MeshCentral/public/scripts/charts-min.js

1 line
194 KiB
JavaScript
Raw Normal View History

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,function(){var a=Object.freeze({__proto__:null,get Colors(){return hr},get Decimation(){return ur},get Filler(){return Sr},get Legend(){return Or},get SubTitle(){return Er},get Title(){return Tr},get Tooltip(){return Yr}});function t(){}let F=(()=>{let t=0;return()=>t++})();function P(t){return null==t}function O(t){return!(!Array.isArray||!Array.isArray(t))||"[object"===(t=Object.prototype.toString.call(t)).slice(0,7)&&"Array]"===t.slice(-6)}function A(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function p(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function u(t,e){return p(t)?t:e}function T(t,e){return void 0===t?e:t}let V=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,B=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function c(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function k(t,e,i,a){let s,r,n;if(O(t))if(r=t.length,a)for(s=r-1;0<=s;s--)e.call(i,t[s],s);else for(s=0;s<r;s++)e.call(i,t[s],s);else if(A(t))for(n=Object.keys(t),r=n.length,s=0;s<r;s++)e.call(i,t[n[s]],n[s])}function W(t,e){let i,a,s,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,a=t.length;i<a;++i)if(s=t[i],r=e[i],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function N(e){if(O(e))return e.map(N);if(A(e)){var i=Object.create(null),a=Object.keys(e),s=a.length;let t=0;for(;t<s;++t)i[a[t]]=N(e[a[t]]);return i}return e}function H(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function j(t,e,i,a){var s;H(t)&&(s=e[t],i=i[t],A(s)&&A(i)?Y(s,i,a):e[t]=N(i))}function Y(a,t,s){var e=O(t)?t:[t],i=e.length;if(A(a)){var r,n=(s=s||{}).merger||j;for(let t=0;t<i;++t)if(A(r=e[t])){let i=Object.keys(r);for(let t=0,e=i.length;t<e;++t)n(i[t],a,r,s)}}return a}function $(t,e){return Y(t,e,{merger:U})}function U(t,e,i){var a;H(t)&&(a=e[t],i=i[t],A(a)&&A(i)?$(a,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=N(i)))}let X={"":t=>t,x:t=>t.x,y:t=>t.y};function q(t){var e=t.split("."),i=[];let a="";for(let t of e)a+=t,a=a.endsWith("\\")?a.slice(0,-1)+".":(i.push(a),"");return i}function f(t,e){return(X[e]||(X[e]=function(){let i=q(e);return t=>{for(var e of i){if(""===e)break;t=t&&t[e]}return t}}()))(t)}function K(t){return t.charAt(0).toUpperCase()+t.slice(1)}let G=t=>void 0!==t,g=t=>"function"==typeof t,Z=(t,e)=>{if(t.size!==e.size)return!1;for(var i of t)if(!e.has(i))return!1;return!0};function J(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}let S=Math.PI,v=2*S,Q=v+S,tt=Number.POSITIVE_INFINITY,et=S/180,D=S/2,it=S/4,at=2*S/3,o=Math.log10,_=Math.sign;function st(t,e,i){return Math.abs(t-e)<i}function rt(t){var e=Math.round(t),e=(t=st(t,e,t/1e3)?e:t,Math.pow(10,Math.floor(o(t)))),t=t/e;return(t<=1?1:t<=2?2:t<=5?5:10)*e}function nt(t){var e=[],i=Math.sqrt(t);let a;for(a=1;a<i;a++)t%a==0&&(e.push(a),e.push(t/a));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function ot(t){return!isNaN(parseFloat(t))&&isFinite(t)}function lt(t,e){var i=Math.round(t);return i-e<=t&&t<=i+e}function ht(t,e,i){let a,s,r;for(a=0,s=t.length;a<s;a++)r=t[a][i],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function L(t){return t*(S/180)}function dt(t){return t*(180/S)}function ct(i){if(p(i)){let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}}function ut(t,e){var i=e.x-t.x,e=e.y-t.y,t=Math.sqrt(i*i+e*e);let a=Math.atan2(e,i);return a<-.5*S&&(a+=v),{angle:a,distance:t}}function gt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ft(t,e){return(t-e+Q)%v-S}function x(t){return(t%v+v)%v}function pt(t,e,i,a){var t=x(t),e=x(e),i=x(i),s=x(e-t),r=x(i-t),n=x(t-e),o=x(t-i);return t===e||t===i||a&&e===i||r<s&&n<o}function C(t,e,i){return Math.max(e,Math.min(i,t))}function mt(t){return C(t,-32768,32767)}function d(t,e,i,a=1e-6){return t>=Math.min(e,i)-a&&t<=Math.max(e,i)+a}function bt(e,i,t)