this.wc=this.wc||{},this.wc.date=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=444)}({2:function(e,t){e.exports=window.wp.i18n},32:function(e,t,r){"use strict";var o=r(67),n=r(68),a=r(39);e.exports={formats:a,parse:n,stringify:o}},39:function(e,t,r){"use strict";var o=String.prototype.replace,n=/%20/g,a="RFC1738",i="RFC3986";e.exports={default:i,formatters:{RFC1738:function(e){return o.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:a,RFC3986:i}},4:function(e,t){e.exports=window.lodash},444:function(e,t,r){"use strict";r.r(t),r.d(t,"isoDateFormat",(function(){return s})),r.d(t,"defaultDateTimeFormat",(function(){return u})),r.d(t,"presetValues",(function(){return l})),r.d(t,"periods",(function(){return d})),r.d(t,"appendTimestamp",(function(){return f})),r.d(t,"toMoment",(function(){return m})),r.d(t,"getRangeLabel",(function(){return p})),r.d(t,"getStoreTimeZoneMoment",(function(){return y})),r.d(t,"getLastPeriod",(function(){return b})),r.d(t,"getCurrentPeriod",(function(){return h})),r.d(t,"getDateParamsFromQuery",(function(){return g})),r.d(t,"getCurrentDates",(function(){return j})),r.d(t,"getDateDifferenceInDays",(function(){return _})),r.d(t,"getPreviousDate",(function(){return k})),r.d(t,"getAllowedIntervalsForQuery",(function(){return S})),r.d(t,"getIntervalForQuery",(function(){return Y})),r.d(t,"getChartTypeForQuery",(function(){return D})),r.d(t,"dayTicksThreshold",(function(){return x})),r.d(t,"weekTicksThreshold",(function(){return M})),r.d(t,"defaultTableDateFormat",(function(){return L})),r.d(t,"getDateFormatsForInterval",(function(){return E})),r.d(t,"loadLocaleData",(function(){return P})),r.d(t,"dateValidationMessages",(function(){return N})),r.d(t,"validateDateInputForRange",(function(){return T}));var o=r(9),n=r.n(o),a=r(4),i=r(2),c=r(32);const s="YYYY-MM-DD",u="YYYY-MM-DDTHH:mm:ss",l=[{value:"today",label:Object(i.__)("Today",'woocommerce')},{value:"yesterday",label:Object(i.__)("Yesterday",'woocommerce')},{value:"week",label:Object(i.__)("Week to date",'woocommerce')},{value:"last_week",label:Object(i.__)("Last week",'woocommerce')},{value:"month",label:Object(i.__)("Month to date",'woocommerce')},{value:"last_month",label:Object(i.__)("Last month",'woocommerce')},{value:"quarter",label:Object(i.__)("Quarter to date",'woocommerce')},{value:"last_quarter",label:Object(i.__)("Last quarter",'woocommerce')},{value:"year",label:Object(i.__)("Year to date",'woocommerce')},{value:"last_year",label:Object(i.__)("Last year",'woocommerce')},{value:"custom",label:Object(i.__)("Custom",'woocommerce')}],d=[{value:"previous_period",label:Object(i.__)("Previous period",'woocommerce')},{value:"previous_year",label:Object(i.__)("Previous year",'woocommerce')}],f=(e,t)=>{if("start"===t)return e.startOf("day").format(u);if("now"===t)return e.format(u);if("end"===t)return e.endOf("day").format(u);throw new Error("appendTimestamp requires second parameter to be either `start`, `now` or `end`")};function m(e,t){if(n.a.isMoment(t))return t.isValid()?t:null;if("string"==typeof t){const r=n()(t,[s,e],!0);return r.isValid()?r:null}throw new Error("toMoment requires a string to be passed as an argument")}function p(e,t){const r=e.year()===t.year(),o=r&&e.month()===t.month(),n=r&&o&&e.isSame(t,"day"),a=Object(i.__)("MMM D, YYYY",'woocommerce');if(n)return e.format(a);if(o){const r=e.date();return e.format(a).replace(r,`${r} - ${t.date()}`)}if(r){const r=Object(i.__)("MMM D",'woocommerce');return`${e.format(r)} - ${t.format(a)}`}return`${e.format(a)} - ${t.format(a)}`}function y(){return window.wcSettings&&window.wcSettings.timeZone?["+","-"].includes(window.wcSettings.timeZone.charAt(0))?n()().utcOffset(window.wcSettings.timeZone):n()().tz(window.wcSettings.timeZone):n()()}function b(e,t){const r=y().startOf(e).subtract(1,e),o=r.clone().endOf(e);let a,i;if("previous_period"===t)if("year"===e)a=n()().startOf(e).subtract(2,e),i=a.clone().endOf(e);else{const e=o.diff(r,"days");i=r.clone().subtract(1,"days"),a=i.clone().subtract(e,"days")}else"week"===e?(a=r.clone().subtract(1,"years"),i=o.clone().subtract(1,"years")):(a=r.clone().subtract(1,"years"),i=a.clone().endOf(e));return"month"===e&&(i=i.clone().endOf("month")),{primaryStart:r,primaryEnd:o,secondaryStart:a,secondaryEnd:i}}function h(e,t){const r=y().startOf(e),o=y(),n=o.diff(r,"days");let a,i;return"previous_period"===t?(a=r.clone().subtract(1,e),i=o.clone().subtract(1,e)):(a=r.clone().subtract(1,"years"),i=a.clone().add(n+1,"days").subtract(1,"seconds")),{primaryStart:r,primaryEnd:o,secondaryStart:a,secondaryEnd:i}}const w=Object(a.memoize)((e,t,r,o)=>{switch(e){case"today":return h("day",t);case"yesterday":return b("day",t);case"week":return h("week",t);case"last_week":return b("week",t);case"month":return h("month",t);case"last_month":return b("month",t);case"quarter":return h("quarter",t);case"last_quarter":return b("quarter",t);case"year":return h("year",t);case"last_year":return b("year",t);case"custom":const e=o.diff(r,"days");if("previous_period"===t){const t=r.clone().subtract(1,"days");return{primaryStart:r,primaryEnd:o,secondaryStart:t.clone().subtract(e,"days"),secondaryEnd:t}}return{primaryStart:r,primaryEnd:o,secondaryStart:r.clone().subtract(1,"years"),secondaryEnd:o.clone().subtract(1,"years")}}},(e,t,r,o)=>[e,t,r&&r.format(),o&&o.format()].join(":")),v=Object(a.memoize)((e,t,r,o,a)=>{if(e&&t)return{period:e,compare:t,after:r?n()(r):null,before:o?n()(o):null};const i=Object(c.parse)(a.replace(/&/g,"&"));return{period:i.period,compare:i.compare,after:i.after?n()(i.after):null,before:i.before?n()(i.before):null}},(e,t,r,o,n)=>[e,t,r,o,n].join(":")),g=(e,t="period=month&compare=previous_year")=>{const{period:r,compare:o,after:n,before:a}=e;return v(r,o,n,a,t)},O=Object(a.memoize)((e,t,r,o,n,i)=>({primary:{label:Object(a.find)(l,t=>t.value===e).label,range:p(r,o),after:r,before:o},secondary:{label:Object(a.find)(d,e=>e.value===t).label,range:p(n,i),after:n,before:i}}),(e,t,r,o,n,a)=>[e,t,r&&r.format(),o&&o.format(),n&&n.format(),a&&a.format()].join(":")),j=(e,t="period=month&compare=previous_year")=>{const{period:r,compare:o,after:n,before:a}=g(e,t),{primaryStart:i,primaryEnd:c,secondaryStart:s,secondaryEnd:u}=w(r,o,n,a);return O(r,o,i,c,s,u)},_=(e,t)=>{const r=n()(e),o=n()(t);return r.diff(o,"days")},k=(e,t,r,o,a)=>{const i=n()(e);if("previous_year"===o)return i.clone().subtract(1,"years");const c=n()(t),s=n()(r),u=c.diff(s,a);return i.clone().subtract(u,a)};function S(e){let t=[];if("custom"===e.period){const{primary:r}=j(e),o=_(r.before,r.after);t=o>=365?["day","week","month","quarter","year"]:o>=90?["day","week","month","quarter"]:o>=28?["day","week","month"]:o>=7?["day","week"]:o>1&&o<7?["day"]:["hour","day"]}else switch(e.period){case"today":case"yesterday":t=["hour","day"];break;case"week":case"last_week":t=["day"];break;case"month":case"last_month":t=["day","week"];break;case"quarter":case"last_quarter":t=["day","week","month"];break;case"year":case"last_year":t=["day","week","month","quarter"];break;default:t=["day"]}return t}function Y(e){const t=S(e),r=t[0];let o=e.interval||r;return e.interval&&!t.includes(e.interval)&&(o=r),o}function D({chartType:e}){return["line","bar"].includes(e)?e:"line"}const x=63,M=9,L="m/d/Y";function E(e,t=0){let r="%B %-d, %Y",o="%B %-d, %Y",n="%Y-%m-%d",a="%b %Y",c=L;switch(e){case"hour":r="%_I%p %B %-d, %Y",o="%_I%p %b %-d, %Y",n="%_I%p",a="%b %-d, %Y",c="h A";break;case"day":t1;){var t=e.pop(),r=t.obj[t.prop];if(a(r)){for(var o=[],n=0;n=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||a===o.RFC1738&&(40===l||41===l)?s+=c.charAt(u):l<128?s+=i[l]:l<2048?s+=i[192|l>>6]+i[128|63&l]:l<55296||l>=57344?s+=i[224|l>>12]+i[128|l>>6&63]+i[128|63&l]:(u+=1,l=65536+((1023&l)<<10|1023&c.charCodeAt(u)),s+=i[240|l>>18]+i[128|l>>12&63]+i[128|l>>6&63]+i[128|63&l])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(a(e)){for(var r=[],o=0;o0?g.join(",")||null:void 0}];else if(c(l))O=l;else{var _=Object.keys(g);O=d?_.sort(d):_}for(var k=0;k0?w+h:""}},68:function(e,t,r){"use strict";var o=r(49),n=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:o.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},u=function(e,t,r,o){if(e){var a=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(a),u=c?a.slice(0,c.index):a,l=[];if(u){if(!r.plainObjects&&n.call(Object.prototype,u)&&!r.allowPrototypes)return;l.push(u)}for(var d=0;r.depth>0&&null!==(c=i.exec(a))&&d=0;--a){var i,c=e[a];if("[]"===c&&r.parseArrays)i=[].concat(n);else{i=r.plainObjects?Object.create(null):{};var u="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,l=parseInt(u,10);r.parseArrays||""!==u?!isNaN(l)&&c!==u&&String(l)===u&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(i=[])[l]=n:i[u]=n:i={0:n}}n=i}return n}(l,t,r,o)}};e.exports=function(e,t){var r=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||o.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,u={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,f=l.split(t.delimiter,d),m=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(b=a(b)?[b]:b),n.call(u,y)?u[y]=o.combine(u[y],b):u[y]=b}return u}(e,r):e,d=r.plainObjects?Object.create(null):{},f=Object.keys(l),m=0;m