@useinsider/guido 3.15.0 → 3.16.0-beta.089654a

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 (90) hide show
  1. package/dist/@types/config/schemas.js +108 -92
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +78 -75
  4. package/dist/composables/useActionsApi.js +30 -22
  5. package/dist/composables/useEmailTemplateApplier.js +25 -23
  6. package/dist/composables/useHtmlValidator.js +108 -106
  7. package/dist/composables/useRecommendation.js +20 -19
  8. package/dist/composables/useTimerClone.js +21 -19
  9. package/dist/config/i18n/en/labels.json.js +7 -3
  10. package/dist/config/migrator/checkboxMigrator.js +20 -19
  11. package/dist/config/migrator/itemsBlockMigrator.js +1 -1
  12. package/dist/config/migrator/radioButtonMigrator.js +26 -25
  13. package/dist/config/migrator/recommendation/compositionMapper.js +26 -23
  14. package/dist/config/migrator/recommendation/htmlBuilder.js +156 -155
  15. package/dist/enums/recommendation.js +17 -17
  16. package/dist/extensions/Blocks/Checkbox/constants/controlIds.js +4 -0
  17. package/dist/extensions/Blocks/Checkbox/constants/selectors.js +6 -0
  18. package/dist/extensions/Blocks/Checkbox/controls/blockBackground/index.js +10 -0
  19. package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
  20. package/dist/extensions/Blocks/Checkbox/settingsPanel.js +15 -14
  21. package/dist/extensions/Blocks/Checkbox/template.js +10 -9
  22. package/dist/extensions/Blocks/Items/block.js +44 -42
  23. package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
  24. package/dist/extensions/Blocks/Items/template.js +86 -86
  25. package/dist/extensions/Blocks/RadioButton/constants/controlIds.js +4 -0
  26. package/dist/extensions/Blocks/RadioButton/constants/selectors.js +6 -0
  27. package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +10 -0
  28. package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
  29. package/dist/extensions/Blocks/RadioButton/settingsPanel.js +12 -11
  30. package/dist/extensions/Blocks/RadioButton/template.js +16 -9
  31. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +18 -15
  32. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +5 -9
  33. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +363 -322
  34. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
  35. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +21 -21
  36. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +8 -8
  37. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +271 -231
  38. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +98 -113
  39. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +21 -0
  40. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -12
  41. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +16 -16
  42. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +16 -16
  43. package/dist/extensions/Blocks/Recommendation/templates/utils.js +120 -120
  44. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +55 -54
  45. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +89 -0
  46. package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
  47. package/dist/extensions/Blocks/common-control.js +42 -35
  48. package/dist/extensions/Blocks/controlFactories.js +117 -115
  49. package/dist/guido.css +1 -1
  50. package/dist/library.js +11 -7
  51. package/dist/node_modules/valibot/dist/index.js +230 -216
  52. package/dist/package.json.js +1 -1
  53. package/dist/public/trackingIds.js +8 -0
  54. package/dist/src/@types/config/schemas.d.ts +20 -0
  55. package/dist/src/composables/useActionsApi.d.ts +1 -1
  56. package/dist/src/composables/useConfig.d.ts +4 -0
  57. package/dist/src/composables/useHtmlValidator.d.ts +3 -2
  58. package/dist/src/config/migrator/recommendation/types.d.ts +1 -0
  59. package/dist/src/extensions/Blocks/Checkbox/constants/controlIds.d.ts +7 -0
  60. package/dist/src/extensions/Blocks/Checkbox/constants/index.d.ts +10 -0
  61. package/dist/src/extensions/Blocks/Checkbox/constants/selectors.d.ts +16 -0
  62. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +14 -0
  63. package/dist/src/extensions/Blocks/RadioButton/constants/controlIds.d.ts +7 -0
  64. package/dist/src/extensions/Blocks/RadioButton/constants/index.d.ts +10 -0
  65. package/dist/src/extensions/Blocks/RadioButton/constants/selectors.d.ts +16 -0
  66. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +14 -0
  67. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  68. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +6 -0
  69. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +27 -5
  70. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
  71. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -0
  72. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -11
  73. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +47 -0
  74. package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
  75. package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
  76. package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
  77. package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
  78. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +14 -0
  79. package/dist/src/extensions/Blocks/common-control.d.ts +3 -1
  80. package/dist/src/library.d.ts +1 -0
  81. package/dist/src/public/trackingIds.d.ts +9 -0
  82. package/dist/src/stores/config.d.ts +36 -0
  83. package/dist/src/stores/editor.d.ts +25 -0
  84. package/dist/src/utils/linkTrackingIds.d.ts +30 -0
  85. package/dist/stores/editor.js +4 -1
  86. package/dist/stores/onboarding.js +11 -7
  87. package/dist/utils/linkTrackingIds.js +56 -0
  88. package/dist/utils/pairProductVariables.js +105 -99
  89. package/dist/utils/templatePreparation.js +72 -61
  90. package/package.json +6 -2
@@ -1,11 +1,11 @@
1
1
  import { useActionsApi as f } from "./useActionsApi.js";
2
- import { useHttp as w } from "./useHttp.js";
3
- import { useToaster as H } from "./useToaster.js";
4
- import { useStripoApi as y } from "../services/stripoApi.js";
5
- const O = () => {
6
- const { handleError: c } = H(), { getToken: u } = y(), { post: d } = w(), { updateHtmlAndCss: l } = f(), s = (t) => /esd-timer-id="(\d+)"/.test(t), i = async (t, e) => {
2
+ import { useHttp as H } from "./useHttp.js";
3
+ import { useToaster as h } from "./useToaster.js";
4
+ import { useStripoApi as k } from "../services/stripoApi.js";
5
+ const S = () => {
6
+ const { handleError: c } = h(), { getToken: l } = k(), { post: p } = H(), { updateHtmlAndCss: u } = f(), s = (t) => /esd-timer-id="(\d+)"/.test(t), i = async (t, e) => {
7
7
  try {
8
- return (await d(
8
+ return (await p(
9
9
  "https://plugins.stripo.email/api/v1/timers/clone",
10
10
  { html: t },
11
11
  {
@@ -25,29 +25,31 @@ const O = () => {
25
25
  cloneTimersOnSave: async (t) => {
26
26
  if (!s(t))
27
27
  return t;
28
- const e = await u();
28
+ const e = await l();
29
29
  return e && await i(t, e) || t;
30
30
  },
31
31
  updateTimersOnLoad: async (t) => {
32
- var e, r, o, m;
32
+ var e, r, n, d;
33
33
  try {
34
- const n = (r = (e = window.UIEditor) == null ? void 0 : e.getHtml) == null ? void 0 : r.call(e);
35
- if (!n || !s(n))
34
+ const o = (r = (e = window.UIEditor) == null ? void 0 : e.getHtml) == null ? void 0 : r.call(e);
35
+ if (!o || !s(o))
36
36
  return;
37
- const p = await t();
38
- if (!p)
37
+ const m = await t();
38
+ if (!m)
39
39
  return;
40
- const a = await i(n, p);
41
- if (!a || a === n)
40
+ const a = await i(o, m);
41
+ if (!a || a === o)
42
42
  return;
43
- const T = ((m = (o = window.UIEditor) == null ? void 0 : o.getCss) == null ? void 0 : m.call(o)) || "";
44
- l(a, T);
45
- } catch (n) {
46
- c(n, "Failed to update timer blocks");
43
+ const T = ((d = (n = window.UIEditor) == null ? void 0 : n.getCss) == null ? void 0 : d.call(n)) || "";
44
+ u(a, T).catch((w) => {
45
+ console.warn("Editor did not acknowledge the timer-block update.", w);
46
+ });
47
+ } catch (o) {
48
+ c(o, "Failed to update timer blocks");
47
49
  }
48
50
  }
49
51
  };
50
52
  };
51
53
  export {
52
- O as useTimerClone
54
+ S as useTimerClone
53
55
  };
@@ -1,4 +1,4 @@
1
- const e = "Items", o = {
1
+ const e = "Items", o = "Default", t = "Custom", s = {
2
2
  "Global Styles & Layout": "Global Styles and Layout",
3
3
  "Structures & Modules": "Structures and Modules",
4
4
  "Recommendation Block": "Recommendation",
@@ -7,9 +7,13 @@ const e = "Items", o = {
7
7
  "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.",
8
8
  "Pixel Tracking Opt-in": "Pixel Tracking Opt-in",
9
9
  "OPT-IN SELECTION": "OPT-IN SELECTION",
10
- "UNSUBSCRIBE GROUPS": "UNSUBSCRIBE GROUPS"
10
+ "UNSUBSCRIBE GROUPS": "UNSUBSCRIBE GROUPS",
11
+ Default: o,
12
+ Custom: t
11
13
  };
12
14
  export {
15
+ t as Custom,
16
+ o as Default,
13
17
  e as Items,
14
- o as default
18
+ s as default
15
19
  };
@@ -1,36 +1,37 @@
1
- var h = Object.defineProperty;
2
- var g = (r, t, e) => t in r ? h(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var l = (r, t, e) => g(r, typeof t != "symbol" ? t + "" : t, e);
4
- import f from "../../extensions/Blocks/Checkbox/template.js";
5
- import { extractTextFromElement as m, buildTextBlock as p } from "./textBlockMigration.js";
6
- class C {
1
+ var g = Object.defineProperty;
2
+ var x = (r, t, e) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var m = (r, t, e) => x(r, typeof t != "symbol" ? t + "" : t, e);
4
+ import { CSS_CLASS_CHECKBOX_BLOCK as b, CSS_CLASS_CHECKBOX_BLOCK_V2 as T, BLOCK_ROOT_SELECTOR as f } from "../../extensions/Blocks/Checkbox/constants/selectors.js";
5
+ import h from "../../extensions/Blocks/Checkbox/template.js";
6
+ import { extractTextFromElement as p, buildTextBlock as C } from "./textBlockMigration.js";
7
+ class O {
7
8
  constructor() {
8
- l(this, "parser");
9
+ m(this, "parser");
9
10
  this.parser = new DOMParser();
10
11
  }
11
12
  migrate(t) {
12
13
  try {
13
- const e = this.parser.parseFromString(t, "text/html"), n = e.querySelectorAll("td.checkbox-block");
14
- if (n.length === 0)
14
+ const e = this.parser.parseFromString(t, "text/html"), i = e.querySelectorAll(`td.${b}`);
15
+ if (i.length === 0)
15
16
  return t;
16
- let i = !1;
17
- return n.forEach((o) => {
18
- if (o.classList.contains("checkbox-block-v2"))
17
+ let s = !1;
18
+ return i.forEach((o) => {
19
+ if (o.classList.contains(T))
19
20
  return;
20
- const b = o.getAttribute("id"), s = m(o, "ins-title"), a = m(o, "ins-description"), u = p(s, s.containerClass), x = p(a, a.containerClass), d = f.replace("{-{-TITLE-}-}", u).replace("{-{-DESCRIPTION-}-}", x), c = this.parser.parseFromString(
21
+ const l = o.getAttribute("id"), c = p(o, "ins-title"), a = p(o, "ins-description"), u = C(c, c.containerClass), S = C(a, a.containerClass), d = h.replace("{-{-TITLE-}-}", u).replace("{-{-DESCRIPTION-}-}", S), n = this.parser.parseFromString(
21
22
  `<table id="tempDoc"><tbody><tr>${d}</tr></tbody></table>`,
22
23
  "text/html"
23
- ).querySelector(".checkbox-block-v2");
24
- c && o.parentNode && (c.setAttribute("id", b || ""), o.parentNode.replaceChild(c, o), i = !0);
25
- }), i ? e.documentElement.outerHTML : t;
24
+ ).querySelector(f);
25
+ n && o.parentNode && (n.setAttribute("id", l || ""), o.parentNode.replaceChild(n, o), s = !0);
26
+ }), s ? e.documentElement.outerHTML : t;
26
27
  } catch (e) {
27
28
  return console.error("CheckboxMigrator failed:", e), t;
28
29
  }
29
30
  }
30
31
  }
31
- function E(r) {
32
- return new C().migrate(r);
32
+ function D(r) {
33
+ return new O().migrate(r);
33
34
  }
34
35
  export {
35
- E as migrateCheckbox
36
+ D as migrateCheckbox
36
37
  };
@@ -381,7 +381,7 @@ class H {
381
381
  * Supports all block types by detecting prefix and using appropriate type:
382
382
  *
383
383
  * Examples:
384
- * - {{ins_apr_img_1}} → https://s3.../img_1.jpeg (CART_ITEMS)
384
+ * - {{ins_apr_img_1}} → https://web-image.useinsider.com/.../img_1.jpeg (CART_ITEMS)
385
385
  * - {{browsed_item_name_2}} → 'Set of Sprite Yoga Straps' (BROWSED_ITEMS)
386
386
  * - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
387
387
  */
@@ -1,53 +1,54 @@
1
- var q = Object.defineProperty;
2
- var C = (o, t, e) => t in o ? q(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var g = (o, t, e) => C(o, typeof t != "symbol" ? t + "" : t, e);
1
+ var R = Object.defineProperty;
2
+ var b = (n, t, e) => t in n ? R(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var g = (n, t, e) => b(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import { CSS_CLASS_RADIO_BUTTON_BLOCK as C, CSS_CLASS_RADIO_BUTTON_BLOCK_V2 as T, BLOCK_ROOT_SELECTOR as A } from "../../extensions/Blocks/RadioButton/constants/selectors.js";
4
5
  import N from "../../extensions/Blocks/RadioButton/template.js";
5
- import { extractTextFromElement as b, buildTextBlock as f } from "./textBlockMigration.js";
6
- class R {
6
+ import { extractTextFromElement as S, buildTextBlock as f } from "./textBlockMigration.js";
7
+ class _ {
7
8
  constructor() {
8
9
  g(this, "parser");
9
10
  this.parser = new DOMParser();
10
11
  }
11
12
  migrate(t) {
12
13
  try {
13
- const e = this.parser.parseFromString(t, "text/html"), n = e.querySelectorAll("td.radio-button-block"), a = e.querySelectorAll("td.radio-button-v2");
14
- if (n.length === 0 && a.length === 0)
14
+ const e = this.parser.parseFromString(t, "text/html"), o = e.querySelectorAll(`td.${C}`), a = e.querySelectorAll(`td.${T}`);
15
+ if (o.length === 0 && a.length === 0)
15
16
  return t;
16
- let i = !1;
17
- return n.forEach((r) => {
18
- if (r.classList.contains("radio-button-v2"))
17
+ let s = !1;
18
+ return o.forEach((r) => {
19
+ if (r.classList.contains(T))
19
20
  return;
20
- const s = r.getAttribute("id"), c = b(r, "ins-title"), d = b(r, "ins-description"), u = b(r, "ins-subscribe"), l = b(r, "ins-unsubscribe"), p = f(c, c.containerClass), m = f(d, d.containerClass), h = f(u), S = f(l), T = N.replace("{-{-TITLE-}-}", p).replace("{-{-DESCRIPTION-}-}", m).replace("{-{-YES-}-}", h).replace("{-{-NO-}-}", S), y = this.parser.parseFromString(
21
- `<table id="tempDoc"><tbody><tr>${T}</tr></tbody></table>`,
21
+ const i = r.getAttribute("id"), c = S(r, "ins-title"), p = S(r, "ins-description"), l = S(r, "ins-subscribe"), u = S(r, "ins-unsubscribe"), d = f(c, c.containerClass), m = f(p, p.containerClass), h = f(l), L = f(u), O = N.replace("{-{-TITLE-}-}", d).replace("{-{-DESCRIPTION-}-}", m).replace("{-{-YES-}-}", h).replace("{-{-NO-}-}", L), y = this.parser.parseFromString(
22
+ `<table id="tempDoc"><tbody><tr>${O}</tr></tbody></table>`,
22
23
  "text/html"
23
- ).querySelector(".radio-button-v2");
24
- y && r.parentNode && (y.setAttribute("id", s || ""), r.parentNode.replaceChild(y, r), i = !0);
25
- }), i = this.healRadioButtonV2(e) || i, i ? e.documentElement.outerHTML : t;
24
+ ).querySelector(A);
25
+ y && r.parentNode && (y.setAttribute("id", i || ""), r.parentNode.replaceChild(y, r), s = !0);
26
+ }), s = this.healRadioButtonV2(e) || s, s ? e.documentElement.outerHTML : t;
26
27
  } catch (e) {
27
28
  return console.error("RadioButtonMigrator failed:", e), t;
28
29
  }
29
30
  }
30
31
  healRadioButtonV2(t) {
31
32
  let e = !1;
32
- return t.querySelectorAll("td.radio-button-v2").forEach((n) => {
33
+ return t.querySelectorAll(`td.${T}`).forEach((o) => {
33
34
  var m;
34
- n.classList.contains("radio-button-block") || (n.classList.add("radio-button-block"), e = !0);
35
- const a = n.querySelector("input#radioYes"), i = n.querySelector("input#radioNo");
36
- if (!a || !i)
35
+ o.classList.contains(C) || (o.classList.add(C), e = !0);
36
+ const a = o.querySelector("input#radioYes"), s = o.querySelector("input#radioNo");
37
+ if (!a || !s)
37
38
  return;
38
39
  const r = ((m = a.parentElement) == null ? void 0 : m.querySelector(":scope > p")) || null;
39
40
  if (!r && !a.hasAttribute("align"))
40
41
  return;
41
- const s = a.closest("tr"), c = i.closest("tr");
42
- if (!s || !c || s === c || !s.parentNode)
42
+ const i = a.closest("tr"), c = s.closest("tr");
43
+ if (!i || !c || i === c || !i.parentNode)
43
44
  return;
44
- const d = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", u = c.cloneNode(!0), l = u.querySelector("input#radioNo"), p = u.querySelector("p");
45
- l && (l.setAttribute("id", "radioYes"), l.removeAttribute("align")), p && (p.innerHTML = d), s.parentNode.replaceChild(u, s), e = !0;
45
+ const p = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", l = c.cloneNode(!0), u = l.querySelector("input#radioNo"), d = l.querySelector("p");
46
+ u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")), d && (d.innerHTML = p), i.parentNode.replaceChild(l, i), e = !0;
46
47
  }), e;
47
48
  }
48
49
  }
49
- function w(o) {
50
- return new R().migrate(o);
50
+ function w(n) {
51
+ return new _().migrate(n);
51
52
  }
52
53
  export {
53
54
  w as migrateRadioButton
@@ -1,4 +1,4 @@
1
- import { DEFAULT_COMPOSITION as d, DEFAULT_VISIBILITY as I } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
1
+ import { DEFAULT_COMPOSITION as p, DEFAULT_VISIBILITY as I } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
2
  import { ATTR_CUSTOM_PREFIX as l, ATTR_PRODUCT_BUTTON as k, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_OMNIBUS_PRICE as x, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as R, ATTR_PRODUCT_NAME as h, ATTR_PRODUCT_IMAGE as y } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
3
  import { mapTextTheme as E, mapButtonTheme as O, mapImageTheme as b } from "./themeMapper.js";
4
4
  const C = "__title__", a = "product_attribute.";
@@ -23,19 +23,22 @@ function N(r) {
23
23
  return { key: k, kind: "button" };
24
24
  default:
25
25
  if (r.variableType === "p_attribute" || t.startsWith("p_attribute_")) {
26
- const s = r.value ?? "", o = s.startsWith(a) ? s.slice(a.length) : s;
27
- return o ? {
28
- key: `${l}${o}`,
26
+ const o = r.value ?? "", s = o.startsWith(a) ? o.slice(a.length) : o;
27
+ if (!s)
28
+ return null;
29
+ const e = o || `${a}${s}`;
30
+ return {
31
+ key: `${l}${e}`,
29
32
  kind: "custom",
30
- customAttrName: o,
31
- customAttrValue: s || `${a}${o}`
32
- } : null;
33
+ customAttrName: s,
34
+ customAttrValue: e
35
+ };
33
36
  }
34
37
  return null;
35
38
  }
36
39
  }
37
- function p(r) {
38
- const t = d.indexOf(r);
40
+ function _(r) {
41
+ const t = p.indexOf(r);
39
42
  return t === -1 ? Number.POSITIVE_INFINITY : t;
40
43
  }
41
44
  function S(r) {
@@ -48,8 +51,8 @@ function S(r) {
48
51
  anyTextTrimming: !1
49
52
  };
50
53
  if (!r || r.length === 0)
51
- return t.composition = [...d], t;
52
- const s = [];
54
+ return t.composition = [...p], t;
55
+ const o = [];
53
56
  r.forEach((e, i) => {
54
57
  const n = N(e);
55
58
  if (n) {
@@ -57,7 +60,7 @@ function S(r) {
57
60
  t.titleVariable = e;
58
61
  return;
59
62
  }
60
- s.push({
63
+ o.push({
61
64
  key: n.key,
62
65
  kind: n.kind,
63
66
  hidden: e.hidden === !0,
@@ -68,30 +71,30 @@ function S(r) {
68
71
  originalIndex: i
69
72
  });
70
73
  }
71
- }), s.sort((e, i) => {
74
+ }), o.sort((e, i) => {
72
75
  if (e.positionIdx !== i.positionIdx)
73
76
  return e.positionIdx - i.positionIdx;
74
- const n = p(e.key), u = p(i.key);
77
+ const n = _(e.key), u = _(i.key);
75
78
  return n !== u ? n - u : e.originalIndex - i.originalIndex;
76
79
  });
77
- const o = {};
78
- return s.forEach((e) => {
79
- const { key: i, kind: n, hidden: u, legacy: m, customAttrName: c, customAttrValue: T } = e;
80
- switch (t.composition.push(i), t.visibility[i] = !u, n === "custom" && c && T && (t.customAttributes.includes(c) || t.customAttributes.push(c), t.customAttrValues[i] = T), n) {
80
+ const s = {};
81
+ return o.forEach((e) => {
82
+ const { key: i, kind: n, hidden: u, legacy: c, customAttrName: d, customAttrValue: m } = e;
83
+ switch (t.composition.push(i), t.visibility[i] = !u, n === "custom" && d && m && (t.customAttributes.includes(m) || t.customAttributes.push(m), t.customAttrValues[i] = m), n) {
81
84
  case "image":
82
- o[i] = b(m.theme);
85
+ s[i] = b(c.theme);
83
86
  break;
84
87
  case "button":
85
- o[i] = O(m.theme);
88
+ s[i] = O(c.theme);
86
89
  break;
87
90
  case "text":
88
91
  case "custom": {
89
- const _ = E(m.theme);
90
- o[i] = _, _.textTrimming && (t.anyTextTrimming = !0);
92
+ const T = E(c.theme);
93
+ s[i] = T, T.textTrimming && (t.anyTextTrimming = !0);
91
94
  break;
92
95
  }
93
96
  }
94
- }), t.perElementStyles = o, t;
97
+ }), t.perElementStyles = s, t;
95
98
  }
96
99
  export {
97
100
  S as mapComposition