@useinsider/guido 3.20.0-beta.e801a3b → 3.20.1-beta.04cd240

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 (75) hide show
  1. package/dist/composables/useLegacyStrategyConversion.js +16 -16
  2. package/dist/composables/useStripo.js +11 -10
  3. package/dist/composables/useVersionHistoryApi.js +42 -37
  4. package/dist/config/compiler/itemsCompilerRules.js +21 -5
  5. package/dist/config/compiler/utils/itemsCompilerUtils.js +64 -17
  6. package/dist/config/migrator/itemsBlockMigrator.js +112 -108
  7. package/dist/extensions/Blocks/Items/block.js +76 -64
  8. package/dist/extensions/Blocks/Items/constants/cardWidth.js +20 -0
  9. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +1 -1
  10. package/dist/extensions/Blocks/Recommendation/block.js +60 -49
  11. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +152 -150
  12. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +1 -2
  13. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +102 -78
  14. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +313 -210
  15. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +15 -13
  16. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +17 -12
  17. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +92 -84
  18. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +219 -193
  19. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +23 -18
  20. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +1 -2
  21. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +6 -6
  22. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +12 -9
  23. package/dist/extensions/Blocks/Recommendation/extension.js +4 -2
  24. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -2
  25. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +240 -190
  26. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
  27. package/dist/extensions/Blocks/Recommendation/utils/blockUrlConfig.js +25 -0
  28. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +1 -1
  29. package/dist/extensions/Blocks/Recommendation/utils/followUpApply.js +34 -0
  30. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +73 -28
  31. package/dist/extensions/Blocks/Recommendation/utils/restoreRefresh.js +36 -0
  32. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +39 -20
  33. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +271 -192
  34. package/dist/package.json.js +1 -1
  35. package/dist/src/config/compiler/utils/itemsCompilerUtils.d.ts +10 -0
  36. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
  37. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
  38. package/dist/src/extensions/Blocks/Items/block.d.ts +5 -0
  39. package/dist/src/extensions/Blocks/Items/constants/cardWidth.d.ts +12 -0
  40. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
  41. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
  42. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +3 -0
  43. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
  44. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
  45. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
  46. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
  47. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +3 -0
  48. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +22 -3
  49. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +1 -18
  50. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +8 -0
  51. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +10 -6
  52. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
  53. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
  54. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
  55. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
  56. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +2 -3
  58. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +1 -1
  59. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
  60. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +28 -6
  61. package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +19 -0
  62. package/dist/src/extensions/Blocks/Recommendation/utils/blockUrlConfig.d.ts +4 -0
  63. package/dist/src/extensions/Blocks/Recommendation/utils/followUpApply.d.ts +20 -0
  64. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +15 -2
  65. package/dist/src/extensions/Blocks/Recommendation/utils/restoreRefresh.d.ts +2 -0
  66. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +7 -0
  67. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
  68. package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
  69. package/dist/src/stores/editor.d.ts +3 -1
  70. package/dist/src/utils/liquidProtection.d.ts +3 -0
  71. package/dist/static/styles/components/button.css.js +5 -0
  72. package/dist/stores/editor.js +5 -0
  73. package/dist/utils/liquidProtection.js +5 -0
  74. package/dist/utils/templatePreparation.js +61 -85
  75. package/package.json +3 -3
@@ -1,34 +1,34 @@
1
- import { useRecommendation as C } from "./useRecommendation.js";
1
+ import { useRecommendation as S } from "./useRecommendation.js";
2
2
  import { useToaster as I } from "./useToaster.js";
3
3
  import { useTranslations as v } from "./useTranslations.js";
4
4
  import { ToasterTypeOptions as g } from "../enums/toaster.js";
5
5
  import "../extensions/Blocks/Recommendation/constants/selectors.js";
6
6
  import { CURRENT_CONFIG_VERSION as L } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
7
- import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
- import { resolveMigrationTarget as k, buildLegacyMigrationPayload as R } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
7
+ import { useRecommendationExtensionStore as R } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
+ import { resolveMigrationTarget as b, buildLegacyMigrationPayload as k } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
9
9
  import { commitBlockChangeOutsidePanel as T } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
10
10
  import { useConfigStore as h } from "../stores/config.js";
11
11
  const F = () => {
12
- const e = b(), r = h(), { buildCampaignUrl: m } = C(), { showToaster: c } = I(), a = v();
12
+ const e = R(), o = h(), { buildCampaignUrl: m } = S(), { showToaster: c } = I(), a = v();
13
13
  return { convertLegacyStrategy: async () => {
14
14
  const t = e.currentRecommendationId;
15
15
  if (t === null || !e.isLegacyStrategyBlock || e.legacyConversionLoading)
16
16
  return "";
17
- const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s = k({
18
- campaignId: r.campaignId,
19
- templateLibraryId: r.templateLibraryId
20
- }), S = R({
17
+ const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s = b({
18
+ campaignId: o.campaignId,
19
+ templateLibraryId: o.templateLibraryId
20
+ }), C = k({
21
21
  blockId: t,
22
22
  url: m(String(t)),
23
- campaignId: r.campaignId,
24
- variationId: r.variationId,
23
+ campaignId: o.campaignId,
24
+ variationId: o.variationId,
25
25
  strategy: d,
26
26
  productIds: y,
27
27
  target: s
28
28
  });
29
- let o;
29
+ let r;
30
30
  try {
31
- o = await e.convertLegacyStrategy(S, s);
31
+ r = await e.convertLegacyStrategy(C, s);
32
32
  } catch (i) {
33
33
  return console.error("[useLegacyStrategyConversion] migration failed", i), c({
34
34
  type: g.Error,
@@ -40,7 +40,7 @@ const F = () => {
40
40
  }), "";
41
41
  }
42
42
  try {
43
- await e.fetchStrategyProductsForBlock(t);
43
+ await e.fetchRecommendationProductsForBlock(t);
44
44
  } catch (i) {
45
45
  console.error("[useLegacyStrategyConversion] product refetch failed", i);
46
46
  }
@@ -48,16 +48,16 @@ const F = () => {
48
48
  return n ? T(
49
49
  t,
50
50
  {
51
- strategyId: o,
51
+ strategyId: r,
52
52
  size: n.recommendationConfigs.size,
53
53
  configVersion: L
54
54
  },
55
55
  n.recommendationProducts,
56
56
  "Converted legacy recommendation strategy"
57
- ) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), o) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f), c({
57
+ ) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), r) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f), c({
58
58
  type: g.Error,
59
59
  message: a("email-editor.legacy-strategy-update-failed")
60
- }), "") : o;
60
+ }), "") : r;
61
61
  } };
62
62
  };
63
63
  export {
@@ -1,5 +1,5 @@
1
- import { useActionsApi as L } from "./useActionsApi.js";
2
- import { useBlocksConfig as O } from "./useBlocksConfig.js";
1
+ import { useActionsApi as O } from "./useActionsApi.js";
2
+ import { useBlocksConfig as q } from "./useBlocksConfig.js";
3
3
  import { useConfig as H } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
5
5
  import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
@@ -17,7 +17,7 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
17
17
  import Z from "../package.json.js";
18
18
  let n = null;
19
19
  const he = () => {
20
- const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
20
+ const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = q(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
21
21
  var d;
22
22
  if (document.getElementById("UiEditorScript")) {
23
23
  r();
@@ -31,13 +31,13 @@ const he = () => {
31
31
  n = null;
32
32
  }), n), D = async (r, s, o, a = [], i = !1) => {
33
33
  var y, E, h, C;
34
- const e = k(), { html: d, css: R } = r, { baseBlocks: g, extensions: P } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
34
+ const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), x = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
35
  w().importCss(), await window.UIEditor.initEditor(
36
36
  document.querySelector("#guido-editor"),
37
37
  {
38
38
  metadata: s,
39
39
  html: d,
40
- css: R,
40
+ css: P,
41
41
  forceRecreate: I,
42
42
  locale: "en",
43
43
  undoButtonSelector: "#guido__undo-button",
@@ -60,9 +60,10 @@ const he = () => {
60
60
  keepModuleStylesEnabled: !0,
61
61
  displayTitle: !1,
62
62
  displayUTM: !1,
63
+ copyPasteEnabled: !1,
63
64
  selectElementAfterDrop: !0,
64
65
  sameFontSizeForOutlook: !0,
65
- allowedScriptSourceDomains: q,
66
+ allowedScriptSourceDomains: x,
66
67
  ...g ? { baseBlocks: g } : {},
67
68
  editorFonts: {
68
69
  showDefaultStandardFonts: !0,
@@ -88,8 +89,8 @@ const he = () => {
88
89
  },
89
90
  onTemplateLoaded() {
90
91
  try {
91
- const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
92
- w().importCss(), t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
92
+ const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = O(), { injectFullStory: L } = N();
93
+ w().importCss(), t(), L(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
93
94
  e.hasChanges = !1;
94
95
  }, 1e3);
95
96
  } catch (t) {
@@ -106,7 +107,7 @@ const he = () => {
106
107
  e.isVersionHistoryOpen = t;
107
108
  },
108
109
  onDataChanged() {
109
- e.hasChanges = !0, e.changeSeq += 1;
110
+ e.markChanged();
110
111
  },
111
112
  onEvent: F,
112
113
  onModuleAdd: A,
@@ -120,7 +121,7 @@ const he = () => {
120
121
  ".in-modal-v2-wrapper",
121
122
  ".in-toasts-wrapper"
122
123
  ],
123
- extensions: P,
124
+ extensions: R,
124
125
  localePatch: J
125
126
  }
126
127
  );
@@ -1,63 +1,68 @@
1
- import { ToasterTypeOptions as t } from "../enums/toaster.js";
2
- import { useVersionHistoryStore as m } from "../stores/version-history.js";
3
- import { findEditorApi as w, EDITOR_NOT_READY_MESSAGE as y } from "../utils/stripoEditorApi.js";
4
- import { useToaster as V } from "./useToaster.js";
5
- const d = () => {
6
- const n = m(), { showToaster: i } = V(), o = (e) => {
7
- var s;
8
- const r = (s = w()) == null ? void 0 : s.versionHistoryApi;
1
+ import { ToasterTypeOptions as n } from "../enums/toaster.js";
2
+ import { refreshRecommendationBlocksAfterRestore as y } from "../extensions/Blocks/Recommendation/utils/restoreRefresh.js";
3
+ import { useEditorStore as g } from "../stores/editor.js";
4
+ import { useVersionHistoryStore as V } from "../stores/version-history.js";
5
+ import { findEditorApi as f, EDITOR_NOT_READY_MESSAGE as l } from "../utils/stripoEditorApi.js";
6
+ import { useToaster as h } from "./useToaster.js";
7
+ const M = () => {
8
+ const c = V(), p = g(), { showToaster: i } = h(), s = (e) => {
9
+ var o;
10
+ const r = (o = f()) == null ? void 0 : o.versionHistoryApi;
9
11
  if (!r) {
10
- i({ type: t.Error, message: y });
12
+ i({ type: n.Error, message: l });
11
13
  return;
12
14
  }
13
15
  e(r);
14
- }, p = (e) => {
15
- n.$reset(), n.updateState(e);
16
+ }, m = (e) => {
17
+ c.$reset(), c.updateState(e);
16
18
  }, a = () => {
17
- n.$reset();
19
+ c.$reset();
18
20
  };
19
21
  return {
20
22
  openVersionHistory: () => {
21
- o((e) => e.openVersionHistory(p, a));
23
+ s((e) => e.openVersionHistory(m, a));
22
24
  },
23
25
  closeVersionHistory: () => {
24
- o((e) => e.closeVersionHistory());
26
+ s((e) => e.closeVersionHistory());
25
27
  },
26
28
  switchToDesktopPreview: () => {
27
- o((e) => e.switchToDesktopPreview());
29
+ s((e) => e.switchToDesktopPreview());
28
30
  },
29
31
  switchToMobilePreview: () => {
30
- o((e) => e.switchToMobilePreview());
32
+ s((e) => e.switchToMobilePreview());
31
33
  },
32
34
  previewVersion: (e) => {
33
- o((r) => r.previewVersion(e, (s) => {
34
- const c = s instanceof Error ? s.message : String(s);
35
+ s((r) => r.previewVersion(e, (o) => {
36
+ const t = o instanceof Error ? o.message : String(o);
35
37
  i({
36
- type: t.Error,
37
- message: `Error compiling email: ${c}`
38
+ type: n.Error,
39
+ message: `Error compiling email: ${t}`
38
40
  });
39
41
  }));
40
42
  },
41
43
  restoreVersion: (e) => {
42
- o((r) => r.restoreVersion(
43
- e,
44
- () => {
45
- i({
46
- type: t.Success,
47
- message: "Your version has been restored successfully."
48
- });
49
- },
50
- (s) => {
51
- const c = s instanceof Error ? s.message : String(s);
52
- i({
53
- type: t.Error,
54
- message: `Error compiling email: ${c}`
55
- });
56
- }
57
- ));
44
+ s((r) => {
45
+ const o = p.changeSeq;
46
+ r.restoreVersion(
47
+ e,
48
+ () => {
49
+ i({
50
+ type: n.Success,
51
+ message: "Your version has been restored successfully."
52
+ }), y(o);
53
+ },
54
+ (t) => {
55
+ const w = t instanceof Error ? t.message : String(t);
56
+ i({
57
+ type: n.Error,
58
+ message: `Error compiling email: ${w}`
59
+ });
60
+ }
61
+ );
62
+ });
58
63
  }
59
64
  };
60
65
  };
61
66
  export {
62
- d as useVersionHistoryApi
67
+ M as useVersionHistoryApi
63
68
  };
@@ -1,6 +1,15 @@
1
1
  import { pairProductVariables as o } from "../../utils/pairProductVariables.js";
2
- import { wrapHiddenPriceTdsForOutlook as r, MSO_ITEMS_HIDE_START as e, MSO_ITEMS_HIDE_END as t } from "./utils/itemsCompilerUtils.js";
3
- const a = [
2
+ import { normalizeItemsBlockWidths as r, wrapHiddenPriceTdsForOutlook as t, lockHorizontalItemImageWidths as e, MSO_ITEMS_HIDE_START as s, MSO_ITEMS_HIDE_END as p } from "./utils/itemsCompilerUtils.js";
3
+ const c = [
4
+ {
5
+ id: "normalize-items-block-widths",
6
+ // Runs before the other items rules so they see non-zero widths; not AMP-safe.
7
+ description: "Normalize zero Items card widths in the compiled email",
8
+ type: "custom",
9
+ processor: r,
10
+ priority: 55
11
+ // Before pair-product-variables (60)
12
+ },
4
13
  {
5
14
  id: "pair-product-variables",
6
15
  description: "Replace product default values with template variables",
@@ -16,20 +25,27 @@ const a = [
16
25
  // with safe placeholder comments and collapse them inline for web-engine Outlook.
17
26
  description: "Mark hidden Items price tds for Outlook conditional hiding",
18
27
  type: "custom",
19
- processor: r,
28
+ processor: t,
20
29
  priority: 65
21
30
  // After pair-product-variables (60), before outlook rules (70+)
22
31
  },
32
+ {
33
+ id: "lock-horizontal-item-image-widths",
34
+ description: "Pin horizontal Items thumbnails to their width so narrow rows cannot collapse them",
35
+ type: "custom",
36
+ processor: e,
37
+ priority: 66
38
+ },
23
39
  {
24
40
  id: "swap-items-mso-markers",
25
41
  // Injecting the delicate `<!-- -->` ghost token LAST (after reco minify P99
26
42
  // and reco swap P100) keeps it out of every whitespace/comment-mangling pass.
27
43
  description: "Swap Items MSO markers into [if !mso] conditional comments",
28
44
  type: "custom",
29
- processor: (i) => i.replaceAll(`<!--${e}-->`, "<!--[if !mso]><!-- -->").replaceAll(`<!--${t}-->`, "<!--<![endif]-->"),
45
+ processor: (i) => i.replaceAll(`<!--${s}-->`, "<!--[if !mso]><!-- -->").replaceAll(`<!--${p}-->`, "<!--<![endif]-->"),
30
46
  priority: 101
31
47
  }
32
48
  ];
33
49
  export {
34
- a as itemsCompilerRules
50
+ c as itemsCompilerRules
35
51
  };
@@ -1,28 +1,75 @@
1
- const p = "MSO_ITEMS_HIDE_START", E = "MSO_ITEMS_HIDE_END", u = "mso-hide:all; max-height:0; overflow:hidden; font-size:0; line-height:0;", _ = ".ins-product-cart td.horizontal-price, .ins-product-cart td.vertical-price";
2
- function T(t) {
1
+ import { PRODUCT_WRAPPER_SELECTOR as h, hasZeroWidthDeclaration as E, isZeroWidthValue as f, withWidthPin as T, PRODUCT_TD_SELECTOR as _, withoutZeroWidth as y } from "../../../extensions/Blocks/Items/constants/cardWidth.js";
2
+ import { DefaultConfigValues as D } from "../../../extensions/Blocks/Items/enums/settingsEnums.js";
3
+ import { protectLiquid as p, restoreLiquid as A } from "../../../utils/liquidProtection.js";
4
+ const m = "MSO_ITEMS_HIDE_START", S = "MSO_ITEMS_HIDE_END", M = "mso-hide:all; max-height:0; overflow:hidden; font-size:0; line-height:0;", I = ".ins-product-cart td.horizontal-price, .ins-product-cart td.vertical-price", O = ".ins-product-td td.product-image-class img[width]", g = Number(D.productImageWidth);
5
+ function C(t) {
3
6
  if (!t.includes("vertical-price") || !t.includes("ins-product-cart"))
4
7
  return t;
5
- const i = t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(i, "text/html");
8
+ const s = t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), o = new DOMParser().parseFromString(s, "text/html");
6
9
  let n = !1;
7
- if (r.querySelectorAll(_).forEach((e) => {
8
- var s, a;
9
- const o = e.getAttribute("style") || "";
10
- if (!/display\s*:\s*none/i.test(o))
10
+ if (o.querySelectorAll(I).forEach((e) => {
11
+ var d, u;
12
+ const r = e.getAttribute("style") || "";
13
+ if (!/display\s*:\s*none/i.test(r))
11
14
  return;
12
- const c = e.previousSibling;
13
- if (((c == null ? void 0 : c.nodeType) !== Node.COMMENT_NODE || c.data !== p) && ((s = e.parentNode) == null || s.insertBefore(r.createComment(p), e), (a = e.parentNode) == null || a.insertBefore(r.createComment(E), e.nextSibling)), !/mso-hide/i.test(o)) {
14
- const d = o.trim().endsWith(";") ? " " : "; ";
15
- e.setAttribute("style", `${o}${d}${u}`);
15
+ const l = e.previousSibling;
16
+ if (((l == null ? void 0 : l.nodeType) !== Node.COMMENT_NODE || l.data !== m) && ((d = e.parentNode) == null || d.insertBefore(o.createComment(m), e), (u = e.parentNode) == null || u.insertBefore(o.createComment(S), e.nextSibling)), !/mso-hide/i.test(r)) {
17
+ const a = r.trim().endsWith(";") ? " " : "; ";
18
+ e.setAttribute("style", `${r}${a}${M}`);
16
19
  }
17
20
  n = !0;
18
21
  }), !n)
19
22
  return t;
20
- const l = i.match(/<!DOCTYPE[^>]*>/i);
21
- return ((l ? `${l[0]}
22
- ` : "") + r.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
23
+ const c = s.match(/<!DOCTYPE[^>]*>/i);
24
+ return ((c ? `${c[0]}
25
+ ` : "") + o.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
26
+ }
27
+ function N(t) {
28
+ if (!t.includes("ins-product-wrapper") && !t.includes("ins-product-td"))
29
+ return t;
30
+ const s = new DOMParser().parseFromString(p(t), "text/html");
31
+ let o = !1;
32
+ if (s.querySelectorAll(h).forEach((i) => {
33
+ const e = i.getAttribute("style") || "";
34
+ if (!E(e) && !f(i.getAttribute("width")))
35
+ return;
36
+ const r = T(e);
37
+ r !== e && (i.setAttribute("style", r), o = !0), f(i.getAttribute("width")) && (i.setAttribute("width", "100%"), o = !0);
38
+ }), s.querySelectorAll(_).forEach((i) => {
39
+ const e = i.getAttribute("style") || "";
40
+ if (E(e)) {
41
+ const r = y(e);
42
+ r ? i.setAttribute("style", r) : i.removeAttribute("style"), o = !0;
43
+ }
44
+ f(i.getAttribute("width")) && (i.removeAttribute("width"), o = !0);
45
+ }), !o)
46
+ return t;
47
+ const n = t.match(/<!DOCTYPE[^>]*>/i), c = n ? `${n[0]}
48
+ ` : "";
49
+ return A(c + s.documentElement.outerHTML);
50
+ }
51
+ function L(t) {
52
+ if (!t.includes("product-image-class"))
53
+ return t;
54
+ const s = new DOMParser().parseFromString(p(t), "text/html");
55
+ let o = !1;
56
+ if (s.querySelectorAll(O).forEach((i) => {
57
+ var u, a;
58
+ const e = ((u = i.getAttribute("width")) == null ? void 0 : u.trim()) ?? "", r = ((a = i.getAttribute("style")) == null ? void 0 : a.trim()) ?? "";
59
+ if (!/^\d+$/.test(e) || /(^|;)\s*min-width\s*:/i.test(r))
60
+ return;
61
+ const l = r && !r.endsWith(";") ? ";" : "", d = Math.min(Number(e), g);
62
+ i.setAttribute("style", `${r}${l}min-width:${d}px;max-width:${e}px`), o = !0;
63
+ }), !o)
64
+ return t;
65
+ const n = t.match(/<!DOCTYPE[^>]*>/i), c = n ? `${n[0]}
66
+ ` : "";
67
+ return A(c + s.documentElement.outerHTML);
23
68
  }
24
69
  export {
25
- E as MSO_ITEMS_HIDE_END,
26
- p as MSO_ITEMS_HIDE_START,
27
- T as wrapHiddenPriceTdsForOutlook
70
+ S as MSO_ITEMS_HIDE_END,
71
+ m as MSO_ITEMS_HIDE_START,
72
+ L as lockHorizontalItemImageWidths,
73
+ N as normalizeItemsBlockWidths,
74
+ C as wrapHiddenPriceTdsForOutlook
28
75
  };