/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@marcelorafael/chartjs-plugin-datalabels@0.8.11/dist/@marcelorafael/chartjs-plugin-datalabels.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/*!
 * @marcelorafael/chartjs-plugin-datalabels v0.8.11
 * https://chartjs-plugin-datalabels.netlify.com
 * (c) 2020 Chart.js Contributors
 * Released under the MIT license
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js"],e):(t=t||self).ChartDataLabels=e(t.Chart)}(this,(function(t){"use strict";var e=(t=t&&t.hasOwnProperty("default")?t.default:t).helpers,r=function(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t)return(t.deviceXDPI||1)/(t.logicalXDPI||1)}return 1}(),n={toTextLines:function(t){var r,n=[];for(t=[].concat(t);t.length;)"string"==typeof(r=t.pop())?n.unshift.apply(n,r.split("\n")):Array.isArray(r)?t.push.apply(t,r):e.isNullOrUndef(t)||n.unshift(""+r);return n},toFontString:function(t){return!t||e.isNullOrUndef(t.size)||e.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family},textSize:function(t,e,r){var n,o=[].concat(e),i=o.length,a=t.font,l=0;for(t.font=r.string,n=0;n<i;++n)l=Math.max(t.measureText(o[n]).width,l);return t.font=a,{height:i*r.lineHeight,width:l}},parseFont:function(r){var o=t.defaults.global,i=e.valueOrDefault(r.size,o.defaultFontSize),a={family:e.valueOrDefault(r.family,o.defaultFontFamily),lineHeight:e.options.toLineHeight(r.lineHeight,i),size:i,style:e.valueOrDefault(r.style,o.defaultFontStyle),weight:e.valueOrDefault(r.weight,null),string:""};return a.string=n.toFontString(a),a},bound:function(t,e,r){return Math.max(t,Math.min(e,r))},arrayDiff:function(t,e){var r,n,o,i,a=t.slice(),l=[];for(r=0,o=e.length;r<o;++r)i=e[r],-1===(n=a.indexOf(i))?l.push([i,1]):a.splice(n,1);for(r=0,o=a.length;r<o;++r)l.push([a[r],-1]);return l},rasterize:function(t){return Math.round(t*r)/r}};function o(t,e){var r=e.x,n=e.y;if(null===r)return{x:0,y:-1};if(null===n)return{x:1,y:0};var o=t.x-r,i=t.y-n,a=Math.sqrt(o*o+i*i);return{x:a?o/a:0,y:a?i/a:-1}}function i(t,e,r){var n=0;return t<r.left?n|=1:t>r.right&&(n|=2),e<r.top?n|=8:e>r.bottom&&(n|=4),n}function a(t,e){var r,n,o=e.anchor,a=t;return e.clamp&&(a=function(t,e){for(var r,n,o,a=t.x0,l=t.y0,s=t.x1,u=t.y1,d=i(a,l,e),f=i(s,u,e);d|f&&!(d&f);)8&(r=d||f)?(n=a+(s-a)*(e.top-l)/(u-l),o=e.top):4&r?(n=a+(s-a)*(e.bottom-l)/(u-l),o=e.bottom):2&r?(o=l+(u-l)*(e.right-a)/(s-a),n=e.right):1&r&&(o=l+(u-l)*(e.left-a)/(s-a),n=e.left),r===d?d=i(a=n,l=o,e):f=i(s=n,u=o,e);return{x0:a,x1:s,y0:l,y1:u}}(a,e.area)),"start"===o?(r=a.x0,n=a.y0):"end"===o?(r=a.x1,n=a.y1):(r=(a.x0+a.x1)/2,n=(a.y0+a.y1)/2),function(t,e,r,n,o){switch(o){case"center":r=n=0;break;case"bottom":r=0,n=1;break;case"right":r=1,n=0;break;case"left":r=-1,n=0;break;case"top":r=0,n=-1;break;case"start":r=-r,n=-n;break;case"end":break;default:o*=Math.PI/180,r=Math.cos(o),n=Math.sin(o)}return{x:t,y:e,vx:r,vy:n}}(r,n,t.vx,t.vy,e.align)}var l=function(t,e){var r=(t.startAngle+t.endAngle)/2,n=Math.cos(r),o=Math.sin(r),i=t.innerRadius,l=t.outerRadius;return a({x0:t.x+n*i,y0:t.y+o*i,x1:t.x+n*l,y1:t.y+o*l,vx:n,vy:o},e)},s=function(t,e){var r=o(t,e.origin),n=r.x*t.radius,i=r.y*t.radius;return a({x0:t.x-n,y0:t.y-i,x1:t.x+n,y1:t.y+i,vx:r.x,vy:r.y},e)},u=function(t,e){var r=o(t,e.origin),n=t.x,i=t.y,l=0,s=0;return t.horizontal?(n=Math.min(t.x,t.base),l=Math.abs(t.base-t.x)):(i=Math.min(t.y,t.base),s=Math.abs(t.base-t.y)),a({x0:n,y0:i+s,x1:n+l,y1:i,vx:r.x,vy:r.y},e)},d=function(t,e){var r=o(t,e.origin);return a({x0:t.x,y0:t.y,x1:t.x,y1:t.y,vx:r.x,vy:r.y},e)},f={top:function(t){return t.highest.y=t.highest.y-t.paddings.top,t.highest.y-t.highest.h/2<0?t.highest.h/2-t.highest.y+2:0},right:function(t){return Math.floor(t.rightest.x+t.rightest.w/2)>Math.floor(t.cW)?t.rightest.x+t.rightest.w/2-t.cW+2:0},bottom:function(t){return t.lowest.y=t.lowest.y+t.paddings.bottom,Math.floor(t.lowest.y+t.lowest.h/2)>Math.floor(t.cH)?t.lowest.y+t.lowest.h/2-t.cH+2:0},left:function(t){return t.leftest.x-t.leftest.w/2<0?t.leftest.w/2+Math.abs(t.leftest.x)+2:0}},h=t.helpers,c=n.rasterize;function x(t){var e=t._model.horizontal,r=t._scale||e&&t._xScale||t._yScale;if(!r)return null;if(void 0!==r.xCenter&&void 0!==r.yCenter)return{x:r.xCenter,y:r.yCenter};var n=r.getBasePixel();return e?{x:n,y:null}:{x:null,y:n}}function y(t,e,r){var n=r.backgroundColor,o=r.borderColor,i=r.borderWidth;(n||o&&i)&&(t.beginPath(),h.canvas.roundedRect(t,c(e.x)+i/2,c(e.y)+i/2,c(e.w)-i,c(e.h)-i,r.borderRadius),t.closePath(),n&&(t.fillStyle=n,t.fill()),o&&i&&(t.strokeStyle=o,t.lineWidth=i,t.lineJoin="miter",t.stroke()))}function p(t,e,r){var n=t.shadowBlur,o=r.stroked,i=c(r.x),a=c(r.y),l=c(r.w);o&&t.strokeText(e,i,a,l),r.filled&&(n&&o&&(t.shadowBlur=0),t.fillText(e,i,a,l),n&&o&&(t.shadowBlur=n))}function b(t,e,r,n){var o,i=n.textAlign,a=n.color,l=!!a,s=n.font,u=e.length,d=n.textStrokeColor,f=n.textStrokeWidth,h=d&&f;if(u&&(l||h))for(r=function(t,e,r){var n=r.lineHeight,o=t.w,i=t.x;return"center"===e?i+=o/2:"end"!==e&&"right"!==e||(i+=o),{h:n,w:o,x:i,y:t.y+n/2}}(r,i,s),t.font=s.string,t.textAlign=i,t.textBaseline="middle",t.shadowBlur=n.textShadowBlur,t.shadowColor=n.textShadowColor,l&&(t.fillStyle=a),h&&(t.lineJoin="round",t.lineWidth=f,t.strokeStyle=d),o=0,u=e.length;o<u;++o)p(t,e[o],{stroked:h,filled:l,w:r.w,x:r.x,y:r.y+r.h*o})}var g=function(t,e,r,n){var o=this;o._config=t,o._index=n,o._model=null,o._rects=null,o._ctx=e,o._el=r};h.extend(g.prototype,{_modelize:function(e,r,o,i){var a,f=this,c=f._index,y=h.options.resolve,p=n.parseFont(y([o.font,{}],i,c)),b=y([o.color,t.defaults.global.defaultFontColor],i,c);return{align:y([o.align,"center"],i,c),anchor:y([o.anchor,"center"],i,c),area:i.chart.chartArea,backgroundColor:y([o.backgroundColor,null],i,c),borderColor:y([o.borderColor,null],i,c),borderRadius:y([o.borderRadius,0],i,c),borderWidth:y([o.borderWidth,0],i,c),clamp:y([o.clamp,!1],i,c),clip:y([o.clip,!1],i,c),color:b,display:e,font:p,lines:r,offset:y([o.offset,0],i,c),opacity:y([o.opacity,1],i,c),origin:x(f._el),padding:h.options.toPadding(y([o.padding,0],i,c)),positioner:(a=f._el,a instanceof t.elements.Arc?l:a instanceof t.elements.Point?s:a instanceof t.elements.Rectangle?u:d),rotation:y([o.rotation,0],i,c)*(Math.PI/180),size:n.textSize(f._ctx,r,p),textAlign:y([o.textAlign,"start"],i,c),textShadowBlur:y([o.textShadowBlur,0],i,c),textShadowColor:y([o.textShadowColor,b],i,c),textStrokeColor:y([o.textStrokeColor,b],i,c),textStrokeWidth:y([o.textStrokeWidth,0],i,c)}},update:function(t){var e,r,o,i=this,a=null,l=null,s=i._index,u=i._config,d=h.options.resolve([u.display,!0],t,s);d&&(e=t.dataset.data[s],r=h.valueOrDefault(h.callback(u.formatter,[e,t]),e),(o=h.isNullOrUndef(r)?[]:n.toTextLines(r)).length&&(l=function(t){var e=t.borderWidth||0,r=t.padding,n=t.size.height,o=t.size.width,i=-o/2,a=-n/2;return{frame:{x:i-r.left-e,y:a-r.top-e,w:o+r.width+2*e,h:n+r.height+2*e},text:{x:i,y:a,w:o,h:n}}}(a=i._modelize(d,o,u,t)))),i._model=a,i._rects=l},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(t,e){var r,o=t.ctx,i=this._model,a=this._rects;this.visible()&&(o.save(),i.clip&&(r=i.area,o.beginPath(),o.rect(r.left,r.top,r.right-r.left,r.bottom-r.top),o.clip()),o.globalAlpha=n.bound(0,1,1),o.translate(c(e.x),c(e.y)),o.rotate(i.rotation),y(o,a.frame,i),b(o,i.lines,a.text,i),o.restore())},renderTexts:function(t,e){},originRenderTexts:function(t,e){var r=this._model,o=t.ctx,i=this._rects;o.globalAlpha=n.bound(0,1,1),o.translate(c(e.x),c(e.y)),o.rotate(r.rotation),y(o,i.frame,r),b(o,r.lines,i.text,r),o.restore()}});var v=t.helpers,_=Number.MIN_SAFE_INTEGER||-9007199254740991,m=Number.MAX_SAFE_INTEGER||9007199254740991;function w(t,e,r){var n=Math.cos(r),o=Math.sin(r),i=e.x,a=e.y;return{x:i+n*(t.x-i)-o*(t.y-a),y:a+o*(t.x-i)+n*(t.y-a)}}function k(t,e){var r,n,o,i,a,l=m,s=_,u=e.origin;for(r=0;r<t.length;++r)o=(n=t[r]).x-u.x,i=n.y-u.y,a=e.vx*o+e.vy*i,l=Math.min(l,a),s=Math.max(s,a);return{min:l,max:s}}function M(t,e){var r=e.x-t.x,n=e.y-t.y,o=Math.sqrt(r*r+n*n);return{vx:(e.x-t.x)/o,vy:(e.y-t.y)/o,origin:t,ln:o}}var S=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function $(t,e,r){var n=e.positioner(t,e),o=n.vx,i=n.vy;if(!o&&!i)return{x:n.x,y:n.y};var a=r.w,l=r.h,s=e.rotation,u=Math.abs(a/2*Math.cos(s))+Math.abs(l/2*Math.sin(s)),d=Math.abs(a/2*Math.sin(s))+Math.abs(l/2*Math.cos(s)),f=1/Math.max(Math.abs(o),Math.abs(i));return u*=o*f,d*=i*f,u+=e.offset*o,d+=e.offset*i,{x:n.x+u,y:n.y+d}}v.extend(S.prototype,{center:function(){var t=this._rect;return{x:t.x+t.w/2,y:t.y+t.h/2}},update:function(t,e,r){this._rotation=r,this._rect={x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},contains:function(t){var e=this,r=e._rect;return!((t=w(t,e.center(),-e._rotation)).x<r.x-1||t.y<r.y-1||t.x>r.x+r.w+2||t.y>r.y+r.h+2)},intersects:function(t){var e,r,n,o=this._points(),i=t._points(),a=[M(o[0],o[1]),M(o[0],o[3])];for(this._rotation!==t._rotation&&a.push(M(i[0],i[1]),M(i[0],i[3])),e=0;e<a.length;++e)if(r=k(o,a[e]),n=k(i,a[e]),r.max<n.min||n.max<r.min)return!1;return!0},_points:function(){var t=this,e=t._rect,r=t._rotation,n=t.center();return[w({x:e.x,y:e.y},n,r),w({x:e.x+e.w,y:e.y},n,r),w({x:e.x+e.w,y:e.y+e.h},n,r),w({x:e.x,y:e.y+e.h},n,r)]}});var C={center:{},isRendered:!1,visible:!1,isAdjusted:!1,prepare:function(t){var e,r,n,o,i,a=[];for(e=0,n=t.length;e<n;++e)for(r=0,o=t[e].length;r<o;++r)i=t[e][r],a.push(i),i.$layout={_box:new S,_hidable:!1,_visible:!0,_set:e,_idx:r};return a.sort((function(t,e){var r=t.$layout,n=e.$layout;return r._idx===n._idx?n._set-r._set:n._idx-r._idx})),this.update(a),a},update:function(t){var e,r,n,o,i,a=!1;for(e=0,r=t.length;e<r;++e)o=(n=t[e]).model(),(i=n.$layout)._hidable=o&&"auto"===o.display,i._visible=n.visible(),a|=i._hidable;a&&function(t){var e,r,n,o,i,a;for(e=0,r=t.length;e<r;++e)(o=(n=t[e]).$layout)._visible&&(i=n.geometry(),a=$(n._el._model,n.model(),i),o._box.update(a,i,n.rotation()));(function(t,e){var r,n,o,i;for(r=t.length-1;r>=0;--r)for(o=t[r].$layout,n=r-1;n>=0&&o._visible;--n)(i=t[n].$layout)._visible&&o._box.intersects(i._box)&&e(o,i)})(t,(function(t,e){var r=t._hidable,n=e._hidable;r&&n||n?e._visible=!1:r&&(t._visible=!1)}))}(t)},lookup:function(t,e){var r,n;for(r=t.length-1;r>=0;--r)if((n=t[r].$layout)&&n._visible&&n._box.contains(e))return t[r];return null},draw:function(t,e){var r,n,o,i,a;for(r=0,n=e.length;r<n;++r)(i=(o=e[r]).$layout)._visible&&(a=o.geometry(),o.center=$(o._el._view,o.model(),a),this.center[r]=o.center,i._box.update(o.center,a,o.rotation()),o.draw(t,o.center))},adjustLayout:function(t,e,r,n){if(!t.$datalabels._adjusted){var o={top:0,right:0,bottom:0,left:0},i={h:0,y:0},a={w:0,x:0},l={h:0,y:0},s={w:0,x:0};clearTimeout(t.$datalabels._adjustTimer),t.$datalabels._adjustTimer=setTimeout((function(){for(var n=t.options&&t.options.plugins&&t.options.plugins.datalabels&&t.options.plugins.datalabels.padding?t.options.plugins.datalabels.padding:{},u=0;u<e.length;u++){var d=e[u],h={x:d.center?d.center.x:0,y:d.center?d.center.y:0};(!i.y||h.y<i.y)&&(i.y=h.y,i.h=d.$layout._box._rect.h),(!a.x||h.x>a.x)&&(a.x=h.x,a.w=d.$layout._box._rect.w),(!l.y||h.y>l.y)&&(l.y=h.y,l.h=d.$layout._box._rect.h),(!s.x||h.x<s.x)&&(s.x=h.x,s.w=d.$layout._box._rect.w)}var c={highest:i,rightest:a,lowest:l,leftest:s,paddings:t.options.layout.padding,pT:n.top,pB:n.bottom,cW:t.width,cH:t.height};t.options.plugins.datalabels.debug&&console.debug("data: ",c);var x=f.top(c),y=f.right(c),p=f.bottom(c),b=f.left(c);o.top=0!==x?x:o.top,o.right=0!==y?y:o.bottom,o.bottom=0!==p?p:o.bottom,o.left=0!==b?b:o.left,t.options.plugins.datalabels.debug&&console.debug("paddings: ",o),t.options.layout.padding=o,t.update(),setTimeout(r,t.options.animation.duration/2)}),n),t.$datalabels._adjusted=!0}}},z=t.helpers,A={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:function(t){if(z.isNullOrUndef(t))return null;var e,r,n,o=t;if(z.isObject(t))if(z.isNullOrUndef(t.label))if(z.isNullOrUndef(t.r))for(o="",n=0,r=(e=Object.keys(t)).length;n<r;++n)o+=(0!==n?", ":"")+e[n]+": "+t[e[n]];else o=t.r;else o=t.label;return""+o},labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},O=t.helpers,T="$datalabels",j="$default";function R(t,e,r){if(e){var n,o=r.$context,i=r.$groups;e[i._set]&&(n=e[i._set][i._key])&&!0===O.callback(n,[o])&&(t[T]._dirty=!0,r.update(o))}}function D(t,e){var r,n,o=t[T],i=o._listeners;if(i.enter||i.leave){if("mousemove"===e.type)n=C.lookup(o._labels,e);else if("mouseout"!==e.type)return;r=o._hovered,o._hovered=n,function(t,e,r,n){var o,i;(r||n)&&(r?n?r!==n&&(i=o=!0):i=!0:o=!0,i&&R(t,e.leave,r),o&&R(t,e.enter,n))}(t,i,r,n)}}t.defaults.global.plugins.datalabels=A;var W={id:"datalabels",beforeInit:function(t){t[T]={_actives:[],_rendered:!1,_adjusted:!1}},beforeUpdate:function(t,e){var r=t[T];r._listened=!1,r._listeners={},r._datasets=[],r._labels=[],t[T]._labels=C.prepare(t[T]._datasets,e)},afterDatasetUpdate:function(t,e,r){var n,o,i,a,l,s,u,d,f=e.index,h=t[T],c=h._datasets[f]=[],x=t.isDatasetVisible(f),y=t.data.datasets[f],p=function(t,e){var r,n,o,i=t.datalabels,a=[];return!1===i?null:(!0===i&&(i={}),e=O.merge({},[e,i]),n=e.labels||{},o=Object.keys(n),delete e.labels,o.length?o.forEach((function(t){n[t]&&a.push(O.merge({},[e,n[t],{_key:t}]))})):a.push(e),r=a.reduce((function(t,e){return O.each(e.listeners||{},(function(r,n){t[n]=t[n]||{},t[n][e._key||j]=r})),delete e.listeners,t}),{}),{labels:a,listeners:r})}(y,r),b=e.meta.data||[],v=t.ctx;for(v.save(),n=0,i=b.length;n<i;++n)if((u=b[n])[T]=[],x&&u&&!u.hidden&&!u._model.skip)for(o=0,a=p.labels.length;o<a;++o)s=(l=p.labels[o])._key,(d=new g(l,v,u,n)).$groups={_set:f,_key:s||j},d.$context={active:!1,chart:t,dataIndex:n,dataset:y,datasetIndex:f},d.update(d.$context),u[T].push(d),c.push(d);v.restore(),O.merge(h._listeners,p.listeners,{merger:function(t,r,n){r[t]=r[t]||{},r[t][e.index]=n[t],h._listened=!0}})},afterUpdate:function(t,e){t[T]._labels=C.prepare(t[T]._datasets,e)},afterRender:function(t,e){e.clamp&&C.adjustLayout(t,t.$datalabels._labels,(function(){for(var e=0;e<t.$datalabels._labels.length;e++){t.$datalabels._labels[e].renderTexts(t,C.center[e])}t[T]._rendered=!0}),1e3)},afterDatasetsDraw:function(t){C.draw(t,t[T]._labels)},beforeEvent:function(t,e){if(t[T]._listened)switch(e.type){case"mousemove":case"mouseout":D(t,e);break;case"click":!function(t,e){var r=t[T],n=r._listeners.click,o=n&&C.lookup(r._labels,e);o&&R(t,n,o)}(t,e)}},afterEvent:function(e){var r,o,i,a,l,s,u,d=e[T],f=d._actives,h=d._actives=e.lastActive||[],c=n.arrayDiff(f,h);for(r=0,o=c.length;r<o;++r)if((l=c[r])[1])for(i=0,a=(u=l[0][T]||[]).length;i<a;++i)(s=u[i]).$context.active=1===l[1],s.update(s.$context);(d._dirty||c.length)&&(C.update(d._labels),function(e){if(!e.animating){for(var r=t.animationService.animations,n=0,o=r.length;n<o;++n)if(r[n].chart===e)return;e.render({duration:1,lazy:!0})}}(e)),delete d._dirty},resize:function(t){t[T]._adjusted=!1}};return t.plugins.register(W),W}));
//# sourceMappingURL=/sm/bbb7e1ed736ff1ecf5ab030c8bd8380fb11ff07b3ef8c51871ee327788c0dbd8.map