define(['exports', 'preact/jsx-runtime', './Grid-a8a51c37', './StyledDatePickerButton-e886e52a', './useTranslationBundle-7c40cb58', './useUser-797287de', './getFormatParse-3d7186b3', './logger-0f873e29', './maskUtils-9370948f', 'preact/compat', './useCellNavigation-4138513e', './calendarDateUtils-5e25297c', './_curry2-86c52b86'], (function(e,t,r,o,a,n,s,i,l,c,u,d,p){"use strict";function g(e){return"[object Number]"===Object.prototype.toString.call(e)}var b=p._curry2((function(e,t){if(!g(e)||!g(t))throw new TypeError("Both arguments to range must be numbers");for(var r=[],o=e;o<t;)r.push(o),o+=1;return r}));const v=e=>{const{buttonProps:r}=(({isCurrent:e,isFocusable:t,isFocused:r,isSelected:o,month:s,onAction:i,onNavigation:d})=>{const{locale:p}=n.useUser(),g=c.useMemo((()=>({short:l.getMonthName(p,s,"*","short"),long:l.getMonthName(p,s,"*","long")})),[p,s]),b=a.useTranslationBundle("@oracle/oraclejet-preact"),v=`${g.long}${e?`, ${b.datePicker_currentDate()}`:""}${o?`, ${b.datePicker_selected()}`:""}`,m=u.useFocusableCell({isFocusable:t,isFocused:r}),h=u.useCellNavigation({navigationMap:{ArrowDown:"down",ArrowLeft:{ltr:"previous",rtl:"next"},ArrowRight:{ltr:"next",rtl:"previous"},ArrowUp:"up"},payload:{month:s},onAction:i,onNavigation:d});return{buttonProps:{"aria-label":v,isActivable:!0,label:g.short,isHoverable:!0,isSelected:o,isToday:e,variant:"month",...m,...h}}})(e);return t.jsx(o.StyledDatePickerButton,{...r})},m=b(1,13),h=e=>{const{buttonProps:r}=(({isCurrent:e,isFocusable:t,isFocused:r,isSelected:o,year:s,onAction:i,onNavigation:l})=>{const{locale:c}=n.useUser(),p=d.getNumericFormattedYear(c,s,1),g=a.useTranslationBundle("@oracle/oraclejet-preact");return{buttonProps:{"aria-label":`${p}${e?`, ${g.datePicker_currentDate()}`:""}${o?`, ${g.datePicker_selected()}`:""}`,isActivable:!0,label:p,isHoverable:!0,isSelected:o,isToday:e,variant:"year",...u.useFocusableCell({isFocusable:t,isFocused:r}),...u.useCellNavigation({navigationMap:{ArrowDown:"down",ArrowLeft:{ltr:"previous",rtl:"next"},ArrowRight:{ltr:"next",rtl:"previous"},ArrowUp:"up",PageDown:"previousDecade",PageUp:"nextDecade"},payload:{year:s},onAction:i,onNavigation:l})}}})(e);return t.jsx(o.StyledDatePickerButton,{...r})};e.MonthsGridView=({currentMonth:e,focusableMonth:o,isFocused:n=!1,selectedMonth:s,testId:i,onAction:l,onNavigation:c})=>{const u=a.useTranslationBundle("@oracle/oraclejet-preact").datePicker_months();return t.jsx(r.Grid,{role:"grid",gap:["13.5x","0x"],testId:i,"aria-label":u,children:[0,1,2].map((a=>t.jsx(r.Grid,{role:"row",gap:["0x","3x"],gridTemplateColumns:"repeat(4, 1fr)",children:[0,1,2,3].map((r=>{const i=m[4*a+r];return t.jsx("div",{role:"gridcell",children:t.jsx(v,{month:i,isCurrent:i===e,isFocusable:i===o,isFocused:i===o&&n,isSelected:i===s,onAction:l,onNavigation:c},`${i}`)})}))},a)))})},e.YearsGridView=({currentYear:e,focusableYear:o,isFocused:n=!1,selectedYear:s,testId:i,onAction:l,onNavigation:c})=>{const u=d.getClosestDecade(o),p=a.useTranslationBundle("@oracle/oraclejet-preact").datePicker_years();return t.jsx(r.Grid,{role:"grid",gap:["13.5x","0x"],testId:i,"aria-label":p,children:[0,1,2].map((a=>t.jsx(r.Grid,{role:"row",gap:["0x","3x"],gridTemplateColumns:"repeat(4, 1fr)",children:b(4*a,4*a+4).map((r=>{const a=u+r;return a<u+11?t.jsx("div",{role:"gridcell",children:t.jsx(h,{year:a,isCurrent:a===e,isFocusable:a===o,isFocused:a===o&&n,isSelected:a===s,onAction:l,onNavigation:c},`${a}`)}):null}))},a)))})}}));
//# sourceMappingURL=YearsGridView-e645d5de.js.map
