"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../panels/DecadePanel/index.js"),f=7;function n(t,e){if(!t&&!e)return!0;if(!t||!e)return!1}function Y(t,e,r){const u=n(e,r);if(typeof u=="boolean")return u;const a=Math.floor(t.getYear(e)/10),o=Math.floor(t.getYear(r)/10);return a===o}function m(t,e,r){const u=n(e,r);return typeof u=="boolean"?u:t.getYear(e)===t.getYear(r)}function M(t,e){return Math.floor(t.getMonth(e)/3)+1}function E(t,e,r){const u=n(e,r);return typeof u=="boolean"?u:m(t,e,r)&&M(t,e)===M(t,r)}function k(t,e,r){const u=n(e,r);return typeof u=="boolean"?u:m(t,e,r)&&t.getMonth(e)===t.getMonth(r)}function i(t,e,r){const u=n(e,r);return typeof u=="boolean"?u:t.getYear(e)===t.getYear(r)&&t.getMonth(e)===t.getMonth(r)&&t.getDate(e)===t.getDate(r)}function y(t,e,r){const u=n(e,r);return typeof u=="boolean"?u:t.getHour(e)===t.getHour(r)&&t.getMinute(e)===t.getMinute(r)&&t.getSecond(e)===t.getSecond(r)}function p(t,e,r,u){const a=n(r,u);return typeof a=="boolean"?a:t.locale.getWeek(e,r)===t.locale.getWeek(e,u)}function d(t,e,r){return i(t,e,r)&&y(t,e,r)}function q(t,e,r,u){return!e||!r||!u?!1:!i(t,e,u)&&!i(t,r,u)&&t.isAfter(u,e)&&t.isAfter(r,u)}function b(t,e,r){const u=e.locale.getWeekFirstDay(t),a=e.setDate(r,1),o=e.getWeekDay(a);let s=e.addDate(a,u-o);return e.getMonth(s)===e.getMonth(r)&&e.getDate(s)>1&&(s=e.addDate(s,-7)),s}function W(t,e,r,u=1){switch(e){case"year":return r.addYear(t,u*10);case"quarter":case"month":return r.addYear(t,u);default:return r.addMonth(t,u)}}function _(t,{generateConfig:e,locale:r,format:u}){return typeof u=="function"?u(t):e.locale.format(r.locale,t,u)}function F(t,{generateConfig:e,locale:r,formatList:u}){return!t||typeof u[0]=="function"?null:e.locale.parse(r.locale,t,u)}function S({cellDate:t,mode:e,disabledDate:r,generateConfig:u}){if(!r)return!1;const a=(o,s,D)=>{let l=s;for(;l<=D;){let c;switch(o){case"date":{if(c=u.setDate(t,l),!r(c))return!1;break}case"month":{if(c=u.setMonth(t,l),!S({cellDate:c,mode:"month",generateConfig:u,disabledDate:r}))return!1;break}case"year":{if(c=u.setYear(t,l),!S({cellDate:c,mode:"year",generateConfig:u,disabledDate:r}))return!1;break}}l+=1}return!0};switch(e){case"date":case"week":return r(t);case"month":{const s=u.getDate(u.getEndDate(t));return a("date",1,s)}case"quarter":{const o=Math.floor(u.getMonth(t)/3)*3,s=o+2;return a("month",o,s)}case"year":return a("month",0,11);case"decade":{const o=u.getYear(t),s=Math.floor(o/h.DECADE_UNIT_DIFF)*h.DECADE_UNIT_DIFF,D=s+h.DECADE_UNIT_DIFF-1;return a("year",s,D)}}}exports.WEEK_DAY_COUNT=f;exports.formatValue=_;exports.getCellDateDisabled=S;exports.getClosingViewDate=W;exports.getQuarter=M;exports.getWeekStartDate=b;exports.isEqual=d;exports.isInRange=q;exports.isNullEqual=n;exports.isSameDate=i;exports.isSameDecade=Y;exports.isSameMonth=k;exports.isSameQuarter=E;exports.isSameTime=y;exports.isSameWeek=p;exports.isSameYear=m;exports.parseValue=F;
