{"version":3,"file":"czech-holidays.cjs","sources":["../src/components/types.ts","../src/components/EasterCalculator.ts","../src/components/DataProvider.ts","../src/components/CzechHolidays.ts"],"sourcesContent":["export interface LocalizedText {\n  cs: string;\n  en: string;\n\n  [key: string]: string;\n}\n\nexport interface Holiday {\n  day: number;\n  month: number;\n  name: LocalizedText;\n  description: LocalizedText;\n  shopRestriction: HolidayShopRestriction;\n  isMoveable: boolean;\n}\n\nexport interface DatedHoliday extends Holiday {\n  date: Date;\n}\n\nexport enum HolidayShopRestriction {\n  Open,\n  Closed,\n  Partial,\n}\n\nexport enum HolidaySupportedLocales {\n  Czech = 'cs',\n  English = 'en'\n}\n\nexport interface LongWeekend {\n  start: Date;\n  end: Date;\n  days: number;\n  holidays: DatedHoliday[];\n}\n\nexport interface BridgeDay {\n  date: Date;\n  surroundingHolidays: DatedHoliday[];\n  totalDaysOff: number;\n}\n","export interface EasterDates {\n  easterSunday: Date;\n  goodFriday: Date;\n  easterMonday: Date;\n}\n\nexport function calculateEasterHolidays(year: number): EasterDates {\n  const a = year % 19;\n  const b = Math.floor(year / 100);\n  const c = year % 100;\n  const d = Math.floor(b / 4);\n  const e = b % 4;\n  const f = Math.floor((b + 8) / 25);\n  const g = Math.floor((b - f + 1) / 3);\n  const h = (19 * a + b - d - g + 15) % 30;\n  const i = Math.floor(c / 4);\n  const k = c % 4;\n  const l = (32 + 2 * e + 2 * i - h - k) % 7;\n  const m = Math.floor((a + 11 * h + 22 * l) / 451);\n  const month = Math.floor((h + l - 7 * m + 114) / 31);\n  const day = ((h + l - 7 * m + 114) % 31) + 1;\n\n  const easterSunday = new Date(year, month - 1, day);\n  const goodFriday = new Date(year, month - 1, day - 2);\n  const easterMonday = new Date(year, month - 1, day + 1);\n\n  return {\n    easterSunday,\n    goodFriday,\n    easterMonday\n  };\n}","import { Holiday, HolidayShopRestriction } from '@app/components/types.ts';\nimport { calculateEasterHolidays } from '@app/components/EasterCalculator.ts';\n\nexport function getEasterHolidays(year: number): Holiday[] {\n  const easterHolidays = calculateEasterHolidays(year);\n  return [\n    {\n      day: easterHolidays.goodFriday.getDate(),\n      month: easterHolidays.goodFriday.getMonth() + 1,\n      name: {\n        cs: 'Velký pátek',\n        en: 'Good Friday'\n      },\n      description: {\n        cs: '',\n        en: ''\n      },\n      shopRestriction: HolidayShopRestriction.Open,\n      isMoveable: true\n    },\n    {\n      day: easterHolidays.easterMonday.getDate(),\n      month: easterHolidays.easterMonday.getMonth() + 1,\n      name: {\n        cs: 'Velikonoční pondělí',\n        en: 'Easter Monday'\n      },\n      description: {\n        cs: '',\n        en: ''\n      },\n      shopRestriction: HolidayShopRestriction.Closed,\n      isMoveable: true\n    }\n  ];\n}\n\nexport function getFixedHolidays(): Holiday[] {\n  return [\n    {\n      day: 1,\n      month: 1,\n      name: {\n        cs: 'Den obnovy samostatného českého státu; Nový rok',\n        en: 'Restoration Day of the Independent Czech State, New Year\\'s Day'\n      },\n      description: {\n        cs: '1993 – vznik samostatné České republiky',\n        en: 'Czechoslovakia split into the Czech Republic and Slovakia.'\n      },\n      shopRestriction: HolidayShopRestriction.Closed,\n      isMoveable: false\n    }, {\n      day: 1,\n      month: 5,\n      name: {\n        cs: 'Svátek práce',\n        en: 'Labor Day'\n      },\n      description: {\n        cs: '',\n        en: ''\n      },\n      shopRestriction: HolidayShopRestriction.Open,\n      isMoveable: false\n    }, {\n      day: 8,\n      month: 5,\n      name: {\n        cs: 'Den vítězství',\n        en: 'Victory Day'\n      },\n      description: {\n        cs: '1945 – konec druhé světové války v Evropě',\n        en: '1945, the end of the European part of World War II.'\n      },\n      shopRestriction: HolidayShopRestriction.Closed,\n      isMoveable: false\n    }, {\n      day: 5,\n      month: 7,\n      name: {\n        cs: 'Den slovanských věrozvěstů Cyrila a Metoděje',\n        en: 'Day of the Slavic Apostles Cyril and Methodius'\n      },\n      description: {\n        cs: '863 – příchod bratrů, kteří přinesli křesťanství a vzdělanost na Velkou Moravu',\n        en: 'In 863, Church teachers St. Cyril (Constantine) and Metoděj (Methodius) came from the Balkans to Great Moravia to propagate Christian faith and literacy.'\n      },\n      shopRestriction: HolidayShopRestriction.Open,\n      isMoveable: false\n    }, {\n      day: 6,\n      month: 7,\n      name: {\n        cs: 'Den upálení mistra Jana Husa',\n        en: 'Jan Hus Day'\n      },\n      description: {\n        cs: '1415',\n        en: 'The religious reformer Jan Hus was burned at the stake in 1415.'\n      },\n      shopRestriction: HolidayShopRestriction.Open,\n      isMoveable: false\n    }, {\n      day: 28,\n      month: 9,\n      name: {\n        cs: 'Den české státnosti',\n        en: 'Czech Statehood Day'\n      },\n      description: {\n        cs: '935 – zavraždění knížete Václava',\n        en: 'In 935, St. Wenceslas, Duke of Bohemia, now patron of the Czech State, was murdered by his brother.'\n      },\n      shopRestriction: HolidayShopRestriction.Closed,\n      isMoveable: false\n    }, {\n      day: 28,\n      month: 10,\n      name: {\n        cs: 'Den vzniku samostatného československého státu',\n        en: 'Independent Czechoslovak State Day'\n      },\n      description: {\n        cs: '1918 – vznik Československa',\n        en: 'Independence Day and Creation of Czechoslovakia in 1918.'\n      },\n      shopRestriction: HolidayShopRestriction.Closed,\n      isMoveable: false\n    }, {\n      day: 17,\n      month: 11,\n      name: {\n        cs: 'Den boje za svobodu a demokracii',\n        en: 'Struggle for Freedom and Democracy Day'\n      },\n      description: {\n        cs: '1939 – uzavření českých vysokých škol nacisty, 1989 – studentské protesty, které spustily sametovou revoluci',\n        en: 'Commemorating the student demonstration against Nazi occupation in 1939, and the demonstration in 1989 that started the Velvet Revolution.'\n      },\n      shopRestriction: HolidayShopRestriction.Open,\n      isMoveable: false\n    }, {\n      day: 24,\n      month: 12,\n      name: {\n        cs: 'Štědrý den',\n        en: 'Christmas Eve'\n      },\n      description: {\n        cs: '',\n        en: 'Christmas is celebrated during the evening of the 24th.'\n      },\n      shopRestriction: HolidayShopRestriction.Partial,\n      isMoveable: false\n    }, {\n      day: 25,\n      month: 12,\n      name: {\n        cs: '1. svátek vánoční',\n        en: 'Christmas Day'\n      },\n      description: {\n        cs: '',\n        en: ''\n      },\n      shopRestriction: HolidayShopRestriction.Closed,\n      isMoveable: false\n    }, {\n      day: 26,\n      month: 12,\n      name: {\n        cs: '2. svátek vánoční',\n        en: 'Second Day of Christmas'\n      },\n      description: {\n        cs: '',\n        en: ''\n      },\n      shopRestriction: HolidayShopRestriction.Closed,\n      isMoveable: false\n    }\n  ];\n}\n","import { getEasterHolidays, getFixedHolidays } from '@app/components/DataProvider.ts';\nimport {\n  BridgeDay,\n  DatedHoliday,\n  Holiday,\n  HolidayShopRestriction,\n  HolidaySupportedLocales,\n  LongWeekend\n} from '@app/components/types.ts';\n\nexport type { LocalizedText, Holiday, DatedHoliday, LongWeekend, BridgeDay } from '@app/components/types.ts';\nexport { HolidayShopRestriction, HolidaySupportedLocales } from '@app/components/types.ts';\n\nconst CzechHolidays = (() => {\n  const fixedHolidays: Holiday[] = getFixedHolidays();\n  const cache = new Map<number, Holiday[]>();\n  const mapCache = new Map<number, Map<string, Holiday>>();\n\n  function getHolidayMap(year: number): Map<string, Holiday> {\n    let map = mapCache.get(year);\n    if (!map) {\n      const holidays = getHolidaysForYear(year);\n      map = new Map<string, Holiday>();\n      holidays.forEach((h) => map!.set(`${h.day}-${h.month}`, h));\n      mapCache.set(year, map);\n    }\n    return map;\n  }\n\n  function getMapKey(date: Date): { key: string; year: number } {\n    return {\n      key: `${date.getDate()}-${date.getMonth() + 1}`,\n      year: date.getFullYear()\n    };\n  }\n\n  function toDatedHoliday(holiday: Holiday, date: Date): DatedHoliday {\n    return { ...holiday, date: new Date(date) };\n  }\n\n  // ── Core ──────────────────────────────────────────────────────────────\n\n  /**\n   * Returns all Czech public holidays for a given year.\n   * Results are cached in memory — subsequent calls for the same year are instant.\n   * @param year - The full year (e.g. 2024).\n   * @returns Array of Holiday objects (11 fixed + 2 Easter-based).\n   */\n  function getHolidaysForYear(year: number): Holiday[] {\n    let holidays = cache.get(year);\n    if (!holidays) {\n      const easterHolidays = getEasterHolidays(year);\n      holidays = fixedHolidays.concat(easterHolidays);\n      cache.set(year, holidays);\n    }\n    return holidays;\n  }\n\n  /**\n   * Checks if a date is a Czech public holiday.\n   * @param date - The date to check.\n   * @returns `true` if the date is a public holiday.\n   */\n  function isHoliday(date: Date): boolean {\n    const { key, year } = getMapKey(date);\n    return getHolidayMap(year).has(key);\n  }\n\n  /**\n   * Returns the Holiday object for a given date.\n   * @param date - The date to look up.\n   * @returns The Holiday object, or `null` if not a holiday.\n   */\n  function getHoliday(date: Date): Holiday | null {\n    const { key, year } = getMapKey(date);\n    return getHolidayMap(year).get(key) ?? null;\n  }\n\n  /**\n   * Returns the localized name of the holiday on a given date.\n   * @param date - The date to look up.\n   * @param locale - `'cs'` for Czech (default) or `'en'` for English.\n   * @returns The holiday name string, or `null` if not a holiday.\n   */\n  function getHolidayName(date: Date, locale: HolidaySupportedLocales = HolidaySupportedLocales.Czech): string | null {\n    const holiday = getHoliday(date);\n    return holiday?.name[locale] ?? null;\n  }\n\n  /**\n   * Returns holidays for a given month.\n   * @param year - The full year (e.g. 2024).\n   * @param month - The month (1–12).\n   * @returns Array of DatedHoliday objects with the `date` field populated.\n   */\n  function getHolidaysByMonth(year: number, month: number): DatedHoliday[] {\n    const holidays = getHolidaysForYear(year);\n    return holidays\n      .filter((h) => h.month === month)\n      .map((h) => toDatedHoliday(h, new Date(year, h.month - 1, h.day)));\n  }\n\n  // ── Weekend & Business Days ───────────────────────────────────────────\n\n  /**\n   * Checks if a date falls on a weekend (Saturday or Sunday).\n   * @param date - The date to check.\n   */\n  function isWeekend(date: Date): boolean {\n    const day = date.getDay();\n    return day === 0 || day === 6;\n  }\n\n  /**\n   * Checks if a date is a business day (not a weekend and not a public holiday).\n   * @param date - The date to check.\n   */\n  function isBusinessDay(date: Date): boolean {\n    return !isWeekend(date) && !isHoliday(date);\n  }\n\n  /**\n   * Returns the next business day after the given date.\n   * Skips weekends and public holidays.\n   * @param date - The starting date (excluded from result).\n   */\n  function getNextBusinessDay(date: Date): Date {\n    const next = new Date(date);\n    do {\n      next.setDate(next.getDate() + 1);\n    } while (!isBusinessDay(next));\n    return next;\n  }\n\n  /**\n   * Adds (or subtracts) a number of business days to a date.\n   * Skips weekends and public holidays. Does not mutate the input date.\n   * @param date - The starting date.\n   * @param count - Number of business days to add. Use negative values to subtract.\n   * @returns A new Date that is `count` business days away.\n   */\n  function addBusinessDays(date: Date, count: number): Date {\n    const direction = count < 0 ? -1 : 1;\n    let current = new Date(date);\n    let remaining = Math.abs(count);\n    while (remaining > 0) {\n      current.setDate(current.getDate() + direction);\n      if (isBusinessDay(current)) {\n        remaining--;\n      }\n    }\n    return current;\n  }\n\n  /**\n   * Counts business days between two dates (exclusive of both endpoints).\n   * Order of arguments does not matter.\n   * @param from - One boundary date.\n   * @param to - The other boundary date.\n   * @returns Number of business days between `from` and `to`.\n   */\n  function countBusinessDays(from: Date, to: Date): number {\n    const start = from < to ? from : to;\n    const end = from < to ? to : from;\n    let count = 0;\n    const current = new Date(start);\n    current.setDate(current.getDate() + 1);\n    while (current < end) {\n      if (isBusinessDay(current)) {\n        count++;\n      }\n      current.setDate(current.getDate() + 1);\n    }\n    return count;\n  }\n\n  /**\n   * Returns the number of business days in a given month.\n   * @param year - The full year (e.g. 2024).\n   * @param month - The month (1–12).\n   */\n  function getBusinessDaysInMonth(year: number, month: number): number {\n    const daysInMonth = new Date(year, month, 0).getDate();\n    let count = 0;\n    for (let day = 1; day <= daysInMonth; day++) {\n      if (isBusinessDay(new Date(year, month - 1, day))) {\n        count++;\n      }\n    }\n    return count;\n  }\n\n  /**\n   * Returns the number of remaining business days in the month from the given date (inclusive).\n   * @param date - The starting date.\n   */\n  function getRemainingBusinessDays(date: Date): number {\n    const year = date.getFullYear();\n    const month = date.getMonth();\n    const daysInMonth = new Date(year, month + 1, 0).getDate();\n    let count = 0;\n    for (let day = date.getDate(); day <= daysInMonth; day++) {\n      if (isBusinessDay(new Date(year, month, day))) {\n        count++;\n      }\n    }\n    return count;\n  }\n\n  /**\n   * Checks if a date is the last business day of its month.\n   * Useful for payroll and invoicing deadlines.\n   * @param date - The date to check.\n   */\n  function isLastBusinessDayOfMonth(date: Date): boolean {\n    if (!isBusinessDay(date)) return false;\n    const year = date.getFullYear();\n    const month = date.getMonth();\n    const daysInMonth = new Date(year, month + 1, 0).getDate();\n    for (let day = date.getDate() + 1; day <= daysInMonth; day++) {\n      if (isBusinessDay(new Date(year, month, day))) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  // ── Holiday Navigation ────────────────────────────────────────────────\n\n  /**\n   * Returns the next public holiday on or after the given date.\n   * @param date - The starting date.\n   * @returns A DatedHoliday with the `date` field set.\n   */\n  function getNextHoliday(date: Date): DatedHoliday {\n    const current = new Date(date);\n    for (let i = 0; i < 366; i++) {\n      const holiday = getHoliday(current);\n      if (holiday) {\n        return toDatedHoliday(holiday, current);\n      }\n      current.setDate(current.getDate() + 1);\n    }\n    throw new Error('No holiday found within 366 days');\n  }\n\n  /**\n   * Returns the most recent public holiday on or before the given date.\n   * @param date - The starting date.\n   * @returns A DatedHoliday with the `date` field set.\n   */\n  function getPreviousHoliday(date: Date): DatedHoliday {\n    const current = new Date(date);\n    for (let i = 0; i < 366; i++) {\n      const holiday = getHoliday(current);\n      if (holiday) {\n        return toDatedHoliday(holiday, current);\n      }\n      current.setDate(current.getDate() - 1);\n    }\n    throw new Error('No holiday found within 366 days');\n  }\n\n  /**\n   * Returns all holidays within a date range (inclusive of both endpoints).\n   * Order of arguments does not matter.\n   * @param from - One boundary date.\n   * @param to - The other boundary date.\n   * @returns Array of DatedHoliday objects sorted chronologically.\n   */\n  function getHolidaysInRange(from: Date, to: Date): DatedHoliday[] {\n    const start = from < to ? from : to;\n    const end = from < to ? to : from;\n    const result: DatedHoliday[] = [];\n    const current = new Date(start);\n    while (current <= end) {\n      const holiday = getHoliday(current);\n      if (holiday) {\n        result.push(toDatedHoliday(holiday, current));\n      }\n      current.setDate(current.getDate() + 1);\n    }\n    return result;\n  }\n\n  /**\n   * Checks if a date is the day before a public holiday (holiday eve).\n   * @param date - The date to check.\n   */\n  function isHolidayEve(date: Date): boolean {\n    const next = new Date(date);\n    next.setDate(next.getDate() + 1);\n    return isHoliday(next);\n  }\n\n  // ── Shop Restrictions ─────────────────────────────────────────────────\n\n  /**\n   * Checks if shops are fully closed on a given date (large retail >200m²).\n   * Returns `true` for holidays with `HolidayShopRestriction.Closed`.\n   * Returns `false` for non-holidays, Open holidays, and Partial restriction days.\n   * @param date - The date to check.\n   */\n  function areShopsClosed(date: Date): boolean {\n    const holiday = getHoliday(date);\n    return holiday?.shopRestriction === HolidayShopRestriction.Closed;\n  }\n\n  /**\n   * Checks if shops have any restriction on a given date.\n   * Returns `true` for holidays with `Closed` or `Partial` shop restrictions.\n   * @param date - The date to check.\n   */\n  function areShopsRestricted(date: Date): boolean {\n    const holiday = getHoliday(date);\n    if (!holiday) return false;\n    return holiday.shopRestriction === HolidayShopRestriction.Closed\n      || holiday.shopRestriction === HolidayShopRestriction.Partial;\n  }\n\n  /**\n   * Returns the shop restriction for a given date.\n   * @param date - The date to check.\n   * @returns The `HolidayShopRestriction` value, or `null` if not a holiday.\n   */\n  function getShopRestriction(date: Date): HolidayShopRestriction | null {\n    const holiday = getHoliday(date);\n    return holiday?.shopRestriction ?? null;\n  }\n\n  // ── Long Weekends & Bridge Days ───────────────────────────────────────\n\n  /**\n   * Finds all long weekends in a given year — continuous stretches of 3+ non-working days\n   * (weekends and holidays) that include at least one public holiday.\n   * @param year - The full year (e.g. 2024).\n   * @returns Array of LongWeekend objects sorted chronologically.\n   */\n  function getLongWeekends(year: number): LongWeekend[] {\n    const holidays = getHolidaysForYear(year);\n    const result: LongWeekend[] = [];\n    const processed = new Set<string>();\n\n    for (const holiday of holidays) {\n      const holidayDate = new Date(year, holiday.month - 1, holiday.day);\n      const dateKey = holidayDate.toISOString();\n      if (processed.has(dateKey)) continue;\n\n      // Expand backward to find the start of the non-working stretch\n      const start = new Date(holidayDate);\n      while (true) {\n        const prev = new Date(start);\n        prev.setDate(prev.getDate() - 1);\n        if (isWeekend(prev) || isHoliday(prev)) {\n          start.setDate(start.getDate() - 1);\n        } else {\n          break;\n        }\n      }\n\n      // Expand forward to find the end\n      const end = new Date(holidayDate);\n      while (true) {\n        const next = new Date(end);\n        next.setDate(next.getDate() + 1);\n        if (isWeekend(next) || isHoliday(next)) {\n          end.setDate(end.getDate() + 1);\n        } else {\n          break;\n        }\n      }\n\n      const days = Math.round((end.getTime() - start.getTime()) / (1000 * 60 * 60 * 24)) + 1;\n      if (days >= 3) {\n        // Collect all holidays in this stretch\n        const stretchHolidays: DatedHoliday[] = [];\n        const cursor = new Date(start);\n        while (cursor <= end) {\n          const h = getHoliday(cursor);\n          if (h) {\n            stretchHolidays.push(toDatedHoliday(h, cursor));\n            processed.add(cursor.toISOString());\n          }\n          cursor.setDate(cursor.getDate() + 1);\n        }\n\n        result.push({\n          start: new Date(start),\n          end: new Date(end),\n          days,\n          holidays: stretchHolidays\n        });\n      }\n    }\n\n    // Deduplicate (multiple holidays can belong to the same long weekend)\n    const seen = new Set<string>();\n    return result.filter((lw) => {\n      const key = lw.start.toISOString();\n      if (seen.has(key)) return false;\n      seen.add(key);\n      return true;\n    });\n  }\n\n  /**\n   * Finds bridge days in a given year — single working days that, if taken off,\n   * connect a holiday with a weekend to create a longer break.\n   * @param year - The full year (e.g. 2024).\n   * @returns Array of BridgeDay objects sorted chronologically.\n   */\n  function getBridgeDays(year: number): BridgeDay[] {\n    const result: BridgeDay[] = [];\n    const startDate = new Date(year, 0, 1);\n    const endDate = new Date(year, 11, 31);\n    const current = new Date(startDate);\n\n    while (current <= endDate) {\n      if (isBusinessDay(current)) {\n        const prev = new Date(current);\n        prev.setDate(prev.getDate() - 1);\n        const next = new Date(current);\n        next.setDate(next.getDate() + 1);\n\n        const prevOff = isWeekend(prev) || isHoliday(prev);\n        const nextOff = isWeekend(next) || isHoliday(next);\n\n        if (prevOff && nextOff) {\n          // Expand backward to find full stretch start\n          const stretchStart = new Date(prev);\n          while (true) {\n            const before = new Date(stretchStart);\n            before.setDate(before.getDate() - 1);\n            if (isWeekend(before) || isHoliday(before)) {\n              stretchStart.setDate(stretchStart.getDate() - 1);\n            } else {\n              break;\n            }\n          }\n\n          // Expand forward to find full stretch end\n          const stretchEnd = new Date(next);\n          while (true) {\n            const after = new Date(stretchEnd);\n            after.setDate(after.getDate() + 1);\n            if (isWeekend(after) || isHoliday(after)) {\n              stretchEnd.setDate(stretchEnd.getDate() + 1);\n            } else {\n              break;\n            }\n          }\n\n          // Collect surrounding holidays\n          const surroundingHolidays: DatedHoliday[] = [];\n          const cursor = new Date(stretchStart);\n          while (cursor <= stretchEnd) {\n            const h = getHoliday(cursor);\n            if (h) {\n              surroundingHolidays.push(toDatedHoliday(h, cursor));\n            }\n            cursor.setDate(cursor.getDate() + 1);\n          }\n\n          const totalDaysOff = Math.round(\n            (stretchEnd.getTime() - stretchStart.getTime()) / (1000 * 60 * 60 * 24)\n          ) + 1;\n\n          result.push({\n            date: new Date(current),\n            surroundingHolidays,\n            totalDaysOff\n          });\n        }\n      }\n      current.setDate(current.getDate() + 1);\n    }\n\n    return result;\n  }\n\n  return {\n    // Core\n    isHoliday,\n    getHolidayName,\n    getHoliday,\n    getHolidaysForYear,\n    getHolidaysByMonth,\n    // Weekend & Business Days\n    isWeekend,\n    isBusinessDay,\n    getNextBusinessDay,\n    addBusinessDays,\n    countBusinessDays,\n    getBusinessDaysInMonth,\n    getRemainingBusinessDays,\n    isLastBusinessDayOfMonth,\n    // Holiday Navigation\n    getNextHoliday,\n    getPreviousHoliday,\n    getHolidaysInRange,\n    isHolidayEve,\n    // Shop Restrictions\n    areShopsClosed,\n    areShopsRestricted,\n    getShopRestriction,\n    // Long Weekends & Bridge Days\n    getLongWeekends,\n    getBridgeDays,\n  };\n})();\n\nexport default CzechHolidays;\n"],"names":["HolidayShopRestriction","HolidaySupportedLocales","calculateEasterHolidays","year","a","b","c","d","e","f","h","i","k","l","m","month","day","easterSunday","goodFriday","easterMonday","getEasterHolidays","easterHolidays","getFixedHolidays","CzechHolidays","fixedHolidays","cache","mapCache","getHolidayMap","map","holidays","getHolidaysForYear","getMapKey","date","toDatedHoliday","holiday","isHoliday","key","getHoliday","getHolidayName","locale","getHolidaysByMonth","isWeekend","isBusinessDay","getNextBusinessDay","next","addBusinessDays","count","direction","current","remaining","countBusinessDays","from","to","start","end","getBusinessDaysInMonth","daysInMonth","getRemainingBusinessDays","isLastBusinessDayOfMonth","getNextHoliday","getPreviousHoliday","getHolidaysInRange","result","isHolidayEve","areShopsClosed","areShopsRestricted","getShopRestriction","getLongWeekends","processed","holidayDate","dateKey","prev","days","stretchHolidays","cursor","seen","lw","getBridgeDays","startDate","endDate","prevOff","nextOff","stretchStart","before","stretchEnd","after","surroundingHolidays","totalDaysOff"],"mappings":"4GAoBO,IAAKA,GAAAA,IACVA,EAAAA,EAAA,KAAA,CAAA,EAAA,OACAA,EAAAA,EAAA,OAAA,CAAA,EAAA,SACAA,EAAAA,EAAA,QAAA,CAAA,EAAA,UAHUA,IAAAA,GAAA,CAAA,CAAA,EAMAC,GAAAA,IACVA,EAAA,MAAQ,KACRA,EAAA,QAAU,KAFAA,IAAAA,GAAA,CAAA,CAAA,ECpBL,SAASC,EAAwBC,EAA2B,CACjE,MAAMC,EAAID,EAAO,GACXE,EAAI,KAAK,MAAMF,EAAO,GAAG,EACzBG,EAAIH,EAAO,IACXI,EAAI,KAAK,MAAMF,EAAI,CAAC,EACpBG,EAAIH,EAAI,EACRI,EAAI,KAAK,OAAOJ,EAAI,GAAK,EAAE,EAC3B,EAAI,KAAK,OAAOA,EAAII,EAAI,GAAK,CAAC,EAC9BC,GAAK,GAAKN,EAAIC,EAAIE,EAAI,EAAI,IAAM,GAChCI,EAAI,KAAK,MAAML,EAAI,CAAC,EACpBM,EAAIN,EAAI,EACRO,GAAK,GAAK,EAAIL,EAAI,EAAIG,EAAID,EAAIE,GAAK,EACnCE,EAAI,KAAK,OAAOV,EAAI,GAAKM,EAAI,GA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