2 lines
56 KiB
JavaScript
2 lines
56 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["main~workouts"],{"00fd":function(t,e,n){var r=n("9e69"),o=Object.prototype,c=o.hasOwnProperty,u=o.toString,a=r?r.toStringTag:void 0;function i(t){var e=c.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(i){}var o=u.call(t);return r&&(e?t[a]=n:delete t[a]),o}t.exports=i},"03dd":function(t,e,n){var r=n("eac5"),o=n("57a5"),c=Object.prototype,u=c.hasOwnProperty;function a(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))u.call(t,n)&&"constructor"!=n&&e.push(n);return e}t.exports=a},"0644":function(t,e,n){var r=n("3818"),o=1,c=4;function u(t){return r(t,o|c)}t.exports=u},"07c7":function(t,e){function n(){return!1}t.exports=n},"0801":function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.defineChartComponent=void 0;const o=n("9b4a"),c=n("72dd"),u=r(n("e740")),a=r(n("bba4")),i=r(n("0644")),f=r(n("63ea"));(0,c.install)();const s=n("e1bd"),d=t=>(0,u.default)((0,a.default)(t)).replace(/ /g,""),l=(t,e)=>{const n={options:{type:Object,required:!1},chartId:{default:t,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:()=>[]},chartData:{type:Object,required:!0},onLabelsUpdate:{type:Function},onChartUpdate:{type:Function},onChartDestroy:{type:Function},onChartRender:{type:Function}},r=d(t);return(0,c.defineComponent)({name:r,props:n,emits:{"labels:update":()=>!0,"chart:update":t=>!0,"chart:destroy":t=>!0,"chart:render":()=>!0},setup(n,{emit:u}){const a=(0,c.ref)(),d=`${t}-${(0,s.nanoid)(6)}`;let l=(0,c.shallowRef)(null);function p(t,e){if(e){let n=l.value,r=t.datasets.map(t=>t.label),o=e.datasets.map(t=>t.label);const c=JSON.stringify(o),u=JSON.stringify(r);u===c&&e.datasets.length===t.datasets.length&&n?(t.datasets.forEach((t,r)=>{const o=Object.keys(e.datasets[r]),c=Object.keys(t),u=o.filter(t=>"_meta"!==t&&-1===c.indexOf(t));u.forEach(t=>{(null===n||void 0===n?void 0:n.data.datasets[r])&&delete n.data.datasets[r][t]});for(const e in t){const o=t[e];t.hasOwnProperty(e)&&o&&n&&(n.data.datasets[r][e]=o)}}),t.hasOwnProperty("labels")&&(n.data.labels=t.labels,v()),y()):(n&&g(),h())}else l.value&&g(),h()}function h(){a.value?(l.value=new o.Chart(a.value,{data:n.chartData,type:e,options:(0,i.default)(n.options),plugins:n.plugins}),b()):console.error(`Error on component ${r}, canvas cannot be rendered. Check if the render appends server-side`)}function v(){var t;u("labels:update"),null===(t=n.onLabelsUpdate)||void 0===t||t.call(n)}function b(){var t;l.value&&(u("chart:render",l.value),null===(t=n.onChartRender)||void 0===t||t.call(n,l.value))}function y(){var t;l.value&&(l.value.update(),u("chart:render",l.value),null===(t=n.onChartRender)||void 0===t||t.call(n,l.value))}function g(){var t,e;null===(t=l.value)||void 0===t||t.destroy(),u("chart:destroy"),null===(e=n.onChartDestroy)||void 0===e||e.call(n)}return(0,c.watch)(()=>n.chartData,p,{deep:!0}),(0,c.watch)(()=>n.options,(t,e)=>{l.value&&t&&!(0,f.default)(l.value.options,e)&&(l.value.options=(0,i.default)(t),e=(0,i.default)(t),y())},{deep:!0}),(0,c.onMounted)(h),(0,c.onBeforeUnmount)(()=>{var t;l.value&&(null===(t=l.value)||void 0===t||t.destroy())}),{canvasRef:a,renderChart:h,chartInstance:l,canvasId:d}},render(){return(0,c.h)("div",{style:{maxWidth:"100%",...this.styles,position:"relative"},class:this.cssClasses},[(0,c.h)("canvas",{style:{maxWidth:"100%",maxHeight:"100%"},...c.isVue2&&{attrs:{id:this.canvasId,width:this.width,height:this.height}},...c.isVue3&&{id:this.canvasId,width:this.width,height:this.height},ref:"canvasRef"})])}})};e.defineChartComponent=l},"087d":function(t,e){function n(t,e){var n=-1,r=e.length,o=t.length;while(++n<r)t[o+n]=e[n];return t}t.exports=n},"0b07":function(t,e,n){var r=n("34ac"),o=n("3698");function c(t,e){var n=o(t,e);return r(n)?n:void 0}t.exports=c},"0d24":function(t,e,n){(function(t){var r=n("2b3e"),o=n("07c7"),c=e&&!e.nodeType&&e,u=c&&"object"==typeof t&&t&&!t.nod
|
||
|
//# sourceMappingURL=main~workouts.a74990d7.js.map
|