{"version":3,"file":"DateTime.shared.cjs","names":["getFormatLocales"],"sources":["../../../src/components/variables/DateTime.shared.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport { getFormatLocales } from '../../hooks/utils/getFormatLocales';\n\n// Pure compute logic shared by the hook-based and RSC implementations. This\n// module must stay free of hook/context imports so it can be reached from the\n// components-rsc entrypoint.\n\ntype DateTimeProps = {\n  children: Date | null | undefined;\n  locales?: string[];\n  options?: Intl.DateTimeFormatOptions;\n  name?: string;\n  _locale?: string;\n  _enableI18n?: boolean;\n};\n\ntype ResolvedDateTimeProps = DateTimeProps & {\n  _locale: string;\n  _enableI18n: boolean;\n};\n\nfunction computeDateTime({\n  _enableI18n,\n  _locale,\n  children,\n  options = {},\n  locales: localesProp = [],\n}: ResolvedDateTimeProps): string | null {\n  const locales = getFormatLocales({\n    locale: _locale,\n    enableI18n: _enableI18n,\n    localesProp,\n  });\n  // TODO: theres a world in which we don't need the i18n cache, if user passes their own params\n  const gt = getI18nConfig().getGTClass();\n  if (children == null) return null;\n  return gt\n    .formatDateTime(children, { locales, ...options })\n    .replace(/[\\u200F\\u202B\\u202E]/g, '');\n}\n\nexport { computeDateTime };\nexport type { DateTimeProps, ResolvedDateTimeProps };\n"],"mappings":"4IAqBA,SAAS,EAAgB,CACvB,cACA,UACA,WACA,UAAU,EAAE,CACZ,QAAS,EAAc,EAAE,EACc,CACvC,IAAM,EAAUA,EAAAA,iBAAiB,CAC/B,OAAQ,EACR,WAAY,EACZ,cACD,CAAC,CAEI,GAAA,EAAA,EAAA,gBAAoB,CAAC,YAAY,CAEvC,OADI,GAAY,KAAa,KACtB,EACJ,eAAe,EAAU,CAAE,UAAS,GAAG,EAAS,CAAC,CACjD,QAAQ,wBAAyB,GAAG"}