{"version":3,"sources":["node_modules/@angular/material-luxon-adapter/fesm2022/material-luxon-adapter.mjs"],"sourcesContent":["import * as i0 from '@angular/core';\nimport { InjectionToken, Injectable, Optional, Inject, NgModule } from '@angular/core';\nimport { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS } from '@angular/material/core';\nimport { DateTime, Info } from 'luxon';\n\n/** InjectionToken for LuxonDateAdapter to configure options. */\nconst MAT_LUXON_DATE_ADAPTER_OPTIONS = /*#__PURE__*/new InjectionToken('MAT_LUXON_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY\n});\n/** @docs-private */\nfunction MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY() {\n return {\n useUtc: false,\n firstDayOfWeek: 0,\n defaultOutputCalendar: 'gregory'\n };\n}\n/** Creates an array and fills it with values. */\nfunction range(length, valueFunction) {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n/** Adapts Luxon Dates for use with Angular Material. */\nlet LuxonDateAdapter = /*#__PURE__*/(() => {\n class LuxonDateAdapter extends DateAdapter {\n constructor(dateLocale, options) {\n super();\n this._useUTC = !!options?.useUtc;\n this._firstDayOfWeek = options?.firstDayOfWeek || 0;\n this._defaultOutputCalendar = options?.defaultOutputCalendar || 'gregory';\n this.setLocale(dateLocale || DateTime.local().locale);\n }\n getYear(date) {\n return date.year;\n }\n getMonth(date) {\n // Luxon works with 1-indexed months whereas our code expects 0-indexed.\n return date.month - 1;\n }\n getDate(date) {\n return date.day;\n }\n getDayOfWeek(date) {\n return date.weekday;\n }\n getMonthNames(style) {\n // Adding outputCalendar option, because LuxonInfo doesn't get effected by LuxonSettings\n return Info.months(style, {\n locale: this.locale,\n outputCalendar: this._defaultOutputCalendar\n });\n }\n getDateNames() {\n // At the time of writing, Luxon doesn't offer similar\n // functionality so we have to fall back to the Intl API.\n const dtf = new Intl.DateTimeFormat(this.locale, {\n day: 'numeric',\n timeZone: 'utc'\n });\n // Format a UTC date in order to avoid DST issues.\n return range(31, i => dtf.format(DateTime.utc(2017, 1, i + 1).toJSDate()));\n }\n getDayOfWeekNames(style) {\n // Note that we shift the array once, because Luxon returns Monday as the\n // first day of the week, whereas our logic assumes that it's Sunday. See:\n // https://moment.github.io/luxon/api-docs/index.html#infoweekdays\n const days = Info.weekdays(style, {\n locale: this.locale\n });\n days.unshift(days.pop());\n return days;\n }\n getYearName(date) {\n return date.toFormat('yyyy', this._getOptions());\n }\n getFirstDayOfWeek() {\n return this._firstDayOfWeek;\n }\n getNumDaysInMonth(date) {\n return date.daysInMonth;\n }\n clone(date) {\n return DateTime.fromObject(date.toObject(), this._getOptions());\n }\n createDate(year, month, date) {\n const options = this._getOptions();\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n // Luxon uses 1-indexed months so we need to add one to the month.\n const result = this._useUTC ? DateTime.utc(year, month + 1, date, options) : DateTime.local(year, month + 1, date, options);\n if (!this.isValid(result)) {\n throw Error(`Invalid date \"${date}\". Reason: \"${result.invalidReason}\".`);\n }\n return result;\n }\n today() {\n const options = this._getOptions();\n return this._useUTC ? DateTime.utc(options) : DateTime.local(options);\n }\n parse(value, parseFormat) {\n const options = this._getOptions();\n if (typeof value == 'string' && value.length > 0) {\n const iso8601Date = DateTime.fromISO(value, options);\n if (this.isValid(iso8601Date)) {\n return iso8601Date;\n }\n const formats = Array.isArray(parseFormat) ? parseFormat : [parseFormat];\n if (!parseFormat.length) {\n throw Error('Formats array must not be empty.');\n }\n for (const format of formats) {\n const fromFormat = DateTime.fromFormat(value, format, options);\n if (this.isValid(fromFormat)) {\n return fromFormat;\n }\n }\n return this.invalid();\n } else if (typeof value === 'number') {\n return DateTime.fromMillis(value, options);\n } else if (value instanceof Date) {\n return DateTime.fromJSDate(value, options);\n } else if (value instanceof DateTime) {\n return DateTime.fromMillis(value.toMillis(), options);\n }\n return null;\n }\n format(date, displayFormat) {\n if (!this.isValid(date)) {\n throw Error('LuxonDateAdapter: Cannot format invalid date.');\n }\n if (this._useUTC) {\n return date.setLocale(this.locale).setZone('utc').toFormat(displayFormat);\n } else {\n return date.setLocale(this.locale).toFormat(displayFormat);\n }\n }\n addCalendarYears(date, years) {\n return date.reconfigure(this._getOptions()).plus({\n years\n });\n }\n addCalendarMonths(date, months) {\n return date.reconfigure(this._getOptions()).plus({\n months\n });\n }\n addCalendarDays(date, days) {\n return date.reconfigure(this._getOptions()).plus({\n days\n });\n }\n toIso8601(date) {\n return date.toISO();\n }\n /**\n * Returns the given value if given a valid Luxon or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid DateTime and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value) {\n const options = this._getOptions();\n let date;\n if (value instanceof Date) {\n date = DateTime.fromJSDate(value, options);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = DateTime.fromISO(value, options);\n }\n if (date && this.isValid(date)) {\n return date;\n }\n return super.deserialize(value);\n }\n isDateInstance(obj) {\n return obj instanceof DateTime;\n }\n isValid(date) {\n return date.isValid;\n }\n invalid() {\n return DateTime.invalid('Invalid Luxon DateTime object.');\n }\n /** Gets the options that should be used when constructing a new `DateTime` object. */\n _getOptions() {\n return {\n zone: this._useUTC ? 'utc' : undefined,\n locale: this.locale,\n outputCalendar: this._defaultOutputCalendar\n };\n }\n static {\n this.ɵfac = function LuxonDateAdapter_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || LuxonDateAdapter)(i0.ɵɵinject(MAT_DATE_LOCALE, 8), i0.ɵɵinject(MAT_LUXON_DATE_ADAPTER_OPTIONS, 8));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: LuxonDateAdapter,\n factory: LuxonDateAdapter.ɵfac\n });\n }\n }\n return LuxonDateAdapter;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nconst MAT_LUXON_DATE_FORMATS = {\n parse: {\n dateInput: 'D'\n },\n display: {\n dateInput: 'D',\n monthYearLabel: 'LLL yyyy',\n dateA11yLabel: 'DD',\n monthYearA11yLabel: 'LLLL yyyy'\n }\n};\nlet LuxonDateModule = /*#__PURE__*/(() => {\n class LuxonDateModule {\n static {\n this.ɵfac = function LuxonDateModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || LuxonDateModule)();\n };\n }\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: LuxonDateModule\n });\n }\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({\n providers: [{\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS]\n }]\n });\n }\n }\n return LuxonDateModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet MatLuxonDateModule = /*#__PURE__*/(() => {\n class MatLuxonDateModule {\n static {\n this.ɵfac = function MatLuxonDateModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || MatLuxonDateModule)();\n };\n }\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: MatLuxonDateModule\n });\n }\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({\n providers: [provideLuxonDateAdapter()]\n });\n }\n }\n return MatLuxonDateModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nfunction provideLuxonDateAdapter(formats = MAT_LUXON_DATE_FORMATS) {\n return [{\n provide: DateAdapter,\n useClass: LuxonDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_LUXON_DATE_ADAPTER_OPTIONS]\n }, {\n provide: MAT_DATE_FORMATS,\n useValue: formats\n }];\n}\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { LuxonDateAdapter, LuxonDateModule, MAT_LUXON_DATE_ADAPTER_OPTIONS, MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY, MAT_LUXON_DATE_FORMATS, MatLuxonDateModule, provideLuxonDateAdapter };\n"],"mappings":"8KAMA,IAAMA,EAA8C,IAAIC,EAAe,iCAAkC,CACvG,WAAY,OACZ,QAASC,CACX,CAAC,EAED,SAASA,GAAyC,CAChD,MAAO,CACL,OAAQ,GACR,eAAgB,EAChB,sBAAuB,SACzB,CACF,CAEA,SAASC,EAAMC,EAAQC,EAAe,CACpC,IAAMC,EAAc,MAAMF,CAAM,EAChC,QAASG,EAAI,EAAGA,EAAIH,EAAQG,IAC1BD,EAAYC,CAAC,EAAIF,EAAcE,CAAC,EAElC,OAAOD,CACT,CAEA,IAAIE,GAAiC,IAAM,CACzC,MAAMA,UAAyBC,CAAY,CACzC,YAAYC,EAAYC,EAAS,CAC/B,MAAM,EACN,KAAK,QAAU,CAAC,CAACA,GAAS,OAC1B,KAAK,gBAAkBA,GAAS,gBAAkB,EAClD,KAAK,uBAAyBA,GAAS,uBAAyB,UAChE,KAAK,UAAUD,GAAcE,EAAS,MAAM,EAAE,MAAM,CACtD,CACA,QAAQC,EAAM,CACZ,OAAOA,EAAK,IACd,CACA,SAASA,EAAM,CAEb,OAAOA,EAAK,MAAQ,CACtB,CACA,QAAQA,EAAM,CACZ,OAAOA,EAAK,GACd,CACA,aAAaA,EAAM,CACjB,OAAOA,EAAK,OACd,CACA,cAAcC,EAAO,CAEnB,OAAOC,EAAK,OAAOD,EAAO,CACxB,OAAQ,KAAK,OACb,eAAgB,KAAK,sBACvB,CAAC,CACH,CACA,cAAe,CAGb,IAAME,EAAM,IAAI,KAAK,eAAe,KAAK,OAAQ,CAC/C,IAAK,UACL,SAAU,KACZ,CAAC,EAED,OAAOb,EAAM,GAAII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C,EACV,KAAM,CAACC,EAAiBC,CAA8B,CACxD,EAAG,CACD,QAASC,EACT,SAAUN,CACZ,CAAC,CACH","names":["MAT_LUXON_DATE_ADAPTER_OPTIONS","InjectionToken","MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY","range","length","valueFunction","valuesArray","i","LuxonDateAdapter","DateAdapter","dateLocale","options","DateTime","date","style","Info","dtf","days","year","month","result","value","parseFormat","iso8601Date","formats","format","fromFormat","displayFormat","years","months","obj","__ngFactoryType__","ɵɵinject","MAT_DATE_LOCALE","ɵɵdefineInjectable","MAT_LUXON_DATE_FORMATS","MatLuxonDateModule","__ngFactoryType__","ɵɵdefineNgModule","ɵɵdefineInjector","provideLuxonDateAdapter","formats","MAT_LUXON_DATE_FORMATS","DateAdapter","LuxonDateAdapter","MAT_DATE_LOCALE","MAT_LUXON_DATE_ADAPTER_OPTIONS","MAT_DATE_FORMATS"],"x_google_ignoreList":[0]}