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xD,OAAO,YAAY,UAAU,QAAQ,2BAA4B,EACnE,EAEA,YAAY,UAAU,0BAA4B,SAAS,GACzD,OAAO,YAAY,UAAU,QAAQ,4BAA6B,EACpE,EAEA,YAAY,UAAU,UAAY,SAAS,GACzC,OAAO,YAAY,UAAU,QAAQ,YAAa,EACpD,EAEA,OAAO,QAAU,IAAI","file":"/npm/feiertage@1.2.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.19.2.\n * Original file: /npm/feiertage@1.2.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var FeiertageJS = function() {};\r\nFeiertageJS.prototype.Holidays = require('./model');\r\n\r\nFeiertageJS.prototype.year = new Date().getFullYear();\r\nFeiertageJS.prototype.state = 'DE';\r\n\r\n/**\r\n * Creates a Date object.\r\n * @param {number} day - Day as a number.\r\n * @param {number} month - Month as a number (don't substract 1).\r\n * @param {number} year - Year as a number.\r\n * @returns {object} Date - Returns a Javascript Date object.\r\n * */\r\nFeiertageJS.prototype.createDate = function(day, month, year) {\r\n  year = typeof year !== 'undefined' ? year : this.year;\r\n  return new Date(Date.UTC(year, month - 1, day));\r\n};\r\n\r\n/**\r\n * Calculate the easter date with Gaussian's formula.\r\n * @param {number} year - Overwrites the current year.\r\n * @returns {object} easter_date - Returns an object with month = 3 and the days as integer possibly bigger than 31.\r\n * */\r\nFeiertageJS.prototype.gaussianEaster = function(year) {\r\n  var a = year % 19,\r\n    b = year % 4,\r\n    c = year % 7,\r\n    k = Math.floor(year / 100),\r\n    p = Math.floor((8 * k + 13) / 25),\r\n    q = Math.floor(k / 4),\r\n    M = (15 + k - p - q) % 30,\r\n    d = (19 * a + M) % 30,\r\n    N = (4 + k - q) % 7,\r\n    e = (2 * b + 4 * c + 6 * d + N) % 7,\r\n    easter_date = 22 + d + e;\r\n  return {\r\n    day: easter_date,\r\n    month: 3\r\n  };\r\n};\r\n\r\n/**\r\n * Calculate the easter date with Gaussian's formula corrected by Lichtenberg.\r\n * @param {number} year - Overwrites the current year.\r\n * @returns {object} easter_date - Returns an object with month = 3 and the days as integer, possibly bigger than 31.\r\n * */\r\nFeiertageJS.prototype.gaussianEasterByLichterberg = function(year) {\r\n  var K = Math.floor(year / 100),\r\n    M = 15 + Math.floor((3 * K + 3) / 4) - Math.floor((8 * K + 13) / 25),\r\n    S = 2 - Math.floor((3 * K + 3) / 4),\r\n    A = year % 19,\r\n    D = (19 * A + M) % 30,\r\n    R = Math.floor((D + Math.floor(A / 11)) / 29),\r\n    OG = 21 + D - R,\r\n    SZ = 7 - (year + Math.floor(year / 4) + S) % 7,\r\n    OE = 7 - (OG - SZ) % 7,\r\n    OS = OG + OE;\r\n  return {\r\n    day: OS,\r\n    month: 3\r\n  };\r\n};\r\n\r\nFeiertageJS.prototype.States = [\r\n  'DE', // Deutschland\r\n  'BW', // Baden-Württemberg\r\n  'BY', // Bayern\r\n  'BE', // Berlin\r\n  'BB', // Brandenburg\r\n  'HB', // Bremen\r\n  'HH', // Hamburg\r\n  'HE', // Hessen\r\n  'NI', // Niedersachsen\r\n  'MV', // Mecklenburg-Vorpommern\r\n  'NW', // Nordrhein-Westfalen\r\n  'RP', // Rheinland-Pfalz\r\n  'SL', // Saarland\r\n  'SN', // Sachsen\r\n  'ST', // Sachsen-Anhalt\r\n  'SH', // Schleswig-Holstein\r\n  'TH', // Thüringen\r\n  'BY-FF', // Bayern, Friedensfest, Stadt Augsburg\r\n  'BY-MH', // Bayern, überwiegend katholische Bevölkerung\r\n  'SN-FL', // Sachsen, Bautzen\r\n  'TH-FL' // Thüringen, Eichsfeld, Unstrut-Hainich, Wartburgkreis\r\n];\r\n\r\n/**\r\n * Returns the calculated non-business day identified by holidayId.\r\n * @param {string} holidayId - The identifier for the holiday.\r\n * @param {number} year - Overwrites the current year.\r\n * @returns {object} Date - The calculated date as a Date object.\r\n * */\r\nFeiertageJS.prototype.getDate = function(holidayId, year) {\r\n  year = typeof year !== 'undefined' ? year : this.year;\r\n\r\n  var theHoliday = {};\r\n\r\n  FeiertageJS.prototype.Holidays.forEach(function(holiday) {\r\n    if (holiday.id == holidayId) {\r\n      theHoliday = holiday;\r\n    }\r\n  });\r\n\r\n  return theHoliday.calc(year, this.gaussianEasterByLichterberg(year));\r\n};\r\n\r\n/**\r\n * Creates a list the non-business days for all or a specific state.\r\n * @param {number} year - Overwrites the current year.\r\n * @param {string} state - An identifier for the state.\r\n * @return {array} dates - The list of the calculated non-business days.\r\n * */\r\nFeiertageJS.prototype.asList = function(year, state) {\r\n  year = typeof year !== 'undefined' ? year : this.year;\r\n  state =\r\n    typeof state !== 'undefined' &&\r\n    FeiertageJS.prototype.States.indexOf(state.toUpperCase()) > -1\r\n      ? state.toUpperCase()\r\n      : this.state;\r\n\r\n  var easter_date = this.gaussianEasterByLichterberg(year);\r\n  var days = [];\r\n\r\n  this.Holidays.forEach(function(holiday) {\r\n    if (holiday.type != 'full') return;\r\n\r\n    var generallyValid = false;\r\n    var exceptionallyValid = false;\r\n\r\n    generallyValid = holiday.valid.indexOf(state) > -1 ? true : generallyValid;\r\n    if (\r\n      holiday.hasOwnProperty('exceptions') &&\r\n      holiday.exceptions.hasOwnProperty(year) &&\r\n      holiday.exceptions[year].indexOf(state.toUpperCase()) > -1\r\n    ) {\r\n      exceptionallyValid = true;\r\n    }\r\n\r\n    if (generallyValid || exceptionallyValid) {\r\n      days.push({\r\n        id: holiday.id,\r\n        label: holiday.label,\r\n        date: holiday.calc(year, easter_date)\r\n      });\r\n    }\r\n  });\r\n\r\n  return days;\r\n};\r\n\r\n/**\r\n * Creates a list of the non-business days falling on monday to friday.\r\n * @param {number} year - Overwrites the current year.\r\n * @param {string} state - An identifier for the state.\r\n * @return {array} dates - The list of the non-business days on workdays.\r\n * */\r\nFeiertageJS.prototype.asListOfWorkdays = function(year, state) {\r\n  year = typeof year !== 'undefined' ? year : this.year;\r\n  state =\r\n    typeof state !== 'undefined' &&\r\n    FeiertageJS.prototype.States.indexOf(state.toUpperCase()) > -1\r\n      ? state.toUpperCase()\r\n      : this.state;\r\n\r\n  var holidays = this.asList(year, state);\r\n  var workdays = [];\r\n\r\n  holidays.forEach(function(holiday) {\r\n    var weekday = holiday.date.getDay();\r\n    if (weekday > 0 && weekday < 6) {\r\n      workdays.push(holiday);\r\n    }\r\n  });\r\n\r\n  return workdays;\r\n};\r\n\r\n/* Sugar for the user. */\r\n\r\nFeiertageJS.prototype.Neujahr = function(year) {\r\n  return FeiertageJS.prototype.getDate('neujahr', year);\r\n};\r\n\r\nFeiertageJS.prototype.HeiligeDreiKoenige = function(year) {\r\n  return FeiertageJS.prototype.getDate('heiligedreikoenige', year);\r\n};\r\n\r\nFeiertageJS.prototype.Karfreitag = function(year) {\r\n  return FeiertageJS.prototype.getDate('karfreitag', year);\r\n};\r\n\r\nFeiertageJS.prototype.Ostersonntag = function(year) {\r\n  return FeiertageJS.prototype.getDate('ostersonntag', year);\r\n};\r\n\r\nFeiertageJS.prototype.Ostermontag = function(year) {\r\n  return FeiertageJS.prototype.getDate('ostermontag', year);\r\n};\r\n\r\nFeiertageJS.prototype.TagDerArbeit = function(year) {\r\n  return FeiertageJS.prototype.getDate('tagderarbeit', year);\r\n};\r\n\r\nFeiertageJS.prototype.ChristiHimmelfahrt = function(year) {\r\n  return FeiertageJS.prototype.getDate('christihimmelfahrt', year);\r\n};\r\n\r\nFeiertageJS.prototype.Pfingstsonntag = function(year) {\r\n  return FeiertageJS.prototype.getDate('pfingstsonntag', year);\r\n};\r\n\r\nFeiertageJS.prototype.Pfingstmontag = function(year) {\r\n  return FeiertageJS.prototype.getDate('pfingstmontag', year);\r\n};\r\n\r\nFeiertageJS.prototype.Fronleichnam = function(year) {\r\n  return FeiertageJS.prototype.getDate('fronleichnam', year);\r\n};\r\n\r\nFeiertageJS.prototype.MariaHimmelfahrt = function(year) {\r\n  return FeiertageJS.prototype.getDate('mariahimmelfahrt', year);\r\n};\r\n\r\nFeiertageJS.prototype.TagDerDeutschenEinheit = function(year) {\r\n  return FeiertageJS.prototype.getDate('tagderdeutscheneinheit', year);\r\n};\r\n\r\nFeiertageJS.prototype.Reformationstag = function(year) {\r\n  return FeiertageJS.prototype.getDate('reformationstag', year);\r\n};\r\n\r\nFeiertageJS.prototype.Allerheiligen = function(year) {\r\n  return FeiertageJS.prototype.getDate('allerheiligen', year);\r\n};\r\n\r\nFeiertageJS.prototype.BußUndBettag = function(year) {\r\n  return FeiertageJS.prototype.getDate('bußundbettag', year);\r\n};\r\n\r\nFeiertageJS.prototype.Heiligabend = function(year) {\r\n  return FeiertageJS.prototype.getDate('heiligabend', year);\r\n};\r\n\r\nFeiertageJS.prototype.ErsterWeihnachtsfeiertag = function(year) {\r\n  return FeiertageJS.prototype.getDate('ersterweihnachtsfeiertag', year);\r\n};\r\n\r\nFeiertageJS.prototype.ZweiterWeihnachtsfeiertag = function(year) {\r\n  return FeiertageJS.prototype.getDate('zweiterweihnachtsfeiertag', year);\r\n};\r\n\r\nFeiertageJS.prototype.Silvester = function(year) {\r\n  return FeiertageJS.prototype.getDate('silvester', year);\r\n};\r\n\r\nmodule.exports = new FeiertageJS();\r\n"]}