File "index.js"

Full Path: /home/vantageo/public_html/cache/cache/cache/cache/.wp-cli/wp-content/plugins/woocommerce/packages/woocommerce-admin/dist/date/index.js
File size: 19.44 KB
MIME-type: text/plain
Charset: utf-8

this.wc=this.wc||{},this.wc.date=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=581)}({104:function(e,r,t){"use strict";var n=t(192),o=t(193),a=t(114);e.exports={formats:a,parse:o,stringify:n}},114:function(e,r,t){"use strict";var n=String.prototype.replace,o=/%20/g,a="RFC1738",i="RFC3986";e.exports={default:i,formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:a,RFC3986:i}},136:function(e,r,t){"use strict";var n=t(114),o=Object.prototype.hasOwnProperty,a=Array.isArray,i=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),c=function(e,r){for(var t=r&&r.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(t[n]=e[n]);return t};e.exports={arrayToObject:c,assign:function(e,r){return Object.keys(r).reduce((function(e,t){return e[t]=r[t],e}),e)},combine:function(e,r){return[].concat(e,r)},compact:function(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;n<r.length;++n)for(var o=r[n],i=o.obj[o.prop],c=Object.keys(i),u=0;u<c.length;++u){var l=c[u],s=i[l];"object"==typeof s&&null!==s&&-1===t.indexOf(s)&&(r.push({obj:i,prop:l}),t.push(s))}return function(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(a(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}}(r),e},decode:function(e,r,t){var n=e.replace(/\+/g," ");if("iso-8859-1"===t)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,r,t,o,a){if(0===e.length)return e;var c=e;if("symbol"==typeof e?c=Symbol.prototype.toString.call(e):"string"!=typeof e&&(c=String(e)),"iso-8859-1"===t)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var u="",l=0;l<c.length;++l){var s=c.charCodeAt(l);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||a===n.RFC1738&&(40===s||41===s)?u+=c.charAt(l):s<128?u+=i[s]:s<2048?u+=i[192|s>>6]+i[128|63&s]:s<55296||s>=57344?u+=i[224|s>>12]+i[128|s>>6&63]+i[128|63&s]:(l+=1,s=65536+((1023&s)<<10|1023&c.charCodeAt(l)),u+=i[240|s>>18]+i[128|s>>12&63]+i[128|s>>6&63]+i[128|63&s])}return u},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,r){if(a(e)){for(var t=[],n=0;n<e.length;n+=1)t.push(r(e[n]));return t}return r(e)},merge:function e(r,t,n){if(!t)return r;if("object"!=typeof t){if(a(r))r.push(t);else{if(!r||"object"!=typeof r)return[r,t];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,t))&&(r[t]=!0)}return r}if(!r||"object"!=typeof r)return[r].concat(t);var i=r;return a(r)&&!a(t)&&(i=c(r,n)),a(r)&&a(t)?(t.forEach((function(t,a){if(o.call(r,a)){var i=r[a];i&&"object"==typeof i&&t&&"object"==typeof t?r[a]=e(i,t,n):r.push(t)}else r[a]=t})),r):Object.keys(t).reduce((function(r,a){var i=t[a];return o.call(r,a)?r[a]=e(r[a],i,n):r[a]=i,r}),i)}}},192:function(e,r,t){"use strict";var n=t(136),o=t(114),a=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},c=Array.isArray,u=Array.prototype.push,l=function(e,r){u.apply(e,c(r)?r:[r])},s=Date.prototype.toISOString,f=o.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(e){return s.call(e)},skipNulls:!1,strictNullHandling:!1},m=function e(r,t,o,a,i,u,s,f,m,p,y,b,h,v){var w,g=r;if("function"==typeof s?g=s(t,g):g instanceof Date?g=p(g):"comma"===o&&c(g)&&(g=n.maybeMap(g,(function(e){return e instanceof Date?p(e):e}))),null===g){if(a)return u&&!h?u(t,d.encoder,v,"key",y):t;g=""}if("string"==typeof(w=g)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||n.isBuffer(g))return u?[b(h?t:u(t,d.encoder,v,"key",y))+"="+b(u(g,d.encoder,v,"value",y))]:[b(t)+"="+b(String(g))];var O,j=[];if(void 0===g)return j;if("comma"===o&&c(g))O=[{value:g.length>0?g.join(",")||null:void 0}];else if(c(s))O=s;else{var _=Object.keys(g);O=f?_.sort(f):_}for(var k=0;k<O.length;++k){var S=O[k],Y="object"==typeof S&&void 0!==S.value?S.value:g[S];if(!i||null!==Y){var D=c(g)?"function"==typeof o?o(t,S):t:t+(m?"."+S:"["+S+"]");l(j,e(Y,D,o,a,i,u,s,f,m,p,y,b,h,v))}}return j};e.exports=function(e,r){var t,n=e,u=function(e){if(!e)return d;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var r=e.charset||d.charset;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=o.default;if(void 0!==e.format){if(!a.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");t=e.format}var n=o.formatters[t],i=d.filter;return("function"==typeof e.filter||c(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===e.allowDots?d.allowDots:!!e.allowDots,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,delimiter:void 0===e.delimiter?d.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:d.encode,encoder:"function"==typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:i,format:t,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}}(r);"function"==typeof u.filter?n=(0,u.filter)("",n):c(u.filter)&&(t=u.filter);var s,f=[];if("object"!=typeof n||null===n)return"";s=r&&r.arrayFormat in i?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices";var p=i[s];t||(t=Object.keys(n)),u.sort&&t.sort(u.sort);for(var y=0;y<t.length;++y){var b=t[y];u.skipNulls&&null===n[b]||l(f,m(n[b],b,p,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset))}var h=f.join(u.delimiter),v=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),h.length>0?v+h:""}},193:function(e,r,t){"use strict";var n=t(136),o=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.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,r){return String.fromCharCode(parseInt(r,10))}))},u=function(e,r){return e&&"string"==typeof e&&r.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,r,t,n){if(e){var a=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,c=t.depth>0&&/(\[[^[\]]*])/.exec(a),l=c?a.slice(0,c.index):a,s=[];if(l){if(!t.plainObjects&&o.call(Object.prototype,l)&&!t.allowPrototypes)return;s.push(l)}for(var f=0;t.depth>0&&null!==(c=i.exec(a))&&f<t.depth;){if(f+=1,!t.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!t.allowPrototypes)return;s.push(c[1])}return c&&s.push("["+a.slice(c.index)+"]"),function(e,r,t,n){for(var o=n?r:u(r,t),a=e.length-1;a>=0;--a){var i,c=e[a];if("[]"===c&&t.parseArrays)i=[].concat(o);else{i=t.plainObjects?Object.create(null):{};var l="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,s=parseInt(l,10);t.parseArrays||""!==l?!isNaN(s)&&c!==l&&String(s)===l&&s>=0&&t.parseArrays&&s<=t.arrayLimit?(i=[])[s]=o:i[l]=o:i={0:o}}o=i}return o}(s,r,t,n)}};e.exports=function(e,r){var t=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 r=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:r,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||n.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}}(r);if(""===e||null==e)return t.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,r){var t,l={},s=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=r.parameterLimit===1/0?void 0:r.parameterLimit,d=s.split(r.delimiter,f),m=-1,p=r.charset;if(r.charsetSentinel)for(t=0;t<d.length;++t)0===d[t].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[t]?p="utf-8":"utf8=%26%2310003%3B"===d[t]&&(p="iso-8859-1"),m=t,t=d.length);for(t=0;t<d.length;++t)if(t!==m){var y,b,h=d[t],v=h.indexOf("]="),w=-1===v?h.indexOf("="):v+1;-1===w?(y=r.decoder(h,i.decoder,p,"key"),b=r.strictNullHandling?null:""):(y=r.decoder(h.slice(0,w),i.decoder,p,"key"),b=n.maybeMap(u(h.slice(w+1),r),(function(e){return r.decoder(e,i.decoder,p,"value")}))),b&&r.interpretNumericEntities&&"iso-8859-1"===p&&(b=c(b)),h.indexOf("[]=")>-1&&(b=a(b)?[b]:b),o.call(l,y)?l[y]=n.combine(l[y],b):l[y]=b}return l}(e,t):e,f=t.plainObjects?Object.create(null):{},d=Object.keys(s),m=0;m<d.length;++m){var p=d[m],y=l(p,s[p],t,"string"==typeof e);f=n.merge(f,y,t)}return n.compact(f)}},2:function(e,r){e.exports=window.wp.i18n},21:function(e,r){e.exports=window.moment},3:function(e,r){e.exports=window.lodash},581:function(e,r,t){"use strict";t.r(r),t.d(r,"isoDateFormat",(function(){return u})),t.d(r,"defaultDateTimeFormat",(function(){return l})),t.d(r,"presetValues",(function(){return s})),t.d(r,"periods",(function(){return f})),t.d(r,"appendTimestamp",(function(){return d})),t.d(r,"toMoment",(function(){return m})),t.d(r,"getRangeLabel",(function(){return p})),t.d(r,"getStoreTimeZoneMoment",(function(){return y})),t.d(r,"getLastPeriod",(function(){return b})),t.d(r,"getCurrentPeriod",(function(){return h})),t.d(r,"getDateParamsFromQuery",(function(){return g})),t.d(r,"getCurrentDates",(function(){return j})),t.d(r,"getDateDifferenceInDays",(function(){return _})),t.d(r,"getPreviousDate",(function(){return k})),t.d(r,"getAllowedIntervalsForQuery",(function(){return S})),t.d(r,"getIntervalForQuery",(function(){return Y})),t.d(r,"getChartTypeForQuery",(function(){return D})),t.d(r,"dayTicksThreshold",(function(){return M})),t.d(r,"weekTicksThreshold",(function(){return x})),t.d(r,"defaultTableDateFormat",(function(){return L})),t.d(r,"getDateFormatsForInterval",(function(){return P})),t.d(r,"loadLocaleData",(function(){return E})),t.d(r,"dateValidationMessages",(function(){return N})),t.d(r,"validateDateInputForRange",(function(){return T}));var n=t(21),o=t.n(n),a=t(3),i=t(2),c=t(104),u="YYYY-MM-DD",l="YYYY-MM-DDTHH:mm:ss",s=[{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')}],f=[{value:"previous_period",label:Object(i.__)("Previous Period",'woocommerce')},{value:"previous_year",label:Object(i.__)("Previous Year",'woocommerce')}],d=function(e,r){if("start"===r)return e.startOf("day").format(l);if("now"===r)return e.format(l);if("end"===r)return e.endOf("day").format(l);throw new Error("appendTimestamp requires second parameter to be either `start`, `now` or `end`")};function m(e,r){if(o.a.isMoment(r))return r.isValid()?r:null;if("string"==typeof r){var t=o()(r,[u,e],!0);return t.isValid()?t:null}throw new Error("toMoment requires a string to be passed as an argument")}function p(e,r){var t=e.year()===r.year(),n=t&&e.month()===r.month(),o=t&&n&&e.isSame(r,"day"),a=Object(i.__)("MMM D, YYYY",'woocommerce');if(o)return e.format(a);if(n){var c=e.date();return e.format(a).replace(c,"".concat(c," - ").concat(r.date()))}if(t){var u=Object(i.__)("MMM D",'woocommerce');return"".concat(e.format(u)," - ").concat(r.format(a))}return"".concat(e.format(a)," - ").concat(r.format(a))}function y(){return window.wcSettings&&window.wcSettings.timeZone?["+","-"].includes(window.wcSettings.timeZone.charAt(0))?o()().utcOffset(window.wcSettings.timeZone):o()().tz(window.wcSettings.timeZone):o()()}function b(e,r){var t,n,a=y().startOf(e).subtract(1,e),i=a.clone().endOf(e);if("previous_period"===r)if("year"===e)n=(t=o()().startOf(e).subtract(2,e)).clone().endOf(e);else{var c=i.diff(a,"days");t=(n=a.clone().subtract(1,"days")).clone().subtract(c,"days")}else t=a.clone().subtract(1,"years"),n=i.clone().subtract(1,"years");return"month"===e&&(n=n.clone().endOf("month")),{primaryStart:a,primaryEnd:i,secondaryStart:t,secondaryEnd:n}}function h(e,r){var t,n,o=y().startOf(e),a=y(),i=a.diff(o,"days");return"previous_period"===r?(t=o.clone().subtract(1,e),n=a.clone().subtract(1,e)):n=(t=o.clone().subtract(1,"years")).clone().add(i+1,"days").subtract(1,"seconds"),{primaryStart:o,primaryEnd:a,secondaryStart:t,secondaryEnd:n}}var v=Object(a.memoize)((function(e,r,t,n){switch(e){case"today":return h("day",r);case"yesterday":return b("day",r);case"week":return h("week",r);case"last_week":return b("week",r);case"month":return h("month",r);case"last_month":return b("month",r);case"quarter":return h("quarter",r);case"last_quarter":return b("quarter",r);case"year":return h("year",r);case"last_year":return b("year",r);case"custom":var o=n.diff(t,"days");if("previous_period"===r){var a=t.clone().subtract(1,"days");return{primaryStart:t,primaryEnd:n,secondaryStart:a.clone().subtract(o,"days"),secondaryEnd:a}}return{primaryStart:t,primaryEnd:n,secondaryStart:t.clone().subtract(1,"years"),secondaryEnd:n.clone().subtract(1,"years")}}}),(function(e,r,t,n){return[e,r,t&&t.format(),n&&n.format()].join(":")})),w=Object(a.memoize)((function(e,r,t,n,a){if(e&&r)return{period:e,compare:r,after:t?o()(t):null,before:n?o()(n):null};var i=Object(c.parse)(a.replace(/&amp;/g,"&"));return{period:i.period,compare:i.compare,after:i.after?o()(i.after):null,before:i.before?o()(i.before):null}}),(function(e,r,t,n,o){return[e,r,t,n,o].join(":")})),g=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"period=month&compare=previous_year",t=e.period,n=e.compare,o=e.after,a=e.before;return w(t,n,o,a,r)},O=Object(a.memoize)((function(e,r,t,n,o,i){return{primary:{label:Object(a.find)(s,(function(r){return r.value===e})).label,range:p(t,n),after:t,before:n},secondary:{label:Object(a.find)(f,(function(e){return e.value===r})).label,range:p(o,i),after:o,before:i}}}),(function(e,r,t,n,o,a){return[e,r,t&&t.format(),n&&n.format(),o&&o.format(),a&&a.format()].join(":")})),j=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"period=month&compare=previous_year",t=g(e,r),n=t.period,o=t.compare,a=t.after,i=t.before,c=v(n,o,a,i),u=c.primaryStart,l=c.primaryEnd,s=c.secondaryStart,f=c.secondaryEnd;return O(n,o,u,l,s,f)},_=function(e,r){var t=o()(e),n=o()(r);return t.diff(n,"days")},k=function(e,r,t,n,a){var i=o()(e);if("previous_year"===n)return i.clone().subtract(1,"years");var c=o()(r),u=o()(t),l=c.diff(u,a);return i.clone().subtract(l,a)};function S(e){var r=[];if("custom"===e.period){var t=j(e).primary,n=_(t.before,t.after);r=n>=365?["day","week","month","quarter","year"]:n>=90?["day","week","month","quarter"]:n>=28?["day","week","month"]:n>=7?["day","week"]:n>1&&n<7?["day"]:["hour","day"]}else switch(e.period){case"today":case"yesterday":r=["hour","day"];break;case"week":case"last_week":r=["day"];break;case"month":case"last_month":r=["day","week"];break;case"quarter":case"last_quarter":r=["day","week","month"];break;case"year":case"last_year":r=["day","week","month","quarter"];break;default:r=["day"]}return r}function Y(e){var r=S(e),t=r[0],n=e.interval||t;return e.interval&&!r.includes(e.interval)&&(n=t),n}function D(e){var r=e.chartType;return["line","bar"].includes(r)?r:"line"}var M=63,x=9,L="m/d/Y";function P(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t="%B %-d, %Y",n="%B %-d, %Y",o="%Y-%m-%d",a="%b %Y",c=L;switch(e){case"hour":t="%_I%p %B %-d, %Y",n="%_I%p %b %-d, %Y",o="%_I%p",a="%b %-d, %Y",c="h A";break;case"day":r<M?o="%-d":(o="%b",a="%Y");break;case"week":r<x?(o="%-d",a="%b %Y"):(o="%b",a="%Y"),t=Object(i.__)("Week of %B %-d, %Y",'woocommerce'),n=Object(i.__)("Week of %B %-d, %Y",'woocommerce');break;case"quarter":case"month":t="%B %Y",n="%B %Y",o="%b",a="%Y";break;case"year":t="%Y",n="%Y",o="%Y"}return{screenReaderFormat:t,tooltipLabelFormat:n,xFormat:o,x2Format:a,tableFormat:c}}function E(e){var r=e.userLocale,t=e.weekdaysShort;"en"!==o.a.locale()&&o.a.updateLocale(r,{longDateFormat:{L:Object(i.__)("MM/DD/YYYY",'woocommerce'),LL:Object(i.__)("MMMM D, YYYY",'woocommerce'),LLL:Object(i.__)("D MMMM YYYY LT",'woocommerce'),LLLL:Object(i.__)("dddd, D MMMM YYYY LT",'woocommerce'),LT:Object(i.__)("HH:mm",'woocommerce')},weekdaysMin:t})}var N={invalid:Object(i.__)("Invalid date",'woocommerce'),future:Object(i.__)("Select a date in the past",'woocommerce'),startAfterEnd:Object(i.__)("Start date must be before end date",'woocommerce'),endBeforeStart:Object(i.__)("Start date must be before end date",'woocommerce')};function T(e,r,t,n,a){var i=m(a,r);return i?o()().isBefore(i,"day")?{date:null,error:N.future}:"after"===e&&t&&i.isAfter(t,"day")?{date:null,error:N.startAfterEnd}:"before"===e&&n&&i.isBefore(n,"day")?{date:null,error:N.endBeforeStart}:{date:i}:{date:null,error:N.invalid}}}});