bs-ad-calendar-react 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- import { jsx as d, jsxs as b, Fragment as pe } from "react/jsx-runtime";
2
- import { useMemo as $t, useState as N, useEffect as Yt, useRef as xt } from "react";
3
- const tt = [1943, 4, 14], Lt = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], be = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], P = [[[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365]];
1
+ import { jsx as g, jsxs as S, Fragment as pe } from "react/jsx-runtime";
2
+ import { useMemo as $t, useState as B, useEffect as Yt, useRef as xt } from "react";
3
+ const Q = [1943, 4, 14], Lt = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], be = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], W = [[[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365]];
4
4
  let Rt = class extends Error {
5
5
  constructor(t) {
6
6
  super(t), this.name = "DateOutOfRangeError";
7
7
  }
8
8
  };
9
- const _t = () => tt[0] + 1, jt = () => tt[0] + P.length - 1, Pt = () => 2e3, Wt = () => 2e3 + P.length - 1, ft = (e) => e % 400 === 0 || e % 4 === 0 && e % 100 !== 0, kt = (e) => ft(e) ? be : Lt, Se = (e, t, n) => !(e < _t() || e > jt() || t < 1 || t > 12 || n < 1 || n > kt(e)[t - 1]), Ft = (e, t, n) => {
9
+ const _t = () => Q[0] + 1, jt = () => Q[0] + W.length - 1, Pt = () => 2e3, Wt = () => 2e3 + W.length - 1, yt = (e) => e % 400 === 0 || e % 4 === 0 && e % 100 !== 0, kt = (e) => yt(e) ? be : Lt, Se = (e, t, n) => !(e < _t() || e > jt() || t < 1 || t > 12 || n < 1 || n > kt(e)[t - 1]), Ft = (e, t, n) => {
10
10
  let a = e * 365 + n;
11
11
  for (let s = 0; s < t - 1; s++) a += Lt[s];
12
12
  return t <= 2 && (e -= 1), a += Math.floor(e / 4) - Math.floor(e / 100) + Math.floor(e / 400), a;
@@ -14,65 +14,65 @@ const _t = () => tt[0] + 1, jt = () => tt[0] + P.length - 1, Pt = () => 2e3, Wt
14
14
  function Ee(e, t, n) {
15
15
  const a = t + 1;
16
16
  if (!Se(e, a, n)) throw new Rt("Date out of range");
17
- let s = 2e3, r = 1, o = 1, u = Math.abs(Ft(e, a, n) - Ft(...tt)), i = 0;
18
- for (; u >= P[i][1]; ) u -= P[i][1], s += 1, i += 1;
19
- let c = 0;
20
- for (; u >= P[i][0][c]; ) u -= P[i][0][c], r += 1, c += 1;
17
+ let s = 2e3, r = 1, o = 1, u = Math.abs(Ft(e, a, n) - Ft(...Q)), i = 0;
18
+ for (; u >= W[i][1]; ) u -= W[i][1], s += 1, i += 1;
19
+ let h = 0;
20
+ for (; u >= W[i][0][h]; ) u -= W[i][0][h], r += 1, h += 1;
21
21
  return o += u, [s, r - 1, o];
22
22
  }
23
- const we = (e, t, n) => !(e < Pt() || e > Wt() || t < 1 || t > 12 || n < 1 || n > P[e - 2e3][0][t - 1]), Ye = (e, t, n) => {
23
+ const we = (e, t, n) => !(e < Pt() || e > Wt() || t < 1 || t > 12 || n < 1 || n > W[e - 2e3][0][t - 1]), Ye = (e, t, n) => {
24
24
  let a = n - 1;
25
25
  const s = e - 2e3;
26
- for (let r = 0; r < t - 1; r++) a += P[s][0][r];
27
- for (let r = 0; r < s; r++) a += P[r][1];
26
+ for (let r = 0; r < t - 1; r++) a += W[s][0][r];
27
+ for (let r = 0; r < s; r++) a += W[r][1];
28
28
  return a;
29
29
  }, ke = (e, t, n) => {
30
30
  const a = t + 1;
31
31
  if (!we(e, a, n)) throw new Rt("Date out of range");
32
- let [s, r, o] = [tt[0], 1, 1];
33
- const u = kt(s).slice(0, tt[1] - 1).reduce((g, m) => g + m, 0) + tt[2] - 1;
32
+ let [s, r, o] = [Q[0], 1, 1];
33
+ const u = kt(s).slice(0, Q[1] - 1).reduce((D, d) => D + d, 0) + Q[2] - 1;
34
34
  let i = Math.abs(Ye(e, a, n) + u);
35
- for (; i >= 366 && ft(s) || i >= 365 && !ft(s); ) i -= ft(s) ? 366 : 365, s += 1;
36
- const c = kt(s);
37
- let h = 0;
38
- for (; i >= c[h]; ) i -= c[h], r += 1, h += 1;
35
+ for (; i >= 366 && yt(s) || i >= 365 && !yt(s); ) i -= yt(s) ? 366 : 365, s += 1;
36
+ const h = kt(s);
37
+ let c = 0;
38
+ for (; i >= h[c]; ) i -= h[c], r += 1, c += 1;
39
39
  return o += i, [s, r - 1, o];
40
- }, W = { enMinYear: _t, enMaxYear: jt, npMinYear: Pt, npMaxYear: Wt, englishToNepali: Ee, nepaliToEnglish: ke }, Vt = "en", L = "ne", Ut = 207e5, Jt = 198e5, Ce = 5049018e5, Ae = new Date(1986, 0, 1, 0, 15), Mt = ["Baisakh", "Jestha", "Asar", "Shrawan", "Bhadra", "Aswin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Ct = ["Bai", "Jes", "Asa", "Shr", "Bhd", "Asw", "Kar", "Man", "Pou", "Mag", "Fal", "Cha"], Kt = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मंसिर", "पौष", "माघ", "फाल्गुण", "चैत्र"], ve = ["बै", "जे", "अ", "श्रा", "भा", "आ", "का", "मं", "पौ", "मा", "फा", "चै"], At = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], vt = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], $e = ["जनवरी", "फेब्रुअरी", "मार्च", "अप्रिल", "मे", "जुन", "जुलाई", "अगस्ट", "सेप्टेम्बर", "अक्टोबर", "नोभेम्बर", "डिसेम्बर"], xe = ["जन", "फेब", "मार", "अप्रि", "मे", "जुन", "जुला", "अग", "सेप", "अक्टो", "नोभे", "डिसे"], Gt = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], et = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], pt = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], zt = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], qt = ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहिबार", "शुक्रबार", "शनिबार"], Fe = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DD?|ddd?d?|do?|YYYY|YY|y{2,4}|yo?|a|A|hh?|HH?|mm?|ss?|SSS|x|X|.)/g, Oe = (e) => {
41
- const t = e.getTime(), n = t < Ce ? Jt : Ut, a = new Date(t + n), s = a.getUTCFullYear(), r = a.getUTCMonth(), o = a.getUTCDate(), u = a.getUTCHours(), i = a.getUTCMinutes(), c = a.getUTCSeconds(), h = a.getUTCMilliseconds(), g = a.getUTCDay();
42
- return { year: s, month0: r, day: o, hour: u, minute: i, second: c, ms: h, weekDay: g };
40
+ }, J = { enMinYear: _t, enMaxYear: jt, npMinYear: Pt, npMaxYear: Wt, englishToNepali: Ee, nepaliToEnglish: ke }, Ut = "en", L = "ne", Jt = 207e5, Vt = 198e5, Ce = 5049018e5, Ae = new Date(1986, 0, 1, 0, 15), Mt = ["Baisakh", "Jestha", "Asar", "Shrawan", "Bhadra", "Aswin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Ct = ["Bai", "Jes", "Asa", "Shr", "Bhd", "Asw", "Kar", "Man", "Pou", "Mag", "Fal", "Cha"], Kt = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मंसिर", "पौष", "माघ", "फाल्गुण", "चैत्र"], ve = ["बै", "जे", "अ", "श्रा", "भा", "आ", "का", "मं", "पौ", "मा", "फा", "चै"], At = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], vt = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], $e = ["जनवरी", "फेब्रुअरी", "मार्च", "अप्रिल", "मे", "जुन", "जुलाई", "अगस्ट", "सेप्टेम्बर", "अक्टोबर", "नोभेम्बर", "डिसेम्बर"], xe = ["जन", "फेब", "मार", "अप्रि", "मे", "जुन", "जुला", "अग", "सेप", "अक्टो", "नोभे", "डिसे"], Gt = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], tt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], pt = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], zt = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], qt = ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहिबार", "शुक्रबार", "शनिबार"], Fe = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DD?|ddd?d?|do?|YYYY|YY|y{2,4}|yo?|a|A|hh?|HH?|mm?|ss?|SSS|x|X|.)/g, Oe = (e) => {
41
+ const t = e.getTime(), n = t < Ce ? Vt : Jt, a = new Date(t + n), s = a.getUTCFullYear(), r = a.getUTCMonth(), o = a.getUTCDate(), u = a.getUTCHours(), i = a.getUTCMinutes(), h = a.getUTCSeconds(), c = a.getUTCMilliseconds(), D = a.getUTCDay();
42
+ return { year: s, month0: r, day: o, hour: u, minute: i, second: h, ms: c, weekDay: D };
43
43
  }, Ot = (e, t, n, a, s, r, o) => {
44
44
  const u = new Date(e, t, n, a, s, r, o);
45
- let i = u < Ae ? Jt : Ut;
46
- const c = -1 * u.getTimezoneOffset() * 60 * 1e3;
47
- return new Date(u.getTime() - i + c);
45
+ let i = u < Ae ? Vt : Jt;
46
+ const h = -1 * u.getTimezoneOffset() * 60 * 1e3;
47
+ return new Date(u.getTime() - i + h);
48
48
  }, bt = (e) => {
49
49
  const t = e.match(Fe);
50
50
  return t ? t.map((n) => n.startsWith("[") && n.endsWith("]") ? n.slice(1, -1) : n) : [];
51
- }, j = (e) => {
51
+ }, P = (e) => {
52
52
  if (e.length === 0) return new RegExp("");
53
53
  let t = [...e];
54
54
  if (t = t.sort((a, s) => s.length - a.length), t[0] === "") return new RegExp("");
55
55
  const n = `(${t.join("|")})`;
56
56
  return new RegExp(n);
57
- }, x = (e) => e.toString().padStart(2, "0"), Xt = (e) => e.toString().padStart(3, "0"), Te = (e) => e.split("").map((t) => Gt[t.charCodeAt(0) - 48]).join(""), p = (e, t) => {
57
+ }, F = (e) => e.toString().padStart(2, "0"), Xt = (e) => e.toString().padStart(3, "0"), Ne = (e) => e.split("").map((t) => Gt[t.charCodeAt(0) - 48]).join(""), b = (e, t) => {
58
58
  const n = typeof e == "string" ? e : String(e);
59
- return t !== L ? n : Te(n);
60
- }, He = (e, t) => p(e.getYear(), t).substring(2), Ne = (e, t) => p(e.getYear(), t), Be = (e, t) => p(e.getEnglishYear(), t).substring(2), Ie = (e, t) => p(e.getEnglishYear(), t), Le = (e, t) => p(e.getMonth() + 1, t), Re = (e, t) => p(x(e.getMonth() + 1), t), _e = (e, t) => t === L ? ve[e.getMonth()] : Ct[e.getMonth()], je = (e, t) => t === L ? Kt[e.getMonth()] : Mt[e.getMonth()], Pe = (e, t) => p(e.getEnglishMonth() + 1, t), We = (e, t) => p(x(e.getEnglishMonth() + 1), t), Ve = (e, t) => t === L ? xe[e.getEnglishMonth()] : vt[e.getEnglishMonth()], Ue = (e, t) => t === L ? $e[e.getEnglishMonth()] : At[e.getEnglishMonth()], Je = (e, t) => p(e.getDate(), t), Ke = (e, t) => p(x(e.getDate()), t), Ge = (e, t) => p(e.getEnglishDate(), t), ze = (e, t) => p(x(e.getEnglishDate()), t), Zt = (e, t) => p(e.getDay(), t), yt = (e, t) => t === L ? zt[e.getDay()] : et[e.getDay()], Qt = (e, t) => t === L ? qt[e.getDay()] : pt[e.getDay()], te = (e, t) => p(e.getHours(), t), ee = (e, t) => p(x(e.getHours()), t), ne = (e, t) => {
59
+ return t !== L ? n : Ne(n);
60
+ }, Te = (e, t) => b(e.getYear(), t).substring(2), He = (e, t) => b(e.getYear(), t), Be = (e, t) => b(e.getEnglishYear(), t).substring(2), Ie = (e, t) => b(e.getEnglishYear(), t), Le = (e, t) => b(e.getMonth() + 1, t), Re = (e, t) => b(F(e.getMonth() + 1), t), _e = (e, t) => t === L ? ve[e.getMonth()] : Ct[e.getMonth()], je = (e, t) => t === L ? Kt[e.getMonth()] : Mt[e.getMonth()], Pe = (e, t) => b(e.getEnglishMonth() + 1, t), We = (e, t) => b(F(e.getEnglishMonth() + 1), t), Ue = (e, t) => t === L ? xe[e.getEnglishMonth()] : vt[e.getEnglishMonth()], Je = (e, t) => t === L ? $e[e.getEnglishMonth()] : At[e.getEnglishMonth()], Ve = (e, t) => b(e.getDate(), t), Ke = (e, t) => b(F(e.getDate()), t), Ge = (e, t) => b(e.getEnglishDate(), t), ze = (e, t) => b(F(e.getEnglishDate()), t), Zt = (e, t) => b(e.getDay(), t), ft = (e, t) => t === L ? zt[e.getDay()] : tt[e.getDay()], Qt = (e, t) => t === L ? qt[e.getDay()] : pt[e.getDay()], te = (e, t) => b(e.getHours(), t), ee = (e, t) => b(F(e.getHours()), t), ne = (e, t) => {
61
61
  const n = e.getHours(), a = n > 12 ? n - 12 : n;
62
- return p(a, t);
62
+ return b(a, t);
63
63
  }, se = (e, t) => {
64
64
  const n = e.getHours(), a = n > 12 ? n - 12 : n;
65
- return p(x(a), t);
66
- }, ae = (e, t) => p(e.getMinutes(), t), re = (e, t) => p(x(e.getMinutes()), t), oe = (e, t) => p(e.getSeconds(), t), ie = (e, t) => p(x(e.getSeconds()), t), ue = (e, t) => p(Xt(e.getMilliseconds()), t), ce = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "PM" : "AM", he = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "pm" : "am", Tt = { YY: He, YYYY: Ne, M: Le, MM: Re, MMM: _e, MMMM: je, D: Je, DD: Ke, d: Zt, dd: yt, ddd: yt, dddd: Qt, H: te, HH: ee, h: ne, hh: se, m: ae, mm: re, s: oe, ss: ie, SSS: ue, A: ce, a: he }, le = (e, t, n) => {
67
- const a = bt(t), s = (r) => r in Tt ? Tt[r](e, n) : r;
65
+ return b(F(a), t);
66
+ }, ae = (e, t) => b(e.getMinutes(), t), re = (e, t) => b(F(e.getMinutes()), t), oe = (e, t) => b(e.getSeconds(), t), ie = (e, t) => b(F(e.getSeconds()), t), ue = (e, t) => b(Xt(e.getMilliseconds()), t), ce = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "PM" : "AM", he = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "pm" : "am", Nt = { YY: Te, YYYY: He, M: Le, MM: Re, MMM: _e, MMMM: je, D: Ve, DD: Ke, d: Zt, dd: ft, ddd: ft, dddd: Qt, H: te, HH: ee, h: ne, hh: se, m: ae, mm: re, s: oe, ss: ie, SSS: ue, A: ce, a: he }, le = (e, t, n) => {
67
+ const a = bt(t), s = (r) => r in Nt ? Nt[r](e, n) : r;
68
68
  return a.map(s).join("");
69
- }, qe = (e, t) => le(e, t, Vt), Xe = (e, t) => le(e, t, L), Ze = (e) => {
70
- const t = x(e.getYear()), n = x(e.getMonth() + 1), a = x(e.getDate()), s = x(e.getHours()), r = x(e.getMinutes()), o = x(e.getSeconds()), u = e.getMilliseconds(), i = u === 0 ? "" : `.${Xt(u)}`;
69
+ }, qe = (e, t) => le(e, t, Ut), Xe = (e, t) => le(e, t, L), Ze = (e) => {
70
+ const t = F(e.getYear()), n = F(e.getMonth() + 1), a = F(e.getDate()), s = F(e.getHours()), r = F(e.getMinutes()), o = F(e.getSeconds()), u = e.getMilliseconds(), i = u === 0 ? "" : `.${Xt(u)}`;
71
71
  return `${t}-${n}-${a} ${s}:${r}:${o}${i}`;
72
- }, Ht = { YY: Be, YYYY: Ie, M: Pe, MM: We, MMM: Ve, MMMM: Ue, D: Ge, DD: ze, d: Zt, dd: yt, ddd: yt, dddd: Qt, H: te, HH: ee, h: ne, hh: se, m: ae, mm: re, s: oe, ss: ie, SSS: ue, A: ce, a: he }, de = (e, t, n) => {
73
- const a = bt(t), s = (r) => r in Ht ? Ht[r](e, n) : r;
72
+ }, Tt = { YY: Be, YYYY: Ie, M: Pe, MM: We, MMM: Ue, MMMM: Je, D: Ge, DD: ze, d: Zt, dd: ft, ddd: ft, dddd: Qt, H: te, HH: ee, h: ne, hh: se, m: ae, mm: re, s: oe, ss: ie, SSS: ue, A: ce, a: he }, de = (e, t, n) => {
73
+ const a = bt(t), s = (r) => r in Tt ? Tt[r](e, n) : r;
74
74
  return a.map(s).join("");
75
- }, Qe = (e, t) => de(e, t, Vt), t3 = (e, t) => de(e, t, L);
75
+ }, Qe = (e, t) => de(e, t, Ut), t3 = (e, t) => de(e, t, L);
76
76
  function e3(e) {
77
77
  const t = e.split(/[-./]/, 3), [n, a = 1, s = 1] = t.map((r) => {
78
78
  const o = parseInt(r, 10);
@@ -84,82 +84,82 @@ function e3(e) {
84
84
  function n3(e) {
85
85
  if (!e) return [0, 0, 0, 0];
86
86
  const [t, n = "0"] = e.split(".", 2), a = t.split(":", 3), [s, r = 0, o = 0] = a.map((i) => {
87
- const c = parseInt(i, 10);
88
- if (Number.isNaN(c)) throw new Error("Invalid time");
89
- return c;
87
+ const h = parseInt(i, 10);
88
+ if (Number.isNaN(h)) throw new Error("Invalid time");
89
+ return h;
90
90
  });
91
91
  let u = parseInt(n, 10);
92
92
  return Number.isNaN(u) && (u = 0), [s, r, o, u];
93
93
  }
94
94
  function s3(e) {
95
- const [t, n] = e.split(" ", 2), [a, s, r] = e3(t), [o, u, i, c] = n3(n);
96
- return [a, s, r, o, u, i, c];
95
+ const [t, n] = e.split(" ", 2), [a, s, r] = e3(t), [o, u, i, h] = n3(n);
96
+ return [a, s, r, o, u, i, h];
97
97
  }
98
- const Nt = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: j(Mt), MMM: j(Ct), dddd: j(pt), ddd: j(et), dd: j(et), d: /([0-6])/ };
98
+ const Ht = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: P(Mt), MMM: P(Ct), dddd: P(pt), ddd: P(tt), dd: P(tt), d: /([0-6])/ };
99
99
  function a3(e) {
100
100
  const t = [], n = [];
101
- for (const s of e) s in Nt ? (t.push(s), n.push(Nt[s].source)) : n.push(s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
101
+ for (const s of e) s in Ht ? (t.push(s), n.push(Ht[s].source)) : n.push(s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
102
102
  const a = n.join("");
103
103
  return { dateTokens: t, regex: new RegExp(`^${a}$`) };
104
104
  }
105
105
  function r3(e, t) {
106
- let [n, a, s, r, o, u, i, c] = [0, 1, 1, 0, 0, 0, 0, 0], h = !1, g = !1;
107
- for (let m = 0; m < e.length; m++) {
108
- const S = e[m], f = parseInt(t[m + 1]);
109
- switch (S) {
106
+ let [n, a, s, r, o, u, i, h] = [0, 1, 1, 0, 0, 0, 0, 0], c = !1, D = !1;
107
+ for (let d = 0; d < e.length; d++) {
108
+ const k = e[d], m = parseInt(t[d + 1]);
109
+ switch (k) {
110
110
  case "YYYY":
111
- n = f;
111
+ n = m;
112
112
  break;
113
113
  case "YY":
114
- n = 2e3 + parseInt(t[m]);
114
+ n = 2e3 + parseInt(t[d]);
115
115
  break;
116
116
  case "MM":
117
117
  case "M":
118
- a = f;
118
+ a = m;
119
119
  break;
120
120
  case "MMMM":
121
- a = Mt.indexOf(t[m + 1]) + 1;
121
+ a = Mt.indexOf(t[d + 1]) + 1;
122
122
  break;
123
123
  case "MMM":
124
- a = Ct.indexOf(t[m + 1]) + 1;
124
+ a = Ct.indexOf(t[d + 1]) + 1;
125
125
  break;
126
126
  case "DD":
127
127
  case "D":
128
- s = f;
128
+ s = m;
129
129
  break;
130
130
  case "HH":
131
131
  case "H":
132
- r = f;
132
+ r = m;
133
133
  break;
134
134
  case "hh":
135
135
  case "h":
136
- o = f, g = !0;
136
+ o = m, D = !0;
137
137
  break;
138
138
  case "mm":
139
139
  case "m":
140
- u = f;
140
+ u = m;
141
141
  break;
142
142
  case "ss":
143
143
  case "s":
144
- i = f;
144
+ i = m;
145
145
  break;
146
146
  case "SSS":
147
- c = f;
147
+ h = m;
148
148
  break;
149
149
  case "A":
150
150
  case "a":
151
- h = t[m + 1].toLowerCase() === "pm";
151
+ c = t[d + 1].toLowerCase() === "pm";
152
152
  }
153
153
  }
154
- return g && (r = o + (h ? 12 : 0)), { year: n, month0: a - 1, day: s, hour: r, minute: u, second: i, ms: c };
154
+ return D && (r = o + (c ? 12 : 0)), { year: n, month0: a - 1, day: s, hour: r, minute: u, second: i, ms: h };
155
155
  }
156
156
  function ge(e, t) {
157
157
  const n = bt(t), { dateTokens: a, regex: s } = a3(n), r = RegExp(s).exec(e);
158
158
  if (!r) throw new Error("Invalid date format");
159
- const { year: o, month0: u, day: i, hour: c, minute: h, second: g, ms: m } = r3(a, r);
160
- return [o, u, i, c, h, g, m];
159
+ const { year: o, month0: u, day: i, hour: h, minute: c, second: D, ms: d } = r3(a, r);
160
+ return [o, u, i, h, c, D, d];
161
161
  }
162
- const Bt = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: j(At), MMM: j(vt), dddd: j(pt), ddd: j(et), dd: j(et), d: /([0-6])/ };
162
+ const Bt = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: P(At), MMM: P(vt), dddd: P(pt), ddd: P(tt), dd: P(tt), d: /([0-6])/ };
163
163
  function o3(e) {
164
164
  const t = [], n = [];
165
165
  for (const s of e) s in Bt ? (t.push(s), n.push(Bt[s].source)) : n.push(s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
@@ -167,65 +167,65 @@ function o3(e) {
167
167
  return { dateTokens: t, regex: new RegExp(`^${a}$`) };
168
168
  }
169
169
  function i3(e, t) {
170
- let [n, a, s, r, o, u, i, c] = [0, 1, 1, 0, 0, 0, 0, 0], h = !1, g = !1;
171
- for (let m = 0; m < e.length; m++) {
172
- const S = e[m], f = parseInt(t[m + 1]);
173
- switch (S) {
170
+ let [n, a, s, r, o, u, i, h] = [0, 1, 1, 0, 0, 0, 0, 0], c = !1, D = !1;
171
+ for (let d = 0; d < e.length; d++) {
172
+ const k = e[d], m = parseInt(t[d + 1]);
173
+ switch (k) {
174
174
  case "YYYY":
175
- n = f;
175
+ n = m;
176
176
  break;
177
177
  case "YY":
178
- n = 2e3 + parseInt(t[m]);
178
+ n = 2e3 + parseInt(t[d]);
179
179
  break;
180
180
  case "MM":
181
181
  case "M":
182
- a = f;
182
+ a = m;
183
183
  break;
184
184
  case "MMMM":
185
- a = At.indexOf(t[m + 1]) + 1;
185
+ a = At.indexOf(t[d + 1]) + 1;
186
186
  break;
187
187
  case "MMM":
188
- a = vt.indexOf(t[m + 1]) + 1;
188
+ a = vt.indexOf(t[d + 1]) + 1;
189
189
  break;
190
190
  case "DD":
191
191
  case "D":
192
- s = f;
192
+ s = m;
193
193
  break;
194
194
  case "HH":
195
195
  case "H":
196
- r = f;
196
+ r = m;
197
197
  break;
198
198
  case "hh":
199
199
  case "h":
200
- o = f, g = !0;
200
+ o = m, D = !0;
201
201
  break;
202
202
  case "mm":
203
203
  case "m":
204
- u = f;
204
+ u = m;
205
205
  break;
206
206
  case "ss":
207
207
  case "s":
208
- i = f;
208
+ i = m;
209
209
  break;
210
210
  case "SSS":
211
- c = f;
211
+ h = m;
212
212
  break;
213
213
  case "A":
214
214
  case "a":
215
- h = t[m + 1].toLowerCase() === "pm";
215
+ c = t[d + 1].toLowerCase() === "pm";
216
216
  }
217
217
  }
218
- return g && (r = o + (h ? 12 : 0)), { year: n, month0: a - 1, day: s, hour: r, minute: u, second: i, ms: c };
218
+ return D && (r = o + (c ? 12 : 0)), { year: n, month0: a - 1, day: s, hour: r, minute: u, second: i, ms: h };
219
219
  }
220
220
  function u3(e, t) {
221
221
  const n = bt(t), { dateTokens: a, regex: s } = o3(n), r = RegExp(s).exec(e);
222
222
  if (!r) throw new Error("Invalid date format");
223
- const { year: o, month0: u, day: i, hour: c, minute: h, second: g, ms: m } = i3(a, r);
224
- return [o, u, i, c, h, g, m];
223
+ const { year: o, month0: u, day: i, hour: h, minute: c, second: D, ms: d } = i3(a, r);
224
+ return [o, u, i, h, c, D, d];
225
225
  }
226
226
  function c3(e) {
227
227
  const t = { एम: "AM", पिम: "PM" };
228
- Kt.forEach((a, s) => t[a] = Mt[s]), qt.forEach((a, s) => t[a] = pt[s]), zt.forEach((a, s) => t[a] = et[s]), Gt.forEach((a, s) => t[a] = String(s));
228
+ Kt.forEach((a, s) => t[a] = Mt[s]), qt.forEach((a, s) => t[a] = pt[s]), zt.forEach((a, s) => t[a] = tt[s]), Gt.forEach((a, s) => t[a] = String(s));
229
229
  const n = new RegExp(Object.keys(t).join("|"), "g");
230
230
  return e.replace(n, (a) => t[a]);
231
231
  }
@@ -297,8 +297,8 @@ class Y {
297
297
  this.timestamp = t;
298
298
  const { year: a, month0: s, day: r, hour: o, minute: u, weekDay: i } = Oe(t);
299
299
  if (this.yearEn = a, this.monthEn = s, this.dayEn = r, this.hour = o, this.minute = u, this.weekDay = i, n) {
300
- const [c, h, g] = W.englishToNepali(a, s, r);
301
- this.year = c, this.month = h, this.day = g;
300
+ const [h, c, D] = J.englishToNepali(a, s, r);
301
+ this.year = h, this.month = c, this.day = D;
302
302
  }
303
303
  }
304
304
  getDateObject() {
@@ -366,8 +366,8 @@ class Y {
366
366
  }
367
367
  set(t, n, a, s, r, o, u) {
368
368
  D3(s, r, o, u);
369
- const [i, c, h] = W.nepaliToEnglish(t, n, a);
370
- this.year = t, this.month = n, this.day = a, this._setDateObject(Ot(i, c, h, s, r, o, u), !1);
369
+ const [i, h, c] = J.nepaliToEnglish(t, n, a);
370
+ this.year = t, this.month = n, this.day = a, this._setDateObject(Ot(i, h, c, s, r, o, u), !1);
371
371
  }
372
372
  setDateObject(t) {
373
373
  this._setDateObject(t, !0);
@@ -392,29 +392,29 @@ class Y {
392
392
  return new Y(i);
393
393
  }
394
394
  static parseNepaliFormat(t, n) {
395
- const [a, s, r, o, u, i, c] = h3(t, n);
396
- return new Y(a, s, r, o, u, i, c);
395
+ const [a, s, r, o, u, i, h] = h3(t, n);
396
+ return new Y(a, s, r, o, u, i, h);
397
397
  }
398
398
  static parseEnglishDate(t, n) {
399
- const [a, s, r, o, u, i, c] = u3(t, n);
400
- return Y.fromEnglishDate(a, s, r, o, u, i, c);
399
+ const [a, s, r, o, u, i, h] = u3(t, n);
400
+ return Y.fromEnglishDate(a, s, r, o, u, i, h);
401
401
  }
402
402
  static getDaysOfMonth(t, n) {
403
- if (t < W.npMinYear() || t > W.npMaxYear()) throw new Error("Year out of range");
403
+ if (t < J.npMinYear() || t > J.npMaxYear()) throw new Error("Year out of range");
404
404
  if (n < 0 || n > 11) throw new Error("Month out of range");
405
- return P[t - W.npMinYear()][0][n];
405
+ return W[t - J.npMinYear()][0][n];
406
406
  }
407
407
  static minSupportedDate() {
408
- return Y.fromEnglishDate(W.enMinYear(), 0, 1).getDateObject();
408
+ return Y.fromEnglishDate(J.enMinYear(), 0, 1).getDateObject();
409
409
  }
410
410
  static maxSupportedDate() {
411
- return Y.fromEnglishDate(W.enMaxYear(), 11, 31).getDateObject();
411
+ return Y.fromEnglishDate(J.enMaxYear(), 11, 31).getDateObject();
412
412
  }
413
413
  static minSupportedNepaliDate() {
414
- return new Y(W.npMinYear(), 0, 1);
414
+ return new Y(J.npMinYear(), 0, 1);
415
415
  }
416
416
  static maxSupportedNepaliDate() {
417
- const t = W.npMaxYear();
417
+ const t = J.npMaxYear();
418
418
  return new Y(t, 11, this.getDaysOfMonth(t, 11));
419
419
  }
420
420
  static minimum() {
@@ -424,7 +424,7 @@ class Y {
424
424
  return console.warn("`NepaliDate.maximum()` is deprecated and will be removed in a future version. Please use `NepaliDate.maxSupportedDate()` instead."), this.maxSupportedDate();
425
425
  }
426
426
  }
427
- const f3 = [
427
+ const y3 = [
428
428
  "बैशाख",
429
429
  "जेठ",
430
430
  "आषाढ",
@@ -450,7 +450,7 @@ const f3 = [
450
450
  "Magh",
451
451
  "Falgun",
452
452
  "Chaitra"
453
- ], y3 = [
453
+ ], f3 = [
454
454
  "January",
455
455
  "February",
456
456
  "March",
@@ -484,7 +484,7 @@ const f3 = [
484
484
  today: "#1e40af",
485
485
  disabled: "#6b7280"
486
486
  }
487
- }, J = (e) => e.toString().split("").map((t) => b3[parseInt(t)]).join(""), De = (e, t, n) => {
487
+ }, V = (e) => e.toString().split("").map((t) => b3[parseInt(t)]).join(""), De = (e, t, n) => {
488
488
  if (e === "BS")
489
489
  try {
490
490
  const a = n === 11 ? new Y(t + 1, 0, 1) : new Y(t, n + 1, 1);
@@ -501,7 +501,7 @@ const f3 = [
501
501
  return 0;
502
502
  }
503
503
  return new Date(t, n, 1).getDay();
504
- }, T = (e) => {
504
+ }, N = (e) => {
505
505
  const t = /* @__PURE__ */ new Date();
506
506
  if (e === "BS")
507
507
  try {
@@ -573,7 +573,7 @@ const f3 = [
573
573
  };
574
574
  }
575
575
  }
576
- }, T3 = (e, t, n) => {
576
+ }, N3 = (e, t, n) => {
577
577
  const a = new Date(e.year, e.month, e.day).getTime(), s = new Date(t.year, t.month, t.day).getTime(), r = new Date(n.year, n.month, n.day).getTime();
578
578
  return a >= s && a <= r;
579
579
  }, It = (e) => {
@@ -583,7 +583,7 @@ const f3 = [
583
583
  } catch {
584
584
  return null;
585
585
  }
586
- }, nt = (e, t, n) => {
586
+ }, et = (e, t, n) => {
587
587
  if (!t && !n) return !1;
588
588
  const a = new Date(e.year, e.month, e.day).getTime();
589
589
  if (t) {
@@ -602,17 +602,17 @@ const f3 = [
602
602
  }
603
603
  return !1;
604
604
  }, E3 = (e = "AD") => {
605
- const t = $t(() => T(e), [e]), [n, a] = N(t.year), [s, r] = N(t.month), [o, u] = N(null), [i, c] = N(null), [h, g] = N(null);
605
+ const t = $t(() => N(e), [e]), [n, a] = B(t.year), [s, r] = B(t.month), [o, u] = B(null), [i, h] = B(null), [c, D] = B(null);
606
606
  Yt(() => {
607
607
  a(t.year), r(t.month);
608
608
  }, [t.year, t.month]);
609
- const m = $t(() => {
610
- const w = De(e, n, s), F = S3(e, n, s), M = [];
611
- for (let k = 0; k < F; k++)
612
- M.push(null);
613
- for (let k = 1; k <= w; k++)
614
- M.push(k);
615
- return M;
609
+ const d = $t(() => {
610
+ const E = De(e, n, s), v = S3(e, n, s), p = [];
611
+ for (let C = 0; C < v; C++)
612
+ p.push(null);
613
+ for (let C = 1; C <= E; C++)
614
+ p.push(C);
615
+ return p;
616
616
  }, [n, s, e]);
617
617
  return {
618
618
  // State
@@ -620,33 +620,33 @@ const f3 = [
620
620
  currentMonth: s,
621
621
  selectedDate: o,
622
622
  rangeStart: i,
623
- rangeEnd: h,
623
+ rangeEnd: c,
624
624
  today: t,
625
- calendarDays: m,
625
+ calendarDays: d,
626
626
  // Actions
627
627
  setCurrentYear: a,
628
628
  setCurrentMonth: r,
629
629
  setSelectedDate: u,
630
- setRangeStart: c,
631
- setRangeEnd: g,
632
- navigateMonth: (w) => {
633
- let M = s + w, k = n;
634
- for (; M > 11; )
635
- M -= 12, k += 1;
636
- for (; M < 0; )
637
- M += 12, k -= 1;
638
- r(M), a(k);
630
+ setRangeStart: h,
631
+ setRangeEnd: D,
632
+ navigateMonth: (E) => {
633
+ let p = s + E, C = n;
634
+ for (; p > 11; )
635
+ p -= 12, C += 1;
636
+ for (; p < 0; )
637
+ p += 12, C -= 1;
638
+ r(p), a(C);
639
639
  },
640
640
  // Helpers
641
- isToday: (w) => n === t.year && s === t.month && w === t.day,
642
- isSelected: (w, F = "single") => F === "range" ? !!(i && i.year === n && i.month === s && i.day === w) || !!(h && h.year === n && h.month === s && h.day === w) : !!(o && o.year === n && o.month === s && o.day === w),
643
- isInRange: (w) => {
644
- if (!i || !h) return !1;
645
- const F = new Date(n, s, w).getTime(), M = new Date(i.year, i.month, i.day).getTime(), k = new Date(h.year, h.month, h.day).getTime();
646
- return F >= M && F <= k;
641
+ isToday: (E) => n === t.year && s === t.month && E === t.day,
642
+ isSelected: (E, v = "single") => v === "range" ? !!(i && i.year === n && i.month === s && i.day === E) || !!(c && c.year === n && c.month === s && c.day === E) : !!(o && o.year === n && o.month === s && o.day === E),
643
+ isInRange: (E) => {
644
+ if (!i || !c) return !1;
645
+ const v = new Date(n, s, E).getTime(), p = new Date(i.year, i.month, i.day).getTime(), C = new Date(c.year, c.month, c.day).getTime();
646
+ return v >= p && v <= C;
647
647
  }
648
648
  };
649
- }, Q = (e, t, n) => {
649
+ }, Z = (e, t, n) => {
650
650
  if (n === "BS")
651
651
  try {
652
652
  const a = new Y(e.year, e.month, e.day), s = new Date(
@@ -685,11 +685,11 @@ const f3 = [
685
685
  const a = new Date(e.year, e.month, e.day);
686
686
  return a.setMonth(a.getMonth() + t), { year: a.getFullYear(), month: a.getMonth(), day: a.getDate() };
687
687
  }
688
- }, q = (e) => ({ year: e.year, month: e.month, day: 1 }), w3 = (e, t) => {
688
+ }, z = (e) => ({ year: e.year, month: e.month, day: 1 }), w3 = (e, t) => {
689
689
  if (t === "BS")
690
690
  try {
691
691
  const a = new Y(e.year, e.month, e.day).getDay();
692
- return Q(e, -a, "BS");
692
+ return Z(e, -a, "BS");
693
693
  } catch {
694
694
  return e;
695
695
  }
@@ -697,7 +697,7 @@ const f3 = [
697
697
  const n = new Date(e.year, e.month, e.day), a = n.getDay();
698
698
  return n.setDate(n.getDate() - a), { year: n.getFullYear(), month: n.getMonth(), day: n.getDate() };
699
699
  }
700
- }, H3 = {
700
+ }, T3 = {
701
701
  TODAY: "today",
702
702
  YESTERDAY: "yesterday",
703
703
  THIS_WEEK: "thisWeek",
@@ -716,7 +716,7 @@ const f3 = [
716
716
  key: "today",
717
717
  label: "Today",
718
718
  getValue: (s) => {
719
- const r = T(s);
719
+ const r = N(s);
720
720
  return { start: r, end: r };
721
721
  }
722
722
  },
@@ -724,7 +724,7 @@ const f3 = [
724
724
  key: "yesterday",
725
725
  label: "Yesterday",
726
726
  getValue: (s) => {
727
- const r = T(s), o = Q(r, -1, s);
727
+ const r = N(s), o = Z(r, -1, s);
728
728
  return { start: o, end: o };
729
729
  }
730
730
  },
@@ -732,7 +732,7 @@ const f3 = [
732
732
  key: "thisWeek",
733
733
  label: "This Week",
734
734
  getValue: (s) => {
735
- const r = T(s);
735
+ const r = N(s);
736
736
  return { start: w3(r, s), end: r };
737
737
  }
738
738
  },
@@ -740,72 +740,72 @@ const f3 = [
740
740
  key: "last7days",
741
741
  label: "Last 7 Days",
742
742
  getValue: (s) => {
743
- const r = T(s);
744
- return { start: Q(r, -6, s), end: r };
743
+ const r = N(s);
744
+ return { start: Z(r, -6, s), end: r };
745
745
  }
746
746
  },
747
747
  {
748
748
  key: "last30days",
749
749
  label: "Last 30 Days",
750
750
  getValue: (s) => {
751
- const r = T(s);
752
- return { start: Q(r, -29, s), end: r };
751
+ const r = N(s);
752
+ return { start: Z(r, -29, s), end: r };
753
753
  }
754
754
  },
755
755
  {
756
756
  key: "thisMonth",
757
757
  label: "This Month",
758
758
  getValue: (s) => {
759
- const r = T(s);
760
- return { start: q(r), end: r };
759
+ const r = N(s);
760
+ return { start: z(r), end: r };
761
761
  }
762
762
  },
763
763
  {
764
764
  key: "lastMonth",
765
765
  label: "Last Month",
766
766
  getValue: (s) => {
767
- const r = T(s), o = Q(q(r), -1, s);
768
- return { start: q(o), end: o };
767
+ const r = N(s), o = Z(z(r), -1, s);
768
+ return { start: z(o), end: o };
769
769
  }
770
770
  },
771
771
  {
772
772
  key: "last3months",
773
773
  label: "Last 3 Months",
774
774
  getValue: (s) => {
775
- const r = T(s), o = dt(r, -2, s);
776
- return { start: q(o), end: r };
775
+ const r = N(s), o = dt(r, -2, s);
776
+ return { start: z(o), end: r };
777
777
  }
778
778
  },
779
779
  {
780
780
  key: "last6months",
781
781
  label: "Last 6 Months",
782
782
  getValue: (s) => {
783
- const r = T(s), o = dt(r, -5, s);
784
- return { start: q(o), end: r };
783
+ const r = N(s), o = dt(r, -5, s);
784
+ return { start: z(o), end: r };
785
785
  }
786
786
  },
787
787
  {
788
788
  key: "last180days",
789
789
  label: "Last 180 Days",
790
790
  getValue: (s) => {
791
- const r = T(s);
792
- return { start: Q(r, -179, s), end: r };
791
+ const r = N(s);
792
+ return { start: Z(r, -179, s), end: r };
793
793
  }
794
794
  },
795
795
  {
796
796
  key: "last9months",
797
797
  label: "Last 9 Months",
798
798
  getValue: (s) => {
799
- const r = T(s), o = dt(r, -8, s);
800
- return { start: q(o), end: r };
799
+ const r = N(s), o = dt(r, -8, s);
800
+ return { start: z(o), end: r };
801
801
  }
802
802
  },
803
803
  {
804
804
  key: "lastYear",
805
805
  label: "Last Year",
806
806
  getValue: (s) => {
807
- const r = T(s), o = dt(r, -11, s);
808
- return { start: q(o), end: r };
807
+ const r = N(s), o = dt(r, -11, s);
808
+ return { start: z(o), end: r };
809
809
  }
810
810
  }
811
811
  ], a = e ? n.filter((s) => e.includes(s.key)) : n;
@@ -818,54 +818,54 @@ const f3 = [
818
818
  onMonthChange: s,
819
819
  onClose: r,
820
820
  showNepaliNumbers: o = !1,
821
- convertToNepaliNumber: u = (c) => c.toString(),
821
+ convertToNepaliNumber: u = (h) => h.toString(),
822
822
  calendarType: i
823
823
  }) => {
824
- const [c, h] = N(Math.floor(e / 12) * 12), g = i === "BS" ? 2e3 : 1944, m = i === "BS" ? 2100 : 2043;
825
- return /* @__PURE__ */ d("div", { className: "bsac-picker-overlay", onClick: r, children: /* @__PURE__ */ b("div", { className: "bsac-picker-content", onClick: (S) => S.stopPropagation(), children: [
826
- /* @__PURE__ */ b("div", { className: "bsac-picker-header", children: [
827
- /* @__PURE__ */ d("h3", { children: "Select Month & Year" }),
828
- /* @__PURE__ */ d("button", { className: "bsac-close-btn", onClick: r, children: "×" })
824
+ const [h, c] = B(Math.floor(e / 12) * 12), D = i === "BS" ? 2e3 : 1944, d = i === "BS" ? 2100 : 2043;
825
+ return /* @__PURE__ */ g("div", { className: "bsac-picker-overlay", onClick: r, children: /* @__PURE__ */ S("div", { className: "bsac-picker-content", onClick: (k) => k.stopPropagation(), children: [
826
+ /* @__PURE__ */ S("div", { className: "bsac-picker-header", children: [
827
+ /* @__PURE__ */ g("h3", { children: "Select Month & Year" }),
828
+ /* @__PURE__ */ g("button", { className: "bsac-close-btn", onClick: r, children: "×" })
829
829
  ] }),
830
- /* @__PURE__ */ b("div", { className: "bsac-picker-body", children: [
831
- /* @__PURE__ */ b("div", { className: "bsac-picker-section", children: [
832
- /* @__PURE__ */ b("div", { className: "bsac-picker-section-header", children: [
833
- /* @__PURE__ */ d("label", { children: "Year" }),
834
- /* @__PURE__ */ b("div", { className: "bsac-year-nav", children: [
835
- /* @__PURE__ */ d("button", { onClick: () => h(Math.max(g, c - 12)), disabled: c <= g, children: "«" }),
836
- /* @__PURE__ */ b("span", { children: [
837
- o ? u(c) : c,
830
+ /* @__PURE__ */ S("div", { className: "bsac-picker-body", children: [
831
+ /* @__PURE__ */ S("div", { className: "bsac-picker-section", children: [
832
+ /* @__PURE__ */ S("div", { className: "bsac-picker-section-header", children: [
833
+ /* @__PURE__ */ g("label", { children: "Year" }),
834
+ /* @__PURE__ */ S("div", { className: "bsac-year-nav", children: [
835
+ /* @__PURE__ */ g("button", { onClick: () => c(Math.max(D, h - 12)), disabled: h <= D, children: "«" }),
836
+ /* @__PURE__ */ S("span", { children: [
837
+ o ? u(h) : h,
838
838
  " – ",
839
- o ? u(c + 11) : c + 11
839
+ o ? u(h + 11) : h + 11
840
840
  ] }),
841
- /* @__PURE__ */ d("button", { onClick: () => h(Math.min(m - 11, c + 12)), disabled: c + 11 >= m, children: "»" })
841
+ /* @__PURE__ */ g("button", { onClick: () => c(Math.min(d - 11, h + 12)), disabled: h + 11 >= d, children: "»" })
842
842
  ] })
843
843
  ] }),
844
- /* @__PURE__ */ d("div", { className: "bsac-year-grid", children: Array.from({ length: 12 }, (S, f) => {
845
- const C = c + f;
846
- return C > m ? null : /* @__PURE__ */ d(
844
+ /* @__PURE__ */ g("div", { className: "bsac-year-grid", children: Array.from({ length: 12 }, (k, m) => {
845
+ const A = h + m;
846
+ return A > d ? null : /* @__PURE__ */ g(
847
847
  "button",
848
848
  {
849
- onClick: () => a(C),
850
- className: C === e ? "bsac-selected" : "",
851
- children: o ? u(C) : C
849
+ onClick: () => a(A),
850
+ className: A === e ? "bsac-selected" : "",
851
+ children: o ? u(A) : A
852
852
  },
853
- C
853
+ A
854
854
  );
855
855
  }) })
856
856
  ] }),
857
- /* @__PURE__ */ b("div", { className: "bsac-picker-section", children: [
858
- /* @__PURE__ */ d("label", { children: "Month" }),
859
- /* @__PURE__ */ d("div", { className: "bsac-month-grid", children: n.map((S, f) => /* @__PURE__ */ d(
857
+ /* @__PURE__ */ S("div", { className: "bsac-picker-section", children: [
858
+ /* @__PURE__ */ g("label", { children: "Month" }),
859
+ /* @__PURE__ */ g("div", { className: "bsac-month-grid", children: n.map((k, m) => /* @__PURE__ */ g(
860
860
  "button",
861
861
  {
862
862
  onClick: () => {
863
- s(f), r();
863
+ s(m), r();
864
864
  },
865
- className: f === t ? "bsac-selected" : "",
866
- children: S
865
+ className: m === t ? "bsac-selected" : "",
866
+ children: k
867
867
  },
868
- f
868
+ m
869
869
  )) })
870
870
  ] })
871
871
  ] })
@@ -880,20 +880,20 @@ const f3 = [
880
880
  disabled: o = !1,
881
881
  showNepaliNumbers: u = !1,
882
882
  convertToNepaliNumber: i,
883
- calendarType: c
883
+ calendarType: h
884
884
  }) => {
885
- const [h, g] = N(!1);
886
- return /* @__PURE__ */ b("div", { className: "bsac-header", children: [
887
- /* @__PURE__ */ d("button", { className: "bsac-nav-btn", onClick: () => a(-12), disabled: o, "aria-label": "Previous year", children: "«" }),
888
- /* @__PURE__ */ d("button", { className: "bsac-nav-btn", onClick: () => a(-1), disabled: o, "aria-label": "Previous month", children: "‹" }),
889
- /* @__PURE__ */ b("button", { className: "bsac-month-year-btn", onClick: () => g(!0), disabled: o, children: [
885
+ const [c, D] = B(!1);
886
+ return /* @__PURE__ */ S("div", { className: "bsac-header", children: [
887
+ /* @__PURE__ */ g("button", { className: "bsac-nav-btn", onClick: () => a(-12), disabled: o, "aria-label": "Previous year", children: "«" }),
888
+ /* @__PURE__ */ g("button", { className: "bsac-nav-btn", onClick: () => a(-1), disabled: o, "aria-label": "Previous month", children: "‹" }),
889
+ /* @__PURE__ */ S("button", { className: "bsac-month-year-btn", onClick: () => D(!0), disabled: o, children: [
890
890
  n[e],
891
891
  " ",
892
892
  u ? i(t) : t
893
893
  ] }),
894
- /* @__PURE__ */ d("button", { className: "bsac-nav-btn", onClick: () => a(1), disabled: o, "aria-label": "Next month", children: "›" }),
895
- /* @__PURE__ */ d("button", { className: "bsac-nav-btn", onClick: () => a(12), disabled: o, "aria-label": "Next year", children: "»" }),
896
- h && /* @__PURE__ */ d(
894
+ /* @__PURE__ */ g("button", { className: "bsac-nav-btn", onClick: () => a(1), disabled: o, "aria-label": "Next month", children: "›" }),
895
+ /* @__PURE__ */ g("button", { className: "bsac-nav-btn", onClick: () => a(12), disabled: o, "aria-label": "Next year", children: "»" }),
896
+ c && /* @__PURE__ */ g(
897
897
  k3,
898
898
  {
899
899
  currentYear: t,
@@ -901,10 +901,10 @@ const f3 = [
901
901
  months: n,
902
902
  onYearChange: s,
903
903
  onMonthChange: r,
904
- onClose: () => g(!1),
904
+ onClose: () => D(!1),
905
905
  showNepaliNumbers: u,
906
906
  convertToNepaliNumber: i,
907
- calendarType: c
907
+ calendarType: h
908
908
  }
909
909
  )
910
910
  ] });
@@ -918,22 +918,22 @@ const f3 = [
918
918
  isDisabled: o,
919
919
  disabled: u = !1,
920
920
  showNepaliNumbers: i = !1,
921
- convertToNepaliNumber: c
922
- }) => /* @__PURE__ */ b("div", { className: "bsac-grid", children: [
923
- t.map((h) => /* @__PURE__ */ d("div", { className: "bsac-day-header", children: h }, h)),
924
- e.map((h, g) => {
925
- const m = h ? o?.(h) || u : !1, S = h ? a(h) : !1, f = h ? s(h) : !1, C = h ? r(h) : !1, A = [
921
+ convertToNepaliNumber: h
922
+ }) => /* @__PURE__ */ S("div", { className: "bsac-grid", children: [
923
+ t.map((c) => /* @__PURE__ */ g("div", { className: "bsac-day-header", children: c }, c)),
924
+ e.map((c, D) => {
925
+ const d = c ? o?.(c) || u : !1, k = c ? a(c) : !1, m = c ? s(c) : !1, A = c ? r(c) : !1, T = [
926
926
  "bsac-day",
927
- h ? m ? "bsac-day-disabled" : S ? "bsac-day-selected" : f ? "bsac-day-in-range" : C ? "bsac-day-today" : "" : "bsac-day-empty"
927
+ c ? d ? "bsac-day-disabled" : k ? "bsac-day-selected" : m ? "bsac-day-in-range" : A ? "bsac-day-today" : "" : "bsac-day-empty"
928
928
  ].filter(Boolean).join(" ");
929
- return /* @__PURE__ */ d(
929
+ return /* @__PURE__ */ g(
930
930
  "div",
931
931
  {
932
- className: A,
933
- onClick: () => h && !m && n(h),
934
- children: h ? i ? c(h) : h : ""
932
+ className: T,
933
+ onClick: () => c && !d && n(c),
934
+ children: c ? i ? h(c) : c : ""
935
935
  },
936
- g
936
+ D
937
937
  );
938
938
  })
939
939
  ] }), Dt = ({
@@ -947,7 +947,7 @@ const f3 = [
947
947
  const u = o.getValue(t);
948
948
  n(o, u);
949
949
  };
950
- return /* @__PURE__ */ d("div", { className: `bsac-presets bsac-presets--${s}`, children: e.map((o) => /* @__PURE__ */ d(
950
+ return /* @__PURE__ */ g("div", { className: `bsac-presets bsac-presets--${s}`, children: e.map((o) => /* @__PURE__ */ g(
951
951
  "button",
952
952
  {
953
953
  onClick: () => r(o),
@@ -966,94 +966,94 @@ const f3 = [
966
966
  outputFormat: o = "both",
967
967
  onDateSelect: u,
968
968
  mode: i = "single",
969
- onRangeSelect: c,
970
- showRangePresets: h = !1,
971
- rangePresetsPosition: g = "top",
972
- predefinedRanges: m,
973
- presetKeys: S,
974
- presetLabels: f,
975
- onPresetSelect: C,
976
- renderPresets: A,
977
- showNepaliMonths: w = !1,
978
- showNepaliDays: F = !1,
979
- showNepaliNumbers: M = !1,
980
- theme: k = "light",
981
- colors: V,
982
- minDate: K,
983
- maxDate: G
969
+ onRangeSelect: h,
970
+ showRangePresets: c = !1,
971
+ rangePresetsPosition: D = "top",
972
+ predefinedRanges: d,
973
+ presetKeys: k,
974
+ presetLabels: m,
975
+ onPresetSelect: A,
976
+ renderPresets: T,
977
+ showNepaliMonths: E = !1,
978
+ showNepaliDays: v = !1,
979
+ showNepaliNumbers: p = !1,
980
+ theme: C = "light",
981
+ colors: nt,
982
+ minDate: I,
983
+ maxDate: K
984
984
  }) => {
985
985
  const {
986
- currentYear: O,
987
- currentMonth: B,
988
- rangeStart: D,
989
- rangeEnd: v,
990
- calendarDays: I,
991
- setSelectedDate: E,
992
- setRangeStart: $,
993
- setRangeEnd: R,
986
+ currentYear: H,
987
+ currentMonth: O,
988
+ rangeStart: U,
989
+ rangeEnd: y,
990
+ calendarDays: w,
991
+ setSelectedDate: R,
992
+ setRangeStart: M,
993
+ setRangeEnd: $,
994
994
  setCurrentYear: _,
995
- setCurrentMonth: U,
996
- navigateMonth: H,
995
+ setCurrentMonth: j,
996
+ navigateMonth: x,
997
997
  isToday: st,
998
998
  isSelected: at,
999
999
  isInRange: rt
1000
- } = E3(e), [ot, Et] = N(), it = m || Y3(S, f), ut = (l, y) => ({
1001
- start: wt(e, l.year, l.month, l.day, z),
1002
- end: wt(e, y.year, y.month, y.day, z)
1003
- }), z = e === "BS" && w ? f3 : e === "BS" ? me : y3, ct = e === "BS" && F ? M3 : p3, ht = (l, y) => {
1004
- y.start && y.end && ($(y.start), R(y.end), _(y.start.year), U(y.start.month), Et(l.key), C?.(l, y), c?.(ut(y.start, y.end)));
1005
- }, fe = (l, y) => {
1006
- $(l), R(y), Et(void 0), c?.(ut(l, y));
1000
+ } = E3(e), [ot, Et] = B(), it = d || Y3(k, m), ut = (l, f) => ({
1001
+ start: wt(e, l.year, l.month, l.day, G),
1002
+ end: wt(e, f.year, f.month, f.day, G)
1003
+ }), G = e === "BS" && E ? y3 : e === "BS" ? me : f3, ct = e === "BS" && v ? M3 : p3, ht = (l, f) => {
1004
+ f.start && f.end && (M(f.start), $(f.end), _(f.start.year), j(f.start.month), Et(l.key), A?.(l, f), h?.(ut(f.start, f.end)));
1005
+ }, ye = (l, f) => {
1006
+ M(l), $(f), Et(void 0), h?.(ut(l, f));
1007
1007
  }, lt = (l) => {
1008
1008
  if (r) return;
1009
- const y = { year: O, month: B, day: l };
1010
- if (nt(y, K, G)) return;
1009
+ const f = { year: H, month: O, day: l };
1010
+ if (et(f, I, K)) return;
1011
1011
  if (i === "range") {
1012
- if (Et(void 0), !D || D && v)
1013
- $(y), R(null);
1012
+ if (Et(void 0), !U || U && y)
1013
+ M(f), $(null);
1014
1014
  else {
1015
- const Z = new Date(D.year, D.month, D.day).getTime();
1016
- new Date(y.year, y.month, y.day).getTime() < Z ? ($(y), R(D), c?.(ut(y, D))) : (R(y), c?.(ut(D, y)));
1015
+ const X = new Date(U.year, U.month, U.day).getTime();
1016
+ new Date(f.year, f.month, f.day).getTime() < X ? (M(f), $(U), h?.(ut(f, U))) : ($(f), h?.(ut(U, f)));
1017
1017
  }
1018
1018
  return;
1019
1019
  }
1020
- E(y);
1021
- const X = wt(e, O, B, l, z);
1022
- if (u?.(X), n) {
1023
- let Z;
1020
+ R(f);
1021
+ const q = wt(e, H, O, l, G);
1022
+ if (u?.(q), n) {
1023
+ let X;
1024
1024
  switch (o) {
1025
1025
  case "iso":
1026
- Z = X.ad;
1026
+ X = q.ad;
1027
1027
  break;
1028
1028
  case "object":
1029
- Z = JSON.stringify(X);
1029
+ X = JSON.stringify(q);
1030
1030
  break;
1031
1031
  default:
1032
- Z = JSON.stringify(X);
1032
+ X = JSON.stringify(q);
1033
1033
  break;
1034
1034
  }
1035
- n(Z);
1035
+ n(X);
1036
1036
  }
1037
- }, ye = (l) => {
1037
+ }, fe = (l) => {
1038
1038
  if (!r) {
1039
1039
  switch (l.key) {
1040
1040
  case "ArrowLeft":
1041
- H(-1);
1041
+ x(-1);
1042
1042
  break;
1043
1043
  case "ArrowRight":
1044
- H(1);
1044
+ x(1);
1045
1045
  break;
1046
1046
  case "ArrowUp":
1047
- H(-12);
1047
+ x(-12);
1048
1048
  break;
1049
1049
  case "ArrowDown":
1050
- H(12);
1050
+ x(12);
1051
1051
  break;
1052
1052
  case "PageUp":
1053
- l.shiftKey ? H(-12) : H(-1);
1053
+ l.shiftKey ? x(-12) : x(-1);
1054
1054
  break;
1055
1055
  case "PageDown":
1056
- l.shiftKey ? H(12) : H(1);
1056
+ l.shiftKey ? x(12) : x(1);
1057
1057
  break;
1058
1058
  default:
1059
1059
  return;
@@ -1061,59 +1061,59 @@ const f3 = [
1061
1061
  l.preventDefault();
1062
1062
  }
1063
1063
  }, Me = {
1064
- ...V ? Object.entries(V).reduce(
1065
- (l, [y, X]) => (l[`--calendar-${y}`] = X, l),
1064
+ ...nt ? Object.entries(nt).reduce(
1065
+ (l, [f, q]) => (l[`--calendar-${f}`] = q, l),
1066
1066
  {}
1067
1067
  ) : {}
1068
1068
  };
1069
- return /* @__PURE__ */ b(
1069
+ return /* @__PURE__ */ S(
1070
1070
  "div",
1071
1071
  {
1072
1072
  className: `bsac-calendar ${a}`,
1073
1073
  style: Me,
1074
- "data-theme": k,
1075
- onKeyDown: ye,
1074
+ "data-theme": C,
1075
+ onKeyDown: fe,
1076
1076
  tabIndex: 0,
1077
1077
  role: "application",
1078
1078
  "aria-label": "Calendar",
1079
1079
  children: [
1080
- i === "range" && A && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px" }, children: [
1081
- /* @__PURE__ */ d("div", { children: A({ onRangeChange: fe }) }),
1082
- /* @__PURE__ */ b("div", { style: { flex: 1 }, children: [
1083
- /* @__PURE__ */ d(
1080
+ i === "range" && T && /* @__PURE__ */ S("div", { style: { display: "flex", gap: "16px" }, children: [
1081
+ /* @__PURE__ */ g("div", { children: T({ onRangeChange: ye }) }),
1082
+ /* @__PURE__ */ S("div", { style: { flex: 1 }, children: [
1083
+ /* @__PURE__ */ g(
1084
1084
  gt,
1085
1085
  {
1086
- currentMonth: B,
1087
- currentYear: O,
1088
- months: z,
1089
- onNavigateMonth: H,
1086
+ currentMonth: O,
1087
+ currentYear: H,
1088
+ months: G,
1089
+ onNavigateMonth: x,
1090
1090
  onYearChange: _,
1091
- onMonthChange: U,
1091
+ onMonthChange: j,
1092
1092
  disabled: r,
1093
- showNepaliNumbers: M,
1094
- convertToNepaliNumber: J,
1093
+ showNepaliNumbers: p,
1094
+ convertToNepaliNumber: V,
1095
1095
  calendarType: e
1096
1096
  }
1097
1097
  ),
1098
- /* @__PURE__ */ d(
1098
+ /* @__PURE__ */ g(
1099
1099
  mt,
1100
1100
  {
1101
- calendarDays: I,
1101
+ calendarDays: w,
1102
1102
  days: ct,
1103
1103
  onDateSelect: lt,
1104
1104
  isSelected: (l) => at(l, i),
1105
1105
  isInRange: rt,
1106
1106
  isToday: (l) => s && st(l),
1107
- isDisabled: (l) => nt({ year: O, month: B, day: l }, K, G),
1107
+ isDisabled: (l) => et({ year: H, month: O, day: l }, I, K),
1108
1108
  disabled: r,
1109
- showNepaliNumbers: M,
1110
- convertToNepaliNumber: J
1109
+ showNepaliNumbers: p,
1110
+ convertToNepaliNumber: V
1111
1111
  }
1112
1112
  )
1113
1113
  ] })
1114
1114
  ] }),
1115
- i === "range" && h && g === "left" && !A && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1116
- /* @__PURE__ */ d(
1115
+ i === "range" && c && D === "left" && !T && /* @__PURE__ */ S("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1116
+ /* @__PURE__ */ g(
1117
1117
  Dt,
1118
1118
  {
1119
1119
  presets: it,
@@ -1123,73 +1123,73 @@ const f3 = [
1123
1123
  position: "left"
1124
1124
  }
1125
1125
  ),
1126
- /* @__PURE__ */ b("div", { children: [
1127
- /* @__PURE__ */ d(
1126
+ /* @__PURE__ */ S("div", { children: [
1127
+ /* @__PURE__ */ g(
1128
1128
  gt,
1129
1129
  {
1130
- currentMonth: B,
1131
- currentYear: O,
1132
- months: z,
1133
- onNavigateMonth: H,
1130
+ currentMonth: O,
1131
+ currentYear: H,
1132
+ months: G,
1133
+ onNavigateMonth: x,
1134
1134
  onYearChange: _,
1135
- onMonthChange: U,
1135
+ onMonthChange: j,
1136
1136
  disabled: r,
1137
- showNepaliNumbers: M,
1138
- convertToNepaliNumber: J,
1137
+ showNepaliNumbers: p,
1138
+ convertToNepaliNumber: V,
1139
1139
  calendarType: e
1140
1140
  }
1141
1141
  ),
1142
- /* @__PURE__ */ d(
1142
+ /* @__PURE__ */ g(
1143
1143
  mt,
1144
1144
  {
1145
- calendarDays: I,
1145
+ calendarDays: w,
1146
1146
  days: ct,
1147
1147
  onDateSelect: lt,
1148
1148
  isSelected: (l) => at(l, i),
1149
1149
  isInRange: rt,
1150
1150
  isToday: (l) => s && st(l),
1151
- isDisabled: (l) => nt({ year: O, month: B, day: l }, K, G),
1151
+ isDisabled: (l) => et({ year: H, month: O, day: l }, I, K),
1152
1152
  disabled: r,
1153
- showNepaliNumbers: M,
1154
- convertToNepaliNumber: J
1153
+ showNepaliNumbers: p,
1154
+ convertToNepaliNumber: V
1155
1155
  }
1156
1156
  )
1157
1157
  ] })
1158
1158
  ] }),
1159
- i === "range" && h && g === "right" && !A && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1160
- /* @__PURE__ */ b("div", { children: [
1161
- /* @__PURE__ */ d(
1159
+ i === "range" && c && D === "right" && !T && /* @__PURE__ */ S("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1160
+ /* @__PURE__ */ S("div", { children: [
1161
+ /* @__PURE__ */ g(
1162
1162
  gt,
1163
1163
  {
1164
- currentMonth: B,
1165
- currentYear: O,
1166
- months: z,
1167
- onNavigateMonth: H,
1164
+ currentMonth: O,
1165
+ currentYear: H,
1166
+ months: G,
1167
+ onNavigateMonth: x,
1168
1168
  onYearChange: _,
1169
- onMonthChange: U,
1169
+ onMonthChange: j,
1170
1170
  disabled: r,
1171
- showNepaliNumbers: M,
1172
- convertToNepaliNumber: J,
1171
+ showNepaliNumbers: p,
1172
+ convertToNepaliNumber: V,
1173
1173
  calendarType: e
1174
1174
  }
1175
1175
  ),
1176
- /* @__PURE__ */ d(
1176
+ /* @__PURE__ */ g(
1177
1177
  mt,
1178
1178
  {
1179
- calendarDays: I,
1179
+ calendarDays: w,
1180
1180
  days: ct,
1181
1181
  onDateSelect: lt,
1182
1182
  isSelected: (l) => at(l, i),
1183
1183
  isInRange: rt,
1184
1184
  isToday: (l) => s && st(l),
1185
- isDisabled: (l) => nt({ year: O, month: B, day: l }, K, G),
1185
+ isDisabled: (l) => et({ year: H, month: O, day: l }, I, K),
1186
1186
  disabled: r,
1187
- showNepaliNumbers: M,
1188
- convertToNepaliNumber: J
1187
+ showNepaliNumbers: p,
1188
+ convertToNepaliNumber: V
1189
1189
  }
1190
1190
  )
1191
1191
  ] }),
1192
- /* @__PURE__ */ d(
1192
+ /* @__PURE__ */ g(
1193
1193
  Dt,
1194
1194
  {
1195
1195
  presets: it,
@@ -1200,8 +1200,8 @@ const f3 = [
1200
1200
  }
1201
1201
  )
1202
1202
  ] }),
1203
- (!i || i === "single" || !h && !A || g === "top" || g === "bottom") && /* @__PURE__ */ b(pe, { children: [
1204
- i === "range" && h && g === "top" && /* @__PURE__ */ d(
1203
+ (!i || i === "single" || !c && !T || D === "top" || D === "bottom") && /* @__PURE__ */ S(pe, { children: [
1204
+ i === "range" && c && D === "top" && /* @__PURE__ */ g(
1205
1205
  Dt,
1206
1206
  {
1207
1207
  presets: it,
@@ -1211,37 +1211,37 @@ const f3 = [
1211
1211
  position: "top"
1212
1212
  }
1213
1213
  ),
1214
- /* @__PURE__ */ d(
1214
+ /* @__PURE__ */ g(
1215
1215
  gt,
1216
1216
  {
1217
- currentMonth: B,
1218
- currentYear: O,
1219
- months: z,
1220
- onNavigateMonth: H,
1217
+ currentMonth: O,
1218
+ currentYear: H,
1219
+ months: G,
1220
+ onNavigateMonth: x,
1221
1221
  onYearChange: _,
1222
- onMonthChange: U,
1222
+ onMonthChange: j,
1223
1223
  disabled: r,
1224
- showNepaliNumbers: M,
1225
- convertToNepaliNumber: J,
1224
+ showNepaliNumbers: p,
1225
+ convertToNepaliNumber: V,
1226
1226
  calendarType: e
1227
1227
  }
1228
1228
  ),
1229
- /* @__PURE__ */ d(
1229
+ /* @__PURE__ */ g(
1230
1230
  mt,
1231
1231
  {
1232
- calendarDays: I,
1232
+ calendarDays: w,
1233
1233
  days: ct,
1234
1234
  onDateSelect: lt,
1235
1235
  isSelected: (l) => at(l, i),
1236
1236
  isInRange: rt,
1237
1237
  isToday: (l) => s && st(l),
1238
- isDisabled: (l) => nt({ year: O, month: B, day: l }, K, G),
1238
+ isDisabled: (l) => et({ year: H, month: O, day: l }, I, K),
1239
1239
  disabled: r,
1240
- showNepaliNumbers: M,
1241
- convertToNepaliNumber: J
1240
+ showNepaliNumbers: p,
1241
+ convertToNepaliNumber: V
1242
1242
  }
1243
1243
  ),
1244
- i === "range" && h && g === "bottom" && /* @__PURE__ */ d(
1244
+ i === "range" && c && D === "bottom" && /* @__PURE__ */ g(
1245
1245
  Dt,
1246
1246
  {
1247
1247
  presets: it,
@@ -1255,129 +1255,140 @@ const f3 = [
1255
1255
  ]
1256
1256
  }
1257
1257
  );
1258
- }, N3 = ({
1258
+ }, H3 = ({
1259
1259
  placeholder: e = "Select date",
1260
1260
  format: t = "YYYY-MM-DD",
1261
- onDateSelect: n,
1262
- inputClassName: a = "",
1263
- popupClassName: s = "",
1264
- style: r,
1265
- inputStyle: o,
1266
- icon: u,
1267
- showIcon: i = !0,
1261
+ defaultValue: n,
1262
+ onDateSelect: a,
1263
+ inputClassName: s = "",
1264
+ popupClassName: r = "",
1265
+ style: o,
1266
+ inputStyle: u,
1267
+ icon: i,
1268
+ showIcon: h = !0,
1268
1269
  calendarType: c = "AD",
1269
- ...h
1270
+ ...D
1270
1271
  }) => {
1271
- const [g, m] = N(!1), [S, f] = N(null), [C, A] = N(""), w = xt(null), F = xt(null), [M, k] = N({ visibility: "hidden" }), V = () => {
1272
- if (!w.current) return;
1273
- const D = w.current.getBoundingClientRect(), v = F.current?.offsetHeight || 360, I = F.current?.offsetWidth || 280, E = window.innerHeight - D.bottom, $ = window.innerWidth - D.left, R = E >= v + 8 ? D.bottom + 8 : Math.max(8, D.top - v - 8), _ = $ >= I ? D.left : Math.max(8, D.right - I);
1274
- k({ top: R, left: _, visibility: "visible" });
1272
+ const [d, k] = B(!1), [m, A] = B(null), [T, E] = B(() => {
1273
+ if (!n) return "";
1274
+ if (c === "BS")
1275
+ try {
1276
+ const [y, w, R] = n.split("-").map(Number), M = Y.fromEnglishDate(y, w - 1, R);
1277
+ return `${M.getYear()}-${String(M.getMonth() + 1).padStart(2, "0")}-${String(M.getDate()).padStart(2, "0")}`;
1278
+ } catch {
1279
+ return n;
1280
+ }
1281
+ return n;
1282
+ }), v = xt(null), p = xt(null), [C, nt] = B({ visibility: "hidden" }), I = () => {
1283
+ if (!v.current) return;
1284
+ const y = v.current.getBoundingClientRect(), w = p.current?.offsetHeight || 360, R = p.current?.offsetWidth || 280, M = window.innerHeight - y.bottom, $ = window.innerWidth - y.left, _ = M >= w + 8 ? y.bottom + 8 : Math.max(8, y.top - w - 8), j = $ >= R ? y.left : Math.max(8, y.right - R);
1285
+ nt({ top: _, left: j, visibility: "visible" });
1275
1286
  };
1276
- Yt(() => (g && (requestAnimationFrame(V), window.addEventListener("scroll", V, !0), window.addEventListener("resize", V)), () => {
1277
- window.removeEventListener("scroll", V, !0), window.removeEventListener("resize", V);
1278
- }), [g]), Yt(() => {
1279
- const D = (v) => {
1280
- w.current && !w.current.contains(v.target) && m(!1);
1287
+ Yt(() => (d && (requestAnimationFrame(I), window.addEventListener("scroll", I, !0), window.addEventListener("resize", I)), () => {
1288
+ window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
1289
+ }), [d]), Yt(() => {
1290
+ const y = (w) => {
1291
+ v.current && !v.current.contains(w.target) && k(!1);
1281
1292
  };
1282
- return g && document.addEventListener("mousedown", D), () => document.removeEventListener("mousedown", D);
1283
- }, [g]);
1284
- const K = (D) => {
1285
- f(D), A(c === "BS" ? D.bs : D.ad), m(!1), n?.(D);
1286
- }, G = (D) => {
1287
- const v = D.target.value;
1288
- if (v === "") {
1289
- A("");
1293
+ return d && document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
1294
+ }, [d]);
1295
+ const K = (y) => {
1296
+ A(y), E(c === "BS" ? y.bs : y.ad), k(!1), a?.(y);
1297
+ }, H = (y) => {
1298
+ const w = y.target.value;
1299
+ if (w === "") {
1300
+ E("");
1290
1301
  return;
1291
1302
  }
1292
- if ((D.target.selectionStart || 0) === v.length && v.length > C.length) {
1293
- const E = v.replace(/[^0-9]/g, "");
1294
- let $ = E;
1295
- E.length > 4 && E.length <= 6 ? $ = E.slice(0, 4) + "-" + E.slice(4) : E.length > 6 && ($ = E.slice(0, 4) + "-" + E.slice(4, 6) + "-" + E.slice(6, 8)), A($);
1303
+ if ((y.target.selectionStart || 0) === w.length && w.length > T.length) {
1304
+ const M = w.replace(/[^0-9]/g, "");
1305
+ let $ = M;
1306
+ M.length > 4 && M.length <= 6 ? $ = M.slice(0, 4) + "-" + M.slice(4) : M.length > 6 && ($ = M.slice(0, 4) + "-" + M.slice(4, 6) + "-" + M.slice(6, 8)), E($);
1296
1307
  } else {
1297
- const E = v.replace(/[^0-9-]/g, "");
1298
- E.length <= 10 && A(E);
1308
+ const M = w.replace(/[^0-9-]/g, "");
1309
+ M.length <= 10 && E(M);
1299
1310
  }
1300
1311
  }, O = () => {
1301
- const D = C.trim();
1302
- if (!D) {
1303
- f(null);
1312
+ const y = T.trim();
1313
+ if (!y) {
1314
+ A(null);
1304
1315
  return;
1305
1316
  }
1306
- const v = D.match(/^(\d{4})-(\d{2})-(\d{2})$/);
1307
- if (v) {
1308
- const [, I, E, $] = v, R = parseInt(E), _ = parseInt($);
1309
- if (R < 1 || R > 12 || _ < 1 || _ > 32) {
1310
- A(S ? c === "BS" ? S.bs : S.ad : "");
1317
+ const w = y.match(/^(\d{4})-(\d{2})-(\d{2})$/);
1318
+ if (w) {
1319
+ const [, R, M, $] = w, _ = parseInt(M), j = parseInt($);
1320
+ if (_ < 1 || _ > 12 || j < 1 || j > 32) {
1321
+ E(m ? c === "BS" ? m.bs : m.ad : "");
1311
1322
  return;
1312
1323
  }
1313
- const U = {
1314
- bs: c === "BS" ? `${I}-${E}-${$}` : "",
1315
- ad: c === "AD" ? `${I}-${E}-${$}` : "",
1324
+ const x = {
1325
+ bs: c === "BS" ? `${R}-${M}-${$}` : "",
1326
+ ad: c === "AD" ? `${R}-${M}-${$}` : "",
1316
1327
  formatted: {
1317
- bs: c === "BS" ? D : "",
1318
- ad: c === "AD" ? D : ""
1328
+ bs: c === "BS" ? y : "",
1329
+ ad: c === "AD" ? y : ""
1319
1330
  }
1320
1331
  };
1321
- f(U), n?.(U);
1322
- } else D.length < 10 && A(S ? c === "BS" ? S.bs : S.ad : "");
1332
+ A(x), a?.(x);
1333
+ } else y.length < 10 && E(m ? c === "BS" ? m.bs : m.ad : "");
1323
1334
  };
1324
- return /* @__PURE__ */ b("div", { className: "bsac-datepicker", ref: w, style: r, children: [
1325
- /* @__PURE__ */ d(
1335
+ return /* @__PURE__ */ S("div", { className: "bsac-datepicker", ref: v, style: o, children: [
1336
+ /* @__PURE__ */ g(
1326
1337
  "input",
1327
1338
  {
1328
1339
  type: "text",
1329
- value: C,
1340
+ value: T,
1330
1341
  placeholder: e,
1331
- onChange: G,
1342
+ onChange: H,
1332
1343
  onBlur: O,
1333
- onKeyDown: (D) => {
1334
- D.key === "Enter" ? (O(), m(!1)) : D.key === "Escape" && m(!1);
1344
+ onKeyDown: (y) => {
1345
+ y.key === "Enter" ? (O(), k(!1)) : y.key === "Escape" && k(!1);
1335
1346
  },
1336
- className: `bsac-input ${a}`,
1337
- style: o,
1347
+ className: `bsac-input ${s}`,
1348
+ style: u,
1338
1349
  "aria-label": "Date picker input",
1339
1350
  "aria-haspopup": "dialog",
1340
- "aria-expanded": g,
1351
+ "aria-expanded": d,
1341
1352
  maxLength: 10
1342
1353
  }
1343
1354
  ),
1344
- /* @__PURE__ */ d(
1355
+ /* @__PURE__ */ g(
1345
1356
  "button",
1346
1357
  {
1347
1358
  type: "button",
1348
1359
  className: "bsac-icon-btn",
1349
- onClick: () => m(!g),
1360
+ onClick: () => k(!d),
1350
1361
  "aria-label": "Toggle calendar",
1351
- style: { display: i ? "flex" : "none" },
1352
- children: u || /* @__PURE__ */ b("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
1353
- /* @__PURE__ */ d("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
1354
- /* @__PURE__ */ d("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
1355
- /* @__PURE__ */ d("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
1356
- /* @__PURE__ */ d("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
1362
+ style: { display: h ? "flex" : "none" },
1363
+ children: i || /* @__PURE__ */ S("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
1364
+ /* @__PURE__ */ g("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
1365
+ /* @__PURE__ */ g("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
1366
+ /* @__PURE__ */ g("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
1367
+ /* @__PURE__ */ g("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
1357
1368
  ] })
1358
1369
  }
1359
1370
  ),
1360
- g && /* @__PURE__ */ d("div", { ref: F, className: `bsac-popup ${s}`, style: M, children: /* @__PURE__ */ d(C3, { calendarType: c, onDateSelect: K, ...h }) })
1371
+ d && /* @__PURE__ */ g("div", { ref: p, className: `bsac-popup ${r}`, style: C, children: /* @__PURE__ */ g(C3, { calendarType: c, onDateSelect: K, ...D }) })
1361
1372
  ] });
1362
1373
  };
1363
1374
  export {
1364
1375
  C3 as Calendar,
1365
- N3 as CalendarInput,
1376
+ H3 as CalendarInput,
1366
1377
  O3 as DEFAULT_COLORS,
1367
- N3 as DatePicker,
1378
+ H3 as DatePicker,
1368
1379
  p3 as ENGLISH_DAYS,
1369
- y3 as ENGLISH_MONTHS_AD,
1380
+ f3 as ENGLISH_MONTHS_AD,
1370
1381
  me as ENGLISH_MONTHS_BS,
1371
1382
  M3 as NEPALI_DAYS,
1372
1383
  b3 as NEPALI_DIGITS,
1373
- f3 as NEPALI_MONTHS,
1374
- H3 as PRESET_KEYS,
1375
- J as convertToNepaliNumber,
1384
+ y3 as NEPALI_MONTHS,
1385
+ T3 as PRESET_KEYS,
1386
+ V as convertToNepaliNumber,
1376
1387
  wt as createDateOutput,
1377
1388
  Y3 as createPredefinedRanges,
1378
1389
  De as getDaysInMonth,
1379
1390
  S3 as getFirstDayOfMonth,
1380
- T as getTodayDate,
1381
- T3 as isDateInRange,
1391
+ N as getTodayDate,
1392
+ N3 as isDateInRange,
1382
1393
  E3 as useCalendar
1383
1394
  };