{"ast":null,"code":"import { addDays } from \"./addDays.mjs\";\nimport { addMonths } from \"./addMonths.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.\n *\n * | Key            | Description                        |\n * |----------------|------------------------------------|\n * | years          | Amount of years to be added        |\n * | months         | Amount of months to be added       |\n * | weeks          | Amount of weeks to be added        |\n * | days           | Amount of days to be added         |\n * | hours          | Amount of hours to be added        |\n * | minutes        | Amount of minutes to be added      |\n * | seconds        | Amount of seconds to be added      |\n *\n * All values default to 0\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n *   years: 2,\n *   months: 9,\n *   weeks: 1,\n *   days: 7,\n *   hours: 5,\\\\-7\n *   minutes: 9,\n *   seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nexport function add(date, duration) {\n  const {\n    years = 0,\n    months = 0,\n    weeks = 0,\n    days = 0,\n    hours = 0,\n    minutes = 0,\n    seconds = 0\n  } = duration;\n\n  // Add years and months\n  const _date = toDate(date);\n  const dateWithMonths = months || years ? addMonths(_date, months + years * 12) : _date;\n\n  // Add weeks and days\n  const dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n  // Add days, hours, minutes and seconds\n  const minutesToAdd = minutes + hours * 60;\n  const secondsToAdd = seconds + minutesToAdd * 60;\n  const msToAdd = secondsToAdd * 1000;\n  const finalDate = constructFrom(date, dateWithDays.getTime() + msToAdd);\n  return finalDate;\n}\n\n// Fallback for modularized imports:\nexport default add;","map":{"version":3,"names":["addDays","addMonths","constructFrom","toDate","add","date","duration","years","months","weeks","days","hours","minutes","seconds","_date","dateWithMonths","dateWithDays","minutesToAdd","secondsToAdd","msToAdd","finalDate","getTime"],"sources":["/root/rfcontavagas_hom/12.-Servidor-local-Docker/Front-Parking-Angular/node_modules/date-fns/add.mjs"],"sourcesContent":["import { addDays } from \"./addDays.mjs\";\nimport { addMonths } from \"./addMonths.mjs\";\nimport { constructFrom } from \"./constructFrom.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added.\n *\n * | Key            | Description                        |\n * |----------------|------------------------------------|\n * | years          | Amount of years to be added        |\n * | months         | Amount of months to be added       |\n * | weeks          | Amount of weeks to be added        |\n * | days           | Amount of days to be added         |\n * | hours          | Amount of hours to be added        |\n * | minutes        | Amount of minutes to be added      |\n * | seconds        | Amount of seconds to be added      |\n *\n * All values default to 0\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n *   years: 2,\n *   months: 9,\n *   weeks: 1,\n *   days: 7,\n *   hours: 5,\\\\-7\n *   minutes: 9,\n *   seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nexport function add(date, duration) {\n  const {\n    years = 0,\n    months = 0,\n    weeks = 0,\n    days = 0,\n    hours = 0,\n    minutes = 0,\n    seconds = 0,\n  } = duration;\n\n  // Add years and months\n  const _date = toDate(date);\n  const dateWithMonths =\n    months || years ? addMonths(_date, months + years * 12) : _date;\n\n  // Add weeks and days\n  const dateWithDays =\n    days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n  // Add days, hours, minutes and seconds\n  const minutesToAdd = minutes + hours * 60;\n  const secondsToAdd = seconds + minutesToAdd * 60;\n  const msToAdd = secondsToAdd * 1000;\n  const finalDate = constructFrom(date, dateWithDays.getTime() + msToAdd);\n\n  return finalDate;\n}\n\n// Fallback for modularized imports:\nexport default add;\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,eAAe;AACvC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,MAAM,QAAQ,cAAc;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,GAAGA,CAACC,IAAI,EAAEC,QAAQ,EAAE;EAClC,MAAM;IACJC,KAAK,GAAG,CAAC;IACTC,MAAM,GAAG,CAAC;IACVC,KAAK,GAAG,CAAC;IACTC,IAAI,GAAG,CAAC;IACRC,KAAK,GAAG,CAAC;IACTC,OAAO,GAAG,CAAC;IACXC,OAAO,GAAG;EACZ,CAAC,GAAGP,QAAQ;;EAEZ;EACA,MAAMQ,KAAK,GAAGX,MAAM,CAACE,IAAI,CAAC;EAC1B,MAAMU,cAAc,GAClBP,MAAM,IAAID,KAAK,GAAGN,SAAS,CAACa,KAAK,EAAEN,MAAM,GAAGD,KAAK,GAAG,EAAE,CAAC,GAAGO,KAAK;;EAEjE;EACA,MAAME,YAAY,GAChBN,IAAI,IAAID,KAAK,GAAGT,OAAO,CAACe,cAAc,EAAEL,IAAI,GAAGD,KAAK,GAAG,CAAC,CAAC,GAAGM,cAAc;;EAE5E;EACA,MAAME,YAAY,GAAGL,OAAO,GAAGD,KAAK,GAAG,EAAE;EACzC,MAAMO,YAAY,GAAGL,OAAO,GAAGI,YAAY,GAAG,EAAE;EAChD,MAAME,OAAO,GAAGD,YAAY,GAAG,IAAI;EACnC,MAAME,SAAS,GAAGlB,aAAa,CAACG,IAAI,EAAEW,YAAY,CAACK,OAAO,CAAC,CAAC,GAAGF,OAAO,CAAC;EAEvE,OAAOC,SAAS;AAClB;;AAEA;AACA,eAAehB,GAAG","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}