@micro-lc/preview 0.3.2 → 0.4.0

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.
@@ -2911,7 +2911,7 @@ var Subscription = function() {
2911
2911
  this._finalizers = null;
2912
2912
  }
2913
2913
  Subscription2.prototype.unsubscribe = function() {
2914
- var e_1, _a, e_2, _b;
2914
+ var e_1, _a2, e_2, _b;
2915
2915
  var errors;
2916
2916
  if (!this.closed) {
2917
2917
  this.closed = true;
@@ -2928,8 +2928,8 @@ var Subscription = function() {
2928
2928
  e_1 = { error: e_1_1 };
2929
2929
  } finally {
2930
2930
  try {
2931
- if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return))
2932
- _a.call(_parentage_1);
2931
+ if (_parentage_1_1 && !_parentage_1_1.done && (_a2 = _parentage_1.return))
2932
+ _a2.call(_parentage_1);
2933
2933
  } finally {
2934
2934
  if (e_1)
2935
2935
  throw e_1.error;
@@ -2982,7 +2982,7 @@ var Subscription = function() {
2982
2982
  }
2983
2983
  };
2984
2984
  Subscription2.prototype.add = function(teardown) {
2985
- var _a;
2985
+ var _a2;
2986
2986
  if (teardown && teardown !== this) {
2987
2987
  if (this.closed) {
2988
2988
  execFinalizer(teardown);
@@ -2993,7 +2993,7 @@ var Subscription = function() {
2993
2993
  }
2994
2994
  teardown._addParent(this);
2995
2995
  }
2996
- (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
2996
+ (this._finalizers = (_a2 = this._finalizers) !== null && _a2 !== void 0 ? _a2 : []).push(teardown);
2997
2997
  }
2998
2998
  }
2999
2999
  };
@@ -3267,7 +3267,7 @@ var Observable = function() {
3267
3267
  var _this = this;
3268
3268
  var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error2, complete);
3269
3269
  errorContext(function() {
3270
- var _a = _this, operator = _a.operator, source = _a.source;
3270
+ var _a2 = _this, operator = _a2.operator, source = _a2.source;
3271
3271
  subscriber.add(operator ? operator.call(subscriber, source) : source ? _this._subscribe(subscriber) : _this._trySubscribe(subscriber));
3272
3272
  });
3273
3273
  return subscriber;
@@ -3299,8 +3299,8 @@ var Observable = function() {
3299
3299
  });
3300
3300
  };
3301
3301
  Observable2.prototype._subscribe = function(subscriber) {
3302
- var _a;
3303
- return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
3302
+ var _a2;
3303
+ return (_a2 = this.source) === null || _a2 === void 0 ? void 0 : _a2.subscribe(subscriber);
3304
3304
  };
3305
3305
  Observable2.prototype[observable] = function() {
3306
3306
  return this;
@@ -3332,8 +3332,8 @@ var Observable = function() {
3332
3332
  return Observable2;
3333
3333
  }();
3334
3334
  function getPromiseCtor(promiseCtor) {
3335
- var _a;
3336
- return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
3335
+ var _a2;
3336
+ return (_a2 = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a2 !== void 0 ? _a2 : Promise;
3337
3337
  }
3338
3338
  function isObserver(value) {
3339
3339
  return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
@@ -3395,11 +3395,11 @@ var OperatorSubscriber = function(_super) {
3395
3395
  return _this;
3396
3396
  }
3397
3397
  OperatorSubscriber2.prototype.unsubscribe = function() {
3398
- var _a;
3398
+ var _a2;
3399
3399
  if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
3400
3400
  var closed_1 = this.closed;
3401
3401
  _super.prototype.unsubscribe.call(this);
3402
- !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
3402
+ !closed_1 && ((_a2 = this.onFinalize) === null || _a2 === void 0 ? void 0 : _a2.call(this));
3403
3403
  }
3404
3404
  };
3405
3405
  return OperatorSubscriber2;
@@ -3436,7 +3436,7 @@ var Subject = function(_super) {
3436
3436
  Subject2.prototype.next = function(value) {
3437
3437
  var _this = this;
3438
3438
  errorContext(function() {
3439
- var e_1, _a;
3439
+ var e_1, _a2;
3440
3440
  _this._throwIfClosed();
3441
3441
  if (!_this.isStopped) {
3442
3442
  if (!_this.currentObservers) {
@@ -3451,8 +3451,8 @@ var Subject = function(_super) {
3451
3451
  e_1 = { error: e_1_1 };
3452
3452
  } finally {
3453
3453
  try {
3454
- if (_c && !_c.done && (_a = _b.return))
3455
- _a.call(_b);
3454
+ if (_c && !_c.done && (_a2 = _b.return))
3455
+ _a2.call(_b);
3456
3456
  } finally {
3457
3457
  if (e_1)
3458
3458
  throw e_1.error;
@@ -3494,8 +3494,8 @@ var Subject = function(_super) {
3494
3494
  };
3495
3495
  Object.defineProperty(Subject2.prototype, "observed", {
3496
3496
  get: function() {
3497
- var _a;
3498
- return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
3497
+ var _a2;
3498
+ return ((_a2 = this.observers) === null || _a2 === void 0 ? void 0 : _a2.length) > 0;
3499
3499
  },
3500
3500
  enumerable: false,
3501
3501
  configurable: true
@@ -3511,7 +3511,7 @@ var Subject = function(_super) {
3511
3511
  };
3512
3512
  Subject2.prototype._innerSubscribe = function(subscriber) {
3513
3513
  var _this = this;
3514
- var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
3514
+ var _a2 = this, hasError = _a2.hasError, isStopped = _a2.isStopped, observers = _a2.observers;
3515
3515
  if (hasError || isStopped) {
3516
3516
  return EMPTY_SUBSCRIPTION;
3517
3517
  }
@@ -3523,7 +3523,7 @@ var Subject = function(_super) {
3523
3523
  });
3524
3524
  };
3525
3525
  Subject2.prototype._checkFinalizedStatuses = function(subscriber) {
3526
- var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
3526
+ var _a2 = this, hasError = _a2.hasError, thrownError = _a2.thrownError, isStopped = _a2.isStopped;
3527
3527
  if (hasError) {
3528
3528
  subscriber.error(thrownError);
3529
3529
  } else if (isStopped) {
@@ -3549,20 +3549,20 @@ var AnonymousSubject = function(_super) {
3549
3549
  return _this;
3550
3550
  }
3551
3551
  AnonymousSubject2.prototype.next = function(value) {
3552
- var _a, _b;
3553
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
3552
+ var _a2, _b;
3553
+ (_b = (_a2 = this.destination) === null || _a2 === void 0 ? void 0 : _a2.next) === null || _b === void 0 ? void 0 : _b.call(_a2, value);
3554
3554
  };
3555
3555
  AnonymousSubject2.prototype.error = function(err) {
3556
- var _a, _b;
3557
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
3556
+ var _a2, _b;
3557
+ (_b = (_a2 = this.destination) === null || _a2 === void 0 ? void 0 : _a2.error) === null || _b === void 0 ? void 0 : _b.call(_a2, err);
3558
3558
  };
3559
3559
  AnonymousSubject2.prototype.complete = function() {
3560
- var _a, _b;
3561
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
3560
+ var _a2, _b;
3561
+ (_b = (_a2 = this.destination) === null || _a2 === void 0 ? void 0 : _a2.complete) === null || _b === void 0 ? void 0 : _b.call(_a2);
3562
3562
  };
3563
3563
  AnonymousSubject2.prototype._subscribe = function(subscriber) {
3564
- var _a, _b;
3565
- return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
3564
+ var _a2, _b;
3565
+ return (_b = (_a2 = this.source) === null || _a2 === void 0 ? void 0 : _a2.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
3566
3566
  };
3567
3567
  return AnonymousSubject2;
3568
3568
  }(Subject);
@@ -3586,7 +3586,7 @@ var BehaviorSubject = function(_super) {
3586
3586
  return subscription;
3587
3587
  };
3588
3588
  BehaviorSubject2.prototype.getValue = function() {
3589
- var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, _value = _a._value;
3589
+ var _a2 = this, hasError = _a2.hasError, thrownError = _a2.thrownError, _value = _a2._value;
3590
3590
  if (hasError) {
3591
3591
  throw thrownError;
3592
3592
  }
@@ -3628,7 +3628,7 @@ var ReplaySubject = function(_super) {
3628
3628
  return _this;
3629
3629
  }
3630
3630
  ReplaySubject2.prototype.next = function(value) {
3631
- var _a = this, isStopped = _a.isStopped, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow, _timestampProvider = _a._timestampProvider, _windowTime = _a._windowTime;
3631
+ var _a2 = this, isStopped = _a2.isStopped, _buffer = _a2._buffer, _infiniteTimeWindow = _a2._infiniteTimeWindow, _timestampProvider = _a2._timestampProvider, _windowTime = _a2._windowTime;
3632
3632
  if (!isStopped) {
3633
3633
  _buffer.push(value);
3634
3634
  !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);
@@ -3640,7 +3640,7 @@ var ReplaySubject = function(_super) {
3640
3640
  this._throwIfClosed();
3641
3641
  this._trimBuffer();
3642
3642
  var subscription = this._innerSubscribe(subscriber);
3643
- var _a = this, _infiniteTimeWindow = _a._infiniteTimeWindow, _buffer = _a._buffer;
3643
+ var _a2 = this, _infiniteTimeWindow = _a2._infiniteTimeWindow, _buffer = _a2._buffer;
3644
3644
  var copy = _buffer.slice();
3645
3645
  for (var i2 = 0; i2 < copy.length && !subscriber.closed; i2 += _infiniteTimeWindow ? 1 : 2) {
3646
3646
  subscriber.next(copy[i2]);
@@ -3649,7 +3649,7 @@ var ReplaySubject = function(_super) {
3649
3649
  return subscription;
3650
3650
  };
3651
3651
  ReplaySubject2.prototype._trimBuffer = function() {
3652
- var _a = this, _bufferSize = _a._bufferSize, _timestampProvider = _a._timestampProvider, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow;
3652
+ var _a2 = this, _bufferSize = _a2._bufferSize, _timestampProvider = _a2._timestampProvider, _buffer = _a2._buffer, _infiniteTimeWindow = _a2._infiniteTimeWindow;
3653
3653
  var adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;
3654
3654
  _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);
3655
3655
  if (!_infiniteTimeWindow) {
@@ -3701,7 +3701,7 @@ var AsyncAction = function(_super) {
3701
3701
  return _this;
3702
3702
  }
3703
3703
  AsyncAction2.prototype.schedule = function(state, delay) {
3704
- var _a;
3704
+ var _a2;
3705
3705
  if (delay === void 0) {
3706
3706
  delay = 0;
3707
3707
  }
@@ -3716,7 +3716,7 @@ var AsyncAction = function(_super) {
3716
3716
  }
3717
3717
  this.pending = true;
3718
3718
  this.delay = delay;
3719
- this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);
3719
+ this.id = (_a2 = this.id) !== null && _a2 !== void 0 ? _a2 : this.requestAsyncId(scheduler, this.id, delay);
3720
3720
  return this;
3721
3721
  };
3722
3722
  AsyncAction2.prototype.requestAsyncId = function(scheduler, _id, delay) {
@@ -3765,7 +3765,7 @@ var AsyncAction = function(_super) {
3765
3765
  };
3766
3766
  AsyncAction2.prototype.unsubscribe = function() {
3767
3767
  if (!this.closed) {
3768
- var _a = this, id = _a.id, scheduler = _a.scheduler;
3768
+ var _a2 = this, id = _a2.id, scheduler = _a2.scheduler;
3769
3769
  var actions = scheduler.actions;
3770
3770
  this.work = this.state = this.scheduler = null;
3771
3771
  this.pending = false;
@@ -3831,6 +3831,7 @@ var AsyncScheduler = function(_super) {
3831
3831
  return AsyncScheduler2;
3832
3832
  }(Scheduler);
3833
3833
  var asyncScheduler = new AsyncScheduler(AsyncAction);
3834
+ var async = asyncScheduler;
3834
3835
  var EMPTY = new Observable(function(subscriber) {
3835
3836
  return subscriber.complete();
3836
3837
  });
@@ -3870,7 +3871,7 @@ function isIterable(input) {
3870
3871
  }
3871
3872
  function readableStreamLikeToAsyncGenerator(readableStream) {
3872
3873
  return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {
3873
- var reader, _a, value, done;
3874
+ var reader, _a2, value, done;
3874
3875
  return __generator(this, function(_b) {
3875
3876
  switch (_b.label) {
3876
3877
  case 0:
@@ -3882,7 +3883,7 @@ function readableStreamLikeToAsyncGenerator(readableStream) {
3882
3883
  case 2:
3883
3884
  return [4, __await(reader.read())];
3884
3885
  case 3:
3885
- _a = _b.sent(), value = _a.value, done = _a.done;
3886
+ _a2 = _b.sent(), value = _a2.value, done = _a2.done;
3886
3887
  if (!done)
3887
3888
  return [3, 5];
3888
3889
  return [4, __await(void 0)];
@@ -3966,7 +3967,7 @@ function fromPromise(promise) {
3966
3967
  }
3967
3968
  function fromIterable(iterable) {
3968
3969
  return new Observable(function(subscriber) {
3969
- var e_1, _a;
3970
+ var e_1, _a2;
3970
3971
  try {
3971
3972
  for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {
3972
3973
  var value = iterable_1_1.value;
@@ -3979,8 +3980,8 @@ function fromIterable(iterable) {
3979
3980
  e_1 = { error: e_1_1 };
3980
3981
  } finally {
3981
3982
  try {
3982
- if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return))
3983
- _a.call(iterable_1);
3983
+ if (iterable_1_1 && !iterable_1_1.done && (_a2 = iterable_1.return))
3984
+ _a2.call(iterable_1);
3984
3985
  } finally {
3985
3986
  if (e_1)
3986
3987
  throw e_1.error;
@@ -4001,7 +4002,7 @@ function fromReadableStreamLike(readableStream) {
4001
4002
  }
4002
4003
  function process(asyncIterable, subscriber) {
4003
4004
  var asyncIterable_1, asyncIterable_1_1;
4004
- var e_2, _a;
4005
+ var e_2, _a2;
4005
4006
  return __awaiter(this, void 0, void 0, function() {
4006
4007
  var value, e_2_1;
4007
4008
  return __generator(this, function(_b) {
@@ -4031,9 +4032,9 @@ function process(asyncIterable, subscriber) {
4031
4032
  return [3, 11];
4032
4033
  case 6:
4033
4034
  _b.trys.push([6, , 9, 10]);
4034
- if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)))
4035
+ if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a2 = asyncIterable_1.return)))
4035
4036
  return [3, 8];
4036
- return [4, _a.call(asyncIterable_1)];
4037
+ return [4, _a2.call(asyncIterable_1)];
4037
4038
  case 7:
4038
4039
  _b.sent();
4039
4040
  _b.label = 8;
@@ -4129,11 +4130,11 @@ function scheduleIterable(input, scheduler) {
4129
4130
  executeSchedule(subscriber, scheduler, function() {
4130
4131
  iterator$1 = input[iterator]();
4131
4132
  executeSchedule(subscriber, scheduler, function() {
4132
- var _a;
4133
+ var _a2;
4133
4134
  var value;
4134
4135
  var done;
4135
4136
  try {
4136
- _a = iterator$1.next(), value = _a.value, done = _a.done;
4137
+ _a2 = iterator$1.next(), value = _a2.value, done = _a2.done;
4137
4138
  } catch (err) {
4138
4139
  subscriber.error(err);
4139
4140
  return;
@@ -4236,6 +4237,9 @@ function lastValueFrom(source, config2) {
4236
4237
  });
4237
4238
  });
4238
4239
  }
4240
+ function isValidDate(value) {
4241
+ return value instanceof Date && !isNaN(value);
4242
+ }
4239
4243
  function map(project, thisArg) {
4240
4244
  return operate(function(source, subscriber) {
4241
4245
  var index = 0;
@@ -4319,6 +4323,39 @@ function mergeMap(project, resultSelector, concurrent) {
4319
4323
  return mergeInternals(source, subscriber, project, concurrent);
4320
4324
  });
4321
4325
  }
4326
+ function timer(dueTime, intervalOrScheduler, scheduler) {
4327
+ if (dueTime === void 0) {
4328
+ dueTime = 0;
4329
+ }
4330
+ if (scheduler === void 0) {
4331
+ scheduler = async;
4332
+ }
4333
+ var intervalDuration = -1;
4334
+ if (intervalOrScheduler != null) {
4335
+ if (isScheduler(intervalOrScheduler)) {
4336
+ scheduler = intervalOrScheduler;
4337
+ } else {
4338
+ intervalDuration = intervalOrScheduler;
4339
+ }
4340
+ }
4341
+ return new Observable(function(subscriber) {
4342
+ var due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;
4343
+ if (due < 0) {
4344
+ due = 0;
4345
+ }
4346
+ var n2 = 0;
4347
+ return scheduler.schedule(function() {
4348
+ if (!subscriber.closed) {
4349
+ subscriber.next(n2++);
4350
+ if (0 <= intervalDuration) {
4351
+ this.schedule(void 0, intervalDuration);
4352
+ } else {
4353
+ subscriber.complete();
4354
+ }
4355
+ }
4356
+ }, due);
4357
+ });
4358
+ }
4322
4359
  function filter(predicate, thisArg) {
4323
4360
  return operate(function(source, subscriber) {
4324
4361
  var index = 0;
@@ -4328,12 +4365,12 @@ function filter(predicate, thisArg) {
4328
4365
  });
4329
4366
  }
4330
4367
  function bufferTime(bufferTimeSpan) {
4331
- var _a, _b;
4368
+ var _a2, _b;
4332
4369
  var otherArgs = [];
4333
4370
  for (var _i = 1; _i < arguments.length; _i++) {
4334
4371
  otherArgs[_i - 1] = arguments[_i];
4335
4372
  }
4336
- var scheduler = (_a = popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : asyncScheduler;
4373
+ var scheduler = (_a2 = popScheduler(otherArgs)) !== null && _a2 !== void 0 ? _a2 : asyncScheduler;
4337
4374
  var bufferCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null;
4338
4375
  var maxBufferSize = otherArgs[1] || Infinity;
4339
4376
  return operate(function(source, subscriber) {
@@ -4368,7 +4405,7 @@ function bufferTime(bufferTimeSpan) {
4368
4405
  }
4369
4406
  startBuffer();
4370
4407
  var bufferTimeSubscriber = createOperatorSubscriber(subscriber, function(value) {
4371
- var e_1, _a2;
4408
+ var e_1, _a3;
4372
4409
  var recordsCopy = bufferRecords.slice();
4373
4410
  try {
4374
4411
  for (var recordsCopy_1 = __values(recordsCopy), recordsCopy_1_1 = recordsCopy_1.next(); !recordsCopy_1_1.done; recordsCopy_1_1 = recordsCopy_1.next()) {
@@ -4381,8 +4418,8 @@ function bufferTime(bufferTimeSpan) {
4381
4418
  e_1 = { error: e_1_1 };
4382
4419
  } finally {
4383
4420
  try {
4384
- if (recordsCopy_1_1 && !recordsCopy_1_1.done && (_a2 = recordsCopy_1.return))
4385
- _a2.call(recordsCopy_1);
4421
+ if (recordsCopy_1_1 && !recordsCopy_1_1.done && (_a3 = recordsCopy_1.return))
4422
+ _a3.call(recordsCopy_1);
4386
4423
  } finally {
4387
4424
  if (e_1)
4388
4425
  throw e_1.error;
@@ -4428,6 +4465,37 @@ function pairwise() {
4428
4465
  }));
4429
4466
  });
4430
4467
  }
4468
+ const DEFAULT_LANGUAGE = "en";
4469
+ const localizeText = (input, lang = DEFAULT_LANGUAGE) => {
4470
+ if (typeof input === "string") {
4471
+ return input;
4472
+ }
4473
+ return input == null ? void 0 : input[lang];
4474
+ };
4475
+ function translateObject(obj) {
4476
+ return Object.entries(obj).reduce((out, [key, value]) => {
4477
+ out[key] = localizeText(value);
4478
+ return out;
4479
+ }, {});
4480
+ }
4481
+ const noop = (..._args) => {
4482
+ };
4483
+ const toArray$1 = (input) => Array.isArray(input) ? input : [input];
4484
+ const urlMakerFactory = ({ document: { baseURI }, location: { href } }) => (input) => new URL(input, new URL(baseURI, href));
4485
+ const toURL = (urlMaker, info) => {
4486
+ let url = info;
4487
+ if (!(info instanceof URL)) {
4488
+ url = urlMaker(typeof info === "string" ? info : info.url);
4489
+ }
4490
+ return url;
4491
+ };
4492
+ const trimLocationOrigin = (origin, url) => {
4493
+ const { href, origin: linkOrigin } = url;
4494
+ if (origin === linkOrigin) {
4495
+ return href.substring(origin.length);
4496
+ }
4497
+ return href;
4498
+ };
4431
4499
  const getElement = (document2, context, nth = 0) => {
4432
4500
  const { selectors } = context;
4433
4501
  return document2.querySelector(selectors[nth]);
@@ -4440,11 +4508,13 @@ const unfocus = (element, map2) => {
4440
4508
  if (originalStyle) {
4441
4509
  const { css, rest, subscription } = originalStyle;
4442
4510
  rest.forEach((el) => {
4443
- var _a;
4444
- return (_a = el.__unfocus_handler) == null ? void 0 : _a.call(el);
4511
+ var _a2;
4512
+ return (_a2 = el.__unfocus_handler) == null ? void 0 : _a2.call(el);
4445
4513
  });
4446
4514
  subscription.unsubscribe();
4447
- Object.assign(originalStyle.elementToFocus.style, css);
4515
+ originalStyle.elementToFocus.forEach((el, idx) => {
4516
+ Object.assign(el.style, css[idx]);
4517
+ });
4448
4518
  }
4449
4519
  map2.delete(element);
4450
4520
  };
@@ -4452,34 +4522,44 @@ function focus(document2, obs$, mode$) {
4452
4522
  const stylesMap = /* @__PURE__ */ new Map();
4453
4523
  const getBySelector = getElementBySelector.bind(document2);
4454
4524
  const subscription = obs$.pipe(pairwise()).subscribe(([current, next]) => {
4455
- var _a, _b, _c;
4525
+ var _a2, _b, _c;
4456
4526
  if (current !== void 0) {
4457
4527
  const prev = getElement(document2, current);
4458
4528
  if (prev !== null) {
4459
- (_a = prev.__unfocus_handler) == null ? void 0 : _a.call(prev);
4529
+ (_a2 = prev.__unfocus_handler) == null ? void 0 : _a2.call(prev);
4460
4530
  unfocus(prev, stylesMap);
4461
4531
  }
4462
4532
  }
4463
4533
  if (next !== void 0) {
4464
4534
  const [first, ...rest] = next.selectors;
4465
4535
  const otherElements = rest.reduce((arr, selector) => {
4466
- var _a2;
4536
+ var _a22;
4467
4537
  const el = getBySelector(selector);
4468
- el && arr.push(el);
4469
- (_a2 = el == null ? void 0 : el.__focus_handler) == null ? void 0 : _a2.call(el);
4538
+ if (el) {
4539
+ arr.push(el);
4540
+ (_a22 = el.__focus_handler) == null ? void 0 : _a22.call(el);
4541
+ }
4470
4542
  return arr;
4471
4543
  }, []);
4472
4544
  const firstElement = getBySelector(first);
4473
- const elementToFocus = (_c = (_b = firstElement.__focus_handler) == null ? void 0 : _b.call(firstElement)) != null ? _c : firstElement;
4545
+ if (firstElement === null) {
4546
+ return;
4547
+ }
4548
+ const elementToFocus = toArray$1((_c = (_b = firstElement.__focus_handler) == null ? void 0 : _b.call(firstElement)) != null ? _c : firstElement);
4474
4549
  const cssKeys = Object.keys(next.style);
4475
4550
  const stylePendingChanges = new Subscription();
4476
- const initialStyles = { css: {}, elementToFocus, rest: otherElements, subscription: stylePendingChanges };
4551
+ const initialStyles = { css: [], elementToFocus, rest: otherElements, subscription: stylePendingChanges };
4477
4552
  const styles = cssKeys.reduce((acc, key) => {
4478
- Object.assign(acc.css, { [key]: elementToFocus.style[key] });
4553
+ elementToFocus.forEach((el, idx) => {
4554
+ var _a22;
4555
+ acc.css[idx] = Object.assign((_a22 = acc.css[idx]) != null ? _a22 : {}, { [key]: el.style[key] });
4556
+ });
4479
4557
  return acc;
4480
4558
  }, initialStyles);
4481
4559
  stylePendingChanges.add(mode$.pipe(filter((val) => val === "select"), take(1)).subscribe(() => {
4482
- Object.assign(elementToFocus.style, next.style);
4560
+ elementToFocus.forEach((el) => {
4561
+ Object.assign(el.style, next.style);
4562
+ });
4483
4563
  }));
4484
4564
  stylesMap.set(firstElement, styles);
4485
4565
  }
@@ -4704,9 +4784,9 @@ class PostChannel {
4704
4784
  send(to, message, origin = "*") {
4705
4785
  this.__window !== to && this.postMessage(to, message, origin);
4706
4786
  }
4707
- recv(window2) {
4708
- const listener2 = ({ data }) => {
4709
- if (isInstanceMessage(data, this.__instance)) {
4787
+ recv(window2, from2 = null) {
4788
+ const listener2 = ({ data, source }) => {
4789
+ if ((from2 === null || source === from2) && isInstanceMessage(data, this.__instance)) {
4710
4790
  const message = unsign(this.__instance, data);
4711
4791
  this.__handler(message);
4712
4792
  }
@@ -5029,12 +5109,12 @@ function interpolate(variables, extra = {}) {
5029
5109
  return acc;
5030
5110
  }, []);
5031
5111
  }
5032
- function toArray$1(input) {
5112
+ function toArray(input) {
5033
5113
  return Array.isArray(input) ? input : [input];
5034
5114
  }
5035
5115
  function parseSources(sources) {
5036
5116
  const arrayOrObject = typeof sources === "string" ? [sources] : sources;
5037
- return Array.isArray(arrayOrObject) ? arrayOrObject : toArray$1(arrayOrObject.uris);
5117
+ return Array.isArray(arrayOrObject) ? arrayOrObject : toArray(arrayOrObject.uris);
5038
5118
  }
5039
5119
  const voidTags = [
5040
5120
  "area",
@@ -5084,14 +5164,14 @@ function parseContent(buffer, content, extraProperties) {
5084
5164
  acc.push(`${name}="${value}"`);
5085
5165
  return acc;
5086
5166
  }, []);
5087
- const initialTagBooleanAttributes = toArray$1(booleanAttributes);
5167
+ const initialTagBooleanAttributes = toArray(booleanAttributes);
5088
5168
  const { override, props } = Object.entries(properties).reduce((acc, [key, value]) => {
5089
5169
  extraProperties.has(key) ? typeof value === "string" && (acc.override[key] = value) : acc.props[key] = value;
5090
5170
  return acc;
5091
5171
  }, { override: {}, props: {} });
5092
5172
  const initialTagExtraProperties = Array.from(extraProperties.keys()).map((prop) => {
5093
- var _a;
5094
- return `.${prop}=\${${(_a = override[prop]) != null ? _a : prop}}`;
5173
+ var _a2;
5174
+ return `.${prop}=\${${(_a2 = override[prop]) != null ? _a2 : prop}}`;
5095
5175
  });
5096
5176
  const initialTagProperties = Object.entries(props).reduce((acc, [name, value]) => {
5097
5177
  switch (typeof value) {
@@ -5379,12 +5459,13 @@ async function createComposerContext(content, { extraProperties, context = {} }
5379
5459
  return (container, options) => Z(htmlTemplate, container, options);
5380
5460
  }
5381
5461
  async function premount(config2, proxyWindow = window, reporter2 = console.error) {
5382
- var _a;
5462
+ var _a2;
5383
5463
  let uris = [];
5384
5464
  let importmap;
5465
+ let done = Promise.resolve();
5385
5466
  if (config2.sources) {
5386
5467
  const { sources } = config2;
5387
- importmap = !Array.isArray(sources) && typeof sources !== "string" ? (_a = sources.importmap) != null ? _a : {} : {};
5468
+ importmap = !Array.isArray(sources) && typeof sources !== "string" ? (_a2 = sources.importmap) != null ? _a2 : {} : {};
5388
5469
  try {
5389
5470
  proxyWindow.importShim.addImportMap(importmap);
5390
5471
  } catch (err) {
@@ -5392,15 +5473,15 @@ async function premount(config2, proxyWindow = window, reporter2 = console.error
5392
5473
  }
5393
5474
  uris = parseSources(sources);
5394
5475
  if (uris.length > 0) {
5395
- await Promise.all(uris.map(
5476
+ done = Promise.all(uris.map(
5396
5477
  (uri) => proxyWindow.importShim(uri).catch(reporter2)
5397
5478
  ));
5398
5479
  }
5399
5480
  }
5400
- return Promise.resolve({
5481
+ return done.then(() => ({
5401
5482
  ...config2,
5402
5483
  sources: { importmap, uris }
5403
- });
5484
+ }));
5404
5485
  }
5405
5486
  async function render(config2, container, context = {}) {
5406
5487
  const appenderPromise = createComposerContext(
@@ -5442,12 +5523,14 @@ const subjects = registerChannels();
5442
5523
  function listener(message) {
5443
5524
  switch (message.type) {
5444
5525
  case "options": {
5445
- const { content: { disableOverlay, instance, redirectTo } } = message;
5526
+ const { content: { disableOverlay, redirectTo, timeout } } = message;
5446
5527
  if (disableOverlay) {
5447
5528
  Object.defineProperty(this.window, "__BACKOFFICE_CONFIGURATOR_DISABLE_OVERLAY__", { value: true });
5448
5529
  subjects.mode.next("interact");
5449
5530
  }
5450
- instance && (this.instance = instance);
5531
+ if (timeout !== void 0) {
5532
+ Object.defineProperty(this.window, "__BACKOFFICE_CONFIGURATOR_PREVIEW_TIMEOUT__", { value: timeout });
5533
+ }
5451
5534
  const { window: { history } } = this;
5452
5535
  redirectTo && history.pushState(history.state, "", redirectTo);
5453
5536
  break;
@@ -5468,9 +5551,9 @@ function listener(message) {
5468
5551
  }
5469
5552
  const postChannel = new PostChannel(listener);
5470
5553
  const fromErrorToNotification = (error2) => {
5471
- var _a;
5554
+ var _a2;
5472
5555
  return {
5473
- data: { message: error2.message, name: error2.name, stack: (_a = error2.stack) != null ? _a : "" },
5556
+ data: { message: error2.message, name: error2.name, stack: (_a2 = error2.stack) != null ? _a2 : "" },
5474
5557
  description: "preview.notifications.error.description",
5475
5558
  message: "preview.notifications.error.message",
5476
5559
  status: "error"
@@ -5530,37 +5613,6 @@ const ctrlSpaceFactory = (channels) => {
5530
5613
  }
5531
5614
  };
5532
5615
  };
5533
- const DEFAULT_LANGUAGE = "en";
5534
- const localizeText = (input, lang = DEFAULT_LANGUAGE) => {
5535
- if (typeof input === "string") {
5536
- return input;
5537
- }
5538
- return input == null ? void 0 : input[lang];
5539
- };
5540
- function translateObject(obj) {
5541
- return Object.entries(obj).reduce((out, [key, value]) => {
5542
- out[key] = localizeText(value);
5543
- return out;
5544
- }, {});
5545
- }
5546
- const noop = (..._args) => {
5547
- };
5548
- const toArray = (input) => Array.isArray(input) ? input : [input];
5549
- const urlMakerFactory = ({ document: { baseURI }, location: { href } }) => (input) => new URL(input, new URL(baseURI, href));
5550
- const toURL = (urlMaker, info) => {
5551
- let url = info;
5552
- if (!(info instanceof URL)) {
5553
- url = urlMaker(typeof info === "string" ? info : info.url);
5554
- }
5555
- return url;
5556
- };
5557
- const trimLocationOrigin = (origin, url) => {
5558
- const { href, origin: linkOrigin } = url;
5559
- if (origin === linkOrigin) {
5560
- return href.substring(origin.length);
5561
- }
5562
- return href;
5563
- };
5564
5616
  const extractConstructor = ([tag, promise]) => from(promise.then((constructor) => [tag, constructor]));
5565
5617
  const extractManifest = ([
5566
5618
  tag,
@@ -5653,20 +5705,24 @@ var __publicField$1 = (obj, key, value) => {
5653
5705
  __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
5654
5706
  return value;
5655
5707
  };
5656
- const fetchMockFactory = (instance, fetchFactory, windowHref) => {
5708
+ function fetchMockFactory(instance, fetchFactory, windowHref) {
5657
5709
  const { properties, attributes, booleanAttributes = [] } = instance;
5658
5710
  const context = Object.assign(
5659
- Object.fromEntries(toArray(booleanAttributes).map((ba) => [ba, true])),
5711
+ Object.fromEntries(toArray$1(booleanAttributes).map((ba) => [ba, true])),
5660
5712
  { ...attributes, ...properties }
5661
5713
  );
5662
5714
  const routes = fetchFactory(context);
5663
- return routes.map(({ url, method = "GET", handler: fetchHandler = () => Promise.resolve(new Response()) }) => {
5664
- var _a;
5715
+ return routes.map(({ url, method = "GET", notify = false, handler: fetchHandler = () => Promise.resolve(new Response()) }) => {
5716
+ var _a2;
5665
5717
  const info = compileObject({ ...url, method }, context);
5666
- const matcher = new URL(info.pathname, (_a = info.origin) != null ? _a : windowHref);
5667
- return [matcher.href, method, (injectedInfo, init2) => fetchHandler(injectedInfo, init2)];
5718
+ const matcher = new URL(info.pathname, (_a2 = info.origin) != null ? _a2 : windowHref);
5719
+ return [matcher.href, method, (injectedInfo, init2) => fetchHandler(injectedInfo, init2).finally(() => {
5720
+ if (notify) {
5721
+ this.notify(fetchNotification(method, matcher));
5722
+ }
5723
+ })];
5668
5724
  });
5669
- };
5725
+ }
5670
5726
  const isExactUpToQuery = (url, next) => {
5671
5727
  const { href, search } = url;
5672
5728
  const requestUrlWithoutQuery = href.replace(/\?$/, "").substring(0, href.length - search.length);
@@ -5677,14 +5733,16 @@ const isExactUpToTrailingSlash = (url, next) => {
5677
5733
  return href.match(new RegExp(`^${next.replace(/\/$/, "")}/`)) !== null;
5678
5734
  };
5679
5735
  class FetchMockStore extends Map {
5680
- constructor() {
5681
- super(...arguments);
5736
+ constructor(notify) {
5737
+ super();
5738
+ __publicField$1(this, "notify");
5682
5739
  __publicField$1(this, "__urlMap", /* @__PURE__ */ new Map());
5740
+ this.notify = notify;
5683
5741
  }
5684
5742
  add(obj, value) {
5685
- var _a, _b;
5743
+ var _a2, _b;
5686
5744
  const { method, url } = obj;
5687
- const methodMap = (_a = this.get(method)) != null ? _a : /* @__PURE__ */ new Map();
5745
+ const methodMap = (_a2 = this.get(method)) != null ? _a2 : /* @__PURE__ */ new Map();
5688
5746
  const urls = (_b = this.__urlMap.get(method)) != null ? _b : [];
5689
5747
  methodMap.set(url, value);
5690
5748
  urls.push(url);
@@ -5692,7 +5750,7 @@ class FetchMockStore extends Map {
5692
5750
  this.__urlMap.set(method, urls);
5693
5751
  }
5694
5752
  match(obj) {
5695
- var _a;
5753
+ var _a2;
5696
5754
  const { method, url } = obj;
5697
5755
  const urls = this.__urlMap.get(method);
5698
5756
  if (urls === void 0) {
@@ -5711,7 +5769,7 @@ class FetchMockStore extends Map {
5711
5769
  if (id === void 0) {
5712
5770
  return;
5713
5771
  }
5714
- return (_a = this.get(method)) == null ? void 0 : _a.get(urls[id]);
5772
+ return (_a2 = this.get(method)) == null ? void 0 : _a2.get(urls[id]);
5715
5773
  }
5716
5774
  }
5717
5775
  const storeSaverMapFactory = (store) => ([url, method, fetchHandler]) => store.add({ method, url }, fetchHandler);
@@ -5719,13 +5777,15 @@ async function handler(store, instances, factory, href) {
5719
5777
  const storeSaverMap = storeSaverMapFactory(store);
5720
5778
  if (Array.isArray(instances)) {
5721
5779
  return Promise.all(
5722
- instances.map((instance) => fetchMockFactory(instance, factory, href)).flat().map(storeSaverMap)
5780
+ instances.map((instance) => fetchMockFactory.call(store, instance, factory, href)).flat().map(storeSaverMap)
5723
5781
  ).then(noop);
5724
5782
  }
5725
5783
  return Promise.all(
5726
- fetchMockFactory(instances, factory, href).map(storeSaverMap)
5784
+ fetchMockFactory.call(store, instances, factory, href).map(storeSaverMap)
5727
5785
  ).then(noop);
5728
5786
  }
5787
+ var _a;
5788
+ const MANIFEST_TIMEOUT = (_a = window.__BACKOFFICE_CONFIGURATOR_PREVIEW_TIMEOUT__) != null ? _a : 5e3;
5729
5789
  const printHeaders = (headers) => {
5730
5790
  const obj = {};
5731
5791
  headers.forEach((val, key) => {
@@ -5734,35 +5794,52 @@ const printHeaders = (headers) => {
5734
5794
  return JSON.stringify(obj);
5735
5795
  };
5736
5796
  const fetchPrint = (window2, url, init2, resHeaders = new Headers()) => {
5737
- var _a;
5797
+ var _a2;
5738
5798
  const style = window2.origin === "null" ? { background: "antiquewhite", color: "brown" } : { background: "cyan", color: "blue" };
5739
5799
  console.groupCollapsed(`%c Fetching from ${window2.origin} `, Object.entries(style).map(([key, val]) => `${key}: ${val}`).join("; "));
5740
5800
  console.info(
5741
- `a component fetched with method ${(_a = init2 == null ? void 0 : init2.method) != null ? _a : "GET"} resource at %c ${url.href} got a response with headers ${printHeaders(resHeaders)}`,
5801
+ `a component fetched with method ${(_a2 = init2 == null ? void 0 : init2.method) != null ? _a2 : "GET"} resource at %c ${url.href} got a response with headers ${printHeaders(resHeaders)}`,
5742
5802
  "background: lightgreen; color: darkgreen"
5743
5803
  );
5744
5804
  console.groupEnd();
5745
5805
  };
5806
+ const isCustomTag = (tag) => tag.includes("-");
5807
+ const notFoundTagNotification = (tag) => ({
5808
+ data: { tag },
5809
+ description: "preview.notifications.no-webcomponent-definition.description",
5810
+ message: "preview.notifications.no-webcomponent-definition.message",
5811
+ status: "warning"
5812
+ });
5746
5813
  async function mock(contexts, tags = []) {
5747
- const { location: { href } } = this;
5814
+ const { location: { href }, fetch: originalFetch } = this;
5748
5815
  const urlMaker = urlMakerFactory(this);
5749
- const store = new FetchMockStore();
5816
+ const store = new FetchMockStore(this.notify.bind(this));
5750
5817
  await Promise.all(tags.map(async (tag) => {
5751
- var _a;
5752
- const [, {
5753
- fetch: fetchFactory = () => []
5754
- }] = await lastValueFrom(
5755
- subjects.mocks.pipe(filter(([incomingTag]) => incomingTag === tag), take(1))
5756
- );
5757
- const instancesCarryingMocks = (_a = contexts.get(tag)) != null ? _a : [];
5818
+ var _a2;
5819
+ let fetchFactory = () => [];
5820
+ const raced = await Promise.race([
5821
+ lastValueFrom(timer(MANIFEST_TIMEOUT)),
5822
+ lastValueFrom(
5823
+ subjects.mocks.pipe(filter(([incomingTag]) => incomingTag === tag), take(1))
5824
+ )
5825
+ ]);
5826
+ if (raced === 0) {
5827
+ this.notify(notFoundTagNotification(tag));
5828
+ } else {
5829
+ const [, { fetch: fetch2 }] = raced;
5830
+ if (fetch2 !== void 0) {
5831
+ fetchFactory = fetch2;
5832
+ }
5833
+ }
5834
+ const instancesCarryingMocks = (_a2 = contexts.get(tag)) != null ? _a2 : [];
5758
5835
  return handler(store, instancesCarryingMocks, fetchFactory, href);
5759
5836
  })).catch(
5760
5837
  (error2) => error2 instanceof Error && errorHandler(this, error2)
5761
5838
  );
5762
5839
  const mockedFetch = async (info, init2) => {
5763
- var _a;
5840
+ var _a2;
5764
5841
  const url = toURL(urlMaker, info);
5765
- const mockImplementation = store.match({ method: (_a = init2 == null ? void 0 : init2.method) != null ? _a : "GET", url });
5842
+ const mockImplementation = store.match({ method: (_a2 = init2 == null ? void 0 : init2.method) != null ? _a2 : "GET", url });
5766
5843
  if (mockImplementation !== void 0) {
5767
5844
  return mockImplementation(url, init2).then((res) => {
5768
5845
  {
@@ -5771,20 +5848,36 @@ async function mock(contexts, tags = []) {
5771
5848
  return res;
5772
5849
  });
5773
5850
  }
5774
- return this.fetch(info, init2);
5851
+ return originalFetch(info, init2);
5775
5852
  };
5776
5853
  if (this.proxyWindow) {
5777
- this.proxyWindow.fetch = Object.assign(
5854
+ const newFetch = Object.assign(
5778
5855
  mockedFetch,
5779
5856
  {
5780
5857
  update: async (instance) => {
5781
- const [, { fetch: fetchFactory = () => [] }] = await lastValueFrom(
5782
- subjects.mocks.pipe(filter(([incomingTag]) => incomingTag === instance.tag), take(1))
5783
- );
5858
+ let fetchFactory = () => [];
5859
+ if (isCustomTag(instance.tag)) {
5860
+ const raced = await Promise.race([
5861
+ lastValueFrom(timer(MANIFEST_TIMEOUT)),
5862
+ lastValueFrom(
5863
+ subjects.mocks.pipe(filter(([incomingTag]) => incomingTag === instance.tag), take(1))
5864
+ )
5865
+ ]);
5866
+ if (raced === 0) {
5867
+ this.notify(notFoundTagNotification(instance.tag));
5868
+ } else {
5869
+ const [, { fetch: fetch2 }] = raced;
5870
+ if (fetch2 !== void 0) {
5871
+ fetchFactory = fetch2;
5872
+ }
5873
+ }
5874
+ }
5784
5875
  return handler(store, instance, fetchFactory, href);
5785
5876
  }
5786
5877
  }
5787
5878
  );
5879
+ this.fetch = newFetch;
5880
+ this.proxyWindow.fetch = newFetch;
5788
5881
  }
5789
5882
  }
5790
5883
  function open(url, target) {
@@ -5852,8 +5945,8 @@ class InMemoryStorage extends Map {
5852
5945
  super.clear();
5853
5946
  }
5854
5947
  getItem(key) {
5855
- var _a;
5856
- return (_a = super.get(key)) != null ? _a : null;
5948
+ var _a2;
5949
+ return (_a2 = super.get(key)) != null ? _a2 : null;
5857
5950
  }
5858
5951
  key() {
5859
5952
  return null;
@@ -5872,11 +5965,11 @@ function domPatch(frame) {
5872
5965
  const element = originalCreateElement.call(this, tagName, options);
5873
5966
  if (isAnchor(element)) {
5874
5967
  const notifyAnchorClick = () => {
5875
- var _a;
5968
+ var _a2;
5876
5969
  return frame.notify({
5877
5970
  data: {
5878
5971
  href: trimLocationOrigin(frame.location.origin, new URL(element.href, frame.location.href)),
5879
- target: (_a = element.getAttribute("target")) != null ? _a : "_self"
5972
+ target: (_a2 = element.getAttribute("target")) != null ? _a2 : "_self"
5880
5973
  },
5881
5974
  description: "preview.notifications.anchor.description",
5882
5975
  message: "preview.notifications.anchor.message",
@@ -6059,8 +6152,8 @@ const run = (frame, renderRoot, channels) => {
6059
6152
  const { context } = next;
6060
6153
  done = queue.add([
6061
6154
  () => {
6062
- var _a, _b, _c;
6063
- return (_c = (_a = frame.proxyWindow) == null ? void 0 : (_b = _a.fetch).update) == null ? void 0 : _c.call(_b, context);
6155
+ var _a2, _b, _c;
6156
+ return (_c = (_a2 = frame.proxyWindow) == null ? void 0 : (_b = _a2.fetch).update) == null ? void 0 : _c.call(_b, context);
6064
6157
  },
6065
6158
  () => update.call(frame, content, renderRoot).finally(() => channels.updated.next(0))
6066
6159
  ]);
@@ -6088,6 +6181,12 @@ const isSameDocumentOriginRequest = (self2, url) => {
6088
6181
  }
6089
6182
  return true;
6090
6183
  };
6184
+ const fetchNotification = (method, url) => ({
6185
+ data: { method, url: url.href.substring(url.origin.length) },
6186
+ description: "preview.notifications.fetch-event.description",
6187
+ message: "preview.notifications.fetch-event.message",
6188
+ status: "info"
6189
+ });
6091
6190
  const interceptCORSFetch = (self2, notification) => {
6092
6191
  const urlMaker = urlMakerFactory(self2);
6093
6192
  const { document: document2, parent } = self2;
@@ -6096,15 +6195,10 @@ const interceptCORSFetch = (self2, notification) => {
6096
6195
  }
6097
6196
  const originalFetch = self2.fetch.bind(self2);
6098
6197
  self2.fetch = (input, init2) => {
6099
- var _a;
6198
+ var _a2;
6100
6199
  const url = toURL(urlMaker, input);
6101
6200
  if (isSameDocumentOriginRequest(document2, url)) {
6102
- notification.next({
6103
- data: { method: (_a = init2 == null ? void 0 : init2.method) != null ? _a : "GET", url: url.href.substring(url.origin.length) },
6104
- description: "preview.notifications.fetch-event.description",
6105
- message: "preview.notifications.fetch-event.message",
6106
- status: "info"
6107
- });
6201
+ notification.next(fetchNotification((_a2 = init2 == null ? void 0 : init2.method) != null ? _a2 : "GET", url));
6108
6202
  }
6109
6203
  return originalFetch(input, init2);
6110
6204
  };
@@ -6190,7 +6284,7 @@ function registerCleanups(window2, fns) {
6190
6284
  }
6191
6285
  ((self2) => {
6192
6286
  init(self2);
6193
- const postChannelCleanup = postChannel.recv(self2);
6287
+ const postChannelCleanup = postChannel.recv(self2, self2.top);
6194
6288
  const senderCleanup = registerSenders(subjects);
6195
6289
  const listenerCleanup = registerEventListeners(
6196
6290
  self2,