|
|
(globalThis.webpackChunkweb_stories_wp=globalThis.webpackChunkweb_stories_wp||[]).push([[2392],{20773:(e,t,r)=>{var n="__lodash_hash_undefined__",a="[object Function]",o="[object GeneratorFunction]",i=/^\[object .+?Constructor\]$/,c="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,u="object"==typeof self&&self&&self.Object===Object&&self,l=c||u||Function("return this")();var s,f=Array.prototype,p=Function.prototype,v=Object.prototype,d=l["__core-js_shared__"],y=(s=/[^.]+$/.exec(d&&d.keys&&d.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",m=p.toString,h=v.hasOwnProperty,b=v.toString,w=RegExp("^"+m.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=f.splice,O=T(l,"Map"),D=T(Object,"create");function Hash(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ListCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function MapCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function _(e,t){for(var r,n,a=e.length;a--;)if((r=e[a][0])===(n=t)||r!=r&&n!=n)return a;return-1}function x(e){if(!N(e)||(t=e,y&&y in t))return!1;var t,r=function(e){var t=N(e)?b.call(e):"";return t==a||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?w:i;return r.test(function(e){if(null!=e){try{return m.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function k(e,t){var r,n,a=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?a["string"==typeof t?"string":"hash"]:a.map}function T(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return x(r)?r:void 0}function E(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],o=r.cache;if(o.has(a))return o.get(a);var i=e.apply(this,n);return r.cache=o.set(a,i),i};return r.cache=new(E.Cache||MapCache),r}function N(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}Hash.prototype.clear=function(){this.__data__=D?D(null):{}},Hash.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Hash.prototype.get=function(e){var t=this.__data__;if(D){var r=t[e];return r===n?void 0:r}return h.call(t,e)?t[e]:void 0},Hash.prototype.has=function(e){var t=this.__data__;return D?void 0!==t[e]:h.call(t,e)},Hash.prototype.set=function(e,t){return this.__data__[e]=D&&void 0===t?n:t,this},ListCache.prototype.clear=function(){this.__data__=[]},ListCache.prototype.delete=function(e){var t=this.__data__,r=_(t,e);return!(r<0)&&(r==t.length-1?t.pop():g.call(t,r,1),!0)},ListCache.prototype.get=function(e){var t=this.__data__,r=_(t,e);return r<0?void 0:t[r][1]},ListCache.prototype.has=function(e){return _(this.__data__,e)>-1},ListCache.prototype.set=function(e,t){var r=this.__data__,n=_(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},MapCache.prototype.clear=function(){this.__data__={hash:new Hash,map:new(O||ListCache),string:new Hash}},MapCache.prototype.delete=function(e){return k(this,e).delete(e)},MapCache.prototype.get=function(e){return k(this,e).get(e)},MapCache.prototype.has=function(e){return k(this,e).has(e)},MapCache.prototype.set=function(e,t){return k(this,e).set(e,t),this},E.Cache=MapCache,e.exports=E},6925:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Calendar:()=>vt,CenturyView:()=>CenturyView,DecadeView:()=>DecadeView,MonthView:()=>MonthView,Navigation:()=>Navigation,YearView:()=>YearView,default:()=>dt});var n=r(67294),a=r(45697),o=r.n(a);function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=i(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}const c=function(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n};var u=r(20773);function l(e){return JSON.stringify(e)}function s(e){if(!e||-1===e.indexOf("-")||!function(e){return e.toLowerCase()===e}(e))return e;var t=e.split("-"),r=t[0],n=void 0===r?"":r,a=t[1],o=void 0===a?"":a;return"".concat(n,"-").concat(o.toUpperCase())}var f=u((function(e){var t,r=void 0===e?{}:e,n=r.useFallbackLocale,a=void 0===n||n,o=r.fallbackLocale,i=void 0===o?"en-US":o,c=[];return"undefined"!=typeof navigator&&(c=c.concat(navigator.languages,navigator.language)),a&&c.push(i),(t=c,t.filter((function(e,r){return e&&t.indexOf(e)===r}))).map(s)}),l);var p=u((function(e){return f(e)[0]||null}),l);const v=p;function d(e,t,r){return function(n,a){void 0===a&&(a=r);var o=e(n)+a;return t(o)}}function y(e){return function(t){return new Date(e(t).getTime()-1)}}function m(e,t){return function(r){return[e(r),t(r)]}}function h(e){if(e instanceof Date)return e.getFullYear();if("number"==typeof e)return e;var t=parseInt(e,10);if("string"==typeof e&&!isNaN(t))return t;throw new Error("Failed to get year from date: ".concat(e,"."))}function b(e){if(e instanceof Date)return e.getMonth();throw new Error("Failed to get month from date: ".concat(e,"."))}function w(e){if(e instanceof Date)return e.getDate();throw new Error("Failed to get year from date: ".concat(e,"."))}function g(e){var t=h(e),r=t+(1-t)%100,n=new Date;return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}var O=d(h,g,-100),D=d(h,g,100),_=y(D),x=d(h,_,-100),k=(d(h,_,100),m(g,_));function T(e){var t=h(e),r=t+(1-t)%10,n=new Date;return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}var E=d(h,T,-10),N=d(h,T,10),S=y(N),C=d(h,S,-10),A=(d(h,S,10),m(T,S));function j(e){var t=h(e),r=new Date;return r.setFullYear(t,0,1),r.setHours(0,0,0,0),r}var L=d(h,j,-1),M=d(h,j,1),W=y(M),I=d(h,W,-1),P=(d(h,W,1),m(j,W));function Y(e,t){return function(r,n){void 0===n&&(n=t);var a=h(r),o=b(r)+n,i=new Date;return i.setFullYear(a,o,1),i.setHours(0,0,0,0),e(i)}}function R(e){var t=h(e),r=b(e),n=new Date;return n.setFullYear(t,r,1),n.setHours(0,0,0,0),n}var F=Y(R,-1),V=Y(R,1),H=y(V),q=Y(H,-1),U=(Y(H,1),m(R,H));function B(e,t){return function(r,n){void 0===n&&(n=t);var a=h(r),o=b(r),i=w(r)+n,c=new Date;return c.setFullYear(a,o,i),c.setHours(0,0,0,0),e(c)}}function G(e){var t=h(e),r=b(e),n=w(e),a=new Date;return a.setFullYear(t,r,n),a.setHours(0,0,0,0),a}B(G,-1);var $,J=y(B(G,1)),Q=(B(J,-1),B(J,1),m(G,J));function K(e){return w(H(e))}var X={ARABIC:"Arabic",HEBREW:"Hebrew",ISO_8601:"ISO 8601",US:"US"},Z=(($={})[X.US]=["en-CA","en-US","es-AR","es-BO","es-CL","es-CO","es-CR","es-DO","es-EC","es-GT","es-HN","es-MX","es-NI","es-PA","es-PE","es-PR","es-SV","es-VE","pt-BR"],$[X.ARABIC]=["ar","ar-AE","ar-BH","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LY","ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-YE","dv","dv-MV","ps","ps-AR"],$[X.HEBREW]=["he","he-IL"],$),z=[0,1,2,3,4,5,6],ee=new Map;function te(e){return function(t,r){return function(e){return function(t,r){var n=t||v();ee.has(n)||ee.set(n,new Map);var a=ee.get(n);return a.has(e)||a.set(e,new Intl.DateTimeFormat(n||void 0,e).format),a.get(e)(r)}}(e)(t,function(e){var t=new Date(e);return new Date(t.setHours(12))}(r))}}te({day:"numeric",month:"numeric",year:"numeric"});var re=te({day:"numeric"}),ne=te({day:"numeric",month:"long",year:"numeric"}),ae=te({month:"long"}),oe=te({month:"long",year:"numeric"}),ie=te({weekday:"short"}),ce=te({weekday:"long"}),ue=te({year:"numeric"}),le=z[0],se=z[5],fe=z[6];function pe(e,t){void 0===t&&(t=X.ISO_8601);var r=e.getDay();switch(t){case X.ISO_8601:return(r+6)%7;case X.ARABIC:return(r+1)%7;case X.HEBREW:case X.US:return r;default:throw new Error("Unsupported calendar type.")}}function ve(e,t){void 0===t&&(t=X.ISO_8601);var r=h(e),n=b(e),a=e.getDate()-pe(e,t);return new Date(r,n,a)}function de(e,t){switch(e){case"century":return g(t);case"decade":return T(t);case"year":return j(t);case"month":return R(t);case"day":return G(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function ye(e,t){switch(e){case"century":return D(t);case"decade":return N(t);case"year":return M(t);case"month":return V(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function me(e,t){switch(e){case"century":return _(t);case"decade":return S(t);case"year":return W(t);case"month":return H(t);case"day":return J(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function he(e,t){switch(e){case"century":return k(t);case"decade":return A(t);case"year":return P(t);case"month":return U(t);case"day":return Q(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function be(e,t,r){return void 0===t&&(t=ue),r.map((function(r){return t(e,r)})).join(" – ")}function we(e,t,r){return be(e,t,A(r))}function ge(e,t){void 0===t&&(t=X.ISO_8601);var r=e.getDay();switch(t){case X.ARABIC:case X.HEBREW:return r===se||r===fe;case X.ISO_8601:case X.US:return r===fe||r===le;default:throw new Error("Unsupported calendar type.")}}var Oe=Object.values(X),De=["century","decade","year","month"],_e=o().oneOf(Oe),xe=o().oneOfType([o().string,o().arrayOf(o().string)]),ke=function(e,t,r){var n=e[t];if(!n)return null;if(!(n instanceof Date))return new Error("Invalid prop `".concat(t,"` of type `").concat(typeof n,"` supplied to `").concat(r,"`, expected instance of `Date`."));var a=e.maxDate;return a&&n>a?new Error("Invalid prop `".concat(t,"` of type `").concat(typeof n,"` supplied to `").concat(r,"`, minDate cannot be larger than maxDate.")):null},Te=function(e,t,r){var n=e[t];if(!n)return null;if(!(n instanceof Date))return new Error("Invalid prop `".concat(t,"` of type `").concat(typeof n,"` supplied to `").concat(r,"`, expected instance of `Date`."));var a=e.minDate;return a&&n<a?new Error("Invalid prop `".concat(t,"` of type `").concat(typeof n,"` supplied to `").concat(r,"`, maxDate cannot be smaller than minDate.")):null},Ee=o().oneOfType([o().func,o().exact({current:o().any})]),Ne=o().oneOfType([o().instanceOf(Date),o().arrayOf(o().instanceOf(Date))]),Se=o().arrayOf(o().oneOf(De)),Ce=function(e,t,r){var n=e[t];return void 0===n||"string"==typeof n&&-1!==De.indexOf(n)?null:new Error("Invalid prop `".concat(t,"` of value `").concat(n,"` supplied to `").concat(r,"`, expected one of [").concat(De.map((function(e){return'"'.concat(e,'"')})).join(", "),"]."))};Ce.isRequired=function(e,t,r,n,a){var o=e[t];return o?Ce(e,t,r):new Error("The prop `".concat(t,"` is marked as required in `").concat(r,"`, but its value is `").concat(o,"`."))};var Ae={activeStartDate:o().instanceOf(Date).isRequired,hover:o().instanceOf(Date),locale:o().string,maxDate:Te,minDate:ke,onClick:o().func,onMouseOver:o().func,tileClassName:o().oneOfType([o().func,xe]),tileContent:o().oneOfType([o().func,o().node]),value:Ne,valueType:o().string},je={activeStartDate:o().instanceOf(Date).isRequired,classes:o().arrayOf(o().string).isRequired,date:o().instanceOf(Date).isRequired,locale:o().string,maxDate:Te,minDate:ke,onClick:o().func,onMouseOver:o().func,style:o().objectOf(o().oneOfType([o().string,o().number])),tileClassName:o().oneOfType([o().func,xe]),tileContent:o().oneOfType([o().func,o().node]),tileDisabled:o().func},Le="react-calendar__navigation";function Navigation(e){var t,r=e.activeStartDate,a=e.drillUp,o=e.formatMonthYear,i=void 0===o?oe:o,c=e.formatYear,u=void 0===c?ue:c,l=e.locale,s=e.maxDate,f=e.minDate,v=e.navigationAriaLabel,d=void 0===v?"":v,y=e.navigationAriaLive,m=e.navigationLabel,h=e.next2AriaLabel,b=void 0===h?"":h,w=e.next2Label,g=void 0===w?"»":w,D=e.nextAriaLabel,_=void 0===D?"":D,T=e.nextLabel,S=void 0===T?"›":T,A=e.prev2AriaLabel,j=void 0===A?"":A,W=e.prev2Label,P=void 0===W?"«":W,Y=e.prevAriaLabel,R=void 0===Y?"":Y,H=e.prevLabel,U=void 0===H?"‹":H,B=e.setActiveStartDate,G=e.showDoubleView,$=e.view,J=e.views.indexOf($)>0,Q="century"!==$,K=function(e,t){switch(e){case"century":return O(t);case"decade":return E(t);case"year":return L(t);case"month":return F(t);default:throw new Error("Invalid rangeType: ".concat(e))}}($,r),X=Q?function(e,t){switch(e){case"decade":return E(t,-100);case"year":return L(t,-10);case"month":return F(t,-12);default:throw new Error("Invalid rangeType: ".concat(e))}}($,r):void 0,Z=ye($,r),z=Q?function(e,t){switch(e){case"decade":return N(t,100);case"year":return M(t,10);case"month":return V(t,12);default:throw new Error("Invalid rangeType: ".concat(e))}}($,r):void 0,ee=function(){if(K.getFullYear()<0)return!0;var e=function(e,t){switch(e){case"century":return x(t);case"decade":return C(t);case"year":return I(t);case"month":return q(t);default:throw new Error("Invalid rangeType: ".concat(e))}}($,r);return f&&f>=e}(),te=Q&&function(){if(X.getFullYear()<0)return!0;var e=function(e,t){switch(e){case"decade":return C(t,-100);case"year":return I(t,-10);case"month":return q(t,-12);default:throw new Error("Invalid rangeType: ".concat(e))}}($,r);return f&&f>=e}(),re=s&&s<Z,ne=Q&&s&&s<z;function ae(e){var t=function(){switch($){case"century":return function(e,t,r){return be(e,t,k(r))}(l,u,e);case"decade":return we(l,u,e);case"year":return u(l,e);case"month":return i(l,e);default:throw new Error("Invalid view: ".concat($,"."))}}();return m?m({date:e,label:t,locale:l||p()||void 0,view:$}):t}return n.createElement("div",{className:Le},null!==P&&Q?n.createElement("button",{"aria-label":j,className:"".concat(Le,"__arrow ").concat(Le,"__prev2-button"),disabled:te,onClick:function(){B(X,"prev2")},type:"button"},P):null,null!==U&&n.createElement("button",{"aria-label":R,className:"".concat(Le,"__arrow ").concat(Le,"__prev-button"),disabled:ee,onClick:function(){B(K,"prev")},type:"button"},U),(t="".concat(Le,"__label"),n.createElement("button",{"aria-label":d,"aria-live":y,className:t,disabled:!J,onClick:a,style:{flexGrow:1},type:"button"},n.createElement("span",{className:"".concat(t,"__labelText ").concat(t,"__labelText--from")},ae(r)),G?n.createElement(n.Fragment,null,n.createElement("span",{className:"".concat(t,"__divider")}," – "),n.createElement("span",{className:"".concat(t,"__labelText ").concat(t,"__labelText--to")},ae(Z))):null)),null!==S&&n.createElement("button",{"aria-label":_,className:"".concat(Le,"__arrow ").concat(Le,"__next-button"),disabled:re,onClick:function(){B(Z,"next")},type:"button"},S),null!==g&&Q?n.createElement("button",{"aria-label":b,className:"".concat(Le,"__arrow ").concat(Le,"__next2-button"),disabled:ne,onClick:function(){B(z,"next2")},type:"button"},g):null)}Navigation.propTypes={activeStartDate:o().instanceOf(Date).isRequired,drillUp:o().func.isRequired,formatMonthYear:o().func,formatYear:o().func,locale:o().string,maxDate:o().instanceOf(Date),minDate:o().instanceOf(Date),navigationAriaLabel:o().string,navigationAriaLive:o().string,navigationLabel:o().func,next2AriaLabel:o().string,next2Label:o().node,nextAriaLabel:o().string,nextLabel:o().node,prev2AriaLabel:o().string,prev2Label:o().node,prevAriaLabel:o().string,prevLabel:o().node,setActiveStartDate:o().func.isRequired,showDoubleView:o().bool,view:Ce.isRequired,views:Se.isRequired};var __assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},__assign.apply(this,arguments)},__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r};function Me(e){return"".concat(e,"%")}function Flex(e){var t=e.children,r=e.className,a=e.count,o=e.direction,i=e.offset,c=e.style,u=e.wrap,l=__rest(e,["children","className","count","direction","offset","style","wrap"]);return n.createElement("div",__assign({className:r,style:__assign({display:"flex",flexDirection:o,flexWrap:u?"wrap":"nowrap"},c)},l),n.Children.map(t,(function(e,t){var r=i&&0===t?Me(100*i/a):null;return n.cloneElement(e,__assign(__assign({},e.props),{style:{flexBasis:Me(100/a),flexShrink:0,flexGrow:0,overflow:"hidden",marginLeft:r,marginInlineStart:r,marginInlineEnd:0}}))})))}function We(e,t){return t[0]<=e&&t[1]>=e}function Ie(e,t){return We(e[0],t)||We(e[1],t)}function Pe(e,t,r){var n=[];if(Ie(t,e)){n.push(r);var a=We(e[0],t),o=We(e[1],t);a&&n.push("".concat(r,"Start")),o&&n.push("".concat(r,"End")),a&&o&&n.push("".concat(r,"BothEnds"))}return n}function Ye(e){if(!e)throw new Error("args is required");var t=e.value,r=e.date,n=e.hover,a="react-calendar__tile",o=[a];if(!r)return o;var i=new Date,c=function(){if(Array.isArray(r))return r;var t=e.dateType;if(!t)throw new Error("dateType is required when date is not an array of two dates");return he(t,r)}();if(We(i,c)&&o.push("".concat(a,"--now")),!t)return o;var u,l,s=function(){if(Array.isArray(t))return t;var r=e.valueType;if(!r)throw new Error("valueType is required when value is not an array of two dates");return he(r,t)}();l=c,(u=s)[0]<=l[0]&&u[1]>=l[1]?o.push("".concat(a,"--active")):Ie(s,c)&&o.push("".concat(a,"--hasActive"));var f=Pe(s,c,"".concat(a,"--range"));o.push.apply(o,f);var p=Array.isArray(t)?t:[t];if(n&&1===p.length){var v=Pe(n>s[0]?[s[0],n]:[n,s[0]],c,"".concat(a,"--hover"));o.push.apply(o,v)}return o}Flex.propTypes={children:o().node,className:o().string,count:o().number.isRequired,direction:o().string,offset:o().number,style:o().objectOf(o().oneOfType([o().string,o().number])),wrap:o().bool};var TileGroup_assign=function(){return TileGroup_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},TileGroup_assign.apply(this,arguments)},TileGroup_rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r};function TileGroup(e){for(var t=e.className,r=e.count,a=void 0===r?3:r,o=e.dateTransform,i=e.dateType,c=e.end,u=e.hover,l=e.offset,s=e.start,f=e.step,p=void 0===f?1:f,v=e.tile,d=e.value,y=e.valueType,m=TileGroup_rest(e,["className","count","dateTransform","dateType","end","hover","offset","start","step","tile","value","valueType"]),h=[],b=s;b<=c;b+=p){var w=o(b);h.push(n.createElement(v,TileGroup_assign({key:w.getTime(),classes:Ye({value:d,valueType:y,date:w,dateType:i,hover:u}),date:w,point:b},m)))}return n.createElement(Flex,{className:t,count:a,offset:l,wrap:!0},h)}TileGroup.propTypes=TileGroup_assign(TileGroup_assign({},Ae),{className:o().string,count:o().number,dateTransform:o().func.isRequired,dateType:o().string,end:o().number.isRequired,offset:o().number,step:o().number,start:o().number.isRequired,tile:o().func.isRequired});var Tile_assign=function(){return Tile_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Tile_assign.apply(this,arguments)};function Tile(e){var t=e.activeStartDate,r=e.children,a=e.classes,o=e.date,i=e.formatAbbr,u=e.locale,l=e.maxDate,s=e.maxDateTransform,f=e.minDate,p=e.minDateTransform,v=e.onClick,d=e.onMouseOver,y=e.style,m=e.tileClassName,h=e.tileContent,b=e.tileDisabled,w=e.view,g=(0,n.useMemo)((function(){return"function"==typeof m?m({activeStartDate:t,date:o,view:w}):m}),[t,o,m,w]),O=(0,n.useMemo)((function(){return"function"==typeof h?h({activeStartDate:t,date:o,view:w}):h}),[t,o,h,w]);return n.createElement("button",{className:c(a,g),disabled:f&&p(f)>o||l&&s(l)<o||b&&b({activeStartDate:t,date:o,view:w}),onClick:v?function(e){return v(o,e)}:void 0,onFocus:d?function(){return d(o)}:void 0,onMouseOver:d?function(){return d(o)}:void 0,style:y,type:"button"},i?n.createElement("abbr",{"aria-label":i(u,o)},r):r,O)}Tile.propTypes=Tile_assign(Tile_assign({},je),{children:o().node.isRequired,formatAbbr:o().func,maxDateTransform:o().func.isRequired,minDateTransform:o().func.isRequired});var Decade_assign=function(){return Decade_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Decade_assign.apply(this,arguments)},Decade_rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},__spreadArray=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},Re="react-calendar__century-view__decades__decade";function Decade(e){var t=e.classes,r=void 0===t?[]:t,a=e.formatYear,o=void 0===a?ue:a,i=Decade_rest(e,["classes","formatYear"]),c=i.date,u=i.locale;return n.createElement(Tile,Decade_assign({},i,{classes:__spreadArray(__spreadArray([],r,!0),[Re],!1),maxDateTransform:S,minDateTransform:T,view:"century"}),we(u,o,c))}Decade.propTypes=Decade_assign(Decade_assign({},je),{formatYear:o().func});var Decades_assign=function(){return Decades_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Decades_assign.apply(this,arguments)};function Decades(e){var t=e.activeStartDate,r=h(g(t)),a=r+99;return n.createElement(TileGroup,Decades_assign({},e,{className:"react-calendar__century-view__decades",dateTransform:T,dateType:"decade",end:a,start:r,step:10,tile:Decade}))}Decades.propTypes=Decades_assign({},Ae);var CenturyView_assign=function(){return CenturyView_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},CenturyView_assign.apply(this,arguments)};function CenturyView(e){return n.createElement("div",{className:"react-calendar__century-view"},n.createElement(Decades,CenturyView_assign({},e)))}var Year_assign=function(){return Year_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Year_assign.apply(this,arguments)},Year_rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Year_spreadArray=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},Fe="react-calendar__decade-view__years__year";function Year(e){var t=e.classes,r=void 0===t?[]:t,a=e.formatYear,o=void 0===a?ue:a,i=Year_rest(e,["classes","formatYear"]),c=i.date,u=i.locale;return n.createElement(Tile,Year_assign({},i,{classes:Year_spreadArray(Year_spreadArray([],r,!0),[Fe],!1),maxDateTransform:W,minDateTransform:j,view:"decade"}),o(u,c))}Year.propTypes=Year_assign(Year_assign({},je),{formatYear:o().func});var Years_assign=function(){return Years_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Years_assign.apply(this,arguments)};function Years(e){var t=e.activeStartDate,r=h(T(t)),a=r+9;return n.createElement(TileGroup,Years_assign({},e,{className:"react-calendar__decade-view__years",dateTransform:function(e){var t=new Date;return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t},dateType:"year",end:a,start:r,tile:Year}))}Years.propTypes=Years_assign({},Ae);var DecadeView_assign=function(){return DecadeView_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},DecadeView_assign.apply(this,arguments)};function DecadeView(e){return n.createElement("div",{className:"react-calendar__decade-view"},n.createElement(Years,DecadeView_assign({},e)))}var Month_assign=function(){return Month_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Month_assign.apply(this,arguments)},Month_rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Month_spreadArray=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},Ve="react-calendar__year-view__months__month";function Month(e){var t=e.classes,r=void 0===t?[]:t,a=e.formatMonth,o=void 0===a?ae:a,i=e.formatMonthYear,c=void 0===i?oe:i,u=Month_rest(e,["classes","formatMonth","formatMonthYear"]),l=u.date,s=u.locale;return n.createElement(Tile,Month_assign({},u,{classes:Month_spreadArray(Month_spreadArray([],r,!0),[Ve],!1),formatAbbr:c,maxDateTransform:H,minDateTransform:R,view:"year"}),o(s,l))}Month.propTypes=Month_assign(Month_assign({},je),{formatMonth:o().func,formatMonthYear:o().func});var Months_assign=function(){return Months_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Months_assign.apply(this,arguments)};function Months(e){var t=h(e.activeStartDate);return n.createElement(TileGroup,Months_assign({},e,{className:"react-calendar__year-view__months",dateTransform:function(e){var r=new Date;return r.setFullYear(t,e,1),r.setHours(0,0,0,0),r},dateType:"month",end:11,start:0,tile:Month}))}Months.propTypes=Months_assign(Months_assign({},Ae),{locale:o().string});var YearView_assign=function(){return YearView_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},YearView_assign.apply(this,arguments)};function YearView(e){return n.createElement("div",{className:"react-calendar__year-view"},n.createElement(Months,YearView_assign({},e)))}var Day_assign=function(){return Day_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Day_assign.apply(this,arguments)},Day_rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},He="react-calendar__month-view__days__day";function Day(e){var t=e.calendarType,r=e.classes,a=void 0===r?[]:r,o=e.currentMonthIndex,i=e.formatDay,c=void 0===i?re:i,u=e.formatLongDate,l=void 0===u?ne:u,s=Day_rest(e,["calendarType","classes","currentMonthIndex","formatDay","formatLongDate"]),f=s.date,p=s.locale,v=[];return a&&v.push.apply(v,a),He&&v.push(He),ge(f,t)&&v.push("".concat(He,"--weekend")),f.getMonth()!==o&&v.push("".concat(He,"--neighboringMonth")),n.createElement(Tile,Day_assign({},s,{classes:v,formatAbbr:l,maxDateTransform:J,minDateTransform:G,view:"month"}),c(p,f))}Day.propTypes=Day_assign(Day_assign({},je),{currentMonthIndex:o().number.isRequired,formatDay:o().func,formatLongDate:o().func});var Days_assign=function(){return Days_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Days_assign.apply(this,arguments)},Days_rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r};function Days(e){var t=e.activeStartDate,r=e.calendarType,a=e.showFixedNumberOfWeeks,o=e.showNeighboringMonth,i=Days_rest(e,["showFixedNumberOfWeeks","showNeighboringMonth"]),c=h(t),u=b(t),l=a||o,s=pe(t,r),f=l?0:s,p=1+(l?-s:0),v=function(){if(a)return p+42-1;var e=K(t);if(o){var n=new Date;return n.setFullYear(c,u,e),n.setHours(0,0,0,0),e+(7-pe(n,r)-1)}return e}();return n.createElement(TileGroup,Days_assign({},i,{className:"react-calendar__month-view__days",count:7,currentMonthIndex:u,dateTransform:function(e){var t=new Date;return t.setFullYear(c,u,e),t.setHours(0,0,0,0),t},dateType:"day",end:v,offset:f,start:p,tile:Day}))}Days.propTypes=Days_assign({calendarType:_e,showFixedNumberOfWeeks:o().bool,showNeighboringMonth:o().bool},Ae);var qe="react-calendar__month-view__weekdays",Ue="".concat(qe,"__weekday");function Weekdays(e){for(var t,r=e.calendarType,a=e.formatShortWeekday,o=void 0===a?ie:a,i=e.formatWeekday,u=void 0===i?ce:i,l=e.locale,s=e.onMouseLeave,f=R(new Date),p=h(f),v=b(f),d=[],y=1;y<=7;y+=1){var m=new Date(p,v,y-pe(f,r)),w=u(l,m);d.push(n.createElement("div",{key:y,className:c(Ue,(t=m,t.getDay()===(new Date).getDay()&&"".concat(Ue,"--current")),ge(m,r)&&"".concat(Ue,"--weekend"))},n.createElement("abbr",{"aria-label":w,title:w},o(l,m).replace(".",""))))}return n.createElement(Flex,{className:qe,count:7,onFocus:s,onMouseOver:s},d)}Weekdays.propTypes={calendarType:_e,formatShortWeekday:o().func,formatWeekday:o().func,locale:o().string,onMouseLeave:o().func};var WeekNumber_assign=function(){return WeekNumber_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},WeekNumber_assign.apply(this,arguments)},WeekNumber_rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},Be="react-calendar__tile";function WeekNumber(e){var t=e.onClickWeekNumber,r=e.weekNumber,a=n.createElement("span",null,r);if(t){var o=e.date,i=e.onClickWeekNumber,c=e.weekNumber,u=WeekNumber_rest(e,["date","onClickWeekNumber","weekNumber"]);return n.createElement("button",WeekNumber_assign({},u,{className:Be,onClick:function(e){return i(c,o,e)},type:"button"}),a)}e.date,e.onClickWeekNumber,e.weekNumber,u=WeekNumber_rest(e,["date","onClickWeekNumber","weekNumber"]);return n.createElement("div",WeekNumber_assign({},u,{className:Be}),a)}function WeekNumbers(e){var t=e.activeStartDate,r=e.calendarType,a=e.onClickWeekNumber,o=e.onMouseLeave,i=e.showFixedNumberOfWeeks,c=function(){if(i)return 6;var e=K(t)-(7-pe(t,r));return 1+Math.ceil(e/7)}(),u=function(){for(var e=h(t),n=b(t),a=w(t),o=[],i=0;i<c;i+=1)o.push(ve(new Date(e,n,a+7*i),r));return o}(),l=u.map((function(e){return function(e,t){void 0===t&&(t=X.ISO_8601);var r,n=t===X.US?X.US:X.ISO_8601,a=ve(e,t),o=h(e)+1;do{r=ve(new Date(o,0,n===X.ISO_8601?4:1),t),o-=1}while(e<r);return Math.round((a.getTime()-r.getTime())/6048e5)+1}(e,r)}));return n.createElement(Flex,{className:"react-calendar__month-view__weekNumbers",count:c,direction:"column",onFocus:o,onMouseOver:o,style:{flexBasis:"calc(100% * (1 / 8)",flexShrink:0}},l.map((function(e,t){var r=u[t];if(!r)throw new Error("date is not defined");return n.createElement(WeekNumber,{key:e,date:r,onClickWeekNumber:a,weekNumber:e})})))}WeekNumber.propTypes={date:o().instanceOf(Date).isRequired,onClickWeekNumber:o().func,weekNumber:o().node.isRequired},WeekNumbers.propTypes={activeStartDate:o().instanceOf(Date).isRequired,calendarType:_e,onClickWeekNumber:o().func,onMouseLeave:o().func,showFixedNumberOfWeeks:o().bool};var MonthView_assign=function(){return MonthView_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},MonthView_assign.apply(this,arguments)},MonthView_rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r};function MonthView(e){var t=e.activeStartDate,r=e.locale,a=e.onMouseLeave,o=e.showFixedNumberOfWeeks,i=e.calendarType,u=void 0===i?function(e){for(var t=0,r=Object.entries(Z);t<r.length;t++){var n=r[t],a=n[0];if(n[1].includes(e))return a}return X.ISO_8601}(r):i,l=e.formatShortWeekday,s=e.formatWeekday,f=e.onClickWeekNumber,p=e.showWeekNumbers,v=MonthView_rest(e,["calendarType","formatShortWeekday","formatWeekday","onClickWeekNumber","showWeekNumbers"]);var d="react-calendar__month-view";return n.createElement("div",{className:c(d,p?"".concat(d,"--weekNumbers"):"")},n.createElement("div",{style:{display:"flex",alignItems:"flex-end"}},p?n.createElement(WeekNumbers,{activeStartDate:t,calendarType:u,onClickWeekNumber:f,onMouseLeave:a,showFixedNumberOfWeeks:o}):null,n.createElement("div",{style:{flexGrow:1,width:"100%"}},n.createElement(Weekdays,{calendarType:u,formatShortWeekday:l,formatWeekday:s,locale:r,onMouseLeave:a}),n.createElement(Days,MonthView_assign({calendarType:u},v)))))}MonthView.propTypes=MonthView_assign(MonthView_assign({},Ae),{calendarType:_e,formatDay:o().func,formatLongDate:o().func,formatShortWeekday:o().func,formatWeekday:o().func,onClickWeekNumber:o().func,onMouseLeave:o().func,showFixedNumberOfWeeks:o().bool,showNeighboringMonth:o().bool,showWeekNumbers:o().bool});var Calendar_assign=function(){return Calendar_assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Calendar_assign.apply(this,arguments)},Ge="react-calendar",$e=["century","decade","year","month"],Je=["decade","year","month","day"],Qe=new Date;Qe.setFullYear(1,0,1),Qe.setHours(0,0,0,0);var Ke=new Date(864e13);function Xe(e){return e instanceof Date?e:new Date(e)}function Ze(e,t){return $e.slice($e.indexOf(e),$e.indexOf(t)+1)}function ze(e,t,r){return e&&function(e,t,r){return-1!==Ze(t,r).indexOf(e)}(e,t,r)?e:r}function et(e){var t=$e.indexOf(e);return Je[t]}function tt(e,t){var r=e.value,n=e.minDate,a=e.maxDate,o=e.maxDetail,i=function(e,t){var r=Array.isArray(e)?e[t]:e;if(!r)return null;var n=Xe(r);if(isNaN(n.getTime()))throw new Error("Invalid date: ".concat(e));return n}(r,t);if(!i)return null;var c=et(o);return function(e,t,r){return t&&t>e?t:r&&r<e?r:e}(function(){switch(t){case 0:return de(c,i);case 1:return me(c,i);default:throw new Error("Invalid index value: ".concat(t))}}(),n,a)}var rt=function(e){return tt(e,0)},nt=function(e){return tt(e,1)},at=function(e){return[rt,nt].map((function(t){return t(e)}))};function ot(e){var t=e.maxDate,r=e.maxDetail,n=e.minDate,a=e.minDetail,o=e.value;return de(ze(e.view,a,r),rt({value:o,minDate:n,maxDate:t,maxDetail:r})||new Date)}function it(e){return e&&(!Array.isArray(e)||1===e.length)}function ct(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var ut,lt=(0,n.forwardRef)((function Calendar(e,t){var r,a=e.activeStartDate,o=e.allowPartialRange,i=e.calendarType,u=e.className,l=e.defaultActiveStartDate,s=e.defaultValue,f=e.defaultView,p=e.formatDay,v=e.formatLongDate,d=e.formatMonth,y=e.formatMonthYear,m=e.formatShortWeekday,h=e.formatWeekday,b=e.formatYear,w=e.goToRangeStartOnSelect,g=void 0===w||w,O=e.inputRef,D=e.locale,_=e.maxDate,x=void 0===_?Ke:_,k=e.maxDetail,T=void 0===k?"month":k,E=e.minDate,N=void 0===E?Qe:E,S=e.minDetail,C=void 0===S?"century":S,A=e.navigationAriaLabel,j=e.navigationAriaLive,L=e.navigationLabel,M=e.next2AriaLabel,W=e.next2Label,I=e.nextAriaLabel,P=e.nextLabel,Y=e.onActiveStartDateChange,R=e.onChange,F=e.onClickDay,V=e.onClickDecade,H=e.onClickMonth,q=e.onClickWeekNumber,U=e.onClickYear,B=e.onDrillDown,G=e.onDrillUp,$=e.onViewChange,J=e.prev2AriaLabel,Q=e.prev2Label,K=e.prevAriaLabel,X=e.prevLabel,Z=e.returnValue,z=void 0===Z?"start":Z,ee=e.selectRange,te=e.showDoubleView,re=e.showFixedNumberOfWeeks,ne=e.showNavigation,ae=void 0===ne||ne,oe=e.showNeighboringMonth,ie=void 0===oe||oe,ce=e.showWeekNumbers,ue=e.tileClassName,le=e.tileContent,se=e.tileDisabled,fe=e.value,pe=e.view,ve=(0,n.useState)(l),he=ve[0],be=ve[1],we=(0,n.useState)(null),ge=we[0],Oe=we[1],De=(0,n.useState)(Array.isArray(s)?s.map((function(e){return null!==e?Xe(e):e})):null!=s?Xe(s):s),_e=De[0],xe=De[1],ke=(0,n.useState)(f),Te=ke[0],Ee=ke[1],Ne=a||he||function(e){var t=e.activeStartDate,r=e.defaultActiveStartDate,n=e.defaultValue,a=e.defaultView,o=e.maxDate,i=e.maxDetail,c=e.minDate,u=e.minDetail,l=e.value,s=e.view,f=ze(s,u,i),p=t||r;return p?de(f,p):ot({maxDate:o,maxDetail:i,minDate:c,minDetail:u,value:l||n,view:s||a})}({activeStartDate:a,defaultActiveStartDate:l,defaultValue:s,defaultView:f,maxDate:x,maxDetail:T,minDate:N,minDetail:C,value:fe,view:pe}),Se=(r=ee&&it(_e)?_e:void 0!==fe?fe:_e)?Array.isArray(r)?r.map((function(e){return null!==e?Xe(e):e})):null!==r?Xe(r):r:null,Ce=et(T),Ae=ze(pe||Te,C,T),je=Ze(C,T),Le=ee?ge:null,Me=je.indexOf(Ae)<je.length-1,We=je.indexOf(Ae)>0,Ie=(0,n.useCallback)((function(e){return function(){switch(z){case"start":return rt;case"end":return nt;case"range":return at;default:throw new Error("Invalid returnValue.")}}()({maxDate:x,maxDetail:T,minDate:N,value:e})}),[x,T,N,z]),Pe=(0,n.useCallback)((function(e,t){be(e);var r={action:t,activeStartDate:e,value:Se,view:Ae};Y&&!ct(Ne,e)&&Y(r)}),[Ne,Y,Se,Ae]),Ye=(0,n.useCallback)((function(e,t){var r=function(){switch(Ae){case"century":return V;case"decade":return U;case"year":return H;case"month":return F;default:throw new Error("Invalid view: ".concat(Ae,"."))}}();r&&r(e,t)}),[F,V,H,U,Ae]),Re=(0,n.useCallback)((function(e,t){if(Me){Ye(e,t);var r=je[je.indexOf(Ae)+1];if(!r)throw new Error("Attempted to drill down from the lowest view.");be(e),Ee(r);var n={action:"drillDown",activeStartDate:e,value:Se,view:r};Y&&!ct(Ne,e)&&Y(n),$&&Ae!==r&&$(n),B&&B(n)}}),[Ne,Me,Y,Ye,B,$,Se,Ae,je]),Fe=(0,n.useCallback)((function(){if(We){var e=je[je.indexOf(Ae)-1];if(!e)throw new Error("Attempted to drill up from the highest view.");var t=de(e,Ne);be(t),Ee(e);var r={action:"drillUp",activeStartDate:t,value:Se,view:e};Y&&!ct(Ne,t)&&Y(r),$&&Ae!==e&&$(r),G&&G(r)}}),[Ne,We,Y,G,$,Se,Ae,je]),Ve=(0,n.useCallback)((function(e,t){var r=Se;Ye(e,t);var n,a=ee&&!it(r);if(ee)if(a)n=de(Ce,e);else{if(!r)throw new Error("previousValue is required");if(Array.isArray(r))throw new Error("previousValue must not be an array");n=function(e,t,r){var n=[t,r].sort((function(e,t){return e.getTime()-t.getTime()}));return[de(e,n[0]),me(e,n[1])]}(Ce,r,e)}else n=Ie(e);var i=!ee||a||g?ot({maxDate:x,maxDetail:T,minDate:N,minDetail:C,value:n,view:Ae}):null;t.persist(),be(i),xe(n);var c={action:"onChange",activeStartDate:i,value:n,view:Ae};if(Y&&!ct(Ne,i)&&Y(c),R)if(ee)if(it(n)){if(o){if(Array.isArray(n))throw new Error("value must not be an array");R([n||null,null],t)}}else R(n||null,t);else R(n||null,t)}),[Ne,o,Ie,g,x,T,N,C,Y,R,Ye,ee,Se,Ce,Ae]);function He(e){Oe(e)}function qe(){Oe(null)}function Ue(e){var t={activeStartDate:e?ye(Ae,Ne):de(Ae,Ne),hover:Le,locale:D,maxDate:x,minDate:N,onClick:Me?Re:Ve,onMouseOver:ee?He:null,tileClassName:ue,tileContent:le,tileDisabled:se,value:Se,valueType:Ce};switch(Ae){case"century":return n.createElement(CenturyView,Calendar_assign({formatYear:b},t));case"decade":return n.createElement(DecadeView,Calendar_assign({formatYear:b},t));case"year":return n.createElement(YearView,Calendar_assign({formatMonth:d,formatMonthYear:y},t));case"month":return n.createElement(MonthView,Calendar_assign({calendarType:i,formatDay:p,formatLongDate:v,formatShortWeekday:m,formatWeekday:h,onClickWeekNumber:q,onMouseLeave:ee?qe:null,showFixedNumberOfWeeks:void 0!==re?re:te,showNeighboringMonth:ie,showWeekNumbers:ce},t));default:throw new Error("Invalid view: ".concat(Ae,"."))}}(0,n.useImperativeHandle)(t,(function(){return{activeStartDate:Ne,drillDown:Re,drillUp:Fe,onChange:Ve,setActiveStartDate:Pe,value:Se,view:Ae}}),[Ne,Re,Fe,Ve,Pe,Se,Ae]);var Be=Array.isArray(Se)?Se:[Se];return n.createElement("div",{className:c(Ge,ee&&1===Be.length&&"".concat(Ge,"--selectRange"),te&&"".concat(Ge,"--doubleView"),u),ref:O},ae?n.createElement(Navigation,{activeStartDate:Ne,drillUp:Fe,formatMonthYear:y,formatYear:b,locale:D,maxDate:x,minDate:N,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:L,next2AriaLabel:M,next2Label:W,nextAriaLabel:I,nextLabel:P,prev2AriaLabel:J,prev2Label:Q,prevAriaLabel:K,prevLabel:X,setActiveStartDate:Pe,showDoubleView:te,view:Ae,views:je}):null,n.createElement("div",{className:"".concat(Ge,"__viewContainer"),onBlur:ee?qe:void 0,onMouseLeave:ee?qe:void 0},Ue(),te?Ue(!0):null))})),st=o().instanceOf(Date),ft=o().oneOfType([o().string,o().instanceOf(Date)]),pt=o().oneOfType([ft,(ut=ft,o().arrayOf(ut))]);lt.propTypes={activeStartDate:st,allowPartialRange:o().bool,calendarType:_e,className:xe,defaultActiveStartDate:st,defaultValue:pt,defaultView:Ce,formatDay:o().func,formatLongDate:o().func,formatMonth:o().func,formatMonthYear:o().func,formatShortWeekday:o().func,formatWeekday:o().func,formatYear:o().func,goToRangeStartOnSelect:o().bool,inputRef:Ee,locale:o().string,maxDate:Te,maxDetail:o().oneOf($e),minDate:ke,minDetail:o().oneOf($e),navigationAriaLabel:o().string,navigationAriaLive:o().oneOf(["off","polite","assertive"]),navigationLabel:o().func,next2AriaLabel:o().string,next2Label:o().node,nextAriaLabel:o().string,nextLabel:o().node,onActiveStartDateChange:o().func,onChange:o().func,onClickDay:o().func,onClickDecade:o().func,onClickMonth:o().func,onClickWeekNumber:o().func,onClickYear:o().func,onDrillDown:o().func,onDrillUp:o().func,onViewChange:o().func,prev2AriaLabel:o().string,prev2Label:o().node,prevAriaLabel:o().string,prevLabel:o().node,returnValue:o().oneOf(["start","end","range"]),selectRange:o().bool,showDoubleView:o().bool,showFixedNumberOfWeeks:o().bool,showNavigation:o().bool,showNeighboringMonth:o().bool,showWeekNumbers:o().bool,tileClassName:o().oneOfType([o().func,xe]),tileContent:o().oneOfType([o().func,o().node]),tileDisabled:o().func,value:pt,view:Ce};const vt=lt,dt=lt}}]); |