diff --git a/README.md b/README.md index 7b64c0b..5287c07 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,45 @@ -### Nepali Date Picker -![branding-image.png](dist%2Fimg%2Fbranding-image.png) +# Nepali Date Picker +Lightweight, Powerful JavaScript Nepali Date Picker with no dependencies. -### INSTALLATION +![branding-image.png](public%2Fimg%2Fbranding-image.png) -- Add nepali-date-picker.min.js -- Add nepali-date-picker.min.css +## INSTALLATION -### USAGE +### 1. Download the latest release +[Download](https://github.com/anuzpandey/nepali-date-picker/releases/latest) and extract the zip file and copy the files from `dist` folder to your project. + +### 2. Use a standalone build ```html - - + + +``` +#### OR - - +### 3. Use separate files (JS and CSS) +```html + + - + +``` + +--- - +### USAGE +```javascript +// Initialize Nepali Date Picker +new NepaliDatePicker('.date-picker') +// --- OR --- +new NepaliDatePicker('#date-of-birth') +// --- OR --- +new NepaliDatePicker('selector', config) // See Config Options below ``` +--- + #### Config Options + ```javascript let config = { format: 'YYYY-MM-DD', // 'YYYY-MM-DD', 'YYYY/MM/DD', 'YYYY.MM.DD', 'DD-MM-YYYY', 'DD/MM/YYYY', 'DD.MM.YYYY' @@ -47,16 +63,12 @@ let config = { ```javascript // To Convert English Date to Nepali Date - let NepaliDatePicker = new NepaliDatePicker(); - -NepaliDatePicker.convertToNepaliDate(2053, 1, 10) - +NepaliDatePicker.convertToNepaliDate(1996, 4, 22) // Result: {year: 2053, month: 1, day: 10} ``` #### Features - - [x] ~~Proper UI for Date Picker~~ - [x] ~~Convert English Date to Nepali Date~~ - [ ] Convert Nepali Date to English Date @@ -67,8 +79,9 @@ NepaliDatePicker.convertToNepaliDate(2053, 1, 10) - [ ] Add Configurations to Date Picker - [x] ~~Close/Hide Date Picker on Date Select~~ - [ ] Disable features on - - [ ] Today's Date - - [ ] Before Today's Date + - [x] Today's Date + - [x] Before Today's Date + - [x] Before After Today's Date - [ ] Specific Dates - [ ] Specific Days - [ ] Specific Months @@ -97,7 +110,7 @@ NepaliDatePicker.convertToNepaliDate(2053, 1, 10) - [x] ~~Language Support (np/en)~~ - [x] ~~English~~ - [x] ~~Nepali~~ - - [x] ~~Date Picker Theme~~ + - [ ] Date Picker Theme - [x] ~~Light~~ - [x] ~~Dark~~ - [ ] Min Date diff --git a/dist/css/nepali-date-picker.min.css b/dist/css/nepali-date-picker.min.css deleted file mode 100644 index ddf2c3f..0000000 --- a/dist/css/nepali-date-picker.min.css +++ /dev/null @@ -1 +0,0 @@ -@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap);:root{--ap-white:#ffffff;--ap-black:#000000;--rounded-md:0.375rem;--gray-50:rgb(249 250 251 / 1);--gray-100:rgb(243 244 246 / 1);--gray-200:rgb(229 231 235 / 1);--gray-300:rgb(209 213 219 / 1);--gray-400:rgb(156 163 175 / 1);--gray-500:rgb(107 114 128 / 1);--gray-600:rgb(75 85 99 / 1);--gray-700:rgb(55 65 81 / 1);--gray-800:rgb(31 41 55 / 1);--gray-900:rgb(17 24 39 / 1);--gray-950:rgb(3 7 18 / 1);--red-400:rgb(248 113 113 / 1);--red-500:rgb(239 68 68 / 1)}.theme-dark{--ap-white:#1D1D1D;--ap-black:#fefefe;--gray-50:rgb(3 7 18 / 1);--gray-100:rgb(33 34 36 / 1);--gray-200:rgb(31 41 55 / 1);--gray-300:rgb(55 65 81 / 1);--gray-400:rgb(75 85 99 / 1 );--gray-500:rgb(210 210 210 / 1);--gray-600:rgb(156 163 175 / 1);--gray-700:rgb(209 213 219 / 1);--gray-800:rgb(229 231 235 / 1);--gray-900:rgb(243 244 246 / 1);--gray-950:rgb(249 250 251 / 1);--red-400:rgb(248 113 113 / 1);--red-500:rgb(239 68 68 / 1)}.ap-card{font-family:"Inter",sans-serif;z-index:10;position:absolute;display:none;width:auto;max-width:fit-content;background:var(--ap-white);box-shadow:0 0#0000,0 0#0000,0 1px 2px 0 rgb(0 0 0/.05);padding:.5rem;box-sizing:border-box;font-size:.875rem;line-height:1.25rem;border:1px solid rgb(229 231 235/1);border-radius:var(--rounded-md);margin-top:.25rem}.ap-header-wrapper{display:flex;justify-content:space-between;align-items:center;width:100%}.ap-header__button{padding:.25rem;border-radius:var(--rounded-md);color:var(--ap-black);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms;width:2.5rem;height:2.5rem;display:flex;justify-content:center;align-items:center;border:0;background:var(--ap-white)}.ap-header__button:hover{color:var(--gray-600);background:var(--gray-100)}.ap-header__button:focus{color:var(--ap-black);background:var(--ap-white);outline:0}.ap-header__button>svg{width:1.25rem;height:1.25rem}.ap-header__selects{display:flex;align-items:center;gap:.25rem}.ap-header__select{appearance:none;line-height:1.8;text-align:center;height:2.5rem;padding:.25rem 1rem;border-radius:var(--rounded-md);border:0;background:var(--ap-white);color:var(--ap-black)}.ap-header__select:focus{outline:0}.ap-header__select:hover{background:var(--gray-100)}.ap-table{margin-top:.5rem;text-align:center;width:100%}.ap-table__thead__tr{padding-top:.5rem;padding-bottom:.75rem}.ap-table__tbody__tr,.ap-table__thead__tr{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;color:var(--gray-500);gap:.25rem}.ap-table__thead__tr_th{width:2.5rem;font-weight:500;padding:0}.holiday-marker-color{color:var(--red-400)!important}.holiday-marker-color:hover>button{color:var(--red-500)!important}.ap-table__tbody{display:flex;flex-direction:column;row-gap:.25rem}.ap-table__thead__tr_td{height:2.5rem;width:2.5rem;text-align:center;padding:0;position:relative;color:var(--gray-500)}.ap-table__thead__tr_td>button{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--rounded-md);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms;width:2.5rem;height:2.5rem;padding:0;font-weight:400;border:0;background:var(--ap-white);color:inherit}.ap-table__thead__tr_td>button:focus{outline:0}.ap-table__thead__tr_td>button:disabled{color:var(--gray-400);background:var(--gray-100);cursor:not-allowed}.ap-table__thead__tr_td>button:hover{color:var(--gray-500);background:var(--gray-100)}.no-hover:hover{color:transparent!important;background:0 0!important}.pointer-events-none{pointer-events:none}.bordered{border:1px solid var(--gray-200)}.ap-width-tr-td{width:2.5rem}.ap-width-ddd{width:4rem}.ap-width-np-ddd{width:5rem}.ap-gap{gap:.25rem}.ap-table__thead__tr_td>button.selected{background:var(--ap-black)!important;color:var(--ap-white)!important;border:0!important}.ap-cell-button.selected:hover{background:var(--gray-800);color:var(--ap-white)}.bordered-theme{border:1px solid var(--gray-200)!important}.soft-theme{background:var(--gray-50)!important;transition:all ease}.soft-theme:hover{background:var(--gray-100)!important}.bordered-dashed{border-style:dashed!important}.ap-table__thead__tr_td.active>button{background:var(--gray-100);border:1px dashed var(--gray-400)!important}.ap-position-left{left:0}.ap-position-right{right:0!important}.ap-position-center{left:0!important;right:0!important;margin-left:auto!important;margin-right:auto!important} \ No newline at end of file diff --git a/dist/favicon.ico b/dist/favicon.ico deleted file mode 100644 index 18993ad..0000000 Binary files a/dist/favicon.ico and /dev/null differ diff --git a/dist/img/hero-image.svg b/dist/img/hero-image.svg deleted file mode 100644 index 25bf920..0000000 --- a/dist/img/hero-image.svg +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dist/img/logo.svg b/dist/img/logo.svg deleted file mode 100644 index 2dd6120..0000000 --- a/dist/img/logo.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dist/img/nepali-datepicker.svg b/dist/img/nepali-datepicker.svg deleted file mode 100644 index d231b24..0000000 --- a/dist/img/nepali-datepicker.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dist/js/nepali-date-picker.min.js b/dist/js/nepali-date-picker.min.js deleted file mode 100644 index 0e24aa1..0000000 --- a/dist/js/nepali-date-picker.min.js +++ /dev/null @@ -1,39 +0,0 @@ -class NepaliDatePicker{constructor(config){this.today=new Date,this.currentYear=this.today.getFullYear(),this.currentMonth=this.today.getMonth(),this.currentDay=this.today.getDate(),this.triggerDataAttributeLabel="data-nepali-date-picker",this.options={format:"YYYY-MM-DD",closeOnDateSelect:!0,disableAfterToday:!1,disableBeforeToday:!1,disableToday:!1,markHolidays:!0,holidays:["Saturday"],indicateCurrentDate:!0,setCurrentDate:!1,position:"left",daysFormat:"dd",locale:"np",theme:"flat",darkMode:!1},"object"==typeof config&&(this.options={...this.options,...config}),this.dynamicClassValues={trGap:"ap-gap",trAndTdWidth:"ddd"===this.options.daysFormat?"np"===this.options.locale?"ap-width-np-ddd":"ap-width-ddd":"ap-width-tr-td",position:this.getPositionClasses()},this.init()}init(setCurrentDate=!0){setCurrentDate&&this.setCurrentDate(),this.setupTriggers(),this.setupOpeners(),this.setupClosers()}setCurrentDate(){var{year,month,date}=this.convertToNepaliDate(this.currentYear,this.currentMonth+1,this.currentDay);this.currentYear=+year,this.currentMonth=+month,this.currentDay=+date}setupTriggers(){this.setupInputTriggers(),this.setupInputFieldConfiguration(),this.setupCellButtonClickTriggers()}setupInputFieldConfiguration(){}setupCellButtonClickTriggers(){document.addEventListener("click",event=>{if(event.preventDefault(),event.target.classList.contains("ap-cell-button")){document.querySelectorAll(".ap-cell-button");const parentTable=event.target.closest("table"),apCells=parentTable.querySelectorAll(".ap-cell-button");apCells.forEach(function(apCell){apCell&&"selected".split(" ").forEach(className=>apCell.classList.remove(className))}),"selected".split(" ").forEach(className=>event.target.classList.add(className));var currentYear=parseInt(event.target.closest(".ap-card").querySelector(".ap-calendar-year").value),showMonth=parseInt(event.target.closest(".ap-card").querySelector(".ap-calendar-month").value)+1,value=this.decodeUnicodeToEnglishText(event.target.textContent),showMonth=("0"+showMonth).slice(-2),value=("0"+value).slice(-2),value=this.getFormattedDate(currentYear,showMonth,value);let apCalendar=event.target.closest(".ap-card").previousElementSibling;if(apCalendar&&(apCalendar.value=value),this.options.closeOnDateSelect){const apCards=document.querySelectorAll(".ap-card");apCards.forEach(function(apCard){apCard.style.display="none"})}}})}setupInputTriggers(){const triggers=document.querySelectorAll(`[${this.triggerDataAttributeLabel}]`);0{this.options.setCurrentDate&&(trigger.value=this.getFormattedDate(this.currentYear,this.currentMonth+1,this.currentDay)),trigger.hasAttribute("placeholder")||trigger.setAttribute("placeholder",this.options.format),trigger.addEventListener("click",event=>{event.preventDefault();const nextSibling=event.target.nextElementSibling;nextSibling&&nextSibling.classList.contains("ap-card")||this.setupDatePickers({pickerId:event.target.getAttribute(this.triggerDataAttributeLabel)})})})}setupOpeners(){document.addEventListener("click",function(targetDataNepaliDatePickerValue){if(targetDataNepaliDatePickerValue.target.classList.contains("ap-calendar")){const nextSibling=targetDataNepaliDatePickerValue.target.nextElementSibling,nextSiblingClasses=nextSibling.classList,parentElement=targetDataNepaliDatePickerValue.target.parentElement;parentElement.style.position="relative";targetDataNepaliDatePickerValue=targetDataNepaliDatePickerValue.target.getAttribute("data-nepali-date-picker");const apCards=document.querySelectorAll(".ap-card");apCards.forEach(function(apCard){apCard.style.display="none"}),nextSibling&&nextSiblingClasses.contains("ap-calendar-"+targetDataNepaliDatePickerValue)&&(nextSibling.style.display="block")}})}setupClosers(){document.addEventListener("click",function(e){if(!e.target.matches(".ap-calendar, .ap-card, .ap-card *")){const apCards=document.querySelectorAll(".ap-card");apCards.forEach(function(apCard){apCard.style.display="none"})}})}setupDatePickers({pickerId}){const inputField=document.querySelector(`[${this.triggerDataAttributeLabel}="${pickerId}"]`);inputField.classList.add("ap-calendar");var themeClass=this.getThemeClasses(),themeSchemeClass=this.options.darkMode?"theme-dark":"theme-light",previousButton=` - - `,nextButton=` - - `,appendData=this.getDaysHeaderList(),monthsOptionList=this.getMonthsOptionList(),yearsOptionList=this.getYearsOptionList(),appendData=` -
-
-
- ${previousButton} -
- - -
- ${nextButton} -
-
- - - - ${appendData} - - - - -
-
- `;inputField.insertAdjacentHTML("afterend",appendData),this.initializeCalendar(inputField,this.currentMonth,this.currentYear),this.initializeDatePickerButtonsEventListeners(inputField)}initializeDatePickerButtonsEventListeners(inputField){const nextButton=inputField.nextElementSibling.querySelector(".btn-next"),previousButton=inputField.nextElementSibling.querySelector(".btn-previous");var selectedYear=inputField.nextElementSibling.querySelector(".ap-calendar-year"),selectedMonth=inputField.nextElementSibling.querySelector(".ap-calendar-month");let year=parseInt(selectedYear.value),month=parseInt(selectedMonth.value);nextButton.removeEventListener("click",()=>{}),previousButton.removeEventListener("click",()=>{}),nextButton.addEventListener("click",event=>{event.preventDefault(),year=11===month?year+1:year,month=(month+1)%12,this.initializeCalendar(inputField,month,year)}),previousButton.addEventListener("click",event=>{event.preventDefault(),year=0===month?year-1:year,month=0===month?11:month-1,this.initializeCalendar(inputField,month,year)})}initializeCalendar(inputField,month,year){const nextSibling=inputField.nextElementSibling;let calenderCard=void 0;if(nextSibling&&nextSibling.classList.contains("ap-card")&&(calenderCard=nextSibling),calenderCard&&void 0!==this.getNepaliDates()[year]){var firstDay=this.getNepaliDates()[year][1][month]-1,nepaliDatePickerDataAttribute=inputField.getAttribute(this.triggerDataAttributeLabel);calenderCard=document.querySelector(".ap-calendar-"+nepaliDatePickerDataAttribute);const tableDOM=calenderCard.querySelector(".calendar-body"),selectedYear=calenderCard.querySelector(".ap-calendar-year"),selectedMonth=calenderCard.querySelector(".ap-calendar-month");selectedYear.removeEventListener("change",()=>{}),selectedMonth.removeEventListener("change",()=>{}),selectedYear.addEventListener("change",event=>{this.initializeCalendar(inputField,month,event.target.value),this.initializeDatePickerButtonsEventListeners(inputField)}),selectedMonth.addEventListener("change",event=>{this.initializeCalendar(inputField,event.target.value,year),this.initializeDatePickerButtonsEventListeners(inputField)}),selectedYear.value=year,selectedMonth.value=month;var themeClasses=this.getThemeClasses();if(tableDOM)for(;tableDOM.firstChild;)tableDOM.removeChild(tableDOM.firstChild);let date=1;for(let i=0;i<6;i++){const row=document.createElement("tr");row.classList.add("ap-table__tbody__tr");const holidayIndices=this.options.markHolidays&&this.options.holidays.map(selectedHoliday=>this.getDaysInNepali().findIndex(dayInNepali=>dayInNepali.day.toLowerCase()===selectedHoliday.toLowerCase()));for(let j=0;j<7;j++){var nepaliDate=holidayIndices&&holidayIndices.includes(j)?"holiday-marker-color":null;if(0===i&&jthis.getDaysInMonth(month,year))break;const cell=document.createElement("td");cell.classList.add("ap-table__thead__tr_td",this.dynamicClassValues.trAndTdWidth,"ap-cell",nepaliDate);const cellButton=document.createElement("button");cellButton.classList.add("ap-cell-button",themeClasses),this.setDisabledAttributes(cellButton,year,month,date);nepaliDate="np"===this.options.locale?this.unicodeText(date):date;this.options.indicateCurrentDate&&date===parseInt(this.currentDay)&&year===parseInt(this.currentYear)&&month===parseInt(this.currentMonth)&&(cell.classList.add("active"),cellButton.classList.add("bordered-dashed")),cellButton.appendChild(document.createTextNode(nepaliDate)),cell.appendChild(cellButton),row.append(cell),date++}}tableDOM.append(row)}}}setDisabledAttributes(cellButton,year,month,date){var currentYear=this.currentYear,currentMonth=this.currentMonth+1,currentDay=this.currentDay;year=+year,month=+month,date=+date,this.options.disableBeforeToday&&(year{return``}).join("")}getDaysHeaderList(){return this.getDaysInNepali().map(day=>{return`${day[this.options.locale][this.options.daysFormat]}`}).join("")}getMonthsOptionList(){return this.getMonthsInNepali().map((month,index)=>``).join("")}closeDatePicker(){console.log("close date picker")}getMonthsInNepali(){return[{en:"Baishak",np:"बैशाख"},{en:"Jestha",np:"जेठ"},{en:"Ashad",np:"असार"},{en:"Shrawn",np:"साउन"},{en:"Bhadra",np:"भदौ"},{en:"Ashwin",np:"असोज"},{en:"Kartik",np:"कार्तिक"},{en:"Mangshir",np:"मंसिर"},{en:"Poush",np:"पुष"},{en:"Magh",np:"माघ"},{en:"Falgun",np:"फाल्गुन"},{en:"Chaitra",np:"चैत्र"}]}getLeapMonths(){return[31,29,31,30,31,30,31,31,30,31,30,31]}getNormalMonths(){return[31,28,31,30,31,30,31,31,30,31,30,31]}getNepaliDates(){return{2e3:[[30,32,31,32,31,30,30,30,29,30,29,31],[4,6,3,6,3,6,1,3,5,6,1,2]],2001:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2002:[[31,31,32,32,31,30,30,29,30,29,30,30],[6,2,5,2,6,2,4,6,7,2,3,5]],2003:[[31,32,31,32,31,30,30,30,29,29,30,31],[7,3,7,3,7,3,5,7,2,3,4,6]],2004:[[30,32,31,32,31,30,30,30,29,30,29,31],[2,4,1,4,1,4,6,1,3,4,6,7]],2005:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2006:[[31,31,32,32,31,30,30,29,30,29,30,30],[4,7,3,7,4,7,2,4,5,7,1,3]],2007:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2008:[[31,31,31,32,31,31,29,30,30,29,29,31],[7,3,6,2,6,2,5,6,1,3,4,5]],2009:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2010:[[31,31,32,32,31,30,30,29,30,29,30,30],[2,5,1,5,2,5,7,2,3,5,6,1]],2011:[[31,32,31,32,31,30,30,30,29,29,30,31],[3,6,3,6,3,6,1,3,5,6,7,2]],2012:[[31,31,31,32,31,31,29,30,30,29,30,30],[5,1,4,7,4,7,3,4,6,1,2,4]],2013:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2014:[[31,31,32,32,31,30,30,29,30,29,30,30],[7,3,6,3,7,3,5,7,1,3,4,6]],2015:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2016:[[31,31,31,32,31,31,29,30,30,29,30,30],[3,6,2,5,2,5,1,2,4,6,7,2]],2017:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2018:[[31,32,31,32,31,30,30,29,30,29,30,30],[5,1,5,1,5,1,3,5,6,1,2,4]],2019:[[31,32,31,32,31,30,30,30,29,30,29,31],[6,2,6,2,6,2,4,6,1,2,4,5]],2020:[[31,31,31,32,31,31,30,29,30,29,30,30],[1,4,7,3,7,3,6,1,2,4,5,7]],2021:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2022:[[31,32,31,32,31,30,30,30,29,29,30,30],[3,6,3,6,3,6,1,3,5,6,7,2]],2023:[[31,32,31,32,31,30,30,30,29,30,29,31],[4,7,4,7,4,7,2,4,6,7,2,3]],2024:[[31,31,31,32,31,31,30,29,30,29,30,30],[6,2,5,1,5,1,4,6,7,2,3,5]],2025:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2026:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2027:[[30,32,31,32,31,30,30,30,29,30,29,31],[3,5,2,5,2,5,7,2,4,5,7,1]],2028:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2029:[[31,31,32,31,32,30,30,29,30,29,30,30],[5,1,4,1,4,1,3,5,6,1,2,4]],2030:[[31,32,31,32,31,30,30,30,29,29,30,31],[6,2,6,2,6,2,4,6,1,2,3,5]],2031:[[30,32,31,32,31,30,30,30,29,30,29,31],[1,3,7,3,7,3,5,7,2,3,5,6]],2032:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2033:[[31,31,32,32,31,30,30,29,30,29,30,30],[3,6,2,6,3,6,1,3,4,6,7,2]],2034:[[31,32,31,32,31,30,30,30,29,29,30,31],[4,7,4,7,4,7,2,4,6,7,1,3]],2035:[[30,32,31,32,31,31,29,30,30,29,29,31],[6,1,5,1,5,1,4,5,7,2,3,4]],2036:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2037:[[31,31,32,32,31,30,30,29,30,29,30,30],[1,4,7,4,1,4,6,1,2,4,5,7]],2038:[[31,32,31,32,31,30,30,30,29,29,30,31],[2,5,2,5,2,5,7,2,4,5,6,1]],2039:[[31,31,31,32,31,31,29,30,30,29,30,30],[4,7,3,6,3,6,2,3,5,7,1,3]],2040:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2041:[[31,31,32,32,31,30,30,29,30,29,30,30],[6,2,5,2,6,2,4,6,7,2,3,5]],2042:[[31,32,31,32,31,30,30,30,29,29,30,31],[7,3,7,3,7,3,5,7,2,3,4,6]],2043:[[31,31,31,32,31,31,29,30,30,29,30,30],[2,5,1,4,1,4,7,1,3,5,6,1]],2044:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2045:[[31,32,31,32,31,30,30,29,30,29,30,30],[4,7,4,7,4,7,2,4,5,7,1,3]],2046:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2047:[[31,31,31,32,31,31,30,29,30,29,30,30],[7,3,6,2,6,2,5,7,1,3,4,6]],2048:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2049:[[31,32,31,32,31,30,30,30,29,29,30,30],[2,5,2,5,2,5,7,2,4,5,6,1]],2050:[[31,32,31,32,31,30,30,30,29,30,29,31],[3,6,3,6,3,6,1,3,5,6,1,2]],2051:[[31,31,31,32,31,31,30,29,30,29,30,30],[5,1,4,7,4,7,3,5,6,1,2,4]],2052:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2053:[[31,32,31,32,31,30,30,30,29,29,30,30],[7,3,7,3,7,3,5,7,2,3,4,6]],2054:[[31,32,31,32,31,30,30,30,29,30,29,31],[1,4,1,4,1,4,6,1,3,4,6,7]],2055:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2056:[[31,31,32,31,32,30,30,29,30,29,30,30],[4,7,3,7,3,7,2,4,5,7,1,3]],2057:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2058:[[30,32,31,32,31,30,30,30,29,30,29,31],[7,2,6,2,6,2,4,6,1,2,4,5]],2059:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2060:[[31,31,32,32,31,30,30,29,30,29,30,30],[2,5,1,5,2,5,7,2,3,5,6,1]],2061:[[31,32,31,32,31,30,30,30,29,29,30,31],[3,6,3,6,3,6,1,3,5,6,7,2]],2062:[[30,32,31,32,31,31,29,30,29,30,29,31],[5,7,4,7,4,7,3,4,6,7,2,3]],2063:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2064:[[31,31,32,32,31,30,30,29,30,29,30,30],[7,3,6,3,7,3,5,7,1,3,4,6]],2065:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2066:[[31,31,31,32,31,31,29,30,30,29,29,31],[3,6,2,5,2,5,1,2,4,6,7,1]],2067:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2068:[[31,31,32,32,31,30,30,29,30,29,30,30],[5,1,4,1,5,1,3,5,6,1,2,4]],2069:[[31,32,31,32,31,30,30,30,29,29,30,31],[6,2,6,2,6,2,4,6,1,2,3,5]],2070:[[31,31,31,32,31,31,29,30,30,29,30,30],[1,4,7,3,7,3,6,7,2,4,5,7]],2071:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2072:[[31,32,31,32,31,30,30,29,30,29,30,30],[3,6,3,6,3,6,1,3,4,6,7,2]],2073:[[31,32,31,32,31,30,30,30,29,29,30,31],[4,7,4,7,4,7,2,4,6,7,1,3]],2074:[[31,31,31,32,31,31,30,29,30,29,30,30],[6,2,5,1,5,1,4,6,7,2,3,5]],2075:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2076:[[31,32,31,32,31,30,30,30,29,29,30,30],[1,4,1,4,1,4,6,1,3,4,5,7]],2077:[[31,32,31,32,31,30,30,30,29,30,29,31],[2,5,2,5,2,5,7,2,4,5,7,1]],2078:[[31,31,31,32,31,31,30,29,30,29,30,30],[4,7,3,6,3,6,2,4,5,7,1,3]],2079:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2080:[[31,32,31,32,31,30,30,30,29,29,30,30],[6,2,6,2,6,2,4,6,1,2,3,5]],2081:[[31,31,32,32,31,30,30,30,29,30,30,30],[7,3,6,3,7,3,5,7,2,3,5,7]],2082:[[30,32,31,32,31,30,30,30,29,30,30,30],[2,4,1,4,1,4,6,1,3,4,6,1]],2083:[[31,31,32,31,31,30,30,30,29,30,30,30],[3,6,2,6,2,5,7,2,4,5,7,2]],2084:[[31,31,32,31,31,30,30,30,29,30,30,30],[4,7,3,7,3,6,1,3,5,6,1,3]],2085:[[31,32,31,32,30,31,30,30,29,30,30,30],[5,1,5,1,5,7,3,5,7,1,3,5]],2086:[[30,32,31,32,31,30,30,30,29,30,30,30],[7,2,6,2,6,2,4,6,1,2,4,6]],2087:[[31,31,32,31,31,31,30,30,29,30,30,30],[1,4,7,4,7,3,6,1,3,4,6,1]],2088:[[30,31,32,32,30,31,30,30,29,30,30,30],[3,5,1,5,2,4,7,2,4,5,7,2]],2089:[[30,32,31,32,31,30,30,30,29,30,30,30],[4,6,3,6,3,6,1,3,5,6,1,3]],2090:[[30,32,31,32,31,30,30,30,29,30,30,30],[5,7,4,7,4,7,2,4,6,7,2,4]]}}getDaysInNepali(){return[{day:"Sunday",en:{ddd:"Sunday",dd:"Sun",d:"S"},np:{ddd:"आइतबार",dd:"आइत",d:"आ"}},{day:"Monday",en:{ddd:"Monday",dd:"Mon",d:"M"},np:{ddd:"सोमबार",dd:"सोम",d:"सो"}},{day:"Tuesday",en:{ddd:"Tuesday",dd:"Tue",d:"T"},np:{ddd:"मंगलबार",dd:"मंगल",d:"मं"}},{day:"Wednesday",en:{ddd:"Wednesday",dd:"Wed",d:"W"},np:{ddd:"बुधबार",dd:"बुध",d:"बु"}},{day:"Thursday",en:{ddd:"Thursday",dd:"Thu",d:"T"},np:{ddd:"बिहिबार",dd:"बिहि",d:"बि"}},{day:"Friday",en:{ddd:"Friday",dd:"Fri",d:"F"},np:{ddd:"शुक्रबार",dd:"शुक्र",d:"शु"}},{day:"Saturday",en:{ddd:"Saturday",dd:"Sat",d:"S"},np:{ddd:"शनिबार",dd:"शनि",d:"श"}}]}getDaysInMonth(month,year){return this.getNepaliDates()[year][0][month]}unicodeText(text){const chars={0:"०",1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९"};return text.toString().replace(/[0123456789]/g,m=>chars[m])}decodeUnicodeToEnglishText(text){const chars={"०":"0","१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9"};return text.toString().replace(/[०१२३४५६७८९]/g,m=>chars[m])}getPositionClasses(){switch(this.options.position){case"left":default:return"ap-position-left";case"right":return"ap-position-right";case"center":return"ap-position-center"}}convertToNepaliDate(nepaliDate,nepaliYear,nepaliMonth){var nepaliDate=this.calculateTotalEnglishDays(nepaliDate=+nepaliDate,nepaliYear=+nepaliYear,nepaliMonth=+nepaliMonth),{nepaliYear,nepaliMonth,nepaliDate}=this.performCalculationBasedOnEnglishDays(nepaliDate);return{year:nepaliYear,month:nepaliMonth-1,date:nepaliDate}}calculateTotalEnglishDays(year,month,day){let totalEnglishDays=0;for(let i=0;ilastDayOfMonth&&(nepaliMonth++,nepaliDay=1,j++),7(()=>{"use strict";var e={0:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(650),r=n.n(a),i=n(196),o=n.n(i)()(r());o.push([e.id,"@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap);"]),o.push([e.id,":root {\n --ap-white: #ffffff;\n --ap-black: #000000;\n --rounded-md: 0.375rem;\n --gray-50: rgb(249 250 251 / 1);\n --gray-100: rgb(243 244 246 / 1);\n --gray-200: rgb(229 231 235 / 1);\n --gray-300: rgb(209 213 219 / 1);\n --gray-400: rgb(156 163 175 / 1);\n --gray-500: rgb(107 114 128 / 1);\n --gray-600: rgb(75 85 99 / 1);\n --gray-700: rgb(55 65 81 / 1);\n --gray-800: rgb(31 41 55 / 1);\n --gray-900: rgb(17 24 39 / 1);\n --gray-950: rgb(3 7 18 / 1);\n --red-400: rgb(248 113 113 / 1);\n --red-500: rgb(239 68 68 / 1);\n}\n\n.theme-dark {\n --ap-white: #1D1D1D;\n --ap-black: #fefefe;\n --gray-50: rgb(3 7 18 / 1);\n --gray-100: rgb(33 34 36 / 1);\n --gray-200: rgb(31 41 55 / 1);\n --gray-300: rgb(55 65 81 / 1);\n --gray-400: rgb(75 85 99 / 1 );\n --gray-500: rgb(210 210 210 / 1);\n --gray-600: rgb(156 163 175 / 1);\n --gray-700: rgb(209 213 219 / 1);\n --gray-800: rgb(229 231 235 / 1);\n --gray-900: rgb(243 244 246 / 1);\n --gray-950: rgb(249 250 251 / 1);\n --red-400: rgb(248 113 113 / 1);\n --red-500: rgb(239 68 68 / 1);\n}\n\n.ap-card {\n font-family: 'Inter', sans-serif;\n z-index: 10;\n position: absolute;\n display: none;\n width: auto;\n max-width: fit-content;\n background: var(--ap-white);\n box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgb(0 0 0 / 0.05);\n padding: 0.5rem;\n box-sizing: border-box;\n font-size: 0.875rem;\n line-height: 1.25rem;\n border: 1px solid var(--gray-200);\n border-radius: var(--rounded-md);\n margin-top: 0.25rem;\n}\n\n.ap-header-wrapper {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n}\n\n.ap-header__button {\n padding: 0.25rem;\n border-radius: var(--rounded-md);\n color: var(--ap-black);\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n width: 2.5rem;\n height: 2.5rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border: none;\n background: var(--ap-white);\n}\n\n.ap-header__button:hover {\n color: var(--gray-600);\n background: var(--gray-100);\n}\n\n.ap-header__button:focus {\n color: var(--ap-black);\n background: var(--ap-white);\n outline: none;\n}\n\n.ap-header__button > svg {\n width: 1.25rem;\n height: 1.25rem;\n}\n\n.ap-header__selects {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n}\n\n.ap-header__select {\n appearance: none;\n line-height: 1.8;\n text-align: center;\n height: 2.5rem;\n padding: 0.25rem 1rem;\n border-radius: var(--rounded-md);\n border: none;\n background: var(--ap-white);\n color: var(--ap-black);\n}\n\n.ap-header__select:focus {\n outline: none;\n}\n\n.ap-header__select:hover {\n background: var(--gray-100);\n}\n\n.ap-table {\n margin-top: 0.5rem;\n text-align: center;\n width: 100%;\n}\n\n.ap-table__thead__tr {\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: flex-start;\n color: var(--gray-500);\n padding-top: 0.5rem;\n padding-bottom: 0.75rem;\n gap: 0.25rem;\n}\n\n.ap-table__tbody__tr {\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: flex-start;\n color: var(--gray-500);\n gap: 0.25rem;\n}\n\n.ap-table__thead__tr_th {\n width: 2.5rem;\n font-weight: 500;\n padding: 0;\n}\n\n.holiday-marker-color {\n color: var(--red-400) !important;\n}\n\n.holiday-marker-color:hover > button {\n color: var(--red-500) !important;\n}\n\n.ap-table__tbody {\n display: flex;\n flex-direction: column;\n row-gap: 0.25rem;\n}\n\n.ap-table__thead__tr_td {\n height: 2.5rem;\n width: 2.5rem;\n text-align: center;\n padding: 0;\n position: relative;\n color: var(--gray-500);\n}\n\n.ap-table__thead__tr_td > button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--rounded-md);\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n width: 2.5rem;\n height: 2.5rem;\n padding: 0;\n font-weight: 400;\n border: none;\n background: var(--ap-white);\n color: inherit;\n}\n\n.ap-table__thead__tr_td > button:focus {\n outline: none;\n}\n\n.ap-table__thead__tr_td > button:disabled {\n color: var(--gray-400);\n background: var(--gray-100);\n cursor: not-allowed;\n}\n\n.ap-table__thead__tr_td > button:hover {\n color: var(--gray-500);\n background: var(--gray-100);\n}\n\n.no-hover:hover {\n color: transparent !important;\n background: transparent !important;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.bordered {\n border: 1px solid var(--gray-200);\n}\n\n.ap-width-tr-td {\n width: 2.5rem;\n}\n\n.ap-width-ddd {\n width: 4rem;\n}\n\n.ap-width-np-ddd {\n width: 5rem;\n}\n\n.ap-gap {\n gap: 0.25rem;\n}\n\n.ap-table__thead__tr_td > button.selected {\n background: var(--ap-black) !important;\n color: var(--ap-white) !important;\n border: none !important;\n}\n\n.ap-cell-button.selected:hover {\n background: var(--gray-800);\n color: var(--ap-white);\n}\n\n\n.bordered-theme {\n border: 1px solid var(--gray-200) !important;\n}\n\n.soft-theme {\n background: var(--gray-50) !important;\n transition: all ease;\n}\n\n.soft-theme:hover {\n background: var(--gray-100) !important;\n}\n\n.bordered-dashed {\n border-style: dashed !important;\n}\n\n.ap-table__thead__tr_td.active > button {\n background: var(--gray-100);\n border: 1px dashed var(--gray-400) !important;\n}\n\n.ap-position-left {\n left: 0;\n}\n\n.ap-position-right {\n right: 0 !important;\n}\n\n.ap-position-center {\n left: 0 !important;\n right: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}",""]);const s=o},196:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",a=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),a&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),a&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,a,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(a)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),t.push(c))}},t}},650:e=>{e.exports=function(e){return e[1]}},62:e=>{var t=[];function n(e){for(var n=-1,a=0;a{var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},911:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},107:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},552:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,r&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},227:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},840:(e,t,n)=>{n.d(t,{default:()=>r});class a{#e={format:"YYYY-MM-DD",closeOnDateSelect:!0,disableAfterToday:!1,disableBeforeToday:!1,disableToday:!1,markHolidays:!0,holidays:["Saturday"],indicateCurrentDate:!0,setCurrentDate:!1,position:"left",daysFormat:"dd",locale:"np",theme:"flat",darkMode:!1};#t=null;#n="data-ap-";constructor(e,t){this.today=new Date,this.currentYear=this.today.getFullYear(),this.currentMonth=this.today.getMonth(),this.currentDay=this.today.getDate(),"object"==typeof t&&(this.#e={...this.#e,...t}),this.#t={trGap:"ap-gap",trAndTdWidth:"ddd"===this.#e.daysFormat?"np"===this.#e.locale?"ap-width-np-ddd":"ap-width-ddd":"ap-width-tr-td",position:this.#a()},this.#r(e)}#r(e){this.#i(),this.#o(e),this.#s(),this.#d()}#i(){let{year:e,month:t,date:n}=a.convertToNepaliDate(this.currentYear,this.currentMonth+1,this.currentDay);this.currentYear=+e,this.currentMonth=+t,this.currentDay=+n}#o(e){this.#l(e),this.#c()}#c(){document.addEventListener("click",(e=>{if(e.preventDefault(),e.target.classList.contains("ap-cell-button")){let t="selected";e.target.closest("table").querySelectorAll(".ap-cell-button").forEach((function(e){e&&t.split(" ").forEach((t=>e.classList.remove(t)))})),t.split(" ").forEach((t=>e.target.classList.add(t)));let n=parseInt(e.target.closest(".ap-card").querySelector(".ap-calendar-year").value),a=parseInt(e.target.closest(".ap-card").querySelector(".ap-calendar-month").value)+1,r=this.#p(e.target.textContent),i=("0"+a).slice(-2),o=("0"+r).slice(-2),s=this.#u(n,i,o),d=e.target.closest(".ap-card").previousElementSibling;d&&(d.value=s),this.#e.closeOnDateSelect&&document.querySelectorAll(".ap-card").forEach((function(e){e.style.display="none"}))}}))}#l(e){const t=document.querySelectorAll(e);t.length>0&&t.forEach((e=>{this.#e.setCurrentDate&&(e.value=this.#u(this.currentYear,this.currentMonth+1,this.currentDay)),e.hasAttribute("placeholder")||e.setAttribute("placeholder",this.#e.format),e.addEventListener("click",(t=>{t.preventDefault();const n=t.target.nextElementSibling;if(n&&n.classList.contains("ap-card"))return;const a=Math.floor(1e5+9e5*Math.random()).toString();e.setAttribute(`${this.#n+a}`,""),this.#h({selector:e,selectorUniqueId:a})}))}))}#s(){document.addEventListener("click",(e=>{if(e.target.classList.contains("ap-calendar")){const t=e.target.nextElementSibling,n=t.classList;e.target.parentElement.style.position="relative";const a=this.#g(e.target,!0);document.querySelectorAll(".ap-card").forEach((function(e){e.style.display="none"})),t&&n.contains(`ap-calendar-${a}`)&&(t.style.display="block")}}))}#d(){document.addEventListener("click",(function(e){e.target.matches(".ap-calendar, .ap-card, .ap-card *")||document.querySelectorAll(".ap-card").forEach((function(e){e.style.display="none"}))}))}#h({selector:e,selectorUniqueId:t}){const n=e;n.classList.add("ap-calendar");const a=this.#y(),r=this.#e.darkMode?"theme-dark":"theme-light",i=`\n \n `,o=`\n \n `,s=this.#m(),d=this.#b(),l=this.#f(),c=`\n
\n
\n
\n ${i}\n
\n \n \n
\n ${o}\n
\n
\n \n \n \n ${s}\n \n \n \n \n
\n
\n `;n.insertAdjacentHTML("afterend",c),this.#v(n,this.currentMonth,this.currentYear),this.#_(n)}#_(e){const t=e.nextElementSibling.querySelector(".btn-next"),n=e.nextElementSibling.querySelector(".btn-previous"),a=e.nextElementSibling.querySelector(".ap-calendar-year"),r=e.nextElementSibling.querySelector(".ap-calendar-month");let i=parseInt(a.value),o=parseInt(r.value);t.removeEventListener("click",(()=>{})),n.removeEventListener("click",(()=>{})),t.addEventListener("click",(t=>{t.preventDefault(),i=11===o?i+1:i,o=(o+1)%12,this.#v(e,o,i)})),n.addEventListener("click",(t=>{t.preventDefault(),i=0===o?i-1:i,o=0===o?11:o-1,this.#v(e,o,i)}))}#v(e,t,n){const r=e.nextElementSibling;let i;if(r&&r.classList.contains("ap-card")&&(i=r),!i)return;if(void 0===a.#D()[n])return;const o=a.#D()[n][1][t]-1,s=Object.keys(e.dataset).find((e=>e.includes("ap-"))).split("-")[1];i=document.querySelector(`.ap-calendar-${s}`);const d=i.querySelector(".calendar-body"),l=i.querySelector(".ap-calendar-year"),c=i.querySelector(".ap-calendar-month");l.removeEventListener("change",(()=>{})),c.removeEventListener("change",(()=>{})),l.addEventListener("change",(n=>{this.#v(e,t,n.target.value),this.#_(e)})),c.addEventListener("change",(t=>{this.#v(e,t.target.value,n),this.#_(e)})),l.value=n,c.value=t;const p=this.#y();if(d)for(;d.firstChild;)d.removeChild(d.firstChild);let u=1;for(let e=0;e<6;e++){const a=document.createElement("tr");a.classList.add("ap-table__tbody__tr");const r=this.#e.markHolidays&&this.#e.holidays.map((e=>this.#x().findIndex((t=>t.day.toLowerCase()===e.toLowerCase()))));for(let i=0;i<7;i++){let s=r&&r.includes(i)?"holiday-marker-color":null;if(0===e&&ithis.#w(t,n))break;const e=document.createElement("td");e.classList.add("ap-table__thead__tr_td",this.#t.trAndTdWidth,"ap-cell",s);const r=document.createElement("button");r.classList.add("ap-cell-button",p),this.#k(r,n,t,u);const i="np"===this.#e.locale?this.#M(u):u;this.#e.indicateCurrentDate&&u===parseInt(this.currentDay)&&n===parseInt(this.currentYear)&&t===parseInt(this.currentMonth)&&(e.classList.add("active"),r.classList.add("bordered-dashed")),r.appendChild(document.createTextNode(i)),e.appendChild(r),a.append(e),u++}}d.append(a)}}#k(e,t,n,a){const r=this.currentYear,i=this.currentMonth+1,o=this.currentDay;t=+t,n=+n,a=+a,this.#e.disableBeforeToday&&(tr||t===r&&n+1>i||t===r&&n+1===i&&a>o)&&e.setAttribute("disabled","disabled")}#f(){return Array.from({length:91},((e,t)=>``)).join("")}#m(){return this.#x().map((e=>`${e[this.#e.locale][this.#e.daysFormat]}`)).join("")}#b(){return this.#C().map(((e,t)=>``)).join("")}#L(){console.log("close date picker")}#C(){return[{en:"Baishak",np:"बैशाख"},{en:"Jestha",np:"जेठ"},{en:"Ashad",np:"असार"},{en:"Shrawn",np:"साउन"},{en:"Bhadra",np:"भदौ"},{en:"Ashwin",np:"असोज"},{en:"Kartik",np:"कार्तिक"},{en:"Mangshir",np:"मंसिर"},{en:"Poush",np:"पुष"},{en:"Magh",np:"माघ"},{en:"Falgun",np:"फाल्गुन"},{en:"Chaitra",np:"चैत्र"}]}static#T(){return[31,29,31,30,31,30,31,31,30,31,30,31]}static#Y(){return[31,28,31,30,31,30,31,31,30,31,30,31]}static#D(){return{2e3:[[30,32,31,32,31,30,30,30,29,30,29,31],[4,6,3,6,3,6,1,3,5,6,1,2]],2001:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2002:[[31,31,32,32,31,30,30,29,30,29,30,30],[6,2,5,2,6,2,4,6,7,2,3,5]],2003:[[31,32,31,32,31,30,30,30,29,29,30,31],[7,3,7,3,7,3,5,7,2,3,4,6]],2004:[[30,32,31,32,31,30,30,30,29,30,29,31],[2,4,1,4,1,4,6,1,3,4,6,7]],2005:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2006:[[31,31,32,32,31,30,30,29,30,29,30,30],[4,7,3,7,4,7,2,4,5,7,1,3]],2007:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2008:[[31,31,31,32,31,31,29,30,30,29,29,31],[7,3,6,2,6,2,5,6,1,3,4,5]],2009:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2010:[[31,31,32,32,31,30,30,29,30,29,30,30],[2,5,1,5,2,5,7,2,3,5,6,1]],2011:[[31,32,31,32,31,30,30,30,29,29,30,31],[3,6,3,6,3,6,1,3,5,6,7,2]],2012:[[31,31,31,32,31,31,29,30,30,29,30,30],[5,1,4,7,4,7,3,4,6,1,2,4]],2013:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2014:[[31,31,32,32,31,30,30,29,30,29,30,30],[7,3,6,3,7,3,5,7,1,3,4,6]],2015:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2016:[[31,31,31,32,31,31,29,30,30,29,30,30],[3,6,2,5,2,5,1,2,4,6,7,2]],2017:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2018:[[31,32,31,32,31,30,30,29,30,29,30,30],[5,1,5,1,5,1,3,5,6,1,2,4]],2019:[[31,32,31,32,31,30,30,30,29,30,29,31],[6,2,6,2,6,2,4,6,1,2,4,5]],2020:[[31,31,31,32,31,31,30,29,30,29,30,30],[1,4,7,3,7,3,6,1,2,4,5,7]],2021:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2022:[[31,32,31,32,31,30,30,30,29,29,30,30],[3,6,3,6,3,6,1,3,5,6,7,2]],2023:[[31,32,31,32,31,30,30,30,29,30,29,31],[4,7,4,7,4,7,2,4,6,7,2,3]],2024:[[31,31,31,32,31,31,30,29,30,29,30,30],[6,2,5,1,5,1,4,6,7,2,3,5]],2025:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2026:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2027:[[30,32,31,32,31,30,30,30,29,30,29,31],[3,5,2,5,2,5,7,2,4,5,7,1]],2028:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2029:[[31,31,32,31,32,30,30,29,30,29,30,30],[5,1,4,1,4,1,3,5,6,1,2,4]],2030:[[31,32,31,32,31,30,30,30,29,29,30,31],[6,2,6,2,6,2,4,6,1,2,3,5]],2031:[[30,32,31,32,31,30,30,30,29,30,29,31],[1,3,7,3,7,3,5,7,2,3,5,6]],2032:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2033:[[31,31,32,32,31,30,30,29,30,29,30,30],[3,6,2,6,3,6,1,3,4,6,7,2]],2034:[[31,32,31,32,31,30,30,30,29,29,30,31],[4,7,4,7,4,7,2,4,6,7,1,3]],2035:[[30,32,31,32,31,31,29,30,30,29,29,31],[6,1,5,1,5,1,4,5,7,2,3,4]],2036:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2037:[[31,31,32,32,31,30,30,29,30,29,30,30],[1,4,7,4,1,4,6,1,2,4,5,7]],2038:[[31,32,31,32,31,30,30,30,29,29,30,31],[2,5,2,5,2,5,7,2,4,5,6,1]],2039:[[31,31,31,32,31,31,29,30,30,29,30,30],[4,7,3,6,3,6,2,3,5,7,1,3]],2040:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2041:[[31,31,32,32,31,30,30,29,30,29,30,30],[6,2,5,2,6,2,4,6,7,2,3,5]],2042:[[31,32,31,32,31,30,30,30,29,29,30,31],[7,3,7,3,7,3,5,7,2,3,4,6]],2043:[[31,31,31,32,31,31,29,30,30,29,30,30],[2,5,1,4,1,4,7,1,3,5,6,1]],2044:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2045:[[31,32,31,32,31,30,30,29,30,29,30,30],[4,7,4,7,4,7,2,4,5,7,1,3]],2046:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2047:[[31,31,31,32,31,31,30,29,30,29,30,30],[7,3,6,2,6,2,5,7,1,3,4,6]],2048:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2049:[[31,32,31,32,31,30,30,30,29,29,30,30],[2,5,2,5,2,5,7,2,4,5,6,1]],2050:[[31,32,31,32,31,30,30,30,29,30,29,31],[3,6,3,6,3,6,1,3,5,6,1,2]],2051:[[31,31,31,32,31,31,30,29,30,29,30,30],[5,1,4,7,4,7,3,5,6,1,2,4]],2052:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2053:[[31,32,31,32,31,30,30,30,29,29,30,30],[7,3,7,3,7,3,5,7,2,3,4,6]],2054:[[31,32,31,32,31,30,30,30,29,30,29,31],[1,4,1,4,1,4,6,1,3,4,6,7]],2055:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2056:[[31,31,32,31,32,30,30,29,30,29,30,30],[4,7,3,7,3,7,2,4,5,7,1,3]],2057:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2058:[[30,32,31,32,31,30,30,30,29,30,29,31],[7,2,6,2,6,2,4,6,1,2,4,5]],2059:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2060:[[31,31,32,32,31,30,30,29,30,29,30,30],[2,5,1,5,2,5,7,2,3,5,6,1]],2061:[[31,32,31,32,31,30,30,30,29,29,30,31],[3,6,3,6,3,6,1,3,5,6,7,2]],2062:[[30,32,31,32,31,31,29,30,29,30,29,31],[5,7,4,7,4,7,3,4,6,7,2,3]],2063:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2064:[[31,31,32,32,31,30,30,29,30,29,30,30],[7,3,6,3,7,3,5,7,1,3,4,6]],2065:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2066:[[31,31,31,32,31,31,29,30,30,29,29,31],[3,6,2,5,2,5,1,2,4,6,7,1]],2067:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2068:[[31,31,32,32,31,30,30,29,30,29,30,30],[5,1,4,1,5,1,3,5,6,1,2,4]],2069:[[31,32,31,32,31,30,30,30,29,29,30,31],[6,2,6,2,6,2,4,6,1,2,3,5]],2070:[[31,31,31,32,31,31,29,30,30,29,30,30],[1,4,7,3,7,3,6,7,2,4,5,7]],2071:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2072:[[31,32,31,32,31,30,30,29,30,29,30,30],[3,6,3,6,3,6,1,3,4,6,7,2]],2073:[[31,32,31,32,31,30,30,30,29,29,30,31],[4,7,4,7,4,7,2,4,6,7,1,3]],2074:[[31,31,31,32,31,31,30,29,30,29,30,30],[6,2,5,1,5,1,4,6,7,2,3,5]],2075:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2076:[[31,32,31,32,31,30,30,30,29,29,30,30],[1,4,1,4,1,4,6,1,3,4,5,7]],2077:[[31,32,31,32,31,30,30,30,29,30,29,31],[2,5,2,5,2,5,7,2,4,5,7,1]],2078:[[31,31,31,32,31,31,30,29,30,29,30,30],[4,7,3,6,3,6,2,4,5,7,1,3]],2079:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2080:[[31,32,31,32,31,30,30,30,29,29,30,30],[6,2,6,2,6,2,4,6,1,2,3,5]],2081:[[31,31,32,32,31,30,30,30,29,30,30,30],[7,3,6,3,7,3,5,7,2,3,5,7]],2082:[[30,32,31,32,31,30,30,30,29,30,30,30],[2,4,1,4,1,4,6,1,3,4,6,1]],2083:[[31,31,32,31,31,30,30,30,29,30,30,30],[3,6,2,6,2,5,7,2,4,5,7,2]],2084:[[31,31,32,31,31,30,30,30,29,30,30,30],[4,7,3,7,3,6,1,3,5,6,1,3]],2085:[[31,32,31,32,30,31,30,30,29,30,30,30],[5,1,5,1,5,7,3,5,7,1,3,5]],2086:[[30,32,31,32,31,30,30,30,29,30,30,30],[7,2,6,2,6,2,4,6,1,2,4,6]],2087:[[31,31,32,31,31,31,30,30,29,30,30,30],[1,4,7,4,7,3,6,1,3,4,6,1]],2088:[[30,31,32,32,30,31,30,30,29,30,30,30],[3,5,1,5,2,4,7,2,4,5,7,2]],2089:[[30,32,31,32,31,30,30,30,29,30,30,30],[4,6,3,6,3,6,1,3,5,6,1,3]],2090:[[30,32,31,32,31,30,30,30,29,30,30,30],[5,7,4,7,4,7,2,4,6,7,2,4]]}}#x(){return[{day:"Sunday",en:{ddd:"Sunday",dd:"Sun",d:"S"},np:{ddd:"आइतबार",dd:"आइत",d:"आ"}},{day:"Monday",en:{ddd:"Monday",dd:"Mon",d:"M"},np:{ddd:"सोमबार",dd:"सोम",d:"सो"}},{day:"Tuesday",en:{ddd:"Tuesday",dd:"Tue",d:"T"},np:{ddd:"मंगलबार",dd:"मंगल",d:"मं"}},{day:"Wednesday",en:{ddd:"Wednesday",dd:"Wed",d:"W"},np:{ddd:"बुधबार",dd:"बुध",d:"बु"}},{day:"Thursday",en:{ddd:"Thursday",dd:"Thu",d:"T"},np:{ddd:"बिहिबार",dd:"बिहि",d:"बि"}},{day:"Friday",en:{ddd:"Friday",dd:"Fri",d:"F"},np:{ddd:"शुक्रबार",dd:"शुक्र",d:"शु"}},{day:"Saturday",en:{ddd:"Saturday",dd:"Sat",d:"S"},np:{ddd:"शनिबार",dd:"शनि",d:"श"}}]}#w(e,t){return a.#D()[t][0][e]}#M(e){const t={0:"०",1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९"};return e.toString().replace(/[0123456789]/g,(e=>t[e]))}#p(e){const t={"०":"0","१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9"};return e.toString().replace(/[०१२३४५६७८९]/g,(e=>t[e]))}#a(){switch(this.#e.position){case"left":default:return"ap-position-left";case"right":return"ap-position-right";case"center":return"ap-position-center"}}static convertToNepaliDate(e,t,n){e=+e,t=+t,n=+n;let a=this.#E(e,t,n),{nepaliYear:r,nepaliMonth:i,nepaliDate:o}=this.#S(a);return{year:r,month:i-1,date:o}}static#E(e,t,n){let a=0;for(let t=0;tthis.#D()[n][0][t-1]&&(a++,r=1,t++),i>7&&(i=1),a>12&&(n++,a=1),t>12&&(t=1),e--;return{nepaliYear:n,nepaliMonth:a,nepaliDate:r}}#u(e,t,n){const a=this.#e.format;switch(t=("0"+t).slice(-2),n=("0"+n).slice(-2),a){case"YYYY/MM/DD":return`${e}/${t}/${n}`;case"YYYY.MM.DD":return`${e}.${t}.${n}`;case"DD-MM-YYYY":return`${n}-${t}-${e}`;case"DD/MM/YYYY":return`${n}/${t}/${e}`;case"DD.MM.YYYY":return`${n}.${t}.${e}`;default:return`${e}-${t}-${n}`}}#$(e,t){const n=e.split(/[./-]/);switch(t){case"DD-MM-YYYY":case"DD/MM/YYYY":case"DD.MM.YYYY":return{year:parseInt(n[2]),month:parseInt(n[1]),day:parseInt(n[0])};default:return{year:parseInt(n[0]),month:parseInt(n[1]),day:parseInt(n[2])}}}#y(){switch(this.#e.theme){case"bordered":return"bordered-theme";case"soft":return"soft-theme";default:return"flat-theme"}}#g(e,t){const n=Object.keys(e.dataset);return t?n.find((e=>e.startsWith("ap-"))).split("-")[1]:n.find((e=>e.startsWith("ap-")))}}const r=a}},t={};function n(a){var r=t[a];if(void 0!==r)return r.exports;var i=t[a]={id:a,exports:{}};return e[a](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;var a={};return(()=>{n.d(a,{default:()=>m});var e=n(62),t=n.n(e),r=n(552),i=n.n(r),o=n(566),s=n.n(o),d=n(107),l=n.n(d),c=n(911),p=n.n(c),u=n(227),h=n.n(u),g=n(0),y={};y.styleTagTransform=h(),y.setAttributes=l(),y.insert=s().bind(null,"head"),y.domAPI=i(),y.insertStyleElement=p(),t()(g.Z,y),g.Z&&g.Z.locals&&g.Z.locals;const m=n(840).default})(),a.default})())); \ No newline at end of file diff --git a/dist/nepali-date-picker.css b/dist/nepali-date-picker.css new file mode 100644 index 0000000..45c83a0 --- /dev/null +++ b/dist/nepali-date-picker.css @@ -0,0 +1,286 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap'); + +:root { + --ap-white: #ffffff; + --ap-black: #000000; + --rounded-md: 0.375rem; + --gray-50: rgb(249 250 251 / 1); + --gray-100: rgb(243 244 246 / 1); + --gray-200: rgb(229 231 235 / 1); + --gray-300: rgb(209 213 219 / 1); + --gray-400: rgb(156 163 175 / 1); + --gray-500: rgb(107 114 128 / 1); + --gray-600: rgb(75 85 99 / 1); + --gray-700: rgb(55 65 81 / 1); + --gray-800: rgb(31 41 55 / 1); + --gray-900: rgb(17 24 39 / 1); + --gray-950: rgb(3 7 18 / 1); + --red-400: rgb(248 113 113 / 1); + --red-500: rgb(239 68 68 / 1); +} + +.theme-dark { + --ap-white: #1D1D1D; + --ap-black: #fefefe; + --gray-50: rgb(3 7 18 / 1); + --gray-100: rgb(33 34 36 / 1); + --gray-200: rgb(31 41 55 / 1); + --gray-300: rgb(55 65 81 / 1); + --gray-400: rgb(75 85 99 / 1 ); + --gray-500: rgb(210 210 210 / 1); + --gray-600: rgb(156 163 175 / 1); + --gray-700: rgb(209 213 219 / 1); + --gray-800: rgb(229 231 235 / 1); + --gray-900: rgb(243 244 246 / 1); + --gray-950: rgb(249 250 251 / 1); + --red-400: rgb(248 113 113 / 1); + --red-500: rgb(239 68 68 / 1); +} + +.ap-card { + font-family: 'Inter', sans-serif; + z-index: 10; + position: absolute; + display: none; + width: auto; + max-width: fit-content; + background: var(--ap-white); + box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgb(0 0 0 / 0.05); + padding: 0.5rem; + box-sizing: border-box; + font-size: 0.875rem; + line-height: 1.25rem; + border: 1px solid var(--gray-200); + border-radius: var(--rounded-md); + margin-top: 0.25rem; +} + +.ap-header-wrapper { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; +} + +.ap-header__button { + padding: 0.25rem; + border-radius: var(--rounded-md); + color: var(--ap-black); + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; + width: 2.5rem; + height: 2.5rem; + display: flex; + justify-content: center; + align-items: center; + border: none; + background: var(--ap-white); +} + +.ap-header__button:hover { + color: var(--gray-600); + background: var(--gray-100); +} + +.ap-header__button:focus { + color: var(--ap-black); + background: var(--ap-white); + outline: none; +} + +.ap-header__button > svg { + width: 1.25rem; + height: 1.25rem; +} + +.ap-header__selects { + display: flex; + align-items: center; + gap: 0.25rem; +} + +.ap-header__select { + appearance: none; + line-height: 1.8; + text-align: center; + height: 2.5rem; + padding: 0.25rem 1rem; + border-radius: var(--rounded-md); + border: none; + background: var(--ap-white); + color: var(--ap-black); +} + +.ap-header__select:focus { + outline: none; +} + +.ap-header__select:hover { + background: var(--gray-100); +} + +.ap-table { + margin-top: 0.5rem; + text-align: center; + width: 100%; +} + +.ap-table__thead__tr { + display: flex; + flex-wrap: nowrap; + align-items: center; + justify-content: flex-start; + color: var(--gray-500); + padding-top: 0.5rem; + padding-bottom: 0.75rem; + gap: 0.25rem; +} + +.ap-table__tbody__tr { + display: flex; + flex-wrap: nowrap; + align-items: center; + justify-content: flex-start; + color: var(--gray-500); + gap: 0.25rem; +} + +.ap-table__thead__tr_th { + width: 2.5rem; + font-weight: 500; + padding: 0; +} + +.holiday-marker-color { + color: var(--red-400) !important; +} + +.holiday-marker-color:hover > button { + color: var(--red-500) !important; +} + +.ap-table__tbody { + display: flex; + flex-direction: column; + row-gap: 0.25rem; +} + +.ap-table__thead__tr_td { + height: 2.5rem; + width: 2.5rem; + text-align: center; + padding: 0; + position: relative; + color: var(--gray-500); +} + +.ap-table__thead__tr_td > button { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: var(--rounded-md); + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; + width: 2.5rem; + height: 2.5rem; + padding: 0; + font-weight: 400; + border: none; + background: var(--ap-white); + color: inherit; +} + +.ap-table__thead__tr_td > button:focus { + outline: none; +} + +.ap-table__thead__tr_td > button:disabled { + color: var(--gray-400); + background: var(--gray-100); + cursor: not-allowed; +} + +.ap-table__thead__tr_td > button:hover { + color: var(--gray-500); + background: var(--gray-100); +} + +.no-hover:hover { + color: transparent !important; + background: transparent !important; +} + +.pointer-events-none { + pointer-events: none; +} + +.bordered { + border: 1px solid var(--gray-200); +} + +.ap-width-tr-td { + width: 2.5rem; +} + +.ap-width-ddd { + width: 4rem; +} + +.ap-width-np-ddd { + width: 5rem; +} + +.ap-gap { + gap: 0.25rem; +} + +.ap-table__thead__tr_td > button.selected { + background: var(--ap-black) !important; + color: var(--ap-white) !important; + border: none !important; +} + +.ap-cell-button.selected:hover { + background: var(--gray-800); + color: var(--ap-white); +} + + +.bordered-theme { + border: 1px solid var(--gray-200) !important; +} + +.soft-theme { + background: var(--gray-50) !important; + transition: all ease; +} + +.soft-theme:hover { + background: var(--gray-100) !important; +} + +.bordered-dashed { + border-style: dashed !important; +} + +.ap-table__thead__tr_td.active > button { + background: var(--gray-100); + border: 1px dashed var(--gray-400) !important; +} + +.ap-position-left { + left: 0; +} + +.ap-position-right { + right: 0 !important; +} + +.ap-position-center { + left: 0 !important; + right: 0 !important; + margin-left: auto !important; + margin-right: auto !important; +} \ No newline at end of file diff --git a/dist/nepali-date-picker.min.css b/dist/nepali-date-picker.min.css new file mode 100644 index 0000000..3fe0aa1 --- /dev/null +++ b/dist/nepali-date-picker.min.css @@ -0,0 +1 @@ +@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap);:root{--ap-white:#ffffff;--ap-black:#000000;--rounded-md:0.375rem;--gray-50:rgb(249 250 251 / 1);--gray-100:rgb(243 244 246 / 1);--gray-200:rgb(229 231 235 / 1);--gray-300:rgb(209 213 219 / 1);--gray-400:rgb(156 163 175 / 1);--gray-500:rgb(107 114 128 / 1);--gray-600:rgb(75 85 99 / 1);--gray-700:rgb(55 65 81 / 1);--gray-800:rgb(31 41 55 / 1);--gray-900:rgb(17 24 39 / 1);--gray-950:rgb(3 7 18 / 1);--red-400:rgb(248 113 113 / 1);--red-500:rgb(239 68 68 / 1)}.theme-dark{--ap-white:#1D1D1D;--ap-black:#fefefe;--gray-50:rgb(3 7 18 / 1);--gray-100:rgb(33 34 36 / 1);--gray-200:rgb(31 41 55 / 1);--gray-300:rgb(55 65 81 / 1);--gray-400:rgb(75 85 99 / 1 );--gray-500:rgb(210 210 210 / 1);--gray-600:rgb(156 163 175 / 1);--gray-700:rgb(209 213 219 / 1);--gray-800:rgb(229 231 235 / 1);--gray-900:rgb(243 244 246 / 1);--gray-950:rgb(249 250 251 / 1);--red-400:rgb(248 113 113 / 1);--red-500:rgb(239 68 68 / 1)}.ap-card{font-family:"Inter",sans-serif;z-index:10;position:absolute;display:none;width:auto;max-width:fit-content;background:var(--ap-white);box-shadow:0 0#0000,0 0#0000,0 1px 2px 0 rgb(0 0 0/.05);padding:.5rem;box-sizing:border-box;font-size:.875rem;line-height:1.25rem;border:1px solid var(--gray-200);border-radius:var(--rounded-md);margin-top:.25rem}.ap-header-wrapper{display:flex;justify-content:space-between;align-items:center;width:100%}.ap-header__button{padding:.25rem;border-radius:var(--rounded-md);color:var(--ap-black);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms;width:2.5rem;height:2.5rem;display:flex;justify-content:center;align-items:center;border:0;background:var(--ap-white)}.ap-header__button:hover{color:var(--gray-600);background:var(--gray-100)}.ap-header__button:focus{color:var(--ap-black);background:var(--ap-white);outline:0}.ap-header__button>svg{width:1.25rem;height:1.25rem}.ap-header__selects{display:flex;align-items:center;gap:.25rem}.ap-header__select{appearance:none;line-height:1.8;text-align:center;height:2.5rem;padding:.25rem 1rem;border-radius:var(--rounded-md);border:0;background:var(--ap-white);color:var(--ap-black)}.ap-header__select:focus{outline:0}.ap-header__select:hover{background:var(--gray-100)}.ap-table{margin-top:.5rem;text-align:center;width:100%}.ap-table__thead__tr{padding-top:.5rem;padding-bottom:.75rem}.ap-table__tbody__tr,.ap-table__thead__tr{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;color:var(--gray-500);gap:.25rem}.ap-table__thead__tr_th{width:2.5rem;font-weight:500;padding:0}.holiday-marker-color{color:var(--red-400)!important}.holiday-marker-color:hover>button{color:var(--red-500)!important}.ap-table__tbody{display:flex;flex-direction:column;row-gap:.25rem}.ap-table__thead__tr_td{height:2.5rem;width:2.5rem;text-align:center;padding:0;position:relative;color:var(--gray-500)}.ap-table__thead__tr_td>button{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--rounded-md);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms;width:2.5rem;height:2.5rem;padding:0;font-weight:400;border:0;background:var(--ap-white);color:inherit}.ap-table__thead__tr_td>button:focus{outline:0}.ap-table__thead__tr_td>button:disabled{color:var(--gray-400);background:var(--gray-100);cursor:not-allowed}.ap-table__thead__tr_td>button:hover{color:var(--gray-500);background:var(--gray-100)}.no-hover:hover{color:transparent!important;background:0 0!important}.pointer-events-none{pointer-events:none}.bordered{border:1px solid var(--gray-200)}.ap-width-tr-td{width:2.5rem}.ap-width-ddd{width:4rem}.ap-width-np-ddd{width:5rem}.ap-gap{gap:.25rem}.ap-table__thead__tr_td>button.selected{background:var(--ap-black)!important;color:var(--ap-white)!important;border:0!important}.ap-cell-button.selected:hover{background:var(--gray-800);color:var(--ap-white)}.bordered-theme{border:1px solid var(--gray-200)!important}.soft-theme{background:var(--gray-50)!important;transition:all ease}.soft-theme:hover{background:var(--gray-100)!important}.bordered-dashed{border-style:dashed!important}.ap-table__thead__tr_td.active>button{background:var(--gray-100);border:1px dashed var(--gray-400)!important}.ap-position-left{left:0}.ap-position-right{right:0!important}.ap-position-center{left:0!important;right:0!important;margin-left:auto!important;margin-right:auto!important} \ No newline at end of file diff --git a/dist/nepali-date-picker.min.js b/dist/nepali-date-picker.min.js new file mode 100644 index 0000000..07677c1 --- /dev/null +++ b/dist/nepali-date-picker.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NepaliDatePicker=t():e.NepaliDatePicker=t()}(this,(()=>(()=>{"use strict";var e={d:(t,a)=>{for(var n in a)e.o(a,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:a[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{default:()=>n});class a{#e={format:"YYYY-MM-DD",closeOnDateSelect:!0,disableAfterToday:!1,disableBeforeToday:!1,disableToday:!1,markHolidays:!0,holidays:["Saturday"],indicateCurrentDate:!0,setCurrentDate:!1,position:"left",daysFormat:"dd",locale:"np",theme:"flat",darkMode:!1};#t=null;#a="data-ap-";constructor(e,t){this.today=new Date,this.currentYear=this.today.getFullYear(),this.currentMonth=this.today.getMonth(),this.currentDay=this.today.getDate(),"object"==typeof t&&(this.#e={...this.#e,...t}),this.#t={trGap:"ap-gap",trAndTdWidth:"ddd"===this.#e.daysFormat?"np"===this.#e.locale?"ap-width-np-ddd":"ap-width-ddd":"ap-width-tr-td",position:this.#n()},this.#s(e)}#s(e){this.#i(),this.#r(e),this.#d(),this.#l()}#i(){let{year:e,month:t,date:n}=a.convertToNepaliDate(this.currentYear,this.currentMonth+1,this.currentDay);this.currentYear=+e,this.currentMonth=+t,this.currentDay=+n}#r(e){this.#o(e),this.#c()}#c(){document.addEventListener("click",(e=>{if(e.preventDefault(),e.target.classList.contains("ap-cell-button")){let t="selected";e.target.closest("table").querySelectorAll(".ap-cell-button").forEach((function(e){e&&t.split(" ").forEach((t=>e.classList.remove(t)))})),t.split(" ").forEach((t=>e.target.classList.add(t)));let a=parseInt(e.target.closest(".ap-card").querySelector(".ap-calendar-year").value),n=parseInt(e.target.closest(".ap-card").querySelector(".ap-calendar-month").value)+1,s=this.#p(e.target.textContent),i=("0"+n).slice(-2),r=("0"+s).slice(-2),d=this.#h(a,i,r),l=e.target.closest(".ap-card").previousElementSibling;l&&(l.value=d),this.#e.closeOnDateSelect&&document.querySelectorAll(".ap-card").forEach((function(e){e.style.display="none"}))}}))}#o(e){const t=document.querySelectorAll(e);t.length>0&&t.forEach((e=>{this.#e.setCurrentDate&&(e.value=this.#h(this.currentYear,this.currentMonth+1,this.currentDay)),e.hasAttribute("placeholder")||e.setAttribute("placeholder",this.#e.format),e.addEventListener("click",(t=>{t.preventDefault();const a=t.target.nextElementSibling;if(a&&a.classList.contains("ap-card"))return;const n=Math.floor(1e5+9e5*Math.random()).toString();e.setAttribute(`${this.#a+n}`,""),this.#u({selector:e,selectorUniqueId:n})}))}))}#d(){document.addEventListener("click",(e=>{if(e.target.classList.contains("ap-calendar")){const t=e.target.nextElementSibling,a=t.classList;e.target.parentElement.style.position="relative";const n=this.#y(e.target,!0);document.querySelectorAll(".ap-card").forEach((function(e){e.style.display="none"})),t&&a.contains(`ap-calendar-${n}`)&&(t.style.display="block")}}))}#l(){document.addEventListener("click",(function(e){e.target.matches(".ap-calendar, .ap-card, .ap-card *")||document.querySelectorAll(".ap-card").forEach((function(e){e.style.display="none"}))}))}#u({selector:e,selectorUniqueId:t}){const a=e;a.classList.add("ap-calendar");const n=this.#g(),s=this.#e.darkMode?"theme-dark":"theme-light",i=`\n \n `,r=`\n \n `,d=this.#m(),l=this.#b(),o=this.#f(),c=`\n
\n
\n
\n ${i}\n
\n \n \n
\n ${r}\n
\n
\n \n \n \n ${d}\n \n \n \n \n
\n
\n `;a.insertAdjacentHTML("afterend",c),this.#D(a,this.currentMonth,this.currentYear),this.#v(a)}#v(e){const t=e.nextElementSibling.querySelector(".btn-next"),a=e.nextElementSibling.querySelector(".btn-previous"),n=e.nextElementSibling.querySelector(".ap-calendar-year"),s=e.nextElementSibling.querySelector(".ap-calendar-month");let i=parseInt(n.value),r=parseInt(s.value);t.removeEventListener("click",(()=>{})),a.removeEventListener("click",(()=>{})),t.addEventListener("click",(t=>{t.preventDefault(),i=11===r?i+1:i,r=(r+1)%12,this.#D(e,r,i)})),a.addEventListener("click",(t=>{t.preventDefault(),i=0===r?i-1:i,r=0===r?11:r-1,this.#D(e,r,i)}))}#D(e,t,n){const s=e.nextElementSibling;let i;if(s&&s.classList.contains("ap-card")&&(i=s),!i)return;if(void 0===a.#M()[n])return;const r=a.#M()[n][1][t]-1,d=Object.keys(e.dataset).find((e=>e.includes("ap-"))).split("-")[1];i=document.querySelector(`.ap-calendar-${d}`);const l=i.querySelector(".calendar-body"),o=i.querySelector(".ap-calendar-year"),c=i.querySelector(".ap-calendar-month");o.removeEventListener("change",(()=>{})),c.removeEventListener("change",(()=>{})),o.addEventListener("change",(a=>{this.#D(e,t,a.target.value),this.#v(e)})),c.addEventListener("change",(t=>{this.#D(e,t.target.value,n),this.#v(e)})),o.value=n,c.value=t;const p=this.#g();if(l)for(;l.firstChild;)l.removeChild(l.firstChild);let h=1;for(let e=0;e<6;e++){const a=document.createElement("tr");a.classList.add("ap-table__tbody__tr");const s=this.#e.markHolidays&&this.#e.holidays.map((e=>this.#Y().findIndex((t=>t.day.toLowerCase()===e.toLowerCase()))));for(let i=0;i<7;i++){let d=s&&s.includes(i)?"holiday-marker-color":null;if(0===e&&ithis.#L(t,n))break;const e=document.createElement("td");e.classList.add("ap-table__thead__tr_td",this.#t.trAndTdWidth,"ap-cell",d);const s=document.createElement("button");s.classList.add("ap-cell-button",p),this.#C(s,n,t,h);const i="np"===this.#e.locale?this.#$(h):h;this.#e.indicateCurrentDate&&h===parseInt(this.currentDay)&&n===parseInt(this.currentYear)&&t===parseInt(this.currentMonth)&&(e.classList.add("active"),s.classList.add("bordered-dashed")),s.appendChild(document.createTextNode(i)),e.appendChild(s),a.append(e),h++}}l.append(a)}}#C(e,t,a,n){const s=this.currentYear,i=this.currentMonth+1,r=this.currentDay;t=+t,a=+a,n=+n,this.#e.disableBeforeToday&&(ts||t===s&&a+1>i||t===s&&a+1===i&&n>r)&&e.setAttribute("disabled","disabled")}#f(){return Array.from({length:91},((e,t)=>``)).join("")}#m(){return this.#Y().map((e=>`${e[this.#e.locale][this.#e.daysFormat]}`)).join("")}#b(){return this.#E().map(((e,t)=>``)).join("")}#T(){console.log("close date picker")}#E(){return[{en:"Baishak",np:"बैशाख"},{en:"Jestha",np:"जेठ"},{en:"Ashad",np:"असार"},{en:"Shrawn",np:"साउन"},{en:"Bhadra",np:"भदौ"},{en:"Ashwin",np:"असोज"},{en:"Kartik",np:"कार्तिक"},{en:"Mangshir",np:"मंसिर"},{en:"Poush",np:"पुष"},{en:"Magh",np:"माघ"},{en:"Falgun",np:"फाल्गुन"},{en:"Chaitra",np:"चैत्र"}]}static#S(){return[31,29,31,30,31,30,31,31,30,31,30,31]}static#_(){return[31,28,31,30,31,30,31,31,30,31,30,31]}static#M(){return{2e3:[[30,32,31,32,31,30,30,30,29,30,29,31],[4,6,3,6,3,6,1,3,5,6,1,2]],2001:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2002:[[31,31,32,32,31,30,30,29,30,29,30,30],[6,2,5,2,6,2,4,6,7,2,3,5]],2003:[[31,32,31,32,31,30,30,30,29,29,30,31],[7,3,7,3,7,3,5,7,2,3,4,6]],2004:[[30,32,31,32,31,30,30,30,29,30,29,31],[2,4,1,4,1,4,6,1,3,4,6,7]],2005:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2006:[[31,31,32,32,31,30,30,29,30,29,30,30],[4,7,3,7,4,7,2,4,5,7,1,3]],2007:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2008:[[31,31,31,32,31,31,29,30,30,29,29,31],[7,3,6,2,6,2,5,6,1,3,4,5]],2009:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2010:[[31,31,32,32,31,30,30,29,30,29,30,30],[2,5,1,5,2,5,7,2,3,5,6,1]],2011:[[31,32,31,32,31,30,30,30,29,29,30,31],[3,6,3,6,3,6,1,3,5,6,7,2]],2012:[[31,31,31,32,31,31,29,30,30,29,30,30],[5,1,4,7,4,7,3,4,6,1,2,4]],2013:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2014:[[31,31,32,32,31,30,30,29,30,29,30,30],[7,3,6,3,7,3,5,7,1,3,4,6]],2015:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2016:[[31,31,31,32,31,31,29,30,30,29,30,30],[3,6,2,5,2,5,1,2,4,6,7,2]],2017:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2018:[[31,32,31,32,31,30,30,29,30,29,30,30],[5,1,5,1,5,1,3,5,6,1,2,4]],2019:[[31,32,31,32,31,30,30,30,29,30,29,31],[6,2,6,2,6,2,4,6,1,2,4,5]],2020:[[31,31,31,32,31,31,30,29,30,29,30,30],[1,4,7,3,7,3,6,1,2,4,5,7]],2021:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2022:[[31,32,31,32,31,30,30,30,29,29,30,30],[3,6,3,6,3,6,1,3,5,6,7,2]],2023:[[31,32,31,32,31,30,30,30,29,30,29,31],[4,7,4,7,4,7,2,4,6,7,2,3]],2024:[[31,31,31,32,31,31,30,29,30,29,30,30],[6,2,5,1,5,1,4,6,7,2,3,5]],2025:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2026:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2027:[[30,32,31,32,31,30,30,30,29,30,29,31],[3,5,2,5,2,5,7,2,4,5,7,1]],2028:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2029:[[31,31,32,31,32,30,30,29,30,29,30,30],[5,1,4,1,4,1,3,5,6,1,2,4]],2030:[[31,32,31,32,31,30,30,30,29,29,30,31],[6,2,6,2,6,2,4,6,1,2,3,5]],2031:[[30,32,31,32,31,30,30,30,29,30,29,31],[1,3,7,3,7,3,5,7,2,3,5,6]],2032:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2033:[[31,31,32,32,31,30,30,29,30,29,30,30],[3,6,2,6,3,6,1,3,4,6,7,2]],2034:[[31,32,31,32,31,30,30,30,29,29,30,31],[4,7,4,7,4,7,2,4,6,7,1,3]],2035:[[30,32,31,32,31,31,29,30,30,29,29,31],[6,1,5,1,5,1,4,5,7,2,3,4]],2036:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2037:[[31,31,32,32,31,30,30,29,30,29,30,30],[1,4,7,4,1,4,6,1,2,4,5,7]],2038:[[31,32,31,32,31,30,30,30,29,29,30,31],[2,5,2,5,2,5,7,2,4,5,6,1]],2039:[[31,31,31,32,31,31,29,30,30,29,30,30],[4,7,3,6,3,6,2,3,5,7,1,3]],2040:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2041:[[31,31,32,32,31,30,30,29,30,29,30,30],[6,2,5,2,6,2,4,6,7,2,3,5]],2042:[[31,32,31,32,31,30,30,30,29,29,30,31],[7,3,7,3,7,3,5,7,2,3,4,6]],2043:[[31,31,31,32,31,31,29,30,30,29,30,30],[2,5,1,4,1,4,7,1,3,5,6,1]],2044:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2045:[[31,32,31,32,31,30,30,29,30,29,30,30],[4,7,4,7,4,7,2,4,5,7,1,3]],2046:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2047:[[31,31,31,32,31,31,30,29,30,29,30,30],[7,3,6,2,6,2,5,7,1,3,4,6]],2048:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2049:[[31,32,31,32,31,30,30,30,29,29,30,30],[2,5,2,5,2,5,7,2,4,5,6,1]],2050:[[31,32,31,32,31,30,30,30,29,30,29,31],[3,6,3,6,3,6,1,3,5,6,1,2]],2051:[[31,31,31,32,31,31,30,29,30,29,30,30],[5,1,4,7,4,7,3,5,6,1,2,4]],2052:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2053:[[31,32,31,32,31,30,30,30,29,29,30,30],[7,3,7,3,7,3,5,7,2,3,4,6]],2054:[[31,32,31,32,31,30,30,30,29,30,29,31],[1,4,1,4,1,4,6,1,3,4,6,7]],2055:[[31,31,32,31,31,31,30,29,30,29,30,30],[3,6,2,6,2,5,1,3,4,6,7,2]],2056:[[31,31,32,31,32,30,30,29,30,29,30,30],[4,7,3,7,3,7,2,4,5,7,1,3]],2057:[[31,32,31,32,31,30,30,30,29,29,30,31],[5,1,5,1,5,1,3,5,7,1,2,4]],2058:[[30,32,31,32,31,30,30,30,29,30,29,31],[7,2,6,2,6,2,4,6,1,2,4,5]],2059:[[31,31,32,31,31,31,30,29,30,29,30,30],[1,4,7,4,7,3,6,1,2,4,5,7]],2060:[[31,31,32,32,31,30,30,29,30,29,30,30],[2,5,1,5,2,5,7,2,3,5,6,1]],2061:[[31,32,31,32,31,30,30,30,29,29,30,31],[3,6,3,6,3,6,1,3,5,6,7,2]],2062:[[30,32,31,32,31,31,29,30,29,30,29,31],[5,7,4,7,4,7,3,4,6,7,2,3]],2063:[[31,31,32,31,31,31,30,29,30,29,30,30],[6,2,5,2,5,1,4,6,7,2,3,5]],2064:[[31,31,32,32,31,30,30,29,30,29,30,30],[7,3,6,3,7,3,5,7,1,3,4,6]],2065:[[31,32,31,32,31,30,30,30,29,29,30,31],[1,4,1,4,1,4,6,1,3,4,5,7]],2066:[[31,31,31,32,31,31,29,30,30,29,29,31],[3,6,2,5,2,5,1,2,4,6,7,1]],2067:[[31,31,32,31,31,31,30,29,30,29,30,30],[4,7,3,7,3,6,2,4,5,7,1,3]],2068:[[31,31,32,32,31,30,30,29,30,29,30,30],[5,1,4,1,5,1,3,5,6,1,2,4]],2069:[[31,32,31,32,31,30,30,30,29,29,30,31],[6,2,6,2,6,2,4,6,1,2,3,5]],2070:[[31,31,31,32,31,31,29,30,30,29,30,30],[1,4,7,3,7,3,6,7,2,4,5,7]],2071:[[31,31,32,31,31,31,30,29,30,29,30,30],[2,5,1,5,1,4,7,2,3,5,6,1]],2072:[[31,32,31,32,31,30,30,29,30,29,30,30],[3,6,3,6,3,6,1,3,4,6,7,2]],2073:[[31,32,31,32,31,30,30,30,29,29,30,31],[4,7,4,7,4,7,2,4,6,7,1,3]],2074:[[31,31,31,32,31,31,30,29,30,29,30,30],[6,2,5,1,5,1,4,6,7,2,3,5]],2075:[[31,31,32,31,31,31,30,29,30,29,30,30],[7,3,6,3,6,2,5,7,1,3,4,6]],2076:[[31,32,31,32,31,30,30,30,29,29,30,30],[1,4,1,4,1,4,6,1,3,4,5,7]],2077:[[31,32,31,32,31,30,30,30,29,30,29,31],[2,5,2,5,2,5,7,2,4,5,7,1]],2078:[[31,31,31,32,31,31,30,29,30,29,30,30],[4,7,3,6,3,6,2,4,5,7,1,3]],2079:[[31,31,32,31,31,31,30,29,30,29,30,30],[5,1,4,1,4,7,3,5,6,1,2,4]],2080:[[31,32,31,32,31,30,30,30,29,29,30,30],[6,2,6,2,6,2,4,6,1,2,3,5]],2081:[[31,31,32,32,31,30,30,30,29,30,30,30],[7,3,6,3,7,3,5,7,2,3,5,7]],2082:[[30,32,31,32,31,30,30,30,29,30,30,30],[2,4,1,4,1,4,6,1,3,4,6,1]],2083:[[31,31,32,31,31,30,30,30,29,30,30,30],[3,6,2,6,2,5,7,2,4,5,7,2]],2084:[[31,31,32,31,31,30,30,30,29,30,30,30],[4,7,3,7,3,6,1,3,5,6,1,3]],2085:[[31,32,31,32,30,31,30,30,29,30,30,30],[5,1,5,1,5,7,3,5,7,1,3,5]],2086:[[30,32,31,32,31,30,30,30,29,30,30,30],[7,2,6,2,6,2,4,6,1,2,4,6]],2087:[[31,31,32,31,31,31,30,30,29,30,30,30],[1,4,7,4,7,3,6,1,3,4,6,1]],2088:[[30,31,32,32,30,31,30,30,29,30,30,30],[3,5,1,5,2,4,7,2,4,5,7,2]],2089:[[30,32,31,32,31,30,30,30,29,30,30,30],[4,6,3,6,3,6,1,3,5,6,1,3]],2090:[[30,32,31,32,31,30,30,30,29,30,30,30],[5,7,4,7,4,7,2,4,6,7,2,4]]}}#Y(){return[{day:"Sunday",en:{ddd:"Sunday",dd:"Sun",d:"S"},np:{ddd:"आइतबार",dd:"आइत",d:"आ"}},{day:"Monday",en:{ddd:"Monday",dd:"Mon",d:"M"},np:{ddd:"सोमबार",dd:"सोम",d:"सो"}},{day:"Tuesday",en:{ddd:"Tuesday",dd:"Tue",d:"T"},np:{ddd:"मंगलबार",dd:"मंगल",d:"मं"}},{day:"Wednesday",en:{ddd:"Wednesday",dd:"Wed",d:"W"},np:{ddd:"बुधबार",dd:"बुध",d:"बु"}},{day:"Thursday",en:{ddd:"Thursday",dd:"Thu",d:"T"},np:{ddd:"बिहिबार",dd:"बिहि",d:"बि"}},{day:"Friday",en:{ddd:"Friday",dd:"Fri",d:"F"},np:{ddd:"शुक्रबार",dd:"शुक्र",d:"शु"}},{day:"Saturday",en:{ddd:"Saturday",dd:"Sat",d:"S"},np:{ddd:"शनिबार",dd:"शनि",d:"श"}}]}#L(e,t){return a.#M()[t][0][e]}#$(e){const t={0:"०",1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९"};return e.toString().replace(/[0123456789]/g,(e=>t[e]))}#p(e){const t={"०":"0","१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9"};return e.toString().replace(/[०१२३४५६७८९]/g,(e=>t[e]))}#n(){switch(this.#e.position){case"left":default:return"ap-position-left";case"right":return"ap-position-right";case"center":return"ap-position-center"}}static convertToNepaliDate(e,t,a){e=+e,t=+t,a=+a;let n=this.#k(e,t,a),{nepaliYear:s,nepaliMonth:i,nepaliDate:r}=this.#x(n);return{year:s,month:i-1,date:r}}static#k(e,t,a){let n=0;for(let t=0;tthis.#M()[a][0][t-1]&&(n++,s=1,t++),i>7&&(i=1),n>12&&(a++,n=1),t>12&&(t=1),e--;return{nepaliYear:a,nepaliMonth:n,nepaliDate:s}}#h(e,t,a){const n=this.#e.format;switch(t=("0"+t).slice(-2),a=("0"+a).slice(-2),n){case"YYYY/MM/DD":return`${e}/${t}/${a}`;case"YYYY.MM.DD":return`${e}.${t}.${a}`;case"DD-MM-YYYY":return`${a}-${t}-${e}`;case"DD/MM/YYYY":return`${a}/${t}/${e}`;case"DD.MM.YYYY":return`${a}.${t}.${e}`;default:return`${e}-${t}-${a}`}}#A(e,t){const a=e.split(/[./-]/);switch(t){case"DD-MM-YYYY":case"DD/MM/YYYY":case"DD.MM.YYYY":return{year:parseInt(a[2]),month:parseInt(a[1]),day:parseInt(a[0])};default:return{year:parseInt(a[0]),month:parseInt(a[1]),day:parseInt(a[2])}}}#g(){switch(this.#e.theme){case"bordered":return"bordered-theme";case"soft":return"soft-theme";default:return"flat-theme"}}#y(e,t){const a=Object.keys(e.dataset);return t?a.find((e=>e.startsWith("ap-"))).split("-")[1]:a.find((e=>e.startsWith("ap-")))}}const n=a;return t.default})())); \ No newline at end of file diff --git a/dist/img/branding-image.png b/public/img/branding-image.png similarity index 100% rename from dist/img/branding-image.png rename to public/img/branding-image.png