node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

16
server/node_modules/@formatjs/intl/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import { MessageDescriptor } from './src/types';
export * from './src/types';
export declare function defineMessages<K extends keyof any, T = MessageDescriptor, U extends Record<K, T> = Record<K, T>>(msgs: U): U;
export declare function defineMessage<T>(msg: T): T;
export { createIntlCache, filterProps, DEFAULT_INTL_CONFIG, createFormatters, getNamedFormat, } from './src/utils';
export * from './src/error';
export { formatMessage } from './src/message';
export type { FormatMessageFn } from './src/message';
export { formatDate, formatDateToParts, formatTime, formatTimeToParts, } from './src/dateTime';
export { formatDisplayName } from './src/displayName';
export { formatList } from './src/list';
export { formatPlural } from './src/plural';
export { formatRelativeTime } from './src/relativeTime';
export { formatNumber, formatNumberToParts } from './src/number';
export { createIntl } from './src/create-intl';
export type { CreateIntlFn } from './src/create-intl';

17
server/node_modules/@formatjs/intl/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
export * from './src/types';
export function defineMessages(msgs) {
return msgs;
}
export function defineMessage(msg) {
return msg;
}
export { createIntlCache, filterProps, DEFAULT_INTL_CONFIG, createFormatters, getNamedFormat, } from './src/utils';
export * from './src/error';
export { formatMessage } from './src/message';
export { formatDate, formatDateToParts, formatTime, formatTimeToParts, } from './src/dateTime';
export { formatDisplayName } from './src/displayName';
export { formatList } from './src/list';
export { formatPlural } from './src/plural';
export { formatRelativeTime } from './src/relativeTime';
export { formatNumber, formatNumberToParts } from './src/number';
export { createIntl } from './src/create-intl';

View File

@@ -0,0 +1,10 @@
import { IntlCache, IntlShape, IntlConfig } from './types';
export interface CreateIntlFn<T = string, C extends IntlConfig<T> = IntlConfig<T>, S extends IntlShape<T> = IntlShape<T>> {
(config: C, cache?: IntlCache): S;
}
/**
* Create intl object
* @param config intl config
* @param cache cache for formatter instances to prevent memory leak
*/
export declare function createIntl<T = string>(config: IntlConfig<T>, cache?: IntlCache): IntlShape<T>;

View File

@@ -0,0 +1,55 @@
import { __assign } from "tslib";
import { createFormatters, DEFAULT_INTL_CONFIG } from './utils';
import { InvalidConfigError, MissingDataError } from './error';
import { formatNumber, formatNumberToParts } from './number';
import { formatRelativeTime } from './relativeTime';
import { formatDate, formatDateToParts, formatTime, formatTimeToParts, formatDateTimeRange, } from './dateTime';
import { formatPlural } from './plural';
import { formatMessage } from './message';
import { formatList, formatListToParts } from './list';
import { formatDisplayName } from './displayName';
function messagesContainString(messages) {
var firstMessage = messages ? messages[Object.keys(messages)[0]] : undefined;
return typeof firstMessage === 'string';
}
function verifyConfigMessages(config) {
if (config.onWarn &&
config.defaultRichTextElements &&
messagesContainString(config.messages || {})) {
config.onWarn("[@formatjs/intl] \"defaultRichTextElements\" was specified but \"message\" was not pre-compiled. \nPlease consider using \"@formatjs/cli\" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution");
}
}
/**
* Create intl object
* @param config intl config
* @param cache cache for formatter instances to prevent memory leak
*/
export function createIntl(config, cache) {
var formatters = createFormatters(cache);
var resolvedConfig = __assign(__assign({}, DEFAULT_INTL_CONFIG), config);
var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
if (!locale) {
if (onError) {
onError(new InvalidConfigError("\"locale\" was not configured, using \"".concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details")));
}
// Since there's no registered locale data for `locale`, this will
// fallback to the `defaultLocale` to make sure things can render.
// The `messages` are overridden to the `defaultProps` empty object
// to maintain referential equality across re-renders. It's assumed
// each <FormattedMessage> contains a `defaultMessage` prop.
resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
}
else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {
onError(new MissingDataError("Missing locale data for locale: \"".concat(locale, "\" in Intl.NumberFormat. Using default locale: \"").concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details")));
}
else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&
onError) {
onError(new MissingDataError("Missing locale data for locale: \"".concat(locale, "\" in Intl.DateTimeFormat. Using default locale: \"").concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details")));
}
verifyConfigMessages(resolvedConfig);
return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules),
// @ts-expect-error TODO: will get to this later
formatMessage: formatMessage.bind(null, resolvedConfig, formatters),
// @ts-expect-error TODO: will get to this later
$t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });
}

View File

@@ -0,0 +1,37 @@
import { Formatters, IntlFormatters, CustomFormats, OnErrorFn } from './types';
import { DateTimeFormat } from '@formatjs/ecma402-abstract';
export declare function getFormatter({ locale, formats, onError, timeZone, }: {
locale: string;
timeZone?: string;
formats: CustomFormats;
onError: OnErrorFn;
}, type: 'date' | 'time', getDateTimeFormat: Formatters['getDateTimeFormat'], options?: Parameters<IntlFormatters['formatDate']>[1]): DateTimeFormat;
export declare function formatDate(config: {
locale: string;
timeZone?: string;
formats: CustomFormats;
onError: OnErrorFn;
}, getDateTimeFormat: Formatters['getDateTimeFormat'], ...[value, options]: Parameters<IntlFormatters['formatDate']>): string;
export declare function formatTime(config: {
locale: string;
timeZone?: string;
formats: CustomFormats;
onError: OnErrorFn;
}, getDateTimeFormat: Formatters['getDateTimeFormat'], ...[value, options]: Parameters<IntlFormatters['formatTime']>): string;
export declare function formatDateTimeRange(config: {
locale: string;
timeZone?: string;
onError: OnErrorFn;
}, getDateTimeFormat: Formatters['getDateTimeFormat'], ...[from, to, options]: Parameters<IntlFormatters['formatDateTimeRange']>): string;
export declare function formatDateToParts(config: {
locale: string;
timeZone?: string;
formats: CustomFormats;
onError: OnErrorFn;
}, getDateTimeFormat: Formatters['getDateTimeFormat'], ...[value, options]: Parameters<IntlFormatters['formatDate']>): Intl.DateTimeFormatPart[];
export declare function formatTimeToParts(config: {
locale: string;
timeZone?: string;
formats: CustomFormats;
onError: OnErrorFn;
}, getDateTimeFormat: Formatters['getDateTimeFormat'], ...[value, options]: Parameters<IntlFormatters['formatTimeToParts']>): Intl.DateTimeFormatPart[];

117
server/node_modules/@formatjs/intl/lib/src/dateTime.js generated vendored Normal file
View File

@@ -0,0 +1,117 @@
import { __assign } from "tslib";
import { filterProps, getNamedFormat } from './utils';
import { IntlFormatError } from './error';
var DATE_TIME_FORMAT_OPTIONS = [
'formatMatcher',
'timeZone',
'hour12',
'weekday',
'era',
'year',
'month',
'day',
'hour',
'minute',
'second',
'timeZoneName',
'hourCycle',
'dateStyle',
'timeStyle',
'calendar',
// 'dayPeriod',
'numberingSystem',
'fractionalSecondDigits',
];
export function getFormatter(_a, type, getDateTimeFormat, options) {
var locale = _a.locale, formats = _a.formats, onError = _a.onError, timeZone = _a.timeZone;
if (options === void 0) { options = {}; }
var format = options.format;
var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);
if (type === 'time' &&
!filteredOptions.hour &&
!filteredOptions.minute &&
!filteredOptions.second &&
!filteredOptions.timeStyle &&
!filteredOptions.dateStyle) {
// Add default formatting options if hour, minute, or second isn't defined.
filteredOptions = __assign(__assign({}, filteredOptions), { hour: 'numeric', minute: 'numeric' });
}
return getDateTimeFormat(locale, filteredOptions);
}
export function formatDate(config, getDateTimeFormat) {
var _a = [];
for (var _i = 2; _i < arguments.length; _i++) {
_a[_i - 2] = arguments[_i];
}
var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;
var date = typeof value === 'string' ? new Date(value || 0) : value;
try {
return getFormatter(config, 'date', getDateTimeFormat, options).format(date);
}
catch (e) {
config.onError(new IntlFormatError('Error formatting date.', config.locale, e));
}
return String(date);
}
export function formatTime(config, getDateTimeFormat) {
var _a = [];
for (var _i = 2; _i < arguments.length; _i++) {
_a[_i - 2] = arguments[_i];
}
var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;
var date = typeof value === 'string' ? new Date(value || 0) : value;
try {
return getFormatter(config, 'time', getDateTimeFormat, options).format(date);
}
catch (e) {
config.onError(new IntlFormatError('Error formatting time.', config.locale, e));
}
return String(date);
}
export function formatDateTimeRange(config, getDateTimeFormat) {
var _a = [];
for (var _i = 2; _i < arguments.length; _i++) {
_a[_i - 2] = arguments[_i];
}
var from = _a[0], to = _a[1], _b = _a[2], options = _b === void 0 ? {} : _b;
var timeZone = config.timeZone, locale = config.locale, onError = config.onError;
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, timeZone ? { timeZone: timeZone } : {});
try {
return getDateTimeFormat(locale, filteredOptions).formatRange(from, to);
}
catch (e) {
onError(new IntlFormatError('Error formatting date time range.', config.locale, e));
}
return String(from);
}
export function formatDateToParts(config, getDateTimeFormat) {
var _a = [];
for (var _i = 2; _i < arguments.length; _i++) {
_a[_i - 2] = arguments[_i];
}
var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;
var date = typeof value === 'string' ? new Date(value || 0) : value;
try {
return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
}
catch (e) {
config.onError(new IntlFormatError('Error formatting date.', config.locale, e));
}
return [];
}
export function formatTimeToParts(config, getDateTimeFormat) {
var _a = [];
for (var _i = 2; _i < arguments.length; _i++) {
_a[_i - 2] = arguments[_i];
}
var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;
var date = typeof value === 'string' ? new Date(value || 0) : value;
try {
return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
}
catch (e) {
config.onError(new IntlFormatError('Error formatting time.', config.locale, e));
}
return [];
}

View File

@@ -0,0 +1,5 @@
import { Formatters, IntlFormatters, OnErrorFn } from './types';
export declare function formatDisplayName({ locale, onError, }: {
locale: string;
onError: OnErrorFn;
}, getDisplayNames: Formatters['getDisplayNames'], value: Parameters<IntlFormatters['formatDisplayName']>[0], options: Parameters<IntlFormatters['formatDisplayName']>[1]): string | undefined;

View File

@@ -0,0 +1,23 @@
import { filterProps } from './utils';
import { FormatError, ErrorCode } from 'intl-messageformat';
import { IntlFormatError } from './error';
var DISPLAY_NAMES_OPTONS = [
'style',
'type',
'fallback',
'languageDisplay',
];
export function formatDisplayName(_a, getDisplayNames, value, options) {
var locale = _a.locale, onError = _a.onError;
var DisplayNames = Intl.DisplayNames;
if (!DisplayNames) {
onError(new FormatError("Intl.DisplayNames is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-displaynames\"\n", ErrorCode.MISSING_INTL_API));
}
var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS);
try {
return getDisplayNames(locale, filteredOptions).of(value);
}
catch (e) {
onError(new IntlFormatError('Error formatting display name.', locale, e));
}
}

35
server/node_modules/@formatjs/intl/lib/src/error.d.ts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
import { MessageDescriptor } from './types';
export declare enum IntlErrorCode {
FORMAT_ERROR = "FORMAT_ERROR",
UNSUPPORTED_FORMATTER = "UNSUPPORTED_FORMATTER",
INVALID_CONFIG = "INVALID_CONFIG",
MISSING_DATA = "MISSING_DATA",
MISSING_TRANSLATION = "MISSING_TRANSLATION"
}
export declare class IntlError<T extends IntlErrorCode = IntlErrorCode.FORMAT_ERROR> extends Error {
readonly code: T;
constructor(code: T, message: string, exception?: Error | unknown);
}
export declare class UnsupportedFormatterError extends IntlError<IntlErrorCode.UNSUPPORTED_FORMATTER> {
constructor(message: string, exception?: Error | unknown);
}
export declare class InvalidConfigError extends IntlError<IntlErrorCode.INVALID_CONFIG> {
constructor(message: string, exception?: Error | unknown);
}
export declare class MissingDataError extends IntlError<IntlErrorCode.MISSING_DATA> {
constructor(message: string, exception?: Error | unknown);
}
export declare class IntlFormatError extends IntlError<IntlErrorCode.FORMAT_ERROR> {
readonly descriptor?: MessageDescriptor;
readonly locale: string;
constructor(message: string, locale: string, exception?: Error | unknown);
}
export declare class MessageFormatError extends IntlFormatError {
readonly descriptor?: MessageDescriptor;
readonly locale: string;
constructor(message: string, locale: string, descriptor?: MessageDescriptor, exception?: Error | unknown);
}
export declare class MissingTranslationError extends IntlError<IntlErrorCode.MISSING_TRANSLATION> {
readonly descriptor?: MessageDescriptor;
constructor(descriptor: MessageDescriptor, locale: string);
}

91
server/node_modules/@formatjs/intl/lib/src/error.js generated vendored Normal file
View File

@@ -0,0 +1,91 @@
import { __extends } from "tslib";
export var IntlErrorCode;
(function (IntlErrorCode) {
IntlErrorCode["FORMAT_ERROR"] = "FORMAT_ERROR";
IntlErrorCode["UNSUPPORTED_FORMATTER"] = "UNSUPPORTED_FORMATTER";
IntlErrorCode["INVALID_CONFIG"] = "INVALID_CONFIG";
IntlErrorCode["MISSING_DATA"] = "MISSING_DATA";
IntlErrorCode["MISSING_TRANSLATION"] = "MISSING_TRANSLATION";
})(IntlErrorCode || (IntlErrorCode = {}));
var IntlError = /** @class */ (function (_super) {
__extends(IntlError, _super);
function IntlError(code, message, exception) {
var _this = this;
var err = exception
? exception instanceof Error
? exception
: new Error(String(exception))
: undefined;
_this = _super.call(this, "[@formatjs/intl Error ".concat(code, "] ").concat(message, "\n").concat(err ? "\n".concat(err.message, "\n").concat(err.stack) : '')) || this;
_this.code = code;
// @ts-ignore just so we don't need to declare dep on @types/node
if (typeof Error.captureStackTrace === 'function') {
// @ts-ignore just so we don't need to declare dep on @types/node
Error.captureStackTrace(_this, IntlError);
}
return _this;
}
return IntlError;
}(Error));
export { IntlError };
var UnsupportedFormatterError = /** @class */ (function (_super) {
__extends(UnsupportedFormatterError, _super);
function UnsupportedFormatterError(message, exception) {
return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;
}
return UnsupportedFormatterError;
}(IntlError));
export { UnsupportedFormatterError };
var InvalidConfigError = /** @class */ (function (_super) {
__extends(InvalidConfigError, _super);
function InvalidConfigError(message, exception) {
return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;
}
return InvalidConfigError;
}(IntlError));
export { InvalidConfigError };
var MissingDataError = /** @class */ (function (_super) {
__extends(MissingDataError, _super);
function MissingDataError(message, exception) {
return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;
}
return MissingDataError;
}(IntlError));
export { MissingDataError };
var IntlFormatError = /** @class */ (function (_super) {
__extends(IntlFormatError, _super);
function IntlFormatError(message, locale, exception) {
var _this = _super.call(this, IntlErrorCode.FORMAT_ERROR, "".concat(message, "\nLocale: ").concat(locale, "\n"), exception) || this;
_this.locale = locale;
return _this;
}
return IntlFormatError;
}(IntlError));
export { IntlFormatError };
var MessageFormatError = /** @class */ (function (_super) {
__extends(MessageFormatError, _super);
function MessageFormatError(message, locale, descriptor, exception) {
var _this = _super.call(this, "".concat(message, "\nMessageID: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, "\nDefault Message: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, "\nDescription: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, "\n"), locale, exception) || this;
_this.descriptor = descriptor;
_this.locale = locale;
return _this;
}
return MessageFormatError;
}(IntlFormatError));
export { MessageFormatError };
var MissingTranslationError = /** @class */ (function (_super) {
__extends(MissingTranslationError, _super);
function MissingTranslationError(descriptor, locale) {
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \"".concat(descriptor.id, "\" for locale \"").concat(locale, "\", using ").concat(descriptor.defaultMessage
? "default message (".concat(typeof descriptor.defaultMessage === 'string'
? descriptor.defaultMessage
: descriptor.defaultMessage
.map(function (e) { var _a; return (_a = e.value) !== null && _a !== void 0 ? _a : JSON.stringify(e); })
.join(), ")")
: 'id', " as fallback.")) || this;
_this.descriptor = descriptor;
return _this;
}
return MissingTranslationError;
}(IntlError));
export { MissingTranslationError };

10
server/node_modules/@formatjs/intl/lib/src/list.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import { Formatters, IntlFormatters, OnErrorFn } from './types';
import type { Part } from '@formatjs/intl-listformat';
export declare function formatList(opts: {
locale: string;
onError: OnErrorFn;
}, getListFormat: Formatters['getListFormat'], values: ReadonlyArray<string>, options: Parameters<IntlFormatters['formatList']>[1]): string;
export declare function formatListToParts<T>(opts: {
locale: string;
onError: OnErrorFn;
}, getListFormat: Formatters['getListFormat'], values: ReadonlyArray<string | T>, options: Parameters<IntlFormatters['formatList']>[1]): Part[];

61
server/node_modules/@formatjs/intl/lib/src/list.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
import { __assign } from "tslib";
import { filterProps } from './utils';
import { FormatError, ErrorCode } from 'intl-messageformat';
import { IntlFormatError } from './error';
var LIST_FORMAT_OPTIONS = [
'type',
'style',
];
var now = Date.now();
function generateToken(i) {
return "".concat(now, "_").concat(i, "_").concat(now);
}
export function formatList(opts, getListFormat, values, options) {
if (options === void 0) { options = {}; }
var results = formatListToParts(opts, getListFormat, values, options).reduce(function (all, el) {
var val = el.value;
if (typeof val !== 'string') {
all.push(val);
}
else if (typeof all[all.length - 1] === 'string') {
all[all.length - 1] += val;
}
else {
all.push(val);
}
return all;
}, []);
return results.length === 1 ? results[0] : results.length === 0 ? '' : results;
}
export function formatListToParts(_a, getListFormat, values, options) {
var locale = _a.locale, onError = _a.onError;
if (options === void 0) { options = {}; }
var ListFormat = Intl.ListFormat;
if (!ListFormat) {
onError(new FormatError("Intl.ListFormat is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-listformat\"\n", ErrorCode.MISSING_INTL_API));
}
var filteredOptions = filterProps(options, LIST_FORMAT_OPTIONS);
try {
var richValues_1 = {};
var serializedValues = values.map(function (v, i) {
if (typeof v === 'object') {
var id = generateToken(i);
richValues_1[id] = v;
return id;
}
return String(v);
});
return getListFormat(locale, filteredOptions)
.formatToParts(serializedValues)
.map(function (part) {
return part.type === 'literal'
? part
: __assign(__assign({}, part), { value: richValues_1[part.value] || part.value });
});
}
catch (e) {
onError(new IntlFormatError('Error formatting list.', locale, e));
}
// @ts-ignore
return values;
}

View File

@@ -0,0 +1,15 @@
import { Formatters, MessageDescriptor, CustomFormats, OnErrorFn } from './types';
import { FormatXMLElementFn, PrimitiveType, Formatters as IntlMessageFormatFormatters, Options } from 'intl-messageformat';
import { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
export type FormatMessageFn<T> = ({ locale, formats, messages, defaultLocale, defaultFormats, fallbackOnEmptyString, onError, timeZone, defaultRichTextElements, }: {
locale: string;
timeZone?: string;
formats: CustomFormats;
messages: Record<string, string> | Record<string, MessageFormatElement[]>;
defaultLocale: string;
defaultFormats: CustomFormats;
defaultRichTextElements?: Record<string, FormatXMLElementFn<T>>;
fallbackOnEmptyString?: boolean;
onError: OnErrorFn;
}, state: IntlMessageFormatFormatters & Pick<Formatters, 'getMessageFormat'>, messageDescriptor: MessageDescriptor, values?: Record<string, PrimitiveType | T | FormatXMLElementFn<T>>, opts?: Options) => T extends string ? string : Array<T | string> | string | T;
export declare const formatMessage: FormatMessageFn<any>;

103
server/node_modules/@formatjs/intl/lib/src/message.js generated vendored Normal file
View File

@@ -0,0 +1,103 @@
import { __assign } from "tslib";
import { invariant } from '@formatjs/ecma402-abstract';
import { IntlMessageFormat, } from 'intl-messageformat';
import { MissingTranslationError, MessageFormatError } from './error';
import { TYPE } from '@formatjs/icu-messageformat-parser';
function setTimeZoneInOptions(opts, timeZone) {
return Object.keys(opts).reduce(function (all, k) {
all[k] = __assign({ timeZone: timeZone }, opts[k]);
return all;
}, {});
}
function deepMergeOptions(opts1, opts2) {
var keys = Object.keys(__assign(__assign({}, opts1), opts2));
return keys.reduce(function (all, k) {
all[k] = __assign(__assign({}, (opts1[k] || {})), (opts2[k] || {}));
return all;
}, {});
}
function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
if (!timeZone) {
return f1;
}
var mfFormats = IntlMessageFormat.formats;
return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });
}
export var formatMessage = function (_a, state, messageDescriptor, values, opts) {
var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;
if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;
// `id` is a required field of a Message Descriptor.
invariant(!!msgId, "[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");
var id = String(msgId);
var message =
// In case messages is Object.create(null)
// e.g import('foo.json') from webpack)
// See https://github.com/formatjs/formatjs/issues/1914
messages &&
Object.prototype.hasOwnProperty.call(messages, id) &&
messages[id];
// IMPORTANT: Hot path if `message` is AST with a single literal node
if (Array.isArray(message) &&
message.length === 1 &&
message[0].type === TYPE.literal) {
return message[0].value;
}
// IMPORTANT: Hot path straight lookup for performance
if (!values &&
message &&
typeof message === 'string' &&
!defaultRichTextElements) {
return message.replace(/'\{(.*?)\}'/gi, "{$1}");
}
values = __assign(__assign({}, defaultRichTextElements), (values || {}));
formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
if (!message) {
if (fallbackOnEmptyString === false && message === '') {
return message;
}
if (!defaultMessage ||
(locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
// This prevents warnings from littering the console in development
// when no `messages` are passed into the <IntlProvider> for the
// default locale.
onError(new MissingTranslationError(messageDescriptor, locale));
}
if (defaultMessage) {
try {
var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);
return formatter.format(values);
}
catch (e) {
onError(new MessageFormatError("Error formatting default message for: \"".concat(id, "\", rendering default message verbatim"), locale, messageDescriptor, e));
return typeof defaultMessage === 'string' ? defaultMessage : id;
}
}
return id;
}
// We have the translated message
try {
var formatter = state.getMessageFormat(message, locale, formats, __assign({ formatters: state }, (opts || {})));
return formatter.format(values);
}
catch (e) {
onError(new MessageFormatError("Error formatting message: \"".concat(id, "\", using ").concat(defaultMessage ? 'default message' : 'id', " as fallback."), locale, messageDescriptor, e));
}
if (defaultMessage) {
try {
var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);
return formatter.format(values);
}
catch (e) {
onError(new MessageFormatError("Error formatting the default message for: \"".concat(id, "\", rendering message verbatim"), locale, messageDescriptor, e));
}
}
if (typeof message === 'string') {
return message;
}
if (typeof defaultMessage === 'string') {
return defaultMessage;
}
return id;
};

16
server/node_modules/@formatjs/intl/lib/src/number.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import { CustomFormats, Formatters, IntlFormatters, OnErrorFn } from './types';
export declare function getFormatter({ locale, formats, onError, }: {
locale: string;
formats: CustomFormats;
onError: OnErrorFn;
}, getNumberFormat: Formatters['getNumberFormat'], options?: Parameters<IntlFormatters['formatNumber']>[1]): Intl.NumberFormat;
export declare function formatNumber(config: {
locale: string;
formats: CustomFormats;
onError: OnErrorFn;
}, getNumberFormat: Formatters['getNumberFormat'], value: Parameters<IntlFormatters['formatNumber']>[0], options?: Parameters<IntlFormatters['formatNumber']>[1]): string;
export declare function formatNumberToParts(config: {
locale: string;
formats: CustomFormats;
onError: OnErrorFn;
}, getNumberFormat: Formatters['getNumberFormat'], value: Parameters<IntlFormatters['formatNumber']>[0], options?: Parameters<IntlFormatters['formatNumber']>[1]): Intl.NumberFormatPart[];

58
server/node_modules/@formatjs/intl/lib/src/number.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
import { IntlFormatError } from './error';
import { filterProps, getNamedFormat } from './utils';
var NUMBER_FORMAT_OPTIONS = [
'style',
'currency',
'unit',
'unitDisplay',
'useGrouping',
'minimumIntegerDigits',
'minimumFractionDigits',
'maximumFractionDigits',
'minimumSignificantDigits',
'maximumSignificantDigits',
// ES2020 NumberFormat
'compactDisplay',
'currencyDisplay',
'currencySign',
'notation',
'signDisplay',
'unit',
'unitDisplay',
'numberingSystem',
// ES2023 NumberFormat
'trailingZeroDisplay',
'roundingPriority',
'roundingIncrement',
'roundingMode',
];
export function getFormatter(_a, getNumberFormat, options) {
var locale = _a.locale, formats = _a.formats, onError = _a.onError;
if (options === void 0) { options = {}; }
var format = options.format;
var defaults = ((format &&
getNamedFormat(formats, 'number', format, onError)) ||
{});
var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);
return getNumberFormat(locale, filteredOptions);
}
export function formatNumber(config, getNumberFormat, value, options) {
if (options === void 0) { options = {}; }
try {
return getFormatter(config, getNumberFormat, options).format(value);
}
catch (e) {
config.onError(new IntlFormatError('Error formatting number.', config.locale, e));
}
return String(value);
}
export function formatNumberToParts(config, getNumberFormat, value, options) {
if (options === void 0) { options = {}; }
try {
return getFormatter(config, getNumberFormat, options).formatToParts(value);
}
catch (e) {
config.onError(new IntlFormatError('Error formatting number.', config.locale, e));
}
return [];
}

View File

@@ -0,0 +1,6 @@
import { Formatters, IntlFormatters, OnErrorFn } from './types';
import { LDMLPluralRule } from '@formatjs/ecma402-abstract';
export declare function formatPlural({ locale, onError, }: {
locale: string;
onError: OnErrorFn;
}, getPluralRules: Formatters['getPluralRules'], value: Parameters<IntlFormatters['formatPlural']>[0], options?: Parameters<IntlFormatters['formatPlural']>[1]): LDMLPluralRule;

19
server/node_modules/@formatjs/intl/lib/src/plural.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import { filterProps } from './utils';
import { IntlFormatError } from './error';
import { ErrorCode, FormatError } from 'intl-messageformat';
var PLURAL_FORMAT_OPTIONS = ['type'];
export function formatPlural(_a, getPluralRules, value, options) {
var locale = _a.locale, onError = _a.onError;
if (options === void 0) { options = {}; }
if (!Intl.PluralRules) {
onError(new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API));
}
var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);
try {
return getPluralRules(locale, filteredOptions).select(value);
}
catch (e) {
onError(new IntlFormatError('Error formatting plural.', locale, e));
}
return 'other';
}

View File

@@ -0,0 +1,6 @@
import { IntlFormatters, Formatters, CustomFormats, OnErrorFn } from './types';
export declare function formatRelativeTime(config: {
locale: string;
formats: CustomFormats;
onError: OnErrorFn;
}, getRelativeTimeFormat: Formatters['getRelativeTimeFormat'], value: Parameters<IntlFormatters['formatRelativeTime']>[0], unit?: Parameters<IntlFormatters['formatRelativeTime']>[1], options?: Parameters<IntlFormatters['formatRelativeTime']>[2]): string;

View File

@@ -0,0 +1,29 @@
import { getNamedFormat, filterProps } from './utils';
import { FormatError, ErrorCode } from 'intl-messageformat';
import { IntlFormatError } from './error';
var RELATIVE_TIME_FORMAT_OPTIONS = ['numeric', 'style'];
function getFormatter(_a, getRelativeTimeFormat, options) {
var locale = _a.locale, formats = _a.formats, onError = _a.onError;
if (options === void 0) { options = {}; }
var format = options.format;
var defaults = (!!format && getNamedFormat(formats, 'relative', format, onError)) || {};
var filteredOptions = filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults);
return getRelativeTimeFormat(locale, filteredOptions);
}
export function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) {
if (options === void 0) { options = {}; }
if (!unit) {
unit = 'second';
}
var RelativeTimeFormat = Intl.RelativeTimeFormat;
if (!RelativeTimeFormat) {
config.onError(new FormatError("Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-relativetimeformat\"\n", ErrorCode.MISSING_INTL_API));
}
try {
return getFormatter(config, getRelativeTimeFormat, options).format(value, unit);
}
catch (e) {
config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));
}
return String(value);
}

106
server/node_modules/@formatjs/intl/lib/src/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,106 @@
import { IntlMessageFormat, Formats, FormatXMLElementFn, FormatError, PrimitiveType, Options as IntlMessageFormatOptions } from 'intl-messageformat';
import { DateTimeFormat } from '@formatjs/ecma402-abstract';
import { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
import IntlListFormat, { IntlListFormatOptions, Part } from '@formatjs/intl-listformat';
import { DisplayNames, DisplayNamesOptions } from '@formatjs/intl-displaynames';
import { MissingTranslationError, MessageFormatError, MissingDataError, InvalidConfigError, UnsupportedFormatterError } from './error';
import { DEFAULT_INTL_CONFIG } from './utils';
import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
declare global {
namespace FormatjsIntl {
interface Message {
}
interface IntlConfig {
}
interface Formats {
}
}
}
type MessageIds = FormatjsIntl.Message extends {
ids: infer T;
} ? T extends string ? T : string : string;
type Locale = FormatjsIntl.IntlConfig extends {
locale: infer T;
} ? T extends string ? T : string : string;
export type OnErrorFn = (err: MissingTranslationError | MessageFormatError | MissingDataError | InvalidConfigError | UnsupportedFormatterError | FormatError) => void;
export type OnWarnFn = (warning: string) => void;
/**
* Config for intl object.
* Generic type T is the type of potential rich text element. For example:
* With React, T would be React.ReactNode
*/
export interface ResolvedIntlConfig<T = string> {
locale: Locale;
timeZone?: string;
fallbackOnEmptyString?: boolean;
formats: CustomFormats;
messages: Record<MessageIds, string> | Record<MessageIds, MessageFormatElement[]>;
defaultLocale: string;
defaultFormats: CustomFormats;
defaultRichTextElements?: Record<string, FormatXMLElementFn<T>>;
onError: OnErrorFn;
onWarn?: OnWarnFn;
}
export interface CustomFormats extends Partial<Formats> {
relative?: Record<string, Intl.RelativeTimeFormatOptions>;
}
export interface CustomFormatConfig<Source = string> {
format?: Source extends keyof FormatjsIntl.Formats ? FormatjsIntl.Formats[Source] : string;
}
export type FormatDateOptions = Omit<Intl.DateTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'date'>;
export type FormatNumberOptions = Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'>;
export type FormatRelativeTimeOptions = Omit<Intl.RelativeTimeFormatOptions, 'localeMatcher'> & CustomFormatConfig<'time'>;
export type FormatPluralOptions = Omit<Intl.PluralRulesOptions, 'localeMatcher'> & CustomFormatConfig;
export type FormatListOptions = Omit<IntlListFormatOptions, 'localeMatcher'>;
export type FormatDisplayNameOptions = Omit<DisplayNamesOptions, 'localeMatcher'>;
/**
* `TBase` is the type constraints of the rich text element in the formatted output.
* For example, with React, `TBase` should be `React.ReactNode`.
*/
export interface IntlFormatters<TBase = unknown> {
formatDateTimeRange(from: Parameters<DateTimeFormat['formatRange']>[0], to: Parameters<DateTimeFormat['formatRange']>[1], opts?: FormatDateOptions): string;
formatDate(value: Parameters<Intl.DateTimeFormat['format']>[0] | string, opts?: FormatDateOptions): string;
formatTime(value: Parameters<Intl.DateTimeFormat['format']>[0] | string, opts?: FormatDateOptions): string;
formatDateToParts(value: Parameters<Intl.DateTimeFormat['format']>[0] | string, opts?: FormatDateOptions): Intl.DateTimeFormatPart[];
formatTimeToParts(value: Parameters<Intl.DateTimeFormat['format']>[0] | string, opts?: FormatDateOptions): Intl.DateTimeFormatPart[];
formatRelativeTime(value: Parameters<Intl.RelativeTimeFormat['format']>[0], unit?: Parameters<Intl.RelativeTimeFormat['format']>[1], opts?: FormatRelativeTimeOptions): string;
formatNumber(value: Parameters<Intl.NumberFormat['format']>[0], opts?: FormatNumberOptions): string;
formatNumberToParts(value: Parameters<Intl.NumberFormat['format']>[0], opts?: FormatNumberOptions): Intl.NumberFormatPart[];
formatPlural(value: Parameters<Intl.PluralRules['select']>[0], opts?: FormatPluralOptions): ReturnType<Intl.PluralRules['select']>;
formatMessage(descriptor: MessageDescriptor, values?: Record<string, PrimitiveType | FormatXMLElementFn<string, string>>, opts?: IntlMessageFormatOptions): string;
formatMessage<T extends TBase>(descriptor: MessageDescriptor, values?: Record<string, PrimitiveType | T | FormatXMLElementFn<T>>, opts?: IntlMessageFormatOptions): string | T | (T | string)[];
$t(descriptor: MessageDescriptor, values?: Record<string, PrimitiveType | FormatXMLElementFn<string, string>>, opts?: IntlMessageFormatOptions): string;
$t<T extends TBase>(descriptor: MessageDescriptor, values?: Record<string, PrimitiveType | T | FormatXMLElementFn<T>>, opts?: IntlMessageFormatOptions): string | T | (T | string)[];
formatList(values: ReadonlyArray<string>, opts?: FormatListOptions): string;
formatList<T extends TBase>(values: ReadonlyArray<string | T>, opts?: FormatListOptions): T | string | (string | T)[];
formatListToParts<T extends TBase>(values: ReadonlyArray<string | T>, opts?: FormatListOptions): Part[];
formatDisplayName(value: Parameters<DisplayNames['of']>[0], opts: FormatDisplayNameOptions): string | undefined;
}
export interface Formatters {
getDateTimeFormat(...args: ConstructorParameters<typeof Intl.DateTimeFormat>): DateTimeFormat;
getNumberFormat(locales?: string | string[], opts?: NumberFormatOptions): Intl.NumberFormat;
getMessageFormat(...args: ConstructorParameters<typeof IntlMessageFormat>): IntlMessageFormat;
getRelativeTimeFormat(...args: ConstructorParameters<typeof Intl.RelativeTimeFormat>): Intl.RelativeTimeFormat;
getPluralRules(...args: ConstructorParameters<typeof Intl.PluralRules>): Intl.PluralRules;
getListFormat(...args: ConstructorParameters<typeof IntlListFormat>): IntlListFormat;
getDisplayNames(...args: ConstructorParameters<typeof DisplayNames>): DisplayNames;
}
export interface IntlShape<T = string> extends ResolvedIntlConfig<T>, IntlFormatters<T> {
formatters: Formatters;
}
export interface IntlCache {
dateTime: Record<string, DateTimeFormat>;
number: Record<string, Intl.NumberFormat>;
message: Record<string, IntlMessageFormat>;
relativeTime: Record<string, Intl.RelativeTimeFormat>;
pluralRules: Record<string, Intl.PluralRules>;
list: Record<string, IntlListFormat>;
displayNames: Record<string, DisplayNames>;
}
export interface MessageDescriptor {
id?: MessageIds;
description?: string | object;
defaultMessage?: string | MessageFormatElement[];
}
export type IntlConfig<T = string> = Omit<ResolvedIntlConfig<T>, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>;
export {};

1
server/node_modules/@formatjs/intl/lib/src/types.js generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

11
server/node_modules/@formatjs/intl/lib/src/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import { IntlCache, CustomFormats, Formatters, OnErrorFn, ResolvedIntlConfig } from './types';
import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, allowlist: Array<K>, defaults?: Partial<T>): Pick<T, K>;
export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig<any>, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'defaultLocale' | 'defaultFormats' | 'onError' | 'onWarn'>;
export declare function createIntlCache(): IntlCache;
/**
* Create intl formatters and populate cache
* @param cache explicit cache to prevent leaking memory
*/
export declare function createFormatters(cache?: IntlCache): Formatters;
export declare function getNamedFormat<T extends keyof CustomFormats>(formats: CustomFormats, type: T, name: string, onError: OnErrorFn): NumberFormatOptions | Intl.DateTimeFormatOptions | Intl.RelativeTimeFormatOptions | undefined;

162
server/node_modules/@formatjs/intl/lib/src/utils.js generated vendored Normal file
View File

@@ -0,0 +1,162 @@
import { __assign, __spreadArray } from "tslib";
import { IntlMessageFormat } from 'intl-messageformat';
import { memoize, strategies } from '@formatjs/fast-memoize';
import { UnsupportedFormatterError } from './error';
export function filterProps(props, allowlist, defaults) {
if (defaults === void 0) { defaults = {}; }
return allowlist.reduce(function (filtered, name) {
if (name in props) {
filtered[name] = props[name];
}
else if (name in defaults) {
filtered[name] = defaults[name];
}
return filtered;
}, {});
}
var defaultErrorHandler = function (error) {
// @ts-ignore just so we don't need to declare dep on @types/node
if (process.env.NODE_ENV !== 'production') {
console.error(error);
}
};
var defaultWarnHandler = function (warning) {
// @ts-ignore just so we don't need to declare dep on @types/node
if (process.env.NODE_ENV !== 'production') {
console.warn(warning);
}
};
export var DEFAULT_INTL_CONFIG = {
formats: {},
messages: {},
timeZone: undefined,
defaultLocale: 'en',
defaultFormats: {},
fallbackOnEmptyString: true,
onError: defaultErrorHandler,
onWarn: defaultWarnHandler,
};
export function createIntlCache() {
return {
dateTime: {},
number: {},
message: {},
relativeTime: {},
pluralRules: {},
list: {},
displayNames: {},
};
}
function createFastMemoizeCache(store) {
return {
create: function () {
return {
get: function (key) {
return store[key];
},
set: function (key, value) {
store[key] = value;
},
};
},
};
}
/**
* Create intl formatters and populate cache
* @param cache explicit cache to prevent leaking memory
*/
export function createFormatters(cache) {
if (cache === void 0) { cache = createIntlCache(); }
var RelativeTimeFormat = Intl.RelativeTimeFormat;
var ListFormat = Intl.ListFormat;
var DisplayNames = Intl.DisplayNames;
var getDateTimeFormat = memoize(function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
}, {
cache: createFastMemoizeCache(cache.dateTime),
strategy: strategies.variadic,
});
var getNumberFormat = memoize(function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
}, {
cache: createFastMemoizeCache(cache.number),
strategy: strategies.variadic,
});
var getPluralRules = memoize(function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
}, {
cache: createFastMemoizeCache(cache.pluralRules),
strategy: strategies.variadic,
});
return {
getDateTimeFormat: getDateTimeFormat,
getNumberFormat: getNumberFormat,
getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {
return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {
getNumberFormat: getNumberFormat,
getDateTimeFormat: getDateTimeFormat,
getPluralRules: getPluralRules,
} }, (opts || {})));
}, {
cache: createFastMemoizeCache(cache.message),
strategy: strategies.variadic,
}),
getRelativeTimeFormat: memoize(function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();
}, {
cache: createFastMemoizeCache(cache.relativeTime),
strategy: strategies.variadic,
}),
getPluralRules: getPluralRules,
getListFormat: memoize(function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();
}, {
cache: createFastMemoizeCache(cache.list),
strategy: strategies.variadic,
}),
getDisplayNames: memoize(function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();
}, {
cache: createFastMemoizeCache(cache.displayNames),
strategy: strategies.variadic,
}),
};
}
export function getNamedFormat(formats, type, name, onError) {
var formatType = formats && formats[type];
var format;
if (formatType) {
format = formatType[name];
}
if (format) {
return format;
}
onError(new UnsupportedFormatterError("No ".concat(type, " format named: ").concat(name)));
}