")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",t.proxy(function(e){var n=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();e.preventDefault(),this.to(n,i.dotsSpeed)},this));for(e in this._overrides)this._core[e]=t.proxy(this[e],this)},o.prototype.destroy=function(){var t,e,i,n,o;o=this._core.settings;for(t in this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&o.navContainer?this._controls[e].html(""):this._controls[e].remove();for(n in this.overides)this._core[n]=this._overrides[n];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},o.prototype.update=function(){var t,e,i,n=this._core.clones().length/2,o=n+this._core.items().length,r=this._core.maximum(!0),a=this._core.settings,s=a.center||a.autoWidth||a.dotsData?1:a.dotsEach||a.items;if("page"!==a.slideBy&&(a.slideBy=Math.min(a.slideBy,a.items)),a.dots||"page"==a.slideBy)for(this._pages=[],t=n,e=0,i=0;t=s||0===e){if(this._pages.push({start:Math.min(r,t-n),end:t-n+s-1}),Math.min(r,t-n)===r)break;e=0,++i}e+=this._core.mergers(this._core.relative(t))}},o.prototype.draw=function(){var e,i=this._core.settings,n=this._core.items().length<=i.items,o=this._core.relative(this._core.current()),r=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||n),i.nav&&(this._controls.$previous.toggleClass("disabled",!r&&o<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!r&&o>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||n),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},o.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},o.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy(function(t,i){return t.start<=e&&t.end>=e},this)).pop()},o.prototype.getPosition=function(e){var i,n,o=this._core.settings;return"page"==o.slideBy?(i=t.inArray(this.current(),this._pages),n=this._pages.length,e?++i:--i,i=this._pages[(i%n+n)%n].start):(i=this._core.relative(this._core.current()),n=this._core.items().length,e?i+=o.slideBy:i-=o.slideBy),i},o.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},o.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},o.prototype.to=function(e,i,n){var o;!n&&this._pages.length?(o=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%o+o)%o].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.owlCarousel.Constructor.Plugins.Navigation=o}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){"use strict";var o=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy(function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}},this),"changed.owl.carousel":t.proxy(function(i){if(i.namespace&&"position"===i.property.name){var n=this._core.items(this._core.relative(this._core.current())),o=t.map(this._hashes,function(t,e){return t===n?e:null}).join();if(!o||e.location.hash.slice(1)===o)return;e.location.hash=o}},this)},this._core.options=t.extend({},o.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy(function(t){var i=e.location.hash.substring(1),n=this._core.$stage.children(),o=this._hashes[i]&&n.index(this._hashes[i]);void 0!==o&&o!==this._core.current()&&this._core.to(this._core.relative(o),!1,!0)},this))};o.Defaults={URLhashListener:!1},o.prototype.destroy=function(){var i,n;t(e).off("hashchange.owl.navigation");for(i in this._handlers)this._core.$element.off(i,this._handlers[i]);for(n in Object.getOwnPropertyNames(this))"function"!=typeof this[n]&&(this[n]=null)},t.fn.owlCarousel.Constructor.Plugins.Hash=o}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){function o(e,i){var o=!1,r=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+s.join(r+" ")+r).split(" "),function(t,e){if(a[e]!==n)return o=!i||e,!1}),o}function r(t){return o(t,!0)}var a=t("").get(0).style,s="Webkit Moz O ms".split(" "),l={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},h={csstransforms:function(){return!!o("transform")},csstransforms3d:function(){return!!o("perspective")},csstransitions:function(){return!!o("transition")},cssanimations:function(){return!!o("animation")}};h.csstransitions()&&(t.support.transition=new String(r("transition")),t.support.transition.end=l.transition.end[t.support.transition]),h.cssanimations()&&(t.support.animation=new String(r("animation")),t.support.animation.end=l.animation.end[t.support.animation]),h.csstransforms()&&(t.support.transform=new String(r("transform")),t.support.transform3d=h.csstransforms3d())}(window.Zepto||window.jQuery,window,document)},7:function(t,e){!function(){function i(t){var e=i.modules[t];if(!e)throw new Error('failed to req "'+t+'"');return"exports"in e||"function"!=typeof e.definition||(e.client=e.component=!0,e.definition.call(this,e.exports={},e),delete e.definition),e.exports}i.loader="component",i.helper={},i.helper.semVerSort=function(t,e){for(var i=t.version.split("."),n=e.version.split("."),o=0;oa?1:-1;var s=i[o].substr((""+r).length),l=n[o].substr((""+a).length);if(""===s&&""!==l)return 1;if(""!==s&&""===l)return-1;if(""!==s&&""!==l)return s>l?1:-1}return 0},i.latest=function(t,e){function n(t){throw new Error('failed to find latest module of "'+t+'"')}var o=/(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/;/(.*)~(.*)/.test(t)||n(t);for(var r=Object.keys(i.modules),a=[],s=[],l=0;l0){var u=a.sort(i.helper.semVerSort).pop().name;return!0===e?u:i(u)}var u=s.sort(function(t,e){return t.name>e.name})[0].name;return!0===e?u:i(u)},i.modules={},i.register=function(t,e){i.modules[t]={definition:e}},i.define=function(t,e){i.modules[t]={exports:e}},i.register("abpetkov~transitionize@0.0.3",function(t,e){function i(t,e){if(!(this instanceof i))return new i(t,e);this.element=t,this.props=e||{},this.init()}e.exports=i,i.prototype.isSafari=function(){return/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)},i.prototype.init=function(){var t=[];for(var e in this.props)t.push(e+" "+this.props[e]);this.element.style.transition=t.join(", "),this.isSafari()&&(this.element.style.webkitTransition=t.join(", "))}}),i.register("ftlabs~fastclick@v0.6.11",function(t,e){function i(t){"use strict";var e,n=this;if(this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=10,this.layer=t,!t||!t.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return i.prototype.onClick.apply(n,arguments)},this.onMouse=function(){return i.prototype.onMouse.apply(n,arguments)},this.onTouchStart=function(){return i.prototype.onTouchStart.apply(n,arguments)},this.onTouchMove=function(){return i.prototype.onTouchMove.apply(n,arguments)},this.onTouchEnd=function(){return i.prototype.onTouchEnd.apply(n,arguments)},this.onTouchCancel=function(){return i.prototype.onTouchCancel.apply(n,arguments)},i.notNeeded(t)||(this.deviceIsAndroid&&(t.addEventListener("mouseover",this.onMouse,!0),t.addEventListener("mousedown",this.onMouse,!0),t.addEventListener("mouseup",this.onMouse,!0)),t.addEventListener("click",this.onClick,!0),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchmove",this.onTouchMove,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;"click"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;"click"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),"function"==typeof t.onclick&&(e=t.onclick,t.addEventListener("click",function(t){e(t)},!1),t.onclick=null))}i.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,i.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),i.prototype.deviceIsIOS4=i.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),i.prototype.deviceIsIOSWithBadTarget=i.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),i.prototype.needsClick=function(t){"use strict";switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(this.deviceIsIOS&&"file"===t.type||t.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(t.className)},i.prototype.needsFocus=function(t){"use strict";switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!this.deviceIsAndroid;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},i.prototype.sendClick=function(t,e){"use strict";var i,n;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),n=e.changedTouches[0],i=document.createEvent("MouseEvents"),i.initMouseEvent(this.determineEventType(t),!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),i.forwardedTouchEvent=!0,t.dispatchEvent(i)},i.prototype.determineEventType=function(t){"use strict";return this.deviceIsAndroid&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},i.prototype.focus=function(t){"use strict";var e;this.deviceIsIOS&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},i.prototype.updateScrollParent=function(t){"use strict";var e,i;if(!(e=t.fastClickScrollParent)||!e.contains(t)){i=t;do{if(i.scrollHeight>i.offsetHeight){e=i,t.fastClickScrollParent=i;break}i=i.parentElement}while(i)}e&&(e.fastClickLastScrollTop=e.scrollTop)},i.prototype.getTargetElementFromEventTarget=function(t){"use strict";return t.nodeType===Node.TEXT_NODE?t.parentNode:t},i.prototype.onTouchStart=function(t){"use strict";var e,i,n;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),i=t.targetTouches[0],this.deviceIsIOS){if(n=window.getSelection(),n.rangeCount&&!n.isCollapsed)return!0;if(!this.deviceIsIOS4){if(i.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=i.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=i.pageX,this.touchStartY=i.pageY,t.timeStamp-this.lastClickTime<200&&t.preventDefault(),!0},i.prototype.touchHasMoved=function(t){"use strict";var e=t.changedTouches[0],i=this.touchBoundary;return Math.abs(e.pageX-this.touchStartX)>i||Math.abs(e.pageY-this.touchStartY)>i},i.prototype.onTouchMove=function(t){"use strict";return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0)},i.prototype.findControl=function(t){"use strict";return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},i.prototype.onTouchEnd=function(t){"use strict";var e,i,n,o,r,a=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,i=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,this.deviceIsIOSWithBadTarget&&(r=t.changedTouches[0],a=document.elementFromPoint(r.pageX-window.pageXOffset,r.pageY-window.pageYOffset)||a,a.fastClickScrollParent=this.targetElement.fastClickScrollParent),"label"===(n=a.tagName.toLowerCase())){if(e=this.findControl(a)){if(this.focus(a),this.deviceIsAndroid)return!1;a=e}}else if(this.needsFocus(a))return t.timeStamp-i>100||this.deviceIsIOS&&window.top!==window&&"input"===n?(this.targetElement=null,!1):(this.focus(a),this.deviceIsIOS4&&"select"===n||(this.targetElement=null,t.preventDefault()),!1);return!(!this.deviceIsIOS||this.deviceIsIOS4||!(o=a.fastClickScrollParent)||o.fastClickLastScrollTop===o.scrollTop)||(this.needsClick(a)||(t.preventDefault(),this.sendClick(a,t)),!1)},i.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},i.prototype.onMouse=function(t){"use strict";return!this.targetElement||(!!t.forwardedTouchEvent||(!t.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1))))},i.prototype.onClick=function(t){"use strict";var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail||(e=this.onMouse(t),e||(this.targetElement=null),e)},i.prototype.destroy=function(){"use strict";var t=this.layer;this.deviceIsAndroid&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},i.notNeeded=function(t){"use strict";var e,n;if(void 0===window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!i.prototype.deviceIsAndroid)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(n>31&&window.innerWidth<=window.screen.width)return!0}}return"none"===t.style.msTouchAction},i.attach=function(t){"use strict";return new i(t)},"undefined"!=typeof define&&define.amd?define(function(){"use strict";return i}):void 0!==e&&e.exports?(e.exports=i.attach,e.exports.FastClick=i):window.FastClick=i}),i.register("component~indexof@0.0.3",function(t,e){e.exports=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i-1)&&new a.a(this.settings,this.$widgetsContainer),(e||$.inArray("atum_sales_widget",t)>-1||$.inArray("atum_lost_sales_widget",t)>-1||$.inArray("atum_orders_widget",t)>-1||$.inArray("atum_promo_sales_widget",t)>-1)&&new r.a,(e||$.inArray("atum_stock_control_widget",t)>-1)&&new s.a(this.settings),(e||$.inArray("atum_current_stock_value_widget",t)>-1)&&new n.a(this.$widgetsContainer),(void 0===t||$.inArray("atum_videos_widget",t)>-1)&&new l.a(this.$widgetsContainer),o.a.addScrollBars(this.$widgetsContainer),this.doNiceSelects()},t.prototype.marketingBannerConfig=function(){$(".marketing-close").on("click",function(){$(".dash-marketing-banner-container").fadeOut()}),$(".banner-button").on("click",function(t){window.open($(t.currentTarget).data("url"),"_blank")})},t.prototype.doNiceSelects=function(t){(void 0!==t?t:this.$widgetsContainer).find("select").niceSelect()},t.prototype.saveWidgetsLayout=function(){$.ajax({url:window.ajaxurl,method:"POST",data:{action:"atum_dashboard_save_layout",token:this.$widgetsContainer.data("nonce"),layout:this.serializeLayout(this.grid.grid.nodes)}})},t.prototype.serializeLayout=function(t){var e={};return void 0===t?e:($.each(t,function(t,i){e[i.id]={x:i.x,y:i.y,height:i.height,width:i.width}}),e)},t}();e.a=h},71:function(t,e,i){"use strict";var n=function(){function t(t){this.$widgetsContainer=t,this.$currentStockValueWidget=$(".current-stock-value-widget"),this.$currentStockValueWidget.length&&this.onChange()}return t.prototype.onChange=function(){var t=this;this.$currentStockValueWidget.find("select").change(function(e){$.ajax({url:window.ajaxurl,method:"POST",data:{token:t.$widgetsContainer.data("nonce"),action:"atum_current_stock_values",categorySelected:$(".categories-list").val(),productTypeSelected:$(".product-types-list").val()},dataType:"json",beforeSend:function(){t.$currentStockValueWidget.addClass("overlay")},success:function(e){if("object"==typeof e&&!0===e.success){var i=e.data.current_stock_values.items_without_purcharse_price,n=t.$currentStockValueWidget.find(".total");n.html(n.data("currency")+" "+e.data.current_stock_values.items_purcharse_price_total),t.$currentStockValueWidget.find(".items-count .total").html(e.data.current_stock_values.items_stocks_counter),t.$currentStockValueWidget.find(".items_without_purcharse_price").html(i),t.$currentStockValueWidget.removeClass("overlay"),"0"===i?$(".items-without-purcharse-price").hide():$(".items-without-purcharse-price").show()}}})})},t}();e.a=n},72:function(t,e,i){"use strict";var n=function(){function t(){$(".stats-data-widget").find("select").change(function(t){t.stopPropagation();var e=$(t.currentTarget),i=e.closest(".stats-data-widget");i.find(".data:visible").hide(),i.find('[data-value="'+e.val()+'"]').fadeIn("fast")})}return t}();e.a=n},73:function(t,e,i){"use strict";var n=i(26),o=i.n(n),r=i(6),a=function(){function t(t,e){this.settings=t,this.$widgetsContainer=e,this.$statisticsWidget=$(".statistics-widget"),this.$statisticsWidget.length&&this.initChart()}return t.prototype.initChart=function(){var t=this;this.$statsCanvas=this.$statisticsWidget.find("canvas"),this.statsCanvasCtx=this.$statsCanvas.get(0).getContext("2d"),this.chartData=this.$statsCanvas.data("chartdata"),this.chartLabels=this.getChartLabels(this.$statsCanvas.data("period")),this.chartLegends=this.$statsCanvas.data("legends"),this.gradientGreen=this.statsCanvasCtx.createLinearGradient(0,0,1200,0),this.gradientBlue=this.statsCanvasCtx.createLinearGradient(0,0,1200,0),this.gradientGreen.addColorStop(0,this.settings.get("chartColors").greenLight),this.gradientGreen.addColorStop(1,this.settings.get("chartColors").greenTrans),this.gradientBlue.addColorStop(0,this.settings.get("chartColors").greenBlue),this.gradientBlue.addColorStop(1,this.settings.get("chartColors").blueTrans),this.statsDataSets=[{id:"value-chart",curSymbol:this.settings.get("statsValueCurSymbol"),curPosition:this.settings.get("statsValueCurPosition"),label:this.chartLegends.value,data:this.chartData.value||[],backgroundColor:this.settings.get("chartColors").greenLight,borderColor:this.gradientGreen,borderWidth:8,pointRadius:6,pointBackgroundColor:this.settings.get("chartColors").green,pointBorderColor:"#FFF",pointBorderWidth:2,pointHoverRadius:6,tooltipBackground:"linear-gradient(135deg, "+this.settings.get("chartColors").green+", "+this.settings.get("chartColors").greenLight+")",fill:!1},{id:"products-chart",units:"",label:this.chartLegends.products,data:this.chartData.products||[],backgroundColor:this.settings.get("chartColors").greenBlue,borderColor:this.gradientBlue,borderWidth:8,pointRadius:6,pointBackgroundColor:this.settings.get("chartColors").blue,pointBorderColor:"#FFF",pointBorderWidth:2,pointHoverRadius:6,tooltipBackground:"linear-gradient(135deg, "+this.settings.get("chartColors").blue+", "+this.settings.get("chartColors").greenBlue+")",fill:!1}],this.statsChartConfig={type:"line",data:{labels:this.chartLabels,datasets:this.statsDataSets},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{top:10}},legend:{display:!1},hover:{mode:"nearest",intersect:!0},scales:{xAxes:[{gridLines:{display:!1,drawBorder:!1,drawOnChartArea:!0,drawTicks:!0}}],yAxes:[{gridLines:{display:!0,drawBorder:!1,drawOnChartArea:!0,drawTicks:!0}}]},tooltips:{enabled:!1,mode:"nearest",intersect:!1,custom:function(e){$(t.statsChart.canvas).css("cursor","pointer");var i=t.statsChart.canvas.offsetTop,n=t.statsChart.canvas.offsetLeft;$(".stats-chart-tooltip").css("opacity",0),e&&e.opacity&&e.dataPoints.length>0&&e.dataPoints.forEach(function(e){if(void 0!==t.statsDataSets[e.datasetIndex].curSymbol){var o=t.statsDataSets[e.datasetIndex].curSymbol;"left"===t.statsDataSets[e.datasetIndex].curPosition?e.yLabel=o+e.yLabel:e.yLabel+=o}var r=e.yLabel,a=$("#stats-chart-tooltip-"+e.datasetIndex);a.html(r),a.css({opacity:1,top:i+e.y+"px",left:n+e.x+"px",background:t.statsDataSets[e.datasetIndex].tooltipBackground})})}}}},this.statsChart=new o.a(this.statsCanvasCtx,this.statsChartConfig),this.doLegendSwitches(),this.changeChartType(),this.doSortableLegends(),this.changeChartData(),this.doMobileFilterNav()},t.prototype.getChartLabels=function(t){var e=[];switch(t){case"month":e=this.settings.get("months");break;case"monthDay":for(var i=1;i<=this.settings.get("numDaysCurMonth");i++)e.push(i);break;case"weekDay":e=this.settings.get("days")}return e},t.prototype.doLegendSwitches=function(){var t=this;r.a.doSwitchers(".value-chart"),r.a.doSwitchers(".products-chart",{color:this.settings.get("chartColors").blueTrans,jackColor:this.settings.get("chartColors").blue}),$("#value-chart, #products-chart").change(function(e){e.stopPropagation();var i=$(".chart-legend").find("input:checkbox:checked"),n=[];i.length&&i.each(function(e,i){$.each(t.statsDataSets,function(t,e){if(e.id===$(i).attr("id"))return n.push(e),!1})}),t.statsChartConfig.data.datasets=n,t.statsChart.update()})},t.prototype.changeChartType=function(){var t=this;$(".chart-type a").click(function(e){e.preventDefault();var i=$(e.currentTarget),n=i.data("view");if(i.hasClass("active"))return!1;if(i.siblings(".active").removeClass("active"),i.addClass("active"),"bar"===n)t.statsChartConfig.type="bar";else{var r="line"!==n&&"start";t.statsChartConfig.type="line",$.each(t.statsChartConfig.data.datasets,function(e,i){t.statsChartConfig.data.datasets[e].fill=r})}t.statsChart.destroy(),t.statsChart=new o.a(t.statsCanvasCtx,t.statsChartConfig)})},t.prototype.doSortableLegends=function(){var t=this,e=$(".chart-legend");e.sortable({revert:!0,placeholder:"legend-switch legend-placeholder",forcePlaceholderSize:!0,update:function(i,n){var o=[];e.find("input:checkbox").each(function(t,e){o.push($(e).attr("id"))}),$.each(t.statsChartConfig.data.datasets,function(e,i){t.statsChartConfig.data.datasets[e].id!==o[e]&&t.statsChartConfig.data.datasets.reverse()}),t.statsChart.update()}}).draggable({connectToSortable:".chart-legend",helper:"clone",revert:"invalid"}).disableSelection()},t.prototype.changeChartData=function(){var t=this,e=$(".chart-filter"),i=null;e.find("select").change(function(n){n.stopPropagation();var o=$(n.currentTarget);i&&i.abort(),i=$.ajax({url:window.ajaxurl,method:"POST",data:{token:t.$widgetsContainer.data("nonce"),action:"atum_statistics_widget_chart",chart_data:e.find("select.chart-data").val(),chart_period:e.find("select.chart-period").val()},dataType:"json",beforeSend:function(){o.siblings(".nice-select.loading").removeClass("loading"),o.next(".nice-select").addClass("loading")},success:function(e){"object"==typeof e&&!0===e.success&&($.each(t.statsDataSets,function(i,n){"value-chart"===n.id?(t.statsDataSets[i].data=void 0!==e.data.dataset&&void 0!==e.data.dataset.value?e.data.dataset.value:[],void 0!==e.data.legends&&void 0!==e.data.legends.value&&(t.statsDataSets[i].label=e.data.legends.value,$("#value-chart").siblings("label").text(e.data.legends.value))):(t.statsDataSets[i].data=void 0!==e.data.dataset&&void 0!==e.data.dataset.products?e.data.dataset.products:[],void 0!==e.data.legends&&void 0!==e.data.legends.products&&(t.statsDataSets[i].label=e.data.legends.products,$("#products-chart").siblings("label").text(e.data.legends.products)))}),t.statsChartConfig.data.labels=t.getChartLabels(e.data.period),t.statsChart.update(),o.siblings(".nice-select.loading").removeClass("loading"))}})})},t.prototype.doMobileFilterNav=function(){var t=this;this.$statisticsWidget.find(".mobile-filter-nav li").click(function(e){var i=$(e.currentTarget);i.hasClass("active")?(i.removeClass("active").find(".status").text("+"),t.$statisticsWidget.find(".chart-filter .visible-filter").removeClass("visible-filter")):(i.siblings(".active").removeClass("active").find(".status").text("+"),i.addClass("active").find(".status").text("-"),t.$statisticsWidget.find(".chart-filter .visible-filter").removeClass("visible-filter"),t.$statisticsWidget.find(i.data("show-filter")).addClass("visible-filter"))})},t}();e.a=a},74:function(t,e,i){"use strict";var n=i(26),o=i.n(n),r=function(){function t(t){this.settings=t,this.$stockControlWidget=$(".stock-chart"),this.$stockControlWidget.length&&this.initChart()}return t.prototype.initChart=function(){var t=this,e=this.$stockControlWidget.find("canvas"),i={type:"doughnut",data:{datasets:[{data:[e.data("lowstock"),e.data("outstock"),e.data("instock"),e.data("unmanaged")],backgroundColor:[this.settings.get("chartColors").orange,this.settings.get("chartColors").red,this.settings.get("chartColors").green,this.settings.get("chartColors").blue]}],labels:[this.settings.get("lowStockLabel"),this.settings.get("outStockLabel"),this.settings.get("inStockLabel"),this.settings.get("unmanagedLabel")]},options:{responsive:!0,legend:{display:!1},maintainAspectRatio:!1,animation:{animateScale:!0,animateRotate:!0},cutoutPercentage:25,tooltips:{enabled:!1,custom:function(e){var i=$(".stock-chart-tooltip").get(0);if(0===e.opacity)return void(i.style.opacity="0");if(i.classList.remove("above","below","no-transform"),e.yAlign?i.classList.add(e.yAlign):i.classList.add("no-transform"),e.body){var n=e.title||[],o=e.body.map(function(t){return t.lines}),r="";n.forEach(function(t){r+="| "+t+" |
"}),r+="",o.forEach(function(t,i){var n=e.labelColors[i],o="background:"+n.backgroundColor+"; border-color:"+n.borderColor+"; border-width: 2px";r+='| '+t+" |
"}),r+="",i.querySelector("table").innerHTML=r}var a=t.stockControlChart.canvas.offsetTop,s=t.stockControlChart.canvas.offsetLeft;i.style.opacity="1",i.style.left=s+e.caretX+"px",i.style.top=a+e.caretY+"px",i.style.padding=e.yPadding+"px "+e.xPadding+"px"}}}};this.stockControlChart=new o.a(e.get(0).getContext("2d"),i)},t}();e.a=r},75:function(t,e,i){"use strict";var n=i(27),o=function(){function t(t){this.$widgetsContainer=t,this.$videosWidget=$(".videos-widget"),this.$videosWidget.length&&this.initVideosWidget()}return t.prototype.initVideosWidget=function(){var t=this;this.$videosWidget.on("click","article a",function(e){e.preventDefault();var i=$(e.currentTarget).closest("article"),n=t.$videosWidget.find(".video-player"),o=i.data("video");i.siblings(".active").removeClass("active"),i.addClass("active"),n.find("iframe").attr("src","//www.youtube.com/embed/"+o+"?rel=0&modestbranding=1"),n.find(".video-title").text(i.find(".video-title").text()),n.find(".video-meta").html(i.find(".video-meta").html()),n.find(".video-desc").text(i.find(".video-desc").text()),i.data("video",o)}),this.$videosWidget.find(".video-list-layout a").click(function(e){e.preventDefault();var i=$(e.currentTarget);if(i.hasClass("active"))return!1;t.$videosWidget.find(".video-list").attr("data-view",i.data("view")),n.a.removeScrollBars(t.$videosWidget),setTimeout(function(){n.a.addScrollBars(t.$videosWidget)},400),i.siblings(".active").removeClass("active"),i.addClass("active")}),this.$videosWidget.find(".video-filter-by").change(function(e){e.stopPropagation(),t.filterVideos()}),this.$videosWidget.find(".video-sort-by").change(function(e){e.stopPropagation();var i=$(e.currentTarget).val(),n=t.$videosWidget.find(".scroll-box");$.ajax({url:window.ajaxurl,method:"POST",data:{token:t.$widgetsContainer.data("nonce"),action:"atum_videos_widget_sorting",sortby:i},beforeSend:function(){return n.addClass("overlay")},success:function(e){-1!=e&&(n.html($(e).find(".scroll-box").html()),t.filterVideos()),n.removeClass("overlay")},error:function(){return n.removeClass("overlay")}})})},t.prototype.filterVideos=function(){var t=this.$videosWidget.find("article"),e=this.$videosWidget.find(".video-filter-by").val();""===e?t.fadeIn("fast"):(t.not("."+e).hide(),t.filter("."+e).fadeIn("fast"))},t}();e.a=o}});
//# sourceMappingURL=atum-dashboard.js.map