@poe-platform/safe-js 0.1.467 → 0.1.469

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-37ZSIEHB.js";
30
+ } from "./chunk-J72Q6BW5.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-O4E2HABJ.js.map
8252
+ //# sourceMappingURL=chunk-566GCASZ.js.map
@@ -1,7 +1,3 @@
1
- import {
2
- __export
3
- } from "./chunk-4YIDX44G.js";
4
-
5
1
  // packages/safe-js/src/interp/internal-symbols.ts
6
2
  var internalSymbols = /* @__PURE__ */ new Set();
7
3
 
@@ -11230,14 +11226,6 @@ function decodeBase64(text, alphabet, mode, budget, maxLength = Number.MAX_SAFE_
11230
11226
  }
11231
11227
  }
11232
11228
 
11233
- // packages/safe-js/src/interp/numberformat-portable.ts
11234
- var numberformat_portable_exports = {};
11235
- __export(numberformat_portable_exports, {
11236
- createPortableNumberFormatter: () => createPortableNumberFormatter,
11237
- numberFormatterOptions: () => numberFormatterOptions,
11238
- numberFormatterResult: () => numberFormatterResult
11239
- });
11240
-
11241
11229
  // packages/safe-js/src/intl-data/dist/pluralrules-engine.js
11242
11230
  import { LookupSupportedLocales, ResolveLocale } from "@formatjs/intl-localematcher";
11243
11231
  import Decimal$1, { Decimal } from "@formatjs/bigdecimal";
@@ -16989,11 +16977,7 @@ var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);
16989
16977
  function IsSanctionedSimpleUnitIdentifier(unitIdentifier) {
16990
16978
  return SIMPLE_UNITS.indexOf(unitIdentifier) > -1;
16991
16979
  }
16992
- function toLowerCase(str) {
16993
- return str.replace(/([A-Z])/g, (_, c) => c.toLowerCase());
16994
- }
16995
16980
  function IsWellFormedUnitIdentifier(unit) {
16996
- unit = toLowerCase(unit);
16997
16981
  if (IsSanctionedSimpleUnitIdentifier(unit)) return true;
16998
16982
  const units = unit.split("-per-");
16999
16983
  if (units.length !== 2) return false;
@@ -18288,7 +18272,6 @@ var localeData = Object.freeze({
18288
18272
 
18289
18273
  // packages/safe-js/src/interp/numberformat-numbering.ts
18290
18274
  var NativeNumberFormat = Intl.NumberFormat;
18291
- var nativeUnits = new Set(Intl.supportedValuesOf("unit"));
18292
18275
  function localizeNumberParts(parts, locale, options) {
18293
18276
  parts = parts.flatMap((part) => {
18294
18277
  if (part.type !== "minusSign" && part.type !== "plusSign") return [part];
@@ -18302,16 +18285,12 @@ function localizeNumberParts(parts, locale, options) {
18302
18285
  return separated;
18303
18286
  });
18304
18287
  const numberingSystem = options.numberingSystem;
18305
- const pluralType = options.style === "unit" ? "unit" : options.style === "currency" && options.currencyDisplay === "name" ? "currency" : void 0;
18306
- const nativePlural = pluralType !== "unit" || typeof options.unit === "string" && options.unit.split("-per-").every((unit) => nativeUnits.has(unit));
18307
- const integralPlural = pluralType !== void 0 && nativePlural && options.notation === "standard" && !parts.some((part) => part.type === "fraction");
18308
- if (numberingSystem === "latn" && !integralPlural) return parts;
18288
+ if (numberingSystem === "latn") return parts;
18309
18289
  const digitFormatter = new NativeNumberFormat(locale, { numberingSystem, useGrouping: false });
18310
18290
  const digits = Array.from({ length: 10 }, (_, digit) => digitFormatter.formatToParts(digit).find((part) => part.type === "integer").value);
18311
18291
  const sourceFormatter = new NumberFormat(locale, { numberingSystem, useGrouping: false });
18312
18292
  const sourceDigits = Array.from({ length: 10 }, (_, digit) => sourceFormatter.formatToParts(digit).find((part) => part.type === "integer").value);
18313
18293
  const result = [];
18314
- let roundedInteger;
18315
18294
  for (let index = 0; index < parts.length; index++) {
18316
18295
  const part = parts[index];
18317
18296
  if (part.type === "exponentMinusSign") {
@@ -18344,7 +18323,6 @@ function localizeNumberParts(parts, locale, options) {
18344
18323
  const digit = sourceDigits.indexOf(char);
18345
18324
  return digit < 0 ? char : String(digit);
18346
18325
  }).join("");
18347
- roundedInteger = ascii;
18348
18326
  const grouping = options.useGrouping;
18349
18327
  const formatter = new NativeNumberFormat(locale, {
18350
18328
  numberingSystem,
@@ -18370,21 +18348,6 @@ function localizeNumberParts(parts, locale, options) {
18370
18348
  }
18371
18349
  for (const value of grouped) result.push({ ...part, type: value.type, value: value.value });
18372
18350
  }
18373
- if (integralPlural && roundedInteger !== void 0) {
18374
- const native = new NativeNumberFormat(locale, {
18375
- style: options.style,
18376
- unit: options.unit,
18377
- unitDisplay: options.unitDisplay,
18378
- currency: options.currency,
18379
- currencyDisplay: "name",
18380
- maximumFractionDigits: 0,
18381
- minimumFractionDigits: 0
18382
- });
18383
- const word = native.formatToParts(BigInt(roundedInteger)).find((part) => part.type === pluralType)?.value;
18384
- if (word !== void 0) {
18385
- for (const part of result) if (part.type === pluralType) part.value = word;
18386
- }
18387
- }
18388
18351
  return result;
18389
18352
  }
18390
18353
  function addNumberingSystem(data, locale, numberingSystem) {
@@ -18509,15 +18472,19 @@ function numberFormatterResult(formatter, method, values) {
18509
18472
  // packages/safe-js/src/interp/numberformat-backend.ts
18510
18473
  var NativeNumberFormat3 = Intl.NumberFormat;
18511
18474
  var modernNative = new NativeNumberFormat3("en", { maximumFractionDigits: 0, ...{ roundingMode: "floor" } }).format(1.9) === "1" && typeof Object.getOwnPropertyDescriptor(NativeNumberFormat3.prototype, "formatRange")?.value === "function";
18512
- var portable = modernNative ? void 0 : numberformat_portable_exports;
18475
+ var portableFormatters = /* @__PURE__ */ new WeakSet();
18513
18476
  function createNumberFormatter(locales2, options) {
18514
- return portable === void 0 ? new NativeNumberFormat3(locales2, options) : portable.createPortableNumberFormatter(locales2, options);
18477
+ if (modernNative && options.style !== "unit" && !(options.style === "currency" && options.currencyDisplay === "name"))
18478
+ return new NativeNumberFormat3(locales2, options);
18479
+ const formatter = createPortableNumberFormatter(locales2, options);
18480
+ portableFormatters.add(formatter);
18481
+ return formatter;
18515
18482
  }
18516
18483
  function numberFormatterOptions2(formatter) {
18517
- return portable === void 0 ? { ...formatter.resolvedOptions() } : portable.numberFormatterOptions(formatter);
18484
+ return portableFormatters.has(formatter) ? numberFormatterOptions(formatter) : { ...formatter.resolvedOptions() };
18518
18485
  }
18519
18486
  function numberFormatterResult2(formatter, method, values) {
18520
- return portable === void 0 ? Reflect.apply(Reflect.get(formatter, method), formatter, values) : portable.numberFormatterResult(formatter, method, values);
18487
+ return portableFormatters.has(formatter) ? numberFormatterResult(formatter, method, values) : Reflect.apply(Reflect.get(formatter, method), formatter, values);
18521
18488
  }
18522
18489
 
18523
18490
  // packages/safe-js/src/interp/intl-digit-options.ts
@@ -56739,4 +56706,4 @@ authorization of the copyright holder.
56739
56706
  SPDX-License-Identifier: Unicode-3.0
56740
56707
 
56741
56708
  */
56742
- //# sourceMappingURL=chunk-37ZSIEHB.js.map
56709
+ //# sourceMappingURL=chunk-J72Q6BW5.js.map