@cadenza.io/core 3.18.2 → 3.19.1

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.
package/dist/index.mjs CHANGED
@@ -256,15 +256,123 @@ function debounce(func, wait, options) {
256
256
  }
257
257
  var debounce_default = debounce;
258
258
 
259
- // node_modules/lodash-es/isArray.js
260
- var isArray = Array.isArray;
261
- var isArray_default = isArray;
259
+ // src/utils/promise.ts
260
+ function sleep(ms) {
261
+ return new Promise((resolve) => setTimeout(resolve, ms));
262
+ }
262
263
 
263
- // node_modules/lodash-es/identity.js
264
- function identity(value) {
265
- return value;
264
+ // node_modules/lodash-es/_listCacheClear.js
265
+ function listCacheClear() {
266
+ this.__data__ = [];
267
+ this.size = 0;
266
268
  }
267
- var identity_default = identity;
269
+ var listCacheClear_default = listCacheClear;
270
+
271
+ // node_modules/lodash-es/eq.js
272
+ function eq(value, other) {
273
+ return value === other || value !== value && other !== other;
274
+ }
275
+ var eq_default = eq;
276
+
277
+ // node_modules/lodash-es/_assocIndexOf.js
278
+ function assocIndexOf(array, key) {
279
+ var length = array.length;
280
+ while (length--) {
281
+ if (eq_default(array[length][0], key)) {
282
+ return length;
283
+ }
284
+ }
285
+ return -1;
286
+ }
287
+ var assocIndexOf_default = assocIndexOf;
288
+
289
+ // node_modules/lodash-es/_listCacheDelete.js
290
+ var arrayProto = Array.prototype;
291
+ var splice = arrayProto.splice;
292
+ function listCacheDelete(key) {
293
+ var data = this.__data__, index = assocIndexOf_default(data, key);
294
+ if (index < 0) {
295
+ return false;
296
+ }
297
+ var lastIndex = data.length - 1;
298
+ if (index == lastIndex) {
299
+ data.pop();
300
+ } else {
301
+ splice.call(data, index, 1);
302
+ }
303
+ --this.size;
304
+ return true;
305
+ }
306
+ var listCacheDelete_default = listCacheDelete;
307
+
308
+ // node_modules/lodash-es/_listCacheGet.js
309
+ function listCacheGet(key) {
310
+ var data = this.__data__, index = assocIndexOf_default(data, key);
311
+ return index < 0 ? void 0 : data[index][1];
312
+ }
313
+ var listCacheGet_default = listCacheGet;
314
+
315
+ // node_modules/lodash-es/_listCacheHas.js
316
+ function listCacheHas(key) {
317
+ return assocIndexOf_default(this.__data__, key) > -1;
318
+ }
319
+ var listCacheHas_default = listCacheHas;
320
+
321
+ // node_modules/lodash-es/_listCacheSet.js
322
+ function listCacheSet(key, value) {
323
+ var data = this.__data__, index = assocIndexOf_default(data, key);
324
+ if (index < 0) {
325
+ ++this.size;
326
+ data.push([key, value]);
327
+ } else {
328
+ data[index][1] = value;
329
+ }
330
+ return this;
331
+ }
332
+ var listCacheSet_default = listCacheSet;
333
+
334
+ // node_modules/lodash-es/_ListCache.js
335
+ function ListCache(entries) {
336
+ var index = -1, length = entries == null ? 0 : entries.length;
337
+ this.clear();
338
+ while (++index < length) {
339
+ var entry = entries[index];
340
+ this.set(entry[0], entry[1]);
341
+ }
342
+ }
343
+ ListCache.prototype.clear = listCacheClear_default;
344
+ ListCache.prototype["delete"] = listCacheDelete_default;
345
+ ListCache.prototype.get = listCacheGet_default;
346
+ ListCache.prototype.has = listCacheHas_default;
347
+ ListCache.prototype.set = listCacheSet_default;
348
+ var ListCache_default = ListCache;
349
+
350
+ // node_modules/lodash-es/_stackClear.js
351
+ function stackClear() {
352
+ this.__data__ = new ListCache_default();
353
+ this.size = 0;
354
+ }
355
+ var stackClear_default = stackClear;
356
+
357
+ // node_modules/lodash-es/_stackDelete.js
358
+ function stackDelete(key) {
359
+ var data = this.__data__, result = data["delete"](key);
360
+ this.size = data.size;
361
+ return result;
362
+ }
363
+ var stackDelete_default = stackDelete;
364
+
365
+ // node_modules/lodash-es/_stackGet.js
366
+ function stackGet(key) {
367
+ return this.__data__.get(key);
368
+ }
369
+ var stackGet_default = stackGet;
370
+
371
+ // node_modules/lodash-es/_stackHas.js
372
+ function stackHas(key) {
373
+ return this.__data__.has(key);
374
+ }
375
+ var stackHas_default = stackHas;
268
376
 
269
377
  // node_modules/lodash-es/isFunction.js
270
378
  var asyncTag = "[object AsyncFunction]";
@@ -344,473 +452,134 @@ function getNative(object, key) {
344
452
  }
345
453
  var getNative_default = getNative;
346
454
 
347
- // node_modules/lodash-es/_baseCreate.js
348
- var objectCreate = Object.create;
349
- var baseCreate = /* @__PURE__ */ (function() {
350
- function object() {
351
- }
352
- return function(proto) {
353
- if (!isObject_default(proto)) {
354
- return {};
355
- }
356
- if (objectCreate) {
357
- return objectCreate(proto);
358
- }
359
- object.prototype = proto;
360
- var result = new object();
361
- object.prototype = void 0;
362
- return result;
363
- };
364
- })();
365
- var baseCreate_default = baseCreate;
455
+ // node_modules/lodash-es/_Map.js
456
+ var Map2 = getNative_default(root_default, "Map");
457
+ var Map_default = Map2;
366
458
 
367
- // node_modules/lodash-es/_apply.js
368
- function apply(func, thisArg, args) {
369
- switch (args.length) {
370
- case 0:
371
- return func.call(thisArg);
372
- case 1:
373
- return func.call(thisArg, args[0]);
374
- case 2:
375
- return func.call(thisArg, args[0], args[1]);
376
- case 3:
377
- return func.call(thisArg, args[0], args[1], args[2]);
378
- }
379
- return func.apply(thisArg, args);
459
+ // node_modules/lodash-es/_nativeCreate.js
460
+ var nativeCreate = getNative_default(Object, "create");
461
+ var nativeCreate_default = nativeCreate;
462
+
463
+ // node_modules/lodash-es/_hashClear.js
464
+ function hashClear() {
465
+ this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
466
+ this.size = 0;
380
467
  }
381
- var apply_default = apply;
468
+ var hashClear_default = hashClear;
382
469
 
383
- // node_modules/lodash-es/_copyArray.js
384
- function copyArray(source, array) {
385
- var index = -1, length = source.length;
386
- array || (array = Array(length));
387
- while (++index < length) {
388
- array[index] = source[index];
470
+ // node_modules/lodash-es/_hashDelete.js
471
+ function hashDelete(key) {
472
+ var result = this.has(key) && delete this.__data__[key];
473
+ this.size -= result ? 1 : 0;
474
+ return result;
475
+ }
476
+ var hashDelete_default = hashDelete;
477
+
478
+ // node_modules/lodash-es/_hashGet.js
479
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
480
+ var objectProto4 = Object.prototype;
481
+ var hasOwnProperty3 = objectProto4.hasOwnProperty;
482
+ function hashGet(key) {
483
+ var data = this.__data__;
484
+ if (nativeCreate_default) {
485
+ var result = data[key];
486
+ return result === HASH_UNDEFINED ? void 0 : result;
389
487
  }
390
- return array;
488
+ return hasOwnProperty3.call(data, key) ? data[key] : void 0;
391
489
  }
392
- var copyArray_default = copyArray;
490
+ var hashGet_default = hashGet;
393
491
 
394
- // node_modules/lodash-es/_shortOut.js
395
- var HOT_COUNT = 800;
396
- var HOT_SPAN = 16;
397
- var nativeNow = Date.now;
398
- function shortOut(func) {
399
- var count = 0, lastCalled = 0;
400
- return function() {
401
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
402
- lastCalled = stamp;
403
- if (remaining > 0) {
404
- if (++count >= HOT_COUNT) {
405
- return arguments[0];
406
- }
407
- } else {
408
- count = 0;
409
- }
410
- return func.apply(void 0, arguments);
411
- };
492
+ // node_modules/lodash-es/_hashHas.js
493
+ var objectProto5 = Object.prototype;
494
+ var hasOwnProperty4 = objectProto5.hasOwnProperty;
495
+ function hashHas(key) {
496
+ var data = this.__data__;
497
+ return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty4.call(data, key);
412
498
  }
413
- var shortOut_default = shortOut;
499
+ var hashHas_default = hashHas;
414
500
 
415
- // node_modules/lodash-es/constant.js
416
- function constant(value) {
417
- return function() {
418
- return value;
419
- };
501
+ // node_modules/lodash-es/_hashSet.js
502
+ var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
503
+ function hashSet(key, value) {
504
+ var data = this.__data__;
505
+ this.size += this.has(key) ? 0 : 1;
506
+ data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
507
+ return this;
420
508
  }
421
- var constant_default = constant;
509
+ var hashSet_default = hashSet;
422
510
 
423
- // node_modules/lodash-es/_defineProperty.js
424
- var defineProperty = (function() {
425
- try {
426
- var func = getNative_default(Object, "defineProperty");
427
- func({}, "", {});
428
- return func;
429
- } catch (e) {
511
+ // node_modules/lodash-es/_Hash.js
512
+ function Hash(entries) {
513
+ var index = -1, length = entries == null ? 0 : entries.length;
514
+ this.clear();
515
+ while (++index < length) {
516
+ var entry = entries[index];
517
+ this.set(entry[0], entry[1]);
430
518
  }
431
- })();
432
- var defineProperty_default = defineProperty;
519
+ }
520
+ Hash.prototype.clear = hashClear_default;
521
+ Hash.prototype["delete"] = hashDelete_default;
522
+ Hash.prototype.get = hashGet_default;
523
+ Hash.prototype.has = hashHas_default;
524
+ Hash.prototype.set = hashSet_default;
525
+ var Hash_default = Hash;
433
526
 
434
- // node_modules/lodash-es/_baseSetToString.js
435
- var baseSetToString = !defineProperty_default ? identity_default : function(func, string) {
436
- return defineProperty_default(func, "toString", {
437
- "configurable": true,
438
- "enumerable": false,
439
- "value": constant_default(string),
440
- "writable": true
441
- });
442
- };
443
- var baseSetToString_default = baseSetToString;
444
-
445
- // node_modules/lodash-es/_setToString.js
446
- var setToString = shortOut_default(baseSetToString_default);
447
- var setToString_default = setToString;
448
-
449
- // node_modules/lodash-es/_isIndex.js
450
- var MAX_SAFE_INTEGER = 9007199254740991;
451
- var reIsUint = /^(?:0|[1-9]\d*)$/;
452
- function isIndex(value, length) {
453
- var type = typeof value;
454
- length = length == null ? MAX_SAFE_INTEGER : length;
455
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
456
- }
457
- var isIndex_default = isIndex;
458
-
459
- // node_modules/lodash-es/_baseAssignValue.js
460
- function baseAssignValue(object, key, value) {
461
- if (key == "__proto__" && defineProperty_default) {
462
- defineProperty_default(object, key, {
463
- "configurable": true,
464
- "enumerable": true,
465
- "value": value,
466
- "writable": true
467
- });
468
- } else {
469
- object[key] = value;
470
- }
471
- }
472
- var baseAssignValue_default = baseAssignValue;
473
-
474
- // node_modules/lodash-es/eq.js
475
- function eq(value, other) {
476
- return value === other || value !== value && other !== other;
477
- }
478
- var eq_default = eq;
479
-
480
- // node_modules/lodash-es/_assignValue.js
481
- var objectProto4 = Object.prototype;
482
- var hasOwnProperty3 = objectProto4.hasOwnProperty;
483
- function assignValue(object, key, value) {
484
- var objValue = object[key];
485
- if (!(hasOwnProperty3.call(object, key) && eq_default(objValue, value)) || value === void 0 && !(key in object)) {
486
- baseAssignValue_default(object, key, value);
487
- }
488
- }
489
- var assignValue_default = assignValue;
490
-
491
- // node_modules/lodash-es/_copyObject.js
492
- function copyObject(source, props, object, customizer) {
493
- var isNew = !object;
494
- object || (object = {});
495
- var index = -1, length = props.length;
496
- while (++index < length) {
497
- var key = props[index];
498
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
499
- if (newValue === void 0) {
500
- newValue = source[key];
501
- }
502
- if (isNew) {
503
- baseAssignValue_default(object, key, newValue);
504
- } else {
505
- assignValue_default(object, key, newValue);
506
- }
507
- }
508
- return object;
509
- }
510
- var copyObject_default = copyObject;
511
-
512
- // node_modules/lodash-es/_overRest.js
513
- var nativeMax2 = Math.max;
514
- function overRest(func, start, transform) {
515
- start = nativeMax2(start === void 0 ? func.length - 1 : start, 0);
516
- return function() {
517
- var args = arguments, index = -1, length = nativeMax2(args.length - start, 0), array = Array(length);
518
- while (++index < length) {
519
- array[index] = args[start + index];
520
- }
521
- index = -1;
522
- var otherArgs = Array(start + 1);
523
- while (++index < start) {
524
- otherArgs[index] = args[index];
525
- }
526
- otherArgs[start] = transform(array);
527
- return apply_default(func, this, otherArgs);
528
- };
529
- }
530
- var overRest_default = overRest;
531
-
532
- // node_modules/lodash-es/_baseRest.js
533
- function baseRest(func, start) {
534
- return setToString_default(overRest_default(func, start, identity_default), func + "");
535
- }
536
- var baseRest_default = baseRest;
537
-
538
- // node_modules/lodash-es/isLength.js
539
- var MAX_SAFE_INTEGER2 = 9007199254740991;
540
- function isLength(value) {
541
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
542
- }
543
- var isLength_default = isLength;
544
-
545
- // node_modules/lodash-es/isArrayLike.js
546
- function isArrayLike(value) {
547
- return value != null && isLength_default(value.length) && !isFunction_default(value);
548
- }
549
- var isArrayLike_default = isArrayLike;
550
-
551
- // node_modules/lodash-es/_isIterateeCall.js
552
- function isIterateeCall(value, index, object) {
553
- if (!isObject_default(object)) {
554
- return false;
555
- }
556
- var type = typeof index;
557
- if (type == "number" ? isArrayLike_default(object) && isIndex_default(index, object.length) : type == "string" && index in object) {
558
- return eq_default(object[index], value);
559
- }
560
- return false;
561
- }
562
- var isIterateeCall_default = isIterateeCall;
563
-
564
- // node_modules/lodash-es/_createAssigner.js
565
- function createAssigner(assigner) {
566
- return baseRest_default(function(object, sources) {
567
- var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
568
- customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
569
- if (guard && isIterateeCall_default(sources[0], sources[1], guard)) {
570
- customizer = length < 3 ? void 0 : customizer;
571
- length = 1;
572
- }
573
- object = Object(object);
574
- while (++index < length) {
575
- var source = sources[index];
576
- if (source) {
577
- assigner(object, source, index, customizer);
578
- }
579
- }
580
- return object;
581
- });
582
- }
583
- var createAssigner_default = createAssigner;
584
-
585
- // node_modules/lodash-es/_isPrototype.js
586
- var objectProto5 = Object.prototype;
587
- function isPrototype(value) {
588
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto5;
589
- return value === proto;
590
- }
591
- var isPrototype_default = isPrototype;
592
-
593
- // node_modules/lodash-es/_baseTimes.js
594
- function baseTimes(n, iteratee) {
595
- var index = -1, result = Array(n);
596
- while (++index < n) {
597
- result[index] = iteratee(index);
598
- }
599
- return result;
600
- }
601
- var baseTimes_default = baseTimes;
602
-
603
- // node_modules/lodash-es/_baseIsArguments.js
604
- var argsTag = "[object Arguments]";
605
- function baseIsArguments(value) {
606
- return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
607
- }
608
- var baseIsArguments_default = baseIsArguments;
609
-
610
- // node_modules/lodash-es/isArguments.js
611
- var objectProto6 = Object.prototype;
612
- var hasOwnProperty4 = objectProto6.hasOwnProperty;
613
- var propertyIsEnumerable = objectProto6.propertyIsEnumerable;
614
- var isArguments = baseIsArguments_default(/* @__PURE__ */ (function() {
615
- return arguments;
616
- })()) ? baseIsArguments_default : function(value) {
617
- return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
618
- };
619
- var isArguments_default = isArguments;
620
-
621
- // node_modules/lodash-es/stubFalse.js
622
- function stubFalse() {
623
- return false;
624
- }
625
- var stubFalse_default = stubFalse;
626
-
627
- // node_modules/lodash-es/isBuffer.js
628
- var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
629
- var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
630
- var moduleExports = freeModule && freeModule.exports === freeExports;
631
- var Buffer = moduleExports ? root_default.Buffer : void 0;
632
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
633
- var isBuffer = nativeIsBuffer || stubFalse_default;
634
- var isBuffer_default = isBuffer;
635
-
636
- // node_modules/lodash-es/_baseIsTypedArray.js
637
- var argsTag2 = "[object Arguments]";
638
- var arrayTag = "[object Array]";
639
- var boolTag = "[object Boolean]";
640
- var dateTag = "[object Date]";
641
- var errorTag = "[object Error]";
642
- var funcTag2 = "[object Function]";
643
- var mapTag = "[object Map]";
644
- var numberTag = "[object Number]";
645
- var objectTag = "[object Object]";
646
- var regexpTag = "[object RegExp]";
647
- var setTag = "[object Set]";
648
- var stringTag = "[object String]";
649
- var weakMapTag = "[object WeakMap]";
650
- var arrayBufferTag = "[object ArrayBuffer]";
651
- var dataViewTag = "[object DataView]";
652
- var float32Tag = "[object Float32Array]";
653
- var float64Tag = "[object Float64Array]";
654
- var int8Tag = "[object Int8Array]";
655
- var int16Tag = "[object Int16Array]";
656
- var int32Tag = "[object Int32Array]";
657
- var uint8Tag = "[object Uint8Array]";
658
- var uint8ClampedTag = "[object Uint8ClampedArray]";
659
- var uint16Tag = "[object Uint16Array]";
660
- var uint32Tag = "[object Uint32Array]";
661
- var typedArrayTags = {};
662
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
663
- typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
664
- function baseIsTypedArray(value) {
665
- return isObjectLike_default(value) && isLength_default(value.length) && !!typedArrayTags[baseGetTag_default(value)];
666
- }
667
- var baseIsTypedArray_default = baseIsTypedArray;
668
-
669
- // node_modules/lodash-es/_baseUnary.js
670
- function baseUnary(func) {
671
- return function(value) {
672
- return func(value);
673
- };
674
- }
675
- var baseUnary_default = baseUnary;
676
-
677
- // node_modules/lodash-es/_nodeUtil.js
678
- var freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports;
679
- var freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
680
- var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
681
- var freeProcess = moduleExports2 && freeGlobal_default.process;
682
- var nodeUtil = (function() {
683
- try {
684
- var types = freeModule2 && freeModule2.require && freeModule2.require("util").types;
685
- if (types) {
686
- return types;
687
- }
688
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
689
- } catch (e) {
690
- }
691
- })();
692
- var nodeUtil_default = nodeUtil;
693
-
694
- // node_modules/lodash-es/isTypedArray.js
695
- var nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray;
696
- var isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default;
697
- var isTypedArray_default = isTypedArray;
698
-
699
- // node_modules/lodash-es/_arrayLikeKeys.js
700
- var objectProto7 = Object.prototype;
701
- var hasOwnProperty5 = objectProto7.hasOwnProperty;
702
- function arrayLikeKeys(value, inherited) {
703
- var isArr = isArray_default(value), isArg = !isArr && isArguments_default(value), isBuff = !isArr && !isArg && isBuffer_default(value), isType = !isArr && !isArg && !isBuff && isTypedArray_default(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes_default(value.length, String) : [], length = result.length;
704
- for (var key in value) {
705
- if ((inherited || hasOwnProperty5.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
706
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
707
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
708
- isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
709
- isIndex_default(key, length)))) {
710
- result.push(key);
711
- }
712
- }
713
- return result;
714
- }
715
- var arrayLikeKeys_default = arrayLikeKeys;
716
-
717
- // node_modules/lodash-es/_overArg.js
718
- function overArg(func, transform) {
719
- return function(arg) {
720
- return func(transform(arg));
527
+ // node_modules/lodash-es/_mapCacheClear.js
528
+ function mapCacheClear() {
529
+ this.size = 0;
530
+ this.__data__ = {
531
+ "hash": new Hash_default(),
532
+ "map": new (Map_default || ListCache_default)(),
533
+ "string": new Hash_default()
721
534
  };
722
535
  }
723
- var overArg_default = overArg;
724
-
725
- // node_modules/lodash-es/_nativeKeysIn.js
726
- function nativeKeysIn(object) {
727
- var result = [];
728
- if (object != null) {
729
- for (var key in Object(object)) {
730
- result.push(key);
731
- }
732
- }
733
- return result;
734
- }
735
- var nativeKeysIn_default = nativeKeysIn;
736
-
737
- // node_modules/lodash-es/_baseKeysIn.js
738
- var objectProto8 = Object.prototype;
739
- var hasOwnProperty6 = objectProto8.hasOwnProperty;
740
- function baseKeysIn(object) {
741
- if (!isObject_default(object)) {
742
- return nativeKeysIn_default(object);
743
- }
744
- var isProto = isPrototype_default(object), result = [];
745
- for (var key in object) {
746
- if (!(key == "constructor" && (isProto || !hasOwnProperty6.call(object, key)))) {
747
- result.push(key);
748
- }
749
- }
750
- return result;
751
- }
752
- var baseKeysIn_default = baseKeysIn;
753
-
754
- // node_modules/lodash-es/keysIn.js
755
- function keysIn(object) {
756
- return isArrayLike_default(object) ? arrayLikeKeys_default(object, true) : baseKeysIn_default(object);
757
- }
758
- var keysIn_default = keysIn;
536
+ var mapCacheClear_default = mapCacheClear;
759
537
 
760
- // node_modules/lodash-es/_nativeCreate.js
761
- var nativeCreate = getNative_default(Object, "create");
762
- var nativeCreate_default = nativeCreate;
538
+ // node_modules/lodash-es/_isKeyable.js
539
+ function isKeyable(value) {
540
+ var type = typeof value;
541
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
542
+ }
543
+ var isKeyable_default = isKeyable;
763
544
 
764
- // node_modules/lodash-es/_hashClear.js
765
- function hashClear() {
766
- this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
767
- this.size = 0;
545
+ // node_modules/lodash-es/_getMapData.js
546
+ function getMapData(map, key) {
547
+ var data = map.__data__;
548
+ return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
768
549
  }
769
- var hashClear_default = hashClear;
550
+ var getMapData_default = getMapData;
770
551
 
771
- // node_modules/lodash-es/_hashDelete.js
772
- function hashDelete(key) {
773
- var result = this.has(key) && delete this.__data__[key];
552
+ // node_modules/lodash-es/_mapCacheDelete.js
553
+ function mapCacheDelete(key) {
554
+ var result = getMapData_default(this, key)["delete"](key);
774
555
  this.size -= result ? 1 : 0;
775
556
  return result;
776
557
  }
777
- var hashDelete_default = hashDelete;
558
+ var mapCacheDelete_default = mapCacheDelete;
778
559
 
779
- // node_modules/lodash-es/_hashGet.js
780
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
781
- var objectProto9 = Object.prototype;
782
- var hasOwnProperty7 = objectProto9.hasOwnProperty;
783
- function hashGet(key) {
784
- var data = this.__data__;
785
- if (nativeCreate_default) {
786
- var result = data[key];
787
- return result === HASH_UNDEFINED ? void 0 : result;
788
- }
789
- return hasOwnProperty7.call(data, key) ? data[key] : void 0;
560
+ // node_modules/lodash-es/_mapCacheGet.js
561
+ function mapCacheGet(key) {
562
+ return getMapData_default(this, key).get(key);
790
563
  }
791
- var hashGet_default = hashGet;
564
+ var mapCacheGet_default = mapCacheGet;
792
565
 
793
- // node_modules/lodash-es/_hashHas.js
794
- var objectProto10 = Object.prototype;
795
- var hasOwnProperty8 = objectProto10.hasOwnProperty;
796
- function hashHas(key) {
797
- var data = this.__data__;
798
- return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty8.call(data, key);
566
+ // node_modules/lodash-es/_mapCacheHas.js
567
+ function mapCacheHas(key) {
568
+ return getMapData_default(this, key).has(key);
799
569
  }
800
- var hashHas_default = hashHas;
570
+ var mapCacheHas_default = mapCacheHas;
801
571
 
802
- // node_modules/lodash-es/_hashSet.js
803
- var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
804
- function hashSet(key, value) {
805
- var data = this.__data__;
806
- this.size += this.has(key) ? 0 : 1;
807
- data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
572
+ // node_modules/lodash-es/_mapCacheSet.js
573
+ function mapCacheSet(key, value) {
574
+ var data = getMapData_default(this, key), size = data.size;
575
+ data.set(key, value);
576
+ this.size += data.size == size ? 0 : 1;
808
577
  return this;
809
578
  }
810
- var hashSet_default = hashSet;
579
+ var mapCacheSet_default = mapCacheSet;
811
580
 
812
- // node_modules/lodash-es/_Hash.js
813
- function Hash(entries) {
581
+ // node_modules/lodash-es/_MapCache.js
582
+ function MapCache(entries) {
814
583
  var index = -1, length = entries == null ? 0 : entries.length;
815
584
  this.clear();
816
585
  while (++index < length) {
@@ -818,334 +587,444 @@ function Hash(entries) {
818
587
  this.set(entry[0], entry[1]);
819
588
  }
820
589
  }
821
- Hash.prototype.clear = hashClear_default;
822
- Hash.prototype["delete"] = hashDelete_default;
823
- Hash.prototype.get = hashGet_default;
824
- Hash.prototype.has = hashHas_default;
825
- Hash.prototype.set = hashSet_default;
826
- var Hash_default = Hash;
827
-
828
- // node_modules/lodash-es/_listCacheClear.js
829
- function listCacheClear() {
830
- this.__data__ = [];
831
- this.size = 0;
832
- }
833
- var listCacheClear_default = listCacheClear;
590
+ MapCache.prototype.clear = mapCacheClear_default;
591
+ MapCache.prototype["delete"] = mapCacheDelete_default;
592
+ MapCache.prototype.get = mapCacheGet_default;
593
+ MapCache.prototype.has = mapCacheHas_default;
594
+ MapCache.prototype.set = mapCacheSet_default;
595
+ var MapCache_default = MapCache;
834
596
 
835
- // node_modules/lodash-es/_assocIndexOf.js
836
- function assocIndexOf(array, key) {
837
- var length = array.length;
838
- while (length--) {
839
- if (eq_default(array[length][0], key)) {
840
- return length;
597
+ // node_modules/lodash-es/_stackSet.js
598
+ var LARGE_ARRAY_SIZE = 200;
599
+ function stackSet(key, value) {
600
+ var data = this.__data__;
601
+ if (data instanceof ListCache_default) {
602
+ var pairs = data.__data__;
603
+ if (!Map_default || pairs.length < LARGE_ARRAY_SIZE - 1) {
604
+ pairs.push([key, value]);
605
+ this.size = ++data.size;
606
+ return this;
841
607
  }
608
+ data = this.__data__ = new MapCache_default(pairs);
842
609
  }
843
- return -1;
610
+ data.set(key, value);
611
+ this.size = data.size;
612
+ return this;
844
613
  }
845
- var assocIndexOf_default = assocIndexOf;
614
+ var stackSet_default = stackSet;
846
615
 
847
- // node_modules/lodash-es/_listCacheDelete.js
848
- var arrayProto = Array.prototype;
849
- var splice = arrayProto.splice;
850
- function listCacheDelete(key) {
851
- var data = this.__data__, index = assocIndexOf_default(data, key);
852
- if (index < 0) {
853
- return false;
616
+ // node_modules/lodash-es/_Stack.js
617
+ function Stack(entries) {
618
+ var data = this.__data__ = new ListCache_default(entries);
619
+ this.size = data.size;
620
+ }
621
+ Stack.prototype.clear = stackClear_default;
622
+ Stack.prototype["delete"] = stackDelete_default;
623
+ Stack.prototype.get = stackGet_default;
624
+ Stack.prototype.has = stackHas_default;
625
+ Stack.prototype.set = stackSet_default;
626
+ var Stack_default = Stack;
627
+
628
+ // node_modules/lodash-es/_defineProperty.js
629
+ var defineProperty = (function() {
630
+ try {
631
+ var func = getNative_default(Object, "defineProperty");
632
+ func({}, "", {});
633
+ return func;
634
+ } catch (e) {
854
635
  }
855
- var lastIndex = data.length - 1;
856
- if (index == lastIndex) {
857
- data.pop();
636
+ })();
637
+ var defineProperty_default = defineProperty;
638
+
639
+ // node_modules/lodash-es/_baseAssignValue.js
640
+ function baseAssignValue(object, key, value) {
641
+ if (key == "__proto__" && defineProperty_default) {
642
+ defineProperty_default(object, key, {
643
+ "configurable": true,
644
+ "enumerable": true,
645
+ "value": value,
646
+ "writable": true
647
+ });
858
648
  } else {
859
- splice.call(data, index, 1);
649
+ object[key] = value;
860
650
  }
861
- --this.size;
862
- return true;
863
651
  }
864
- var listCacheDelete_default = listCacheDelete;
652
+ var baseAssignValue_default = baseAssignValue;
865
653
 
866
- // node_modules/lodash-es/_listCacheGet.js
867
- function listCacheGet(key) {
868
- var data = this.__data__, index = assocIndexOf_default(data, key);
869
- return index < 0 ? void 0 : data[index][1];
654
+ // node_modules/lodash-es/_assignMergeValue.js
655
+ function assignMergeValue(object, key, value) {
656
+ if (value !== void 0 && !eq_default(object[key], value) || value === void 0 && !(key in object)) {
657
+ baseAssignValue_default(object, key, value);
658
+ }
870
659
  }
871
- var listCacheGet_default = listCacheGet;
660
+ var assignMergeValue_default = assignMergeValue;
872
661
 
873
- // node_modules/lodash-es/_listCacheHas.js
874
- function listCacheHas(key) {
875
- return assocIndexOf_default(this.__data__, key) > -1;
662
+ // node_modules/lodash-es/_createBaseFor.js
663
+ function createBaseFor(fromRight) {
664
+ return function(object, iteratee, keysFunc) {
665
+ var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
666
+ while (length--) {
667
+ var key = props[fromRight ? length : ++index];
668
+ if (iteratee(iterable[key], key, iterable) === false) {
669
+ break;
670
+ }
671
+ }
672
+ return object;
673
+ };
876
674
  }
877
- var listCacheHas_default = listCacheHas;
675
+ var createBaseFor_default = createBaseFor;
878
676
 
879
- // node_modules/lodash-es/_listCacheSet.js
880
- function listCacheSet(key, value) {
881
- var data = this.__data__, index = assocIndexOf_default(data, key);
882
- if (index < 0) {
883
- ++this.size;
884
- data.push([key, value]);
885
- } else {
886
- data[index][1] = value;
677
+ // node_modules/lodash-es/_baseFor.js
678
+ var baseFor = createBaseFor_default();
679
+ var baseFor_default = baseFor;
680
+
681
+ // node_modules/lodash-es/_cloneBuffer.js
682
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
683
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
684
+ var moduleExports = freeModule && freeModule.exports === freeExports;
685
+ var Buffer = moduleExports ? root_default.Buffer : void 0;
686
+ var allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
687
+ function cloneBuffer(buffer, isDeep) {
688
+ if (isDeep) {
689
+ return buffer.slice();
887
690
  }
888
- return this;
691
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
692
+ buffer.copy(result);
693
+ return result;
889
694
  }
890
- var listCacheSet_default = listCacheSet;
695
+ var cloneBuffer_default = cloneBuffer;
696
+
697
+ // node_modules/lodash-es/_Uint8Array.js
698
+ var Uint8Array = root_default.Uint8Array;
699
+ var Uint8Array_default = Uint8Array;
700
+
701
+ // node_modules/lodash-es/_cloneArrayBuffer.js
702
+ function cloneArrayBuffer(arrayBuffer) {
703
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
704
+ new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer));
705
+ return result;
706
+ }
707
+ var cloneArrayBuffer_default = cloneArrayBuffer;
708
+
709
+ // node_modules/lodash-es/_cloneTypedArray.js
710
+ function cloneTypedArray(typedArray, isDeep) {
711
+ var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
712
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
713
+ }
714
+ var cloneTypedArray_default = cloneTypedArray;
715
+
716
+ // node_modules/lodash-es/_copyArray.js
717
+ function copyArray(source, array) {
718
+ var index = -1, length = source.length;
719
+ array || (array = Array(length));
720
+ while (++index < length) {
721
+ array[index] = source[index];
722
+ }
723
+ return array;
724
+ }
725
+ var copyArray_default = copyArray;
726
+
727
+ // node_modules/lodash-es/_baseCreate.js
728
+ var objectCreate = Object.create;
729
+ var baseCreate = /* @__PURE__ */ (function() {
730
+ function object() {
731
+ }
732
+ return function(proto) {
733
+ if (!isObject_default(proto)) {
734
+ return {};
735
+ }
736
+ if (objectCreate) {
737
+ return objectCreate(proto);
738
+ }
739
+ object.prototype = proto;
740
+ var result = new object();
741
+ object.prototype = void 0;
742
+ return result;
743
+ };
744
+ })();
745
+ var baseCreate_default = baseCreate;
891
746
 
892
- // node_modules/lodash-es/_ListCache.js
893
- function ListCache(entries) {
894
- var index = -1, length = entries == null ? 0 : entries.length;
895
- this.clear();
896
- while (++index < length) {
897
- var entry = entries[index];
898
- this.set(entry[0], entry[1]);
899
- }
747
+ // node_modules/lodash-es/_overArg.js
748
+ function overArg(func, transform) {
749
+ return function(arg) {
750
+ return func(transform(arg));
751
+ };
900
752
  }
901
- ListCache.prototype.clear = listCacheClear_default;
902
- ListCache.prototype["delete"] = listCacheDelete_default;
903
- ListCache.prototype.get = listCacheGet_default;
904
- ListCache.prototype.has = listCacheHas_default;
905
- ListCache.prototype.set = listCacheSet_default;
906
- var ListCache_default = ListCache;
753
+ var overArg_default = overArg;
907
754
 
908
- // node_modules/lodash-es/_Map.js
909
- var Map2 = getNative_default(root_default, "Map");
910
- var Map_default = Map2;
755
+ // node_modules/lodash-es/_getPrototype.js
756
+ var getPrototype = overArg_default(Object.getPrototypeOf, Object);
757
+ var getPrototype_default = getPrototype;
911
758
 
912
- // node_modules/lodash-es/_mapCacheClear.js
913
- function mapCacheClear() {
914
- this.size = 0;
915
- this.__data__ = {
916
- "hash": new Hash_default(),
917
- "map": new (Map_default || ListCache_default)(),
918
- "string": new Hash_default()
919
- };
759
+ // node_modules/lodash-es/_isPrototype.js
760
+ var objectProto6 = Object.prototype;
761
+ function isPrototype(value) {
762
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto6;
763
+ return value === proto;
920
764
  }
921
- var mapCacheClear_default = mapCacheClear;
765
+ var isPrototype_default = isPrototype;
922
766
 
923
- // node_modules/lodash-es/_isKeyable.js
924
- function isKeyable(value) {
925
- var type = typeof value;
926
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
767
+ // node_modules/lodash-es/_initCloneObject.js
768
+ function initCloneObject(object) {
769
+ return typeof object.constructor == "function" && !isPrototype_default(object) ? baseCreate_default(getPrototype_default(object)) : {};
927
770
  }
928
- var isKeyable_default = isKeyable;
771
+ var initCloneObject_default = initCloneObject;
929
772
 
930
- // node_modules/lodash-es/_getMapData.js
931
- function getMapData(map, key) {
932
- var data = map.__data__;
933
- return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
773
+ // node_modules/lodash-es/_baseIsArguments.js
774
+ var argsTag = "[object Arguments]";
775
+ function baseIsArguments(value) {
776
+ return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
934
777
  }
935
- var getMapData_default = getMapData;
778
+ var baseIsArguments_default = baseIsArguments;
936
779
 
937
- // node_modules/lodash-es/_mapCacheDelete.js
938
- function mapCacheDelete(key) {
939
- var result = getMapData_default(this, key)["delete"](key);
940
- this.size -= result ? 1 : 0;
941
- return result;
942
- }
943
- var mapCacheDelete_default = mapCacheDelete;
780
+ // node_modules/lodash-es/isArguments.js
781
+ var objectProto7 = Object.prototype;
782
+ var hasOwnProperty5 = objectProto7.hasOwnProperty;
783
+ var propertyIsEnumerable = objectProto7.propertyIsEnumerable;
784
+ var isArguments = baseIsArguments_default(/* @__PURE__ */ (function() {
785
+ return arguments;
786
+ })()) ? baseIsArguments_default : function(value) {
787
+ return isObjectLike_default(value) && hasOwnProperty5.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
788
+ };
789
+ var isArguments_default = isArguments;
944
790
 
945
- // node_modules/lodash-es/_mapCacheGet.js
946
- function mapCacheGet(key) {
947
- return getMapData_default(this, key).get(key);
791
+ // node_modules/lodash-es/isArray.js
792
+ var isArray = Array.isArray;
793
+ var isArray_default = isArray;
794
+
795
+ // node_modules/lodash-es/isLength.js
796
+ var MAX_SAFE_INTEGER = 9007199254740991;
797
+ function isLength(value) {
798
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
948
799
  }
949
- var mapCacheGet_default = mapCacheGet;
800
+ var isLength_default = isLength;
950
801
 
951
- // node_modules/lodash-es/_mapCacheHas.js
952
- function mapCacheHas(key) {
953
- return getMapData_default(this, key).has(key);
802
+ // node_modules/lodash-es/isArrayLike.js
803
+ function isArrayLike(value) {
804
+ return value != null && isLength_default(value.length) && !isFunction_default(value);
954
805
  }
955
- var mapCacheHas_default = mapCacheHas;
806
+ var isArrayLike_default = isArrayLike;
956
807
 
957
- // node_modules/lodash-es/_mapCacheSet.js
958
- function mapCacheSet(key, value) {
959
- var data = getMapData_default(this, key), size = data.size;
960
- data.set(key, value);
961
- this.size += data.size == size ? 0 : 1;
962
- return this;
808
+ // node_modules/lodash-es/isArrayLikeObject.js
809
+ function isArrayLikeObject(value) {
810
+ return isObjectLike_default(value) && isArrayLike_default(value);
963
811
  }
964
- var mapCacheSet_default = mapCacheSet;
812
+ var isArrayLikeObject_default = isArrayLikeObject;
965
813
 
966
- // node_modules/lodash-es/_MapCache.js
967
- function MapCache(entries) {
968
- var index = -1, length = entries == null ? 0 : entries.length;
969
- this.clear();
970
- while (++index < length) {
971
- var entry = entries[index];
972
- this.set(entry[0], entry[1]);
973
- }
814
+ // node_modules/lodash-es/stubFalse.js
815
+ function stubFalse() {
816
+ return false;
974
817
  }
975
- MapCache.prototype.clear = mapCacheClear_default;
976
- MapCache.prototype["delete"] = mapCacheDelete_default;
977
- MapCache.prototype.get = mapCacheGet_default;
978
- MapCache.prototype.has = mapCacheHas_default;
979
- MapCache.prototype.set = mapCacheSet_default;
980
- var MapCache_default = MapCache;
818
+ var stubFalse_default = stubFalse;
981
819
 
982
- // node_modules/lodash-es/_getPrototype.js
983
- var getPrototype = overArg_default(Object.getPrototypeOf, Object);
984
- var getPrototype_default = getPrototype;
820
+ // node_modules/lodash-es/isBuffer.js
821
+ var freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports;
822
+ var freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
823
+ var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
824
+ var Buffer2 = moduleExports2 ? root_default.Buffer : void 0;
825
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
826
+ var isBuffer = nativeIsBuffer || stubFalse_default;
827
+ var isBuffer_default = isBuffer;
985
828
 
986
829
  // node_modules/lodash-es/isPlainObject.js
987
- var objectTag2 = "[object Object]";
830
+ var objectTag = "[object Object]";
988
831
  var funcProto3 = Function.prototype;
989
- var objectProto11 = Object.prototype;
832
+ var objectProto8 = Object.prototype;
990
833
  var funcToString3 = funcProto3.toString;
991
- var hasOwnProperty9 = objectProto11.hasOwnProperty;
834
+ var hasOwnProperty6 = objectProto8.hasOwnProperty;
992
835
  var objectCtorString = funcToString3.call(Object);
993
836
  function isPlainObject(value) {
994
- if (!isObjectLike_default(value) || baseGetTag_default(value) != objectTag2) {
837
+ if (!isObjectLike_default(value) || baseGetTag_default(value) != objectTag) {
995
838
  return false;
996
839
  }
997
840
  var proto = getPrototype_default(value);
998
841
  if (proto === null) {
999
842
  return true;
1000
843
  }
1001
- var Ctor = hasOwnProperty9.call(proto, "constructor") && proto.constructor;
844
+ var Ctor = hasOwnProperty6.call(proto, "constructor") && proto.constructor;
1002
845
  return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
1003
846
  }
1004
847
  var isPlainObject_default = isPlainObject;
1005
848
 
1006
- // node_modules/lodash-es/_stackClear.js
1007
- function stackClear() {
1008
- this.__data__ = new ListCache_default();
1009
- this.size = 0;
849
+ // node_modules/lodash-es/_baseIsTypedArray.js
850
+ var argsTag2 = "[object Arguments]";
851
+ var arrayTag = "[object Array]";
852
+ var boolTag = "[object Boolean]";
853
+ var dateTag = "[object Date]";
854
+ var errorTag = "[object Error]";
855
+ var funcTag2 = "[object Function]";
856
+ var mapTag = "[object Map]";
857
+ var numberTag = "[object Number]";
858
+ var objectTag2 = "[object Object]";
859
+ var regexpTag = "[object RegExp]";
860
+ var setTag = "[object Set]";
861
+ var stringTag = "[object String]";
862
+ var weakMapTag = "[object WeakMap]";
863
+ var arrayBufferTag = "[object ArrayBuffer]";
864
+ var dataViewTag = "[object DataView]";
865
+ var float32Tag = "[object Float32Array]";
866
+ var float64Tag = "[object Float64Array]";
867
+ var int8Tag = "[object Int8Array]";
868
+ var int16Tag = "[object Int16Array]";
869
+ var int32Tag = "[object Int32Array]";
870
+ var uint8Tag = "[object Uint8Array]";
871
+ var uint8ClampedTag = "[object Uint8ClampedArray]";
872
+ var uint16Tag = "[object Uint16Array]";
873
+ var uint32Tag = "[object Uint32Array]";
874
+ var typedArrayTags = {};
875
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
876
+ typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag2] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
877
+ function baseIsTypedArray(value) {
878
+ return isObjectLike_default(value) && isLength_default(value.length) && !!typedArrayTags[baseGetTag_default(value)];
1010
879
  }
1011
- var stackClear_default = stackClear;
880
+ var baseIsTypedArray_default = baseIsTypedArray;
1012
881
 
1013
- // node_modules/lodash-es/_stackDelete.js
1014
- function stackDelete(key) {
1015
- var data = this.__data__, result = data["delete"](key);
1016
- this.size = data.size;
1017
- return result;
882
+ // node_modules/lodash-es/_baseUnary.js
883
+ function baseUnary(func) {
884
+ return function(value) {
885
+ return func(value);
886
+ };
1018
887
  }
1019
- var stackDelete_default = stackDelete;
888
+ var baseUnary_default = baseUnary;
1020
889
 
1021
- // node_modules/lodash-es/_stackGet.js
1022
- function stackGet(key) {
1023
- return this.__data__.get(key);
890
+ // node_modules/lodash-es/_nodeUtil.js
891
+ var freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports;
892
+ var freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module;
893
+ var moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
894
+ var freeProcess = moduleExports3 && freeGlobal_default.process;
895
+ var nodeUtil = (function() {
896
+ try {
897
+ var types = freeModule3 && freeModule3.require && freeModule3.require("util").types;
898
+ if (types) {
899
+ return types;
900
+ }
901
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
902
+ } catch (e) {
903
+ }
904
+ })();
905
+ var nodeUtil_default = nodeUtil;
906
+
907
+ // node_modules/lodash-es/isTypedArray.js
908
+ var nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray;
909
+ var isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default;
910
+ var isTypedArray_default = isTypedArray;
911
+
912
+ // node_modules/lodash-es/_safeGet.js
913
+ function safeGet(object, key) {
914
+ if (key === "constructor" && typeof object[key] === "function") {
915
+ return;
916
+ }
917
+ if (key == "__proto__") {
918
+ return;
919
+ }
920
+ return object[key];
1024
921
  }
1025
- var stackGet_default = stackGet;
922
+ var safeGet_default = safeGet;
1026
923
 
1027
- // node_modules/lodash-es/_stackHas.js
1028
- function stackHas(key) {
1029
- return this.__data__.has(key);
924
+ // node_modules/lodash-es/_assignValue.js
925
+ var objectProto9 = Object.prototype;
926
+ var hasOwnProperty7 = objectProto9.hasOwnProperty;
927
+ function assignValue(object, key, value) {
928
+ var objValue = object[key];
929
+ if (!(hasOwnProperty7.call(object, key) && eq_default(objValue, value)) || value === void 0 && !(key in object)) {
930
+ baseAssignValue_default(object, key, value);
931
+ }
1030
932
  }
1031
- var stackHas_default = stackHas;
933
+ var assignValue_default = assignValue;
1032
934
 
1033
- // node_modules/lodash-es/_stackSet.js
1034
- var LARGE_ARRAY_SIZE = 200;
1035
- function stackSet(key, value) {
1036
- var data = this.__data__;
1037
- if (data instanceof ListCache_default) {
1038
- var pairs = data.__data__;
1039
- if (!Map_default || pairs.length < LARGE_ARRAY_SIZE - 1) {
1040
- pairs.push([key, value]);
1041
- this.size = ++data.size;
1042
- return this;
935
+ // node_modules/lodash-es/_copyObject.js
936
+ function copyObject(source, props, object, customizer) {
937
+ var isNew = !object;
938
+ object || (object = {});
939
+ var index = -1, length = props.length;
940
+ while (++index < length) {
941
+ var key = props[index];
942
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
943
+ if (newValue === void 0) {
944
+ newValue = source[key];
945
+ }
946
+ if (isNew) {
947
+ baseAssignValue_default(object, key, newValue);
948
+ } else {
949
+ assignValue_default(object, key, newValue);
1043
950
  }
1044
- data = this.__data__ = new MapCache_default(pairs);
1045
951
  }
1046
- data.set(key, value);
1047
- this.size = data.size;
1048
- return this;
1049
- }
1050
- var stackSet_default = stackSet;
1051
-
1052
- // node_modules/lodash-es/_Stack.js
1053
- function Stack(entries) {
1054
- var data = this.__data__ = new ListCache_default(entries);
1055
- this.size = data.size;
952
+ return object;
1056
953
  }
1057
- Stack.prototype.clear = stackClear_default;
1058
- Stack.prototype["delete"] = stackDelete_default;
1059
- Stack.prototype.get = stackGet_default;
1060
- Stack.prototype.has = stackHas_default;
1061
- Stack.prototype.set = stackSet_default;
1062
- var Stack_default = Stack;
954
+ var copyObject_default = copyObject;
1063
955
 
1064
- // node_modules/lodash-es/_cloneBuffer.js
1065
- var freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports;
1066
- var freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module;
1067
- var moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
1068
- var Buffer2 = moduleExports3 ? root_default.Buffer : void 0;
1069
- var allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
1070
- function cloneBuffer(buffer, isDeep) {
1071
- if (isDeep) {
1072
- return buffer.slice();
956
+ // node_modules/lodash-es/_baseTimes.js
957
+ function baseTimes(n, iteratee) {
958
+ var index = -1, result = Array(n);
959
+ while (++index < n) {
960
+ result[index] = iteratee(index);
1073
961
  }
1074
- var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1075
- buffer.copy(result);
1076
- return result;
1077
- }
1078
- var cloneBuffer_default = cloneBuffer;
1079
-
1080
- // node_modules/lodash-es/_Uint8Array.js
1081
- var Uint8Array = root_default.Uint8Array;
1082
- var Uint8Array_default = Uint8Array;
1083
-
1084
- // node_modules/lodash-es/_cloneArrayBuffer.js
1085
- function cloneArrayBuffer(arrayBuffer) {
1086
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1087
- new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer));
1088
962
  return result;
1089
963
  }
1090
- var cloneArrayBuffer_default = cloneArrayBuffer;
1091
-
1092
- // node_modules/lodash-es/_cloneTypedArray.js
1093
- function cloneTypedArray(typedArray, isDeep) {
1094
- var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
1095
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1096
- }
1097
- var cloneTypedArray_default = cloneTypedArray;
964
+ var baseTimes_default = baseTimes;
1098
965
 
1099
- // node_modules/lodash-es/_initCloneObject.js
1100
- function initCloneObject(object) {
1101
- return typeof object.constructor == "function" && !isPrototype_default(object) ? baseCreate_default(getPrototype_default(object)) : {};
966
+ // node_modules/lodash-es/_isIndex.js
967
+ var MAX_SAFE_INTEGER2 = 9007199254740991;
968
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
969
+ function isIndex(value, length) {
970
+ var type = typeof value;
971
+ length = length == null ? MAX_SAFE_INTEGER2 : length;
972
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
1102
973
  }
1103
- var initCloneObject_default = initCloneObject;
974
+ var isIndex_default = isIndex;
1104
975
 
1105
- // node_modules/lodash-es/_createBaseFor.js
1106
- function createBaseFor(fromRight) {
1107
- return function(object, iteratee, keysFunc) {
1108
- var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
1109
- while (length--) {
1110
- var key = props[fromRight ? length : ++index];
1111
- if (iteratee(iterable[key], key, iterable) === false) {
1112
- break;
1113
- }
976
+ // node_modules/lodash-es/_arrayLikeKeys.js
977
+ var objectProto10 = Object.prototype;
978
+ var hasOwnProperty8 = objectProto10.hasOwnProperty;
979
+ function arrayLikeKeys(value, inherited) {
980
+ var isArr = isArray_default(value), isArg = !isArr && isArguments_default(value), isBuff = !isArr && !isArg && isBuffer_default(value), isType = !isArr && !isArg && !isBuff && isTypedArray_default(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes_default(value.length, String) : [], length = result.length;
981
+ for (var key in value) {
982
+ if ((inherited || hasOwnProperty8.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
983
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
984
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
985
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
986
+ isIndex_default(key, length)))) {
987
+ result.push(key);
1114
988
  }
1115
- return object;
1116
- };
1117
- }
1118
- var createBaseFor_default = createBaseFor;
1119
-
1120
- // node_modules/lodash-es/_baseFor.js
1121
- var baseFor = createBaseFor_default();
1122
- var baseFor_default = baseFor;
1123
-
1124
- // node_modules/lodash-es/_assignMergeValue.js
1125
- function assignMergeValue(object, key, value) {
1126
- if (value !== void 0 && !eq_default(object[key], value) || value === void 0 && !(key in object)) {
1127
- baseAssignValue_default(object, key, value);
1128
989
  }
990
+ return result;
1129
991
  }
1130
- var assignMergeValue_default = assignMergeValue;
992
+ var arrayLikeKeys_default = arrayLikeKeys;
1131
993
 
1132
- // node_modules/lodash-es/isArrayLikeObject.js
1133
- function isArrayLikeObject(value) {
1134
- return isObjectLike_default(value) && isArrayLike_default(value);
994
+ // node_modules/lodash-es/_nativeKeysIn.js
995
+ function nativeKeysIn(object) {
996
+ var result = [];
997
+ if (object != null) {
998
+ for (var key in Object(object)) {
999
+ result.push(key);
1000
+ }
1001
+ }
1002
+ return result;
1135
1003
  }
1136
- var isArrayLikeObject_default = isArrayLikeObject;
1004
+ var nativeKeysIn_default = nativeKeysIn;
1137
1005
 
1138
- // node_modules/lodash-es/_safeGet.js
1139
- function safeGet(object, key) {
1140
- if (key === "constructor" && typeof object[key] === "function") {
1141
- return;
1006
+ // node_modules/lodash-es/_baseKeysIn.js
1007
+ var objectProto11 = Object.prototype;
1008
+ var hasOwnProperty9 = objectProto11.hasOwnProperty;
1009
+ function baseKeysIn(object) {
1010
+ if (!isObject_default(object)) {
1011
+ return nativeKeysIn_default(object);
1142
1012
  }
1143
- if (key == "__proto__") {
1144
- return;
1013
+ var isProto = isPrototype_default(object), result = [];
1014
+ for (var key in object) {
1015
+ if (!(key == "constructor" && (isProto || !hasOwnProperty9.call(object, key)))) {
1016
+ result.push(key);
1017
+ }
1145
1018
  }
1146
- return object[key];
1019
+ return result;
1147
1020
  }
1148
- var safeGet_default = safeGet;
1021
+ var baseKeysIn_default = baseKeysIn;
1022
+
1023
+ // node_modules/lodash-es/keysIn.js
1024
+ function keysIn(object) {
1025
+ return isArrayLike_default(object) ? arrayLikeKeys_default(object, true) : baseKeysIn_default(object);
1026
+ }
1027
+ var keysIn_default = keysIn;
1149
1028
 
1150
1029
  // node_modules/lodash-es/toPlainObject.js
1151
1030
  function toPlainObject(value) {
@@ -1190,34 +1069,160 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
1190
1069
  isCommon = false;
1191
1070
  }
1192
1071
  }
1193
- if (isCommon) {
1194
- stack.set(srcValue, newValue);
1195
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
1196
- stack["delete"](srcValue);
1072
+ if (isCommon) {
1073
+ stack.set(srcValue, newValue);
1074
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
1075
+ stack["delete"](srcValue);
1076
+ }
1077
+ assignMergeValue_default(object, key, newValue);
1078
+ }
1079
+ var baseMergeDeep_default = baseMergeDeep;
1080
+
1081
+ // node_modules/lodash-es/_baseMerge.js
1082
+ function baseMerge(object, source, srcIndex, customizer, stack) {
1083
+ if (object === source) {
1084
+ return;
1085
+ }
1086
+ baseFor_default(source, function(srcValue, key) {
1087
+ stack || (stack = new Stack_default());
1088
+ if (isObject_default(srcValue)) {
1089
+ baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack);
1090
+ } else {
1091
+ var newValue = customizer ? customizer(safeGet_default(object, key), srcValue, key + "", object, source, stack) : void 0;
1092
+ if (newValue === void 0) {
1093
+ newValue = srcValue;
1094
+ }
1095
+ assignMergeValue_default(object, key, newValue);
1096
+ }
1097
+ }, keysIn_default);
1098
+ }
1099
+ var baseMerge_default = baseMerge;
1100
+
1101
+ // node_modules/lodash-es/identity.js
1102
+ function identity(value) {
1103
+ return value;
1104
+ }
1105
+ var identity_default = identity;
1106
+
1107
+ // node_modules/lodash-es/_apply.js
1108
+ function apply(func, thisArg, args) {
1109
+ switch (args.length) {
1110
+ case 0:
1111
+ return func.call(thisArg);
1112
+ case 1:
1113
+ return func.call(thisArg, args[0]);
1114
+ case 2:
1115
+ return func.call(thisArg, args[0], args[1]);
1116
+ case 3:
1117
+ return func.call(thisArg, args[0], args[1], args[2]);
1118
+ }
1119
+ return func.apply(thisArg, args);
1120
+ }
1121
+ var apply_default = apply;
1122
+
1123
+ // node_modules/lodash-es/_overRest.js
1124
+ var nativeMax2 = Math.max;
1125
+ function overRest(func, start, transform) {
1126
+ start = nativeMax2(start === void 0 ? func.length - 1 : start, 0);
1127
+ return function() {
1128
+ var args = arguments, index = -1, length = nativeMax2(args.length - start, 0), array = Array(length);
1129
+ while (++index < length) {
1130
+ array[index] = args[start + index];
1131
+ }
1132
+ index = -1;
1133
+ var otherArgs = Array(start + 1);
1134
+ while (++index < start) {
1135
+ otherArgs[index] = args[index];
1136
+ }
1137
+ otherArgs[start] = transform(array);
1138
+ return apply_default(func, this, otherArgs);
1139
+ };
1140
+ }
1141
+ var overRest_default = overRest;
1142
+
1143
+ // node_modules/lodash-es/constant.js
1144
+ function constant(value) {
1145
+ return function() {
1146
+ return value;
1147
+ };
1148
+ }
1149
+ var constant_default = constant;
1150
+
1151
+ // node_modules/lodash-es/_baseSetToString.js
1152
+ var baseSetToString = !defineProperty_default ? identity_default : function(func, string) {
1153
+ return defineProperty_default(func, "toString", {
1154
+ "configurable": true,
1155
+ "enumerable": false,
1156
+ "value": constant_default(string),
1157
+ "writable": true
1158
+ });
1159
+ };
1160
+ var baseSetToString_default = baseSetToString;
1161
+
1162
+ // node_modules/lodash-es/_shortOut.js
1163
+ var HOT_COUNT = 800;
1164
+ var HOT_SPAN = 16;
1165
+ var nativeNow = Date.now;
1166
+ function shortOut(func) {
1167
+ var count = 0, lastCalled = 0;
1168
+ return function() {
1169
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
1170
+ lastCalled = stamp;
1171
+ if (remaining > 0) {
1172
+ if (++count >= HOT_COUNT) {
1173
+ return arguments[0];
1174
+ }
1175
+ } else {
1176
+ count = 0;
1177
+ }
1178
+ return func.apply(void 0, arguments);
1179
+ };
1180
+ }
1181
+ var shortOut_default = shortOut;
1182
+
1183
+ // node_modules/lodash-es/_setToString.js
1184
+ var setToString = shortOut_default(baseSetToString_default);
1185
+ var setToString_default = setToString;
1186
+
1187
+ // node_modules/lodash-es/_baseRest.js
1188
+ function baseRest(func, start) {
1189
+ return setToString_default(overRest_default(func, start, identity_default), func + "");
1190
+ }
1191
+ var baseRest_default = baseRest;
1192
+
1193
+ // node_modules/lodash-es/_isIterateeCall.js
1194
+ function isIterateeCall(value, index, object) {
1195
+ if (!isObject_default(object)) {
1196
+ return false;
1197
+ }
1198
+ var type = typeof index;
1199
+ if (type == "number" ? isArrayLike_default(object) && isIndex_default(index, object.length) : type == "string" && index in object) {
1200
+ return eq_default(object[index], value);
1197
1201
  }
1198
- assignMergeValue_default(object, key, newValue);
1202
+ return false;
1199
1203
  }
1200
- var baseMergeDeep_default = baseMergeDeep;
1204
+ var isIterateeCall_default = isIterateeCall;
1201
1205
 
1202
- // node_modules/lodash-es/_baseMerge.js
1203
- function baseMerge(object, source, srcIndex, customizer, stack) {
1204
- if (object === source) {
1205
- return;
1206
- }
1207
- baseFor_default(source, function(srcValue, key) {
1208
- stack || (stack = new Stack_default());
1209
- if (isObject_default(srcValue)) {
1210
- baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack);
1211
- } else {
1212
- var newValue = customizer ? customizer(safeGet_default(object, key), srcValue, key + "", object, source, stack) : void 0;
1213
- if (newValue === void 0) {
1214
- newValue = srcValue;
1206
+ // node_modules/lodash-es/_createAssigner.js
1207
+ function createAssigner(assigner) {
1208
+ return baseRest_default(function(object, sources) {
1209
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
1210
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
1211
+ if (guard && isIterateeCall_default(sources[0], sources[1], guard)) {
1212
+ customizer = length < 3 ? void 0 : customizer;
1213
+ length = 1;
1214
+ }
1215
+ object = Object(object);
1216
+ while (++index < length) {
1217
+ var source = sources[index];
1218
+ if (source) {
1219
+ assigner(object, source, index, customizer);
1215
1220
  }
1216
- assignMergeValue_default(object, key, newValue);
1217
1221
  }
1218
- }, keysIn_default);
1222
+ return object;
1223
+ });
1219
1224
  }
1220
- var baseMerge_default = baseMerge;
1225
+ var createAssigner_default = createAssigner;
1221
1226
 
1222
1227
  // node_modules/lodash-es/merge.js
1223
1228
  var merge = createAssigner_default(function(object, source, srcIndex) {
@@ -1225,25 +1230,35 @@ var merge = createAssigner_default(function(object, source, srcIndex) {
1225
1230
  });
1226
1231
  var merge_default = merge;
1227
1232
 
1228
- // src/utils/promise.ts
1229
- function sleep(ms) {
1230
- return new Promise((resolve) => setTimeout(resolve, ms));
1231
- }
1232
-
1233
1233
  // src/engine/SignalBroker.ts
1234
1234
  var SignalBroker = class _SignalBroker {
1235
1235
  constructor() {
1236
1236
  this.debug = false;
1237
1237
  this.verbose = false;
1238
- this.debouncedEmitters = /* @__PURE__ */ new Map();
1239
- this.squashedEmitters = /* @__PURE__ */ new Map();
1240
- this.squashedContexts = /* @__PURE__ */ new Map();
1241
1238
  this.throttleEmitters = /* @__PURE__ */ new Map();
1242
1239
  this.throttleQueues = /* @__PURE__ */ new Map();
1243
1240
  // TODO: Signals should be a class with a the observers, registered flag and other data.
1244
1241
  this.signalObservers = /* @__PURE__ */ new Map();
1245
1242
  this.emittedSignalsRegistry = /* @__PURE__ */ new Set();
1243
+ // ── Flush Strategy Management ───────────────────────────────────────
1244
+ this.flushStrategies = /* @__PURE__ */ new Map();
1245
+ this.strategyData = /* @__PURE__ */ new Map();
1246
+ this.strategyTimers = /* @__PURE__ */ new Map();
1247
+ this.isStrategyFlushing = /* @__PURE__ */ new Map();
1248
+ this.defaultStrategyName = "default";
1249
+ // ── Squash (Multi-strategy) ─────────────────────────────────────────
1250
+ this.MAX_FLUSH_DURATION_MS = 120;
1251
+ // ── Schedule (Bucketed) ─────────────────────────────────────────────
1252
+ this.scheduledBuckets = /* @__PURE__ */ new Map();
1253
+ this.scheduleTimer = null;
1254
+ // ── Debounce (with cap) ─────────────────────────────────────────────
1255
+ this.debouncedEmitters = /* @__PURE__ */ new Map();
1256
+ this.MAX_DEBOUNCERS = 5e3;
1246
1257
  this.addSignal("meta.signal_broker.added");
1258
+ this.setFlushStrategy(this.defaultStrategyName, {
1259
+ intervalMs: 350,
1260
+ maxBatchSize: 80
1261
+ });
1247
1262
  }
1248
1263
  static get instance() {
1249
1264
  if (!this.instance_) {
@@ -1330,57 +1345,224 @@ var SignalBroker = class _SignalBroker {
1330
1345
  }
1331
1346
  ).doOn("meta.signal.registered");
1332
1347
  }
1333
- /**
1334
- * Observes a signal with a routine/task.
1335
- * @param signal The signal (e.g., 'domain.action', 'domain.*' for wildcards).
1336
- * @param routineOrTask The observer.
1337
- * @edge Duplicates ignored; supports wildcards for broad listening.
1338
- */
1339
- observe(signal, routineOrTask) {
1340
- this.addSignal(signal);
1341
- this.signalObservers.get(signal).tasks.add(routineOrTask);
1348
+ setFlushStrategy(name, config) {
1349
+ if (config.intervalMs < 50) {
1350
+ throw new Error("intervalMs must be >= 50ms for performance reasons");
1351
+ }
1352
+ this.flushStrategies.set(name, {
1353
+ intervalMs: config.intervalMs,
1354
+ maxBatchSize: config.maxBatchSize ?? 80
1355
+ });
1356
+ if (!this.strategyData.has(name)) {
1357
+ this.strategyData.set(name, /* @__PURE__ */ new Map());
1358
+ this.strategyTimers.set(name, null);
1359
+ this.isStrategyFlushing.set(name, false);
1360
+ }
1342
1361
  }
1343
- registerEmittedSignal(signal) {
1344
- this.emittedSignalsRegistry.add(signal);
1362
+ updateFlushStrategy(name, config) {
1363
+ if (!this.flushStrategies.get(name)) {
1364
+ return this.setFlushStrategy(name, config);
1365
+ }
1366
+ this.flushStrategies.set(name, config);
1345
1367
  }
1346
- /**
1347
- * Unsubscribes a routine/task from a signal.
1348
- * @param signal The signal.
1349
- * @param routineOrTask The observer.
1350
- * @edge Removes all instances if duplicate; deletes if empty.
1351
- */
1352
- unsubscribe(signal, routineOrTask) {
1353
- const obs = this.signalObservers.get(signal);
1354
- if (obs) {
1355
- obs.tasks.delete(routineOrTask);
1356
- if (obs.tasks.size === 0) {
1357
- this.signalObservers.delete(signal);
1368
+ removeFlushStrategy(name) {
1369
+ if (name === this.defaultStrategyName) {
1370
+ throw new Error("Cannot remove default strategy");
1371
+ }
1372
+ const timer = this.strategyTimers.get(name);
1373
+ if (timer) clearTimeout(timer);
1374
+ this.strategyTimers.delete(name);
1375
+ this.strategyData.delete(name);
1376
+ this.isStrategyFlushing.delete(name);
1377
+ this.flushStrategies.delete(name);
1378
+ }
1379
+ getFlushStrategies() {
1380
+ return Object.fromEntries(this.flushStrategies);
1381
+ }
1382
+ squash(signal, context, options = { squash: true }) {
1383
+ if (!options.squash) {
1384
+ this.emit(signal, context, options);
1385
+ return;
1386
+ }
1387
+ const strategyName = options.flushStrategy ?? this.defaultStrategyName;
1388
+ const strategy = this.flushStrategies.get(strategyName);
1389
+ if (!strategy) {
1390
+ console.warn(
1391
+ `Unknown flush strategy '${strategyName}', falling back to default`
1392
+ );
1393
+ return this.squash(signal, context, {
1394
+ ...options,
1395
+ flushStrategy: this.defaultStrategyName
1396
+ });
1397
+ }
1398
+ const squashId = options.squashId ?? signal;
1399
+ let groups = this.strategyData.get(strategyName);
1400
+ let data = groups.get(squashId);
1401
+ if (!data) {
1402
+ data = { signal, contexts: [] };
1403
+ groups.set(squashId, data);
1404
+ }
1405
+ data.contexts.push(context);
1406
+ if (data.contexts.length >= strategy.maxBatchSize) {
1407
+ this.flushGroup(strategyName, squashId, options);
1408
+ return;
1409
+ }
1410
+ if (!this.strategyTimers.get(strategyName) && !this.isStrategyFlushing.get(strategyName)) {
1411
+ this.strategyTimers.set(
1412
+ strategyName,
1413
+ setTimeout(() => this.flushStrategy(strategyName), strategy.intervalMs)
1414
+ );
1415
+ }
1416
+ }
1417
+ flushGroup(strategyName, squashId, options) {
1418
+ const groups = this.strategyData.get(strategyName);
1419
+ if (!groups) return;
1420
+ const data = groups.get(squashId);
1421
+ if (!data || data.contexts.length === 0) return;
1422
+ const start = performance.now();
1423
+ const merged = options.mergeFunction ? options.mergeFunction(data.contexts[0], ...data.contexts.slice(1)) : merge_default({}, ...data.contexts);
1424
+ groups.delete(squashId);
1425
+ this.emit(data.signal, merged, { ...options, squash: false });
1426
+ const duration = performance.now() - start;
1427
+ if (duration > this.MAX_FLUSH_DURATION_MS) {
1428
+ console.warn(
1429
+ `Squash flush for ${data.signal} in group ${squashId} took ${duration.toFixed(1)}ms`
1430
+ );
1431
+ }
1432
+ }
1433
+ flushStrategy(strategyName) {
1434
+ this.strategyTimers.set(strategyName, null);
1435
+ this.isStrategyFlushing.set(strategyName, true);
1436
+ const groups = this.strategyData.get(strategyName);
1437
+ if (!groups || groups.size === 0) {
1438
+ this.isStrategyFlushing.set(strategyName, false);
1439
+ return;
1440
+ }
1441
+ const keys = Array.from(groups.keys());
1442
+ for (const squashId of keys) {
1443
+ if (groups.has(squashId)) {
1444
+ this.flushGroup(strategyName, squashId, {});
1358
1445
  }
1359
1446
  }
1447
+ this.isStrategyFlushing.set(strategyName, false);
1448
+ if (groups.size > 0) {
1449
+ const strategy = this.flushStrategies.get(strategyName);
1450
+ this.strategyTimers.set(
1451
+ strategyName,
1452
+ setTimeout(() => this.flushStrategy(strategyName), strategy.intervalMs)
1453
+ );
1454
+ }
1455
+ }
1456
+ clearSquashState() {
1457
+ for (const [name, timer] of this.strategyTimers.entries()) {
1458
+ if (timer) clearTimeout(timer);
1459
+ }
1460
+ this.strategyTimers.clear();
1461
+ this.strategyData.clear();
1462
+ this.isStrategyFlushing.clear();
1360
1463
  }
1361
- /**
1362
- * Schedules a signal to be emitted after a specified delay or at an exact date and time.
1363
- *
1364
- * @param {string} signal - The name of the signal to be emitted.
1365
- * @param {AnyObject} context - The context to be passed along with the signal.
1366
- * @param options
1367
- * @return {AbortController} An AbortController instance that can be used to cancel the scheduled signal emission.
1368
- */
1369
1464
  schedule(signal, context, options = { delayMs: 6e4 }) {
1370
- let delay = options.delayMs;
1371
- if (options.exactDateTime != null) {
1465
+ let delay = options.delayMs ?? 0;
1466
+ if (options.exactDateTime) {
1372
1467
  delay = options.exactDateTime.getTime() - Date.now();
1373
1468
  }
1374
- delay = Math.max(0, delay ?? 0);
1469
+ delay = Math.max(0, delay);
1470
+ const bucketKey = Math.ceil(delay / 100) * 100;
1471
+ let bucket = this.scheduledBuckets.get(bucketKey);
1472
+ if (!bucket) {
1473
+ bucket = [];
1474
+ this.scheduledBuckets.set(bucketKey, bucket);
1475
+ }
1476
+ bucket.push({ signal, context });
1375
1477
  const controller = new AbortController();
1376
- const { signal: signalController } = controller;
1377
- const tick = () => this.emit(signal, context);
1378
- const timerId = setTimeout(() => {
1379
- if (!signalController.aborted) tick();
1380
- }, delay);
1381
- signalController.addEventListener("abort", () => clearTimeout(timerId));
1478
+ if (!this.scheduleTimer) {
1479
+ this.scheduleTimer = setTimeout(() => this.flushScheduled(), 50);
1480
+ }
1382
1481
  return controller;
1383
1482
  }
1483
+ flushScheduled() {
1484
+ this.scheduleTimer = null;
1485
+ const now2 = Date.now();
1486
+ const toProcess = [];
1487
+ for (const [bucketKey, items] of this.scheduledBuckets.entries()) {
1488
+ const bucketTime = bucketKey;
1489
+ if (now2 >= bucketTime - 150) {
1490
+ toProcess.push([bucketKey, items]);
1491
+ }
1492
+ }
1493
+ for (const [key, items] of toProcess) {
1494
+ this.scheduledBuckets.delete(key);
1495
+ for (const item of items) {
1496
+ this.emit(item.signal, item.context);
1497
+ }
1498
+ }
1499
+ if (this.scheduledBuckets.size > 0) {
1500
+ this.scheduleTimer = setTimeout(() => this.flushScheduled(), 50);
1501
+ }
1502
+ }
1503
+ debounce(signal, context, options = { delayMs: 500 }) {
1504
+ if (this.debouncedEmitters.size > this.MAX_DEBOUNCERS) {
1505
+ console.warn("Max debouncers reached - evicting oldest");
1506
+ const oldestKey = this.debouncedEmitters.keys().next().value;
1507
+ if (oldestKey) {
1508
+ const entry2 = this.debouncedEmitters.get(oldestKey);
1509
+ entry2.debouncedFn.flush();
1510
+ this.debouncedEmitters.delete(oldestKey);
1511
+ }
1512
+ }
1513
+ const delay = options.delayMs ?? 300;
1514
+ const key = signal;
1515
+ let entry = this.debouncedEmitters.get(key);
1516
+ if (!entry) {
1517
+ const debouncedFn = debounce_default(
1518
+ (ctx) => {
1519
+ this.emit(signal, ctx);
1520
+ entry.idleTimeout = setTimeout(() => {
1521
+ this.debouncedEmitters.delete(key);
1522
+ }, delay * 4);
1523
+ },
1524
+ delay,
1525
+ { leading: false, trailing: true }
1526
+ );
1527
+ entry = { debouncedFn, idleTimeout: null };
1528
+ this.debouncedEmitters.set(key, entry);
1529
+ }
1530
+ if (entry.idleTimeout) {
1531
+ clearTimeout(entry.idleTimeout);
1532
+ entry.idleTimeout = null;
1533
+ }
1534
+ entry.debouncedFn(context);
1535
+ }
1536
+ // ── Existing throttle, interval, etc. remain unchanged ──────────────
1537
+ throttle(signal, context, options = { delayMs: 1e3 }) {
1538
+ let { groupId, delayMs = 300 } = options;
1539
+ if (!groupId) {
1540
+ groupId = signal;
1541
+ }
1542
+ if (!this.throttleQueues.has(groupId)) {
1543
+ this.throttleQueues.set(groupId, []);
1544
+ }
1545
+ const queue = this.throttleQueues.get(groupId);
1546
+ queue.push([signal, context]);
1547
+ if (!this.throttleEmitters.has(groupId)) {
1548
+ this.throttleEmitters.set(groupId, async () => {
1549
+ while (queue.length > 0) {
1550
+ let batchSize = options.throttleBatch ?? 1;
1551
+ if (batchSize > queue.length) {
1552
+ batchSize = queue.length;
1553
+ }
1554
+ for (let i = 0; i < batchSize; i++) {
1555
+ const [nextSignal, nextContext] = queue.shift();
1556
+ this.emit(nextSignal, nextContext);
1557
+ }
1558
+ await sleep(delayMs);
1559
+ }
1560
+ this.throttleEmitters.delete(groupId);
1561
+ this.throttleQueues.delete(groupId);
1562
+ });
1563
+ this.throttleEmitters.get(groupId)();
1564
+ }
1565
+ }
1384
1566
  /**
1385
1567
  * Emits `signal` repeatedly with a fixed interval.
1386
1568
  *
@@ -1427,90 +1609,6 @@ var SignalBroker = class _SignalBroker {
1427
1609
  }
1428
1610
  };
1429
1611
  }
1430
- debounce(signal, context, options = { delayMs: 500 }) {
1431
- let debouncedEmitter = this.debouncedEmitters.get(signal);
1432
- if (!debouncedEmitter) {
1433
- this.debouncedEmitters.set(
1434
- signal,
1435
- debounce_default((ctx) => {
1436
- this.emit(signal, ctx);
1437
- }, options.delayMs ?? 300)
1438
- );
1439
- debouncedEmitter = this.debouncedEmitters.get(signal);
1440
- }
1441
- debouncedEmitter(context);
1442
- }
1443
- throttle(signal, context, options = { delayMs: 1e3 }) {
1444
- let { groupId, delayMs = 300 } = options;
1445
- if (!groupId) {
1446
- groupId = signal;
1447
- }
1448
- if (!this.throttleQueues.has(groupId)) {
1449
- this.throttleQueues.set(groupId, []);
1450
- }
1451
- const queue = this.throttleQueues.get(groupId);
1452
- queue.push([signal, context]);
1453
- if (!this.throttleEmitters.has(groupId)) {
1454
- this.throttleEmitters.set(groupId, async () => {
1455
- while (queue.length > 0) {
1456
- let batchSize = options.throttleBatch ?? 1;
1457
- if (batchSize > queue.length) {
1458
- batchSize = queue.length;
1459
- }
1460
- for (let i = 0; i < batchSize; i++) {
1461
- const [nextSignal, nextContext] = queue.shift();
1462
- this.emit(nextSignal, nextContext);
1463
- }
1464
- await sleep(delayMs);
1465
- }
1466
- this.throttleEmitters.delete(groupId);
1467
- this.throttleQueues.delete(groupId);
1468
- });
1469
- this.throttleEmitters.get(groupId)();
1470
- }
1471
- }
1472
- /**
1473
- * Aggregates and debounces multiple events with the same identifier to minimize redundant operations.
1474
- *
1475
- * @param {string} signal - The identifier for the event being emitted.
1476
- * @param {AnyObject} context - The context data associated with the event.
1477
- * @param {Object} [options] - Configuration options for handling the squashed event.
1478
- * @param {boolean} [options.squash=true] - Whether the event should be squashed.
1479
- * @param {string|null} [options.squashId=null] - A unique identifier for the squashed group of events. Defaults to the signal if null.
1480
- * @param {function|null} [options.mergeFunction=null] - A custom merge function that combines old and new contexts. If null, a default merge is used.
1481
- * @return {void} Does not return a value.
1482
- */
1483
- squash(signal, context, options = { squash: true }) {
1484
- let { squashId, delayMs = 300 } = options;
1485
- if (!squashId) {
1486
- squashId = signal;
1487
- }
1488
- if (!this.squashedEmitters.has(squashId)) {
1489
- this.squashedEmitters.set(
1490
- squashId,
1491
- debounce_default(() => {
1492
- options.squash = false;
1493
- this.emit(
1494
- signal,
1495
- options.mergeFunction ? options.mergeFunction(
1496
- this.squashedContexts.get(squashId)[0],
1497
- ...this.squashedContexts.get(squashId).slice(1)
1498
- ) : merge_default(
1499
- this.squashedContexts.get(squashId)[0],
1500
- ...this.squashedContexts.get(squashId).slice(1)
1501
- ),
1502
- options
1503
- );
1504
- this.squashedEmitters.delete(squashId);
1505
- this.squashedContexts.delete(squashId);
1506
- }, delayMs ?? 300)
1507
- );
1508
- this.squashedContexts.set(squashId, [context]);
1509
- } else {
1510
- this.squashedContexts.get(squashId)?.push(context);
1511
- }
1512
- this.squashedEmitters.get(squashId)();
1513
- }
1514
1612
  /**
1515
1613
  * Emits a signal with the specified context, triggering any associated handlers for that signal.
1516
1614
  *
@@ -1684,6 +1782,34 @@ var SignalBroker = class _SignalBroker {
1684
1782
  this.emit("meta.signal_broker.added", { signalName: _signal });
1685
1783
  }
1686
1784
  }
1785
+ /**
1786
+ * Observes a signal with a routine/task.
1787
+ * @param signal The signal (e.g., 'domain.action', 'domain.*' for wildcards).
1788
+ * @param routineOrTask The observer.
1789
+ * @edge Duplicates ignored; supports wildcards for broad listening.
1790
+ */
1791
+ observe(signal, routineOrTask) {
1792
+ this.addSignal(signal);
1793
+ this.signalObservers.get(signal).tasks.add(routineOrTask);
1794
+ }
1795
+ registerEmittedSignal(signal) {
1796
+ this.emittedSignalsRegistry.add(signal);
1797
+ }
1798
+ /**
1799
+ * Unsubscribes a routine/task from a signal.
1800
+ * @param signal The signal.
1801
+ * @param routineOrTask The observer.
1802
+ * @edge Removes all instances if duplicate; deletes if empty.
1803
+ */
1804
+ unsubscribe(signal, routineOrTask) {
1805
+ const obs = this.signalObservers.get(signal);
1806
+ if (obs) {
1807
+ obs.tasks.delete(routineOrTask);
1808
+ if (obs.tasks.size === 0) {
1809
+ this.signalObservers.delete(signal);
1810
+ }
1811
+ }
1812
+ }
1687
1813
  /**
1688
1814
  * Lists all observed signals.
1689
1815
  * @returns Array of signals.
@@ -1698,6 +1824,10 @@ var SignalBroker = class _SignalBroker {
1698
1824
  this.signalObservers.clear();
1699
1825
  this.emittedSignalsRegistry.clear();
1700
1826
  }
1827
+ shutdown() {
1828
+ this.clearSquashState();
1829
+ this.reset();
1830
+ }
1701
1831
  };
1702
1832
 
1703
1833
  // src/engine/GraphRunner.ts
@@ -2405,7 +2535,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
2405
2535
  },
2406
2536
  filter: { uuid: this.id }
2407
2537
  },
2408
- { squash: true, squashId: this.id, delayMs: 0 }
2538
+ { squash: true, squashId: this.id }
2409
2539
  );
2410
2540
  if (this.graphDone()) {
2411
2541
  const context2 = this.context.getFullContext();
@@ -2427,7 +2557,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
2427
2557
  },
2428
2558
  filter: { uuid: this.routineExecId }
2429
2559
  },
2430
- { squash: true, squashId: this.routineExecId, delayMs: 0 }
2560
+ { squash: true, squashId: this.routineExecId }
2431
2561
  );
2432
2562
  }
2433
2563
  return end;
@@ -5231,10 +5361,9 @@ var GraphRunStrategy = class {
5231
5361
  // src/engine/ThrottleEngine.ts
5232
5362
  var ThrottleEngine = class _ThrottleEngine {
5233
5363
  constructor() {
5234
- this.queues = {};
5235
- this.runningCounts = {};
5236
- this.maxConcurrencyPerTag = {};
5237
- this.functionIdToPromiseResolve = {};
5364
+ this.tagState = /* @__PURE__ */ new Map();
5365
+ this.nextId = 0;
5366
+ this.pendingResolves = /* @__PURE__ */ new Map();
5238
5367
  }
5239
5368
  static get instance() {
5240
5369
  if (!this.instance_) {
@@ -5242,11 +5371,24 @@ var ThrottleEngine = class _ThrottleEngine {
5242
5371
  }
5243
5372
  return this.instance_;
5244
5373
  }
5374
+ getTagState(tag) {
5375
+ let state = this.tagState.get(tag);
5376
+ if (!state) {
5377
+ state = {
5378
+ queue: [],
5379
+ runningCount: 0,
5380
+ maxConcurrency: 1
5381
+ };
5382
+ this.tagState.set(tag, state);
5383
+ }
5384
+ return state;
5385
+ }
5245
5386
  /**
5246
5387
  * Set a custom concurrency limit for a specific tag
5247
5388
  */
5248
5389
  setConcurrencyLimit(tag, limit) {
5249
- this.maxConcurrencyPerTag[tag] = limit;
5390
+ const state = this.getTagState(tag);
5391
+ state.maxConcurrency = limit;
5250
5392
  }
5251
5393
  /**
5252
5394
  * Manages the execution of a function `fn` applied on a specified node `node` with controlled concurrency for a given tag.
@@ -5258,13 +5400,12 @@ var ThrottleEngine = class _ThrottleEngine {
5258
5400
  * @return {Promise<GraphNode[]>} A promise resolving to an array of GraphNode objects once the throttled function execution completes.
5259
5401
  */
5260
5402
  throttle(fn, node, tag = "default") {
5261
- var _a, _b;
5403
+ const state = this.getTagState(tag);
5404
+ const id = this.nextId++;
5262
5405
  const functionPromise = new Promise((resolve) => {
5263
- this.functionIdToPromiseResolve[node.id] = resolve;
5406
+ this.pendingResolves.set(id, resolve);
5264
5407
  });
5265
- (_a = this.queues)[tag] ?? (_a[tag] = []);
5266
- this.queues[tag].push([fn, node]);
5267
- (_b = this.maxConcurrencyPerTag)[tag] ?? (_b[tag] = 1);
5408
+ state.queue.push([fn, node, id]);
5268
5409
  this.processQueue(tag);
5269
5410
  return functionPromise;
5270
5411
  }
@@ -5275,34 +5416,44 @@ var ThrottleEngine = class _ThrottleEngine {
5275
5416
  * @return {void} Does not return a value; it processes tasks asynchronously and manages state internally.
5276
5417
  */
5277
5418
  processQueue(tag) {
5278
- const maxAllowed = this.maxConcurrencyPerTag[tag];
5279
- while ((this.queues[tag]?.length ?? 0) > 0 && (this.runningCounts[tag] ?? 0) < maxAllowed) {
5280
- this.runningCounts[tag] = (this.runningCounts[tag] || 0) + 1;
5281
- const item = this.queues[tag].shift();
5282
- this.process(item).then(() => {
5283
- this.runningCounts[tag]--;
5284
- this.processQueue(tag);
5285
- });
5286
- }
5287
- if ((this.queues[tag]?.length ?? 0) === 0 && this.runningCounts[tag] === 0) {
5288
- delete this.queues[tag];
5289
- delete this.runningCounts[tag];
5290
- }
5419
+ const tagData = this.tagState.get(tag);
5420
+ if (!tagData) return;
5421
+ const maxAllowed = tagData.maxConcurrency;
5422
+ const processNext = () => {
5423
+ while (tagData.queue.length > 0 && tagData.runningCount < maxAllowed) {
5424
+ tagData.runningCount++;
5425
+ const item = tagData.queue.shift();
5426
+ this.process(item).catch(() => []).finally(() => {
5427
+ tagData.runningCount--;
5428
+ processNext();
5429
+ });
5430
+ }
5431
+ if (tagData.queue.length === 0 && tagData.runningCount === 0) {
5432
+ }
5433
+ };
5434
+ processNext();
5291
5435
  }
5292
5436
  /**
5293
5437
  * Processes a given item consisting of a function and a graph node.
5294
5438
  *
5295
- * @param {Array} item - An array where the first element is a processing function and the second element is a graph node.
5439
+ * @param {Array} item - An array where the first element is a processing function, the second element is a graph node, and the third is the unique ID.
5296
5440
  * @param {Function} item[0] - The function to process the graph node.
5297
5441
  * @param {GraphNode} item[1] - The graph node to be processed.
5442
+ * @param {number} item[2] - The unique ID for promise resolution.
5298
5443
  * @return {Promise<void>} A promise that resolves when the processing and cleanup are complete.
5299
5444
  */
5300
5445
  async process(item) {
5301
5446
  const fn = item[0];
5302
5447
  const node = item[1];
5303
- const context = await fn(node);
5304
- this.functionIdToPromiseResolve[node.id](context);
5305
- delete this.functionIdToPromiseResolve[node.id];
5448
+ const id = item[2];
5449
+ try {
5450
+ const context = await fn(node);
5451
+ this.pendingResolves.get(id)?.(context);
5452
+ } catch (e) {
5453
+ this.pendingResolves.get(id)?.([]);
5454
+ } finally {
5455
+ this.pendingResolves.delete(id);
5456
+ }
5306
5457
  }
5307
5458
  };
5308
5459
 
@@ -6395,17 +6546,4 @@ export {
6395
6546
  Task,
6396
6547
  index_default as default
6397
6548
  };
6398
- /*! Bundled license information:
6399
-
6400
- lodash-es/lodash.js:
6401
- (**
6402
- * @license
6403
- * Lodash (Custom Build) <https://lodash.com/>
6404
- * Build: `lodash modularize exports="es" -o ./`
6405
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
6406
- * Released under MIT license <https://lodash.com/license>
6407
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
6408
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
6409
- *)
6410
- */
6411
6549
  //# sourceMappingURL=index.mjs.map