{"version":3,"file":"index.cjs","sources":[""],"sourcesContent":["import { _getDateValue } from \"../_dateValue/index.ts\";\nimport type { TDateInput } from \"../_dateValue/index.ts\";\n\nexport type TGetDateFormattedArgs = Parameters<typeof getDateFormatted>;\n\nexport type TGetDateFormattedReturn = ReturnType<typeof getDateFormatted>;\n\n/**\n * Formats a date using `Intl.DateTimeFormat`.\n * @param {TDateInput} date Source date\n * @param {Intl.LocalesArgument} [locales] Locale or locales\n * @param {Intl.DateTimeFormatOptions} [options={}] Date format options\n * @returns {string} Localized date\n * @throws {TypeError} getDateFormatted: date must be a valid date\n * @example\n * getDateFormatted(new Date(\"2024-01-02T00:00:00Z\"), \"en-US\", { timeZone: \"UTC\" });\n * @example\n * // Format an order date for a Russian storefront\n * const label = getDateFormatted(order.createdAt, \"ru-RU\", {\n *   dateStyle: \"long\",\n *   timeZone: \"Europe/Moscow\",\n * });\n */\nexport const getDateFormatted = (\n  date: TDateInput,\n  locales?: Intl.LocalesArgument,\n  options: Intl.DateTimeFormatOptions = {}\n): string => {\n  if (!options || typeof options !== \"object\" || Array.isArray(options)) {\n    throw new TypeError(\"getDateFormatted: options must be a plain object\");\n  }\n  return new Intl.DateTimeFormat(locales, options).format(_getDateValue(date, getDateFormatted.name));\n};\n"],"names":["getDateFormatted","date","locales","options","Array","isArray","TypeError","Intl","DateTimeFormat","format","_getDateValue","name"],"mappings":"sGAuBO,MAAMA,iBAAmB,CAC9BC,KACAC,QACAC,QAAsC,CAAA,KAEtC,IAAKA,gBAAkBA,UAAY,UAAYC,MAAMC,QAAQF,SAC3D,MAAM,IAAIG,UAAU,oDAEtB,OAAO,IAAIC,KAAKC,eAAeN,QAASC,SAASM,OAAOC,oBAAcT,KAAMD,iBAAiBW"}