(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["dashboardActivityConversion~dashboardActivityOrder~dashboardActivityRevenue~dashboardActivityVisit"],{"060a":function(t,e,a){"use strict";a("8e94")},"0812":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.loading?a("BarChartSkeleton",{key:"chart-skeleton"}):t.loading||t.hasDatas?a("LineChart",{key:"chart",attrs:{labels:t.labels,datasets:t.computedDatasets,color:t.color,"hover-color":t.hoverColor,"is-gradient":t.isGradient,title:t.title,"choice-tab":t.choiceTab,granularity:t.granularity,"short-cut-date":t.shortCutDate,"is-numeric":t.isNumeric,width:740}}):a("NoData",{key:"chart-no-data"})],1)},o=[],i=(a("d81d"),a("99af"),a("c1df")),r=(a("a9e3"),a("b680"),a("b0c0"),a("1fca")),l=a("c583"),s=a("30ef"),d=a.n(s),c=a("a9be"),u=a.n(c); /** * 2007-2020 PrestaShop and Contributors * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License 3.0 (AFL-3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/AFL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * @author PrestaShop SA * @copyright 2007-2020 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) * International Registered Trademark & Property of PrestaShop SA */ d.a.plugins.unregister(u.a);var h="#FFFFFF",f={aspectRatio:4/3,tooltips:!1,layout:{padding:{bottom:25,right:50,left:25,top:50}},elements:{line:{fill:!1}},hover:{mode:"index",intersect:!1},legend:{display:!0,position:"bottom",align:"start",onClick:function(){}},plugins:{}},b=function(t){var e,a,n,o,i,r,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2?arguments[2]:void 0,d=arguments.length>3?arguments[3]:void 0,c=Math.round(100*s)/100,u=Number(c);return r=null!==(e=d.chart)&&void 0!==e&&null!==(a=e.chart)&&void 0!==a&&null!==(n=a.config)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(i=o.labels)&&void 0!==i&&i.lengh?"".concat(d.chart.chart.config.data.labels[d.dataIndex]):"".concat(t[d.dataIndex]),l&&(u="".concat(this.$i18n.n(Number(c).toFixed(2),"currency"))),d.active?"".concat(r,"\n").concat(u):""},p={name:"line-chart",extends:r["c"],props:["labels","datasets","data","color","extraOptions","title","isNumeric"],mounted:function(){this.addPlugin(u.a),this.render()},methods:{updateState:function(t,e){this[e]=t,this.render()},render:function(){var t,e,a,n,o,i,r="#f96332";Object(l["c"])(this.color)&&(this.color=Object(l["d"])(this.color));var s=this.color||r,d=document.getElementById(this.chartId).getContext("2d"),c=d.createLinearGradient(500,0,100,0);c.addColorStop(0,s),c.addColorStop(1,h);var u=d.createLinearGradient(0,170,0,50);u.addColorStop(0,"rgba(128, 182, 244, 0)"),u.addColorStop(1,Object(l["b"])(s,.4));var p=Object.assign(f,this.extraOptions||{});p.plugins.datalabels={backgroundColor:function(t){return t.active?t.dataset.backgroundColor:"white"},borderColor:function(t){return t.dataset.borderColor},borderRadius:function(t){return t.active?0:32},borderWidth:1,color:function(t){return t.active?"white":t.dataset.backgroundColor},font:{weight:"bold"},offset:8,textAlign:"center"};var v=JSON.parse(JSON.stringify(this.datasets));v&&null!==(t=v[0])&&void 0!==t&&null!==(e=t.datalabels)&&void 0!==e&&null!==(a=e.labels)&&void 0!==a&&a.name&&(v[0].datalabels.labels.name.formatter=b.bind(this,this.labels[0],this.isNumeric),v[0].datalabels.labels.name.display=function(t){return t.active}),v&&null!==(n=v[1])&&void 0!==n&&null!==(o=n.datalabels)&&void 0!==o&&null!==(i=o.labels)&&void 0!==i&&i.name&&(v[1].datalabels.labels.name.formatter=b.bind(this,this.labels[1],this.isNumeric),v[1].datalabels.labels.name.display=function(t){return t.active}),this.renderChart({labels:this.labels[0]||[],datasets:v||[{label:this.title||"",borderColor:s,pointBorderColor:"#FFF",pointBackgroundColor:s,pointBorderWidth:2,pointHoverRadius:4,pointHoverBorderWidth:1,pointRadius:4,fill:!0,backgroundColor:u,borderWidth:2,data:this.data||[]}]},p)}},watch:{labels:function(t){this.updateState(t,"labels")},data:function(t){this.updateState(t,"data")},isGradient:function(t){this.updateState(t,"isGradient")},color:function(t){this.updateState(t,"color")},title:function(t){this.updateState(t,"title")},datasets:function(t){this.updateState(t,"datasets")}}},v=a("19a3"),y=a("110c"),g={components:{LineChart:p,BarChartSkeleton:v["a"],NoData:y["a"]},props:{granularity:{type:String,default:"day"},loading:{type:Boolean,default:!0},dataSets:{type:Object,required:!0},keyId:{type:String,default:"revenues"},shortCutDate:{type:String,default:"7days"},choiceTab:{type:String,default:"revenues"},isNumeric:{type:Boolean,default:!1}},methods:{updateData:function(t,e){this[e]=t}},data:function(){return{isGradient:!1,color:"#34219e",title:" ",hoverColor:"#FF0076"}},watch:{loading:function(t){this.updateData(t,"loading")},choiceTab:function(t){this.updateData(t,"choiceTab")}},computed:{labels:function(){var t,e=this;return t=this.dataSets.previous?[this.dataSets.actual[1],this.dataSets.previous[1]]:[this.dataSets.actual[1]],t=t.map((function(t){return"hours"===e.granularity?t.map((function(t){return i(t).format("hh A")})):"weeks"===e.granularity?t.map((function(t){return"".concat(e.$i18n.t("tabsBody.dates.week")," ").concat(t)})):"months"===e.granularity?t.map((function(t){return"".concat(e.$i18n.t("tabsBody.dates.month")," ").concat(t)})):t})),t},computedDatasets:function(){var t={label:"Active period",borderColor:"#34219E",backgroundColor:"#34219E",fill:!1,data:this.dataSets.actual[0],datalabels:{labels:{name:{font:{size:16}}},align:"top",anchor:"top",clamp:!0}},e={label:"Previous period",data:this.dataSets.previous[0],borderColor:"#D2CCF5",backgroundColor:"#D2CCF5",fill:!1,datalabels:{labels:{name:{font:{size:16}}},align:"bottom",anchor:"bottom",clamp:!0}};return this.$store.getters.getCompareMode?[t,e]:[t]},hasDatas:function(){var t=function(t){return t.data.every((function(t){return 0===t}))};return!(!this.computedDatasets[1]&&t(this.computedDatasets[0]))&&!(this.computedDatasets[1]&&t(this.computedDatasets[0])&&t(this.computedDatasets[1]))},hasDatasToCompare:function(t){var e=function(t){return t.data.every((function(t){return 0===t}))};return!t||!e(t)}}},x=g,m=a("2877"),_=Object(m["a"])(x,n,o,!1,null,"62b06693",null);e["a"]=_.exports},"3b95":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,'.bg-horizontal-bar{display:flex;flex-direction:column;align-items:center}.legend{position:relative;top:-200px;left:100%}.legend ul{list-style:none!important}.legend ul li:before{content:"\\2022"!important;color:var(--bubble-color)!important;font-weight:700;display:inline-block;width:1em;font-size:2em;margin-left:-1em;vertical-align:sub}.legend ul li span{margin-left:-10px;vertical-align:text-bottom}.legend ul li i{vertical-align:initial!important}',""]),t.exports=e},"896f":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"tw-text-base tw-font-bold tw-text-center tw-py-4"},[t._v(" "+t._s(t.title)+" ")]),t.loading?a("BarChartSkeleton"):!t.loading&&t.data.every((function(t){return 0===t}))?a("NoData"):a("PieChart",{staticStyle:{"margin-top":"2%"},attrs:{title:t.title,labels:t.labels,data:t.data,width:320,height:220,"choice-tab":t.choiceTab,"legend-callback":t.legendCallback,"label-callback":t.labelCallback,"use-inline-label":t.useInlineLabel},on:{generated:t.setLegend}}),t.loading||t.data.every((function(t){return 0===t}))?t._e():a("div",{staticClass:"legend",domProps:{innerHTML:t._s(t.message)}})],1)},o=[],i=(a("13d5"),a("a9e3"),a("99af"),a("a15b"),a("1276"),a("ac1f"),a("b680"),a("1fca")),r=a("c583"),l=a("a9be"),s=a.n(l),d={maintainAspectRatio:!1,legend:{display:!1,position:"right",align:"start",onClick:function(t){return t.stopPropagation()}},tooltips:{bodySpacing:4,xPadding:10,yPadding:10,caretPadding:10},responsive:!0,layout:{padding:{left:0,right:0,top:15,bottom:15}},plugins:{datalabels:{color:"white",display:function(t){var e=t.dataset.data.reduce((function(t,e){return t+Number(e)}),0),a=t.dataset.data[t.dataIndex]/e*100;return a>10},labels:{value:{anchor:"center",color:function(t){return t.dataset.backgroundColor},backgroundColor:"white",borderColor:"white",borderWidth:2,borderRadius:4,font:{weight:"bold"}}}}}},c={name:"pie-chart",extends:i["d"],props:["labels","datasets","data","extraOptions","title","hoverColor","choiceTab","labelCallback","legendCallback","useInlineLabel"],data:function(){return{color:[]}},mounted:function(){this.useInlineLabel&&this.addPlugin(s.a),this.render();var t=this.$data._chart.generateLegend();this.$emit("generated",t)},methods:{render:function(){var t=this;(!this.color||0===this.color.length||this.color.length");for(var i=0;i')),e.data.labels[i]&&("sessions"===t.choiceTab.toLowerCase()?a.push(''.concat(e.data.labels[i]," ").concat(Number(e.data.datasets[0].data[i]/n*100).toFixed(2),' %\n info_outlined\n ').concat(t.$t("tabsBody.visits.".concat(e.data.labels[i].toLowerCase().split(" ").join("_"))),"\n ")):a.push(''.concat(t.$t("tabsBody.conversionRate.".concat(e.data.labels[i].toLowerCase().split(" ").join("_")))," ").concat(t.$n(e.data.datasets[0].data[i],"currency"),'\n info_outlined\n ').concat(t.$t("tabsBody.conversionRate.".concat(e.data.labels[i].toLowerCase().split(" ").join("_"),"Tooltip")),"\n "))),a.push("");return a.push(""),a.join("")};this.useInlineLabel,e.tooltips.callbacks={label:this.labelCallback||a},e.legendCallback=this.legendCallback||n;var o={labels:this.labels||[],datasets:this.datasets?this.datasets:[{label:this.title||"",backgroundColor:this.color,hoverBackgroundColor:this.color,borderWidth:1,data:this.data||[]}]};this.renderChart(o,e)},updateState:function(t,e){this[e]=t,this.render()}},watch:{labels:function(t){this.updateState(t,"labels")},data:function(t){this.updateState(t,"data")},title:function(t){this.updateState(t,"title")},hoverColor:function(t){this.updateState(t,"hoverColor")},choiceTab:function(t){this.updateState(t,"choiceTab")}}},u=a("19a3"),h=a("110c"),f={components:{PieChart:c,BarChartSkeleton:u["a"],NoData:h["a"]},props:{loading:{type:Boolean,default:!0},data:{type:Array,default:function(){return[]}},labels:{type:Array,default:function(){return[]}},title:{type:String,default:"Traffic per Channel"},choiceTab:{type:String,default:"visits"},legendCallback:{type:Function,default:null},labelCallback:{type:Function,default:null},useInlineLabel:{type:Boolean,default:!1}},data:function(){return{isGradient:!1,color:"#34219e",hoverColor:"#FF0076",message:""}},methods:{updateData:function(t,e){this[e]=t},setLegend:function(t){this.message=t}},watch:{data:function(t){this.updateData(t,"data")},labels:function(t){this.updateData(t,"labels")}}},b=f,p=(a("060a"),a("2877")),v=Object(p["a"])(b,n,o,!1,null,null,null);e["a"]=v.exports},"8e94":function(t,e,a){var n=a("3b95");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var o=a("499e").default;o("0ad149bc",n,!0,{sourceMap:!1,shadowMode:!1})},a9be:function(t,e,a){ /*! * chartjs-plugin-datalabels v0.7.0 * https://chartjs-plugin-datalabels.netlify.com * (c) 2019 Chart.js Contributors * Released under the MIT license */ (function(e,n){t.exports=n(a("30ef"))})(0,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t["default"]:t;var e=t.helpers,a=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 a,n=[];t=[].concat(t);while(t.length)a=t.pop(),"string"===typeof a?n.unshift.apply(n,a.split("\n")):Array.isArray(a)?t.push.apply(t,a):e.isNullOrUndef(t)||n.unshift(""+a);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,a){var n,o=[].concat(e),i=o.length,r=t.font,l=0;for(t.font=a.string,n=0;na.right&&(n|=s),ea.bottom&&(n|=d),n}function h(t,e){var a,n,o,i=t.x0,r=t.y0,h=t.x1,f=t.y1,b=u(i,r,e),p=u(h,f,e);while(1){if(!(b|p)||b&p)break;a=b||p,a&c?(n=i+(h-i)*(e.top-r)/(f-r),o=e.top):a&d?(n=i+(h-i)*(e.bottom-r)/(f-r),o=e.bottom):a&s?(o=r+(f-r)*(e.right-i)/(h-i),n=e.right):a&l&&(o=r+(f-r)*(e.left-i)/(h-i),n=e.left),a===b?(i=n,r=o,b=u(i,r,e)):(h=n,f=o,p=u(h,f,e))}return{x0:i,x1:h,y0:r,y1:f}}function f(t,e){var a,n,o=e.anchor,r=t;return e.clamp&&(r=h(r,e.area)),"start"===o?(a=r.x0,n=r.y0):"end"===o?(a=r.x1,n=r.y1):(a=(r.x0+r.x1)/2,n=(r.y0+r.y1)/2),i(a,n,t.vx,t.vy,e.align)}var b={arc:function(t,e){var a=(t.startAngle+t.endAngle)/2,n=Math.cos(a),o=Math.sin(a),i=t.innerRadius,r=t.outerRadius;return f({x0:t.x+n*i,y0:t.y+o*i,x1:t.x+n*r,y1:t.y+o*r,vx:n,vy:o},e)},point:function(t,e){var a=o(t,e.origin),n=a.x*t.radius,i=a.y*t.radius;return f({x0:t.x-n,y0:t.y-i,x1:t.x+n,y1:t.y+i,vx:a.x,vy:a.y},e)},rect:function(t,e){var a=o(t,e.origin),n=t.x,i=t.y,r=0,l=0;return t.horizontal?(n=Math.min(t.x,t.base),r=Math.abs(t.base-t.x)):(i=Math.min(t.y,t.base),l=Math.abs(t.base-t.y)),f({x0:n,y0:i+l,x1:n+r,y1:i,vx:a.x,vy:a.y},e)},fallback:function(t,e){var a=o(t,e.origin);return f({x0:t.x,y0:t.y,x1:t.x,y1:t.y,vx:a.x,vy:a.y},e)}},p=t.helpers,v=n.rasterize;function y(t){var e=t.borderWidth||0,a=t.padding,n=t.size.height,o=t.size.width,i=-o/2,r=-n/2;return{frame:{x:i-a.left-e,y:r-a.top-e,w:o+a.width+2*e,h:n+a.height+2*e},text:{x:i,y:r,w:o,h:n}}}function g(t){var e=t._model.horizontal,a=t._scale||e&&t._xScale||t._yScale;if(!a)return null;if(void 0!==a.xCenter&&void 0!==a.yCenter)return{x:a.xCenter,y:a.yCenter};var n=a.getBasePixel();return e?{x:n,y:null}:{x:null,y:n}}function x(e){return e instanceof t.elements.Arc?b.arc:e instanceof t.elements.Point?b.point:e instanceof t.elements.Rectangle?b.rect:b.fallback}function m(t,e,a){var n=a.backgroundColor,o=a.borderColor,i=a.borderWidth;(n||o&&i)&&(t.beginPath(),p.canvas.roundedRect(t,v(e.x)+i/2,v(e.y)+i/2,v(e.w)-i,v(e.h)-i,a.borderRadius),t.closePath(),n&&(t.fillStyle=n,t.fill()),o&&i&&(t.strokeStyle=o,t.lineWidth=i,t.lineJoin="miter",t.stroke()))}function _(t,e,a){var n=a.lineHeight,o=t.w,i=t.x,r=t.y+n/2;return"center"===e?i+=o/2:"end"!==e&&"right"!==e||(i+=o),{h:n,w:o,x:i,y:r}}function w(t,e,a){var n=t.shadowBlur,o=a.stroked,i=v(a.x),r=v(a.y),l=v(a.w);o&&t.strokeText(e,i,r,l),a.filled&&(n&&o&&(t.shadowBlur=0),t.fillText(e,i,r,l),n&&o&&(t.shadowBlur=n))}function C(t,e,a,n){var o,i=n.textAlign,r=n.color,l=!!r,s=n.font,d=e.length,c=n.textStrokeColor,u=n.textStrokeWidth,h=c&&u;if(d&&(l||h))for(a=_(a,i,s),t.font=s.string,t.textAlign=i,t.textBaseline="middle",t.shadowBlur=n.textShadowBlur,t.shadowColor=n.textShadowColor,l&&(t.fillStyle=r),h&&(t.lineJoin="round",t.lineWidth=u,t.strokeStyle=c),o=0,d=e.length;o=0;--a)for(o=t[a].$layout,n=a-1;n>=0&&o._visible;--n)i=t[n].$layout,i._visible&&o._box.intersects(i._box)&&e(o,i);return t}function z(t){var e,a,n,o,i,r;for(e=0,a=t.length;en.x+n.w+2*a||t.y>n.y+n.h+2*a)},intersects:function(t){var e,a,n,o=this._points(),i=t._points(),r=[B(o[0],o[1]),B(o[0],o[3])];for(this._rotation!==t._rotation&&r.push(B(i[0],i[1]),B(i[0],i[3])),e=0;e=0;--a)if(n=t[a].$layout,n&&n._visible&&n._box.contains(e))return t[a];return null},draw:function(t,e){var a,n,o,i,r,l;for(a=0,n=e.length;a