@steedos/webapp 3.0.1 → 3.0.2-beta.4

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.
@@ -1600,10 +1600,10 @@
1600
1600
  var SHARED = "__core-js_shared__";
1601
1601
  var store2 = sharedStore.exports = globalThis2[SHARED] || defineGlobalProperty2(SHARED, {});
1602
1602
  (store2.versions || (store2.versions = [])).push({
1603
- version: "3.46.0",
1603
+ version: "3.47.0",
1604
1604
  mode: IS_PURE ? "pure" : "global",
1605
1605
  copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",
1606
- license: "https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",
1606
+ license: "https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",
1607
1607
  source: "https://github.com/zloirock/core-js"
1608
1608
  });
1609
1609
  return sharedStore.exports;
@@ -3285,39 +3285,89 @@
3285
3285
  });
3286
3286
  return functionApply;
3287
3287
  }
3288
- var getJsonReplacerFunction;
3289
- var hasRequiredGetJsonReplacerFunction;
3290
- function requireGetJsonReplacerFunction() {
3291
- if (hasRequiredGetJsonReplacerFunction) return getJsonReplacerFunction;
3292
- hasRequiredGetJsonReplacerFunction = 1;
3288
+ var isRawJson;
3289
+ var hasRequiredIsRawJson;
3290
+ function requireIsRawJson() {
3291
+ if (hasRequiredIsRawJson) return isRawJson;
3292
+ hasRequiredIsRawJson = 1;
3293
+ var isObject2 = requireIsObject();
3294
+ var getInternalState = requireInternalState().get;
3295
+ isRawJson = function isRawJSON(O) {
3296
+ if (!isObject2(O)) return false;
3297
+ var state = getInternalState(O);
3298
+ return !!state && state.type === "RawJSON";
3299
+ };
3300
+ return isRawJson;
3301
+ }
3302
+ var parseJsonString;
3303
+ var hasRequiredParseJsonString;
3304
+ function requireParseJsonString() {
3305
+ if (hasRequiredParseJsonString) return parseJsonString;
3306
+ hasRequiredParseJsonString = 1;
3293
3307
  var uncurryThis = requireFunctionUncurryThis();
3294
- var isArray2 = requireIsArray();
3295
- var isCallable2 = requireIsCallable();
3296
- var classof2 = requireClassofRaw();
3297
- var toString2 = requireToString();
3298
- var push2 = uncurryThis([].push);
3299
- getJsonReplacerFunction = function(replacer) {
3300
- if (isCallable2(replacer)) return replacer;
3301
- if (!isArray2(replacer)) return;
3302
- var rawLength = replacer.length;
3303
- var keys2 = [];
3304
- for (var i = 0; i < rawLength; i++) {
3305
- var element2 = replacer[i];
3306
- if (typeof element2 == "string") push2(keys2, element2);
3307
- else if (typeof element2 == "number" || classof2(element2) === "Number" || classof2(element2) === "String") push2(keys2, toString2(element2));
3308
- }
3309
- var keysLength = keys2.length;
3310
- var root2 = true;
3311
- return function(key2, value2) {
3312
- if (root2) {
3313
- root2 = false;
3314
- return value2;
3308
+ var hasOwn = requireHasOwnProperty();
3309
+ var $SyntaxError = SyntaxError;
3310
+ var $parseInt = parseInt;
3311
+ var fromCharCode = String.fromCharCode;
3312
+ var at2 = uncurryThis("".charAt);
3313
+ var slice2 = uncurryThis("".slice);
3314
+ var exec = uncurryThis(/./.exec);
3315
+ var codePoints = {
3316
+ '\\"': '"',
3317
+ "\\\\": "\\",
3318
+ "\\/": "/",
3319
+ "\\b": "\b",
3320
+ "\\f": "\f",
3321
+ "\\n": "\n",
3322
+ "\\r": "\r",
3323
+ "\\t": " "
3324
+ };
3325
+ var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i;
3326
+ var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/;
3327
+ parseJsonString = function(source, i) {
3328
+ var unterminated = true;
3329
+ var value2 = "";
3330
+ while (i < source.length) {
3331
+ var chr = at2(source, i);
3332
+ if (chr === "\\") {
3333
+ var twoChars = slice2(source, i, i + 2);
3334
+ if (hasOwn(codePoints, twoChars)) {
3335
+ value2 += codePoints[twoChars];
3336
+ i += 2;
3337
+ } else if (twoChars === "\\u") {
3338
+ i += 2;
3339
+ var fourHexDigits = slice2(source, i, i + 4);
3340
+ if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError("Bad Unicode escape at: " + i);
3341
+ value2 += fromCharCode($parseInt(fourHexDigits, 16));
3342
+ i += 4;
3343
+ } else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
3344
+ } else if (chr === '"') {
3345
+ unterminated = false;
3346
+ i++;
3347
+ break;
3348
+ } else {
3349
+ if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError("Bad control character in string literal at: " + i);
3350
+ value2 += chr;
3351
+ i++;
3315
3352
  }
3316
- if (isArray2(this)) return value2;
3317
- for (var j = 0; j < keysLength; j++) if (keys2[j] === key2) return value2;
3318
- };
3353
+ }
3354
+ if (unterminated) throw new $SyntaxError("Unterminated string at: " + i);
3355
+ return { value: value2, end: i };
3319
3356
  };
3320
- return getJsonReplacerFunction;
3357
+ return parseJsonString;
3358
+ }
3359
+ var nativeRawJson;
3360
+ var hasRequiredNativeRawJson;
3361
+ function requireNativeRawJson() {
3362
+ if (hasRequiredNativeRawJson) return nativeRawJson;
3363
+ hasRequiredNativeRawJson = 1;
3364
+ var fails2 = requireFails();
3365
+ nativeRawJson = !fails2(function() {
3366
+ var unsafeInt = "9007199254740993";
3367
+ var raw = JSON.rawJSON(unsafeInt);
3368
+ return !JSON.isRawJSON(raw) || JSON.stringify(raw) !== unsafeInt;
3369
+ });
3370
+ return nativeRawJson;
3321
3371
  }
3322
3372
  var hasRequiredEs_json_stringify;
3323
3373
  function requireEs_json_stringify() {
@@ -3329,21 +3379,31 @@
3329
3379
  var call = requireFunctionCall();
3330
3380
  var uncurryThis = requireFunctionUncurryThis();
3331
3381
  var fails2 = requireFails();
3382
+ var isArray2 = requireIsArray();
3332
3383
  var isCallable2 = requireIsCallable();
3384
+ var isRawJSON = requireIsRawJson();
3333
3385
  var isSymbol2 = requireIsSymbol();
3386
+ var classof2 = requireClassofRaw();
3387
+ var toString2 = requireToString();
3334
3388
  var arraySlice2 = requireArraySlice();
3335
- var getReplacerFunction = requireGetJsonReplacerFunction();
3389
+ var parseJSONString = requireParseJsonString();
3390
+ var uid2 = requireUid();
3336
3391
  var NATIVE_SYMBOL = requireSymbolConstructorDetection();
3392
+ var NATIVE_RAW_JSON = requireNativeRawJson();
3337
3393
  var $String = String;
3338
3394
  var $stringify = getBuiltIn2("JSON", "stringify");
3339
3395
  var exec = uncurryThis(/./.exec);
3340
3396
  var charAt = uncurryThis("".charAt);
3341
3397
  var charCodeAt = uncurryThis("".charCodeAt);
3342
3398
  var replace2 = uncurryThis("".replace);
3399
+ var slice2 = uncurryThis("".slice);
3400
+ var push2 = uncurryThis([].push);
3343
3401
  var numberToString = uncurryThis(1.1.toString);
3344
- var tester = /[\uD800-\uDFFF]/g;
3345
- var low = /^[\uD800-\uDBFF]$/;
3346
- var hi = /^[\uDC00-\uDFFF]$/;
3402
+ var surrogates = /[\uD800-\uDFFF]/g;
3403
+ var lowSurrogates = /^[\uD800-\uDBFF]$/;
3404
+ var hiSurrogates = /^[\uDC00-\uDFFF]$/;
3405
+ var MARK = uid2();
3406
+ var MARK_LENGTH = MARK.length;
3347
3407
  var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails2(function() {
3348
3408
  var symbol2 = getBuiltIn2("Symbol")("stringify detection");
3349
3409
  return $stringify([symbol2]) !== "[null]" || $stringify({ a: symbol2 }) !== "{}" || $stringify(Object(symbol2)) !== "{}";
@@ -3351,7 +3411,7 @@
3351
3411
  var ILL_FORMED_UNICODE = fails2(function() {
3352
3412
  return $stringify("\uDF06\uD834") !== '"\\udf06\\ud834"' || $stringify("\uDEAD") !== '"\\udead"';
3353
3413
  });
3354
- var stringifyWithSymbolsFix = function(it, replacer) {
3414
+ var stringifyWithProperSymbolsConversion = WRONG_SYMBOLS_CONVERSION ? function(it, replacer) {
3355
3415
  var args = arraySlice2(arguments);
3356
3416
  var $replacer = getReplacerFunction(replacer);
3357
3417
  if (!isCallable2($replacer) && (it === void 0 || isSymbol2(it))) return;
@@ -3360,25 +3420,61 @@
3360
3420
  if (!isSymbol2(value2)) return value2;
3361
3421
  };
3362
3422
  return apply($stringify, null, args);
3363
- };
3364
- var fixIllFormed = function(match2, offset, string2) {
3423
+ } : $stringify;
3424
+ var fixIllFormedJSON = function(match2, offset, string2) {
3365
3425
  var prev = charAt(string2, offset - 1);
3366
3426
  var next = charAt(string2, offset + 1);
3367
- if (exec(low, match2) && !exec(hi, next) || exec(hi, match2) && !exec(low, prev)) {
3427
+ if (exec(lowSurrogates, match2) && !exec(hiSurrogates, next) || exec(hiSurrogates, match2) && !exec(lowSurrogates, prev)) {
3368
3428
  return "\\u" + numberToString(charCodeAt(match2, 0), 16);
3369
3429
  }
3370
3430
  return match2;
3371
3431
  };
3372
- if ($stringify) {
3373
- $2({ target: "JSON", stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
3374
- // eslint-disable-next-line no-unused-vars -- required for `.length`
3375
- stringify: function stringify2(it, replacer, space2) {
3376
- var args = arraySlice2(arguments);
3377
- var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
3378
- return ILL_FORMED_UNICODE && typeof result == "string" ? replace2(result, tester, fixIllFormed) : result;
3432
+ var getReplacerFunction = function(replacer) {
3433
+ if (isCallable2(replacer)) return replacer;
3434
+ if (!isArray2(replacer)) return;
3435
+ var rawLength = replacer.length;
3436
+ var keys2 = [];
3437
+ for (var i = 0; i < rawLength; i++) {
3438
+ var element2 = replacer[i];
3439
+ if (typeof element2 == "string") push2(keys2, element2);
3440
+ else if (typeof element2 == "number" || classof2(element2) === "Number" || classof2(element2) === "String") push2(keys2, toString2(element2));
3441
+ }
3442
+ var keysLength = keys2.length;
3443
+ var root2 = true;
3444
+ return function(key2, value2) {
3445
+ if (root2) {
3446
+ root2 = false;
3447
+ return value2;
3379
3448
  }
3380
- });
3381
- }
3449
+ if (isArray2(this)) return value2;
3450
+ for (var j = 0; j < keysLength; j++) if (keys2[j] === key2) return value2;
3451
+ };
3452
+ };
3453
+ if ($stringify) $2({ target: "JSON", stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON }, {
3454
+ stringify: function stringify2(text2, replacer, space2) {
3455
+ var replacerFunction = getReplacerFunction(replacer);
3456
+ var rawStrings = [];
3457
+ var json = stringifyWithProperSymbolsConversion(text2, function(key2, value2) {
3458
+ var v = isCallable2(replacerFunction) ? call(replacerFunction, this, $String(key2), value2) : value2;
3459
+ return !NATIVE_RAW_JSON && isRawJSON(v) ? MARK + (push2(rawStrings, v.rawJSON) - 1) : v;
3460
+ }, space2);
3461
+ if (typeof json != "string") return json;
3462
+ if (ILL_FORMED_UNICODE) json = replace2(json, surrogates, fixIllFormedJSON);
3463
+ if (NATIVE_RAW_JSON) return json;
3464
+ var result = "";
3465
+ var length = json.length;
3466
+ for (var i = 0; i < length; i++) {
3467
+ var chr = charAt(json, i);
3468
+ if (chr === '"') {
3469
+ var end = parseJSONString(json, ++i).end - 1;
3470
+ var string2 = slice2(json, i, end);
3471
+ result += slice2(string2, 0, MARK_LENGTH) === MARK ? rawStrings[slice2(string2, MARK_LENGTH)] : '"' + string2 + '"';
3472
+ i = end;
3473
+ } else result += chr;
3474
+ }
3475
+ return result;
3476
+ }
3477
+ });
3382
3478
  return es_json_stringify;
3383
3479
  }
3384
3480
  var es_object_getOwnPropertySymbols = {};
@@ -6237,9 +6333,7 @@
6237
6333
  new Set2()[name2](createSetLikeWithInfinitySize(-Infinity));
6238
6334
  return false;
6239
6335
  } catch (error) {
6240
- var set2 = new Set2();
6241
- set2.add(1);
6242
- set2.add(2);
6336
+ var set2 = new Set2([1, 2]);
6243
6337
  return callback(set2[name2](createSetLikeWithInfinitySize(Infinity)));
6244
6338
  }
6245
6339
  }
@@ -7589,7 +7683,7 @@
7589
7683
  var state = getInternalParamsState(this);
7590
7684
  validateArgumentsLength2(arguments.length, 2);
7591
7685
  push2(state.entries, { key: $toString(name2), value: $toString(value2) });
7592
- if (!DESCRIPTORS) this.length++;
7686
+ if (!DESCRIPTORS) this.size++;
7593
7687
  state.updateURL();
7594
7688
  },
7595
7689
  // `URLSearchParams.prototype.delete` method
@@ -8912,9 +9006,9 @@
8912
9006
  var host = this.host;
8913
9007
  return host === null ? "" : serializeHost(host);
8914
9008
  },
8915
- setHostname: function(hostname2) {
9009
+ setHostname: function(hostname) {
8916
9010
  if (this.cannotBeABaseURL) return;
8917
- this.parse(hostname2, HOSTNAME);
9011
+ this.parse(hostname, HOSTNAME);
8918
9012
  },
8919
9013
  // https://url.spec.whatwg.org/#dom-url-port
8920
9014
  getPort: function() {
@@ -12453,53 +12547,7 @@
12453
12547
  });
12454
12548
  return es_iterator_constructor;
12455
12549
  }
12456
- var es_iterator_dispose = {};
12457
- var hasRequiredEs_iterator_dispose;
12458
- function requireEs_iterator_dispose() {
12459
- if (hasRequiredEs_iterator_dispose) return es_iterator_dispose;
12460
- hasRequiredEs_iterator_dispose = 1;
12461
- var call = requireFunctionCall();
12462
- var defineBuiltIn2 = requireDefineBuiltIn();
12463
- var getMethod2 = requireGetMethod();
12464
- var hasOwn = requireHasOwnProperty();
12465
- var wellKnownSymbol2 = requireWellKnownSymbol();
12466
- var IteratorPrototype = requireIteratorsCore().IteratorPrototype;
12467
- var DISPOSE = wellKnownSymbol2("dispose");
12468
- if (!hasOwn(IteratorPrototype, DISPOSE)) {
12469
- defineBuiltIn2(IteratorPrototype, DISPOSE, function() {
12470
- var $return = getMethod2(this, "return");
12471
- if ($return) call($return, this);
12472
- });
12473
- }
12474
- return es_iterator_dispose;
12475
- }
12476
- var es_iterator_drop = {};
12477
- var notANan;
12478
- var hasRequiredNotANan;
12479
- function requireNotANan() {
12480
- if (hasRequiredNotANan) return notANan;
12481
- hasRequiredNotANan = 1;
12482
- var $RangeError = RangeError;
12483
- notANan = function(it) {
12484
- if (it === it) return it;
12485
- throw new $RangeError("NaN is not allowed");
12486
- };
12487
- return notANan;
12488
- }
12489
- var toPositiveInteger;
12490
- var hasRequiredToPositiveInteger;
12491
- function requireToPositiveInteger() {
12492
- if (hasRequiredToPositiveInteger) return toPositiveInteger;
12493
- hasRequiredToPositiveInteger = 1;
12494
- var toIntegerOrInfinity2 = requireToIntegerOrInfinity();
12495
- var $RangeError = RangeError;
12496
- toPositiveInteger = function(it) {
12497
- var result = toIntegerOrInfinity2(it);
12498
- if (result < 0) throw new $RangeError("The argument can't be less than 0");
12499
- return result;
12500
- };
12501
- return toPositiveInteger;
12502
- }
12550
+ var es_iterator_concat = {};
12503
12551
  var iteratorCloseAll;
12504
12552
  var hasRequiredIteratorCloseAll;
12505
12553
  function requireIteratorCloseAll() {
@@ -12602,6 +12650,109 @@
12602
12650
  };
12603
12651
  return iteratorCreateProxy;
12604
12652
  }
12653
+ var hasRequiredEs_iterator_concat;
12654
+ function requireEs_iterator_concat() {
12655
+ if (hasRequiredEs_iterator_concat) return es_iterator_concat;
12656
+ hasRequiredEs_iterator_concat = 1;
12657
+ var $2 = require_export();
12658
+ var call = requireFunctionCall();
12659
+ var aCallable2 = requireACallable();
12660
+ var anObject2 = requireAnObject();
12661
+ var getIteratorMethod2 = requireGetIteratorMethod();
12662
+ var createIteratorProxy = requireIteratorCreateProxy();
12663
+ var $Array = Array;
12664
+ var IteratorProxy = createIteratorProxy(function() {
12665
+ while (true) {
12666
+ var iterator2 = this.iterator;
12667
+ if (!iterator2) {
12668
+ var iterableIndex = this.nextIterableIndex++;
12669
+ var iterables = this.iterables;
12670
+ if (iterableIndex >= iterables.length) {
12671
+ this.done = true;
12672
+ return;
12673
+ }
12674
+ var entry = iterables[iterableIndex];
12675
+ this.iterables[iterableIndex] = null;
12676
+ iterator2 = this.iterator = call(entry.method, entry.iterable);
12677
+ this.next = iterator2.next;
12678
+ }
12679
+ var result = anObject2(call(this.next, iterator2));
12680
+ if (result.done) {
12681
+ this.iterator = null;
12682
+ this.next = null;
12683
+ continue;
12684
+ }
12685
+ return result.value;
12686
+ }
12687
+ });
12688
+ $2({ target: "Iterator", stat: true }, {
12689
+ concat: function concat() {
12690
+ var length = arguments.length;
12691
+ var iterables = $Array(length);
12692
+ for (var index2 = 0; index2 < length; index2++) {
12693
+ var item = anObject2(arguments[index2]);
12694
+ iterables[index2] = {
12695
+ iterable: item,
12696
+ method: aCallable2(getIteratorMethod2(item))
12697
+ };
12698
+ }
12699
+ return new IteratorProxy({
12700
+ iterables,
12701
+ nextIterableIndex: 0,
12702
+ iterator: null,
12703
+ next: null
12704
+ });
12705
+ }
12706
+ });
12707
+ return es_iterator_concat;
12708
+ }
12709
+ var es_iterator_dispose = {};
12710
+ var hasRequiredEs_iterator_dispose;
12711
+ function requireEs_iterator_dispose() {
12712
+ if (hasRequiredEs_iterator_dispose) return es_iterator_dispose;
12713
+ hasRequiredEs_iterator_dispose = 1;
12714
+ var call = requireFunctionCall();
12715
+ var defineBuiltIn2 = requireDefineBuiltIn();
12716
+ var getMethod2 = requireGetMethod();
12717
+ var hasOwn = requireHasOwnProperty();
12718
+ var wellKnownSymbol2 = requireWellKnownSymbol();
12719
+ var IteratorPrototype = requireIteratorsCore().IteratorPrototype;
12720
+ var DISPOSE = wellKnownSymbol2("dispose");
12721
+ if (!hasOwn(IteratorPrototype, DISPOSE)) {
12722
+ defineBuiltIn2(IteratorPrototype, DISPOSE, function() {
12723
+ var $return = getMethod2(this, "return");
12724
+ if ($return) call($return, this);
12725
+ });
12726
+ }
12727
+ return es_iterator_dispose;
12728
+ }
12729
+ var es_iterator_drop = {};
12730
+ var notANan;
12731
+ var hasRequiredNotANan;
12732
+ function requireNotANan() {
12733
+ if (hasRequiredNotANan) return notANan;
12734
+ hasRequiredNotANan = 1;
12735
+ var $RangeError = RangeError;
12736
+ notANan = function(it) {
12737
+ if (it === it) return it;
12738
+ throw new $RangeError("NaN is not allowed");
12739
+ };
12740
+ return notANan;
12741
+ }
12742
+ var toPositiveInteger;
12743
+ var hasRequiredToPositiveInteger;
12744
+ function requireToPositiveInteger() {
12745
+ if (hasRequiredToPositiveInteger) return toPositiveInteger;
12746
+ hasRequiredToPositiveInteger = 1;
12747
+ var toIntegerOrInfinity2 = requireToIntegerOrInfinity();
12748
+ var $RangeError = RangeError;
12749
+ toPositiveInteger = function(it) {
12750
+ var result = toIntegerOrInfinity2(it);
12751
+ if (result < 0) throw new $RangeError("The argument can't be less than 0");
12752
+ return result;
12753
+ };
12754
+ return toPositiveInteger;
12755
+ }
12605
12756
  var iteratorHelperThrowsOnInvalidIterator;
12606
12757
  var hasRequiredIteratorHelperThrowsOnInvalidIterator;
12607
12758
  function requireIteratorHelperThrowsOnInvalidIterator() {
@@ -13129,6 +13280,295 @@
13129
13280
  });
13130
13281
  return es_iterator_toArray;
13131
13282
  }
13283
+ var es_json_isRawJson = {};
13284
+ var hasRequiredEs_json_isRawJson;
13285
+ function requireEs_json_isRawJson() {
13286
+ if (hasRequiredEs_json_isRawJson) return es_json_isRawJson;
13287
+ hasRequiredEs_json_isRawJson = 1;
13288
+ var $2 = require_export();
13289
+ var NATIVE_RAW_JSON = requireNativeRawJson();
13290
+ var isRawJSON = requireIsRawJson();
13291
+ $2({ target: "JSON", stat: true, forced: !NATIVE_RAW_JSON }, {
13292
+ isRawJSON
13293
+ });
13294
+ return es_json_isRawJson;
13295
+ }
13296
+ var es_json_parse = {};
13297
+ var hasRequiredEs_json_parse;
13298
+ function requireEs_json_parse() {
13299
+ if (hasRequiredEs_json_parse) return es_json_parse;
13300
+ hasRequiredEs_json_parse = 1;
13301
+ var $2 = require_export();
13302
+ var DESCRIPTORS = requireDescriptors();
13303
+ var globalThis2 = requireGlobalThis();
13304
+ var getBuiltIn2 = requireGetBuiltIn();
13305
+ var uncurryThis = requireFunctionUncurryThis();
13306
+ var call = requireFunctionCall();
13307
+ var isCallable2 = requireIsCallable();
13308
+ var isObject2 = requireIsObject();
13309
+ var isArray2 = requireIsArray();
13310
+ var hasOwn = requireHasOwnProperty();
13311
+ var toString2 = requireToString();
13312
+ var lengthOfArrayLike2 = requireLengthOfArrayLike();
13313
+ var createProperty2 = requireCreateProperty();
13314
+ var fails2 = requireFails();
13315
+ var parseJSONString = requireParseJsonString();
13316
+ var NATIVE_SYMBOL = requireSymbolConstructorDetection();
13317
+ var JSON2 = globalThis2.JSON;
13318
+ var Number2 = globalThis2.Number;
13319
+ var SyntaxError2 = globalThis2.SyntaxError;
13320
+ var nativeParse = JSON2 && JSON2.parse;
13321
+ var enumerableOwnProperties = getBuiltIn2("Object", "keys");
13322
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
13323
+ var at2 = uncurryThis("".charAt);
13324
+ var slice2 = uncurryThis("".slice);
13325
+ var exec = uncurryThis(/./.exec);
13326
+ var push2 = uncurryThis([].push);
13327
+ var IS_DIGIT = /^\d$/;
13328
+ var IS_NON_ZERO_DIGIT = /^[1-9]$/;
13329
+ var IS_NUMBER_START = /^[\d-]$/;
13330
+ var IS_WHITESPACE = /^[\t\n\r ]$/;
13331
+ var PRIMITIVE2 = 0;
13332
+ var OBJECT2 = 1;
13333
+ var $parse = function(source, reviver) {
13334
+ source = toString2(source);
13335
+ var context = new Context2(source, 0);
13336
+ var root2 = context.parse();
13337
+ var value2 = root2.value;
13338
+ var endIndex = context.skip(IS_WHITESPACE, root2.end);
13339
+ if (endIndex < source.length) {
13340
+ throw new SyntaxError2('Unexpected extra character: "' + at2(source, endIndex) + '" after the parsed data at: ' + endIndex);
13341
+ }
13342
+ return isCallable2(reviver) ? internalize({ "": value2 }, "", reviver, root2) : value2;
13343
+ };
13344
+ var internalize = function(holder, name2, reviver, node2) {
13345
+ var val = holder[name2];
13346
+ var unmodified = node2 && val === node2.value;
13347
+ var context = unmodified && typeof node2.source == "string" ? { source: node2.source } : {};
13348
+ var elementRecordsLen, keys2, len, i, P;
13349
+ if (isObject2(val)) {
13350
+ var nodeIsArray = isArray2(val);
13351
+ var nodes = unmodified ? node2.nodes : nodeIsArray ? [] : {};
13352
+ if (nodeIsArray) {
13353
+ elementRecordsLen = nodes.length;
13354
+ len = lengthOfArrayLike2(val);
13355
+ for (i = 0; i < len; i++) {
13356
+ internalizeProperty(val, i, internalize(val, "" + i, reviver, i < elementRecordsLen ? nodes[i] : void 0));
13357
+ }
13358
+ } else {
13359
+ keys2 = enumerableOwnProperties(val);
13360
+ len = lengthOfArrayLike2(keys2);
13361
+ for (i = 0; i < len; i++) {
13362
+ P = keys2[i];
13363
+ internalizeProperty(val, P, internalize(val, P, reviver, hasOwn(nodes, P) ? nodes[P] : void 0));
13364
+ }
13365
+ }
13366
+ }
13367
+ return call(reviver, holder, name2, val, context);
13368
+ };
13369
+ var internalizeProperty = function(object2, key2, value2) {
13370
+ if (DESCRIPTORS) {
13371
+ var descriptor = getOwnPropertyDescriptor(object2, key2);
13372
+ if (descriptor && !descriptor.configurable) return;
13373
+ }
13374
+ if (value2 === void 0) delete object2[key2];
13375
+ else createProperty2(object2, key2, value2);
13376
+ };
13377
+ var Node = function(value2, end, source, nodes) {
13378
+ this.value = value2;
13379
+ this.end = end;
13380
+ this.source = source;
13381
+ this.nodes = nodes;
13382
+ };
13383
+ var Context2 = function(source, index2) {
13384
+ this.source = source;
13385
+ this.index = index2;
13386
+ };
13387
+ Context2.prototype = {
13388
+ fork: function(nextIndex) {
13389
+ return new Context2(this.source, nextIndex);
13390
+ },
13391
+ parse: function() {
13392
+ var source = this.source;
13393
+ var i = this.skip(IS_WHITESPACE, this.index);
13394
+ var fork = this.fork(i);
13395
+ var chr = at2(source, i);
13396
+ if (exec(IS_NUMBER_START, chr)) return fork.number();
13397
+ switch (chr) {
13398
+ case "{":
13399
+ return fork.object();
13400
+ case "[":
13401
+ return fork.array();
13402
+ case '"':
13403
+ return fork.string();
13404
+ case "t":
13405
+ return fork.keyword(true);
13406
+ case "f":
13407
+ return fork.keyword(false);
13408
+ case "n":
13409
+ return fork.keyword(null);
13410
+ }
13411
+ throw new SyntaxError2('Unexpected character: "' + chr + '" at: ' + i);
13412
+ },
13413
+ node: function(type, value2, start, end, nodes) {
13414
+ return new Node(value2, end, type ? null : slice2(this.source, start, end), nodes);
13415
+ },
13416
+ object: function() {
13417
+ var source = this.source;
13418
+ var i = this.index + 1;
13419
+ var expectKeypair = false;
13420
+ var object2 = {};
13421
+ var nodes = {};
13422
+ while (i < source.length) {
13423
+ i = this.until(['"', "}"], i);
13424
+ if (at2(source, i) === "}" && !expectKeypair) {
13425
+ i++;
13426
+ break;
13427
+ }
13428
+ var result = this.fork(i).string();
13429
+ var key2 = result.value;
13430
+ i = result.end;
13431
+ i = this.until([":"], i) + 1;
13432
+ i = this.skip(IS_WHITESPACE, i);
13433
+ result = this.fork(i).parse();
13434
+ createProperty2(nodes, key2, result);
13435
+ createProperty2(object2, key2, result.value);
13436
+ i = this.until([",", "}"], result.end);
13437
+ var chr = at2(source, i);
13438
+ if (chr === ",") {
13439
+ expectKeypair = true;
13440
+ i++;
13441
+ } else if (chr === "}") {
13442
+ i++;
13443
+ break;
13444
+ }
13445
+ }
13446
+ return this.node(OBJECT2, object2, this.index, i, nodes);
13447
+ },
13448
+ array: function() {
13449
+ var source = this.source;
13450
+ var i = this.index + 1;
13451
+ var expectElement = false;
13452
+ var array2 = [];
13453
+ var nodes = [];
13454
+ while (i < source.length) {
13455
+ i = this.skip(IS_WHITESPACE, i);
13456
+ if (at2(source, i) === "]" && !expectElement) {
13457
+ i++;
13458
+ break;
13459
+ }
13460
+ var result = this.fork(i).parse();
13461
+ push2(nodes, result);
13462
+ push2(array2, result.value);
13463
+ i = this.until([",", "]"], result.end);
13464
+ if (at2(source, i) === ",") {
13465
+ expectElement = true;
13466
+ i++;
13467
+ } else if (at2(source, i) === "]") {
13468
+ i++;
13469
+ break;
13470
+ }
13471
+ }
13472
+ return this.node(OBJECT2, array2, this.index, i, nodes);
13473
+ },
13474
+ string: function() {
13475
+ var index2 = this.index;
13476
+ var parsed = parseJSONString(this.source, this.index + 1);
13477
+ return this.node(PRIMITIVE2, parsed.value, index2, parsed.end);
13478
+ },
13479
+ number: function() {
13480
+ var source = this.source;
13481
+ var startIndex = this.index;
13482
+ var i = startIndex;
13483
+ if (at2(source, i) === "-") i++;
13484
+ if (at2(source, i) === "0") i++;
13485
+ else if (exec(IS_NON_ZERO_DIGIT, at2(source, i))) i = this.skip(IS_DIGIT, i + 1);
13486
+ else throw new SyntaxError2("Failed to parse number at: " + i);
13487
+ if (at2(source, i) === ".") i = this.skip(IS_DIGIT, i + 1);
13488
+ if (at2(source, i) === "e" || at2(source, i) === "E") {
13489
+ i++;
13490
+ if (at2(source, i) === "+" || at2(source, i) === "-") i++;
13491
+ var exponentStartIndex = i;
13492
+ i = this.skip(IS_DIGIT, i);
13493
+ if (exponentStartIndex === i) throw new SyntaxError2("Failed to parse number's exponent value at: " + i);
13494
+ }
13495
+ return this.node(PRIMITIVE2, Number2(slice2(source, startIndex, i)), startIndex, i);
13496
+ },
13497
+ keyword: function(value2) {
13498
+ var keyword = "" + value2;
13499
+ var index2 = this.index;
13500
+ var endIndex = index2 + keyword.length;
13501
+ if (slice2(this.source, index2, endIndex) !== keyword) throw new SyntaxError2("Failed to parse value at: " + index2);
13502
+ return this.node(PRIMITIVE2, value2, index2, endIndex);
13503
+ },
13504
+ skip: function(regex, i) {
13505
+ var source = this.source;
13506
+ for (; i < source.length; i++) if (!exec(regex, at2(source, i))) break;
13507
+ return i;
13508
+ },
13509
+ until: function(array2, i) {
13510
+ i = this.skip(IS_WHITESPACE, i);
13511
+ var chr = at2(this.source, i);
13512
+ for (var j = 0; j < array2.length; j++) if (array2[j] === chr) return i;
13513
+ throw new SyntaxError2('Unexpected character: "' + chr + '" at: ' + i);
13514
+ }
13515
+ };
13516
+ var NO_SOURCE_SUPPORT = fails2(function() {
13517
+ var unsafeInt = "9007199254740993";
13518
+ var source;
13519
+ nativeParse(unsafeInt, function(key2, value2, context) {
13520
+ source = context.source;
13521
+ });
13522
+ return source !== unsafeInt;
13523
+ });
13524
+ var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails2(function() {
13525
+ return 1 / nativeParse("-0 ") !== -Infinity;
13526
+ });
13527
+ $2({ target: "JSON", stat: true, forced: NO_SOURCE_SUPPORT }, {
13528
+ parse: function parse2(text2, reviver) {
13529
+ return PROPER_BASE_PARSE && !isCallable2(reviver) ? nativeParse(text2) : $parse(text2, reviver);
13530
+ }
13531
+ });
13532
+ return es_json_parse;
13533
+ }
13534
+ var es_json_rawJson = {};
13535
+ var hasRequiredEs_json_rawJson;
13536
+ function requireEs_json_rawJson() {
13537
+ if (hasRequiredEs_json_rawJson) return es_json_rawJson;
13538
+ hasRequiredEs_json_rawJson = 1;
13539
+ var $2 = require_export();
13540
+ var FREEZING = requireFreezing();
13541
+ var NATIVE_RAW_JSON = requireNativeRawJson();
13542
+ var getBuiltIn2 = requireGetBuiltIn();
13543
+ var uncurryThis = requireFunctionUncurryThis();
13544
+ var toString2 = requireToString();
13545
+ var createProperty2 = requireCreateProperty();
13546
+ var setInternalState = requireInternalState().set;
13547
+ var $SyntaxError = SyntaxError;
13548
+ var parse2 = getBuiltIn2("JSON", "parse");
13549
+ var create2 = getBuiltIn2("Object", "create");
13550
+ var freeze = getBuiltIn2("Object", "freeze");
13551
+ var at2 = uncurryThis("".charAt);
13552
+ var ERROR_MESSAGE = "Unacceptable as raw JSON";
13553
+ var isWhitespace = function(it) {
13554
+ return it === " " || it === " " || it === "\n" || it === "\r";
13555
+ };
13556
+ $2({ target: "JSON", stat: true, forced: !NATIVE_RAW_JSON }, {
13557
+ rawJSON: function rawJSON(text2) {
13558
+ var jsonString = toString2(text2);
13559
+ if (jsonString === "" || isWhitespace(at2(jsonString, 0)) || isWhitespace(at2(jsonString, jsonString.length - 1))) {
13560
+ throw new $SyntaxError(ERROR_MESSAGE);
13561
+ }
13562
+ var parsed = parse2(jsonString);
13563
+ if (typeof parsed == "object" && parsed !== null) throw new $SyntaxError(ERROR_MESSAGE);
13564
+ var obj = create2(null);
13565
+ setInternalState(obj, { type: "RawJSON" });
13566
+ createProperty2(obj, "rawJSON", jsonString);
13567
+ return FREEZING ? freeze(obj) : obj;
13568
+ }
13569
+ });
13570
+ return es_json_rawJson;
13571
+ }
13132
13572
  var es_math_acosh = {};
13133
13573
  var mathLog1p;
13134
13574
  var hasRequiredMathLog1p;
@@ -17391,12 +17831,11 @@
17391
17831
  var execCalled = false;
17392
17832
  var re2 = /a/;
17393
17833
  if (KEY === "split") {
17394
- re2 = {};
17395
- re2.constructor = {};
17396
- re2.constructor[SPECIES] = function() {
17834
+ var constructor = {};
17835
+ constructor[SPECIES] = function() {
17397
17836
  return re2;
17398
17837
  };
17399
- re2.flags = "";
17838
+ re2 = { constructor, flags: "" };
17400
17839
  re2[SYMBOL] = /./[SYMBOL];
17401
17840
  }
17402
17841
  re2.exec = function() {
@@ -21395,6 +21834,7 @@
21395
21834
  requireEs_function_name();
21396
21835
  requireEs_globalThis();
21397
21836
  requireEs_iterator_constructor();
21837
+ requireEs_iterator_concat();
21398
21838
  requireEs_iterator_dispose();
21399
21839
  requireEs_iterator_drop();
21400
21840
  requireEs_iterator_every();
@@ -21408,6 +21848,9 @@
21408
21848
  requireEs_iterator_some();
21409
21849
  requireEs_iterator_take();
21410
21850
  requireEs_iterator_toArray();
21851
+ requireEs_json_isRawJson();
21852
+ requireEs_json_parse();
21853
+ requireEs_json_rawJson();
21411
21854
  requireEs_json_stringify();
21412
21855
  requireEs_json_toStringTag();
21413
21856
  requireEs_map();
@@ -21646,6 +22089,10 @@
21646
22089
  var clientExports = requireClient();
21647
22090
  var reactExports = requireReact();
21648
22091
  const React$1 = /* @__PURE__ */ getDefaultExportFromCjs(reactExports);
22092
+ const React4 = /* @__PURE__ */ _mergeNamespaces({
22093
+ __proto__: null,
22094
+ default: React$1
22095
+ }, [reactExports]);
21649
22096
  function _typeof$6(o) {
21650
22097
  "@babel/helpers - typeof";
21651
22098
  return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
@@ -21713,7 +22160,7 @@
21713
22160
  return "@@redux/PROBE_UNKNOWN_ACTION" + randomString$1();
21714
22161
  }
21715
22162
  };
21716
- function isPlainObject$4(obj) {
22163
+ function isPlainObject$5(obj) {
21717
22164
  if (typeof obj !== "object" || obj === null) return false;
21718
22165
  var proto = obj;
21719
22166
  while (Object.getPrototypeOf(proto) !== null) {
@@ -21780,7 +22227,7 @@
21780
22227
  };
21781
22228
  }
21782
22229
  function dispatch2(action) {
21783
- if (!isPlainObject$4(action)) {
22230
+ if (!isPlainObject$5(action)) {
21784
22231
  throw new Error(formatProdErrorMessage(7));
21785
22232
  }
21786
22233
  if (typeof action.type === "undefined") {
@@ -24146,19 +24593,23 @@
24146
24593
  if (isIndexRoute(route)) {
24147
24594
  let indexRoute = {
24148
24595
  ...route,
24149
- ...mapRouteProperties2(route),
24150
24596
  id: id2
24151
24597
  };
24152
- manifest[id2] = indexRoute;
24598
+ manifest[id2] = mergeRouteUpdates(
24599
+ indexRoute,
24600
+ mapRouteProperties2(indexRoute)
24601
+ );
24153
24602
  return indexRoute;
24154
24603
  } else {
24155
24604
  let pathOrLayoutRoute = {
24156
24605
  ...route,
24157
- ...mapRouteProperties2(route),
24158
24606
  id: id2,
24159
24607
  children: void 0
24160
24608
  };
24161
- manifest[id2] = pathOrLayoutRoute;
24609
+ manifest[id2] = mergeRouteUpdates(
24610
+ pathOrLayoutRoute,
24611
+ mapRouteProperties2(pathOrLayoutRoute)
24612
+ );
24162
24613
  if (route.children) {
24163
24614
  pathOrLayoutRoute.children = convertRoutesToDataRoutes(
24164
24615
  route.children,
@@ -24172,6 +24623,17 @@
24172
24623
  }
24173
24624
  });
24174
24625
  }
24626
+ function mergeRouteUpdates(route, updates) {
24627
+ return Object.assign(route, {
24628
+ ...updates,
24629
+ ...typeof updates.lazy === "object" && updates.lazy != null ? {
24630
+ lazy: {
24631
+ ...route.lazy,
24632
+ ...updates.lazy
24633
+ }
24634
+ } : {}
24635
+ });
24636
+ }
24175
24637
  function matchRoutes(routes2, locationArg, basename2 = "/") {
24176
24638
  return matchRoutesImpl(routes2, locationArg, basename2, false);
24177
24639
  }
@@ -24459,13 +24921,36 @@
24459
24921
  }) {
24460
24922
  return pathname === "/" ? basename2 : joinPaths([basename2, pathname]);
24461
24923
  }
24924
+ var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
24925
+ var isAbsoluteUrl = (url2) => ABSOLUTE_URL_REGEX.test(url2);
24462
24926
  function resolvePath(to, fromPathname = "/") {
24463
24927
  let {
24464
24928
  pathname: toPathname,
24465
24929
  search: search2 = "",
24466
24930
  hash: hash2 = ""
24467
24931
  } = typeof to === "string" ? parsePath$1(to) : to;
24468
- let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
24932
+ let pathname;
24933
+ if (toPathname) {
24934
+ if (isAbsoluteUrl(toPathname)) {
24935
+ pathname = toPathname;
24936
+ } else {
24937
+ if (toPathname.includes("//")) {
24938
+ let oldPathname = toPathname;
24939
+ toPathname = toPathname.replace(/\/\/+/g, "/");
24940
+ warning(
24941
+ false,
24942
+ `Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
24943
+ );
24944
+ }
24945
+ if (toPathname.startsWith("/")) {
24946
+ pathname = resolvePathname(toPathname.substring(1), "/");
24947
+ } else {
24948
+ pathname = resolvePathname(toPathname, fromPathname);
24949
+ }
24950
+ }
24951
+ } else {
24952
+ pathname = fromPathname;
24953
+ }
24469
24954
  return {
24470
24955
  pathname,
24471
24956
  search: normalizeSearch(search2),
@@ -24575,6 +25060,247 @@
24575
25060
  function isRouteErrorResponse(error) {
24576
25061
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
24577
25062
  }
25063
+ function getRoutePattern(matches) {
25064
+ return matches.map((m) => m.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
25065
+ }
25066
+ var UninstrumentedSymbol = Symbol("Uninstrumented");
25067
+ function getRouteInstrumentationUpdates(fns, route) {
25068
+ let aggregated = {
25069
+ lazy: [],
25070
+ "lazy.loader": [],
25071
+ "lazy.action": [],
25072
+ "lazy.middleware": [],
25073
+ middleware: [],
25074
+ loader: [],
25075
+ action: []
25076
+ };
25077
+ fns.forEach(
25078
+ (fn) => fn({
25079
+ id: route.id,
25080
+ index: route.index,
25081
+ path: route.path,
25082
+ instrument(i) {
25083
+ let keys2 = Object.keys(aggregated);
25084
+ for (let key2 of keys2) {
25085
+ if (i[key2]) {
25086
+ aggregated[key2].push(i[key2]);
25087
+ }
25088
+ }
25089
+ }
25090
+ })
25091
+ );
25092
+ let updates = {};
25093
+ if (typeof route.lazy === "function" && aggregated.lazy.length > 0) {
25094
+ let instrumented = wrapImpl(aggregated.lazy, route.lazy, () => void 0);
25095
+ if (instrumented) {
25096
+ updates.lazy = instrumented;
25097
+ }
25098
+ }
25099
+ if (typeof route.lazy === "object") {
25100
+ let lazyObject = route.lazy;
25101
+ ["middleware", "loader", "action"].forEach((key2) => {
25102
+ let lazyFn = lazyObject[key2];
25103
+ let instrumentations = aggregated[`lazy.${key2}`];
25104
+ if (typeof lazyFn === "function" && instrumentations.length > 0) {
25105
+ let instrumented = wrapImpl(instrumentations, lazyFn, () => void 0);
25106
+ if (instrumented) {
25107
+ updates.lazy = Object.assign(updates.lazy || {}, {
25108
+ [key2]: instrumented
25109
+ });
25110
+ }
25111
+ }
25112
+ });
25113
+ }
25114
+ ["loader", "action"].forEach((key2) => {
25115
+ let handler = route[key2];
25116
+ if (typeof handler === "function" && aggregated[key2].length > 0) {
25117
+ let original = handler[UninstrumentedSymbol] ?? handler;
25118
+ let instrumented = wrapImpl(
25119
+ aggregated[key2],
25120
+ original,
25121
+ (...args) => getHandlerInfo(args[0])
25122
+ );
25123
+ if (instrumented) {
25124
+ instrumented[UninstrumentedSymbol] = original;
25125
+ updates[key2] = instrumented;
25126
+ }
25127
+ }
25128
+ });
25129
+ if (route.middleware && route.middleware.length > 0 && aggregated.middleware.length > 0) {
25130
+ updates.middleware = route.middleware.map((middleware) => {
25131
+ let original = middleware[UninstrumentedSymbol] ?? middleware;
25132
+ let instrumented = wrapImpl(
25133
+ aggregated.middleware,
25134
+ original,
25135
+ (...args) => getHandlerInfo(args[0])
25136
+ );
25137
+ if (instrumented) {
25138
+ instrumented[UninstrumentedSymbol] = original;
25139
+ return instrumented;
25140
+ }
25141
+ return middleware;
25142
+ });
25143
+ }
25144
+ return updates;
25145
+ }
25146
+ function instrumentClientSideRouter(router, fns) {
25147
+ let aggregated = {
25148
+ navigate: [],
25149
+ fetch: []
25150
+ };
25151
+ fns.forEach(
25152
+ (fn) => fn({
25153
+ instrument(i) {
25154
+ let keys2 = Object.keys(i);
25155
+ for (let key2 of keys2) {
25156
+ if (i[key2]) {
25157
+ aggregated[key2].push(i[key2]);
25158
+ }
25159
+ }
25160
+ }
25161
+ })
25162
+ );
25163
+ if (aggregated.navigate.length > 0) {
25164
+ let navigate = router.navigate[UninstrumentedSymbol] ?? router.navigate;
25165
+ let instrumentedNavigate = wrapImpl(
25166
+ aggregated.navigate,
25167
+ navigate,
25168
+ (...args) => {
25169
+ let [to, opts] = args;
25170
+ return {
25171
+ to: typeof to === "number" || typeof to === "string" ? to : to ? createPath$1(to) : ".",
25172
+ ...getRouterInfo(router, opts ?? {})
25173
+ };
25174
+ }
25175
+ );
25176
+ if (instrumentedNavigate) {
25177
+ instrumentedNavigate[UninstrumentedSymbol] = navigate;
25178
+ router.navigate = instrumentedNavigate;
25179
+ }
25180
+ }
25181
+ if (aggregated.fetch.length > 0) {
25182
+ let fetch2 = router.fetch[UninstrumentedSymbol] ?? router.fetch;
25183
+ let instrumentedFetch = wrapImpl(aggregated.fetch, fetch2, (...args) => {
25184
+ let [key2, , href, opts] = args;
25185
+ return {
25186
+ href: href ?? ".",
25187
+ fetcherKey: key2,
25188
+ ...getRouterInfo(router, opts ?? {})
25189
+ };
25190
+ });
25191
+ if (instrumentedFetch) {
25192
+ instrumentedFetch[UninstrumentedSymbol] = fetch2;
25193
+ router.fetch = instrumentedFetch;
25194
+ }
25195
+ }
25196
+ return router;
25197
+ }
25198
+ function wrapImpl(impls, handler, getInfo) {
25199
+ if (impls.length === 0) {
25200
+ return null;
25201
+ }
25202
+ return async (...args) => {
25203
+ let result = await recurseRight(
25204
+ impls,
25205
+ getInfo(...args),
25206
+ () => handler(...args),
25207
+ impls.length - 1
25208
+ );
25209
+ if (result.type === "error") {
25210
+ throw result.value;
25211
+ }
25212
+ return result.value;
25213
+ };
25214
+ }
25215
+ async function recurseRight(impls, info, handler, index2) {
25216
+ let impl = impls[index2];
25217
+ let result;
25218
+ if (!impl) {
25219
+ try {
25220
+ let value2 = await handler();
25221
+ result = { type: "success", value: value2 };
25222
+ } catch (e) {
25223
+ result = { type: "error", value: e };
25224
+ }
25225
+ } else {
25226
+ let handlerPromise = void 0;
25227
+ let callHandler = async () => {
25228
+ if (handlerPromise) {
25229
+ console.error("You cannot call instrumented handlers more than once");
25230
+ } else {
25231
+ handlerPromise = recurseRight(impls, info, handler, index2 - 1);
25232
+ }
25233
+ result = await handlerPromise;
25234
+ invariant$1(result, "Expected a result");
25235
+ if (result.type === "error" && result.value instanceof Error) {
25236
+ return { status: "error", error: result.value };
25237
+ }
25238
+ return { status: "success", error: void 0 };
25239
+ };
25240
+ try {
25241
+ await impl(callHandler, info);
25242
+ } catch (e) {
25243
+ console.error("An instrumentation function threw an error:", e);
25244
+ }
25245
+ if (!handlerPromise) {
25246
+ await callHandler();
25247
+ }
25248
+ await handlerPromise;
25249
+ }
25250
+ if (result) {
25251
+ return result;
25252
+ }
25253
+ return {
25254
+ type: "error",
25255
+ value: new Error("No result assigned in instrumentation chain.")
25256
+ };
25257
+ }
25258
+ function getHandlerInfo(args) {
25259
+ let { request: request2, context, params, unstable_pattern } = args;
25260
+ return {
25261
+ request: getReadonlyRequest(request2),
25262
+ params: { ...params },
25263
+ unstable_pattern,
25264
+ context: getReadonlyContext(context)
25265
+ };
25266
+ }
25267
+ function getRouterInfo(router, opts) {
25268
+ return {
25269
+ currentUrl: createPath$1(router.state.location),
25270
+ ..."formMethod" in opts ? { formMethod: opts.formMethod } : {},
25271
+ ..."formEncType" in opts ? { formEncType: opts.formEncType } : {},
25272
+ ..."formData" in opts ? { formData: opts.formData } : {},
25273
+ ..."body" in opts ? { body: opts.body } : {}
25274
+ };
25275
+ }
25276
+ function getReadonlyRequest(request2) {
25277
+ return {
25278
+ method: request2.method,
25279
+ url: request2.url,
25280
+ headers: {
25281
+ get: (...args) => request2.headers.get(...args)
25282
+ }
25283
+ };
25284
+ }
25285
+ function getReadonlyContext(context) {
25286
+ if (isPlainObject$4(context)) {
25287
+ let frozen = { ...context };
25288
+ Object.freeze(frozen);
25289
+ return frozen;
25290
+ } else {
25291
+ return {
25292
+ get: (ctx) => context.get(ctx)
25293
+ };
25294
+ }
25295
+ }
25296
+ var objectProtoNames = Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
25297
+ function isPlainObject$4(thing) {
25298
+ if (thing === null || typeof thing !== "object") {
25299
+ return false;
25300
+ }
25301
+ const proto = Object.getPrototypeOf(thing);
25302
+ return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames;
25303
+ }
24578
25304
  var validMutationMethodsArr = [
24579
25305
  "POST",
24580
25306
  "PUT",
@@ -24617,8 +25343,6 @@
24617
25343
  reset: void 0,
24618
25344
  location: void 0
24619
25345
  };
24620
- var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
24621
- var isAbsoluteUrl = (url2) => ABSOLUTE_URL_REGEX.test(url2);
24622
25346
  var defaultMapRouteProperties = (route) => ({
24623
25347
  hasErrorBoundary: Boolean(route.hasErrorBoundary)
24624
25348
  });
@@ -24632,7 +25356,20 @@
24632
25356
  "You must provide a non-empty routes array to createRouter"
24633
25357
  );
24634
25358
  let hydrationRouteProperties2 = init.hydrationRouteProperties || [];
24635
- let mapRouteProperties2 = init.mapRouteProperties || defaultMapRouteProperties;
25359
+ let _mapRouteProperties = init.mapRouteProperties || defaultMapRouteProperties;
25360
+ let mapRouteProperties2 = _mapRouteProperties;
25361
+ if (init.unstable_instrumentations) {
25362
+ let instrumentations = init.unstable_instrumentations;
25363
+ mapRouteProperties2 = (route) => {
25364
+ return {
25365
+ ..._mapRouteProperties(route),
25366
+ ...getRouteInstrumentationUpdates(
25367
+ instrumentations.map((i) => i.route).filter(Boolean),
25368
+ route
25369
+ )
25370
+ };
25371
+ };
25372
+ }
24636
25373
  let manifest = {};
24637
25374
  let dataRoutes = convertRoutesToDataRoutes(
24638
25375
  init.routes,
@@ -24729,6 +25466,7 @@
24729
25466
  blockers: /* @__PURE__ */ new Map()
24730
25467
  };
24731
25468
  let pendingAction = "POP";
25469
+ let pendingPopstateNavigationDfd = null;
24732
25470
  let pendingPreventScrollReset = false;
24733
25471
  let pendingNavigationController;
24734
25472
  let pendingViewTransitionEnabled = false;
@@ -24788,6 +25526,8 @@
24788
25526
  updateState({ blockers });
24789
25527
  }
24790
25528
  });
25529
+ pendingPopstateNavigationDfd?.resolve();
25530
+ pendingPopstateNavigationDfd = null;
24791
25531
  return;
24792
25532
  }
24793
25533
  return startNavigation(historyAction, location2);
@@ -24859,6 +25599,7 @@
24859
25599
  [...subscribers].forEach(
24860
25600
  (subscriber) => subscriber(state, {
24861
25601
  deletedFetchers: unmountedFetchers,
25602
+ newErrors: newState.errors ?? null,
24862
25603
  viewTransitionOpts: opts.viewTransitionOpts,
24863
25604
  flushSync: opts.flushSync === true
24864
25605
  })
@@ -24956,13 +25697,21 @@
24956
25697
  pendingViewTransitionEnabled = false;
24957
25698
  isUninterruptedRevalidation = false;
24958
25699
  isRevalidationRequired = false;
25700
+ pendingPopstateNavigationDfd?.resolve();
25701
+ pendingPopstateNavigationDfd = null;
24959
25702
  pendingRevalidationDfd?.resolve();
24960
25703
  pendingRevalidationDfd = null;
24961
25704
  }
24962
25705
  async function navigate(to, opts) {
25706
+ pendingPopstateNavigationDfd?.resolve();
25707
+ pendingPopstateNavigationDfd = null;
24963
25708
  if (typeof to === "number") {
25709
+ if (!pendingPopstateNavigationDfd) {
25710
+ pendingPopstateNavigationDfd = createDeferred();
25711
+ }
25712
+ let promise = pendingPopstateNavigationDfd.promise;
24964
25713
  init.history.go(to);
24965
- return;
25714
+ return promise;
24966
25715
  }
24967
25716
  let normalizedPath = normalizeTo(
24968
25717
  state.location,
@@ -25645,6 +26394,14 @@
25645
26394
  key2
25646
26395
  );
25647
26396
  let actionResult = actionResults[match2.route.id];
26397
+ if (!actionResult) {
26398
+ for (let match22 of fetchMatches) {
26399
+ if (actionResults[match22.route.id]) {
26400
+ actionResult = actionResults[match22.route.id];
26401
+ break;
26402
+ }
26403
+ }
26404
+ }
25648
26405
  if (fetchRequest.signal.aborted) {
25649
26406
  if (fetchControllers.get(key2) === abortController) {
25650
26407
  fetchControllers.delete(key2);
@@ -25894,6 +26651,10 @@
25894
26651
  preventScrollReset,
25895
26652
  replace: replace2
25896
26653
  } = {}) {
26654
+ if (!isNavigation) {
26655
+ pendingPopstateNavigationDfd?.resolve();
26656
+ pendingPopstateNavigationDfd = null;
26657
+ }
25897
26658
  if (redirect2.response.headers.has("X-Remix-Revalidate")) {
25898
26659
  isRevalidationRequired = true;
25899
26660
  }
@@ -26301,23 +27062,43 @@
26301
27062
  return { type: "aborted" };
26302
27063
  }
26303
27064
  let newMatches = matchRoutes(routesToUse, pathname, basename2);
27065
+ let newPartialMatches = null;
26304
27066
  if (newMatches) {
26305
- return { type: "success", matches: newMatches };
27067
+ if (Object.keys(newMatches[0].params).length === 0) {
27068
+ return { type: "success", matches: newMatches };
27069
+ } else {
27070
+ newPartialMatches = matchRoutesImpl(
27071
+ routesToUse,
27072
+ pathname,
27073
+ basename2,
27074
+ true
27075
+ );
27076
+ let matchedDeeper = newPartialMatches && partialMatches.length < newPartialMatches.length && compareMatches(
27077
+ partialMatches,
27078
+ newPartialMatches.slice(0, partialMatches.length)
27079
+ );
27080
+ if (!matchedDeeper) {
27081
+ return { type: "success", matches: newMatches };
27082
+ }
27083
+ }
26306
27084
  }
26307
- let newPartialMatches = matchRoutesImpl(
26308
- routesToUse,
26309
- pathname,
26310
- basename2,
26311
- true
26312
- );
26313
- if (!newPartialMatches || partialMatches.length === newPartialMatches.length && partialMatches.every(
26314
- (m, i) => m.route.id === newPartialMatches[i].route.id
26315
- )) {
27085
+ if (!newPartialMatches) {
27086
+ newPartialMatches = matchRoutesImpl(
27087
+ routesToUse,
27088
+ pathname,
27089
+ basename2,
27090
+ true
27091
+ );
27092
+ }
27093
+ if (!newPartialMatches || compareMatches(partialMatches, newPartialMatches)) {
26316
27094
  return { type: "success", matches: null };
26317
27095
  }
26318
27096
  partialMatches = newPartialMatches;
26319
27097
  }
26320
27098
  }
27099
+ function compareMatches(a, b) {
27100
+ return a.length === b.length && a.every((m, i) => m.route.id === b[i].route.id);
27101
+ }
26321
27102
  function _internalSetRoutes(newRoutes) {
26322
27103
  manifest = {};
26323
27104
  inFlightDataRoutes = convertRoutesToDataRoutes(
@@ -26384,6 +27165,12 @@
26384
27165
  updateState(newState);
26385
27166
  }
26386
27167
  };
27168
+ if (init.unstable_instrumentations) {
27169
+ router = instrumentClientSideRouter(
27170
+ router,
27171
+ init.unstable_instrumentations.map((i) => i.router).filter(Boolean)
27172
+ );
27173
+ }
26387
27174
  return router;
26388
27175
  }
26389
27176
  function isSubmissionNavigation(opts) {
@@ -26563,6 +27350,7 @@
26563
27350
  actionResult,
26564
27351
  actionStatus
26565
27352
  };
27353
+ let pattern = getRoutePattern(matches);
26566
27354
  let dsMatches = matches.map((match2, index2) => {
26567
27355
  let { route } = match2;
26568
27356
  let forceShouldLoad = null;
@@ -26586,6 +27374,7 @@
26586
27374
  mapRouteProperties2,
26587
27375
  manifest,
26588
27376
  request2,
27377
+ pattern,
26589
27378
  match2,
26590
27379
  lazyRoutePropertiesToSkip,
26591
27380
  scopedContext,
@@ -26606,6 +27395,7 @@
26606
27395
  mapRouteProperties2,
26607
27396
  manifest,
26608
27397
  request2,
27398
+ pattern,
26609
27399
  match2,
26610
27400
  lazyRoutePropertiesToSkip,
26611
27401
  scopedContext,
@@ -27015,7 +27805,7 @@
27015
27805
  ),
27016
27806
  // or the shallowest route that needs to load data
27017
27807
  Math.max(
27018
- matches.findIndex((m) => m.unstable_shouldCallHandler()),
27808
+ matches.findIndex((m) => m.shouldCallHandler()),
27019
27809
  0
27020
27810
  )
27021
27811
  );
@@ -27030,12 +27820,17 @@
27030
27820
  }
27031
27821
  }
27032
27822
  async function runMiddlewarePipeline(args, handler, processResult, isResult, errorHandler) {
27033
- let { matches, request: request2, params, context } = args;
27823
+ let { matches, request: request2, params, context, unstable_pattern } = args;
27034
27824
  let tuples = matches.flatMap(
27035
27825
  (m) => m.route.middleware ? m.route.middleware.map((fn) => [m.route.id, fn]) : []
27036
27826
  );
27037
27827
  let result = await callRouteMiddleware(
27038
- { request: request2, params, context },
27828
+ {
27829
+ request: request2,
27830
+ params,
27831
+ context,
27832
+ unstable_pattern
27833
+ },
27039
27834
  tuples,
27040
27835
  handler,
27041
27836
  processResult,
@@ -27113,7 +27908,7 @@
27113
27908
  handler: lazyRoutePromises.lazyHandlerPromise
27114
27909
  };
27115
27910
  }
27116
- function getDataStrategyMatch(mapRouteProperties2, manifest, request2, match2, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, unstable_shouldRevalidateArgs = null) {
27911
+ function getDataStrategyMatch(mapRouteProperties2, manifest, request2, unstable_pattern, match2, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null) {
27117
27912
  let isUsingNewApi = false;
27118
27913
  let _lazyPromises = getDataStrategyMatchLazyPromises(
27119
27914
  mapRouteProperties2,
@@ -27126,27 +27921,28 @@
27126
27921
  ...match2,
27127
27922
  _lazyPromises,
27128
27923
  shouldLoad,
27129
- unstable_shouldRevalidateArgs,
27130
- unstable_shouldCallHandler(defaultShouldRevalidate) {
27924
+ shouldRevalidateArgs,
27925
+ shouldCallHandler(defaultShouldRevalidate) {
27131
27926
  isUsingNewApi = true;
27132
- if (!unstable_shouldRevalidateArgs) {
27927
+ if (!shouldRevalidateArgs) {
27133
27928
  return shouldLoad;
27134
27929
  }
27135
27930
  if (typeof defaultShouldRevalidate === "boolean") {
27136
27931
  return shouldRevalidateLoader(match2, {
27137
- ...unstable_shouldRevalidateArgs,
27932
+ ...shouldRevalidateArgs,
27138
27933
  defaultShouldRevalidate
27139
27934
  });
27140
27935
  }
27141
- return shouldRevalidateLoader(match2, unstable_shouldRevalidateArgs);
27936
+ return shouldRevalidateLoader(match2, shouldRevalidateArgs);
27142
27937
  },
27143
27938
  resolve(handlerOverride) {
27144
27939
  let { lazy: lazy2, loader, middleware } = match2.route;
27145
27940
  let callHandler = isUsingNewApi || shouldLoad || handlerOverride && !isMutationMethod(request2.method) && (lazy2 || loader);
27146
27941
  let isMiddlewareOnlyRoute = middleware && middleware.length > 0 && !loader && !lazy2;
27147
- if (callHandler && !isMiddlewareOnlyRoute) {
27942
+ if (callHandler && (isMutationMethod(request2.method) || !isMiddlewareOnlyRoute)) {
27148
27943
  return callLoaderOrAction({
27149
27944
  request: request2,
27945
+ unstable_pattern,
27150
27946
  match: match2,
27151
27947
  lazyHandlerPromise: _lazyPromises?.handler,
27152
27948
  lazyRoutePromise: _lazyPromises?.route,
@@ -27164,8 +27960,8 @@
27164
27960
  return {
27165
27961
  ...match2,
27166
27962
  shouldLoad: false,
27167
- unstable_shouldRevalidateArgs: shouldRevalidateArgs,
27168
- unstable_shouldCallHandler: () => false,
27963
+ shouldRevalidateArgs,
27964
+ shouldCallHandler: () => false,
27169
27965
  _lazyPromises: getDataStrategyMatchLazyPromises(
27170
27966
  mapRouteProperties2,
27171
27967
  manifest,
@@ -27180,6 +27976,7 @@
27180
27976
  mapRouteProperties2,
27181
27977
  manifest,
27182
27978
  request2,
27979
+ getRoutePattern(matches),
27183
27980
  match2,
27184
27981
  lazyRoutePropertiesToSkip,
27185
27982
  scopedContext,
@@ -27194,6 +27991,7 @@
27194
27991
  }
27195
27992
  let dataStrategyArgs = {
27196
27993
  request: request2,
27994
+ unstable_pattern: getRoutePattern(matches),
27197
27995
  params: matches[0].params,
27198
27996
  context: scopedContext,
27199
27997
  matches
@@ -27230,6 +28028,7 @@
27230
28028
  }
27231
28029
  async function callLoaderOrAction({
27232
28030
  request: request2,
28031
+ unstable_pattern,
27233
28032
  match: match2,
27234
28033
  lazyHandlerPromise,
27235
28034
  lazyRoutePromise,
@@ -27256,6 +28055,7 @@
27256
28055
  return handler(
27257
28056
  {
27258
28057
  request: request2,
28058
+ unstable_pattern,
27259
28059
  params: match2.params,
27260
28060
  context: scopedContext
27261
28061
  },
@@ -27370,11 +28170,7 @@
27370
28170
  }
27371
28171
  return {
27372
28172
  type: "error",
27373
- error: new ErrorResponseImpl(
27374
- result.init?.status || 500,
27375
- void 0,
27376
- result.data
27377
- ),
28173
+ error: dataWithResponseInitToErrorResponse(result),
27378
28174
  statusCode: isRouteErrorResponse(result) ? result.status : void 0,
27379
28175
  headers: result.init?.headers ? new Headers(result.init.headers) : void 0
27380
28176
  };
@@ -27668,6 +28464,13 @@
27668
28464
  }
27669
28465
  return false;
27670
28466
  }
28467
+ function dataWithResponseInitToErrorResponse(data2) {
28468
+ return new ErrorResponseImpl(
28469
+ data2.init?.status ?? 500,
28470
+ data2.init?.statusText ?? "Internal Server Error",
28471
+ data2.data
28472
+ );
28473
+ }
27671
28474
  function isDataStrategyResults(result) {
27672
28475
  return result != null && typeof result === "object" && Object.entries(result).every(
27673
28476
  ([key2, value2]) => typeof key2 === "string" && isDataStrategyResult(value2)
@@ -28163,8 +28966,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28163
28966
  };
28164
28967
  }
28165
28968
  componentDidCatch(error, errorInfo) {
28166
- if (this.props.unstable_onError) {
28167
- this.props.unstable_onError(error, errorInfo);
28969
+ if (this.props.onError) {
28970
+ this.props.onError(error, errorInfo);
28168
28971
  } else {
28169
28972
  console.error(
28170
28973
  "React Router caught the following error during render",
@@ -28242,6 +29045,14 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28242
29045
  }
28243
29046
  }
28244
29047
  }
29048
+ let onError = dataRouterState && unstable_onError ? (error, errorInfo) => {
29049
+ unstable_onError(error, {
29050
+ location: dataRouterState.location,
29051
+ params: dataRouterState.matches?.[0]?.params ?? {},
29052
+ unstable_pattern: getRoutePattern(dataRouterState.matches),
29053
+ errorInfo
29054
+ });
29055
+ } : void 0;
28245
29056
  return renderedMatches.reduceRight(
28246
29057
  (outlet, match2, index2) => {
28247
29058
  let error;
@@ -28302,7 +29113,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28302
29113
  error,
28303
29114
  children: getChildren(),
28304
29115
  routeContext: { outlet: null, matches: matches2, isDataRoute: true },
28305
- unstable_onError
29116
+ onError
28306
29117
  }
28307
29118
  ) : getChildren();
28308
29119
  },
@@ -28375,7 +29186,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28375
29186
  warning(activeRef.current, navigateEffectWarning);
28376
29187
  if (!activeRef.current) return;
28377
29188
  if (typeof to === "number") {
28378
- router.navigate(to);
29189
+ await router.navigate(to);
28379
29190
  } else {
28380
29191
  await router.navigate(to, { fromRouteId: id2, ...options });
28381
29192
  }
@@ -28398,6 +29209,15 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28398
29209
  console.warn(message2);
28399
29210
  }
28400
29211
  }
29212
+ var USE_OPTIMISTIC = "useOptimistic";
29213
+ var useOptimisticImpl = React4[USE_OPTIMISTIC];
29214
+ function useOptimisticSafe(val) {
29215
+ if (useOptimisticImpl) {
29216
+ return useOptimisticImpl(val);
29217
+ } else {
29218
+ return [val, () => void 0];
29219
+ }
29220
+ }
28401
29221
  function mapRouteProperties(route) {
28402
29222
  let updates = {
28403
29223
  // Note: this check also occurs in createRoutesFromChildren so update
@@ -28474,9 +29294,11 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28474
29294
  function RouterProvider({
28475
29295
  router,
28476
29296
  flushSync: reactDomFlushSyncImpl,
28477
- unstable_onError
29297
+ unstable_onError,
29298
+ unstable_useTransitions
28478
29299
  }) {
28479
- let [state, setStateImpl] = reactExports.useState(router.state);
29300
+ let [_state2, setStateImpl] = reactExports.useState(router.state);
29301
+ let [state, setOptimisticState] = useOptimisticSafe(_state2);
28480
29302
  let [pendingState, setPendingState] = reactExports.useState();
28481
29303
  let [vtContext, setVtContext] = reactExports.useState({
28482
29304
  isTransitioning: false
@@ -28485,23 +29307,17 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28485
29307
  let [transition2, setTransition] = reactExports.useState();
28486
29308
  let [interruption, setInterruption] = reactExports.useState();
28487
29309
  let fetcherData = reactExports.useRef(/* @__PURE__ */ new Map());
28488
- let logErrorsAndSetState = reactExports.useCallback(
28489
- (newState) => {
28490
- setStateImpl((prevState) => {
28491
- if (newState.errors && unstable_onError) {
28492
- Object.entries(newState.errors).forEach(([routeId, error]) => {
28493
- if (prevState.errors?.[routeId] !== error) {
28494
- unstable_onError(error);
28495
- }
28496
- });
28497
- }
28498
- return newState;
28499
- });
28500
- },
28501
- [unstable_onError]
28502
- );
28503
29310
  let setState = reactExports.useCallback(
28504
- (newState, { deletedFetchers, flushSync, viewTransitionOpts }) => {
29311
+ (newState, { deletedFetchers, newErrors, flushSync, viewTransitionOpts }) => {
29312
+ if (newErrors && unstable_onError) {
29313
+ Object.values(newErrors).forEach(
29314
+ (error) => unstable_onError(error, {
29315
+ location: newState.location,
29316
+ params: newState.matches[0]?.params ?? {},
29317
+ unstable_pattern: getRoutePattern(newState.matches)
29318
+ })
29319
+ );
29320
+ }
28505
29321
  newState.fetchers.forEach((fetcher, key2) => {
28506
29322
  if (fetcher.data !== void 0) {
28507
29323
  fetcherData.current.set(key2, fetcher.data);
@@ -28519,16 +29335,23 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28519
29335
  );
28520
29336
  if (!viewTransitionOpts || !isViewTransitionAvailable) {
28521
29337
  if (reactDomFlushSyncImpl && flushSync) {
28522
- reactDomFlushSyncImpl(() => logErrorsAndSetState(newState));
29338
+ reactDomFlushSyncImpl(() => setStateImpl(newState));
29339
+ } else if (unstable_useTransitions === false) {
29340
+ setStateImpl(newState);
28523
29341
  } else {
28524
- reactExports.startTransition(() => logErrorsAndSetState(newState));
29342
+ reactExports.startTransition(() => {
29343
+ if (unstable_useTransitions === true) {
29344
+ setOptimisticState((s) => getOptimisticRouterState(s, newState));
29345
+ }
29346
+ setStateImpl(newState);
29347
+ });
28525
29348
  }
28526
29349
  return;
28527
29350
  }
28528
29351
  if (reactDomFlushSyncImpl && flushSync) {
28529
29352
  reactDomFlushSyncImpl(() => {
28530
29353
  if (transition2) {
28531
- renderDfd && renderDfd.resolve();
29354
+ renderDfd?.resolve();
28532
29355
  transition2.skipTransition();
28533
29356
  }
28534
29357
  setVtContext({
@@ -28539,7 +29362,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28539
29362
  });
28540
29363
  });
28541
29364
  let t = router.window.document.startViewTransition(() => {
28542
- reactDomFlushSyncImpl(() => logErrorsAndSetState(newState));
29365
+ reactDomFlushSyncImpl(() => setStateImpl(newState));
28543
29366
  });
28544
29367
  t.finished.finally(() => {
28545
29368
  reactDomFlushSyncImpl(() => {
@@ -28553,7 +29376,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28553
29376
  return;
28554
29377
  }
28555
29378
  if (transition2) {
28556
- renderDfd && renderDfd.resolve();
29379
+ renderDfd?.resolve();
28557
29380
  transition2.skipTransition();
28558
29381
  setInterruption({
28559
29382
  state: newState,
@@ -28575,7 +29398,9 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28575
29398
  reactDomFlushSyncImpl,
28576
29399
  transition2,
28577
29400
  renderDfd,
28578
- logErrorsAndSetState
29401
+ unstable_useTransitions,
29402
+ setOptimisticState,
29403
+ unstable_onError
28579
29404
  ]
28580
29405
  );
28581
29406
  reactExports.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
@@ -28589,7 +29414,16 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28589
29414
  let newState = pendingState;
28590
29415
  let renderPromise = renderDfd.promise;
28591
29416
  let transition22 = router.window.document.startViewTransition(async () => {
28592
- reactExports.startTransition(() => logErrorsAndSetState(newState));
29417
+ if (unstable_useTransitions === false) {
29418
+ setStateImpl(newState);
29419
+ } else {
29420
+ reactExports.startTransition(() => {
29421
+ if (unstable_useTransitions === true) {
29422
+ setOptimisticState((s) => getOptimisticRouterState(s, newState));
29423
+ }
29424
+ setStateImpl(newState);
29425
+ });
29426
+ }
28593
29427
  await renderPromise;
28594
29428
  });
28595
29429
  transition22.finished.finally(() => {
@@ -28600,7 +29434,13 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28600
29434
  });
28601
29435
  setTransition(transition22);
28602
29436
  }
28603
- }, [pendingState, renderDfd, router.window, logErrorsAndSetState]);
29437
+ }, [
29438
+ pendingState,
29439
+ renderDfd,
29440
+ router.window,
29441
+ unstable_useTransitions,
29442
+ setOptimisticState
29443
+ ]);
28604
29444
  reactExports.useEffect(() => {
28605
29445
  if (renderDfd && pendingState && state.location.key === pendingState.location.key) {
28606
29446
  renderDfd.resolve();
@@ -28651,7 +29491,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28651
29491
  basename: basename2,
28652
29492
  location: state.location,
28653
29493
  navigationType: state.historyAction,
28654
- navigator: navigator2
29494
+ navigator: navigator2,
29495
+ unstable_useTransitions: unstable_useTransitions === true
28655
29496
  },
28656
29497
  /* @__PURE__ */ reactExports.createElement(
28657
29498
  MemoizedDataRoutes,
@@ -28664,6 +29505,20 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28664
29505
  )
28665
29506
  ))))), null);
28666
29507
  }
29508
+ function getOptimisticRouterState(currentState, newState) {
29509
+ return {
29510
+ // Don't surface "current location specific" stuff mid-navigation
29511
+ // (historyAction, location, matches, loaderData, errors, initialized,
29512
+ // restoreScroll, preventScrollReset, blockers, etc.)
29513
+ ...currentState,
29514
+ // Only surface "pending/in-flight stuff"
29515
+ // (navigation, revalidation, actionData, fetchers, )
29516
+ navigation: newState.navigation.state !== "idle" ? newState.navigation : currentState.navigation,
29517
+ revalidation: newState.revalidation !== "idle" ? newState.revalidation : currentState.revalidation,
29518
+ actionData: newState.navigation.state !== "submitting" ? newState.actionData : currentState.actionData,
29519
+ fetchers: newState.fetchers
29520
+ };
29521
+ }
28667
29522
  var MemoizedDataRoutes = reactExports.memo(DataRoutes);
28668
29523
  function DataRoutes({
28669
29524
  routes: routes2,
@@ -28679,7 +29534,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28679
29534
  location: locationProp,
28680
29535
  navigationType = "POP",
28681
29536
  navigator: navigator2,
28682
- static: staticProp = false
29537
+ static: staticProp = false,
29538
+ unstable_useTransitions
28683
29539
  }) {
28684
29540
  invariant$1(
28685
29541
  !useInRouterContext(),
@@ -28691,9 +29547,10 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28691
29547
  basename: basename2,
28692
29548
  navigator: navigator2,
28693
29549
  static: staticProp,
29550
+ unstable_useTransitions,
28694
29551
  future: {}
28695
29552
  }),
28696
- [basename2, navigator2, staticProp]
29553
+ [basename2, navigator2, staticProp, unstable_useTransitions]
28697
29554
  );
28698
29555
  if (typeof locationProp === "string") {
28699
29556
  locationProp = parsePath$1(locationProp);
@@ -28733,7 +29590,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
28733
29590
  var defaultMethod = "get";
28734
29591
  var defaultEncType = "application/x-www-form-urlencoded";
28735
29592
  function isHtmlElement(object2) {
28736
- return object2 != null && typeof object2.tagName === "string";
29593
+ return typeof HTMLElement !== "undefined" && object2 instanceof HTMLElement;
28737
29594
  }
28738
29595
  function isButtonElement(object2) {
28739
29596
  return isHtmlElement(object2) && object2.tagName.toLowerCase() === "button";
@@ -29238,7 +30095,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29238
30095
  try {
29239
30096
  if (isBrowser$3) {
29240
30097
  window.__reactRouterVersion = // @ts-expect-error
29241
- "7.9.4";
30098
+ "7.10.0";
29242
30099
  }
29243
30100
  } catch (e) {
29244
30101
  }
@@ -29254,7 +30111,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29254
30111
  hydrationRouteProperties,
29255
30112
  dataStrategy: opts?.dataStrategy,
29256
30113
  patchRoutesOnNavigation: opts?.patchRoutesOnNavigation,
29257
- window: opts?.window
30114
+ window: opts?.window,
30115
+ unstable_instrumentations: opts?.unstable_instrumentations
29258
30116
  }).initialize();
29259
30117
  }
29260
30118
  function parseHydrationData() {
@@ -29318,7 +30176,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29318
30176
  viewTransition,
29319
30177
  ...rest
29320
30178
  }, forwardedRef) {
29321
- let { basename: basename2 } = reactExports.useContext(NavigationContext);
30179
+ let { basename: basename2, unstable_useTransitions } = reactExports.useContext(NavigationContext);
29322
30180
  let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX2.test(to);
29323
30181
  let absoluteHref;
29324
30182
  let isExternal = false;
@@ -29353,7 +30211,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29353
30211
  target,
29354
30212
  preventScrollReset,
29355
30213
  relative,
29356
- viewTransition
30214
+ viewTransition,
30215
+ unstable_useTransitions
29357
30216
  });
29358
30217
  function handleClick(event2) {
29359
30218
  if (onClick) onClick(event2);
@@ -29463,6 +30322,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29463
30322
  viewTransition,
29464
30323
  ...props
29465
30324
  }, forwardedRef) => {
30325
+ let { unstable_useTransitions } = reactExports.useContext(NavigationContext);
29466
30326
  let submit = useSubmit();
29467
30327
  let formAction = useFormAction(action, { relative });
29468
30328
  let formMethod = method.toLowerCase() === "get" ? "get" : "post";
@@ -29473,7 +30333,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29473
30333
  event2.preventDefault();
29474
30334
  let submitter = event2.nativeEvent.submitter;
29475
30335
  let submitMethod = submitter?.getAttribute("formmethod") || method;
29476
- submit(submitter || event2.currentTarget, {
30336
+ let doSubmit = () => submit(submitter || event2.currentTarget, {
29477
30337
  fetcherKey,
29478
30338
  method: submitMethod,
29479
30339
  navigate,
@@ -29483,6 +30343,11 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29483
30343
  preventScrollReset,
29484
30344
  viewTransition
29485
30345
  });
30346
+ if (unstable_useTransitions && navigate !== false) {
30347
+ reactExports.startTransition(() => doSubmit());
30348
+ } else {
30349
+ doSubmit();
30350
+ }
29486
30351
  };
29487
30352
  return /* @__PURE__ */ reactExports.createElement(
29488
30353
  "form",
@@ -29512,7 +30377,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29512
30377
  state,
29513
30378
  preventScrollReset,
29514
30379
  relative,
29515
- viewTransition
30380
+ viewTransition,
30381
+ unstable_useTransitions
29516
30382
  } = {}) {
29517
30383
  let navigate = useNavigate();
29518
30384
  let location2 = useLocation();
@@ -29522,13 +30388,18 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29522
30388
  if (shouldProcessLinkClick(event2, target)) {
29523
30389
  event2.preventDefault();
29524
30390
  let replace2 = replaceProp !== void 0 ? replaceProp : createPath$1(location2) === createPath$1(path2);
29525
- navigate(to, {
30391
+ let doNavigate = () => navigate(to, {
29526
30392
  replace: replace2,
29527
30393
  state,
29528
30394
  preventScrollReset,
29529
30395
  relative,
29530
30396
  viewTransition
29531
30397
  });
30398
+ if (unstable_useTransitions) {
30399
+ reactExports.startTransition(() => doNavigate());
30400
+ } else {
30401
+ doNavigate();
30402
+ }
29532
30403
  }
29533
30404
  },
29534
30405
  [
@@ -29541,7 +30412,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29541
30412
  to,
29542
30413
  preventScrollReset,
29543
30414
  relative,
29544
- viewTransition
30415
+ viewTransition,
30416
+ unstable_useTransitions
29545
30417
  ]
29546
30418
  );
29547
30419
  }
@@ -29587,6 +30459,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29587
30459
  );
29588
30460
  let { basename: basename2 } = reactExports.useContext(NavigationContext);
29589
30461
  let currentRouteId = useRouteId();
30462
+ let routerFetch = router.fetch;
30463
+ let routerNavigate = router.navigate;
29590
30464
  return reactExports.useCallback(
29591
30465
  async (target, options = {}) => {
29592
30466
  let { action, method, encType, formData, body } = getFormSubmissionInfo(
@@ -29595,7 +30469,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29595
30469
  );
29596
30470
  if (options.navigate === false) {
29597
30471
  let key2 = options.fetcherKey || getUniqueFetcherId();
29598
- await router.fetch(key2, currentRouteId, options.action || action, {
30472
+ await routerFetch(key2, currentRouteId, options.action || action, {
29599
30473
  preventScrollReset: options.preventScrollReset,
29600
30474
  formData,
29601
30475
  body,
@@ -29604,7 +30478,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29604
30478
  flushSync: options.flushSync
29605
30479
  });
29606
30480
  } else {
29607
- await router.navigate(options.action || action, {
30481
+ await routerNavigate(options.action || action, {
29608
30482
  preventScrollReset: options.preventScrollReset,
29609
30483
  formData,
29610
30484
  body,
@@ -29618,7 +30492,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
29618
30492
  });
29619
30493
  }
29620
30494
  },
29621
- [router, basename2, currentRouteId]
30495
+ [routerFetch, routerNavigate, basename2, currentRouteId]
29622
30496
  );
29623
30497
  }
29624
30498
  function useFormAction(action, { relative } = {}) {
@@ -42732,8 +43606,8 @@ Try polyfilling it using "@formatjs/intl-displaynames"
42732
43606
  type: "builder.registerEditor",
42733
43607
  data: omit$4(info, "component")
42734
43608
  }, "*");
42735
- var hostname2 = location.hostname;
42736
- if (!Builder2.isTrustedHost(hostname2)) {
43609
+ var hostname = location.hostname;
43610
+ if (!Builder2.isTrustedHost(hostname)) {
42737
43611
  console.error("Builder.registerEditor() called in the wrong environment! You cannot load custom editors from your app, they must be loaded through the builder6.com app itself. Follow the readme here for more details: https://github.com/builderio/builder/tree/master/plugins/cloudinary or contact chat us in our Spectrum community for help: https://spectrum.chat/builder");
42738
43612
  }
42739
43613
  }
@@ -42751,9 +43625,9 @@ Try polyfilling it using "@formatjs/intl-displaynames"
42751
43625
  Builder2.setServerContext = function(context) {
42752
43626
  this.serverContext = context;
42753
43627
  };
42754
- Builder2.isTrustedHost = function(hostname2) {
43628
+ Builder2.isTrustedHost = function(hostname) {
42755
43629
  var isTrusted2 = this.trustedHosts.findIndex(function(trustedHost) {
42756
- return trustedHost.startsWith("*.") ? hostname2.endsWith(trustedHost.slice(1)) : trustedHost === hostname2;
43630
+ return trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname;
42757
43631
  }) > -1;
42758
43632
  return isTrusted2;
42759
43633
  };
@@ -45139,8 +46013,8 @@ Try polyfilling it using "@formatjs/intl-displaynames"
45139
46013
  });
45140
46014
  });
45141
46015
  var define_process_env_default = {};
45142
- var SDK_VERSION = "8.0.40", _a$1;
45143
- "undefined" != typeof window && (null === (_a$1 = window.parent) || void 0 === _a$1 || _a$1.postMessage({ type: "builder.isReactSdk", data: { value: true, supportsPatchUpdates: "v4", supportsCustomBreakpoints: true, supportsGlobalSymbols: true, blockLevelPersonalization: true, version: SDK_VERSION } }, "*"));
46016
+ var SDK_VERSION = "8.0.40", _a$2;
46017
+ "undefined" != typeof window && (null === (_a$2 = window.parent) || void 0 === _a$2 || _a$2.postMessage({ type: "builder.isReactSdk", data: { value: true, supportsPatchUpdates: "v4", supportsCustomBreakpoints: true, supportsGlobalSymbols: true, blockLevelPersonalization: true, version: SDK_VERSION } }, "*"));
45144
46018
  var extendStatics = function(e, t) {
45145
46019
  return (extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e2, t2) {
45146
46020
  e2.__proto__ = t2;
@@ -50738,245 +51612,251 @@ Try polyfilling it using "@formatjs/intl-displaynames"
50738
51612
  const isMobile = false;
50739
51613
  const badgeText = "${IF(${id} == 'approve_workflow',${badge|pick:'workflow'},${badge|pick:${id}}) | toInt}";
50740
51614
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
50741
- "type": "service",
50742
- "id": "u:0f6224a0836f",
50743
- "affixFooter": false,
50744
- "body": [
50745
- {
50746
- "type": "panel",
50747
- "key": "1",
50748
- "title": localizeMessage("accounts.app"),
50749
- "className": "p-4 shadow border-none",
50750
- "header": [
50751
- {
50752
- "type": "flex",
50753
- "justify": "space-between",
50754
- "items": [
50755
- {
50756
- "type": "wrapper",
50757
- "className": "text-xl font-bold p-0",
50758
- "body": [
50759
- {
50760
- "type": "plain",
50761
- "text": localizeMessage("accounts.app")
50762
- }
50763
- ]
50764
- },
50765
- {
50766
- "type": "wrapper",
50767
- "className": "p-0",
50768
- "body": [
50769
- {
50770
- "type": "button",
50771
- "label": localizeMessage("accounts.refresh"),
50772
- "className": "hidden btn-reload-app-dashboard",
50773
- "onEvent": {
50774
- "click": {
50775
- "actions": [
50776
- {
50777
- "actionType": "reload"
50778
- }
50779
- ]
50780
- }
51615
+ "type": "spinner",
51616
+ "show": true,
51617
+ "overlay": true,
51618
+ "body": {
51619
+ "type": "service",
51620
+ "id": "u:0f6224a0836f",
51621
+ "affixFooter": false,
51622
+ "body": [
51623
+ {
51624
+ "type": "panel",
51625
+ "key": "1",
51626
+ "title": localizeMessage("accounts.app"),
51627
+ "className": "p-4 shadow border-none",
51628
+ "header": [
51629
+ {
51630
+ "type": "flex",
51631
+ "justify": "space-between",
51632
+ "items": [
51633
+ {
51634
+ "type": "wrapper",
51635
+ "className": "text-xl font-bold p-0",
51636
+ "body": [
51637
+ {
51638
+ "type": "plain",
51639
+ "text": localizeMessage("accounts.app")
50781
51640
  }
50782
- },
50783
- {
50784
- "type": "button",
50785
- "label": localizeMessage("accounts.newApp"),
50786
- "actionType": "dialog",
50787
- "level": "primary",
50788
- "visibleOn": "Builder.settings.context.user.is_space_admin == true",
50789
- "dialog": {
50790
- "title": localizeMessage("accounts.newApp"),
50791
- "actions": [
50792
- {
50793
- "type": "button",
50794
- "actionType": "cancel",
50795
- "label": localizeMessage("accounts.Cancel")
50796
- },
50797
- {
50798
- "type": "button",
50799
- "actionType": "confirm",
50800
- "label": localizeMessage("accounts.OK"),
50801
- "primary": true
50802
- }
50803
- ],
50804
- "body": [
50805
- {
50806
- "type": "form",
50807
- "canAccessSuperData": false,
50808
- "api": {
50809
- "url": "/service/api/apps/create_by_design",
50810
- "method": "post",
50811
- "requestAdaptor": "api.data={code: context.code, name: context.name, icon: context.icon}; return api;",
50812
- "adaptor": "window.location.href=Steedos.getRelativeUrl('/app/' + payload.code);return {}",
50813
- "messages": {}
50814
- },
50815
- "body": [
50816
- {
50817
- "type": "input-text",
50818
- "name": "code",
50819
- "label": localizeMessage("accounts.appCode"),
50820
- "value": "a_${UUID(6)}",
50821
- "required": true,
50822
- "validateOnChange": true,
50823
- "validations": {
50824
- "isVariableName": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/
50825
- }
50826
- },
50827
- {
50828
- "name": "name",
50829
- "type": "input-text",
50830
- "label": localizeMessage("accounts.appName"),
50831
- "required": true
50832
- },
51641
+ ]
51642
+ },
51643
+ {
51644
+ "type": "wrapper",
51645
+ "className": "p-0",
51646
+ "body": [
51647
+ {
51648
+ "type": "button",
51649
+ "label": localizeMessage("accounts.refresh"),
51650
+ "className": "hidden btn-reload-app-dashboard",
51651
+ "onEvent": {
51652
+ "click": {
51653
+ "actions": [
50833
51654
  {
50834
- "type": "steedos-field",
50835
- "label": localizeMessage("accounts.appIcon"),
50836
- "config": {
50837
- "label": localizeMessage("accounts.appIcon"),
50838
- "type": "lookup",
50839
- "required": true,
50840
- "sort_no": 30,
50841
- "optionsFunction": "function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }",
50842
- "name": "icon",
50843
- "inlineHelpText": "",
50844
- "description": "",
50845
- "hidden": false,
50846
- "readonly": false,
50847
- "disabled": false
50848
- }
51655
+ "actionType": "reload"
50849
51656
  }
50850
51657
  ]
50851
51658
  }
50852
- ]
50853
- }
50854
- }
50855
- ]
50856
- }
50857
- ]
50858
- }
50859
- ],
50860
- "body": [
50861
- {
50862
- "type": "each",
50863
- "name": "app_items",
50864
- "items": [{
50865
- "type": "button",
50866
- "level": "link",
50867
- "body": [{
50868
- "type": "tpl",
50869
- "tpl": "<div class='slds-app-launcher__tile slds-text-link_reset'><div class='slds-app-launcher__tile-figure'><svg class='w-12 h-12 slds-icon slds-icon_container rounded-sm slds-icon-${iconCategory || 'standard'}-${REPLACE(icon, '_', '-')}' aria-hidden='true'><use xlink:href='/assets/icons/${iconCategory || 'standard'}-sprite/svg/symbols.svg#${icon}'></use></svg><span class='slds-assistive-text'>${name}</span></div><div class='slds-app-launcher__tile-body'><span class='slds-link text-blue-600 text-lg'><span title='${name}'>${name}</span></span><div style='display: -webkit-box; -webkit-line-clamp: 1;-webkit-box-orient: vertical;overflow: hidden;'><span title='${description}'>${description}</span></div></div></div>",
50870
- "badge": {
50871
- "mode": "text",
50872
- "text": badgeText,
50873
- "visibleOn": badgeText,
50874
- "className": "w-full",
50875
- "overflowCount": 99,
50876
- "style": {
50877
- "top": "20px",
50878
- "left": "37px",
50879
- "height": "20px",
50880
- "border-radius": "10px",
50881
- "line-height": "18px",
50882
- "margin-left": "${" + badgeText + ">9?(" + badgeText + ">99?'-21px':'-11px'):'0'}",
50883
- "right": "auto",
50884
- "font-size": "16px"
50885
- }
50886
- }
50887
- }],
50888
- "onEvent": {
50889
- "click": {
50890
- "actions": [
50891
- {
50892
- "actionType": "closeDialog"
50893
- },
50894
- {
50895
- "actionType": "link",
50896
- "args": {
50897
- "link": "${path}"
50898
- },
50899
- "expression": "${AND(!blank , !on_click)}"
50900
- },
50901
- {
50902
- "actionType": "url",
50903
- "args": {
50904
- "url": "${path}",
50905
- "blank": true
50906
- },
50907
- "expression": "${AND(blank , !on_click)}"
51659
+ }
50908
51660
  },
50909
51661
  {
50910
- "actionType": "custom",
50911
- "script": on_click_script,
50912
- "expression": "${!!on_click}"
51662
+ "type": "button",
51663
+ "label": localizeMessage("accounts.newApp"),
51664
+ "actionType": "dialog",
51665
+ "level": "primary",
51666
+ "visibleOn": "Builder.settings.context.user.is_space_admin == true",
51667
+ "dialog": {
51668
+ "title": localizeMessage("accounts.newApp"),
51669
+ "actions": [
51670
+ {
51671
+ "type": "button",
51672
+ "actionType": "cancel",
51673
+ "label": localizeMessage("accounts.Cancel")
51674
+ },
51675
+ {
51676
+ "type": "button",
51677
+ "actionType": "confirm",
51678
+ "label": localizeMessage("accounts.OK"),
51679
+ "primary": true
51680
+ }
51681
+ ],
51682
+ "body": [
51683
+ {
51684
+ "type": "form",
51685
+ "canAccessSuperData": false,
51686
+ "api": {
51687
+ "url": "/service/api/apps/create_by_design",
51688
+ "method": "post",
51689
+ "requestAdaptor": "api.data={code: context.code, name: context.name, icon: context.icon}; return api;",
51690
+ "adaptor": "window.location.href=Steedos.getRelativeUrl('/app/' + payload.code);return {}",
51691
+ "messages": {}
51692
+ },
51693
+ "body": [
51694
+ {
51695
+ "type": "input-text",
51696
+ "name": "code",
51697
+ "label": localizeMessage("accounts.appCode"),
51698
+ "value": "a_${UUID(6)}",
51699
+ "required": true,
51700
+ "validateOnChange": true,
51701
+ "validations": {
51702
+ "isVariableName": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/
51703
+ }
51704
+ },
51705
+ {
51706
+ "name": "name",
51707
+ "type": "input-text",
51708
+ "label": localizeMessage("accounts.appName"),
51709
+ "required": true
51710
+ },
51711
+ {
51712
+ "type": "steedos-field",
51713
+ "label": localizeMessage("accounts.appIcon"),
51714
+ "config": {
51715
+ "label": localizeMessage("accounts.appIcon"),
51716
+ "type": "lookup",
51717
+ "required": true,
51718
+ "sort_no": 30,
51719
+ "optionsFunction": "function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }",
51720
+ "name": "icon",
51721
+ "inlineHelpText": "",
51722
+ "description": "",
51723
+ "hidden": false,
51724
+ "readonly": false,
51725
+ "disabled": false
51726
+ }
51727
+ }
51728
+ ]
51729
+ }
51730
+ ]
51731
+ }
50913
51732
  }
50914
51733
  ]
50915
51734
  }
51735
+ ]
51736
+ }
51737
+ ],
51738
+ "body": [
51739
+ {
51740
+ "type": "each",
51741
+ "name": "app_items",
51742
+ "items": [{
51743
+ "type": "button",
51744
+ "level": "link",
51745
+ "body": [{
51746
+ "type": "tpl",
51747
+ "tpl": "<div class='slds-app-launcher__tile slds-text-link_reset'><div class='slds-app-launcher__tile-figure'><svg class='w-12 h-12 slds-icon slds-icon_container rounded-sm slds-icon-${iconCategory || 'standard'}-${REPLACE(icon, '_', '-')}' aria-hidden='true'><use xlink:href='/assets/icons/${iconCategory || 'standard'}-sprite/svg/symbols.svg#${icon}'></use></svg><span class='slds-assistive-text'>${name}</span></div><div class='slds-app-launcher__tile-body'><span class='slds-link text-blue-600 text-lg'><span title='${name}'>${name}</span></span><div style='display: -webkit-box; -webkit-line-clamp: 1;-webkit-box-orient: vertical;overflow: hidden;'><span title='${description}'>${description}</span></div></div></div>",
51748
+ "badge": {
51749
+ "mode": "text",
51750
+ "text": badgeText,
51751
+ "visibleOn": badgeText,
51752
+ "className": "w-full",
51753
+ "overflowCount": 99,
51754
+ "style": {
51755
+ "top": "20px",
51756
+ "left": "37px",
51757
+ "height": "20px",
51758
+ "border-radius": "10px",
51759
+ "line-height": "18px",
51760
+ "margin-left": "${" + badgeText + ">9?(" + badgeText + ">99?'-21px':'-11px'):'0'}",
51761
+ "right": "auto",
51762
+ "font-size": "16px"
51763
+ }
51764
+ }
51765
+ }],
51766
+ "onEvent": {
51767
+ "click": {
51768
+ "actions": [
51769
+ {
51770
+ "actionType": "closeDialog"
51771
+ },
51772
+ {
51773
+ "actionType": "link",
51774
+ "args": {
51775
+ "link": "${path}"
51776
+ },
51777
+ "expression": "${AND(!blank , !on_click)}"
51778
+ },
51779
+ {
51780
+ "actionType": "url",
51781
+ "args": {
51782
+ "url": "${path}",
51783
+ "blank": true
51784
+ },
51785
+ "expression": "${AND(blank , !on_click)}"
51786
+ },
51787
+ {
51788
+ "actionType": "custom",
51789
+ "script": on_click_script,
51790
+ "expression": "${!!on_click}"
51791
+ }
51792
+ ]
51793
+ }
51794
+ },
51795
+ "inline": true,
51796
+ "style": {},
51797
+ "visibleOn": "${visible_on}",
51798
+ "className": "slds-p-horizontal_small app-item app-item-${id}"
51799
+ }],
51800
+ "className": "grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4"
51801
+ }
51802
+ ],
51803
+ "visible": false
51804
+ }
51805
+ ],
51806
+ "className": "steedos-apps-service steedos-apps-home p-4",
51807
+ "visibleOn": "",
51808
+ "clearValueOnHidden": false,
51809
+ "visible": true,
51810
+ "messages": {},
51811
+ "onEvent": {
51812
+ "@data.changed.steedos_keyvalues": {
51813
+ "actions": [
51814
+ {
51815
+ "actionType": "reload"
51816
+ }
51817
+ ]
51818
+ },
51819
+ "fetchInited": {
51820
+ "actions": [
51821
+ {
51822
+ "actionType": "broadcast",
51823
+ "args": {
51824
+ "eventName": "@appsLoaded"
50916
51825
  },
50917
- "inline": true,
50918
- "style": {},
50919
- "visibleOn": "${visible_on}",
50920
- "className": "slds-p-horizontal_small app-item app-item-${id}"
50921
- }],
50922
- "className": "grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4"
50923
- }
50924
- ]
50925
- }
50926
- ],
50927
- "className": "steedos-apps-service steedos-apps-home p-4",
50928
- "visibleOn": "",
50929
- "clearValueOnHidden": false,
50930
- "visible": true,
50931
- "messages": {},
50932
- "onEvent": {
50933
- "@data.changed.steedos_keyvalues": {
50934
- "actions": [
50935
- {
50936
- "actionType": "reload"
50937
- }
50938
- ]
50939
- },
50940
- "fetchInited": {
50941
- "actions": [
50942
- {
50943
- "actionType": "broadcast",
50944
- "args": {
50945
- "eventName": "@appsLoaded"
50946
- },
50947
- "data": {
50948
- "apps": "${event.data.app_items}"
51826
+ "data": {
51827
+ "apps": "${event.data.app_items}"
51828
+ }
50949
51829
  }
51830
+ ]
51831
+ }
51832
+ },
51833
+ "api": {
51834
+ "method": "get",
51835
+ "cache": "10000",
51836
+ "url": "${context.rootUrl}/service/api/apps/menus?mobile=" + isMobile,
51837
+ "data": null,
51838
+ "headers": {
51839
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
51840
+ },
51841
+ // "adaptor": pcInitApiAdaptorScript
51842
+ adaptor: pcInitJumtoFirstAppFirstTabScript
51843
+ },
51844
+ data: {
51845
+ objectName: "",
51846
+ pageType: "",
51847
+ listName: "",
51848
+ app: "",
51849
+ appId: "",
51850
+ app_id: ""
51851
+ },
51852
+ dataProvider: function(data2, setData) {
51853
+ window.addEventListener("message", function(event2) {
51854
+ const { data: data22 } = event2;
51855
+ if (data22 && data22.type === "page.dataProvider.setData") {
51856
+ setData(data22.data);
50950
51857
  }
50951
- ]
51858
+ });
50952
51859
  }
50953
- },
50954
- "api": {
50955
- "method": "get",
50956
- "cache": "10000",
50957
- "url": "${context.rootUrl}/service/api/apps/menus?mobile=" + isMobile,
50958
- "data": null,
50959
- "headers": {
50960
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
50961
- },
50962
- // "adaptor": pcInitApiAdaptorScript
50963
- adaptor: pcInitJumtoFirstAppFirstTabScript
50964
- },
50965
- data: {
50966
- objectName: "",
50967
- pageType: "",
50968
- listName: "",
50969
- app: "",
50970
- appId: "",
50971
- app_id: ""
50972
- },
50973
- dataProvider: function(data2, setData) {
50974
- window.addEventListener("message", function(event2) {
50975
- const { data: data22 } = event2;
50976
- if (data22 && data22.type === "page.dataProvider.setData") {
50977
- setData(data22.data);
50978
- }
50979
- });
50980
51860
  }
50981
51861
  }, data: {
50982
51862
  context: {
@@ -53533,7 +54413,7 @@ Try polyfilling it using "@formatjs/intl-displaynames"
53533
54413
  body: [
53534
54414
  {
53535
54415
  "type": "wrapper",
53536
- "className": "flex w-full px-4 py-0 h-[50px] justify-between items-center steedos-header-container-line-one bg-white border-b",
54416
+ "className": "flex w-full px-4 py-0 h-[50px] justify-between items-center steedos-header-container-line-one bg-white shadow",
53537
54417
  "body": [
53538
54418
  {
53539
54419
  type: "service",
@@ -54141,7 +55021,7 @@ Try polyfilling it using "@formatjs/intl-displaynames"
54141
55021
  };
54142
55022
  var marker = "vercel.ai.error";
54143
55023
  var symbol = Symbol.for(marker);
54144
- var _a;
55024
+ var _a$1;
54145
55025
  var _AISDKError = class _AISDKError2 extends Error {
54146
55026
  /**
54147
55027
  * Creates an AI SDK Error.
@@ -54157,7 +55037,7 @@ Try polyfilling it using "@formatjs/intl-displaynames"
54157
55037
  cause
54158
55038
  }) {
54159
55039
  super(message2);
54160
- this[_a] = true;
55040
+ this[_a$1] = true;
54161
55041
  this.name = name14;
54162
55042
  this.cause = cause;
54163
55043
  }
@@ -54174,7 +55054,7 @@ Try polyfilling it using "@formatjs/intl-displaynames"
54174
55054
  return error != null && typeof error === "object" && markerSymbol in error && typeof error[markerSymbol] === "boolean" && error[markerSymbol] === true;
54175
55055
  }
54176
55056
  };
54177
- _a = symbol;
55057
+ _a$1 = symbol;
54178
55058
  var AISDKError = _AISDKError;
54179
55059
  function getErrorMessage(error) {
54180
55060
  if (error == null) {
@@ -54207,26 +55087,26 @@ Try polyfilling it using "@formatjs/intl-displaynames"
54207
55087
  }
54208
55088
  };
54209
55089
  _a4 = symbol4;
54210
- var name6 = "AI_JSONParseError";
54211
- var marker7$1 = `vercel.ai.error.${name6}`;
54212
- var symbol7$1 = Symbol.for(marker7$1);
54213
- var _a7$1;
55090
+ var name6$1 = "AI_JSONParseError";
55091
+ var marker7 = `vercel.ai.error.${name6$1}`;
55092
+ var symbol7 = Symbol.for(marker7);
55093
+ var _a7;
54214
55094
  var JSONParseError = class extends AISDKError {
54215
55095
  constructor({ text: text2, cause }) {
54216
55096
  super({
54217
- name: name6,
55097
+ name: name6$1,
54218
55098
  message: `JSON parsing failed: Text: ${text2}.
54219
55099
  Error message: ${getErrorMessage(cause)}`,
54220
55100
  cause
54221
55101
  });
54222
- this[_a7$1] = true;
55102
+ this[_a7] = true;
54223
55103
  this.text = text2;
54224
55104
  }
54225
55105
  static isInstance(error) {
54226
- return AISDKError.hasMarker(error, marker7$1);
55106
+ return AISDKError.hasMarker(error, marker7);
54227
55107
  }
54228
55108
  };
54229
- _a7$1 = symbol7$1;
55109
+ _a7 = symbol7;
54230
55110
  var name12 = "AI_TypeValidationError";
54231
55111
  var marker13 = `vercel.ai.error.${name12}`;
54232
55112
  var symbol13 = Symbol.for(marker13);
@@ -54389,20 +55269,29 @@ Error message: ${getErrorMessage(cause)}`,
54389
55269
  }
54390
55270
  function $constructor(name2, initializer2, params) {
54391
55271
  function init(inst, def) {
54392
- var _a2;
54393
- Object.defineProperty(inst, "_zod", {
54394
- value: inst._zod ?? {},
54395
- enumerable: false
54396
- });
54397
- (_a2 = inst._zod).traits ?? (_a2.traits = /* @__PURE__ */ new Set());
55272
+ if (!inst._zod) {
55273
+ Object.defineProperty(inst, "_zod", {
55274
+ value: {
55275
+ def,
55276
+ constr: _2,
55277
+ traits: /* @__PURE__ */ new Set()
55278
+ },
55279
+ enumerable: false
55280
+ });
55281
+ }
55282
+ if (inst._zod.traits.has(name2)) {
55283
+ return;
55284
+ }
54398
55285
  inst._zod.traits.add(name2);
54399
55286
  initializer2(inst, def);
54400
- for (const k in _2.prototype) {
54401
- if (!(k in inst))
54402
- Object.defineProperty(inst, k, { value: _2.prototype[k].bind(inst) });
55287
+ const proto = _2.prototype;
55288
+ const keys2 = Object.keys(proto);
55289
+ for (let i = 0; i < keys2.length; i++) {
55290
+ const k = keys2[i];
55291
+ if (!(k in inst)) {
55292
+ inst[k] = proto[k].bind(inst);
55293
+ }
54403
55294
  }
54404
- inst._zod.constr = _2;
54405
- inst._zod.def = def;
54406
55295
  }
54407
55296
  const Parent = params?.Parent ?? Object;
54408
55297
  class Definition extends Parent {
@@ -54530,6 +55419,9 @@ Error message: ${getErrorMessage(cause)}`,
54530
55419
  function esc(str) {
54531
55420
  return JSON.stringify(str);
54532
55421
  }
55422
+ function slugify(input) {
55423
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
55424
+ }
54533
55425
  const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
54534
55426
  };
54535
55427
  function isObject$1(data2) {
@@ -54553,6 +55445,8 @@ Error message: ${getErrorMessage(cause)}`,
54553
55445
  const ctor = o.constructor;
54554
55446
  if (ctor === void 0)
54555
55447
  return true;
55448
+ if (typeof ctor !== "function")
55449
+ return true;
54556
55450
  const prot = ctor.prototype;
54557
55451
  if (isObject$1(prot) === false)
54558
55452
  return false;
@@ -54974,9 +55868,8 @@ Error message: ${getErrorMessage(cause)}`,
54974
55868
  const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
54975
55869
  const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
54976
55870
  const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
54977
- const base64$1 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
55871
+ const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
54978
55872
  const base64url = /^[A-Za-z0-9_-]*$/;
54979
- const hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
54980
55873
  const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
54981
55874
  const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
54982
55875
  const date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
@@ -55429,7 +56322,7 @@ Error message: ${getErrorMessage(cause)}`,
55429
56322
  const version = {
55430
56323
  major: 4,
55431
56324
  minor: 1,
55432
- patch: 12
56325
+ patch: 13
55433
56326
  };
55434
56327
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
55435
56328
  var _a2;
@@ -55605,7 +56498,7 @@ Error message: ${getErrorMessage(cause)}`,
55605
56498
  code: "invalid_format",
55606
56499
  format: "url",
55607
56500
  note: "Invalid hostname",
55608
- pattern: hostname.source,
56501
+ pattern: def.hostname.source,
55609
56502
  input: payload.value,
55610
56503
  inst,
55611
56504
  continue: !def.abort
@@ -55690,18 +56583,12 @@ Error message: ${getErrorMessage(cause)}`,
55690
56583
  const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
55691
56584
  def.pattern ?? (def.pattern = ipv4);
55692
56585
  $ZodStringFormat.init(inst, def);
55693
- inst._zod.onattach.push((inst2) => {
55694
- const bag = inst2._zod.bag;
55695
- bag.format = `ipv4`;
55696
- });
56586
+ inst._zod.bag.format = `ipv4`;
55697
56587
  });
55698
56588
  const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
55699
56589
  def.pattern ?? (def.pattern = ipv6);
55700
56590
  $ZodStringFormat.init(inst, def);
55701
- inst._zod.onattach.push((inst2) => {
55702
- const bag = inst2._zod.bag;
55703
- bag.format = `ipv6`;
55704
- });
56591
+ inst._zod.bag.format = `ipv6`;
55705
56592
  inst._zod.check = (payload) => {
55706
56593
  try {
55707
56594
  new URL(`http://[${payload.value}]`);
@@ -55761,11 +56648,9 @@ Error message: ${getErrorMessage(cause)}`,
55761
56648
  }
55762
56649
  }
55763
56650
  const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
55764
- def.pattern ?? (def.pattern = base64$1);
56651
+ def.pattern ?? (def.pattern = base64);
55765
56652
  $ZodStringFormat.init(inst, def);
55766
- inst._zod.onattach.push((inst2) => {
55767
- inst2._zod.bag.contentEncoding = "base64";
55768
- });
56653
+ inst._zod.bag.contentEncoding = "base64";
55769
56654
  inst._zod.check = (payload) => {
55770
56655
  if (isValidBase64(payload.value))
55771
56656
  return;
@@ -55788,9 +56673,7 @@ Error message: ${getErrorMessage(cause)}`,
55788
56673
  const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
55789
56674
  def.pattern ?? (def.pattern = base64url);
55790
56675
  $ZodStringFormat.init(inst, def);
55791
- inst._zod.onattach.push((inst2) => {
55792
- inst2._zod.bag.contentEncoding = "base64url";
55793
- });
56676
+ inst._zod.bag.contentEncoding = "base64url";
55794
56677
  inst._zod.check = (payload) => {
55795
56678
  if (isValidBase64URL(payload.value))
55796
56679
  return;
@@ -55865,7 +56748,7 @@ Error message: ${getErrorMessage(cause)}`,
55865
56748
  return payload;
55866
56749
  };
55867
56750
  });
55868
- const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
56751
+ const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => {
55869
56752
  $ZodCheckNumberFormat.init(inst, def);
55870
56753
  $ZodNumber.init(inst, def);
55871
56754
  });
@@ -55995,7 +56878,7 @@ Error message: ${getErrorMessage(cause)}`,
55995
56878
  const keySet = def.keySet;
55996
56879
  const _catchall = def.catchall._zod;
55997
56880
  const t = _catchall.def.type;
55998
- for (const key2 of Object.keys(input)) {
56881
+ for (const key2 in input) {
55999
56882
  if (keySet.has(key2))
56000
56883
  continue;
56001
56884
  if (t === "never") {
@@ -56381,11 +57264,13 @@ Error message: ${getErrorMessage(cause)}`,
56381
57264
  return payload;
56382
57265
  }
56383
57266
  const proms = [];
56384
- if (def.keyType._zod.values) {
56385
- const values2 = def.keyType._zod.values;
57267
+ const values2 = def.keyType._zod.values;
57268
+ if (values2) {
56386
57269
  payload.value = {};
57270
+ const recordKeys = /* @__PURE__ */ new Set();
56387
57271
  for (const key2 of values2) {
56388
57272
  if (typeof key2 === "string" || typeof key2 === "number" || typeof key2 === "symbol") {
57273
+ recordKeys.add(typeof key2 === "number" ? key2.toString() : key2);
56389
57274
  const result = def.valueType._zod.run({ value: input[key2], issues: [] }, ctx);
56390
57275
  if (result instanceof Promise) {
56391
57276
  proms.push(result.then((result2) => {
@@ -56404,7 +57289,7 @@ Error message: ${getErrorMessage(cause)}`,
56404
57289
  }
56405
57290
  let unrecognized;
56406
57291
  for (const key2 in input) {
56407
- if (!values2.has(key2)) {
57292
+ if (!recordKeys.has(key2)) {
56408
57293
  unrecognized = unrecognized ?? [];
56409
57294
  unrecognized.push(key2);
56410
57295
  }
@@ -56485,11 +57370,12 @@ Error message: ${getErrorMessage(cause)}`,
56485
57370
  if (def.values.length === 0) {
56486
57371
  throw new Error("Cannot create literal schema with no valid values");
56487
57372
  }
56488
- inst._zod.values = new Set(def.values);
57373
+ const values2 = new Set(def.values);
57374
+ inst._zod.values = values2;
56489
57375
  inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
56490
57376
  inst._zod.parse = (payload, _ctx) => {
56491
57377
  const input = payload.value;
56492
- if (inst._zod.values.has(input)) {
57378
+ if (values2.has(input)) {
56493
57379
  return payload;
56494
57380
  }
56495
57381
  payload.issues.push({
@@ -56705,8 +57591,8 @@ Error message: ${getErrorMessage(cause)}`,
56705
57591
  $ZodType.init(inst, def);
56706
57592
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
56707
57593
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
56708
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
56709
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
57594
+ defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
57595
+ defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
56710
57596
  inst._zod.parse = (payload, ctx) => {
56711
57597
  if (ctx.direction === "backward") {
56712
57598
  return def.innerType._zod.run(payload, ctx);
@@ -56725,10 +57611,10 @@ Error message: ${getErrorMessage(cause)}`,
56725
57611
  const $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
56726
57612
  $ZodType.init(inst, def);
56727
57613
  defineLazy(inst._zod, "innerType", () => def.getter());
56728
- defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
56729
- defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
56730
- defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin ?? void 0);
56731
- defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout ?? void 0);
57614
+ defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
57615
+ defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
57616
+ defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
57617
+ defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? void 0);
56732
57618
  inst._zod.parse = (payload, ctx) => {
56733
57619
  const inner = inst._zod.innerType;
56734
57620
  return inner._zod.run(payload, ctx);
@@ -56767,6 +57653,7 @@ Error message: ${getErrorMessage(cause)}`,
56767
57653
  payload.issues.push(issue(_iss));
56768
57654
  }
56769
57655
  }
57656
+ var _a;
56770
57657
  class $ZodRegistry {
56771
57658
  constructor() {
56772
57659
  this._map = /* @__PURE__ */ new WeakMap();
@@ -56813,7 +57700,8 @@ Error message: ${getErrorMessage(cause)}`,
56813
57700
  function registry() {
56814
57701
  return new $ZodRegistry();
56815
57702
  }
56816
- const globalRegistry = /* @__PURE__ */ registry();
57703
+ (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
57704
+ const globalRegistry = globalThis.__zod_globalRegistry;
56817
57705
  function _string(Class, params) {
56818
57706
  return new Class({
56819
57707
  type: "string",
@@ -57221,6 +58109,9 @@ Error message: ${getErrorMessage(cause)}`,
57221
58109
  function _toUpperCase() {
57222
58110
  return _overwrite((input) => input.toUpperCase());
57223
58111
  }
58112
+ function _slugify() {
58113
+ return _overwrite((input) => slugify(input));
58114
+ }
57224
58115
  function _array(Class, element2, params) {
57225
58116
  return new Class({
57226
58117
  type: "array",
@@ -57507,11 +58398,16 @@ Error message: ${getErrorMessage(cause)}`,
57507
58398
  }
57508
58399
  case "union": {
57509
58400
  const json = _json;
58401
+ const isDiscriminated = def.discriminator !== void 0;
57510
58402
  const options = def.options.map((x, i) => this.process(x, {
57511
58403
  ...params,
57512
- path: [...params.path, "anyOf", i]
58404
+ path: [...params.path, isDiscriminated ? "oneOf" : "anyOf", i]
57513
58405
  }));
57514
- json.anyOf = options;
58406
+ if (isDiscriminated) {
58407
+ json.oneOf = options;
58408
+ } else {
58409
+ json.anyOf = options;
58410
+ }
57515
58411
  break;
57516
58412
  }
57517
58413
  case "intersection": {
@@ -57996,100 +58892,51 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
57996
58892
  if (ctx.seen.has(_schema))
57997
58893
  return false;
57998
58894
  ctx.seen.add(_schema);
57999
- const schema = _schema;
58000
- const def = schema._zod.def;
58001
- switch (def.type) {
58002
- case "string":
58003
- case "number":
58004
- case "bigint":
58005
- case "boolean":
58006
- case "date":
58007
- case "symbol":
58008
- case "undefined":
58009
- case "null":
58010
- case "any":
58011
- case "unknown":
58012
- case "never":
58013
- case "void":
58014
- case "literal":
58015
- case "enum":
58016
- case "nan":
58017
- case "file":
58018
- case "template_literal":
58019
- return false;
58020
- case "array": {
58021
- return isTransforming(def.element, ctx);
58022
- }
58023
- case "object": {
58024
- for (const key2 in def.shape) {
58025
- if (isTransforming(def.shape[key2], ctx))
58026
- return true;
58027
- }
58028
- return false;
58029
- }
58030
- case "union": {
58031
- for (const option of def.options) {
58032
- if (isTransforming(option, ctx))
58033
- return true;
58034
- }
58035
- return false;
58036
- }
58037
- case "intersection": {
58038
- return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
58039
- }
58040
- case "tuple": {
58041
- for (const item of def.items) {
58042
- if (isTransforming(item, ctx))
58043
- return true;
58044
- }
58045
- if (def.rest && isTransforming(def.rest, ctx))
58895
+ const def = _schema._zod.def;
58896
+ if (def.type === "transform")
58897
+ return true;
58898
+ if (def.type === "array")
58899
+ return isTransforming(def.element, ctx);
58900
+ if (def.type === "set")
58901
+ return isTransforming(def.valueType, ctx);
58902
+ if (def.type === "lazy")
58903
+ return isTransforming(def.getter(), ctx);
58904
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
58905
+ return isTransforming(def.innerType, ctx);
58906
+ }
58907
+ if (def.type === "intersection") {
58908
+ return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
58909
+ }
58910
+ if (def.type === "record" || def.type === "map") {
58911
+ return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
58912
+ }
58913
+ if (def.type === "pipe") {
58914
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
58915
+ }
58916
+ if (def.type === "object") {
58917
+ for (const key2 in def.shape) {
58918
+ if (isTransforming(def.shape[key2], ctx))
58046
58919
  return true;
58047
- return false;
58048
- }
58049
- case "record": {
58050
- return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
58051
58920
  }
58052
- case "map": {
58053
- return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
58054
- }
58055
- case "set": {
58056
- return isTransforming(def.valueType, ctx);
58057
- }
58058
- // inner types
58059
- case "promise":
58060
- case "optional":
58061
- case "nonoptional":
58062
- case "nullable":
58063
- case "readonly":
58064
- return isTransforming(def.innerType, ctx);
58065
- case "lazy":
58066
- return isTransforming(def.getter(), ctx);
58067
- case "default": {
58068
- return isTransforming(def.innerType, ctx);
58069
- }
58070
- case "prefault": {
58071
- return isTransforming(def.innerType, ctx);
58921
+ return false;
58922
+ }
58923
+ if (def.type === "union") {
58924
+ for (const option of def.options) {
58925
+ if (isTransforming(option, ctx))
58926
+ return true;
58072
58927
  }
58073
- case "custom": {
58074
- return false;
58928
+ return false;
58929
+ }
58930
+ if (def.type === "tuple") {
58931
+ for (const item of def.items) {
58932
+ if (isTransforming(item, ctx))
58933
+ return true;
58075
58934
  }
58076
- case "transform": {
58935
+ if (def.rest && isTransforming(def.rest, ctx))
58077
58936
  return true;
58078
- }
58079
- case "pipe": {
58080
- return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
58081
- }
58082
- case "success": {
58083
- return false;
58084
- }
58085
- case "catch": {
58086
- return false;
58087
- }
58088
- case "function": {
58089
- return false;
58090
- }
58937
+ return false;
58091
58938
  }
58092
- throw new Error(`Unknown schema type: ${def.type}`);
58939
+ return false;
58093
58940
  }
58094
58941
  const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
58095
58942
  $ZodISODateTime.init(inst, def);
@@ -58260,6 +59107,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
58260
59107
  inst.normalize = (...args) => inst.check(_normalize(...args));
58261
59108
  inst.toLowerCase = () => inst.check(_toLowerCase());
58262
59109
  inst.toUpperCase = () => inst.check(_toUpperCase());
59110
+ inst.slugify = () => inst.check(_slugify());
58263
59111
  });
58264
59112
  const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
58265
59113
  $ZodString.init(inst, def);
@@ -58363,9 +59211,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
58363
59211
  $ZodBase64.init(inst, def);
58364
59212
  ZodStringFormat.init(inst, def);
58365
59213
  });
58366
- function base64(params) {
58367
- return _base64(ZodBase64, params);
58368
- }
58369
59214
  const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
58370
59215
  $ZodBase64URL.init(inst, def);
58371
59216
  ZodStringFormat.init(inst, def);
@@ -58494,14 +59339,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
58494
59339
  ...normalizeParams(params)
58495
59340
  });
58496
59341
  }
58497
- function looseObject(shape2, params) {
58498
- return new ZodObject({
58499
- type: "object",
58500
- shape: shape2,
58501
- catchall: unknown(),
58502
- ...normalizeParams(params)
58503
- });
58504
- }
58505
59342
  const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
58506
59343
  $ZodUnion.init(inst, def);
58507
59344
  ZodType.init(inst, def);
@@ -59080,22 +59917,35 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
59080
59917
  }
59081
59918
  return "runtime/unknown";
59082
59919
  }
59083
- function removeUndefinedEntries(record2) {
59084
- return Object.fromEntries(
59085
- Object.entries(record2).filter(([_key, value2]) => value2 != null)
59086
- );
59920
+ function normalizeHeaders(headers) {
59921
+ if (headers == null) {
59922
+ return {};
59923
+ }
59924
+ const normalized = {};
59925
+ if (headers instanceof Headers) {
59926
+ headers.forEach((value2, key2) => {
59927
+ normalized[key2.toLowerCase()] = value2;
59928
+ });
59929
+ } else {
59930
+ if (!Array.isArray(headers)) {
59931
+ headers = Object.entries(headers);
59932
+ }
59933
+ for (const [key2, value2] of headers) {
59934
+ if (value2 != null) {
59935
+ normalized[key2.toLowerCase()] = value2;
59936
+ }
59937
+ }
59938
+ }
59939
+ return normalized;
59087
59940
  }
59088
59941
  function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
59089
- const cleanedHeaders = removeUndefinedEntries(
59090
- headers != null ? headers : {}
59091
- );
59092
- const normalizedHeaders = new Headers(cleanedHeaders);
59942
+ const normalizedHeaders = new Headers(normalizeHeaders(headers));
59093
59943
  const currentUserAgentHeader = normalizedHeaders.get("user-agent") || "";
59094
59944
  normalizedHeaders.set(
59095
59945
  "user-agent",
59096
59946
  [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" ")
59097
59947
  );
59098
- return Object.fromEntries(normalizedHeaders);
59948
+ return Object.fromEntries(normalizedHeaders.entries());
59099
59949
  }
59100
59950
  var suspectProtoRx = /"__proto__"\s*:/;
59101
59951
  var suspectConstructorRx = /"constructor"\s*:/;
@@ -59133,7 +59983,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
59133
59983
  }
59134
59984
  function secureJsonParse(text2) {
59135
59985
  const { stackTraceLimit } = Error;
59136
- Error.stackTraceLimit = 0;
59986
+ try {
59987
+ Error.stackTraceLimit = 0;
59988
+ } catch (e) {
59989
+ return _parse(text2);
59990
+ }
59137
59991
  try {
59138
59992
  return _parse(text2);
59139
59993
  } finally {
@@ -60412,13 +61266,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
60412
61266
  }
60413
61267
  var __defProp = Object.defineProperty;
60414
61268
  var __export = (target, all2) => {
60415
- for (var name17 in all2)
60416
- __defProp(target, name17, { get: all2[name17], enumerable: true });
61269
+ for (var name16 in all2)
61270
+ __defProp(target, name16, { get: all2[name16], enumerable: true });
60417
61271
  };
60418
- var name7 = "AI_NoObjectGeneratedError";
60419
- var marker7 = `vercel.ai.error.${name7}`;
60420
- var symbol7 = Symbol.for(marker7);
60421
- var _a7;
61272
+ var name6 = "AI_NoObjectGeneratedError";
61273
+ var marker6 = `vercel.ai.error.${name6}`;
61274
+ var symbol6 = Symbol.for(marker6);
61275
+ var _a6;
60422
61276
  var NoObjectGeneratedError = class extends AISDKError {
60423
61277
  constructor({
60424
61278
  message: message2 = "No object generated.",
@@ -60428,19 +61282,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
60428
61282
  usage,
60429
61283
  finishReason
60430
61284
  }) {
60431
- super({ name: name7, message: message2, cause });
60432
- this[_a7] = true;
61285
+ super({ name: name6, message: message2, cause });
61286
+ this[_a6] = true;
60433
61287
  this.text = text2;
60434
61288
  this.response = response;
60435
61289
  this.usage = usage;
60436
61290
  this.finishReason = finishReason;
60437
61291
  }
60438
61292
  static isInstance(error) {
60439
- return AISDKError.hasMarker(error, marker7);
61293
+ return AISDKError.hasMarker(error, marker6);
60440
61294
  }
60441
61295
  };
60442
- _a7 = symbol7;
60443
- var VERSION = "5.0.76";
61296
+ _a6 = symbol6;
61297
+ var VERSION = "5.0.106";
60444
61298
  var dataContentSchema = union([
60445
61299
  string$2(),
60446
61300
  _instanceof(Uint8Array),
@@ -60448,8 +61302,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
60448
61302
  custom(
60449
61303
  // Buffer might not be available in some environments such as CloudFlare:
60450
61304
  (value2) => {
60451
- var _a17, _b2;
60452
- return (_b2 = (_a17 = globalThis.Buffer) == null ? void 0 : _a17.isBuffer(value2)) != null ? _b2 : false;
61305
+ var _a16, _b2;
61306
+ return (_b2 = (_a16 = globalThis.Buffer) == null ? void 0 : _a16.isBuffer(value2)) != null ? _b2 : false;
60453
61307
  },
60454
61308
  { message: "Must be a Buffer" }
60455
61309
  )
@@ -60728,6 +61582,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
60728
61582
  }),
60729
61583
  strictObject({
60730
61584
  type: literal("finish"),
61585
+ finishReason: _enum([
61586
+ "stop",
61587
+ "length",
61588
+ "content-filter",
61589
+ "tool-calls",
61590
+ "error",
61591
+ "other",
61592
+ "unknown"
61593
+ ]).optional(),
60731
61594
  messageMetadata: unknown().optional()
60732
61595
  }),
60733
61596
  strictObject({
@@ -61145,7 +62008,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61145
62008
  new TransformStream({
61146
62009
  async transform(chunk, controller) {
61147
62010
  await runUpdateMessageJob(async ({ state, write }) => {
61148
- var _a17, _b2, _c, _d;
62011
+ var _a16, _b2, _c, _d;
61149
62012
  function getToolInvocation(toolCallId) {
61150
62013
  const toolInvocations = state.message.parts.filter(isToolUIPart);
61151
62014
  const toolInvocation = toolInvocations.find(
@@ -61173,7 +62036,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61173
62036
  return toolInvocation;
61174
62037
  }
61175
62038
  function updateToolPart(options) {
61176
- var _a18;
62039
+ var _a17;
61177
62040
  const part = state.message.parts.find(
61178
62041
  (part2) => isToolUIPart(part2) && part2.toolCallId === options.toolCallId
61179
62042
  );
@@ -61186,7 +62049,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61186
62049
  anyPart.errorText = anyOptions.errorText;
61187
62050
  anyPart.rawInput = anyOptions.rawInput;
61188
62051
  anyPart.preliminary = anyOptions.preliminary;
61189
- anyPart.providerExecuted = (_a18 = anyOptions.providerExecuted) != null ? _a18 : part.providerExecuted;
62052
+ anyPart.providerExecuted = (_a17 = anyOptions.providerExecuted) != null ? _a17 : part.providerExecuted;
61190
62053
  if (anyOptions.providerMetadata != null && part.state === "input-available") {
61191
62054
  part.callProviderMetadata = anyOptions.providerMetadata;
61192
62055
  }
@@ -61206,7 +62069,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61206
62069
  }
61207
62070
  }
61208
62071
  function updateDynamicToolPart(options) {
61209
- var _a18;
62072
+ var _a17, _b22;
61210
62073
  const part = state.message.parts.find(
61211
62074
  (part2) => part2.type === "dynamic-tool" && part2.toolCallId === options.toolCallId
61212
62075
  );
@@ -61218,8 +62081,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61218
62081
  anyPart.input = anyOptions.input;
61219
62082
  anyPart.output = anyOptions.output;
61220
62083
  anyPart.errorText = anyOptions.errorText;
61221
- anyPart.rawInput = (_a18 = anyOptions.rawInput) != null ? _a18 : anyPart.rawInput;
62084
+ anyPart.rawInput = (_a17 = anyOptions.rawInput) != null ? _a17 : anyPart.rawInput;
61222
62085
  anyPart.preliminary = anyOptions.preliminary;
62086
+ anyPart.providerExecuted = (_b22 = anyOptions.providerExecuted) != null ? _b22 : part.providerExecuted;
61223
62087
  if (anyOptions.providerMetadata != null && part.state === "input-available") {
61224
62088
  part.callProviderMetadata = anyOptions.providerMetadata;
61225
62089
  }
@@ -61233,6 +62097,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61233
62097
  output: anyOptions.output,
61234
62098
  errorText: anyOptions.errorText,
61235
62099
  preliminary: anyOptions.preliminary,
62100
+ providerExecuted: anyOptions.providerExecuted,
61236
62101
  ...anyOptions.providerMetadata != null ? { callProviderMetadata: anyOptions.providerMetadata } : {}
61237
62102
  });
61238
62103
  }
@@ -61265,7 +62130,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61265
62130
  case "text-delta": {
61266
62131
  const textPart = state.activeTextParts[chunk.id];
61267
62132
  textPart.text += chunk.delta;
61268
- textPart.providerMetadata = (_a17 = chunk.providerMetadata) != null ? _a17 : textPart.providerMetadata;
62133
+ textPart.providerMetadata = (_a16 = chunk.providerMetadata) != null ? _a16 : textPart.providerMetadata;
61269
62134
  write();
61270
62135
  break;
61271
62136
  }
@@ -61349,7 +62214,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61349
62214
  toolCallId: chunk.toolCallId,
61350
62215
  toolName: chunk.toolName,
61351
62216
  state: "input-streaming",
61352
- input: void 0
62217
+ input: void 0,
62218
+ providerExecuted: chunk.providerExecuted
61353
62219
  });
61354
62220
  } else {
61355
62221
  updateToolPart({
@@ -61394,6 +62260,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61394
62260
  toolName: chunk.toolName,
61395
62261
  state: "input-available",
61396
62262
  input: chunk.input,
62263
+ providerExecuted: chunk.providerExecuted,
61397
62264
  providerMetadata: chunk.providerMetadata
61398
62265
  });
61399
62266
  } else {
@@ -61422,6 +62289,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61422
62289
  state: "output-error",
61423
62290
  input: chunk.input,
61424
62291
  errorText: chunk.errorText,
62292
+ providerExecuted: chunk.providerExecuted,
61425
62293
  providerMetadata: chunk.providerMetadata
61426
62294
  });
61427
62295
  } else {
@@ -61477,7 +62345,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61477
62345
  toolName: toolInvocation.toolName,
61478
62346
  state: "output-error",
61479
62347
  input: toolInvocation.input,
61480
- errorText: chunk.errorText
62348
+ errorText: chunk.errorText,
62349
+ providerExecuted: chunk.providerExecuted
61481
62350
  });
61482
62351
  } else {
61483
62352
  const toolInvocation = getToolInvocation(chunk.toolCallId);
@@ -61487,7 +62356,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61487
62356
  state: "output-error",
61488
62357
  input: toolInvocation.input,
61489
62358
  rawInput: toolInvocation.rawInput,
61490
- errorText: chunk.errorText
62359
+ errorText: chunk.errorText,
62360
+ providerExecuted: chunk.providerExecuted
61491
62361
  });
61492
62362
  }
61493
62363
  write();
@@ -61513,6 +62383,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61513
62383
  break;
61514
62384
  }
61515
62385
  case "finish": {
62386
+ if (chunk.finishReason != null) {
62387
+ state.finishReason = chunk.finishReason;
62388
+ }
61516
62389
  await updateMessageMetadata(chunk.messageMetadata);
61517
62390
  if (chunk.messageMetadata != null) {
61518
62391
  write();
@@ -61688,130 +62561,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61688
62561
  }
61689
62562
  };
61690
62563
  };
61691
- var ClientOrServerImplementationSchema = looseObject({
61692
- name: string$2(),
61693
- version: string$2()
61694
- });
61695
- var BaseParamsSchema = looseObject({
61696
- _meta: optional(object$1({}).loose())
61697
- });
61698
- var ResultSchema = BaseParamsSchema;
61699
- var RequestSchema = object$1({
61700
- method: string$2(),
61701
- params: optional(BaseParamsSchema)
61702
- });
61703
- var ServerCapabilitiesSchema = looseObject({
61704
- experimental: optional(object$1({}).loose()),
61705
- logging: optional(object$1({}).loose()),
61706
- prompts: optional(
61707
- looseObject({
61708
- listChanged: optional(boolean$1())
61709
- })
61710
- ),
61711
- resources: optional(
61712
- looseObject({
61713
- subscribe: optional(boolean$1()),
61714
- listChanged: optional(boolean$1())
61715
- })
61716
- ),
61717
- tools: optional(
61718
- looseObject({
61719
- listChanged: optional(boolean$1())
61720
- })
61721
- )
61722
- });
61723
- ResultSchema.extend({
61724
- protocolVersion: string$2(),
61725
- capabilities: ServerCapabilitiesSchema,
61726
- serverInfo: ClientOrServerImplementationSchema,
61727
- instructions: optional(string$2())
61728
- });
61729
- var PaginatedResultSchema = ResultSchema.extend({
61730
- nextCursor: optional(string$2())
61731
- });
61732
- var ToolSchema = object$1({
61733
- name: string$2(),
61734
- description: optional(string$2()),
61735
- inputSchema: object$1({
61736
- type: literal("object"),
61737
- properties: optional(object$1({}).loose())
61738
- }).loose()
61739
- }).loose();
61740
- PaginatedResultSchema.extend({
61741
- tools: array(ToolSchema)
61742
- });
61743
- var TextContentSchema = object$1({
61744
- type: literal("text"),
61745
- text: string$2()
61746
- }).loose();
61747
- var ImageContentSchema = object$1({
61748
- type: literal("image"),
61749
- data: base64(),
61750
- mimeType: string$2()
61751
- }).loose();
61752
- var ResourceContentsSchema = object$1({
61753
- /**
61754
- * The URI of this resource.
61755
- */
61756
- uri: string$2(),
61757
- /**
61758
- * The MIME type of this resource, if known.
61759
- */
61760
- mimeType: optional(string$2())
61761
- }).loose();
61762
- var TextResourceContentsSchema = ResourceContentsSchema.extend({
61763
- text: string$2()
61764
- });
61765
- var BlobResourceContentsSchema = ResourceContentsSchema.extend({
61766
- blob: base64()
61767
- });
61768
- var EmbeddedResourceSchema = object$1({
61769
- type: literal("resource"),
61770
- resource: union([TextResourceContentsSchema, BlobResourceContentsSchema])
61771
- }).loose();
61772
- ResultSchema.extend({
61773
- content: array(
61774
- union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])
61775
- ),
61776
- isError: boolean$1().default(false).optional()
61777
- }).or(
61778
- ResultSchema.extend({
61779
- toolResult: unknown()
61780
- })
61781
- );
61782
- var JSONRPC_VERSION = "2.0";
61783
- var JSONRPCRequestSchema = object$1({
61784
- jsonrpc: literal(JSONRPC_VERSION),
61785
- id: union([string$2(), number$1().int()])
61786
- }).merge(RequestSchema).strict();
61787
- var JSONRPCResponseSchema = object$1({
61788
- jsonrpc: literal(JSONRPC_VERSION),
61789
- id: union([string$2(), number$1().int()]),
61790
- result: ResultSchema
61791
- }).strict();
61792
- var JSONRPCErrorSchema = object$1({
61793
- jsonrpc: literal(JSONRPC_VERSION),
61794
- id: union([string$2(), number$1().int()]),
61795
- error: object$1({
61796
- code: number$1().int(),
61797
- message: string$2(),
61798
- data: optional(unknown())
61799
- })
61800
- }).strict();
61801
- var JSONRPCNotificationSchema = object$1({
61802
- jsonrpc: literal(JSONRPC_VERSION)
61803
- }).merge(
61804
- object$1({
61805
- method: string$2(),
61806
- params: optional(BaseParamsSchema)
61807
- })
61808
- ).strict();
61809
- union([
61810
- JSONRPCRequestSchema,
61811
- JSONRPCNotificationSchema,
61812
- JSONRPCResponseSchema,
61813
- JSONRPCErrorSchema
61814
- ]);
61815
62564
  async function convertFileListToFileUIParts(files) {
61816
62565
  if (files == null) {
61817
62566
  return [];
@@ -61821,12 +62570,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61821
62570
  }
61822
62571
  return Promise.all(
61823
62572
  Array.from(files).map(async (file) => {
61824
- const { name: name17, type } = file;
62573
+ const { name: name16, type } = file;
61825
62574
  const dataUrl = await new Promise((resolve2, reject) => {
61826
62575
  const reader = new FileReader();
61827
62576
  reader.onload = (readerEvent) => {
61828
- var _a17;
61829
- resolve2((_a17 = readerEvent.target) == null ? void 0 : _a17.result);
62577
+ var _a16;
62578
+ resolve2((_a16 = readerEvent.target) == null ? void 0 : _a16.result);
61830
62579
  };
61831
62580
  reader.onerror = (error) => reject(error);
61832
62581
  reader.readAsDataURL(file);
@@ -61834,7 +62583,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61834
62583
  return {
61835
62584
  type: "file",
61836
62585
  mediaType: type,
61837
- filename: name17,
62586
+ filename: name16,
61838
62587
  url: dataUrl
61839
62588
  };
61840
62589
  })
@@ -61862,23 +62611,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61862
62611
  abortSignal,
61863
62612
  ...options
61864
62613
  }) {
61865
- var _a17, _b2, _c, _d, _e;
62614
+ var _a16, _b2, _c, _d, _e;
61866
62615
  const resolvedBody = await resolve(this.body);
61867
62616
  const resolvedHeaders = await resolve(this.headers);
61868
62617
  const resolvedCredentials = await resolve(this.credentials);
61869
- const preparedRequest = await ((_a17 = this.prepareSendMessagesRequest) == null ? void 0 : _a17.call(this, {
62618
+ const baseHeaders = {
62619
+ ...normalizeHeaders(resolvedHeaders),
62620
+ ...normalizeHeaders(options.headers)
62621
+ };
62622
+ const preparedRequest = await ((_a16 = this.prepareSendMessagesRequest) == null ? void 0 : _a16.call(this, {
61870
62623
  api: this.api,
61871
62624
  id: options.chatId,
61872
62625
  messages: options.messages,
61873
62626
  body: { ...resolvedBody, ...options.body },
61874
- headers: { ...resolvedHeaders, ...options.headers },
62627
+ headers: baseHeaders,
61875
62628
  credentials: resolvedCredentials,
61876
62629
  requestMetadata: options.metadata,
61877
62630
  trigger: options.trigger,
61878
62631
  messageId: options.messageId
61879
62632
  }));
61880
62633
  const api2 = (_b2 = preparedRequest == null ? void 0 : preparedRequest.api) != null ? _b2 : this.api;
61881
- const headers = (preparedRequest == null ? void 0 : preparedRequest.headers) !== void 0 ? preparedRequest.headers : { ...resolvedHeaders, ...options.headers };
62634
+ const headers = (preparedRequest == null ? void 0 : preparedRequest.headers) !== void 0 ? normalizeHeaders(preparedRequest.headers) : baseHeaders;
61882
62635
  const body = (preparedRequest == null ? void 0 : preparedRequest.body) !== void 0 ? preparedRequest.body : {
61883
62636
  ...resolvedBody,
61884
62637
  ...options.body,
@@ -61914,20 +62667,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61914
62667
  return this.processResponseStream(response.body);
61915
62668
  }
61916
62669
  async reconnectToStream(options) {
61917
- var _a17, _b2, _c, _d, _e;
62670
+ var _a16, _b2, _c, _d, _e;
61918
62671
  const resolvedBody = await resolve(this.body);
61919
62672
  const resolvedHeaders = await resolve(this.headers);
61920
62673
  const resolvedCredentials = await resolve(this.credentials);
61921
- const preparedRequest = await ((_a17 = this.prepareReconnectToStreamRequest) == null ? void 0 : _a17.call(this, {
62674
+ const baseHeaders = {
62675
+ ...normalizeHeaders(resolvedHeaders),
62676
+ ...normalizeHeaders(options.headers)
62677
+ };
62678
+ const preparedRequest = await ((_a16 = this.prepareReconnectToStreamRequest) == null ? void 0 : _a16.call(this, {
61922
62679
  api: this.api,
61923
62680
  id: options.chatId,
61924
62681
  body: { ...resolvedBody, ...options.body },
61925
- headers: { ...resolvedHeaders, ...options.headers },
62682
+ headers: baseHeaders,
61926
62683
  credentials: resolvedCredentials,
61927
62684
  requestMetadata: options.metadata
61928
62685
  }));
61929
62686
  const api2 = (_b2 = preparedRequest == null ? void 0 : preparedRequest.api) != null ? _b2 : `${this.api}/${options.chatId}/stream`;
61930
- const headers = (preparedRequest == null ? void 0 : preparedRequest.headers) !== void 0 ? preparedRequest.headers : { ...resolvedHeaders, ...options.headers };
62687
+ const headers = (preparedRequest == null ? void 0 : preparedRequest.headers) !== void 0 ? normalizeHeaders(preparedRequest.headers) : baseHeaders;
61931
62688
  const credentials2 = (_c = preparedRequest == null ? void 0 : preparedRequest.credentials) != null ? _c : resolvedCredentials;
61932
62689
  const fetch2 = (_d = this.fetch) != null ? _d : globalThis.fetch;
61933
62690
  const response = await fetch2(api2, {
@@ -61990,11 +62747,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
61990
62747
  this.activeResponse = void 0;
61991
62748
  this.jobExecutor = new SerialJobExecutor();
61992
62749
  this.sendMessage = async (message2, options) => {
61993
- var _a17, _b2, _c, _d;
62750
+ var _a16, _b2, _c, _d;
61994
62751
  if (message2 == null) {
61995
62752
  await this.makeRequest({
61996
62753
  trigger: "submit-message",
61997
- messageId: (_a17 = this.lastMessage) == null ? void 0 : _a17.id,
62754
+ messageId: (_a16 = this.lastMessage) == null ? void 0 : _a16.id,
61998
62755
  ...options
61999
62756
  });
62000
62757
  return;
@@ -62072,14 +62829,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
62072
62829
  this.setStatus({ status: "ready" });
62073
62830
  }
62074
62831
  };
62075
- this.addToolResult = async ({
62832
+ this.addToolOutput = async ({
62076
62833
  state: state2 = "output-available",
62077
- tool: tool3,
62834
+ tool: tool2,
62078
62835
  toolCallId,
62079
62836
  output,
62080
62837
  errorText
62081
62838
  }) => this.jobExecutor.run(async () => {
62082
- var _a17, _b2;
62839
+ var _a16, _b2;
62083
62840
  const messages = this.state.messages;
62084
62841
  const lastMessage = messages[messages.length - 1];
62085
62842
  this.state.replaceMessage(messages.length - 1, {
@@ -62098,18 +62855,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
62098
62855
  } : part
62099
62856
  );
62100
62857
  }
62101
- if (this.status !== "streaming" && this.status !== "submitted" && ((_a17 = this.sendAutomaticallyWhen) == null ? void 0 : _a17.call(this, { messages: this.state.messages }))) {
62858
+ if (this.status !== "streaming" && this.status !== "submitted" && ((_a16 = this.sendAutomaticallyWhen) == null ? void 0 : _a16.call(this, { messages: this.state.messages }))) {
62102
62859
  this.makeRequest({
62103
62860
  trigger: "submit-message",
62104
62861
  messageId: (_b2 = this.lastMessage) == null ? void 0 : _b2.id
62105
62862
  });
62106
62863
  }
62107
62864
  });
62865
+ this.addToolResult = this.addToolOutput;
62108
62866
  this.stop = async () => {
62109
- var _a17;
62867
+ var _a16;
62110
62868
  if (this.status !== "streaming" && this.status !== "submitted")
62111
62869
  return;
62112
- if ((_a17 = this.activeResponse) == null ? void 0 : _a17.abortController) {
62870
+ if ((_a16 = this.activeResponse) == null ? void 0 : _a16.abortController) {
62113
62871
  this.activeResponse.abortController.abort();
62114
62872
  }
62115
62873
  };
@@ -62164,7 +62922,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
62164
62922
  body,
62165
62923
  messageId
62166
62924
  }) {
62167
- var _a17, _b2, _c;
62925
+ var _a16, _b2, _c, _d;
62168
62926
  this.setStatus({ status: "submitted", error: void 0 });
62169
62927
  const lastMessage = this.lastMessage;
62170
62928
  let isAbort = false;
@@ -62213,9 +62971,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
62213
62971
  () => job({
62214
62972
  state: activeResponse.state,
62215
62973
  write: () => {
62216
- var _a18;
62974
+ var _a17;
62217
62975
  this.setStatus({ status: "streaming" });
62218
- const replaceLastMessage = activeResponse.state.message.id === ((_a18 = this.lastMessage) == null ? void 0 : _a18.id);
62976
+ const replaceLastMessage = activeResponse.state.message.id === ((_a17 = this.lastMessage) == null ? void 0 : _a17.id);
62219
62977
  if (replaceLastMessage) {
62220
62978
  this.state.replaceMessage(
62221
62979
  this.state.messages.length - 1,
@@ -62261,22 +63019,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
62261
63019
  this.setStatus({ status: "error", error: err });
62262
63020
  } finally {
62263
63021
  try {
62264
- (_a17 = this.onFinish) == null ? void 0 : _a17.call(this, {
63022
+ (_b2 = this.onFinish) == null ? void 0 : _b2.call(this, {
62265
63023
  message: this.activeResponse.state.message,
62266
63024
  messages: this.state.messages,
62267
63025
  isAbort,
62268
63026
  isDisconnect,
62269
- isError
63027
+ isError,
63028
+ finishReason: (_a16 = this.activeResponse) == null ? void 0 : _a16.state.finishReason
62270
63029
  });
62271
63030
  } catch (err) {
62272
63031
  console.error(err);
62273
63032
  }
62274
63033
  this.activeResponse = void 0;
62275
63034
  }
62276
- if (((_b2 = this.sendAutomaticallyWhen) == null ? void 0 : _b2.call(this, { messages: this.state.messages })) && !isError) {
63035
+ if (((_c = this.sendAutomaticallyWhen) == null ? void 0 : _c.call(this, { messages: this.state.messages })) && !isError) {
62277
63036
  await this.makeRequest({
62278
63037
  trigger: "submit-message",
62279
- messageId: (_c = this.lastMessage) == null ? void 0 : _c.id,
63038
+ messageId: (_d = this.lastMessage) == null ? void 0 : _d.id,
62280
63039
  metadata,
62281
63040
  headers,
62282
63041
  body
@@ -62497,7 +63256,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
62497
63256
  error,
62498
63257
  resumeStream: chatRef.current.resumeStream,
62499
63258
  status,
62500
- addToolResult: chatRef.current.addToolResult
63259
+ /**
63260
+ * @deprecated Use `addToolOutput` instead.
63261
+ */
63262
+ addToolResult: chatRef.current.addToolOutput,
63263
+ addToolOutput: chatRef.current.addToolOutput
62501
63264
  };
62502
63265
  }
62503
63266
  function ok$1() {
@@ -63732,12 +64495,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
63732
64495
  function stringify(values2) {
63733
64496
  return values2.join(" ").trim();
63734
64497
  }
63735
- var cjs$1 = {};
63736
- var inlineStyleParser;
63737
- var hasRequiredInlineStyleParser;
63738
- function requireInlineStyleParser() {
63739
- if (hasRequiredInlineStyleParser) return inlineStyleParser;
63740
- hasRequiredInlineStyleParser = 1;
64498
+ var cjs$2 = {};
64499
+ var cjs$1;
64500
+ var hasRequiredCjs$2;
64501
+ function requireCjs$2() {
64502
+ if (hasRequiredCjs$2) return cjs$1;
64503
+ hasRequiredCjs$2 = 1;
63741
64504
  var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
63742
64505
  var NEWLINE_REGEX = /\n/g;
63743
64506
  var WHITESPACE_REGEX = /^\s*/;
@@ -63752,7 +64515,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
63752
64515
  var EMPTY_STRING = "";
63753
64516
  var TYPE_COMMENT = "comment";
63754
64517
  var TYPE_DECLARATION = "declaration";
63755
- inlineStyleParser = function(style2, options) {
64518
+ function index2(style2, options) {
63756
64519
  if (typeof style2 !== "string") {
63757
64520
  throw new TypeError("First argument must be a string");
63758
64521
  }
@@ -63865,22 +64628,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
63865
64628
  }
63866
64629
  whitespace2();
63867
64630
  return declarations();
63868
- };
64631
+ }
63869
64632
  function trim2(str) {
63870
64633
  return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
63871
64634
  }
63872
- return inlineStyleParser;
64635
+ cjs$1 = index2;
64636
+ return cjs$1;
63873
64637
  }
63874
64638
  var hasRequiredCjs$1;
63875
64639
  function requireCjs$1() {
63876
- if (hasRequiredCjs$1) return cjs$1;
64640
+ if (hasRequiredCjs$1) return cjs$2;
63877
64641
  hasRequiredCjs$1 = 1;
63878
- var __importDefault = cjs$1 && cjs$1.__importDefault || function(mod) {
64642
+ var __importDefault = cjs$2 && cjs$2.__importDefault || function(mod) {
63879
64643
  return mod && mod.__esModule ? mod : { "default": mod };
63880
64644
  };
63881
- Object.defineProperty(cjs$1, "__esModule", { value: true });
63882
- cjs$1.default = StyleToObject;
63883
- const inline_style_parser_1 = __importDefault(requireInlineStyleParser());
64645
+ Object.defineProperty(cjs$2, "__esModule", { value: true });
64646
+ cjs$2.default = StyleToObject;
64647
+ const inline_style_parser_1 = __importDefault(requireCjs$2());
63884
64648
  function StyleToObject(style2, iterator2) {
63885
64649
  let styleObject = null;
63886
64650
  if (!style2 || typeof style2 !== "string") {
@@ -63902,7 +64666,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
63902
64666
  });
63903
64667
  return styleObject;
63904
64668
  }
63905
- return cjs$1;
64669
+ return cjs$2;
63906
64670
  }
63907
64671
  var utilities = {};
63908
64672
  var hasRequiredUtilities;
@@ -69299,8 +70063,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
69299
70063
  function code$2(state, node2) {
69300
70064
  const value2 = node2.value ? node2.value + "\n" : "";
69301
70065
  const properties = {};
69302
- if (node2.lang) {
69303
- properties.className = ["language-" + node2.lang];
70066
+ const language = node2.lang ? node2.lang.split(/\s+/) : [];
70067
+ if (language.length > 0) {
70068
+ properties.className = ["language-" + language[0]];
69304
70069
  }
69305
70070
  let result = {
69306
70071
  type: "element",
@@ -76806,8 +77571,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
76806
77571
  return schema + "://" + this._hostname() + this._port() + this.opts.path + this._query(query);
76807
77572
  }
76808
77573
  _hostname() {
76809
- const hostname2 = this.opts.hostname;
76810
- return hostname2.indexOf(":") === -1 ? hostname2 : "[" + hostname2 + "]";
77574
+ const hostname = this.opts.hostname;
77575
+ return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]";
76811
77576
  }
76812
77577
  _port() {
76813
77578
  if (this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80)) {