diff --git a/feature/bootstrap5/asset-manifest.json b/feature/bootstrap5/asset-manifest.json index 144596bc..b1a93413 100644 --- a/feature/bootstrap5/asset-manifest.json +++ b/feature/bootstrap5/asset-manifest.json @@ -1,14 +1,14 @@ { "main.css": "/shlink-web-client/feature/bootstrap5/static/css/main.8f098ec9.chunk.css", - "main.js": "/shlink-web-client/feature/bootstrap5/static/js/main.26b42432.chunk.js", - "main.js.map": "/shlink-web-client/feature/bootstrap5/static/js/main.26b42432.chunk.js.map", + "main.js": "/shlink-web-client/feature/bootstrap5/static/js/main.f50f3936.chunk.js", + "main.js.map": "/shlink-web-client/feature/bootstrap5/static/js/main.f50f3936.chunk.js.map", "runtime~main.js": "/shlink-web-client/feature/bootstrap5/static/js/runtime~main.7d3ff180.js", "runtime~main.js.map": "/shlink-web-client/feature/bootstrap5/static/js/runtime~main.7d3ff180.js.map", "static/css/2.04c5acbe.chunk.css": "/shlink-web-client/feature/bootstrap5/static/css/2.04c5acbe.chunk.css", - "static/js/2.a4dfa427.chunk.js": "/shlink-web-client/feature/bootstrap5/static/js/2.a4dfa427.chunk.js", - "static/js/2.a4dfa427.chunk.js.map": "/shlink-web-client/feature/bootstrap5/static/js/2.a4dfa427.chunk.js.map", + "static/js/2.f422478e.chunk.js": "/shlink-web-client/feature/bootstrap5/static/js/2.f422478e.chunk.js", + "static/js/2.f422478e.chunk.js.map": "/shlink-web-client/feature/bootstrap5/static/js/2.f422478e.chunk.js.map", "index.html": "/shlink-web-client/feature/bootstrap5/index.html", "static/css/2.04c5acbe.chunk.css.map": "/shlink-web-client/feature/bootstrap5/static/css/2.04c5acbe.chunk.css.map", "static/css/main.8f098ec9.chunk.css.map": "/shlink-web-client/feature/bootstrap5/static/css/main.8f098ec9.chunk.css.map", - "static/js/2.a4dfa427.chunk.js.LICENSE.txt": "/shlink-web-client/feature/bootstrap5/static/js/2.a4dfa427.chunk.js.LICENSE.txt" + "static/js/2.f422478e.chunk.js.LICENSE.txt": "/shlink-web-client/feature/bootstrap5/static/js/2.f422478e.chunk.js.LICENSE.txt" } \ No newline at end of file diff --git a/feature/bootstrap5/index.html b/feature/bootstrap5/index.html index 59a6edc2..63ff0d08 100644 --- a/feature/bootstrap5/index.html +++ b/feature/bootstrap5/index.html @@ -1 +1 @@ -
0&&e.stroke()}}function st(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x1&&void 0!==arguments[1]?arguments[1]:"x",o=Zt(i),a=e.length,s=Array(a).fill(0),u=Array(a),c=qt(e,0);for(t=0;t0||t>0)&&(!n||!n.shadowRoot)}(s,u,i.target))n=s,r=u;else{var l=t.getBoundingClientRect();n=a.clientX-l.left,r=a.clientY-l.top,c=!0}return{x:n,y:r,box:c}}(e,n),c=u.x,l=u.y,f=u.box,d=a.left+(f&&s.left),p=a.top+(f&&s.top),h=t.width,m=t.height;return o&&(h-=a.width+s.width,m-=a.height+s.height),{x:Math.round((c-d)/h*n.width/r),y:Math.round((l-p)/m*n.height/r)}}var sn=function(e){return Math.round(10*e)/10};function un(e,t,n,r){var i=nn(e),o=on(i,"margin"),a=tn(i.maxWidth,e,"clientWidth")||Z,s=tn(i.maxHeight,e,"clientHeight")||Z,u=function(e,t,n){var r,i;if(void 0===t||void 0===n){var o=en(e);if(o){var a=o.getBoundingClientRect(),s=nn(o),u=on(s,"border","width"),c=on(s,"padding");t=a.width-c.width-u.width,n=a.height-c.height-u.height,r=tn(s.maxWidth,o,"clientWidth"),i=tn(s.maxHeight,o,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:r||Z,maxHeight:i||Z}}(e,t,n),c=u.width,l=u.height;if("content-box"===i.boxSizing){var f=on(i,"border","width"),d=on(i,"padding");c-=d.width+f.width,l-=d.height+f.height}return c=Math.max(0,c-o.width),l=Math.max(0,r?Math.floor(c/r):l-o.height),c=sn(Math.min(c,a,u.maxWidth)),l=sn(Math.min(l,s,u.maxHeight)),c&&!l&&(l=sn(c/2)),{width:c,height:l}}function cn(e,t,n){var r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=i/r,e.width=o/r;var a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height="".concat(e.height,"px"),a.style.width="".concat(e.width,"px")),(e.currentDevicePixelRatio!==r||a.height!==i||a.width!==o)&&(e.currentDevicePixelRatio=r,a.height=i,a.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0)}var ln=function(){var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(n){}return e}();function fn(e,t){var n=function(e,t){return nn(e).getPropertyValue(t)}(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function dn(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function pn(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:"middle"===r?n<.5?e.y:t.y:"after"===r?n<1?e.y:t.y:n>0?t.y:e.y}}function hn(e,t,n,r){var i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},a=dn(e,i,n),s=dn(i,o,n),u=dn(o,t,n),c=dn(a,s,n),l=dn(s,u,n);return dn(c,l,n)}var mn=new Map;function vn(e,t,n){return function(e,t){t=t||{};var n=e+JSON.stringify(t),r=mn.get(n);return r||(r=new Intl.NumberFormat(e,t),mn.set(n,r)),r}(t,n).format(e)}function gn(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}}function yn(e,t){var n,r;"ltr"!==t&&"rtl"!==t||(r=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function bn(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function _n(e){return"angle"===e?{between:le,compare:ue,normalize:ce}:{between:function(e,t,n){return e>=Math.min(t,n)&&e<=Math.max(n,t)},compare:function(e,t){return e-t},normalize:function(e){return e}}}function wn(e){var t=e.start,n=e.end,r=e.count;return{start:t%r,end:n%r,loop:e.loop&&(n-t+1)%r===0,style:e.style}}function xn(e,t,n){if(!n)return[e];for(var r,i,o,a=n.property,s=n.start,u=n.end,c=t.length,l=_n(a),f=l.compare,d=l.between,p=l.normalize,h=function(e,t,n){var r,i,o=n.property,a=n.start,s=n.end,u=_n(o),c=u.between,l=u.normalize,f=t.length,d=e.start,p=e.end,h=e.loop;if(h){for(d+=f,p+=f,r=0,i=f;r0&&void 0!==arguments[0]?arguments[0]:Date.now(),t=this,n=0;t._charts.forEach((function(r,i){if(r.running&&r.items.length){for(var o,a=r.items,s=a.length-1,u=!1;s>=0;--s)(o=a[s])._active?(o._total>r.duration&&(r.duration=o._total),o.tick(e),u=!0):(a[s]=a[a.length-1],a.pop());u&&(i.draw(),t._notify(i,r,e,"progress")),a.length||(r.running=!1,t._notify(i,r,e,"complete"),r.initial=!1),n+=a.length}})),t._lastDate=e,0===n&&(t._running=!1)}},{key:"_getAnims",value:function(e){var t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}},{key:"listen",value:function(e,t,n){this._getAnims(e).listeners[t].push(n)}},{key:"add",value:function(e,t){var n;t&&t.length&&(n=this._getAnims(e).items).push.apply(n,Object(o.a)(t))}},{key:"has",value:function(e){return this._getAnims(e).items.length>0}},{key:"start",value:function(e){var t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((function(e,t){return Math.max(e,t._duration)}),0),this._refresh())}},{key:"running",value:function(e){if(!this._running)return!1;var t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}},{key:"stop",value:function(e){var t=this._charts.get(e);if(t&&t.items.length){for(var n=t.items,r=n.length-1;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}}},{key:"remove",value:function(e){return this._charts.delete(e)}}]),e}()),Cn="transparent",Tn={boolean:function(e,t,n){return n>.5?t:e},color:function(e,t,n){var r=Qe(e||Cn),i=r.valid&&Qe(t||Cn);return i&&i.valid?i.mix(r,n).hexString():t},number:function(e,t,n){return e+(t-e)*n}},Pn=function(){function e(t,n,r,i){Object(m.a)(this,e);var o=n[r];i=Ot([t.to,i,o,t.from]);var a=Ot([t.from,o,i]);this._active=!0,this._fn=t.fn||Tn[t.type||typeof a],this._easing=me[t.easing]||me.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=a,this._to=i,this._promises=void 0}return Object(v.a)(e,[{key:"active",value:function(){return this._active}},{key:"update",value:function(e,t,n){var r=this;if(r._active){r._notify(!1);var i=r._target[r._prop],o=n-r._start,a=r._duration-o;r._start=n,r._duration=Math.floor(Math.max(a,e.duration)),r._total+=o,r._loop=!!e.loop,r._to=Ot([e.to,t,i,e.from]),r._from=Ot([e.from,i,t])}}},{key:"cancel",value:function(){var e=this;e._active&&(e.tick(Date.now()),e._active=!1,e._notify(!1))}},{key:"tick",value:function(e){var t,n=this,r=e-n._start,i=n._duration,o=n._prop,a=n._from,s=n._loop,u=n._to;if(n._active=a!==u&&(s||r1?2-t:t,t=n._easing(Math.min(1,Math.max(0,t))),n._target[o]=n._fn(a,u,t))}},{key:"wait",value:function(){var e=this._promises||(this._promises=[]);return new Promise((function(t,n){e.push({res:t,rej:n})}))}},{key:"_notify",value:function(e){for(var t=e?"res":"rej",n=this._promises||[],r=0;rMath.abs(s)&&(u=s,c=a),t[n.axis]=c,t._custom={barStart:u,barEnd:c,start:i,end:o,min:a,max:s}}(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Zn(e,t,n,r){var i,o,a,s,u=e.iScale,c=e.vScale,l=u.getLabels(),f=u===c,d=[];for(i=n,o=n+r;i0}},{key:"_computeGridLineItems",value:function(e){var t,n,r,i,o,a,s,u,c,l,f,d,p=this,h=p.axis,m=p.chart,v=p.options,g=v.grid,y=v.position,b=g.offset,_=p.isHorizontal(),w=p.ticks.length+(b?1:0),x=ni(g),k=[],O=g.setContext(p.getContext()),M=O.drawBorder?O.borderWidth:0,S=M/2,T=function(e){return it(m,e,M)};if("top"===y)t=T(p.bottom),a=p.bottom-x,u=t-S,l=T(e.top)+S,d=e.bottom;else if("bottom"===y)t=T(p.top),l=e.top,d=T(e.bottom)-S,a=t+S,u=p.top+x;else if("left"===y)t=T(p.right),o=p.right-x,s=t-S,c=T(e.left)+S,f=e.right;else if("right"===y)t=T(p.left),c=e.left,f=T(e.right)-S,o=t+S,s=p.left+x;else if("x"===h){if("center"===y)t=T((e.top+e.bottom)/2+.5);else if(E(y)){var P=Object.keys(y)[0],j=y[P];t=T(p.chart.scales[P].getPixelForValue(j))}l=e.top,d=e.bottom,u=(a=t+S)+x}else if("y"===h){if("center"===y)t=T((e.left+e.right)/2);else if(E(y)){var N=Object.keys(y)[0],D=y[N];t=T(p.chart.scales[N].getPixelForValue(D))}s=(o=t-S)-x,c=e.left,f=e.right}var L=C(v.ticks.maxTicksLimit,w),A=Math.max(1,Math.ceil(w/L));for(n=0;n=a.left&&t<=a.right)&&(o||n>=a.top&&n<=a.bottom)}function eo(e,t){e.rect(t.x,t.y,t.w,t.h)}function to(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+a,radius:e.radius}}Qi.id="point",Qi.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Qi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var no=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(e){var r;return Object(m.a)(this,n),(r=t.call(this)).options=void 0,r.horizontal=void 0,r.base=void 0,r.width=void 0,r.height=void 0,e&&Object.assign(Object(s.a)(r),e),r}return Object(v.a)(n,[{key:"draw",value:function(e){var t,n=this.options,r=Gi(this),i=r.inner,o=r.outer,a=(t=o.radius).topLeft||t.topRight||t.bottomLeft||t.bottomRight?mt:eo,s=.33;e.save(),o.w===i.w&&o.h===i.h||(e.beginPath(),a(e,to(o,s,i)),e.clip(),a(e,to(i,-.33,o)),e.fillStyle=n.borderColor,e.fill("evenodd")),e.beginPath(),a(e,to(i,s,o)),e.fillStyle=n.backgroundColor,e.fill(),e.restore()}},{key:"inRange",value:function(e,t,n){return Ji(this,e,t,n)}},{key:"inXRange",value:function(e,t){return Ji(this,e,null,t)}},{key:"inYRange",value:function(e,t){return Ji(this,null,e,t)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","base","horizontal"],e),n=t.x,r=t.y,i=t.base,o=t.horizontal;return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}},{key:"getRange",value:function(e){return"x"===e?this.width/2:this.height/2}}]),n}(Kr);no.id="bar",no.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},no.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var ro=Object.freeze({__proto__:null,ArcElement:zi,LineElement:Zi,PointElement:Qi,BarElement:no});function io(e){if(e._decimated){var t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{value:t})}}function oo(e){e.data.datasets.forEach((function(e){io(e)}))}var ao={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:function(e,t,n){if(n.enabled){var r=e.width;e.data.datasets.forEach((function(t,i){var o=t._data,s=t.indexAxis,u=e.getDatasetMeta(i),c=o||t.data;if("y"!==Ot([s,e.options.indexAxis])&&"line"===u.type){var l=e.scales[u.xAxisID];if(("linear"===l.type||"time"===l.type)&&!e.options.parsing){var f=function(e,t){var n=t.length,r=0,i=e.iScale,o=i.getUserBounds(),a=o.min,s=o.max,u=o.minDefined,c=o.maxDefined;return u&&(r=fe(Mt(t,i.axis,a).lo,0,n-1)),{start:r,count:c?fe(Mt(t,i.axis,s).hi+1,r,n)-r:n-r}}(u,c),d=f.start,p=f.count;if(p<=(n.threshold||4*r))io(t);else{var h;switch(k(o)&&(t._data=c,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),n.algorithm){case"lttb":h=function(e,t,n,r,i){var o=i.samples||r;if(o>=n)return e.slice(t,t+n);var a,s,u,c,l,f=[],d=(n-2)/(o-2),p=0,h=t+n-1,m=t;for(f[p++]=e[m],a=0;ae;t--){var r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function fo(e){var t=e.chart,n=e.scale,r=e.index,i=e.line,o=[],a=i.segments,s=i.points,u=function(e,t){for(var n=[],r=e.getSortedVisibleDatasetMetas(),i=0;i=0;--a){var s=i[a].$filler;s&&(s.line.updateControlPoints(o,s.axis),r&&Oo(e.ctx,s,o))}},beforeDatasetsDraw:function(e,t,n){if("beforeDatasetsDraw"===n.drawTime)for(var r=e.getSortedVisibleDatasetMetas(),i=r.length-1;i>=0;--i){var o=r[i].$filler;o&&Oo(e.ctx,o,e.chartArea)}},beforeDatasetDraw:function(e,t,n){var r=t.meta.$filler;r&&!1!==r.fill&&"beforeDatasetDraw"===n.drawTime&&Oo(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Mo=function(e,t){var n=e.boxHeight,r=void 0===n?t:n,i=e.boxWidth,o=void 0===i?t:i;return e.usePointStyle&&(r=Math.min(r,t),o=Math.min(o,t)),{boxWidth:o,boxHeight:r,itemHeight:Math.max(t,r)}},So=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(e){var r;return Object(m.a)(this,n),(r=t.call(this))._added=!1,r.legendHitBoxes=[],r._hoveredItem=null,r.doughnutMode=!1,r.chart=e.chart,r.options=e.options,r.ctx=e.ctx,r.legendItems=void 0,r.columnSizes=void 0,r.lineWidths=void 0,r.maxHeight=void 0,r.maxWidth=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.height=void 0,r.width=void 0,r._margins=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return Object(v.a)(n,[{key:"update",value:function(e,t,n){var r=this;r.maxWidth=e,r.maxHeight=t,r._margins=n,r.setDimensions(),r.buildLabels(),r.fit()}},{key:"setDimensions",value:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=e._margins.left,e.right=e.width):(e.height=e.maxHeight,e.top=e._margins.top,e.bottom=e.height)}},{key:"buildLabels",value:function(){var e=this,t=e.options.labels||{},n=P(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter((function(n){return t.filter(n,e.chart.data)}))),t.sort&&(n=n.sort((function(n,r){return t.sort(n,r,e.chart.data)}))),e.options.reverse&&n.reverse(),e.legendItems=n}},{key:"fit",value:function(){var e=this,t=e.options,n=e.ctx;if(t.display){var r,i,o=t.labels,a=kt(o.font),s=a.size,u=e._computeTitleHeight(),c=Mo(o,s),l=c.boxWidth,f=c.itemHeight;n.font=a.string,e.isHorizontal()?(r=e.maxWidth,i=e._fitRows(u,s,l,f)+10):(i=e.maxHeight,r=e._fitCols(u,s,l,f)+10),e.width=Math.min(r,t.maxWidth||e.maxWidth),e.height=Math.min(i,t.maxHeight||e.maxHeight)}else e.width=e.height=0}},{key:"_fitRows",value:function(e,t,n,r){var i=this,o=i.ctx,a=i.maxWidth,s=i.options.labels.padding,u=i.legendHitBoxes=[],c=i.lineWidths=[0],l=r+s,f=e;o.textAlign="left",o.textBaseline="middle";var d=-1,p=-l;return i.legendItems.forEach((function(e,i){var h=n+t/2+o.measureText(e.text).width;(0===i||c[c.length-1]+h+2*s>a)&&(f+=l,c[c.length-(i>0?0:1)]=0,p+=l,d++),u[i]={left:0,top:p,row:d,width:h,height:r},c[c.length-1]+=h+s})),f}},{key:"_fitCols",value:function(e,t,n,r){var i=this,o=i.ctx,a=i.maxHeight,s=i.options.labels.padding,u=i.legendHitBoxes=[],c=i.columnSizes=[],l=a-e,f=s,d=0,p=0,h=0,m=0;return i.legendItems.forEach((function(e,i){var a=n+t/2+o.measureText(e.text).width;i>0&&p+r+2*s>l&&(f+=d+s,c.push({width:d,height:p}),h+=d+s,m++,d=p=0),u[i]={left:h,top:p,col:m,width:a,height:r},d=Math.max(d,a),p+=r+s})),f+=d,c.push({width:d,height:p}),f}},{key:"adjustHitBoxes",value:function(){var e=this;if(e.options.display){var t=e._computeTitleHeight(),n=e.legendHitBoxes,r=e.options,i=r.align,o=r.labels.padding,a=gn(r.rtl,e.left,e.width);if(this.isHorizontal()){var s,u=0,c=_(i,e.left+o,e.right-e.lineWidths[u]),l=Object(h.a)(n);try{for(l.s();!(s=l.n()).done;){var f=s.value;u!==f.row&&(u=f.row,c=_(i,e.left+o,e.right-e.lineWidths[u])),f.top+=e.top+t+o,f.left=a.leftForLtr(a.x(c),f.width),c+=f.width+o}}catch(y){l.e(y)}finally{l.f()}}else{var d,p=0,m=_(i,e.top+t+o,e.bottom-e.columnSizes[p].height),v=Object(h.a)(n);try{for(v.s();!(d=v.n()).done;){var g=d.value;g.col!==p&&(p=g.col,m=_(i,e.top+t+o,e.bottom-e.columnSizes[p].height)),g.top=m,g.left+=e.left+o,g.left=a.leftForLtr(a.x(g.left),g.width),m+=g.height+o}}catch(y){v.e(y)}finally{v.f()}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){var e=this;if(e.options.display){var t=e.ctx;ut(t,e),e._draw(),ct(t)}}},{key:"_draw",value:function(){var e,t=this,n=t.options,r=t.columnSizes,i=t.lineWidths,o=t.ctx,a=n.align,s=n.labels,u=tt.color,c=gn(n.rtl,t.left,t.width),l=kt(s.font),f=s.color,d=s.padding,p=l.size,h=p/2;t.drawTitle(),o.textAlign=c.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=l.string;var m=Mo(s,p),v=m.boxWidth,g=m.boxHeight,y=m.itemHeight,b=t.isHorizontal(),w=this._computeTitleHeight();e=b?{x:_(a,t.left+d,t.right-i[0]),y:t.top+d+w,line:0}:{x:t.left+d,y:_(a,t.top+w+d,t.bottom-r[0].height),line:0},yn(t.ctx,n.textDirection);var x=y+d;t.legendItems.forEach((function(m,k){o.strokeStyle=m.fontColor||f,o.fillStyle=m.fontColor||f;var O=o.measureText(m.text).width,E=c.textAlign(m.textAlign||(m.textAlign=s.textAlign)),M=v+h+O,S=e.x,T=e.y;c.setWidth(t.width),b?k>0&&S+M+d>t.right&&(T=e.y+=x,e.line++,S=e.x=_(a,t.left+d,t.right-i[e.line])):k>0&&T+x>t.bottom&&(S=e.x=S+r[e.line].width+d,e.line++,T=e.y=_(a,t.top+w+d,t.bottom-r[e.line].height)),function(e,t,n){if(!(isNaN(v)||v<=0||isNaN(g)||g<0)){o.save();var r=C(n.lineWidth,1);if(o.fillStyle=C(n.fillStyle,u),o.lineCap=C(n.lineCap,"butt"),o.lineDashOffset=C(n.lineDashOffset,0),o.lineJoin=C(n.lineJoin,"miter"),o.lineWidth=r,o.strokeStyle=C(n.strokeStyle,u),o.setLineDash(C(n.lineDash,[])),s.usePointStyle){var i={radius:v*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},a=c.xPlus(e,v/2);at(o,i,a,t+h)}else{var l=t+Math.max((p-g)/2,0),f=c.leftForLtr(e,v),d=wt(n.borderRadius);o.beginPath(),Object.values(d).some((function(e){return 0!==e}))?mt(o,{x:f,y:l,w:v,h:g,radius:d}):o.rect(f,l,v,g),o.fill(),0!==r&&o.stroke()}o.restore()}}(c.x(S),T,m),S=function(e,t,n,r){return e===(r?"left":"right")?n:"center"===e?(t+n)/2:t}(E,S+v+h,b?S+M:t.right,n.rtl),function(e,t,n){dt(o,n.text,e,t+y/2,l,{strikethrough:n.hidden,textAlign:c.textAlign(n.textAlign)})}(c.x(S),T,m),b?e.x+=M+d:e.y+=x})),bn(t.ctx,n.textDirection)}},{key:"drawTitle",value:function(){var e=this,t=e.options,n=t.title,r=kt(n.font),i=xt(n.padding);if(n.display){var a,s=gn(t.rtl,e.left,e.width),u=e.ctx,c=n.position,l=r.size/2,f=i.top+l,d=e.left,p=e.width;if(this.isHorizontal())p=Math.max.apply(Math,Object(o.a)(e.lineWidths)),a=e.top+f,d=_(t.align,d,e.right-p);else{var h=e.columnSizes.reduce((function(e,t){return Math.max(e,t.height)}),0);a=f+_(t.align,e.top,e.bottom-h-t.labels.padding-e._computeTitleHeight())}var m=_(c,d,d+p);u.textAlign=s.textAlign(b(c)),u.textBaseline="middle",u.strokeStyle=n.color,u.fillStyle=n.color,u.font=r.string,dt(u,n.text,m,a,r)}}},{key:"_computeTitleHeight",value:function(){var e=this.options.title,t=kt(e.font),n=xt(e.padding);return e.display?t.lineHeight+n.height:0}},{key:"_getLegendItemAt",value:function(e,t){var n,r,i,o=this;if(e>=o.left&&e<=o.right&&t>=o.top&&t<=o.bottom)for(i=o.legendHitBoxes,n=0;n=0&&(t[o].major=!0);return t}(e,o,a,n):o}var ga=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(e){var r;return Object(m.a)(this,n),(r=t.call(this,e))._cache={data:[],labels:[],all:[]},r._unit="day",r._majorUnit=void 0,r._offsets={},r._normalized=!1,r._parseOpts=void 0,r}return Object(v.a)(n,[{key:"init",value:function(e,t){var r=e.time||(e.time={}),i=this._adapter=new cr._date(e.adapters.date);I(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},c(Object(u.a)(n.prototype),"init",this).call(this,e),this._normalized=t.normalized}},{key:"parse",value:function(e,t){return void 0===e?null:pa(this,e)}},{key:"beforeLayout",value:function(){c(Object(u.a)(n.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var e=this,t=e.options,n=e._adapter,r=t.time.unit||"day",i=e.getUserBounds(),o=i.min,a=i.max,s=i.minDefined,u=i.maxDefined;function c(e){s||isNaN(e.min)||(o=Math.min(o,e.min)),u||isNaN(e.max)||(a=Math.max(a,e.max))}s&&u||(c(e._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||c(e.getMinMax(!1))),o=M(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),a=M(a)&&!isNaN(a)?a:+n.endOf(Date.now(),r)+1,e.min=Math.min(o,a-1),e.max=Math.max(o+1,a)}},{key:"_getLabelBounds",value:function(){var e=this.getLabelTimestamps(),t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}},{key:"buildTicks",value:function(){var e=this,t=e.options,n=t.time,r=t.ticks,i="labels"===r.source?e.getLabelTimestamps():e._generate();"ticks"===t.bounds&&i.length&&(e.min=e._userMin||i[0],e.max=e._userMax||i[i.length-1]);var o=e.min,a=function(e,t,n){for(var r=0,i=e.length;rr&&e[i-1]>n;)i--;return r>0||is&&(n=s-u),o=n;o>=0;o--){for(var f=!0,d=0;di&&(r=i):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;ai)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i