lilact 0.27.3 → 0.28.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.
Files changed (65) hide show
  1. package/bin/bundle.cjs +2 -2
  2. package/dist/lilact.development.js +312 -280
  3. package/dist/lilact.development.js.map +3 -3
  4. package/dist/lilact.development.min.js +39 -37
  5. package/dist/lilact.development.min.js.map +3 -3
  6. package/dist/lilact.production.min.js +39 -37
  7. package/docs/classes/accessories.ErrorBoundary.html +11 -11
  8. package/docs/classes/accessories.Suspense.html +10 -10
  9. package/docs/classes/components.Component.html +11 -11
  10. package/docs/classes/components.HTMLComponent.html +11 -11
  11. package/docs/classes/components.RootComponent.html +11 -11
  12. package/docs/functions/accessories.DragHandle.html +1 -1
  13. package/docs/functions/accessories.Spinner.html +1 -1
  14. package/docs/functions/components.cloneComponent.html +1 -1
  15. package/docs/functions/components.createComponent.html +1 -1
  16. package/docs/functions/components.createPortal.html +1 -1
  17. package/docs/functions/components.createRoot.html +1 -1
  18. package/docs/functions/components.memo.html +1 -1
  19. package/docs/functions/components.render.html +1 -1
  20. package/docs/functions/errors.scanBlockLabels.html +1 -1
  21. package/docs/functions/timers.animationFramePromise.html +3 -3
  22. package/docs/functions/timers.clearInterval.html +5 -3
  23. package/docs/functions/timers.clearTimeout.html +5 -3
  24. package/docs/functions/timers.grabTimers.html +4 -3
  25. package/docs/functions/timers.pauseTimers.html +5 -2
  26. package/docs/functions/timers.releaseTimers.html +4 -2
  27. package/docs/functions/timers.resetTimers.html +4 -2
  28. package/docs/functions/timers.resumeTimers.html +4 -2
  29. package/docs/functions/timers.setInterval.html +8 -6
  30. package/docs/functions/timers.setTimeout.html +8 -6
  31. package/docs/functions/timers.timeoutPromise.html +8 -149
  32. package/docs/static/demos/error-nested-1.jsx +11 -0
  33. package/docs/static/demos/error-nested-2.jsx +12 -0
  34. package/docs/static/demos/error-nested-3.jsx +12 -0
  35. package/docs/static/demos/error-nested-4.jsx +12 -0
  36. package/docs/static/demos/error-nested-5.jsx +12 -0
  37. package/docs/static/index.html +44 -38
  38. package/docs/static/lilact.development.js +312 -280
  39. package/docs/static/lilact.development.js.map +3 -3
  40. package/docs/static/lilact.development.min.js +39 -37
  41. package/docs/static/lilact.development.min.js.map +3 -3
  42. package/docs/static/lilact.production.min.js +39 -37
  43. package/docs/variables/accessories.SplitPane.html +1 -1
  44. package/docs/variables/components.cloneElement.html +1 -1
  45. package/docs/variables/errors.blocks_info.html +1 -1
  46. package/docs/variables/errors.error.html +1 -1
  47. package/examples/demos/error-nested-1.jsx +11 -0
  48. package/examples/demos/error-nested-2.jsx +12 -0
  49. package/examples/demos/error-nested-3.jsx +12 -0
  50. package/examples/demos/error-nested-4.jsx +12 -0
  51. package/examples/demos/error-nested-5.jsx +12 -0
  52. package/examples/index.html +44 -38
  53. package/examples/lilact.development.js +312 -280
  54. package/examples/lilact.development.js.map +3 -3
  55. package/examples/lilact.development.min.js +39 -37
  56. package/examples/lilact.development.min.js.map +3 -3
  57. package/examples/lilact.production.min.js +39 -37
  58. package/package.json +1 -1
  59. package/scripts/build.mjs +1 -1
  60. package/src/accessories.jsx +1 -4
  61. package/src/components.jsx +20 -15
  62. package/src/errors.jsx +5 -3
  63. package/src/lilact.jsx +4 -4
  64. package/src/run.jsx +1 -1
  65. package/src/timers.jsx +377 -207
@@ -1561,13 +1561,13 @@ function insertWithoutScoping(cache2, serialized) {
1561
1561
  return cache2.insert("", serialized, cache2.sheet, true);
1562
1562
  }
1563
1563
  }
1564
- function merge(registered, css3, className) {
1564
+ function merge(registered, css2, className) {
1565
1565
  var registeredStyles = [];
1566
1566
  var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
1567
1567
  if (registeredStyles.length < 2) {
1568
1568
  return className;
1569
1569
  }
1570
- return rawClassName + css3(registeredStyles);
1570
+ return rawClassName + css2(registeredStyles);
1571
1571
  }
1572
1572
  var createEmotion = function createEmotion2(options) {
1573
1573
  var cache2 = createCache(options);
@@ -1575,7 +1575,7 @@ var createEmotion = function createEmotion2(options) {
1575
1575
  this.isSpeedy = value;
1576
1576
  };
1577
1577
  cache2.compat = true;
1578
- var css3 = function css4() {
1578
+ var css2 = function css3() {
1579
1579
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1580
1580
  args[_key] = arguments[_key];
1581
1581
  }
@@ -1602,15 +1602,15 @@ var createEmotion = function createEmotion2(options) {
1602
1602
  var serialized = serializeStyles(args, cache2.registered);
1603
1603
  insertWithoutScoping(cache2, serialized);
1604
1604
  };
1605
- var cx3 = function cx4() {
1605
+ var cx2 = function cx3() {
1606
1606
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1607
1607
  args[_key4] = arguments[_key4];
1608
1608
  }
1609
- return merge(cache2.registered, css3, classnames(args));
1609
+ return merge(cache2.registered, css2, classnames(args));
1610
1610
  };
1611
1611
  return {
1612
- css: css3,
1613
- cx: cx3,
1612
+ css: css2,
1613
+ cx: cx2,
1614
1614
  injectGlobal: injectGlobal2,
1615
1615
  keyframes: keyframes2,
1616
1616
  hydrate: function hydrate2(ids) {
@@ -1626,7 +1626,7 @@ var createEmotion = function createEmotion2(options) {
1626
1626
  sheet: cache2.sheet,
1627
1627
  cache: cache2,
1628
1628
  getRegisteredStyles: getRegisteredStyles.bind(null, cache2.registered),
1629
- merge: merge.bind(null, cache2.registered, css3)
1629
+ merge: merge.bind(null, cache2.registered, css2)
1630
1630
  };
1631
1631
  };
1632
1632
  var classnames = function classnames2(args) {
@@ -1766,8 +1766,7 @@ var isValidComponent = (value) => {
1766
1766
  };
1767
1767
  var isValidElement = isValidComponent;
1768
1768
  var findDOMNode = (component) => {
1769
- var _a, _b;
1770
- if (!((_b = (_a = component[CORE]) == null ? void 0 : _a.element) == null ? void 0 : _b.parentNode)) throw new Error("findDOMNode only works on mounted components.");
1769
+ if (!component[CORE]?.element?.parentNode) throw new Error("findDOMNode only works on mounted components.");
1771
1770
  return component[CORE].element;
1772
1771
  };
1773
1772
  function Fragment2({ children }) {
@@ -2375,7 +2374,7 @@ var ComponentCache = class {
2375
2374
  this.owner = owner;
2376
2375
  }
2377
2376
  pick(key, construct_func) {
2378
- var _a, _b;
2377
+ var _a;
2379
2378
  let comp;
2380
2379
  let buck = this.current_map.get(key);
2381
2380
  if (buck && buck.length > buck[IDX]) {
@@ -2399,7 +2398,7 @@ var ComponentCache = class {
2399
2398
  this.new_map.set(key, buck);
2400
2399
  buck[IDX] = 0;
2401
2400
  }
2402
- if (comp[CORE]) (_b = (_a = comp[CORE]).parent) != null ? _b : _a.parent = this.owner;
2401
+ if (comp[CORE]) (_a = comp[CORE]).parent ?? (_a.parent = this.owner);
2403
2402
  }
2404
2403
  return comp;
2405
2404
  }
@@ -2453,18 +2452,17 @@ var ComponentCore = class {
2453
2452
  */
2454
2453
  // TODO: should componentDidUpdate be called after arranging/appending the outlet or before?
2455
2454
  apply(next_props = this.props, next_state = this.next_state || this.state) {
2456
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
2457
2455
  let do_rerender = true;
2458
- if (this.outlet && (this == null ? void 0 : this[MEMOIZED])) {
2459
- if (shallowEqual(this.props, next_props, "children") && shallowEqual((_a = this.props) == null ? void 0 : _a.children, next_props == null ? void 0 : next_props.children)) {
2456
+ if (this.outlet && this?.[MEMOIZED]) {
2457
+ if (shallowEqual(this.props, next_props, "children") && shallowEqual(this.props?.children, next_props?.children)) {
2460
2458
  do_rerender = false;
2461
2459
  }
2462
2460
  }
2463
2461
  if (do_rerender) {
2464
2462
  if (true) {
2465
- if ((_b = this.entity) == null ? void 0 : _b.propTypes) {
2463
+ if (this.entity?.propTypes) {
2466
2464
  PropTypes.checkPropTypes(this.entity.propTypes, this.props, "prop", this.entity.name);
2467
- } else if ((_c = this.component) == null ? void 0 : _c.propTypes) {
2465
+ } else if (this.component?.propTypes) {
2468
2466
  PropTypes.checkPropTypes(this.component.propTypes, this.props, "prop", this.component.name);
2469
2467
  }
2470
2468
  }
@@ -2472,8 +2470,8 @@ var ComponentCore = class {
2472
2470
  if (this.component.constructor.defaultProps) {
2473
2471
  next_props = { ...this.component.constructor.defaultProps, ...next_props };
2474
2472
  }
2475
- if (((_e = (_d = this == null ? void 0 : this.parent) == null ? void 0 : _d.component) == null ? void 0 : _e.context) || ((_g = (_f = this == null ? void 0 : this.parent) == null ? void 0 : _f.component) == null ? void 0 : _g.getChildContext)) {
2476
- this.context = { ...this.parent.component.context, ...(_i = (_h = this.parent.component).getChildContext) == null ? void 0 : _i.call(_h) };
2473
+ if (this?.parent?.component?.context || this?.parent?.component?.getChildContext) {
2474
+ this.context = { ...this.parent.component.context, ...this.parent.component.getChildContext?.() };
2477
2475
  if (this.component.constructor.contextTypes) {
2478
2476
  PropTypes.checkPropTypes(this.component.constructor.contextTypes, this.context, "context", this.entity.name);
2479
2477
  }
@@ -2487,8 +2485,8 @@ var ComponentCore = class {
2487
2485
  } else {
2488
2486
  this.element = document.createElement(this.entity);
2489
2487
  }
2490
- if (next_props == null ? void 0 : next_props.defaultValue) this.element.value = String(next_props.defaultValue).slice(0, next_props == null ? void 0 : next_props.maxLength);
2491
- if (next_props == null ? void 0 : next_props.defaultChecked) this.element.checked = next_props.defaultChecked;
2488
+ if (next_props?.defaultValue) this.element.value = String(next_props.defaultValue).slice(0, next_props?.maxLength);
2489
+ if (next_props?.defaultChecked) this.element.checked = next_props.defaultChecked;
2492
2490
  }
2493
2491
  this.element[COMPONENT] = this.component;
2494
2492
  }
@@ -2531,10 +2529,10 @@ var ComponentCore = class {
2531
2529
  renderErrorHandler(this, e);
2532
2530
  }
2533
2531
  }
2534
- if (this == null ? void 0 : this.portal) {
2532
+ if (this?.portal) {
2535
2533
  this.element = this.portal;
2536
2534
  }
2537
- if (((_k = (_j = this.outlet) == null ? void 0 : _j.constructor) == null ? void 0 : _k.name) !== "Array") {
2535
+ if (this.outlet?.constructor?.name !== "Array") {
2538
2536
  this.outlet = [this.outlet];
2539
2537
  }
2540
2538
  this.outlet = [...this.outlet];
@@ -2576,10 +2574,9 @@ var ComponentCore = class {
2576
2574
  }
2577
2575
  }
2578
2576
  async cleanup() {
2579
- var _a, _b, _c;
2580
2577
  try {
2581
2578
  const promises = [];
2582
- if ((_a = this.props) == null ? void 0 : _a.ref) {
2579
+ if (this.props?.ref) {
2583
2580
  if (typeof this.props.ref === "function") {
2584
2581
  this.props.ref(null);
2585
2582
  } else {
@@ -2589,7 +2586,7 @@ var ComponentCore = class {
2589
2586
  if (this.component.componentWillUnmount) {
2590
2587
  this.component.componentWillUnmount();
2591
2588
  }
2592
- if (((_b = this == null ? void 0 : this.element) == null ? void 0 : _b.parentElement) && !this.portal) {
2589
+ if (this?.element?.parentElement && !this.portal) {
2593
2590
  this.element.parentElement.removeChild(this.element);
2594
2591
  }
2595
2592
  if (this.outlet !== void 0) {
@@ -2599,7 +2596,7 @@ var ComponentCore = class {
2599
2596
  }
2600
2597
  }
2601
2598
  }
2602
- if (((_c = this.props) == null ? void 0 : _c.children) !== void 0) {
2599
+ if (this.props?.children !== void 0) {
2603
2600
  for (let c of this.props.children) {
2604
2601
  if (c.cleanup) {
2605
2602
  promises.push(c.cleanup());
@@ -2619,23 +2616,30 @@ var ComponentCore = class {
2619
2616
  }
2620
2617
  }
2621
2618
  updateElementProps(patch, force = false) {
2622
- var _a, _b, _c, _d, _e, _f, _g;
2623
2619
  if (this.entity === "input") {
2624
- if (!(patch == null ? void 0 : patch.type)) patch.type = "text";
2620
+ if (!patch?.type) patch.type = "text";
2625
2621
  if (patch.type !== this.element.type) {
2626
2622
  this.element.type = patch.type;
2627
2623
  }
2628
- if ((patch == null ? void 0 : patch.value) !== void 0 && (patch == null ? void 0 : patch.value) !== this.element.value) {
2624
+ if (patch?.value !== void 0 && patch?.value !== this.element.value) {
2629
2625
  if (patch.value === void 0) patch.value = "";
2630
- this.element.value = String(patch.value).slice(0, patch == null ? void 0 : patch.maxLength);
2626
+ this.element.value = String(patch.value).slice(0, patch?.maxLength);
2631
2627
  }
2632
2628
  } else if (this.entity === "textarea") {
2633
- if ((patch == null ? void 0 : patch.value) !== this.element.value) {
2634
- this.element.value = String(patch.value).slice(0, patch == null ? void 0 : patch.maxLength);
2629
+ if (patch?.value !== this.element.value) {
2630
+ this.element.value = String(patch.value).slice(0, patch?.maxLength);
2635
2631
  }
2636
2632
  } else if (this.entity === "select") {
2637
- if ((patch == null ? void 0 : patch.value) !== this.element.value) {
2638
- lilact_default._setTimeout(() => this.element.value = String(patch.value), 0);
2633
+ if (typeof patch.value === "string") {
2634
+ if (patch.value !== this.element.value) {
2635
+ this.element.value = patch.value;
2636
+ }
2637
+ }
2638
+ } else if (this.entity === "option") {
2639
+ if (this.container?.props?.value?.constructor?.name === "Array") {
2640
+ patch.selected = this.container.props.value.indexOf(patch.value) !== -1;
2641
+ } else if (typeof this.container?.props?.value === "string") {
2642
+ patch.selected = this.container.props.value === patch.value;
2639
2643
  }
2640
2644
  }
2641
2645
  for (let a in this.props) {
@@ -2653,19 +2657,19 @@ var ComponentCore = class {
2653
2657
  if (special_attributes.has(al)) continue;
2654
2658
  if (patch === this.props || !lilact_default.defaultIsEqual(patch[a], this.props[a]) || force) {
2655
2659
  if (events_set.has(al)) {
2656
- (_a = this.event_detachers) != null ? _a : this.event_detachers = {};
2657
- (_c = (_b = this.event_detachers)[al]) == null ? void 0 : _c.call(_b);
2660
+ this.event_detachers ?? (this.event_detachers = {});
2661
+ this.event_detachers[al]?.();
2658
2662
  this.event_detachers[al] = lilact_default.addWrappedEventListener(this.element, al.substring(2), patch[a]);
2659
2663
  } else if (capture_events_set.hasOwnProperty(al)) {
2660
2664
  const alc = capture_events_set[al];
2661
- (_d = this.event_detachers) != null ? _d : this.event_detachers = {};
2662
- (_f = (_e = this.event_detachers)[al]) == null ? void 0 : _f.call(_e);
2665
+ this.event_detachers ?? (this.event_detachers = {});
2666
+ this.event_detachers[al]?.();
2663
2667
  this.event_detachers[al] = lilact_default.addWrappedEventListener(this.element, alc.substring(2), patch[a], { capture: true });
2664
2668
  } else if (a === "style") {
2665
2669
  if (typeof patch.style === "string") {
2666
2670
  this.element.style = patch.style;
2667
2671
  } else {
2668
- if ((_g = this.props) == null ? void 0 : _g.style) {
2672
+ if (this.props?.style) {
2669
2673
  if (typeof this.props.style === "string") {
2670
2674
  this.element.style = "";
2671
2675
  } else {
@@ -2686,34 +2690,31 @@ var ComponentCore = class {
2686
2690
  Object.assign(this.element.style, patch.style);
2687
2691
  }
2688
2692
  } else if (boolean_html_attributes_set.has(a)) {
2689
- this.element[a] = toBool(patch[a]);
2690
- if (!this.element[a]) this.element.removeAttribute(a);
2693
+ const v = toBool(patch[a]);
2694
+ if (v !== this.element[a]) {
2695
+ this.element[a] = v;
2696
+ }
2691
2697
  } else if (a === "autoFocus") {
2692
2698
  this.element["autofocus"] = toBool(patch[a]);
2693
2699
  } else if (a === "htmlFor") {
2694
2700
  this.element.setAttribute("for", patch[a]);
2695
- } else {
2696
- if (al !== "value" || ["input", "textarea", "select"].indexOf(this.entity) === -1) {
2697
- this.element.setAttribute(al, patch[a]);
2698
- }
2701
+ } else if (al !== "value" || ["input", "textarea", "select"].indexOf(this.entity) === -1) {
2702
+ this.element.setAttribute(al, patch[a]);
2699
2703
  }
2700
2704
  }
2701
2705
  }
2702
- if (patch == null ? void 0 : patch.action) {
2706
+ if (patch?.action) {
2703
2707
  this.element.onsubmit = patch.action;
2704
2708
  } else {
2705
2709
  this.element.onsubmit = void 0;
2706
2710
  }
2707
- if (true) {
2708
- }
2709
2711
  this.updateElementClass(patch);
2710
2712
  }
2711
2713
  updateElementClass(patch = this.props) {
2712
- var _a, _b;
2713
- let cn = patch == null ? void 0 : patch.className;
2714
- cn != null ? cn : cn = (patch == null ? void 0 : patch.class) ? patch.class : "";
2715
- if ((_a = this == null ? void 0 : this.parent) == null ? void 0 : _a[CHILD_CLASS_ADDENDUM]) {
2716
- cn += " " + ((_b = this == null ? void 0 : this.parent) == null ? void 0 : _b[CHILD_CLASS_ADDENDUM]);
2714
+ let cn = patch?.className;
2715
+ cn ?? (cn = patch?.class ? patch.class : "");
2716
+ if (this?.parent?.[CHILD_CLASS_ADDENDUM]) {
2717
+ cn += " " + this?.parent?.[CHILD_CLASS_ADDENDUM];
2717
2718
  }
2718
2719
  if (cn.length > 0) {
2719
2720
  cn = cn.split(/\s+/g);
@@ -2738,15 +2739,14 @@ var ComponentCore = class {
2738
2739
  }
2739
2740
  }
2740
2741
  appendElement(core) {
2741
- var _a;
2742
2742
  if (core.portal) return;
2743
2743
  this.scanZombies(core.container, core.element);
2744
- if ((core == null ? void 0 : core.element.parentNode) === null) {
2744
+ if (core?.element.parentNode === null) {
2745
2745
  core.container.element.insertBefore(
2746
2746
  core.element,
2747
2747
  core.container.element.childNodes[core.container.insert_index] || null
2748
2748
  );
2749
- if ((_a = core == null ? void 0 : core.component) == null ? void 0 : _a.componentDidMount) {
2749
+ if (core?.component?.componentDidMount) {
2750
2750
  core.component.componentDidMount();
2751
2751
  }
2752
2752
  } else {
@@ -2760,7 +2760,6 @@ var ComponentCore = class {
2760
2760
  core.container.insert_index++;
2761
2761
  }
2762
2762
  arrangeOutlet() {
2763
- var _a;
2764
2763
  this.insert_index = 0;
2765
2764
  for (const core of this.outlet) {
2766
2765
  if (core) {
@@ -2769,9 +2768,9 @@ var ComponentCore = class {
2769
2768
  core.container.appendElement(core);
2770
2769
  } else {
2771
2770
  if (core.arrangeOutlet) core.arrangeOutlet();
2772
- if (!(core == null ? void 0 : core.mounted)) {
2771
+ if (!core?.mounted) {
2773
2772
  core.mounted = true;
2774
- if ((_a = core == null ? void 0 : core.component) == null ? void 0 : _a.componentDidMount) {
2773
+ if (core?.component?.componentDidMount) {
2775
2774
  core.component.componentDidMount();
2776
2775
  }
2777
2776
  }
@@ -2785,21 +2784,20 @@ var ComponentCore = class {
2785
2784
  }
2786
2785
  };
2787
2786
  var renderErrorHandler = (c, e) => {
2788
- var _a, _b, _c, _d;
2789
2787
  const stack = [c];
2790
- while (c && !((_a = c.component) == null ? void 0 : _a.componentDidCatch)) {
2788
+ while (c && !c.component?.componentDidCatch) {
2791
2789
  c = c.parent;
2792
2790
  if (c) stack.push(c);
2793
2791
  }
2794
- if ((_b = c == null ? void 0 : c.component) == null ? void 0 : _b.componentDidCatch) {
2795
- if ((_c = c.entity) == null ? void 0 : _c.getDerivedStateFromError) {
2792
+ if (c?.component?.componentDidCatch) {
2793
+ if (c.entity?.getDerivedStateFromError) {
2796
2794
  c.component.setState(c.entity.getDerivedStateFromError.call(c, e));
2797
2795
  }
2798
2796
  }
2799
2797
  let stack_log = Array.prototype.map.call(stack, (x) => `in ${typeof x.component.displayName === "function" ? x.component.displayName() : x.component.displayName}`).join("\n");
2800
2798
  e.componentStack = stack;
2801
2799
  e.componentStackLog = stack_log;
2802
- if ((_d = c == null ? void 0 : c.component) == null ? void 0 : _d.componentDidCatch) {
2800
+ if (c?.component?.componentDidCatch) {
2803
2801
  c.component.componentDidCatch(e, { componentStack: stack, componentStackLog: stack_log });
2804
2802
  } else throw e;
2805
2803
  };
@@ -2821,7 +2819,7 @@ function constructFunc(core, parent) {
2821
2819
  comp = new HTMLComponent(entity, core.props);
2822
2820
  } else {
2823
2821
  if (isClass(entity)) {
2824
- if (entity == null ? void 0 : entity.defaultProps) {
2822
+ if (entity?.defaultProps) {
2825
2823
  core.props = { ...entity.defaultProps, ...core.props };
2826
2824
  }
2827
2825
  comp = new entity(core.props);
@@ -2844,7 +2842,7 @@ function constructFunc(core, parent) {
2844
2842
  }
2845
2843
  }
2846
2844
  } else if (typeof entity === "function") {
2847
- if (entity == null ? void 0 : entity.defaultProps) {
2845
+ if (entity?.defaultProps) {
2848
2846
  core.props = { ...entity.defaultProps, ...core.props };
2849
2847
  }
2850
2848
  comp = new Component(core.props);
@@ -2865,16 +2863,15 @@ function constructFunc(core, parent) {
2865
2863
  return comp;
2866
2864
  }
2867
2865
  function prepareCore(parent, core) {
2868
- var _a, _b, _c;
2869
2866
  try {
2870
- (_a = parent.cache) != null ? _a : parent.cache = new ComponentCache(parent);
2867
+ parent.cache ?? (parent.cache = new ComponentCache(parent));
2871
2868
  core = parent.cache.pick(
2872
- core[TEXT2] === void 0 ? (_b = core == null ? void 0 : core.props) == null ? void 0 : _b.key : ":text:",
2869
+ core[TEXT2] === void 0 ? core?.props?.key : ":text:",
2873
2870
  () => core[TEXT2] !== void 0 || core instanceof ComponentCore ? core : constructFunc(core, parent)[CORE]
2874
2871
  );
2875
2872
  return core;
2876
2873
  } catch (e) {
2877
- if ((_c = core == null ? void 0 : core.component) == null ? void 0 : _c.componentDidCatch) {
2874
+ if (core?.component?.componentDidCatch) {
2878
2875
  core.component.componentDidCatch(e);
2879
2876
  } else throw e;
2880
2877
  }
@@ -2916,7 +2913,7 @@ var generateComponentKey = (entity, props) => {
2916
2913
  } else {
2917
2914
  if (typeof entity === "string") {
2918
2915
  key = ":t:" + entity;
2919
- } else if (entity == null ? void 0 : entity.name) {
2916
+ } else if (entity?.name) {
2920
2917
  key = entity.name;
2921
2918
  } else {
2922
2919
  key = "::";
@@ -3007,7 +3004,7 @@ var Component = class {
3007
3004
  */
3008
3005
  displayName() {
3009
3006
  const entity = this[CORE].entity;
3010
- if (entity == null ? void 0 : entity.displayName) {
3007
+ if (entity?.displayName) {
3011
3008
  return typeof entity.displayName === "function" ? entity.displayName() : entity.displayName;
3012
3009
  }
3013
3010
  if (typeof entity === "string") {
@@ -3145,7 +3142,7 @@ function createPortal(children, element) {
3145
3142
  }
3146
3143
  function cloneComponent(component, propsPatch, ...children) {
3147
3144
  const cc = { entity: component.entity, props: { ...component.props, ...propsPatch }, [CORE]: null };
3148
- if (children == null ? void 0 : children.length) {
3145
+ if (children?.length) {
3149
3146
  cc.props.children = children;
3150
3147
  }
3151
3148
  return cc;
@@ -3319,6 +3316,7 @@ var boolean_html_attributes_set = /* @__PURE__ */ new Set([
3319
3316
  "required",
3320
3317
  "checked",
3321
3318
  "multiple",
3319
+ "selected",
3322
3320
  "hidden",
3323
3321
  "open",
3324
3322
  "loop",
@@ -3377,11 +3375,11 @@ function useCallback(callback, deps = void 0) {
3377
3375
  }
3378
3376
  const hk = useHook();
3379
3377
  if (!isEmpty(hk)) {
3380
- if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) {
3378
+ if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) {
3381
3379
  return hk.callback;
3382
3380
  }
3383
3381
  }
3384
- if (hk == null ? void 0 : hk.cleanup) {
3382
+ if (hk?.cleanup) {
3385
3383
  hk.cleanup();
3386
3384
  }
3387
3385
  hk.deps = deps;
@@ -3398,12 +3396,11 @@ function createContext(defaultValue) {
3398
3396
  };
3399
3397
  }
3400
3398
  function useContext(context2) {
3401
- var _a, _b, _c;
3402
- let core = (_a = lilact_default.current_component[0]) == null ? void 0 : _a.parent;
3399
+ let core = lilact_default.current_component[0]?.parent;
3403
3400
  while (core && core.entity !== context2.Provider) {
3404
3401
  core = core.parent;
3405
3402
  }
3406
- return core ? (_c = (_b = core.props) == null ? void 0 : _b.value) != null ? _c : context2.default : context2.default;
3403
+ return core ? core.props?.value ?? context2.default : context2.default;
3407
3404
  }
3408
3405
  function useId(prefix2 = "N") {
3409
3406
  const hk = useHook();
@@ -3470,9 +3467,9 @@ async function useLayoutEffect(effect, deps = void 0) {
3470
3467
  }
3471
3468
  const hk = useHook();
3472
3469
  if (!isEmpty(hk)) {
3473
- if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
3470
+ if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
3474
3471
  }
3475
- if (hk == null ? void 0 : hk.cleanup) {
3472
+ if (hk?.cleanup) {
3476
3473
  await hk.cleanup();
3477
3474
  hk.cleanup = void 0;
3478
3475
  }
@@ -3489,9 +3486,9 @@ async function useEffect(effect, deps = void 0) {
3489
3486
  }
3490
3487
  const hk = useHook();
3491
3488
  if (!isEmpty(hk)) {
3492
- if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
3489
+ if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
3493
3490
  }
3494
- if (hk == null ? void 0 : hk.cleanup) {
3491
+ if (hk?.cleanup) {
3495
3492
  await hk.cleanup();
3496
3493
  hk.cleanup = void 0;
3497
3494
  }
@@ -3508,9 +3505,9 @@ async function useInsertionEffect(effect, deps = void 0) {
3508
3505
  }
3509
3506
  const hk = useHook();
3510
3507
  if (!isEmpty(hk)) {
3511
- if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
3508
+ if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
3512
3509
  }
3513
- if (hk == null ? void 0 : hk.cleanup) {
3510
+ if (hk?.cleanup) {
3514
3511
  await hk.cleanup();
3515
3512
  hk.cleanup = void 0;
3516
3513
  }
@@ -3527,7 +3524,7 @@ function useMemo(factory, deps = void 0) {
3527
3524
  }
3528
3525
  const hk = useHook();
3529
3526
  if (!isEmpty(hk)) {
3530
- if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) {
3527
+ if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) {
3531
3528
  return hk.value;
3532
3529
  }
3533
3530
  }
@@ -3600,9 +3597,9 @@ function useDeferredValue(value, initialValue) {
3600
3597
  return deferred;
3601
3598
  }
3602
3599
  function useImperativeHandle(ref, factory, deps = void 0) {
3603
- if (deps !== void 0 && (ref == null ? void 0 : ref.deps) !== void 0 && shallowEqual(deps, ref.deps)) return;
3600
+ if (deps !== void 0 && ref?.deps !== void 0 && shallowEqual(deps, ref.deps)) return;
3604
3601
  ref.deps = deps;
3605
- if (typeof (ref == null ? void 0 : ref.current) !== "object") {
3602
+ if (typeof ref?.current !== "object") {
3606
3603
  ref.current = {};
3607
3604
  }
3608
3605
  Object.assign(ref.current, factory());
@@ -3643,9 +3640,9 @@ function joinPaths(basePath, relativePath) {
3643
3640
  }
3644
3641
  function asError(value, fallback = "Unknown error") {
3645
3642
  if (value instanceof Error) return value;
3646
- if ((value == null ? void 0 : value.error) instanceof Error) return value.error;
3643
+ if (value?.error instanceof Error) return value.error;
3647
3644
  const error2 = new Error(
3648
- (value == null ? void 0 : value.message) == null ? fallback : String(value.message)
3645
+ value?.message == null ? fallback : String(value.message)
3649
3646
  );
3650
3647
  if (value && typeof value === "object") {
3651
3648
  if (value.name) error2.name = value.name;
@@ -3703,7 +3700,6 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
3703
3700
  isInline = true,
3704
3701
  isModule = true
3705
3702
  } = {}) {
3706
- var _a, _b;
3707
3703
  let module = required_scripts[path];
3708
3704
  if (!module) {
3709
3705
  module = createModule(path, {
@@ -3734,7 +3730,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
3734
3730
  });
3735
3731
  } catch (value) {
3736
3732
  const error2 = asError(value);
3737
- (_a = error2.fileName) != null ? _a : error2.fileName = path;
3733
+ error2.fileName ?? (error2.fileName = path);
3738
3734
  error2.sourcePhase = "transpile";
3739
3735
  module.error = error2;
3740
3736
  lilact_default.error = error2;
@@ -3754,7 +3750,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
3754
3750
  return isEmpty(module.exports) ? result : module.exports;
3755
3751
  } catch (value) {
3756
3752
  const error2 = report(value, path);
3757
- (_b = error2.sourcePhase) != null ? _b : error2.sourcePhase = "runtime";
3753
+ error2.sourcePhase ?? (error2.sourcePhase = "runtime");
3758
3754
  module.error = error2;
3759
3755
  throw error2;
3760
3756
  }
@@ -3763,10 +3759,9 @@ function getOrCreateModule(path2, options = {}) {
3763
3759
  return required_scripts[path2] || createModule(path2, options);
3764
3760
  }
3765
3761
  function loadAsyncResource(path2, module2) {
3766
- var _a, _b;
3767
3762
  let source;
3768
3763
  try {
3769
- const resolved = (_b = (_a = lilact_default).resolver) == null ? void 0 : _b.call(_a, path2);
3764
+ const resolved = lilact_default.resolver?.(path2);
3770
3765
  if (resolved == null) {
3771
3766
  if (module2.code && !module2.loaded) {
3772
3767
  source = Promise.resolve(module2.code);
@@ -3801,10 +3796,7 @@ function loadAsyncResource(path2, module2) {
3801
3796
  isInline: false,
3802
3797
  isModule: true
3803
3798
  });
3804
- }).then((result2) => {
3805
- var _a2;
3806
- return (_a2 = result2 == null ? void 0 : result2.default) != null ? _a2 : result2;
3807
- }).catch((error2) => {
3799
+ }).then((result2) => result2?.default ?? result2).catch((error2) => {
3808
3800
  module2.error = report(error2, path2);
3809
3801
  throw module2.error;
3810
3802
  }).finally(() => {
@@ -3816,15 +3808,14 @@ function loadAsyncResource(path2, module2) {
3816
3808
  return request;
3817
3809
  }
3818
3810
  function require2(path2) {
3819
- var _a, _b, _c, _d;
3820
3811
  let options = {};
3821
3812
  if (arguments.length === 2 && arguments[1] && typeof arguments[1] === "object") {
3822
3813
  options = arguments[1];
3823
3814
  }
3824
- if ((_a = lilact_default.importObjectPaths) == null ? void 0 : _a[path2]) {
3815
+ if (lilact_default.importObjectPaths?.[path2]) {
3825
3816
  return lilact_default.importObjectPaths[path2];
3826
3817
  }
3827
- if ((_b = options.requirer) == null ? void 0 : _b.path) {
3818
+ if (options.requirer?.path) {
3828
3819
  path2 = joinPaths(options.requirer.path, path2);
3829
3820
  }
3830
3821
  const loadAsync = Boolean(lilact_default[LAZY]) || Boolean(options.isLazy);
@@ -3832,7 +3823,7 @@ function require2(path2) {
3832
3823
  isInline: false,
3833
3824
  isModule: true
3834
3825
  });
3835
- if (module2.loaded && !options.forceUpdate && !loadAsync) {
3826
+ if (module2.loaded && !options.forceUpdate) {
3836
3827
  return module2.exports;
3837
3828
  }
3838
3829
  if (path2.startsWith("#")) {
@@ -3852,7 +3843,7 @@ function require2(path2) {
3852
3843
  }
3853
3844
  return loadAsyncResource(path2, module2);
3854
3845
  }
3855
- const resolved = (_d = (_c = lilact_default).resolver) == null ? void 0 : _d.call(_c, path2);
3846
+ const resolved = lilact_default.resolver?.(path2);
3856
3847
  if (resolved != null) {
3857
3848
  if (path2.endsWith(".css")) {
3858
3849
  injectGlobal(String(resolved));
@@ -3976,10 +3967,10 @@ function Transition({
3976
3967
  // but the user should use CSSTransition itself.
3977
3968
  _classNames: classNames
3978
3969
  }) {
3979
- var _a, _b, _c, _d, _e, _f;
3980
- (_b = (_a = this[CORE]).is_mounted) != null ? _b : _a.is_mounted = !mountOnEnter || inProp || appear;
3981
- (_d = (_c = this[CORE]).is_appeared) != null ? _d : _c.is_appeared = inProp;
3982
- (_f = (_e = this[CORE]).timer) != null ? _f : _e.timer = null;
3970
+ var _a, _b, _c;
3971
+ (_a = this[CORE]).is_mounted ?? (_a.is_mounted = !mountOnEnter || inProp || appear);
3972
+ (_b = this[CORE]).is_appeared ?? (_b.is_appeared = inProp);
3973
+ (_c = this[CORE]).timer ?? (_c.timer = null);
3983
3974
  this[CORE].childFunctionHandler = (func) => {
3984
3975
  return func(this[CORE].mount_state);
3985
3976
  };
@@ -3994,15 +3985,15 @@ function Transition({
3994
3985
  }, []);
3995
3986
  useEffect(() => {
3996
3987
  if (!this[CORE].is_appeared && appear && this[CORE].mount_state === ENTERING && inProp) {
3997
- onEnter == null ? void 0 : onEnter();
3988
+ onEnter?.();
3998
3989
  requestAnimationFrame(() => {
3999
- onEntering == null ? void 0 : onEntering(!this[CORE].is_appeared);
3990
+ onEntering?.(!this[CORE].is_appeared);
4000
3991
  clearTimeout(this[CORE].timer);
4001
3992
  this[CORE].timer = setTimeout(() => {
4002
3993
  this[CORE].mount_state = ENTERED;
4003
3994
  this.forceUpdate();
4004
3995
  this[CORE].is_appeared = true;
4005
- onEntered == null ? void 0 : onEntered(!this[CORE].is_appeared);
3996
+ onEntered?.(!this[CORE].is_appeared);
4006
3997
  }, timeout);
4007
3998
  });
4008
3999
  }
@@ -4011,29 +4002,29 @@ function Transition({
4011
4002
  if (inProp) {
4012
4003
  this[CORE].is_mounted = true;
4013
4004
  if (this[CORE].mount_state === ENTERING || this[CORE].mount_state === ENTERED) return;
4014
- onEnter == null ? void 0 : onEnter(!this[CORE].is_appeared);
4005
+ onEnter?.(!this[CORE].is_appeared);
4015
4006
  this[CORE].mount_state = ENTERING;
4016
4007
  this.forceUpdate(() => {
4017
- onEntering == null ? void 0 : onEntering(!this[CORE].is_appeared);
4008
+ onEntering?.(!this[CORE].is_appeared);
4018
4009
  clearTimeout(this[CORE].timer);
4019
4010
  this[CORE].timer = setTimeout(() => {
4020
4011
  this[CORE].mount_state = ENTERED;
4021
4012
  this.forceUpdate();
4022
4013
  this[CORE].is_appeared = true;
4023
- onEntered == null ? void 0 : onEntered();
4014
+ onEntered?.();
4024
4015
  }, timeout);
4025
4016
  });
4026
4017
  } else {
4027
4018
  if (this[CORE].mount_state === UNMOUNTED || this[CORE].mount_state === EXITING || this[CORE].mount_state === EXITED) return;
4028
- onExit == null ? void 0 : onExit();
4019
+ onExit?.();
4029
4020
  this[CORE].mount_state = EXITING;
4030
4021
  this.forceUpdate(() => {
4031
- onExiting == null ? void 0 : onExiting();
4022
+ onExiting?.();
4032
4023
  clearTimeout(this[CORE].timer);
4033
4024
  this[CORE].timer = setTimeout(() => {
4034
4025
  this[CORE].mount_state = EXITED;
4035
4026
  this.forceUpdate();
4036
- onExited == null ? void 0 : onExited();
4027
+ onExited?.();
4037
4028
  if (unmountOnExit) {
4038
4029
  this[CORE].is_mounted = false;
4039
4030
  this[CORE].mount_state = UNMOUNTED;
@@ -4155,8 +4146,7 @@ function SwitchTransition({
4155
4146
  }
4156
4147
  };
4157
4148
  return createComponent("div", { "style": { position: "relative" } }, childArray.map((child, index2) => {
4158
- var _a;
4159
- const key = ((_a = child == null ? void 0 : child.props) == null ? void 0 : _a.key) || index2;
4149
+ const key = child?.props?.key || index2;
4160
4150
  const isIncoming = key === activeKey;
4161
4151
  const isOutgoing = key === exitingKey;
4162
4152
  const inProp = isIncoming ? enterAllowed : isOutgoing ? !exitStarted : false;
@@ -4200,7 +4190,6 @@ var _pool = [];
4200
4190
  var MAX_POOL_SIZE = 10;
4201
4191
  var POINTER_TYPES = ["mouse", "pen", "touch"];
4202
4192
  function createSyntheticEvent(nativeEvent, currentTarget) {
4203
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
4204
4193
  const e = _pool.length ? _pool.pop() : {};
4205
4194
  e.nativeEvent = nativeEvent;
4206
4195
  e.type = nativeEvent.type;
@@ -4233,25 +4222,25 @@ function createSyntheticEvent(nativeEvent, currentTarget) {
4233
4222
  };
4234
4223
  e.key = nativeEvent.key || null;
4235
4224
  e.code = nativeEvent.code || null;
4236
- e.which = (_b = (_a = nativeEvent.which) != null ? _a : nativeEvent.keyCode) != null ? _b : null;
4237
- e.button = (_c = nativeEvent.button) != null ? _c : null;
4238
- e.buttons = (_d = nativeEvent.buttons) != null ? _d : null;
4239
- e.pointerId = (_e = nativeEvent.pointerId) != null ? _e : null;
4240
- e.pointerType = (_f = nativeEvent.pointerType) != null ? _f : null;
4241
- e.isPrimary = (_g = nativeEvent.isPrimary) != null ? _g : null;
4242
- e.clientX = (_h = nativeEvent.clientX) != null ? _h : 0;
4243
- e.clientY = (_i = nativeEvent.clientY) != null ? _i : 0;
4244
- e.screenX = (_j = nativeEvent.screenX) != null ? _j : 0;
4245
- e.screenY = (_k = nativeEvent.screenY) != null ? _k : 0;
4246
- e.pageX = (_l = nativeEvent.pageX) != null ? _l : null;
4247
- e.pageY = (_m = nativeEvent.pageY) != null ? _m : null;
4248
- e.movementX = (_n = nativeEvent.movementX) != null ? _n : 0;
4249
- e.movementY = (_o = nativeEvent.movementY) != null ? _o : 0;
4250
- e.pressure = (_p = nativeEvent.pressure) != null ? _p : null;
4251
- e.tiltX = (_q = nativeEvent.tiltX) != null ? _q : null;
4252
- e.tiltY = (_r = nativeEvent.tiltY) != null ? _r : null;
4253
- e.width = (_s = nativeEvent.width) != null ? _s : null;
4254
- e.height = (_t = nativeEvent.height) != null ? _t : null;
4225
+ e.which = nativeEvent.which ?? nativeEvent.keyCode ?? null;
4226
+ e.button = nativeEvent.button ?? null;
4227
+ e.buttons = nativeEvent.buttons ?? null;
4228
+ e.pointerId = nativeEvent.pointerId ?? null;
4229
+ e.pointerType = nativeEvent.pointerType ?? null;
4230
+ e.isPrimary = nativeEvent.isPrimary ?? null;
4231
+ e.clientX = nativeEvent.clientX ?? 0;
4232
+ e.clientY = nativeEvent.clientY ?? 0;
4233
+ e.screenX = nativeEvent.screenX ?? 0;
4234
+ e.screenY = nativeEvent.screenY ?? 0;
4235
+ e.pageX = nativeEvent.pageX ?? null;
4236
+ e.pageY = nativeEvent.pageY ?? null;
4237
+ e.movementX = nativeEvent.movementX ?? 0;
4238
+ e.movementY = nativeEvent.movementY ?? 0;
4239
+ e.pressure = nativeEvent.pressure ?? null;
4240
+ e.tiltX = nativeEvent.tiltX ?? null;
4241
+ e.tiltY = nativeEvent.tiltY ?? null;
4242
+ e.width = nativeEvent.width ?? null;
4243
+ e.height = nativeEvent.height ?? null;
4255
4244
  e.pointerEventsSupported = POINTER_TYPES.includes(e.pointerType);
4256
4245
  try {
4257
4246
  const tgt = e.target;
@@ -4269,8 +4258,8 @@ function createSyntheticEvent(nativeEvent, currentTarget) {
4269
4258
  e.targetTouches = nativeEvent.targetTouches || null;
4270
4259
  e.changedTouches = nativeEvent.changedTouches || null;
4271
4260
  e.path = typeof nativeEvent.composedPath === "function" ? nativeEvent.composedPath() : [e.target];
4272
- e.repeat = (_u = nativeEvent.repeat) != null ? _u : false;
4273
- e.location = (_v = nativeEvent.location) != null ? _v : 0;
4261
+ e.repeat = nativeEvent.repeat ?? false;
4262
+ e.location = nativeEvent.location ?? 0;
4274
4263
  return e;
4275
4264
  }
4276
4265
  function releaseSyntheticEvent(e) {
@@ -4363,7 +4352,7 @@ __export(redux_exports2, {
4363
4352
  });
4364
4353
  var ReduxContext;
4365
4354
  function Provider({ store, children }) {
4366
- ReduxContext != null ? ReduxContext : ReduxContext = createContext(null);
4355
+ ReduxContext ?? (ReduxContext = createContext(null));
4367
4356
  return createComponent(ReduxContext.Provider, { "value": store }, children);
4368
4357
  }
4369
4358
  function useStore() {
@@ -4461,24 +4450,21 @@ __export(timers_exports, {
4461
4450
  setTimeout: () => setTimeout2,
4462
4451
  timeoutPromise: () => timeoutPromise
4463
4452
  });
4464
- var timer_pause_time = void 0;
4465
- var current_timer_idx = -1;
4453
+ var timer_pause_time;
4454
+ var current_timer_idx = 0;
4466
4455
  var timer_list = [];
4467
- var timer_timeout = -1;
4468
- var all_timers = {};
4469
- var _setTimeout = window.setTimeout;
4470
- var _setInterval = window.setInterval;
4471
- var _clearTimeout = window.clearTimeout;
4472
- var _clearInterval = window.clearInterval;
4456
+ var timer_timeout = 0;
4457
+ var all_timers = /* @__PURE__ */ new Map();
4473
4458
  function get_bucket(target) {
4474
4459
  let left = 0;
4475
4460
  let right = timer_list.length - 1;
4476
4461
  while (left <= right) {
4477
4462
  const mid = Math.floor((left + right) / 2);
4478
- const mid_val = timer_list[mid][DUE];
4479
- if (mid_val === target) {
4463
+ const mid_value = timer_list[mid][DUE];
4464
+ if (mid_value === target) {
4480
4465
  return [mid, timer_list[mid]];
4481
- } else if (mid_val < target) {
4466
+ }
4467
+ if (mid_value < target) {
4482
4468
  left = mid + 1;
4483
4469
  } else {
4484
4470
  right = mid - 1;
@@ -4489,84 +4475,142 @@ function get_bucket(target) {
4489
4475
  timer_list.splice(left, 0, bucket);
4490
4476
  return [left, bucket];
4491
4477
  }
4492
- function add_timer(t, is_repeat = false) {
4493
- const [i2, bucket] = get_bucket(t[DUE]);
4478
+ function schedule_next_timer() {
4479
+ if (timer_pause_time !== void 0 || timer_list.length === 0) {
4480
+ return;
4481
+ }
4482
+ Lilact._clearTimeout(timer_timeout);
4483
+ const delay = Math.max(
4484
+ 0,
4485
+ timer_list[0][DUE] - Date.now()
4486
+ );
4487
+ timer_timeout = Lilact._setTimeout(run_timer, delay);
4488
+ }
4489
+ function add_timer(timer, is_repeat = false) {
4490
+ const [bucket_index, bucket] = get_bucket(timer[DUE]);
4494
4491
  if (!is_repeat) {
4495
- current_timer_idx++;
4496
- all_timers[current_timer_idx] = t;
4497
- t[IDX] = current_timer_idx;
4492
+ current_timer_idx += 1;
4493
+ timer[IDX] = current_timer_idx;
4494
+ all_timers.set(timer[IDX], timer);
4498
4495
  }
4499
- bucket.push(t);
4500
- if (timer_list[0][0] === t) {
4501
- _clearTimeout(timer_timeout);
4502
- timer_timeout = _setTimeout(run_timer, t[INTERVAL]);
4496
+ bucket.push(timer);
4497
+ if (bucket_index === 0 && timer_pause_time === void 0) {
4498
+ schedule_next_timer();
4503
4499
  }
4504
- return current_timer_idx;
4500
+ return timer[IDX];
4505
4501
  }
4506
4502
  function run_timer() {
4503
+ timer_timeout = -1;
4507
4504
  const now = Date.now();
4508
- let i2 = 0;
4509
- let buck = timer_list[i2];
4510
- while (buck && buck[DUE] - now <= 0) {
4511
- for (const t of buck) {
4512
- if (!t[CLEARED]) {
4513
- t[CALLBACK](...t[ARGS]);
4514
- if (t[REPEAT]) {
4515
- t[DUE] = Date.now() + t[INTERVAL];
4516
- add_timer(t, true);
4517
- } else {
4518
- delete all_timers[t[IDX]];
4519
- }
4520
- } else {
4521
- delete all_timers[t[IDX]];
4522
- }
4505
+ const due_buckets = [];
4506
+ while (timer_list.length > 0 && timer_list[0][DUE] - now <= 0) {
4507
+ due_buckets.push(timer_list.shift());
4508
+ }
4509
+ const due_timers = [];
4510
+ for (const bucket of due_buckets) {
4511
+ for (const timer of bucket) {
4512
+ due_timers.push(timer);
4523
4513
  }
4524
- i2++;
4525
- buck = timer_list[i2];
4526
4514
  }
4527
- timer_list.splice(0, i2);
4528
- if (timer_list.length > 0) {
4529
- _clearTimeout(timer_timeout);
4530
- timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
4515
+ let first_error;
4516
+ for (const timer of due_timers) {
4517
+ if (timer[CLEARED] || all_timers.get(timer[IDX]) !== timer) {
4518
+ all_timers.delete(timer[IDX]);
4519
+ continue;
4520
+ }
4521
+ try {
4522
+ timer[CALLBACK](...timer[ARGS]);
4523
+ } catch (error2) {
4524
+ first_error ?? (first_error = error2);
4525
+ }
4526
+ if (timer[CLEARED]) {
4527
+ all_timers.delete(timer[IDX]);
4528
+ continue;
4529
+ }
4530
+ if (all_timers.get(timer[IDX]) !== timer) {
4531
+ continue;
4532
+ }
4533
+ if (timer[REPEAT]) {
4534
+ timer[DUE] = Date.now() + timer[INTERVAL];
4535
+ add_timer(timer, true);
4536
+ } else {
4537
+ all_timers.delete(timer[IDX]);
4538
+ }
4539
+ }
4540
+ schedule_next_timer();
4541
+ if (first_error !== void 0) {
4542
+ Lilact._setTimeout(() => {
4543
+ throw first_error;
4544
+ }, 0);
4531
4545
  }
4532
4546
  }
4533
4547
  function resetTimers() {
4534
- _clearTimeout(timer_timeout);
4548
+ Lilact._clearTimeout(timer_timeout);
4549
+ for (const timer of all_timers.values()) {
4550
+ timer[CLEARED] = true;
4551
+ }
4535
4552
  timer_pause_time = void 0;
4536
4553
  current_timer_idx = -1;
4537
4554
  timer_list = [];
4538
4555
  timer_timeout = -1;
4539
- all_timers = {};
4556
+ all_timers = /* @__PURE__ */ new Map();
4540
4557
  }
4541
4558
  function pauseTimers() {
4542
- _clearTimeout(timer_timeout);
4559
+ if (timer_pause_time !== void 0) {
4560
+ return;
4561
+ }
4562
+ Lilact._clearTimeout(timer_timeout);
4563
+ timer_timeout = -1;
4543
4564
  timer_pause_time = Date.now();
4544
4565
  }
4545
4566
  function resumeTimers() {
4546
- if (!timer_pause_time) return;
4547
- if (timer_list.length > 0) {
4548
- const now = Date.now();
4549
- timer_pause_time -= now;
4550
- for (const t of timer_list) {
4551
- t[DUE] -= timer_pause_time;
4552
- }
4553
- timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
4567
+ if (timer_pause_time === void 0) {
4568
+ return;
4569
+ }
4570
+ const elapsed = Date.now() - timer_pause_time;
4571
+ for (const bucket of timer_list) {
4572
+ bucket[DUE] += elapsed;
4554
4573
  }
4555
4574
  timer_pause_time = void 0;
4575
+ schedule_next_timer();
4576
+ }
4577
+ function setTimeout2(callback, delay = 0, ...args) {
4578
+ const milliseconds = Math.max(0, Number(delay) || 0);
4579
+ return add_timer({
4580
+ [CALLBACK]: callback,
4581
+ [INTERVAL]: milliseconds,
4582
+ [DUE]: Date.now() + milliseconds,
4583
+ [REPEAT]: false,
4584
+ [CLEARED]: false,
4585
+ [ARGS]: args
4586
+ });
4556
4587
  }
4557
- function setTimeout2(callback, delay, ...args) {
4558
- return add_timer({ [CALLBACK]: callback, [INTERVAL]: delay, [DUE]: Date.now() + delay, [REPEAT]: false, [ARGS]: args });
4559
- }
4560
- function setInterval(callback, interval, ...args) {
4561
- return add_timer({ [CALLBACK]: callback, [INTERVAL]: interval, [DUE]: Date.now() + interval, [REPEAT]: true, [ARGS]: args });
4588
+ function setInterval(callback, interval = 0, ...args) {
4589
+ const milliseconds = Math.max(0, Number(interval) || 0);
4590
+ return add_timer({
4591
+ [CALLBACK]: callback,
4592
+ [INTERVAL]: milliseconds,
4593
+ [DUE]: Date.now() + milliseconds,
4594
+ [REPEAT]: true,
4595
+ [CLEARED]: false,
4596
+ [ARGS]: args
4597
+ });
4562
4598
  }
4563
4599
  function clearTimeout2(id) {
4564
- if (all_timers[id]) all_timers[id][CLEARED] = true;
4565
- else _clearTimeout(id);
4600
+ const timer = all_timers.get(id);
4601
+ if (timer !== void 0) {
4602
+ timer[CLEARED] = true;
4603
+ } else {
4604
+ Lilact._clearTimeout(id);
4605
+ }
4566
4606
  }
4567
4607
  function clearInterval(id) {
4568
- if (all_timers[id]) all_timers[id][CLEARED] = true;
4569
- else _clearInterval(id);
4608
+ const timer = all_timers.get(id);
4609
+ if (timer !== void 0) {
4610
+ timer[CLEARED] = true;
4611
+ } else {
4612
+ Lilact._clearInterval(id);
4613
+ }
4570
4614
  }
4571
4615
  function grabTimers() {
4572
4616
  globalThis.setTimeout = Lilact.setTimeout;
@@ -4575,27 +4619,29 @@ function grabTimers() {
4575
4619
  globalThis.clearInterval = Lilact.clearInterval;
4576
4620
  }
4577
4621
  function releaseTimers() {
4578
- globalThis.setTimeout = _setTimeout;
4579
- globalThis.setInterval = _setInterval;
4580
- globalThis.clearTimeout = _clearTimeout;
4581
- globalThis.clearInterval = _clearInterval;
4622
+ globalThis.setTimeout = Lilact._setTimeout;
4623
+ globalThis.setInterval = Lilact._setInterval;
4624
+ globalThis.clearTimeout = Lilact._clearTimeout;
4625
+ globalThis.clearInterval = Lilact._clearInterval;
4582
4626
  }
4583
4627
  function timeoutPromise(duration = 0, timerSource = Lilact) {
4584
- let id, resolve, reject;
4585
- const promise = new Promise((res, rej) => {
4586
- resolve = res;
4587
- reject = rej;
4628
+ let id;
4629
+ let resolve_promise;
4630
+ let reject_promise;
4631
+ const promise = new Promise((resolve, reject) => {
4632
+ resolve_promise = resolve;
4633
+ reject_promise = reject;
4588
4634
  id = timerSource.setTimeout(() => {
4589
4635
  resolve();
4590
4636
  }, duration);
4591
4637
  });
4592
4638
  promise.proceed = () => {
4593
4639
  timerSource.clearTimeout(id);
4594
- resolve();
4640
+ resolve_promise();
4595
4641
  };
4596
4642
  promise.cancel = () => {
4597
4643
  timerSource.clearTimeout(id);
4598
- reject();
4644
+ reject_promise();
4599
4645
  };
4600
4646
  return promise;
4601
4647
  }
@@ -4622,9 +4668,9 @@ function number(value) {
4622
4668
  }
4623
4669
  function asError2(value) {
4624
4670
  if (value instanceof Error) return value;
4625
- if ((value == null ? void 0 : value.error) instanceof Error) return value.error;
4671
+ if (value?.error instanceof Error) return value.error;
4626
4672
  const error2 = new Error(
4627
- (value == null ? void 0 : value.message) == null ? String(value) : String(value.message)
4673
+ value?.message == null ? String(value) : String(value.message)
4628
4674
  );
4629
4675
  if (value && typeof value === "object") {
4630
4676
  if (value.name) error2.name = value.name;
@@ -4636,7 +4682,7 @@ function asError2(value) {
4636
4682
  return error2;
4637
4683
  }
4638
4684
  function isParserError(error2) {
4639
- return (error2 == null ? void 0 : error2.name) === "JSXParserError";
4685
+ return error2?.name === "JSXParserError";
4640
4686
  }
4641
4687
  function stackLocation(stack) {
4642
4688
  if (typeof stack !== "string") return null;
@@ -4652,12 +4698,11 @@ function stackLocation(stack) {
4652
4698
  return null;
4653
4699
  }
4654
4700
  function browserLocation(error2) {
4655
- var _a, _b, _c, _d;
4656
4701
  const line2 = number(
4657
- (_b = (_a = error2 == null ? void 0 : error2.lineNumber) != null ? _a : error2 == null ? void 0 : error2.lineno) != null ? _b : error2 == null ? void 0 : error2.line
4702
+ error2?.lineNumber ?? error2?.lineno ?? error2?.line
4658
4703
  );
4659
4704
  const column2 = number(
4660
- (_d = (_c = error2 == null ? void 0 : error2.columnNumber) != null ? _c : error2 == null ? void 0 : error2.colno) != null ? _d : error2 == null ? void 0 : error2.column
4705
+ error2?.columnNumber ?? error2?.colno ?? error2?.column
4661
4706
  );
4662
4707
  return {
4663
4708
  line: line2 == null ? null : Math.max(0, line2 - 1),
@@ -4665,13 +4710,12 @@ function browserLocation(error2) {
4665
4710
  };
4666
4711
  }
4667
4712
  function traceBlock(error2) {
4668
- const trace = error2 == null ? void 0 : error2.lilact_trace;
4713
+ const trace = error2?.lilact_trace;
4669
4714
  return Array.isArray(trace) ? trace[0] : trace;
4670
4715
  }
4671
4716
  function blockInfo(error2) {
4672
- var _a, _b;
4673
4717
  const trace = traceBlock(error2);
4674
- return trace == null ? null : (_b = (_a = lilact_default.blocks_info) == null ? void 0 : _a.labels) == null ? void 0 : _b[trace];
4718
+ return trace == null ? null : lilact_default.blocks_info?.labels?.[trace];
4675
4719
  }
4676
4720
  function mapLocation(mappings, line2, column2) {
4677
4721
  if (!Array.isArray(mappings) || !mappings.length || !Number.isFinite(line2) || !Number.isFinite(column2)) {
@@ -4703,8 +4747,7 @@ function mapLocation(mappings, line2, column2) {
4703
4747
  };
4704
4748
  }
4705
4749
  function traceError(value, runPath) {
4706
- var _a, _b, _c, _d, _e, _f;
4707
- if (value == null ? void 0 : value.isTraced) return value;
4750
+ if (value?.isTraced) return value;
4708
4751
  const error2 = asError2(value);
4709
4752
  const source = error2.lilact_source;
4710
4753
  const stack = isParserError(error2) ? null : stackLocation(error2.stack);
@@ -4712,9 +4755,9 @@ function traceError(value, runPath) {
4712
4755
  line: number(error2.lineNumber),
4713
4756
  column: number(error2.columnNumber)
4714
4757
  } : browserLocation(error2);
4715
- const fileName = (source == null ? void 0 : source.path) || (stack == null ? void 0 : stack.path) || error2.fileName || runPath || null;
4716
- let line2 = (_b = (_a = stack == null ? void 0 : stack.line) != null ? _a : browser.line) != null ? _b : null;
4717
- let column2 = (_d = (_c = stack == null ? void 0 : stack.column) != null ? _c : browser.column) != null ? _d : null;
4758
+ const fileName = source?.path || stack?.path || error2.fileName || runPath || null;
4759
+ let line2 = stack?.line ?? browser.line ?? null;
4760
+ let column2 = stack?.column ?? browser.column ?? null;
4718
4761
  const result2 = {
4719
4762
  fileName,
4720
4763
  lineNumber: line2,
@@ -4739,40 +4782,39 @@ function traceError(value, runPath) {
4739
4782
  const block = blockInfo(error2);
4740
4783
  if (block && (result2.lineNumber == null || result2.columnNumber == null || !result2.fileName)) {
4741
4784
  result2.fileName || (result2.fileName = block.path || runPath || null);
4742
- (_e = result2.lineNumber) != null ? _e : result2.lineNumber = block.line;
4743
- (_f = result2.columnNumber) != null ? _f : result2.columnNumber = block.col;
4785
+ result2.lineNumber ?? (result2.lineNumber = block.line);
4786
+ result2.columnNumber ?? (result2.columnNumber = block.col);
4744
4787
  result2.label = block.desc;
4745
4788
  }
4746
4789
  lilact_default.error = result2;
4747
4790
  return result2;
4748
4791
  }
4749
4792
  function escapeHtml(value) {
4750
- return String(value != null ? value : "").replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
4793
+ return String(value ?? "").replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
4751
4794
  }
4752
4795
  function sourceExcerpt(module2, line2) {
4753
- var _a, _b, _c, _d;
4754
4796
  if (!module2 || !Number.isFinite(line2)) return null;
4755
- const lines = String((_a = module2.code) != null ? _a : "").split(/\r?\n/);
4797
+ const lines = String(module2.code ?? "").split(/\r?\n/);
4756
4798
  return {
4757
- before: (_b = lines[line2 - 1]) != null ? _b : "",
4758
- current: (_c = lines[line2]) != null ? _c : "",
4759
- after: (_d = lines[line2 + 1]) != null ? _d : ""
4799
+ before: lines[line2 - 1] ?? "",
4800
+ current: lines[line2] ?? "",
4801
+ after: lines[line2 + 1] ?? ""
4760
4802
  };
4761
4803
  }
4762
4804
  function globalErrorHandler(eventOrError) {
4763
- var _a, _b;
4764
- const value = (eventOrError == null ? void 0 : eventOrError.error) instanceof Error ? eventOrError.error : (eventOrError == null ? void 0 : eventOrError.reason) !== void 0 ? eventOrError.reason : eventOrError;
4805
+ const value = eventOrError?.error instanceof Error ? eventOrError.error : eventOrError?.reason !== void 0 ? eventOrError.reason : eventOrError;
4765
4806
  const error2 = traceError(
4766
4807
  value,
4767
- (eventOrError == null ? void 0 : eventOrError.fileName) || null
4808
+ eventOrError?.fileName || null
4768
4809
  );
4769
4810
  const excerpt = sourceExcerpt(
4770
4811
  required_scripts[error2.fileName],
4771
4812
  error2.lineNumber
4772
4813
  );
4773
4814
  const className = css(`
4774
- background: linear-gradient(135deg, #fff2f2d4, #ffffffd4);
4775
- backdrop-filter: blur(10px);
4815
+ background: #fff;
4816
+ text-shadow: 0 0 3px #fff;
4817
+ -backdrop-filter: blur(20px);
4776
4818
  border: 1px solid rgba(255,255,255,.25);
4777
4819
  border-radius: 5px;
4778
4820
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
@@ -4785,17 +4827,18 @@ function globalErrorHandler(eventOrError) {
4785
4827
  }
4786
4828
 
4787
4829
  code {
4788
- border: 1px solid #0003;
4830
+ background: #0001;
4789
4831
  overflow: auto;
4790
4832
  padding: 10px;
4791
4833
  display: block;
4834
+ border-radius: 3px;
4792
4835
  }
4793
4836
  `);
4794
4837
  const dialog = document.createElement("dialog");
4795
4838
  dialog.className = className;
4796
4839
  const location = error2.fileName ? `At ${escapeHtml(error2.fileName)}` : "";
4797
4840
  const line2 = Number.isFinite(error2.lineNumber) ? `: Line ${error2.lineNumber + 1}` : "";
4798
- const componentStack = ((_a = error2._error) == null ? void 0 : _a.componentStackLog) || ((_b = error2._error) == null ? void 0 : _b.componentStack) || "";
4841
+ const componentStack = error2._error?.componentStackLog || error2._error?.componentStack || "";
4799
4842
  dialog.innerHTML = `
4800
4843
  <h3><red>Error!</red></h3>
4801
4844
  <b>${location}${line2}</b><br><br>
@@ -4861,7 +4904,6 @@ var createURL = (to) => typeof to === "string" ? to : (to.pathname || "") + (to.
4861
4904
  var escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4862
4905
  function HashRouter({ children, basename = "" }) {
4863
4906
  const readLocation = () => {
4864
- var _a;
4865
4907
  const raw = window.location.hash || "#/";
4866
4908
  const full = raw.slice(1);
4867
4909
  const baseRe = new RegExp("^" + escapeRegExp(basename));
@@ -4872,7 +4914,7 @@ function HashRouter({ children, basename = "" }) {
4872
4914
  pathname: path2 || "/",
4873
4915
  search: search ? "?" + search : "",
4874
4916
  hash: hashPart ? "#" + hashPart : "",
4875
- state: (_a = history.state) == null ? void 0 : _a.__state
4917
+ state: history.state?.__state
4876
4918
  };
4877
4919
  };
4878
4920
  const [location, setLocation] = useState(readLocation);
@@ -4895,7 +4937,7 @@ function HashRouter({ children, basename = "" }) {
4895
4937
  done = true;
4896
4938
  window.removeEventListener("popstate", onPop);
4897
4939
  window.removeEventListener("hashchange", onHash);
4898
- fn == null ? void 0 : fn();
4940
+ fn?.();
4899
4941
  resolve();
4900
4942
  };
4901
4943
  const onPop = () => cleanup(() => setLocation(readLocation()));
@@ -5001,14 +5043,13 @@ function Route({ path: path2, element = null, children }) {
5001
5043
  return null;
5002
5044
  }
5003
5045
  function Routes({ children }) {
5004
- var _a;
5005
5046
  const location = useLocation();
5006
5047
  const pathname = location.pathname || "/";
5007
5048
  const routes = Children.toArray(children);
5008
5049
  for (let i2 = 0; i2 < routes.length; i2++) {
5009
5050
  const route = routes[i2];
5010
5051
  const path2 = route.props.path === void 0 ? null : route.props.path;
5011
- const element = (_a = route.props.element) != null ? _a : null;
5052
+ const element = route.props.element ?? null;
5012
5053
  const childRoutes = route.props.children;
5013
5054
  const { matched, params } = matchPath(path2, pathname);
5014
5055
  if (matched) {
@@ -5033,7 +5074,6 @@ __export(accessories_exports, {
5033
5074
  SplitPane: () => SplitPane,
5034
5075
  Suspense: () => Suspense
5035
5076
  });
5036
- var { css: css2, cx: cx2 } = emotion_css_esm_exports;
5037
5077
  function Spinner({
5038
5078
  size = 48,
5039
5079
  className,
@@ -5209,7 +5249,7 @@ function DragHandle({
5209
5249
  }, []);
5210
5250
  const endDrag = useCallback((reason = "up") => {
5211
5251
  if (!draggingRef.current) return;
5212
- onEnd == null ? void 0 : onEnd(reason);
5252
+ onEnd?.(reason);
5213
5253
  resetDrag();
5214
5254
  }, [onEnd, resetDrag]);
5215
5255
  const onPointerDown = useCallback((e) => {
@@ -5221,17 +5261,17 @@ function DragHandle({
5221
5261
  lastClientXRef.current = e.clientX;
5222
5262
  lastClientYRef.current = e.clientY;
5223
5263
  setIsDragging(true);
5224
- onStart == null ? void 0 : onStart(data);
5264
+ onStart?.(data);
5225
5265
  try {
5226
5266
  e.currentTarget.setPointerCapture(e.pointerId);
5227
- } catch (e2) {
5267
+ } catch {
5228
5268
  }
5229
5269
  }, [onStart]);
5230
5270
  const onPointerMove = useCallback((e) => {
5231
5271
  if (!draggingRef.current) return;
5232
5272
  if (activePointerIdRef.current !== e.pointerId) return;
5233
5273
  const { dx, dy } = computeDeltaFromStart(e.clientX, e.clientY);
5234
- onDelta == null ? void 0 : onDelta(dx, dy, data);
5274
+ onDelta?.(dx, dy, data);
5235
5275
  lastClientXRef.current = e.clientX;
5236
5276
  lastClientYRef.current = e.clientY;
5237
5277
  }, [computeDeltaFromStart, onDelta]);
@@ -5243,7 +5283,7 @@ function DragHandle({
5243
5283
  if (activePointerIdRef.current !== e.pointerId) return;
5244
5284
  endDrag("cancel", data);
5245
5285
  }, [endDrag]);
5246
- return createComponent("div", { "role": "button", "tabIndex": 0, "style": { ...style, touchAction: "none" }, "className": cx2(className, isDragging ? "dragging" : ""), "onPointerDown": onPointerDown, "onPointerMove": onPointerMove, "onPointerUp": onPointerUp, "onPointerCancel": onPointerCancel }, children);
5286
+ return createComponent("div", { "role": "button", "tabIndex": 0, "style": { ...style, touchAction: "none" }, "className": `${className} ${isDragging ? "dragging" : ""}`, "onPointerDown": onPointerDown, "onPointerMove": onPointerMove, "onPointerUp": onPointerUp, "onPointerCancel": onPointerCancel }, children);
5247
5287
  }
5248
5288
  var SplitPane = forwardRef(function SplitPane2({
5249
5289
  mode = "horizontal",
@@ -5299,21 +5339,18 @@ var SplitPane = forwardRef(function SplitPane2({
5299
5339
  const { w: w2, h: h2 } = sizeRef.current;
5300
5340
  if (modeNow === "vertical" ? h2 <= 0 : w2 <= 0) {
5301
5341
  if (position2 == null) setInternalPos(next2);
5302
- onSizeChange == null ? void 0 : onSizeChange(next2);
5342
+ onSizeChange?.(next2);
5303
5343
  return;
5304
5344
  }
5305
5345
  const clamped = clampWithSize(next2, modeNow, w2, h2);
5306
5346
  if (position2 == null) setInternalPos(clamped);
5307
5347
  effectivePosRef.current = clamped;
5308
- onSizeChange == null ? void 0 : onSizeChange(clamped);
5348
+ onSizeChange?.(clamped);
5309
5349
  };
5310
5350
  useImperativeHandle(ref, () => ({
5311
5351
  setPosition,
5312
5352
  setMode: (nextMode) => setInternalMode(nextMode === "vertical" ? "vertical" : "horizontal"),
5313
- getPosition: () => {
5314
- var _a;
5315
- return (_a = effectivePosRef.current) != null ? _a : posResolved;
5316
- },
5353
+ getPosition: () => effectivePosRef.current ?? posResolved,
5317
5354
  getMode: () => internalModeRef.current
5318
5355
  }));
5319
5356
  const didInitRef = useRef(false);
@@ -5321,7 +5358,6 @@ var SplitPane = forwardRef(function SplitPane2({
5321
5358
  const el = containerRef.current;
5322
5359
  if (!el) return;
5323
5360
  const ro = new ResizeObserver((entries) => {
5324
- var _a;
5325
5361
  const rect = el.getBoundingClientRect();
5326
5362
  const prev2 = sizeRef.current;
5327
5363
  const nextSize = { w: rect.width, h: rect.height };
@@ -5335,11 +5371,11 @@ var SplitPane = forwardRef(function SplitPane2({
5335
5371
  const clamped = clampWithSize(raw, modeNow, nextSize.w, nextSize.h);
5336
5372
  if (position2 == null) setInternalPos(clamped);
5337
5373
  effectivePosRef.current = clamped;
5338
- onSizeChange == null ? void 0 : onSizeChange(clamped);
5374
+ onSizeChange?.(clamped);
5339
5375
  return;
5340
5376
  }
5341
5377
  if (!hadSize || !hasSizeNow) return;
5342
- const p2 = (_a = effectivePosRef.current) != null ? _a : posResolved;
5378
+ const p2 = effectivePosRef.current ?? posResolved;
5343
5379
  const rp = resizePolicyRef.current;
5344
5380
  const s = splitterSize;
5345
5381
  if (rp === "fixFirst") {
@@ -5389,9 +5425,8 @@ var SplitPane = forwardRef(function SplitPane2({
5389
5425
  if (!dragging) startPosRef.current = posResolved;
5390
5426
  }, [posResolved, dragging]);
5391
5427
  const handleStart = () => {
5392
- var _a;
5393
5428
  setDragging(true);
5394
- startPosRef.current = (_a = effectivePosRef.current) != null ? _a : posResolved;
5429
+ startPosRef.current = effectivePosRef.current ?? posResolved;
5395
5430
  };
5396
5431
  const handleDelta = (x, y) => {
5397
5432
  const modeNow = internalModeRef.current;
@@ -6116,14 +6151,14 @@ function preprocessPragmas(node, context) {
6116
6151
  var scope_stack = [];
6117
6152
  var last_block = null;
6118
6153
  const clone_block = (i2, val) => {
6119
- var _a, _b;
6154
+ var _a;
6120
6155
  last_block = typeof all_nodes[i2] === "object" ? structuredClone(
6121
6156
  { ...all_nodes[i2], children: void 0, attributes: {} }
6122
6157
  ) : all_nodes[i2];
6123
6158
  if (last_block.type === "directive") {
6124
6159
  last_block.value = val;
6125
6160
  }
6126
- (_b = (_a = scope_stack[0]).out) != null ? _b : _a.out = [];
6161
+ (_a = scope_stack[0]).out ?? (_a.out = []);
6127
6162
  scope_stack[0].out.push(last_block);
6128
6163
  return last_block;
6129
6164
  };
@@ -6654,13 +6689,12 @@ function generateSourceMap(json, path2, jsx_eols, out_eols, mappings = []) {
6654
6689
  "mappings": ""
6655
6690
  };
6656
6691
  const scan_leaves = (node3) => {
6657
- var _a;
6658
- if (((_a = node3 == null ? void 0 : node3.out) == null ? void 0 : _a.length) > 0) {
6692
+ if (node3?.out?.length > 0) {
6659
6693
  for (const ch2 of node3.out) {
6660
6694
  scan_leaves(ch2);
6661
6695
  }
6662
6696
  }
6663
- if ((node3 == null ? void 0 : node3.begin) !== void 0 && (node3 == null ? void 0 : node3.out_index) !== void 0) {
6697
+ if (node3?.begin !== void 0 && node3?.out_index !== void 0) {
6664
6698
  mpps.push([...getRowCol(out_eols, node3.out_index), ...getRowCol(jsx_eols, node3.begin), node3]);
6665
6699
  }
6666
6700
  };
@@ -6709,9 +6743,8 @@ function transpileJSX(jsx2, {
6709
6743
  },
6710
6744
  mappings = []
6711
6745
  } = {}) {
6712
- var _a, _b;
6713
- (_a = transpilerConfig.preprocessorDelimiter) != null ? _a : transpilerConfig.preprocessorDelimiter = "\u0294";
6714
- (_b = transpilerConfig.injectTraceLabels) != null ? _b : transpilerConfig.injectTraceLabels = injectTraceLabels;
6746
+ transpilerConfig.preprocessorDelimiter ?? (transpilerConfig.preprocessorDelimiter = "\u0294");
6747
+ transpilerConfig.injectTraceLabels ?? (transpilerConfig.injectTraceLabels = injectTraceLabels);
6715
6748
  const eols = scanEOLs(jsx2);
6716
6749
  raiseError = ((eols2, msg, index2) => {
6717
6750
  const rc = getRowCol(eols2, index2);
@@ -6808,7 +6841,7 @@ function transpileJSX(jsx2, {
6808
6841
  if (is_attr) {
6809
6842
  return out2.substring(1, out2.length - 1);
6810
6843
  }
6811
- if (node3 == null ? void 0 : node3.is_xml_js) {
6844
+ if (node3?.is_xml_js) {
6812
6845
  return jsx2.substring(node3.begin + 1, node3.end - 1);
6813
6846
  }
6814
6847
  return out2;
@@ -6892,10 +6925,10 @@ var Lilact2 = {
6892
6925
  PropTypes,
6893
6926
  redux: redux_exports,
6894
6927
  emotion: emotion_css_esm_exports,
6895
- _setTimeout: window.setTimeout.bind(window),
6896
- _setInterval: window.setInterval.bind(window),
6897
- _clearTimeout: window.clearTimeout.bind(window),
6898
- _clearInterval: window.clearInterval.bind(window)
6928
+ _setTimeout: globalThis.setTimeout.bind(globalThis),
6929
+ _setInterval: globalThis.setInterval.bind(globalThis),
6930
+ _clearTimeout: globalThis.clearTimeout.bind(globalThis),
6931
+ _clearInterval: globalThis.clearInterval.bind(globalThis)
6899
6932
  };
6900
6933
  Lilact2.default = Lilact2;
6901
6934
  var lilact_default = Lilact2;
@@ -6911,8 +6944,7 @@ globalThis.require = Lilact2.require;
6911
6944
  document.addEventListener("DOMContentLoaded", () => {
6912
6945
  Lilact2.grabTimers();
6913
6946
  Lilact2.runScripts().catch((error2) => {
6914
- var _a;
6915
- (_a = Lilact2.globalErrorHandler) == null ? void 0 : _a.call(Lilact2, error2);
6947
+ Lilact2.globalErrorHandler?.(error2);
6916
6948
  });
6917
6949
  });
6918
6950
  if (true) {