@warp-ds/elements 2.1.0 → 2.1.1-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -723,9 +723,9 @@ var require_moo = __commonJS({
723
723
  }
724
724
  });
725
725
 
726
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js
726
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js
727
727
  var require_lexer = __commonJS({
728
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
728
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
729
729
  "use strict";
730
730
  var __importDefault = exports && exports.__importDefault || function(mod) {
731
731
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -738,7 +738,7 @@ var require_lexer = __commonJS({
738
738
  doubleapos: { match: "''", value: () => "'" },
739
739
  quoted: {
740
740
  lineBreaks: true,
741
- match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
741
+ match: /'[{}#](?:[^']|'')*'(?!')/u,
742
742
  value: (src) => src.slice(1, -1).replace(/''/g, "'")
743
743
  },
744
744
  argument: {
@@ -790,12 +790,13 @@ var require_lexer = __commonJS({
790
790
  }
791
791
  });
792
792
 
793
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js
793
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js
794
794
  var require_parser = __commonJS({
795
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js"(exports) {
795
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js"(exports) {
796
796
  "use strict";
797
797
  Object.defineProperty(exports, "__esModule", { value: true });
798
- exports.parse = exports.ParseError = void 0;
798
+ exports.ParseError = void 0;
799
+ exports.parse = parse2;
799
800
  var lexer_js_1 = require_lexer();
800
801
  var getContext = (lt) => ({
801
802
  offset: lt.offset,
@@ -861,8 +862,9 @@ var require_parser = __commonJS({
861
862
  }
862
863
  checkSelectKey(lt, type, key) {
863
864
  if (key[0] === "=") {
864
- if (type === "select")
865
+ if (type === "select") {
865
866
  throw new ParseError(lt, `The case ${key} is not valid with select`);
867
+ }
866
868
  } else if (type !== "select") {
867
869
  const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
868
870
  if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
@@ -880,10 +882,12 @@ var require_parser = __commonJS({
880
882
  for (const lt of this.lexer) {
881
883
  switch (lt.type) {
882
884
  case "offset":
883
- if (type === "select")
885
+ if (type === "select") {
884
886
  throw new ParseError(lt, "Unexpected plural offset for select");
885
- if (sel.cases.length > 0)
887
+ }
888
+ if (sel.cases.length > 0) {
886
889
  throw new ParseError(lt, "Plural offset must be set before cases");
890
+ }
887
891
  sel.pluralOffset = Number(lt.value);
888
892
  ctx.text += lt.text;
889
893
  ctx.lineBreaks += lt.lineBreaks;
@@ -923,11 +927,13 @@ var require_parser = __commonJS({
923
927
  const end = this.lexer.next();
924
928
  if (!end)
925
929
  throw new ParseError(null, "Unexpected message end");
926
- if (end.type !== "end")
930
+ if (end.type !== "end") {
927
931
  throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
932
+ }
928
933
  ctx.text += end.text;
929
- if (isSelectType(argType.value.toLowerCase()))
934
+ if (isSelectType(argType.value.toLowerCase())) {
930
935
  throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
936
+ }
931
937
  return {
932
938
  type: "function",
933
939
  arg: lt.value,
@@ -941,8 +947,9 @@ var require_parser = __commonJS({
941
947
  throw new ParseError(argType, msg);
942
948
  }
943
949
  let param = this.parseBody(this.strict ? false : inPlural);
944
- if (this.strict && param.length > 0)
950
+ if (this.strict && param.length > 0) {
945
951
  param = strictArgStyleParam(lt, param);
952
+ }
946
953
  return {
947
954
  type: "function",
948
955
  arg: lt.value,
@@ -952,10 +959,11 @@ var require_parser = __commonJS({
952
959
  };
953
960
  }
954
961
  case "select":
955
- if (isSelectType(argType.value))
962
+ if (isSelectType(argType.value)) {
956
963
  return this.parseSelect(lt, inPlural, ctx, argType.value);
957
- else
964
+ } else {
958
965
  throw new ParseError(argType, `Unexpected select type ${argType.value}`);
966
+ }
959
967
  default:
960
968
  throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
961
969
  }
@@ -1002,21 +1010,278 @@ var require_parser = __commonJS({
1002
1010
  const parser = new Parser(src, options);
1003
1011
  return parser.parse();
1004
1012
  }
1005
- exports.parse = parse2;
1006
1013
  }
1007
1014
  });
1008
1015
 
1009
1016
  // packages/breadcrumbs/index.js
1010
1017
  import { html } from "lit";
1011
1018
 
1012
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1019
+ // node_modules/.pnpm/@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-macros@3.1.0_typescri_qfhfd5z2jpd4amxt2golzdalsi/node_modules/@lingui/core/dist/index.mjs
1013
1020
  var import_unraw = __toESM(require_dist(), 1);
1014
1021
 
1015
- // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1022
+ // node_modules/.pnpm/@lingui+message-utils@5.2.0/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1016
1023
  var import_parser = __toESM(require_parser(), 1);
1024
+ var DateFormatError = class extends Error {
1025
+ /** @internal */
1026
+ constructor(msg, token, type) {
1027
+ super(msg);
1028
+ this.token = token;
1029
+ this.type = type || "error";
1030
+ }
1031
+ };
1032
+ var alpha = (width) => width < 4 ? "short" : width === 4 ? "long" : "narrow";
1033
+ var numeric = (width) => width % 2 === 0 ? "2-digit" : "numeric";
1034
+ function yearOptions(token, onError) {
1035
+ switch (token.char) {
1036
+ case "y":
1037
+ return { year: numeric(token.width) };
1038
+ case "r":
1039
+ return { calendar: "gregory", year: "numeric" };
1040
+ case "u":
1041
+ case "U":
1042
+ case "Y":
1043
+ default:
1044
+ onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);
1045
+ return { year: "numeric" };
1046
+ }
1047
+ }
1048
+ function monthStyle(token, onError) {
1049
+ switch (token.width) {
1050
+ case 1:
1051
+ return "numeric";
1052
+ case 2:
1053
+ return "2-digit";
1054
+ case 3:
1055
+ return "short";
1056
+ case 4:
1057
+ return "long";
1058
+ case 5:
1059
+ return "narrow";
1060
+ default:
1061
+ onError(`${token.desc} is not supported with width ${token.width}`);
1062
+ return void 0;
1063
+ }
1064
+ }
1065
+ function dayStyle(token, onError) {
1066
+ const { char, desc, width } = token;
1067
+ if (char === "d") {
1068
+ return numeric(width);
1069
+ } else {
1070
+ onError(`${desc} is not supported`);
1071
+ return void 0;
1072
+ }
1073
+ }
1074
+ function weekdayStyle(token, onError) {
1075
+ const { char, desc, width } = token;
1076
+ if ((char === "c" || char === "e") && width < 3) {
1077
+ const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;
1078
+ onError(msg, DateFormatError.WARNING);
1079
+ }
1080
+ return alpha(width);
1081
+ }
1082
+ function hourOptions(token) {
1083
+ const hour = numeric(token.width);
1084
+ let hourCycle;
1085
+ switch (token.char) {
1086
+ case "h":
1087
+ hourCycle = "h12";
1088
+ break;
1089
+ case "H":
1090
+ hourCycle = "h23";
1091
+ break;
1092
+ case "k":
1093
+ hourCycle = "h24";
1094
+ break;
1095
+ case "K":
1096
+ hourCycle = "h11";
1097
+ break;
1098
+ }
1099
+ return hourCycle ? { hour, hourCycle } : { hour };
1100
+ }
1101
+ function timeZoneNameStyle(token, onError) {
1102
+ const { char, desc, width } = token;
1103
+ switch (char) {
1104
+ case "v":
1105
+ case "z":
1106
+ return width === 4 ? "long" : "short";
1107
+ case "V":
1108
+ if (width === 4)
1109
+ return "long";
1110
+ onError(`${desc} is not supported with width ${width}`);
1111
+ return void 0;
1112
+ case "X":
1113
+ onError(`${desc} is not supported`);
1114
+ return void 0;
1115
+ }
1116
+ return "short";
1117
+ }
1118
+ function compileOptions(token, onError) {
1119
+ switch (token.field) {
1120
+ case "era":
1121
+ return { era: alpha(token.width) };
1122
+ case "year":
1123
+ return yearOptions(token, onError);
1124
+ case "month":
1125
+ return { month: monthStyle(token, onError) };
1126
+ case "day":
1127
+ return { day: dayStyle(token, onError) };
1128
+ case "weekday":
1129
+ return { weekday: weekdayStyle(token, onError) };
1130
+ case "period":
1131
+ return void 0;
1132
+ case "hour":
1133
+ return hourOptions(token);
1134
+ case "min":
1135
+ return { minute: numeric(token.width) };
1136
+ case "sec":
1137
+ return { second: numeric(token.width) };
1138
+ case "tz":
1139
+ return { timeZoneName: timeZoneNameStyle(token, onError) };
1140
+ case "quarter":
1141
+ case "week":
1142
+ case "sec-frac":
1143
+ case "ms":
1144
+ onError(`${token.desc} is not supported`);
1145
+ }
1146
+ return void 0;
1147
+ }
1148
+ function getDateFormatOptions(tokens, timeZone, onError = (error) => {
1149
+ throw error;
1150
+ }) {
1151
+ const options = {
1152
+ timeZone
1153
+ };
1154
+ const fields2 = [];
1155
+ for (const token of tokens) {
1156
+ const { error, field, str } = token;
1157
+ if (error) {
1158
+ const dte = new DateFormatError(error.message, token);
1159
+ dte.stack = error.stack;
1160
+ onError(dte);
1161
+ }
1162
+ if (str) {
1163
+ const msg = `Ignoring string part: ${str}`;
1164
+ onError(new DateFormatError(msg, token, DateFormatError.WARNING));
1165
+ }
1166
+ if (field) {
1167
+ if (fields2.indexOf(field) === -1)
1168
+ fields2.push(field);
1169
+ else
1170
+ onError(new DateFormatError(`Duplicate ${field} token`, token));
1171
+ }
1172
+ const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));
1173
+ if (opt)
1174
+ Object.assign(options, opt);
1175
+ }
1176
+ return options;
1177
+ }
1178
+ var fields = {
1179
+ G: { field: "era", desc: "Era" },
1180
+ y: { field: "year", desc: "Year" },
1181
+ Y: { field: "year", desc: 'Year of "Week of Year"' },
1182
+ u: { field: "year", desc: "Extended year" },
1183
+ U: { field: "year", desc: "Cyclic year name" },
1184
+ r: { field: "year", desc: "Related Gregorian year" },
1185
+ Q: { field: "quarter", desc: "Quarter" },
1186
+ q: { field: "quarter", desc: "Stand-alone quarter" },
1187
+ M: { field: "month", desc: "Month in year" },
1188
+ L: { field: "month", desc: "Stand-alone month in year" },
1189
+ w: { field: "week", desc: "Week of year" },
1190
+ W: { field: "week", desc: "Week of month" },
1191
+ d: { field: "day", desc: "Day in month" },
1192
+ D: { field: "day", desc: "Day of year" },
1193
+ F: { field: "day", desc: "Day of week in month" },
1194
+ g: { field: "day", desc: "Modified julian day" },
1195
+ E: { field: "weekday", desc: "Day of week" },
1196
+ e: { field: "weekday", desc: "Local day of week" },
1197
+ c: { field: "weekday", desc: "Stand-alone local day of week" },
1198
+ a: { field: "period", desc: "AM/PM marker" },
1199
+ b: { field: "period", desc: "AM/PM/noon/midnight marker" },
1200
+ B: { field: "period", desc: "Flexible day period" },
1201
+ h: { field: "hour", desc: "Hour in AM/PM (1~12)" },
1202
+ H: { field: "hour", desc: "Hour in day (0~23)" },
1203
+ k: { field: "hour", desc: "Hour in day (1~24)" },
1204
+ K: { field: "hour", desc: "Hour in AM/PM (0~11)" },
1205
+ j: { field: "hour", desc: "Hour in preferred cycle" },
1206
+ J: { field: "hour", desc: "Hour in preferred cycle without marker" },
1207
+ C: { field: "hour", desc: "Hour in preferred cycle with flexible marker" },
1208
+ m: { field: "min", desc: "Minute in hour" },
1209
+ s: { field: "sec", desc: "Second in minute" },
1210
+ S: { field: "sec-frac", desc: "Fractional second" },
1211
+ A: { field: "ms", desc: "Milliseconds in day" },
1212
+ z: { field: "tz", desc: "Time Zone: specific non-location" },
1213
+ Z: { field: "tz", desc: "Time Zone" },
1214
+ O: { field: "tz", desc: "Time Zone: localized" },
1215
+ v: { field: "tz", desc: "Time Zone: generic non-location" },
1216
+ V: { field: "tz", desc: "Time Zone: ID" },
1217
+ X: { field: "tz", desc: "Time Zone: ISO8601 with Z" },
1218
+ x: { field: "tz", desc: "Time Zone: ISO8601" }
1219
+ };
1220
+ var isLetter = (char) => char >= "A" && char <= "Z" || char >= "a" && char <= "z";
1221
+ function readFieldToken(src, pos) {
1222
+ const char = src[pos];
1223
+ let width = 1;
1224
+ while (src[++pos] === char)
1225
+ ++width;
1226
+ const field = fields[char];
1227
+ if (!field) {
1228
+ const msg = `The letter ${char} is not a valid field identifier`;
1229
+ return { char, error: new Error(msg), width };
1230
+ }
1231
+ return { char, field: field.field, desc: field.desc, width };
1232
+ }
1233
+ function readQuotedToken(src, pos) {
1234
+ let str = src[++pos];
1235
+ let width = 2;
1236
+ if (str === "'")
1237
+ return { char: "'", str, width };
1238
+ while (true) {
1239
+ const next = src[++pos];
1240
+ ++width;
1241
+ if (next === void 0) {
1242
+ const msg = `Unterminated quoted literal in pattern: ${str || src}`;
1243
+ return { char: "'", error: new Error(msg), str, width };
1244
+ } else if (next === "'") {
1245
+ if (src[++pos] !== "'")
1246
+ return { char: "'", str, width };
1247
+ else
1248
+ ++width;
1249
+ }
1250
+ str += next;
1251
+ }
1252
+ }
1253
+ function readToken(src, pos) {
1254
+ const char = src[pos];
1255
+ if (!char)
1256
+ return null;
1257
+ if (isLetter(char))
1258
+ return readFieldToken(src, pos);
1259
+ if (char === "'")
1260
+ return readQuotedToken(src, pos);
1261
+ let str = char;
1262
+ let width = 1;
1263
+ while (true) {
1264
+ const next = src[++pos];
1265
+ if (!next || isLetter(next) || next === "'")
1266
+ return { char, str, width };
1267
+ str += next;
1268
+ width += 1;
1269
+ }
1270
+ }
1271
+ function parseDateTokens(src) {
1272
+ const tokens = [];
1273
+ let pos = 0;
1274
+ while (true) {
1275
+ const token = readToken(src, pos);
1276
+ if (!token)
1277
+ return tokens;
1278
+ tokens.push(token);
1279
+ pos += token.width;
1280
+ }
1281
+ }
1017
1282
  function processTokens(tokens, mapText) {
1018
1283
  if (!tokens.filter((token) => token.type !== "content").length) {
1019
- return tokens.map((token) => mapText(token.value)).join("");
1284
+ return tokens.map((token) => mapText(token.value));
1020
1285
  }
1021
1286
  return tokens.map((token) => {
1022
1287
  var _a;
@@ -1028,6 +1293,12 @@ function processTokens(tokens, mapText) {
1028
1293
  return [token.arg];
1029
1294
  } else if (token.type === "function") {
1030
1295
  const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
1296
+ if (token.key === "date" && _param) {
1297
+ const opts = compileDateExpression(_param.value.trim(), (e) => {
1298
+ throw new Error(`Unable to compile date expression: ${e.message}`);
1299
+ });
1300
+ return [token.arg, token.key, opts];
1301
+ }
1031
1302
  if (_param) {
1032
1303
  return [token.arg, token.key, _param.value.trim()];
1033
1304
  } else {
@@ -1049,6 +1320,13 @@ function processTokens(tokens, mapText) {
1049
1320
  ];
1050
1321
  });
1051
1322
  }
1323
+ function compileDateExpression(format, onError) {
1324
+ if (/^::/.test(format)) {
1325
+ const tokens = parseDateTokens(format.substring(2));
1326
+ return getDateFormatOptions(tokens, void 0, onError);
1327
+ }
1328
+ return format;
1329
+ }
1052
1330
  function compileMessage(message, mapText = (v) => v) {
1053
1331
  try {
1054
1332
  return processTokens((0, import_parser.parse)(message), mapText);
@@ -1056,11 +1334,11 @@ function compileMessage(message, mapText = (v) => v) {
1056
1334
  console.error(`${e.message}
1057
1335
 
1058
1336
  Message: ${message}`);
1059
- return message;
1337
+ return [message];
1060
1338
  }
1061
1339
  }
1062
1340
 
1063
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1341
+ // node_modules/.pnpm/@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-macros@3.1.0_typescri_qfhfd5z2jpd4amxt2golzdalsi/node_modules/@lingui/core/dist/index.mjs
1064
1342
  var isString = (s) => typeof s === "string";
1065
1343
  var isFunction = (f) => typeof f === "function";
1066
1344
  var cache = /* @__PURE__ */ new Map();
@@ -1071,12 +1349,59 @@ function normalizeLocales(locales) {
1071
1349
  }
1072
1350
  function date(locales, value, format) {
1073
1351
  const _locales = normalizeLocales(locales);
1352
+ if (!format) {
1353
+ format = "default";
1354
+ }
1355
+ let o;
1356
+ if (typeof format === "string") {
1357
+ o = {
1358
+ day: "numeric",
1359
+ month: "short",
1360
+ year: "numeric"
1361
+ };
1362
+ switch (format) {
1363
+ case "full":
1364
+ o.weekday = "long";
1365
+ case "long":
1366
+ o.month = "long";
1367
+ break;
1368
+ case "short":
1369
+ o.month = "numeric";
1370
+ break;
1371
+ }
1372
+ } else {
1373
+ o = format;
1374
+ }
1074
1375
  const formatter = getMemoized(
1075
1376
  () => cacheKey("date", _locales, format),
1076
- () => new Intl.DateTimeFormat(_locales, format)
1377
+ () => new Intl.DateTimeFormat(_locales, o)
1077
1378
  );
1078
1379
  return formatter.format(isString(value) ? new Date(value) : value);
1079
1380
  }
1381
+ function time(locales, value, format) {
1382
+ let o;
1383
+ if (!format) {
1384
+ format = "default";
1385
+ }
1386
+ if (typeof format === "string") {
1387
+ o = {
1388
+ second: "numeric",
1389
+ minute: "numeric",
1390
+ hour: "numeric"
1391
+ };
1392
+ switch (format) {
1393
+ case "full":
1394
+ case "long":
1395
+ o.timeZoneName = "short";
1396
+ break;
1397
+ case "short":
1398
+ delete o.second;
1399
+ }
1400
+ } else {
1401
+ o = format;
1402
+ }
1403
+ return date(locales, value, o);
1404
+ }
1080
1405
  function number(locales, value, format) {
1081
1406
  const _locales = normalizeLocales(locales);
1082
1407
  const formatter = getMemoized(
@@ -1111,12 +1436,14 @@ function cacheKey(type, locales, options) {
1111
1436
  const localeKey = locales.join("-");
1112
1437
  return `${type}-${localeKey}-${JSON.stringify(options)}`;
1113
1438
  }
1114
- var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1439
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;
1115
1440
  var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1116
1441
  var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1117
1442
  const locales = passedLocales || locale;
1118
1443
  const style = (format) => {
1119
- return typeof format === "object" ? format : formats[format] || { style: format };
1444
+ if (typeof format === "object")
1445
+ return format;
1446
+ return formats[format];
1120
1447
  };
1121
1448
  const replaceOctothorpe = (value, message) => {
1122
1449
  const numberFormat = Object.keys(formats).length ? style("number") : void 0;
@@ -1135,8 +1462,13 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1135
1462
  return replaceOctothorpe(value - offset, message);
1136
1463
  },
1137
1464
  select: selectFormatter,
1138
- number: (value, format) => number(locales, value, style(format)),
1139
- date: (value, format) => date(locales, value, style(format))
1465
+ number: (value, format) => number(
1466
+ locales,
1467
+ value,
1468
+ style(format) || { style: format }
1469
+ ),
1470
+ date: (value, format) => date(locales, value, style(format) || format),
1471
+ time: (value, format) => time(locales, value, style(format) || format)
1140
1472
  };
1141
1473
  };
1142
1474
  var selectFormatter = (value, rules) => {
@@ -1185,10 +1517,10 @@ function interpolate(translation, locale, locales) {
1185
1517
  };
1186
1518
  const result = formatMessage(translation);
1187
1519
  if (isString(result) && UNICODE_REGEX.test(result)) {
1188
- return (0, import_unraw.unraw)(result.trim());
1520
+ return (0, import_unraw.unraw)(result);
1189
1521
  }
1190
1522
  if (isString(result))
1191
- return result.trim();
1523
+ return result;
1192
1524
  return result ? String(result) : "";
1193
1525
  };
1194
1526
  }
@@ -1243,7 +1575,11 @@ var I18n = class extends EventEmitter {
1243
1575
  __publicField2(this, "_localeData", {});
1244
1576
  __publicField2(this, "_messages", {});
1245
1577
  __publicField2(this, "_missing");
1578
+ __publicField2(this, "_messageCompiler");
1246
1579
  __publicField2(this, "t", this._.bind(this));
1580
+ if (true) {
1581
+ this.setMessagesCompiler(compileMessage);
1582
+ }
1247
1583
  if (params.missing != null)
1248
1584
  this._missing = params.missing;
1249
1585
  if (params.messages != null)
@@ -1279,12 +1615,30 @@ var I18n = class extends EventEmitter {
1279
1615
  Object.assign(maybeLocaleData, localeData);
1280
1616
  }
1281
1617
  }
1618
+ /**
1619
+ * Registers a `MessageCompiler` to enable the use of uncompiled catalogs at runtime.
1620
+ *
1621
+ * In production builds, the `MessageCompiler` is typically excluded to reduce bundle size.
1622
+ * By default, message catalogs should be precompiled during the build process. However,
1623
+ * if you need to compile catalogs at runtime, you can use this method to set a message compiler.
1624
+ *
1625
+ * Example usage:
1626
+ *
1627
+ * ```ts
1628
+ * import { compileMessage } from "@lingui/message-utils/compileMessage";
1629
+ *
1630
+ * i18n.setMessagesCompiler(compileMessage);
1631
+ * ```
1632
+ */
1633
+ setMessagesCompiler(compiler) {
1634
+ this._messageCompiler = compiler;
1635
+ return this;
1636
+ }
1282
1637
  /**
1283
1638
  * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1284
1639
  */
1285
- // @ts-ignore deprecated, so ignore the reported error
1286
1640
  loadLocaleData(localeOrAllData, localeData) {
1287
- if (localeData != null) {
1641
+ if (typeof localeOrAllData === "string") {
1288
1642
  this._loadLocaleData(localeOrAllData, localeData);
1289
1643
  } else {
1290
1644
  Object.keys(localeOrAllData).forEach(
@@ -1331,6 +1685,11 @@ var I18n = class extends EventEmitter {
1331
1685
  this.emit("change");
1332
1686
  }
1333
1687
  _(id, values, options) {
1688
+ if (!this.locale) {
1689
+ throw new Error(
1690
+ "Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic."
1691
+ );
1692
+ }
1334
1693
  let message = options == null ? void 0 : options.message;
1335
1694
  if (!id) {
1336
1695
  id = "";
@@ -1350,8 +1709,20 @@ var I18n = class extends EventEmitter {
1350
1709
  this.emit("missing", { id, locale: this._locale });
1351
1710
  }
1352
1711
  let translation = messageForId || message || id;
1353
- if (true) {
1354
- translation = isString(translation) ? compileMessage(translation) : translation;
1712
+ if (isString(translation)) {
1713
+ if (this._messageCompiler) {
1714
+ translation = this._messageCompiler(translation);
1715
+ } else {
1716
+ console.warn(`Uncompiled message detected! Message:
1717
+
1718
+ > ${translation}
1719
+
1720
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
1721
+ ICU features such as interpolation and plurals will not work properly for that message.
1722
+
1723
+ Please compile your catalog first.
1724
+ `);
1725
+ }
1355
1726
  }
1356
1727
  if (isString(translation) && UNICODE_REGEX.test(translation))
1357
1728
  return JSON.parse(`"${translation}"`);
@@ -1375,12 +1746,12 @@ function setupI18n(params = {}) {
1375
1746
  }
1376
1747
  var i18n = setupI18n();
1377
1748
 
1378
- // node_modules/.pnpm/@warp-ds+core@1.1.8_@floating-ui+dom@1.6.10/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
1749
+ // node_modules/.pnpm/@warp-ds+core@1.1.8_@floating-ui+dom@1.6.13/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
1379
1750
  function interleave(array, separator2) {
1380
1751
  return array.flatMap((el) => [el, separator2]).slice(0, -1);
1381
1752
  }
1382
1753
 
1383
- // node_modules/.pnpm/@warp-ds+css@2.0.0_@warp-ds+uno@2.0.0_unocss@0.62.0_postcss@8.4.41_rollup@4.20.0_vite@5.3.3_@_vyiy5vwpqfzwy5hpmfkwp3zmle/node_modules/@warp-ds/css/component-classes/index.js
1754
+ // node_modules/.pnpm/@warp-ds+css@2.1.1_@warp-ds+uno@2.1.0_unocss@0.62.0_postcss@8.5.1_rollup@4.32.1_vite@5.3.3_@t_sgrraibu65gdmqpe655kfrpl6a/node_modules/@warp-ds/css/component-classes/index.js
1384
1755
  var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1385
1756
  var buttonColors = {
1386
1757
  primary: "s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",
@@ -1672,19 +2043,19 @@ function kebabCaseAttributes(constructor) {
1672
2043
  }
1673
2044
 
1674
2045
  // packages/breadcrumbs/locales/da/messages.mjs
1675
- var messages = JSON.parse('{"breadcrumbs.ariaLabel":"Du er her"}');
2046
+ var messages = JSON.parse('{"breadcrumbs.ariaLabel":["Du er her"]}');
1676
2047
 
1677
2048
  // packages/breadcrumbs/locales/en/messages.mjs
1678
- var messages2 = JSON.parse('{"breadcrumbs.ariaLabel":"You are here"}');
2049
+ var messages2 = JSON.parse('{"breadcrumbs.ariaLabel":["You are here"]}');
1679
2050
 
1680
2051
  // packages/breadcrumbs/locales/fi/messages.mjs
1681
- var messages3 = JSON.parse('{"breadcrumbs.ariaLabel":"Olet t\xE4ss\xE4"}');
2052
+ var messages3 = JSON.parse('{"breadcrumbs.ariaLabel":["Olet t\xE4ss\xE4"]}');
1682
2053
 
1683
2054
  // packages/breadcrumbs/locales/nb/messages.mjs
1684
- var messages4 = JSON.parse('{"breadcrumbs.ariaLabel":"Her er du"}');
2055
+ var messages4 = JSON.parse('{"breadcrumbs.ariaLabel":["Her er du"]}');
1685
2056
 
1686
2057
  // packages/breadcrumbs/locales/sv/messages.mjs
1687
- var messages5 = JSON.parse('{"breadcrumbs.ariaLabel":"Du \xE4r h\xE4r"}');
2058
+ var messages5 = JSON.parse('{"breadcrumbs.ariaLabel":["Du \xE4r h\xE4r"]}');
1688
2059
 
1689
2060
  // packages/breadcrumbs/index.js
1690
2061
  var separator = html`<span class=${breadcrumbs.separator}>/</span>`;