"use strict";
exports.id = 7291;
exports.ids = [7291];
exports.modules = {

/***/ 3005:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "w": () => (/* binding */ SourceExample)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var nextra_theme_docs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(933);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([nextra_theme_docs__WEBPACK_IMPORTED_MODULE_1__]);
nextra_theme_docs__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];


const SourceExample = ({ example , children  })=>{
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(nextra_theme_docs__WEBPACK_IMPORTED_MODULE_1__/* .Tabs */ .mQ, {
        items: [
            "Example",
            "Code"
        ],
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(nextra_theme_docs__WEBPACK_IMPORTED_MODULE_1__/* .Tab */ .OK, {
                children: example
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(nextra_theme_docs__WEBPACK_IMPORTED_MODULE_1__/* .Tab */ .OK, {
                children: children
            })
        ]
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 8081:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "w": () => (/* reexport safe */ _SourceExample__WEBPACK_IMPORTED_MODULE_0__.w)
/* harmony export */ });
/* harmony import */ var _SourceExample__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3005);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_SourceExample__WEBPACK_IMPORTED_MODULE_0__]);
_SourceExample__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];


__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 8303:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "R": () => (/* binding */ AdvancedCalendar)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_calendar_client__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3514);
/* harmony import */ var _leight_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2353);
/* harmony import */ var _leight_i18n_client__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6994);
/* harmony import */ var _leight_utils_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8972);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_utils_client__WEBPACK_IMPORTED_MODULE_2__, _leight_calendar_client__WEBPACK_IMPORTED_MODULE_3__, _leight_i18n__WEBPACK_IMPORTED_MODULE_4__, _leight_i18n_client__WEBPACK_IMPORTED_MODULE_5__]);
([_leight_utils_client__WEBPACK_IMPORTED_MODULE_2__, _leight_calendar_client__WEBPACK_IMPORTED_MODULE_3__, _leight_i18n__WEBPACK_IMPORTED_MODULE_4__, _leight_i18n_client__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);






const AdvancedCalendar = (props)=>{
    /**
     * You can control the loading state of a Calendar by using optional
     * BlockProvider.
     */ return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_utils_client__WEBPACK_IMPORTED_MODULE_2__/* .BlockProvider */ .ZJ, {
        /**
         * blocked by default (for example, when you expect loading)
         */ isBlock: true,
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_3__/* .CalendarProvider */ .gi, {
            /**
             * You can pass input here or through the props; input is DateTime from Luxon
             */ date: _leight_i18n__WEBPACK_IMPORTED_MODULE_4__.DateTime.fromObject({
                month: 2,
                day: 12
            }),
            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(CalendarInternal, {
                ...props
            })
        })
    });
};
const CalendarInternal = (props)=>{
    /**
     * This is just an example how to use (control) loading state of
     * a Calendar.
     */ const { unblock  } = _leight_utils_client__WEBPACK_IMPORTED_MODULE_2__/* .BlockStore.useState */ .G.useState(({ unblock  })=>({
            unblock
        }));
    const [day, setDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)();
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        setTimeout(()=>{
            unblock();
        }, 750);
    }, []);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_3__/* .Calendar */ .f, {
                onClick: ({ day  })=>setDay(day),
                ...props
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                children: [
                    "selected date: ",
                    day ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_i18n_client__WEBPACK_IMPORTED_MODULE_5__/* .DateInline */ .Yo, {
                        date: day.day
                    }) : "- click the calendar -"
                ]
            })
        ]
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 8477:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "r": () => (/* binding */ AdvancedCalendarExample)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_mantine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9335);
/* harmony import */ var _AdvancedCalendar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8303);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_AdvancedCalendar__WEBPACK_IMPORTED_MODULE_1__, _leight_mantine__WEBPACK_IMPORTED_MODULE_2__]);
([_AdvancedCalendar__WEBPACK_IMPORTED_MODULE_1__, _leight_mantine__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);



const AdvancedCalendarExample = ()=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_mantine__WEBPACK_IMPORTED_MODULE_2__/* .Shell */ .N2, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_AdvancedCalendar__WEBPACK_IMPORTED_MODULE_1__/* .AdvancedCalendar */ .R, {})
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 7506:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "g": () => (/* binding */ DefaultCalendar)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3514);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__]);
_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];


const DefaultCalendar = (props)=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__/* .CalendarProvider */ .gi, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__/* .Calendar */ .f, {
            withControls: false,
            ...props
        })
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3275:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "m": () => (/* binding */ DefaultMonths)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3514);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__]);
_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];


const DefaultMonths = ()=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__/* .MonthsOfProvider */ .MT, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__/* .Months */ .zC, {})
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 1489:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "k": () => (/* binding */ DefaultMonthsExample)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_mantine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9335);
/* harmony import */ var _DefaultMonths__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3275);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_DefaultMonths__WEBPACK_IMPORTED_MODULE_1__, _leight_mantine__WEBPACK_IMPORTED_MODULE_2__]);
([_DefaultMonths__WEBPACK_IMPORTED_MODULE_1__, _leight_mantine__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);



const DefaultMonthsExample = ()=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_mantine__WEBPACK_IMPORTED_MODULE_2__/* .Shell */ .N2, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_DefaultMonths__WEBPACK_IMPORTED_MODULE_1__/* .DefaultMonths */ .m, {})
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 4828:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "_": () => (/* binding */ DefaultWeeks)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3514);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__]);
_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];


const DefaultWeeks = ()=>{
    /**
     * Here you can use WeeksProvider or CalendarProvider.
     *
     * CalendarProvider provides all stuff needed for the whole Calendar (weeks/months/years/...).
     */ return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__/* .WeeksOfProvider */ .Fh, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__/* .Weeks */ .B3, {
            /**
             * Controls are enabled by default and do not create such overhead; this is just for
             * an example to render must minimal calendar.
             */ withControls: false
        })
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 9102:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "P": () => (/* binding */ DefaultWeeksExample)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_mantine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9335);
/* harmony import */ var _DefaultWeeks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4828);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_DefaultWeeks__WEBPACK_IMPORTED_MODULE_1__, _leight_mantine__WEBPACK_IMPORTED_MODULE_2__]);
([_DefaultWeeks__WEBPACK_IMPORTED_MODULE_1__, _leight_mantine__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);



const DefaultWeeksExample = ()=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_mantine__WEBPACK_IMPORTED_MODULE_2__/* .Shell */ .N2, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_DefaultWeeks__WEBPACK_IMPORTED_MODULE_1__/* .DefaultWeeks */ ._, {})
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 9128:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "r": () => (/* binding */ DefaultYears)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3514);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__]);
_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];


const DefaultYears = ()=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__/* .YearsOfProvider */ .ui, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_calendar_client__WEBPACK_IMPORTED_MODULE_1__/* .Years */ .wE, {})
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 775:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "R": () => (/* binding */ DefaultYearsExample)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _leight_mantine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9335);
/* harmony import */ var _DefaultYears__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9128);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_DefaultYears__WEBPACK_IMPORTED_MODULE_1__, _leight_mantine__WEBPACK_IMPORTED_MODULE_2__]);
([_DefaultYears__WEBPACK_IMPORTED_MODULE_1__, _leight_mantine__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);



const DefaultYearsExample = ()=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_leight_mantine__WEBPACK_IMPORTED_MODULE_2__/* .Shell */ .N2, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_DefaultYears__WEBPACK_IMPORTED_MODULE_1__/* .DefaultYears */ .r, {})
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 7413:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Pm": () => (/* reexport safe */ _DefaultWeeksExample__WEBPACK_IMPORTED_MODULE_6__.P),
/* harmony export */   "Rz": () => (/* reexport safe */ _DefaultYearsExample__WEBPACK_IMPORTED_MODULE_8__.R),
/* harmony export */   "gK": () => (/* reexport safe */ _DefaultCalendar__WEBPACK_IMPORTED_MODULE_2__.g),
/* harmony export */   "k": () => (/* reexport safe */ _DefaultMonthsExample__WEBPACK_IMPORTED_MODULE_4__.k),
/* harmony export */   "rd": () => (/* reexport safe */ _AdvancedCalendarExample__WEBPACK_IMPORTED_MODULE_1__.r)
/* harmony export */ });
/* harmony import */ var _AdvancedCalendar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8303);
/* harmony import */ var _AdvancedCalendarExample__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8477);
/* harmony import */ var _DefaultCalendar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7506);
/* harmony import */ var _DefaultMonths__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3275);
/* harmony import */ var _DefaultMonthsExample__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1489);
/* harmony import */ var _DefaultWeeks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4828);
/* harmony import */ var _DefaultWeeksExample__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9102);
/* harmony import */ var _DefaultYears__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9128);
/* harmony import */ var _DefaultYearsExample__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(775);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_AdvancedCalendar__WEBPACK_IMPORTED_MODULE_0__, _AdvancedCalendarExample__WEBPACK_IMPORTED_MODULE_1__, _DefaultCalendar__WEBPACK_IMPORTED_MODULE_2__, _DefaultMonths__WEBPACK_IMPORTED_MODULE_3__, _DefaultMonthsExample__WEBPACK_IMPORTED_MODULE_4__, _DefaultWeeks__WEBPACK_IMPORTED_MODULE_5__, _DefaultWeeksExample__WEBPACK_IMPORTED_MODULE_6__, _DefaultYears__WEBPACK_IMPORTED_MODULE_7__, _DefaultYearsExample__WEBPACK_IMPORTED_MODULE_8__]);
([_AdvancedCalendar__WEBPACK_IMPORTED_MODULE_0__, _AdvancedCalendarExample__WEBPACK_IMPORTED_MODULE_1__, _DefaultCalendar__WEBPACK_IMPORTED_MODULE_2__, _DefaultMonths__WEBPACK_IMPORTED_MODULE_3__, _DefaultMonthsExample__WEBPACK_IMPORTED_MODULE_4__, _DefaultWeeks__WEBPACK_IMPORTED_MODULE_5__, _DefaultWeeksExample__WEBPACK_IMPORTED_MODULE_6__, _DefaultYears__WEBPACK_IMPORTED_MODULE_7__, _DefaultYearsExample__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);










__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3514:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "B3": () => (/* binding */ Weeks),
/* harmony export */   "Fh": () => (/* binding */ WeeksOfProvider),
/* harmony export */   "MT": () => (/* binding */ MonthsOfProvider),
/* harmony export */   "f": () => (/* binding */ Calendar),
/* harmony export */   "gi": () => (/* binding */ CalendarProvider),
/* harmony export */   "ui": () => (/* binding */ YearsOfProvider),
/* harmony export */   "wE": () => (/* binding */ Years),
/* harmony export */   "zC": () => (/* binding */ Months)
/* harmony export */ });
/* unused harmony exports CalendarShell, DateRageInline, MonthsOfStore, WeeksOfStore, YearsOfStore */
/* harmony import */ var _leight_calendar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9347);
/* harmony import */ var _leight_context_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7817);
/* harmony import */ var _leight_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2353);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var _leight_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5666);
/* harmony import */ var _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6994);
/* harmony import */ var _mantine_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2247);
/* harmony import */ var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2236);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6689);
/* harmony import */ var _leight_utils_client__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8972);
/* harmony import */ var _leight_mantine__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9335);
/* harmony import */ var _leight_source_client__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8069);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_context_client__WEBPACK_IMPORTED_MODULE_1__, _leight_calendar__WEBPACK_IMPORTED_MODULE_2__, _leight_i18n__WEBPACK_IMPORTED_MODULE_3__, _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__, _leight_mantine__WEBPACK_IMPORTED_MODULE_9__, _leight_utils_client__WEBPACK_IMPORTED_MODULE_10__, _leight_source_client__WEBPACK_IMPORTED_MODULE_11__]);
([_leight_context_client__WEBPACK_IMPORTED_MODULE_1__, _leight_calendar__WEBPACK_IMPORTED_MODULE_2__, _leight_i18n__WEBPACK_IMPORTED_MODULE_3__, _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__, _leight_mantine__WEBPACK_IMPORTED_MODULE_9__, _leight_utils_client__WEBPACK_IMPORTED_MODULE_10__, _leight_source_client__WEBPACK_IMPORTED_MODULE_11__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
// src/context/MonthsOfStore.tsx




var MonthsOfStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_1__/* .createStoreContext */ .re)({
  state: ({ state }) => (set, get) => ({
    monthsOf(date) {
      set({
        months: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .monthsOf */ .ge)({ date })
      });
      return get().months;
    },
    today() {
      set({
        months: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .monthsOf */ .ge)({ date: _leight_i18n__WEBPACK_IMPORTED_MODULE_3__.DateTime.now() })
      });
      return get().months;
    },
    prevYear() {
      set(({ months: { date } }) => ({
        months: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .monthsOf */ .ge)({ date: date.minus({ year: 1 }) })
      }));
      return get().months;
    },
    nextYear() {
      set(({ months: { date } }) => ({
        months: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .monthsOf */ .ge)({ date: date.plus({ year: 1 }) })
      }));
      return get().months;
    },
    ...state
  }),
  name: "MonthsOfStore",
  hint: "Add MonthsOfProvider or CalendarProvider."
});
var MonthsOfProvider = ({ date, ...props }) => {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    MonthsOfStore.Provider,
    {
      state: {
        months: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .monthsOf */ .ge)({ date })
      },
      ...props
    }
  );
};

// src/context/WeeksOfStore.tsx





var WeeksOfStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_1__/* .createStoreContext */ .re)({
  state: ({ state }) => (set, get) => ({
    id: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .generateId */ .Ox)(),
    weeksOf(date) {
      set({
        id: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .generateId */ .Ox)(),
        weeks: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .weeksOf */ .Of)({ date })
      });
      return get().weeks;
    },
    today() {
      set({
        id: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .generateId */ .Ox)(),
        weeks: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .weeksOf */ .Of)({ date: _leight_i18n__WEBPACK_IMPORTED_MODULE_3__.DateTime.now() })
      });
      return get().weeks;
    },
    prevMonth() {
      set(({ weeks: { date } }) => ({
        id: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .generateId */ .Ox)(),
        weeks: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .weeksOf */ .Of)({ date: date.minus({ month: 1 }) })
      }));
      return get().weeks;
    },
    nextMonth() {
      set(({ weeks: { date } }) => ({
        id: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .generateId */ .Ox)(),
        weeks: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .weeksOf */ .Of)({ date: date.plus({ month: 1 }) })
      }));
      return get().weeks;
    },
    prevYear() {
      set(({ weeks: { date } }) => ({
        id: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .generateId */ .Ox)(),
        weeks: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .weeksOf */ .Of)({ date: date.minus({ year: 1 }) })
      }));
      return get().weeks;
    },
    nextYear() {
      set(({ weeks: { date } }) => ({
        id: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .generateId */ .Ox)(),
        weeks: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .weeksOf */ .Of)({ date: date.plus({ year: 1 }) })
      }));
      return get().weeks;
    },
    ...state
  }),
  name: "WeeksOfStore",
  hint: "Add WeeksOfProvider or CalendarProvider."
});
var WeeksOfProvider = ({ date, ...props }) => {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    WeeksOfStore.Provider,
    {
      state: {
        weeks: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .weeksOf */ .Of)({ date })
      },
      ...props
    }
  );
};

// src/context/YearsOfStore.tsx




var YearsOfStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_1__/* .createStoreContext */ .re)({
  state: ({ state }) => (set, get) => ({
    yearsOf(date) {
      set({
        years: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .yearsOf */ .JR)({ date })
      });
      return get().years;
    },
    today() {
      set({
        years: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .yearsOf */ .JR)({ date: _leight_i18n__WEBPACK_IMPORTED_MODULE_3__.DateTime.now() })
      });
      return get().years;
    },
    prevYear() {
      set(({ years: { date } }) => ({
        years: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .yearsOf */ .JR)({ date: date.minus({ year: 1 }) })
      }));
      return get().years;
    },
    nextYear() {
      set(({ years: { date } }) => ({
        years: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .yearsOf */ .JR)({ date: date.plus({ year: 1 }) })
      }));
      return get().years;
    },
    prevYears() {
      set(({ years: { count, date } }) => ({
        years: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .yearsOf */ .JR)({ date: date.minus({ year: count }) })
      }));
      return get().years;
    },
    nextYears() {
      set(({ years: { count, date } }) => ({
        years: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .yearsOf */ .JR)({ date: date.plus({ year: count }) })
      }));
      return get().years;
    },
    ...state
  }),
  name: "YearsOfStore",
  hint: "Add YearsOfProvider or CalendarProvider."
});
var YearsOfProvider = ({ date, ...props }) => {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    YearsOfStore.Provider,
    {
      state: {
        years: (0,_leight_calendar__WEBPACK_IMPORTED_MODULE_2__/* .yearsOf */ .JR)({ date })
      },
      ...props
    }
  );
};

// src/context/index.tsx

var CalendarProvider = ({ children, date }) => {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    YearsOfProvider,
    {
      date,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        MonthsOfProvider,
        {
          date,
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            WeeksOfProvider,
            {
              date,
              children
            }
          )
        }
      )
    }
  );
};

// src/inline/DateRageInline.tsx



var DateRageInline = ({
  start,
  end,
  startOptions = { day: "numeric", month: "numeric" },
  endOptions,
  ...props
}) => {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Breadcrumbs,
    {
      separator: "\u2192",
      className: "secondary",
      ...props,
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
          {
            date: start,
            options: startOptions
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
          {
            date: end,
            options: endOptions
          }
        )
      ]
    }
  );
};

// src/ui/Calendar.tsx





// src/ui/Months.tsx






// src/ui/CalendarShell.tsx





var useStyles = (0,_mantine_core__WEBPACK_IMPORTED_MODULE_5__.createStyles)((theme) => ({
  calendar: {
    userSelect: "none"
  },
  calendarGrid: {
    border: "1px solid",
    borderColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
      theme,
      theme.colors.gray[6],
      theme.colors.gray[4]
    ),
    borderBottom: "none",
    borderRight: "none",
    "&:last-child": {
      border: "1px solid",
      borderColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
        theme,
        theme.colors.gray[6],
        theme.colors.gray[4]
      ),
      borderRight: "none"
    }
  },
  controlsGrid: {
    "& > div:last-child": {
      borderRight: "1px solid",
      borderRightColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
        theme,
        theme.colors.gray[6],
        theme.colors.gray[4]
      )
    }
  },
  controls: {
    display: "flex",
    flex: "1 1 auto",
    alignItems: "center"
  },
  controlsLeft: {},
  controlsMiddle: {
    justifyContent: "center"
  },
  controlsRight: {
    justifyContent: "end"
  },
  controlsPrefix: {},
  controlsSuffix: {},
  header: {
    backgroundColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
      theme,
      theme.colors.gray[6],
      theme.colors.gray[0]
    ),
    fontWeight: "bold",
    height: "3em",
    display: "flex",
    flex: "1 1 auto",
    justifyContent: "center",
    alignItems: "center",
    "&.compact": {
      height: "2em"
    }
  },
  cell: {
    height: "6em",
    padding: "0",
    "&:hover": {
      backgroundColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
        theme,
        theme.colors.gray[6],
        theme.colors.gray[0]
      )
    },
    "&.compact": {
      fontWeight: "normal",
      height: "2em",
      display: "flex",
      flex: "1 1 auto",
      justifyContent: "center",
      alignItems: "center"
    }
  },
  monthCell: {
    display: "flex",
    flex: "1 1 auto",
    justifyContent: "center",
    alignItems: "center"
  },
  yearCell: {
    display: "flex",
    flex: "1 1 auto",
    justifyContent: "center",
    alignItems: "center"
  },
  row: {
    "& > div": {
      borderRight: "1px solid",
      borderColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
        theme,
        theme.colors.gray[6],
        theme.colors.gray[4]
      )
    }
  },
  currentMonth: {
    fontWeight: "bold",
    backgroundColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
      theme,
      theme.colors.gray[6],
      theme.colors.gray[1]
    )
  },
  currentYear: {
    fontWeight: "bold",
    backgroundColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
      theme,
      theme.colors.gray[6],
      theme.colors.gray[1]
    )
  },
  currentWeek: {},
  currentDay: {
    backgroundColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .withPrimaryColor */ .$$)(theme, -4),
    color: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .withSecondaryPrimaryColor */ .QJ)(theme, -4),
    "&:hover": {
      backgroundColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .withPrimaryColor */ .$$)(theme, -3),
      color: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .withSecondaryPrimaryColor */ .QJ)(theme, -2)
    }
  },
  inRange: {
    fontWeight: "bold"
  },
  outOfRange: {
    backgroundColor: (0,_leight_mantine__WEBPACK_IMPORTED_MODULE_9__/* .switchScheme */ .rm)(
      theme,
      theme.colors.gray[6],
      theme.colors.gray[0]
    )
  }
}));
var renderComponent = (component, props) => (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .isCallable */ .GV)(component) ? component(props) : component;
var CalendarShell = ({
  events,
  withControls = true,
  controlsTopLeft,
  controlsTopMiddle,
  controlsTopRight,
  controlsBottomLeft,
  controlsBottomMiddle,
  controlsBottomRight,
  compact = false,
  children,
  ...props
}) => {
  const blockStore = _leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .BlockStore.useOptionalState */ .G.useOptionalState();
  const source = events?.SourceStore.useSource();
  const { classes } = useStyles();
  const controlColumnCount = 18;
  const controlWidth = 7;
  const renderProps = {
    classes,
    source,
    compact
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Box,
    {
      className: classes.calendar,
      ...props,
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.LoadingOverlay, { visible: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_4__/* .withBool */ .ls)(blockStore?.isBlock, source?.result.isFetching || false) }),
        withControls && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid,
          {
            columns: controlColumnCount,
            className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
              classes.calendarGrid,
              classes.controlsGrid,
              classes.controlsPrefix
            ),
            m: 0,
            children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: controlWidth,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.controls,
                    classes.controlsLeft
                  ),
                  children: renderComponent(controlsTopLeft, renderProps)
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: controlColumnCount - controlWidth * 2,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.controls,
                    classes.controlsMiddle
                  ),
                  children: renderComponent(controlsTopMiddle, renderProps)
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: controlWidth,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.controls,
                    classes.controlsRight
                  ),
                  children: renderComponent(controlsTopRight, renderProps)
                }
              )
            ]
          }
        ),
        renderComponent(children, renderProps),
        withControls && (controlsBottomLeft || controlsBottomMiddle || controlsBottomRight) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid,
          {
            columns: controlColumnCount,
            className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
              classes.calendarGrid,
              classes.controlsGrid,
              classes.controlsSuffix
            ),
            m: 0,
            children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: controlWidth,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.controls,
                    classes.controlsLeft
                  ),
                  children: renderComponent(controlsBottomLeft, renderProps)
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: controlColumnCount - controlWidth * 2,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.controls,
                    classes.controlsMiddle
                  ),
                  children: renderComponent(controlsBottomMiddle, renderProps)
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: controlWidth,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.controls,
                    classes.controlsRight
                  ),
                  children: renderComponent(controlsBottomRight, renderProps)
                }
              )
            ]
          }
        )
      ]
    }
  );
};

// src/ui/Months.tsx

var Months = ({
  children,
  onClick,
  ...props
}) => {
  const { months: { months, isCurrent, date }, today, prevYear, nextYear } = MonthsOfStore.useState();
  const columnCount = 4;
  const rowCount = months.length / columnCount;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    CalendarShell,
    {
      controlsTopLeft: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button.Group, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
        {
          size: "sm",
          variant: "subtle",
          onClick: () => prevYear(),
          leftIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronLeft, {}),
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
            {
              date: date.minus({ year: 1 }),
              options: { year: "numeric" }
            }
          )
        }
      ) }) }),
      controlsTopMiddle: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
        {
          variant: "subtle",
          onClick: () => today(),
          disabled: isCurrent,
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Text, { c: "dimmed", children: isCurrent ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo, { date: _leight_i18n__WEBPACK_IMPORTED_MODULE_3__.DateTime.now(), options: { day: "numeric", month: "long", year: "numeric" } }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo, { date, options: { year: "numeric" } }) })
        }
      ) }),
      controlsTopRight: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button.Group, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
        {
          size: "sm",
          variant: "subtle",
          onClick: () => nextYear(),
          rightIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronRight, {}),
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
            {
              date: date.plus({ year: 1 }),
              options: { year: "numeric" }
            }
          )
        }
      ) }) }),
      ...props,
      children: ({ classes }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
        Array.from({ length: rowCount }, (_, row) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid,
          {
            columns: columnCount,
            className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
              classes.calendarGrid,
              classes.row
            ),
            m: 0,
            children: Array.from({ length: columnCount }, (_2, column) => {
              const month = months[row * columnCount + column];
              if (!month) {
                return null;
              }
              return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: 1,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.cell,
                    classes.monthCell,
                    month.isCurrent ? classes.currentMonth : void 0
                  ),
                  style: onClick ? { cursor: "pointer" } : void 0,
                  onClick: () => onClick?.({ month }),
                  children: month.name
                },
                month.id
              );
            })
          },
          `month${row}`
        )),
        children
      ] })
    }
  );
};

// src/ui/Weeks.tsx








var Weeks = ({
  onClick,
  onChange: $onChange = () => null,
  events,
  renderDayInline,
  highlightToday = true,
  defaultWithWeekNo = false,
  weekCountSize = 2,
  columnSize = 3,
  children,
  ...props
}) => {
  const {
    id,
    nextMonth,
    prevMonth,
    prevYear,
    nextYear,
    today,
    weeks: {
      weeks,
      list,
      start,
      end,
      isCurrent
    }
  } = WeeksOfStore.useState();
  const source = events?.SourceStore.useSource();
  const filter = events?.SourceStore.Query.useState();
  const fulltextContext = _leight_source_client__WEBPACK_IMPORTED_MODULE_11__/* .FulltextStoreContext.useOptionalState */ ._V.useOptionalState();
  const $events = events && source?.data.reduce((prev, current) => {
    const stamp = _leight_i18n__WEBPACK_IMPORTED_MODULE_3__.DateTime.fromJSDate(current.date).toLocaleString({ day: "numeric", month: "numeric", year: "numeric" });
    prev[stamp] = (prev[stamp] || []).concat(current);
    return prev;
  }, {});
  const [withWeeks, setWithWeeks] = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)(defaultWithWeekNo);
  (0,react__WEBPACK_IMPORTED_MODULE_8__.useEffect)(() => {
    filter?.setFilter({
      fulltext: fulltextContext?.fulltext || void 0,
      withRange: {
        from: start.toUTC().toJSDate(),
        to: end.toUTC().toJSDate()
      }
    });
  }, [
    id
  ]);
  const onChange = (props2) => {
    filter?.setFilter({
      fulltext: fulltextContext?.fulltext || void 0,
      withRange: {
        from: props2.weeks.start.toUTC().toJSDate(),
        to: props2.weeks.end.toUTC().toJSDate()
      }
    });
    $onChange?.(props2);
  };
  const columnCount = list.length * columnSize + (withWeeks ? weekCountSize : 0);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    CalendarShell,
    {
      events,
      controlsTopLeft: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button.Group, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            compact: props.compact,
            size: "sm",
            variant: "subtle",
            onClick: () => onChange({ weeks: prevMonth() }),
            leftIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronLeft, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
              {
                date: start.minus({ month: 1 }),
                options: { month: "long" }
              }
            )
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            compact: props.compact,
            size: "sm",
            variant: "subtle",
            onClick: () => onChange({ weeks: prevYear() }),
            leftIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronsLeft, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
              {
                date: start.minus({ year: 1 }),
                options: { year: "numeric" }
              }
            )
          }
        )
      ] }) }),
      controlsTopMiddle: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
        {
          compact: props.compact,
          variant: "subtle",
          onClick: () => onChange({ weeks: today() }),
          disabled: isCurrent,
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Text, { c: "dimmed", children: isCurrent ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo, { date: _leight_i18n__WEBPACK_IMPORTED_MODULE_3__.DateTime.now(), options: { day: "numeric", month: "long", year: "numeric" } }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo, { date: start, options: { month: "long", year: "numeric" } }) })
        }
      ) }),
      controlsTopRight: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button.Group, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            compact: props.compact,
            size: "sm",
            variant: "subtle",
            onClick: () => onChange({ weeks: nextYear() }),
            rightIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronsRight, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
              {
                date: start.plus({ year: 1 }),
                options: { year: "numeric" }
              }
            )
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            compact: props.compact,
            size: "sm",
            variant: "subtle",
            onClick: () => onChange({ weeks: nextMonth() }),
            rightIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronRight, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
              {
                date: start.plus({ month: 1 }),
                options: { month: "long" }
              }
            )
          }
        )
      ] }) }),
      controlsBottomLeft: props.compact ? void 0 : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        _mantine_core__WEBPACK_IMPORTED_MODULE_5__.ActionIcon,
        {
          variant: "subtle",
          onClick: () => setWithWeeks((weeks2) => !weeks2),
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconCalendarEvent, {})
        }
      ),
      ...props,
      children: ({ classes }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid,
          {
            columns: columnCount,
            className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
              classes.calendarGrid,
              classes.row
            ),
            m: 0,
            children: [
              withWeeks && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: weekCountSize,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.header,
                    props.compact ? "compact" : void 0
                  ),
                  children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.ActionIcon, { variant: "light", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconCalendarEvent, {}) })
                }
              ),
              list.map((day) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: columnSize,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.header,
                    props.compact ? "compact" : void 0
                  ),
                  children: day
                },
                `day-${day}`
              ))
            ]
          }
        ),
        weeks.map(({ days, number, isCurrent: isCurrent2, id: id2 }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid,
          {
            columns: columnCount,
            className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
              classes.calendarGrid,
              classes.row,
              isCurrent2 ? classes.currentWeek : void 0
            ),
            m: 0,
            children: [
              withWeeks && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: weekCountSize,
                  children: [
                    number,
                    "."
                  ]
                }
              ),
              days.map((day) => props.compact ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: columnSize,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    "compact",
                    classes.cell,
                    day.isCurrent && highlightToday ? classes.currentDay : void 0,
                    day.isOutOfRange ? classes.outOfRange : classes.inRange
                  ),
                  style: onClick ? { cursor: "pointer" } : void 0,
                  onClick: () => onClick?.({ day }),
                  children: day.day.day
                },
                day.id
              ) }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: columnSize,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.cell,
                    day.isCurrent && highlightToday ? classes.currentDay : void 0,
                    day.isOutOfRange ? classes.outOfRange : classes.inRange
                  ),
                  style: onClick ? { cursor: "pointer" } : void 0,
                  onClick: () => onClick?.({ day }),
                  children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
                    _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Stack,
                    {
                      justify: "space-between",
                      style: { height: "100%", padding: "0 0.3em" },
                      children: [
                        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { position: "apart", children: [
                          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {}),
                          day.day.day
                        ] }),
                        renderDayInline && events ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: renderDayInline({
                          schema: events.schema,
                          day,
                          events: $events?.[day.id] || [],
                          compact: props.compact
                        }) }) : null
                      ]
                    }
                  )
                },
                day.id
              ))
            ]
          },
          id2
        )),
        children
      ] })
    }
  );
};

// src/ui/Years.tsx





var Years = ({
  children,
  onClick,
  ...props
}) => {
  const {
    years: {
      years,
      isCurrent,
      start,
      end,
      columns,
      rows,
      count
    },
    today,
    prevYear,
    nextYear,
    prevYears,
    nextYears
  } = YearsOfStore.useState();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    CalendarShell,
    {
      controlsTopLeft: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button.Group, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            size: "sm",
            variant: "subtle",
            onClick: () => prevYears(),
            leftIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronsLeft, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
              {
                date: start.minus({ year: count }),
                options: { year: "numeric" }
              }
            )
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            size: "sm",
            variant: "subtle",
            onClick: () => prevYear(),
            leftIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronLeft, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
              {
                date: start.minus({ year: 1 }),
                options: { year: "numeric" }
              }
            )
          }
        )
      ] }) }),
      controlsTopMiddle: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
        {
          variant: "subtle",
          onClick: () => today(),
          disabled: isCurrent,
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Text, { c: "dimmed", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            DateRageInline,
            {
              start,
              end,
              startOptions: { year: "numeric" },
              endOptions: { year: "numeric" }
            }
          ) })
        }
      ) }),
      controlsTopRight: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Group, { spacing: "sm", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button.Group, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            size: "sm",
            variant: "subtle",
            onClick: () => nextYear(),
            rightIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronRight, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
              {
                date: end.plus({ year: 1 }),
                options: { year: "numeric" }
              }
            )
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            size: "sm",
            variant: "subtle",
            onClick: () => nextYears(),
            leftIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconChevronsRight, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo,
              {
                date: end.plus({ year: count }),
                options: { year: "numeric" }
              }
            )
          }
        )
      ] }) }),
      ...props,
      children: ({ classes }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
        Array.from({ length: rows }, (_, row) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid,
          {
            columns,
            className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
              classes.calendarGrid,
              classes.row
            ),
            m: 0,
            children: Array.from({ length: columns }, (_2, column) => {
              const year = years[row * columns + column];
              if (!year) {
                return null;
              }
              return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Grid.Col,
                {
                  span: 1,
                  className: (0,_leight_utils_client__WEBPACK_IMPORTED_MODULE_10__/* .classNames */ .AK)(
                    classes.cell,
                    classes.yearCell,
                    year.isCurrent ? classes.currentYear : void 0
                  ),
                  style: onClick ? { cursor: "pointer" } : void 0,
                  onClick: () => onClick?.({ year }),
                  children: year.name
                },
                year.id
              );
            })
          },
          `year${row}`
        )),
        children
      ] })
    }
  );
};

// src/ui/Calendar.tsx

var Calendar = ({
  onClick,
  withControls = true,
  onChange,
  ...props
}) => {
  const { weeksOf: weeksOf2, weeks } = WeeksOfStore.useState(({ weeksOf: weeksOf3, weeks: weeks2 }) => ({ weeksOf: weeksOf3, weeks: weeks2 }));
  const { monthsOf: monthsOf2 } = MonthsOfStore.useState(({ monthsOf: monthsOf3 }) => ({ monthsOf: monthsOf3 }));
  const { yearsOf: yearsOf2 } = YearsOfStore.useState(({ yearsOf: yearsOf3 }) => ({ yearsOf: yearsOf3 }));
  const [selectMonth, setSelectMonth] = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
  const [selectYear, setSelectYear] = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Box, { pos: "relative", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    Weeks,
    {
      onClick,
      withControls,
      onChange,
      controlsBottomMiddle: props.compact ? void 0 : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button.Group, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            compact: props.compact,
            variant: "subtle",
            onClick: () => {
              setSelectMonth(true);
              monthsOf2(weeks.date);
            },
            leftIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconCalendarSearch, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo, { date: weeks.date, options: { month: "long" } })
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          _mantine_core__WEBPACK_IMPORTED_MODULE_5__.Button,
          {
            compact: props.compact,
            variant: "subtle",
            onClick: () => {
              setSelectYear(true);
              yearsOf2(weeks.date);
            },
            leftIcon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconCalendarSearch, {}),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_leight_i18n_client__WEBPACK_IMPORTED_MODULE_6__/* .DateInline */ .Yo, { date: weeks.date, options: { year: "numeric" } })
          }
        )
      ] }),
      ...props,
      children: [
        selectMonth && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Overlay, { color: "#FFF", opacity: 1, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Months,
          {
            onClick: ({ month: { month } }) => {
              onChange?.({ weeks: weeksOf2(month) });
              setSelectMonth(false);
            },
            controlsBottomMiddle: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _mantine_core__WEBPACK_IMPORTED_MODULE_5__.ActionIcon,
              {
                variant: "subtle",
                onClick: () => setSelectMonth(false),
                children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconX, {})
              }
            ),
            compact: props.compact
          }
        ) }),
        selectYear && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_5__.Overlay, { color: "#FFF", opacity: 1, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Years,
          {
            onClick: ({ year: { year } }) => {
              onChange?.({ weeks: weeksOf2(year) });
              setSelectYear(false);
            },
            controlsBottomMiddle: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              _mantine_core__WEBPACK_IMPORTED_MODULE_5__.ActionIcon,
              {
                variant: "subtle",
                onClick: () => setSelectYear(false),
                children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_7__.IconX, {})
              }
            ),
            compact: props.compact
          }
        ) })
      ]
    }
  ) });
};

//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 9347:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "JR": () => (/* binding */ yearsOf),
/* harmony export */   "Of": () => (/* binding */ weeksOf),
/* harmony export */   "ge": () => (/* binding */ monthsOf)
/* harmony export */ });
/* unused harmony export CalendarEventSourceSchema */
/* harmony import */ var _leight_source__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3154);
/* harmony import */ var _leight_zod__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9926);
/* harmony import */ var _leight_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2353);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_source__WEBPACK_IMPORTED_MODULE_0__, _leight_zod__WEBPACK_IMPORTED_MODULE_1__, _leight_i18n__WEBPACK_IMPORTED_MODULE_2__]);
([_leight_source__WEBPACK_IMPORTED_MODULE_0__, _leight_zod__WEBPACK_IMPORTED_MODULE_1__, _leight_i18n__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
// src/api/index.ts


var CalendarEventSourceSchema = (0,_leight_source__WEBPACK_IMPORTED_MODULE_0__/* .withSourceSchema */ .P5)({
  /**
   * Defines an individual calendar item being rendered/handled in a particular day.
   */
  DtoSchema: _leight_source__WEBPACK_IMPORTED_MODULE_0__/* .DtoSchema.merge */ .eO.merge(_leight_zod__WEBPACK_IMPORTED_MODULE_1__.z.object({
    date: _leight_zod__WEBPACK_IMPORTED_MODULE_1__.z.date(),
    prev: _leight_zod__WEBPACK_IMPORTED_MODULE_1__.z.date().optional(),
    next: _leight_zod__WEBPACK_IMPORTED_MODULE_1__.z.date().optional()
  })),
  FilterSchema: _leight_source__WEBPACK_IMPORTED_MODULE_0__/* .FilterSchema.merge */ .eq.merge(_leight_zod__WEBPACK_IMPORTED_MODULE_1__.z.object({
    withRange: _leight_zod__WEBPACK_IMPORTED_MODULE_1__.z.object({
      from: _leight_zod__WEBPACK_IMPORTED_MODULE_1__.z.date(),
      to: _leight_zod__WEBPACK_IMPORTED_MODULE_1__.z.date()
    }).optional()
  }))
});

// src/calendar/weeksOf.ts

var weeksOf = ({
  date = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.now(),
  margin = 0,
  marginPlus,
  marginMinus,
  dayFormat = "short"
} = {
  date: _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.now(),
  margin: 1,
  dayFormat: "short"
}) => {
  const start = date.startOf("month").minus({ week: marginMinus || margin });
  const end = date.endOf("month").plus({ week: marginPlus || margin });
  const interval = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.Interval.fromDateTimes(start, end);
  const length = Math.max(interval.count("weeks"), 6);
  const calendarStart = start.startOf("week");
  const calendarEnd = calendarStart.plus({ week: length });
  const days = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.Interval.fromDateTimes(
    calendarStart,
    calendarEnd
  ).count("days");
  const now = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.now();
  return {
    date,
    now,
    start,
    calendarStart,
    end,
    calendarEnd,
    interval,
    get isCurrent() {
      return interval.contains(now);
    },
    get list() {
      return _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.Info.weekdays(dayFormat);
    },
    get weeks() {
      return Array.from({ length }, (_, week) => {
        const $week = calendarStart.plus({ week });
        const id = `${$week.year}-${$week.weekNumber}`;
        return {
          id,
          week: $week,
          number: $week.weekNumber,
          isCurrent: $week.weekNumber === now.weekNumber && $week.year === now.year,
          get days() {
            return Array.from({ length: 7 }, (_2, day) => {
              const $day = $week.plus({ day });
              return {
                id: $day.toLocaleString({ day: "numeric", month: "numeric", year: "numeric" }),
                day: $day,
                isCurrent: !Math.floor(now.diff($day, "day").days),
                isOutOfRange: $day.month !== date.month || $day.year !== date.year
              };
            });
          }
        };
      });
    },
    get days() {
      return Array.from({ length: days }, (_, day) => {
        const $day = calendarStart.plus({ day });
        return {
          id: $day.toLocaleString({ day: "numeric", month: "numeric", year: "numeric" }),
          day: $day,
          isCurrent: !Math.floor(now.diff($day, "day").days),
          isOutOfRange: $day.month !== date.month || $day.year !== date.year
        };
      });
    }
  };
};

// src/calendar/monthsOf.ts

var monthsOf = ({
  date = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.now(),
  monthFormat = "long"
}) => {
  const start = date.startOf("year");
  const end = date.endOf("year");
  const interval = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.Interval.fromDateTimes(start, end);
  const length = interval.count("months");
  const now = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.now();
  return {
    date,
    start,
    end,
    interval,
    now,
    get isCurrent() {
      return interval.contains(now);
    },
    get list() {
      return _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.Info.months(monthFormat);
    },
    get months() {
      return Array.from({ length }, (_, month) => {
        const $month = start.plus({ month });
        const id = `${$month.year}-${$month.month}`;
        return {
          id,
          name: $month.toLocaleString({ month: "long" }),
          month: $month,
          number: $month.month,
          isCurrent: now.year === $month.year && now.month === $month.month
        };
      });
    }
  };
};

// src/calendar/yearsOf.ts

var yearsOf = ({
  date = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.now(),
  columns = 5,
  rows = 3
}) => {
  const margin = (columns - 1) / 2 + (rows - 1) / 2 * columns;
  const start = date.minus({ year: margin });
  const end = date.plus({ year: margin });
  const interval = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.Interval.fromDateTimes(start, end);
  const length = interval.count("years");
  const now = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.now();
  return {
    date,
    start,
    end,
    interval,
    columns,
    rows,
    count: columns * rows,
    now,
    get isCurrent() {
      return now.year >= start.year && now.year <= end.year;
    },
    get list() {
      return Array.from({ length }, (_, year) => start.year + year);
    },
    get years() {
      return Array.from({ length }, (_, year) => {
        const $year = start.plus({ year });
        const id = `${$year.year}`;
        return {
          id,
          name: $year.year,
          year: $year,
          isCurrent: now.year === $year.year
        };
      });
    }
  };
};

//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 8069:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "_V": () => (/* binding */ FulltextStoreContext)
/* harmony export */ });
/* unused harmony exports FulltextProvider, Pagination, QueryProvider, SortIcon, createQueryStore, useSource, withSourceQuery, withSourceStore */
/* harmony import */ var _leight_context_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7817);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var _mantine_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2247);
/* harmony import */ var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2236);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_context_client__WEBPACK_IMPORTED_MODULE_1__]);
_leight_context_client__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
// src/fulltext/FulltextStoreContext.tsx


var FulltextStoreContext = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_1__/* .createStoreContext */ .re)({
  state: () => (set) => ({
    fulltext: void 0,
    setFulltext(fulltext) {
      set({ fulltext });
    }
  }),
  name: "FulltextStoreContext"
});
var FulltextProvider = ({ defaultFulltext, ...props }) => {
  return /* @__PURE__ */ jsx(
    FulltextStoreContext.Provider,
    {
      defaults: { fulltext: defaultFulltext },
      ...props
    }
  );
};

// src/query/createQueryStore.ts


var createQueryStore = ({
  name,
  schema
}) => {
  return createStoreContext2({
    state: ({ defaults }) => (set) => ({
      $id: generateId(),
      $schema: schema,
      $filter: defaults?.$query?.filter,
      $applyFilter: void 0,
      $filterDto: void 0,
      $sort: defaults?.$query?.sort || {},
      $page: defaults?.$query?.cursor?.page || 0,
      $size: defaults?.$query?.cursor?.size || 30,
      $query: defaults?.$query || {
        cursor: {
          page: 0,
          size: 30
        }
      },
      setFilter(filter) {
        set(({ $query, $applyFilter }) => ({
          $id: generateId(),
          $filter: {
            ...filter,
            ...$applyFilter
          },
          $query: {
            ...$query,
            filter: {
              ...filter,
              ...$applyFilter
            }
          }
        }));
      },
      applyFilter(filter) {
        set(({ $query }) => ({
          $id: generateId(),
          $applyFilter: filter,
          $filter: filter,
          $query: {
            ...$query,
            filter
          }
        }));
      },
      applyShallowFilter(filter) {
        set(({ $query, $applyFilter }) => ({
          $id: generateId(),
          $applyFilter: {
            ...$applyFilter,
            ...filter
          },
          $filter: {
            ...$query.filter,
            ...$applyFilter,
            ...filter
          },
          $query: {
            ...$query,
            filter: {
              ...$query.filter,
              ...$applyFilter,
              ...filter
            }
          }
        }));
      },
      setShallowFilter(filter) {
        set(({ $query, $applyFilter }) => ({
          $id: generateId(),
          $filter: {
            ...$query.filter,
            ...filter,
            ...$applyFilter
          },
          $query: {
            ...$query,
            filter: {
              ...$query.filter,
              ...filter,
              ...$applyFilter
            }
          }
        }));
      },
      setFilterDto(dto) {
        set({ $filterDto: dto });
      },
      setSort(key, order) {
        set(({ $query }) => ({
          $id: generateId(),
          $sort: {
            [key]: order
          },
          $query: {
            ...$query,
            sort: {
              [key]: order
            }
          }
        }));
      },
      setSize(size) {
        set(({ $query }) => ({
          $id: generateId(),
          $size: size,
          $query: {
            ...$query,
            cursor: {
              ...$query.cursor,
              size
            }
          }
        }));
      },
      setPage(page) {
        set(({ $query }) => ({
          $id: generateId(),
          $page: page,
          $query: {
            ...$query,
            cursor: {
              ...$query.cursor,
              page
            }
          }
        }));
      }
    }),
    name
  });
};

// src/query/QueryProvider.tsx

var QueryProvider = ({
  SourceStore,
  defaultFilter,
  defaultSort,
  defaultCursor,
  children
}) => {
  return /* @__PURE__ */ jsx2(
    SourceStore.Query.Provider,
    {
      defaults: {
        $filter: defaultFilter,
        $sort: defaultSort,
        $page: defaultCursor?.page || 0,
        $size: defaultCursor?.size || 30
      },
      children
    }
  );
};

// src/source/createSourceContext.tsx
var withSourceStore = ({
  name,
  schema,
  use
}) => {
  const $store = {
    name,
    useSource: ({ cacheTime } = { cacheTime: void 0 }) => {
      return useSource({
        SourceStore: $store,
        schema: schema.DtoSchema,
        cacheTime
      });
    },
    use,
    Query: createQueryStore({
      name,
      schema
    })
  };
  return $store;
};

// src/source/useSource.ts
var useSource = ({
  cacheTime = 120,
  schema,
  SourceStore
}) => {
  const $cacheTime = cacheTime ? cacheTime * 1e3 : void 0;
  const { query } = SourceStore.Query.useState(({ $query }) => ({ query: $query }));
  const result = SourceStore.use.useQuery(query, {
    staleTime: $cacheTime,
    cacheTime: $cacheTime
  });
  return {
    result,
    data: result.isSuccess ? result.data.filter((item) => schema.safeParse(item).success).filter((item) => schema.parse(item)) : []
  };
};

// src/ui/Pagination.tsx


var Pagination = ({
  SourceStore,
  hideOnSingle = true,
  ...props
}) => {
  const $cacheTime = 120;
  const { query, setPage } = SourceStore.Query.useState(({ $query, setPage: setPage2 }) => ({ query: $query, setPage: setPage2 }));
  const result = SourceStore.use.useCount(query, {
    cacheTime: $cacheTime * 1e3,
    staleTime: $cacheTime * 1e3
  });
  const pages = Math.ceil((result.data || 0) / query.cursor.size);
  return hideOnSingle && pages === 1 ? null : /* @__PURE__ */ jsx3(
    CoolPagination,
    {
      withEdges: true,
      size: "md",
      radius: "sm",
      total: pages,
      boundaries: 2,
      siblings: 2,
      value: query.cursor.page + 1,
      onChange: (page) => setPage(page - 1),
      ...props
    }
  );
};

// src/ui/SortIcon.tsx


var SortIcon = ({ index, sort }) => {
  switch (sort[index]) {
    case "asc":
      return /* @__PURE__ */ jsx4(IconSortAscending2, { color: "grey" });
    case "desc":
      return /* @__PURE__ */ jsx4(IconSortDescending2, { color: "grey" });
    default:
      return /* @__PURE__ */ jsx4(IconArrowsSort, { color: "lightgrey" });
  }
};

// src/utils/withSourceQuery.ts
var withSourceQuery = ({
  create: { useMutation: useCreate },
  patch: { useMutation: usePatch },
  delete: { useMutation: useDelete },
  deleteWith: { useMutation: useDeleteWith },
  query: { useQuery },
  count: { useQuery: useCount },
  fetch: { useQuery: useFetch },
  find: { useQuery: useFind },
  findOptional: { useQuery: useFindOptional }
}) => ({
  useCreate,
  usePatch,
  useDelete,
  useDeleteWith,
  useQuery,
  useCount,
  useFetch,
  useFind,
  useFindOptional
});

//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3154:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "P5": () => (/* binding */ withSourceSchema),
/* harmony export */   "eO": () => (/* binding */ DtoSchema),
/* harmony export */   "eq": () => (/* binding */ FilterSchema)
/* harmony export */ });
/* unused harmony exports CreateSchema, CursorSchema, EntitySchema, ParamsSchema, PatchSchema, QuerySchema, SortOrderSchema, SortSchema, SourceError, ToCreateSchema, ToPatchSchema, WithIdentitySchema, WithOptionalIdentitySchema, withCursor, withSourceSchemaEx */
/* harmony import */ var _leight_zod__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9926);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_zod__WEBPACK_IMPORTED_MODULE_0__]);
_leight_zod__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
// src/error/SourceError.ts
var SourceError = class extends Error {
};

// src/schema/CursorSchema.ts

var CursorSchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({
  page: _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.number().min(0),
  size: _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.number().min(1)
});

// src/schema/FilterSchema.ts

var FilterSchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({
  id: _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.string().optional(),
  ids: _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.array(_leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.string()).optional(),
  fulltext: _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.string().optional()
});

// src/schema/QuerySchema.ts


// src/schema/SortSchema.ts

var SortOrderSchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z["enum"]([
  "asc",
  "desc"
]).optional();
var SortSchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({});

// src/schema/QuerySchema.ts
var ParamsSchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({});
var QuerySchema = ({
  filterSchema,
  sortSchema,
  paramsSchema
}) => _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({
  filter: (filterSchema || FilterSchema).optional(),
  sort: (sortSchema || SortSchema).optional(),
  cursor: CursorSchema.optional(),
  params: (paramsSchema || ParamsSchema).optional()
});

// src/schema/SourceSchema.ts

var WithIdentitySchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({
  id: _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.string()
});
var WithOptionalIdentitySchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({
  id: _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.string().optional()
}).optional();
var EntitySchema = WithIdentitySchema;
var DtoSchema = WithIdentitySchema;
var CreateSchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({});
var ToCreateSchema = _leight_zod__WEBPACK_IMPORTED_MODULE_0__.z.object({});
var PatchSchema = WithIdentitySchema;
var ToPatchSchema = WithIdentitySchema;

// src/utils/withCursor.ts
var withCursor = ({ query, arg = {}, size, page }) => {
  const take = query?.cursor?.size ?? size;
  const skip = query?.cursor?.page ?? page;
  return {
    ...arg,
    take: take !== void 0 && skip !== void 0 ? take : void 0,
    skip: take !== void 0 && skip !== void 0 ? take * skip : void 0
  };
};

// src/utils/withSourceSchema.ts
var withSourceSchema = ({
  EntitySchema: $EntitySchema = EntitySchema,
  DtoSchema: $DtoSchema = DtoSchema,
  ToCreateSchema: $ToCreateSchema = ToCreateSchema,
  CreateSchema: $CreateSchema = CreateSchema,
  ToPatchSchema: $ToPatchSchema = ToPatchSchema,
  PatchSchema: $PatchSchema = PatchSchema,
  FilterSchema: $FilterSchema = FilterSchema,
  SortSchema: $SortSchema = SortSchema,
  ParamsSchema: $ParamsSchema = ParamsSchema
}) => {
  const $QuerySchema = QuerySchema({
    filterSchema: $FilterSchema,
    sortSchema: $SortSchema,
    paramsSchema: $ParamsSchema
  });
  return {
    EntitySchema: $EntitySchema,
    DtoSchema: $DtoSchema,
    ToCreateSchema: $ToCreateSchema,
    CreateSchema: $CreateSchema,
    ToPatchSchema: $ToPatchSchema,
    PatchSchema: $PatchSchema,
    FilterSchema: $FilterSchema,
    SortSchema: $SortSchema,
    ParamsSchema: $ParamsSchema,
    CursorSchema,
    QuerySchema: $QuerySchema,
    QueryOptionalSchema: $QuerySchema.optional()
  };
};

// src/utils/withSourceSchemaEx.ts
var withSourceSchemaEx = (props) => {
  return props;
};

//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ })

};
;