{"version":3,"sources":["../src/index.ts"],"sourcesContent":["const getNovFirst = (year: number = new Date().getFullYear()): Date => new Date(year, 10, 1);\n\nconst getFirstThursday = (year: number = new Date().getFullYear()): Date => {\n  const novFirst = getNovFirst(year);\n  const dayOfWeek = novFirst.getDay();\n  const daysToAdd = dayOfWeek <= 4 ? 4 - dayOfWeek : 11 - dayOfWeek;\n  return new Date(novFirst.getFullYear(), novFirst.getMonth(), novFirst.getDate() + daysToAdd);\n};\n\nexport const thanksgiving = (year: number = new Date().getFullYear()): Date => {\n  const firstThursday = getFirstThursday(year);\n  return new Date(firstThursday.getFullYear(), firstThursday.getMonth(), firstThursday.getDate() + 21);\n};\n\nexport const blackFriday = (year: number = new Date().getFullYear()): Date => {\n  const thanksgivingDate = thanksgiving(year);\n  return new Date(thanksgivingDate.getFullYear(), thanksgivingDate.getMonth(), thanksgivingDate.getDate() + 1);\n};\n\nexport const cyberMonday = (year: number = new Date().getFullYear()): Date => {\n  const thanksgivingDate = thanksgiving(year);\n  return new Date(thanksgivingDate.getFullYear(), thanksgivingDate.getMonth(), thanksgivingDate.getDate() + 4);\n};\n\nconst daysUntil = (eventDate: Date): number => {\n  const today = new Date();\n  today.setHours(0, 0, 0, 0);\n  eventDate.setHours(0, 0, 0, 0);\n\n  return Math.ceil((eventDate.getTime() - today.getTime()) / (1000 * 3600 * 24));\n};\n\nexport const daysUntilThanksgiving = (year: number = new Date().getFullYear()): number => {\n  return daysUntil(thanksgiving(year));\n};\n\nexport const daysUntilBlackFriday = (year: number = new Date().getFullYear()): number => {\n  return daysUntil(blackFriday(year));\n};\n\nexport const daysUntilCyberMonday = (year: number = new Date().getFullYear()): number => {\n  return daysUntil(cyberMonday(year));\n};\n"],"mappings":";AAAA,IAAM,cAAc,CAAC,QAAe,oBAAI,KAAK,GAAE,YAAY,MAAY,IAAI,KAAK,MAAM,IAAI,CAAC;AAE3F,IAAM,mBAAmB,CAAC,QAAe,oBAAI,KAAK,GAAE,YAAY,MAAY;AAC1E,Q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