@symbo.ls/scratch 2.11.453 → 2.11.469

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -768,10 +768,10 @@ var require_object = __commonJS({
768
768
  return o;
769
769
  };
770
770
  var deepStringify = (obj, stringified = {}) => {
771
- var _a;
771
+ var _a, _b;
772
772
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
773
- console.warn("Trying to clone element or state at", obj);
774
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
773
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
774
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
775
775
  }
776
776
  for (const prop in obj) {
777
777
  const objProp = obj[prop];
@@ -841,7 +841,7 @@ var require_object = __commonJS({
841
841
  if ((0, import_types.isArray)(value)) {
842
842
  str += "[\n";
843
843
  for (const element of value) {
844
- if ((0, import_types.isObject)(element) && element !== null) {
844
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
845
845
  str += `${spaces} ${objectToString(element, indent + 2)},
846
846
  `;
847
847
  } else if ((0, import_types.isString)(element)) {
@@ -1411,9 +1411,11 @@ var require_cookie = __commonJS({
1411
1411
  var cookie_exports = {};
1412
1412
  __export2(cookie_exports, {
1413
1413
  getCookie: () => getCookie,
1414
+ getLocalStorage: () => getLocalStorage,
1414
1415
  isMobile: () => isMobile,
1415
1416
  removeCookie: () => removeCookie,
1416
- setCookie: () => setCookie
1417
+ setCookie: () => setCookie,
1418
+ setLocalStorage: () => setLocalStorage
1417
1419
  });
1418
1420
  module2.exports = __toCommonJS2(cookie_exports);
1419
1421
  var import_types = require_types();
@@ -1447,6 +1449,27 @@ var require_cookie = __commonJS({
1447
1449
  return;
1448
1450
  import_utils13.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
1449
1451
  };
1452
+ function getLocalStorage(key) {
1453
+ let savedJSON;
1454
+ if (window.localStorage) {
1455
+ try {
1456
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
1457
+ } catch (e) {
1458
+ }
1459
+ }
1460
+ if (typeof savedJSON !== "undefined") {
1461
+ return savedJSON;
1462
+ }
1463
+ }
1464
+ function setLocalStorage(key, data) {
1465
+ if (data && window.localStorage) {
1466
+ if (typeof data === "object") {
1467
+ window.localStorage.setItem(key, JSON.stringify(data));
1468
+ } else {
1469
+ window.localStorage.setItem(key, data);
1470
+ }
1471
+ }
1472
+ }
1450
1473
  }
1451
1474
  });
1452
1475
 
@@ -1650,7 +1673,9 @@ var require_component = __commonJS({
1650
1673
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
1651
1674
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1652
1675
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
1676
+ checkIfSugar: () => checkIfSugar,
1653
1677
  extendizeByKey: () => extendizeByKey,
1678
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
1654
1679
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
1655
1680
  getExtendsInElement: () => getExtendsInElement,
1656
1681
  hasVariantProp: () => hasVariantProp,
@@ -1684,12 +1709,13 @@ var require_component = __commonJS({
1684
1709
  return { ...element, extend };
1685
1710
  };
1686
1711
  var checkIfSugar = (element, parent, key) => {
1712
+ var _a;
1687
1713
  const {
1688
1714
  extend,
1689
1715
  props,
1690
1716
  childExtend,
1691
1717
  extends: extendProps,
1692
- childrenExtends,
1718
+ childExtends,
1693
1719
  childProps,
1694
1720
  children,
1695
1721
  on,
@@ -1698,15 +1724,17 @@ var require_component = __commonJS({
1698
1724
  $propsCollection
1699
1725
  } = element;
1700
1726
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
1701
- if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
1702
- element.error("Sugar component includes params for builtin components");
1727
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
1728
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
1729
+ if (logErr)
1730
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
1703
1731
  }
1704
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
1732
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
1705
1733
  };
1706
1734
  var extendizeByKey = (element, parent, key) => {
1707
1735
  const { context } = parent;
1708
- const { tag, extend, childrenExtends } = element;
1709
- const isSugar = checkIfSugar(element);
1736
+ const { tag, extend, childExtends } = element;
1737
+ const isSugar = checkIfSugar(element, parent, key);
1710
1738
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
1711
1739
  const isExtendKeyComponent = context && context.components[extendFromKey];
1712
1740
  if (element === isExtendKeyComponent)
@@ -1717,8 +1745,8 @@ var require_component = __commonJS({
1717
1745
  tag,
1718
1746
  props: { ...element }
1719
1747
  });
1720
- if (childrenExtends)
1721
- newElem.childExtend = childrenExtends;
1748
+ if (childExtends)
1749
+ newElem.childExtend = childExtends;
1722
1750
  return newElem;
1723
1751
  } else if (!extend || extend === true) {
1724
1752
  return {
@@ -1747,23 +1775,24 @@ var require_component = __commonJS({
1747
1775
  const childKey = childElems[i];
1748
1776
  const childElem = element[childKey];
1749
1777
  const newChild = element.props[childKey];
1778
+ const assignChild = (val) => {
1779
+ element[childKey] = val;
1780
+ delete element.props[childKey];
1781
+ };
1750
1782
  if (newChild == null ? void 0 : newChild.ignoreExtend)
1751
1783
  continue;
1752
- if (!childElem)
1753
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
1784
+ if (newChild === null)
1785
+ assignChild(null);
1786
+ else if (!childElem)
1787
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
1754
1788
  else {
1755
- const isSugar = checkIfSugar(childElem);
1756
- if (!isSugar)
1789
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
1790
+ if (isSugarChildElem)
1757
1791
  continue;
1758
- const inheritedChildElem = element[childKey].props;
1759
- if ((0, import__.isObjectLike)(newChild)) {
1760
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
1761
- } else if ((0, import__.isFunction)(newChild)) {
1762
- element[childKey] = {
1763
- extend: element[childKey],
1764
- props: newChild
1765
- };
1766
- }
1792
+ assignChild({
1793
+ extend: element[childKey],
1794
+ props: newChild
1795
+ });
1767
1796
  }
1768
1797
  }
1769
1798
  };
@@ -2685,10 +2714,10 @@ var require_cjs3 = __commonJS({
2685
2714
  return o;
2686
2715
  };
2687
2716
  var deepStringify = (obj, stringified = {}) => {
2688
- var _a;
2717
+ var _a, _b;
2689
2718
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
2690
- console.warn("Trying to clone element or state at", obj);
2691
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
2719
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
2720
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
2692
2721
  }
2693
2722
  for (const prop in obj) {
2694
2723
  const objProp = obj[prop];
@@ -2758,7 +2787,7 @@ var require_cjs3 = __commonJS({
2758
2787
  if ((0, import_types.isArray)(value)) {
2759
2788
  str += "[\n";
2760
2789
  for (const element of value) {
2761
- if ((0, import_types.isObject)(element) && element !== null) {
2790
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
2762
2791
  str += `${spaces} ${objectToString(element, indent + 2)},
2763
2792
  `;
2764
2793
  } else if ((0, import_types.isString)(element)) {
@@ -3322,9 +3351,11 @@ var require_cjs3 = __commonJS({
3322
3351
  var cookie_exports = {};
3323
3352
  __export22(cookie_exports, {
3324
3353
  getCookie: () => getCookie,
3354
+ getLocalStorage: () => getLocalStorage,
3325
3355
  isMobile: () => isMobile,
3326
3356
  removeCookie: () => removeCookie,
3327
- setCookie: () => setCookie
3357
+ setCookie: () => setCookie,
3358
+ setLocalStorage: () => setLocalStorage
3328
3359
  });
3329
3360
  module22.exports = __toCommonJS22(cookie_exports);
3330
3361
  var import_types = require_types2();
@@ -3358,6 +3389,27 @@ var require_cjs3 = __commonJS({
3358
3389
  return;
3359
3390
  import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
3360
3391
  };
3392
+ function getLocalStorage(key) {
3393
+ let savedJSON;
3394
+ if (window.localStorage) {
3395
+ try {
3396
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
3397
+ } catch (e) {
3398
+ }
3399
+ }
3400
+ if (typeof savedJSON !== "undefined") {
3401
+ return savedJSON;
3402
+ }
3403
+ }
3404
+ function setLocalStorage(key, data) {
3405
+ if (data && window.localStorage) {
3406
+ if (typeof data === "object") {
3407
+ window.localStorage.setItem(key, JSON.stringify(data));
3408
+ } else {
3409
+ window.localStorage.setItem(key, data);
3410
+ }
3411
+ }
3412
+ }
3361
3413
  }
3362
3414
  });
3363
3415
  var require_tags2 = __commonJS2({
@@ -3557,7 +3609,9 @@ var require_cjs3 = __commonJS({
3557
3609
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
3558
3610
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
3559
3611
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
3612
+ checkIfSugar: () => checkIfSugar,
3560
3613
  extendizeByKey: () => extendizeByKey,
3614
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
3561
3615
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
3562
3616
  getExtendsInElement: () => getExtendsInElement,
3563
3617
  hasVariantProp: () => hasVariantProp,
@@ -3591,12 +3645,13 @@ var require_cjs3 = __commonJS({
3591
3645
  return { ...element, extend };
3592
3646
  };
3593
3647
  var checkIfSugar = (element, parent, key) => {
3648
+ var _a;
3594
3649
  const {
3595
3650
  extend,
3596
3651
  props,
3597
3652
  childExtend,
3598
3653
  extends: extendProps,
3599
- childrenExtends,
3654
+ childExtends,
3600
3655
  childProps,
3601
3656
  children,
3602
3657
  on,
@@ -3605,15 +3660,17 @@ var require_cjs3 = __commonJS({
3605
3660
  $propsCollection
3606
3661
  } = element;
3607
3662
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
3608
- if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
3609
- element.error("Sugar component includes params for builtin components");
3663
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
3664
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
3665
+ if (logErr)
3666
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
3610
3667
  }
3611
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
3668
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
3612
3669
  };
3613
3670
  var extendizeByKey = (element, parent, key) => {
3614
3671
  const { context } = parent;
3615
- const { tag, extend, childrenExtends } = element;
3616
- const isSugar = checkIfSugar(element);
3672
+ const { tag, extend, childExtends } = element;
3673
+ const isSugar = checkIfSugar(element, parent, key);
3617
3674
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
3618
3675
  const isExtendKeyComponent = context && context.components[extendFromKey];
3619
3676
  if (element === isExtendKeyComponent)
@@ -3624,8 +3681,8 @@ var require_cjs3 = __commonJS({
3624
3681
  tag,
3625
3682
  props: { ...element }
3626
3683
  });
3627
- if (childrenExtends)
3628
- newElem.childExtend = childrenExtends;
3684
+ if (childExtends)
3685
+ newElem.childExtend = childExtends;
3629
3686
  return newElem;
3630
3687
  } else if (!extend || extend === true) {
3631
3688
  return {
@@ -3654,23 +3711,24 @@ var require_cjs3 = __commonJS({
3654
3711
  const childKey = childElems[i];
3655
3712
  const childElem = element[childKey];
3656
3713
  const newChild = element.props[childKey];
3714
+ const assignChild = (val) => {
3715
+ element[childKey] = val;
3716
+ delete element.props[childKey];
3717
+ };
3657
3718
  if (newChild == null ? void 0 : newChild.ignoreExtend)
3658
3719
  continue;
3659
- if (!childElem)
3660
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
3720
+ if (newChild === null)
3721
+ assignChild(null);
3722
+ else if (!childElem)
3723
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
3661
3724
  else {
3662
- const isSugar = checkIfSugar(childElem);
3663
- if (!isSugar)
3725
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
3726
+ if (isSugarChildElem)
3664
3727
  continue;
3665
- const inheritedChildElem = element[childKey].props;
3666
- if ((0, import__.isObjectLike)(newChild)) {
3667
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
3668
- } else if ((0, import__.isFunction)(newChild)) {
3669
- element[childKey] = {
3670
- extend: element[childKey],
3671
- props: newChild
3672
- };
3673
- }
3728
+ assignChild({
3729
+ extend: element[childKey],
3730
+ props: newChild
3731
+ });
3674
3732
  }
3675
3733
  }
3676
3734
  };
@@ -4223,7 +4281,7 @@ var CONFIG = {
4223
4281
  useVariable: true,
4224
4282
  useReset: true,
4225
4283
  CSS_VARS,
4226
- ...defaultConfig_exports
4284
+ ...void 0 || defaultConfig_exports
4227
4285
  };
4228
4286
  var cachedConfig = (0, import_utils.deepClone)(CONFIG);
4229
4287
  var FACTORY = {
@@ -787,10 +787,10 @@ var require_cjs = __commonJS({
787
787
  return o;
788
788
  };
789
789
  var deepStringify = (obj, stringified = {}) => {
790
- var _a;
790
+ var _a, _b;
791
791
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
792
- console.warn("Trying to clone element or state at", obj);
793
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
792
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
793
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
794
794
  }
795
795
  for (const prop in obj) {
796
796
  const objProp = obj[prop];
@@ -860,7 +860,7 @@ var require_cjs = __commonJS({
860
860
  if ((0, import_types.isArray)(value)) {
861
861
  str += "[\n";
862
862
  for (const element of value) {
863
- if ((0, import_types.isObject)(element) && element !== null) {
863
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
864
864
  str += `${spaces} ${objectToString(element, indent + 2)},
865
865
  `;
866
866
  } else if ((0, import_types.isString)(element)) {
@@ -1424,9 +1424,11 @@ var require_cjs = __commonJS({
1424
1424
  var cookie_exports = {};
1425
1425
  __export22(cookie_exports, {
1426
1426
  getCookie: () => getCookie,
1427
+ getLocalStorage: () => getLocalStorage,
1427
1428
  isMobile: () => isMobile,
1428
1429
  removeCookie: () => removeCookie,
1429
- setCookie: () => setCookie
1430
+ setCookie: () => setCookie,
1431
+ setLocalStorage: () => setLocalStorage
1430
1432
  });
1431
1433
  module22.exports = __toCommonJS22(cookie_exports);
1432
1434
  var import_types = require_types2();
@@ -1460,6 +1462,27 @@ var require_cjs = __commonJS({
1460
1462
  return;
1461
1463
  import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
1462
1464
  };
1465
+ function getLocalStorage(key) {
1466
+ let savedJSON;
1467
+ if (window.localStorage) {
1468
+ try {
1469
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
1470
+ } catch (e) {
1471
+ }
1472
+ }
1473
+ if (typeof savedJSON !== "undefined") {
1474
+ return savedJSON;
1475
+ }
1476
+ }
1477
+ function setLocalStorage(key, data) {
1478
+ if (data && window.localStorage) {
1479
+ if (typeof data === "object") {
1480
+ window.localStorage.setItem(key, JSON.stringify(data));
1481
+ } else {
1482
+ window.localStorage.setItem(key, data);
1483
+ }
1484
+ }
1485
+ }
1463
1486
  }
1464
1487
  });
1465
1488
  var require_tags2 = __commonJS2({
@@ -1659,7 +1682,9 @@ var require_cjs = __commonJS({
1659
1682
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
1660
1683
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1661
1684
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
1685
+ checkIfSugar: () => checkIfSugar,
1662
1686
  extendizeByKey: () => extendizeByKey,
1687
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
1663
1688
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
1664
1689
  getExtendsInElement: () => getExtendsInElement,
1665
1690
  hasVariantProp: () => hasVariantProp,
@@ -1693,12 +1718,13 @@ var require_cjs = __commonJS({
1693
1718
  return { ...element, extend };
1694
1719
  };
1695
1720
  var checkIfSugar = (element, parent, key) => {
1721
+ var _a;
1696
1722
  const {
1697
1723
  extend,
1698
1724
  props,
1699
1725
  childExtend,
1700
1726
  extends: extendProps,
1701
- childrenExtends,
1727
+ childExtends,
1702
1728
  childProps,
1703
1729
  children,
1704
1730
  on,
@@ -1707,15 +1733,17 @@ var require_cjs = __commonJS({
1707
1733
  $propsCollection
1708
1734
  } = element;
1709
1735
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
1710
- if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
1711
- element.error("Sugar component includes params for builtin components");
1736
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
1737
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
1738
+ if (logErr)
1739
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
1712
1740
  }
1713
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
1741
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
1714
1742
  };
1715
1743
  var extendizeByKey = (element, parent, key) => {
1716
1744
  const { context } = parent;
1717
- const { tag, extend, childrenExtends } = element;
1718
- const isSugar = checkIfSugar(element);
1745
+ const { tag, extend, childExtends } = element;
1746
+ const isSugar = checkIfSugar(element, parent, key);
1719
1747
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
1720
1748
  const isExtendKeyComponent = context && context.components[extendFromKey];
1721
1749
  if (element === isExtendKeyComponent)
@@ -1726,8 +1754,8 @@ var require_cjs = __commonJS({
1726
1754
  tag,
1727
1755
  props: { ...element }
1728
1756
  });
1729
- if (childrenExtends)
1730
- newElem.childExtend = childrenExtends;
1757
+ if (childExtends)
1758
+ newElem.childExtend = childExtends;
1731
1759
  return newElem;
1732
1760
  } else if (!extend || extend === true) {
1733
1761
  return {
@@ -1756,23 +1784,24 @@ var require_cjs = __commonJS({
1756
1784
  const childKey = childElems[i];
1757
1785
  const childElem = element[childKey];
1758
1786
  const newChild = element.props[childKey];
1787
+ const assignChild = (val) => {
1788
+ element[childKey] = val;
1789
+ delete element.props[childKey];
1790
+ };
1759
1791
  if (newChild == null ? void 0 : newChild.ignoreExtend)
1760
1792
  continue;
1761
- if (!childElem)
1762
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
1793
+ if (newChild === null)
1794
+ assignChild(null);
1795
+ else if (!childElem)
1796
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
1763
1797
  else {
1764
- const isSugar = checkIfSugar(childElem);
1765
- if (!isSugar)
1798
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
1799
+ if (isSugarChildElem)
1766
1800
  continue;
1767
- const inheritedChildElem = element[childKey].props;
1768
- if ((0, import__.isObjectLike)(newChild)) {
1769
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
1770
- } else if ((0, import__.isFunction)(newChild)) {
1771
- element[childKey] = {
1772
- extend: element[childKey],
1773
- props: newChild
1774
- };
1775
- }
1801
+ assignChild({
1802
+ extend: element[childKey],
1803
+ props: newChild
1804
+ });
1776
1805
  }
1777
1806
  }
1778
1807
  };
@@ -2847,10 +2876,10 @@ var require_object = __commonJS({
2847
2876
  return o;
2848
2877
  };
2849
2878
  var deepStringify = (obj, stringified = {}) => {
2850
- var _a;
2879
+ var _a, _b;
2851
2880
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
2852
- console.warn("Trying to clone element or state at", obj);
2853
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
2881
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
2882
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
2854
2883
  }
2855
2884
  for (const prop in obj) {
2856
2885
  const objProp = obj[prop];
@@ -2920,7 +2949,7 @@ var require_object = __commonJS({
2920
2949
  if ((0, import_types.isArray)(value)) {
2921
2950
  str += "[\n";
2922
2951
  for (const element of value) {
2923
- if ((0, import_types.isObject)(element) && element !== null) {
2952
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
2924
2953
  str += `${spaces} ${objectToString(element, indent + 2)},
2925
2954
  `;
2926
2955
  } else if ((0, import_types.isString)(element)) {
@@ -3490,9 +3519,11 @@ var require_cookie = __commonJS({
3490
3519
  var cookie_exports = {};
3491
3520
  __export2(cookie_exports, {
3492
3521
  getCookie: () => getCookie,
3522
+ getLocalStorage: () => getLocalStorage,
3493
3523
  isMobile: () => isMobile,
3494
3524
  removeCookie: () => removeCookie,
3495
- setCookie: () => setCookie
3525
+ setCookie: () => setCookie,
3526
+ setLocalStorage: () => setLocalStorage
3496
3527
  });
3497
3528
  module2.exports = __toCommonJS2(cookie_exports);
3498
3529
  var import_types = require_types();
@@ -3526,6 +3557,27 @@ var require_cookie = __commonJS({
3526
3557
  return;
3527
3558
  import_utils10.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
3528
3559
  };
3560
+ function getLocalStorage(key) {
3561
+ let savedJSON;
3562
+ if (window.localStorage) {
3563
+ try {
3564
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
3565
+ } catch (e) {
3566
+ }
3567
+ }
3568
+ if (typeof savedJSON !== "undefined") {
3569
+ return savedJSON;
3570
+ }
3571
+ }
3572
+ function setLocalStorage(key, data) {
3573
+ if (data && window.localStorage) {
3574
+ if (typeof data === "object") {
3575
+ window.localStorage.setItem(key, JSON.stringify(data));
3576
+ } else {
3577
+ window.localStorage.setItem(key, data);
3578
+ }
3579
+ }
3580
+ }
3529
3581
  }
3530
3582
  });
3531
3583
 
@@ -3729,7 +3781,9 @@ var require_component = __commonJS({
3729
3781
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
3730
3782
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
3731
3783
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
3784
+ checkIfSugar: () => checkIfSugar,
3732
3785
  extendizeByKey: () => extendizeByKey,
3786
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
3733
3787
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
3734
3788
  getExtendsInElement: () => getExtendsInElement,
3735
3789
  hasVariantProp: () => hasVariantProp,
@@ -3763,12 +3817,13 @@ var require_component = __commonJS({
3763
3817
  return { ...element, extend };
3764
3818
  };
3765
3819
  var checkIfSugar = (element, parent, key) => {
3820
+ var _a;
3766
3821
  const {
3767
3822
  extend,
3768
3823
  props,
3769
3824
  childExtend,
3770
3825
  extends: extendProps,
3771
- childrenExtends,
3826
+ childExtends,
3772
3827
  childProps,
3773
3828
  children,
3774
3829
  on,
@@ -3777,15 +3832,17 @@ var require_component = __commonJS({
3777
3832
  $propsCollection
3778
3833
  } = element;
3779
3834
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
3780
- if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
3781
- element.error("Sugar component includes params for builtin components");
3835
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
3836
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
3837
+ if (logErr)
3838
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
3782
3839
  }
3783
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
3840
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
3784
3841
  };
3785
3842
  var extendizeByKey = (element, parent, key) => {
3786
3843
  const { context } = parent;
3787
- const { tag, extend, childrenExtends } = element;
3788
- const isSugar = checkIfSugar(element);
3844
+ const { tag, extend, childExtends } = element;
3845
+ const isSugar = checkIfSugar(element, parent, key);
3789
3846
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
3790
3847
  const isExtendKeyComponent = context && context.components[extendFromKey];
3791
3848
  if (element === isExtendKeyComponent)
@@ -3796,8 +3853,8 @@ var require_component = __commonJS({
3796
3853
  tag,
3797
3854
  props: { ...element }
3798
3855
  });
3799
- if (childrenExtends)
3800
- newElem.childExtend = childrenExtends;
3856
+ if (childExtends)
3857
+ newElem.childExtend = childExtends;
3801
3858
  return newElem;
3802
3859
  } else if (!extend || extend === true) {
3803
3860
  return {
@@ -3826,23 +3883,24 @@ var require_component = __commonJS({
3826
3883
  const childKey = childElems[i];
3827
3884
  const childElem = element[childKey];
3828
3885
  const newChild = element.props[childKey];
3886
+ const assignChild = (val) => {
3887
+ element[childKey] = val;
3888
+ delete element.props[childKey];
3889
+ };
3829
3890
  if (newChild == null ? void 0 : newChild.ignoreExtend)
3830
3891
  continue;
3831
- if (!childElem)
3832
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
3892
+ if (newChild === null)
3893
+ assignChild(null);
3894
+ else if (!childElem)
3895
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
3833
3896
  else {
3834
- const isSugar = checkIfSugar(childElem);
3835
- if (!isSugar)
3897
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
3898
+ if (isSugarChildElem)
3836
3899
  continue;
3837
- const inheritedChildElem = element[childKey].props;
3838
- if ((0, import__.isObjectLike)(newChild)) {
3839
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
3840
- } else if ((0, import__.isFunction)(newChild)) {
3841
- element[childKey] = {
3842
- extend: element[childKey],
3843
- props: newChild
3844
- };
3845
- }
3900
+ assignChild({
3901
+ extend: element[childKey],
3902
+ props: newChild
3903
+ });
3846
3904
  }
3847
3905
  }
3848
3906
  };
@@ -4226,7 +4284,7 @@ var CONFIG = {
4226
4284
  useVariable: true,
4227
4285
  useReset: true,
4228
4286
  CSS_VARS,
4229
- ...defaultConfig_exports
4287
+ ...void 0 || defaultConfig_exports
4230
4288
  };
4231
4289
  var cachedConfig = (0, import_utils.deepClone)(CONFIG);
4232
4290
  var FACTORY = {