@templatical/editor 0.45.0 → 0.46.0

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 (140) hide show
  1. package/dist/{AiChatSidebar-BlFWWhBv.js → AiChatSidebar-DGcH4Lyo.js} +1 -1
  2. package/dist/{AiFeatureMenu-CvWygUmC.js → AiFeatureMenu-B4q-0g1S.js} +1 -1
  3. package/dist/{BlockPreviewCanvas-DwxJOTzH.js → BlockPreviewCanvas-DIZ0KgUD.js} +3 -3
  4. package/dist/{CloudHeaderExtras-BzM1QU1r.js → CloudHeaderExtras-ehMYJP68.js} +1 -1
  5. package/dist/{CloudPanels-d36YXXyn.js → CloudPanels-BwOaAlKz.js} +2 -2
  6. package/dist/{CollaboratorBar-rwXe_Qd2.js → CollaboratorBar-qOZFRNPx.js} +1 -1
  7. package/dist/{CountdownToolbar-lbjCc8ik.js → CountdownToolbar-BeF21SeB.js} +4 -4
  8. package/dist/{DesignReferenceSidebar-zlJQsP0X.js → DesignReferenceSidebar-zH93uB15.js} +1 -1
  9. package/dist/{IssuesPanel-CHx3m8SP.js → IssuesPanel-Dltw9haP.js} +1 -1
  10. package/dist/{LogicTagInsertButton-BvftbkL4.js → LogicTagInsertButton-CHa-UD76.js} +12 -12
  11. package/dist/{MergeTagInput-CR1kcj8X.js → MergeTagInput-B3ntd4dN.js} +1 -1
  12. package/dist/{MergeTagModeToggle-DssKrVYb.js → MergeTagModeToggle-C_06ZL0Q.js} +1 -1
  13. package/dist/{ParagraphEditor-DFizsZRc.js → ParagraphEditor-CxuW3TV0.js} +6 -6
  14. package/dist/{RestoreVersionDialog-Cp3q2mU4.js → RestoreVersionDialog-B1n37M1Z.js} +1 -1
  15. package/dist/{RichTextEditorContent-Cj3oaPMk.js → RichTextEditorContent-CP_uULWB.js} +2 -2
  16. package/dist/{SaveBlockDialog-BR8vW_XF.js → SaveBlockDialog-BSKX_7_v.js} +5 -5
  17. package/dist/{SavedBlocksBrowserModal-DmwbmKxI.js → SavedBlocksBrowserModal-CHKrH1gO.js} +4 -4
  18. package/dist/{SavedBlocksPanels-D4XKrs-a.js → SavedBlocksPanels-B-xDqBcz.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-gfc-o5sR.js → SavedBlocksPickBar-D2J-g82g.js} +1 -1
  20. package/dist/{TemplateSettings-D7aNrd0d.js → TemplateSettings-D07K_Y4m.js} +4 -4
  21. package/dist/{TestEmailModal-DUmtcSm-.js → TestEmailModal-BNPw_lID.js} +5 -5
  22. package/dist/{TestEmailPanel-s9gISTI8.js → TestEmailPanel-8klWo8hE.js} +1 -1
  23. package/dist/{TitleEditor-C-uHqtml.js → TitleEditor-CmC9OuhA.js} +4 -4
  24. package/dist/{ToggleSwitch-CTwwCIVA.js → ToggleSwitch-COeyWGfT.js} +1 -1
  25. package/dist/{Toolbar-CLpA36RO.js → Toolbar-CqhRb6EM.js} +36 -36
  26. package/dist/{TplModal-D6XtxusQ.js → TplModal-BGFawHY9.js} +1 -1
  27. package/dist/{VersionHistoryPanels-Dvowtt7V.js → VersionHistoryPanels-DdbGjEOR.js} +1 -1
  28. package/dist/{WrapperBlock-CzJa2Mxw.js → WrapperBlock-CTkmA887.js} +1 -1
  29. package/dist/{blockTypeIcons-D3aj5u_5.js → blockTypeIcons-CVKo6V_v.js} +1 -1
  30. package/dist/bundle-stats.json +6 -6
  31. package/dist/cdn/chunks/{AiChatSidebar-SRGBP-SL.js → AiChatSidebar-kCK4NZM9.js} +2 -2
  32. package/dist/cdn/chunks/{AiChatSidebar-SRGBP-SL.js.map → AiChatSidebar-kCK4NZM9.js.map} +1 -1
  33. package/dist/cdn/chunks/{AiFeatureMenu-oZhlgsGh.js → AiFeatureMenu-K1dLeDft.js} +2 -2
  34. package/dist/cdn/chunks/{AiFeatureMenu-oZhlgsGh.js.map → AiFeatureMenu-K1dLeDft.js.map} +1 -1
  35. package/dist/cdn/chunks/{BlockPreviewCanvas-hKxE6f-k.js → BlockPreviewCanvas-Djz9YAFx.js} +4 -4
  36. package/dist/cdn/chunks/{BlockPreviewCanvas-hKxE6f-k.js.map → BlockPreviewCanvas-Djz9YAFx.js.map} +1 -1
  37. package/dist/cdn/chunks/{CloudHeaderExtras-t-_ZlHwn.js → CloudHeaderExtras-5ONQ1RCa.js} +2 -2
  38. package/dist/cdn/chunks/{CloudHeaderExtras-t-_ZlHwn.js.map → CloudHeaderExtras-5ONQ1RCa.js.map} +1 -1
  39. package/dist/cdn/chunks/{CloudPanels-DR2eEcpX.js → CloudPanels-_irSdWbi.js} +3 -3
  40. package/dist/cdn/chunks/{CloudPanels-DR2eEcpX.js.map → CloudPanels-_irSdWbi.js.map} +1 -1
  41. package/dist/cdn/chunks/{CollaboratorBar-w8_2WPE0.js → CollaboratorBar-CZufI1On.js} +2 -2
  42. package/dist/cdn/chunks/{CollaboratorBar-w8_2WPE0.js.map → CollaboratorBar-CZufI1On.js.map} +1 -1
  43. package/dist/cdn/chunks/{CountdownToolbar-CvNuDR5Z.js → CountdownToolbar-BaXCefQM.js} +5 -5
  44. package/dist/cdn/chunks/{CountdownToolbar-CvNuDR5Z.js.map → CountdownToolbar-BaXCefQM.js.map} +1 -1
  45. package/dist/cdn/chunks/{DesignReferenceSidebar-CJg_5GXU.js → DesignReferenceSidebar-GjkpHylX.js} +2 -2
  46. package/dist/cdn/chunks/{DesignReferenceSidebar-CJg_5GXU.js.map → DesignReferenceSidebar-GjkpHylX.js.map} +1 -1
  47. package/dist/cdn/chunks/{IssuesPanel-DXqlRk19.js → IssuesPanel-C1Lv2y_O.js} +2 -2
  48. package/dist/cdn/chunks/{IssuesPanel-DXqlRk19.js.map → IssuesPanel-C1Lv2y_O.js.map} +1 -1
  49. package/dist/cdn/chunks/{LogicTagInsertButton-DnHghQHb.js → LogicTagInsertButton-BYjdrDnQ.js} +4 -4
  50. package/dist/cdn/chunks/{LogicTagInsertButton-DnHghQHb.js.map → LogicTagInsertButton-BYjdrDnQ.js.map} +1 -1
  51. package/dist/cdn/chunks/{MergeTagInput-heTX9P_k.js → MergeTagInput-Cx67J_vg.js} +2 -2
  52. package/dist/cdn/chunks/{MergeTagInput-heTX9P_k.js.map → MergeTagInput-Cx67J_vg.js.map} +1 -1
  53. package/dist/cdn/chunks/{MergeTagModeToggle-C9EfuZIP.js → MergeTagModeToggle-DZ4EuXVp.js} +2 -2
  54. package/dist/cdn/chunks/{MergeTagModeToggle-C9EfuZIP.js.map → MergeTagModeToggle-DZ4EuXVp.js.map} +1 -1
  55. package/dist/cdn/chunks/{ParagraphEditor-B5DN4Sy4.js → ParagraphEditor-DndEFXmR.js} +7 -7
  56. package/dist/cdn/chunks/{ParagraphEditor-B5DN4Sy4.js.map → ParagraphEditor-DndEFXmR.js.map} +1 -1
  57. package/dist/cdn/chunks/{RestoreVersionDialog-DBgJ-Nui.js → RestoreVersionDialog-CFYs13a4.js} +2 -2
  58. package/dist/cdn/chunks/{RestoreVersionDialog-DBgJ-Nui.js.map → RestoreVersionDialog-CFYs13a4.js.map} +1 -1
  59. package/dist/cdn/chunks/{RichTextEditorContent-LOas4rfU.js → RichTextEditorContent-DKkDQ0dc.js} +3 -3
  60. package/dist/cdn/chunks/{RichTextEditorContent-LOas4rfU.js.map → RichTextEditorContent-DKkDQ0dc.js.map} +1 -1
  61. package/dist/cdn/chunks/{SaveBlockDialog-Dx-QVQCX.js → SaveBlockDialog-BOA2RaC_.js} +6 -6
  62. package/dist/cdn/chunks/{SaveBlockDialog-Dx-QVQCX.js.map → SaveBlockDialog-BOA2RaC_.js.map} +1 -1
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-C2RQ-JCc.js → SavedBlocksBrowserModal-DQDVek3K.js} +4 -4
  64. package/dist/cdn/chunks/{SavedBlocksBrowserModal-C2RQ-JCc.js.map → SavedBlocksBrowserModal-DQDVek3K.js.map} +1 -1
  65. package/dist/cdn/chunks/{SavedBlocksPanels-BmRbvqqL.js → SavedBlocksPanels-Lu3tJ3QA.js} +2 -2
  66. package/dist/cdn/chunks/{SavedBlocksPanels-BmRbvqqL.js.map → SavedBlocksPanels-Lu3tJ3QA.js.map} +1 -1
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-BzwKojoJ.js → SavedBlocksPickBar-D7MtqG6r.js} +2 -2
  68. package/dist/cdn/chunks/{SavedBlocksPickBar-BzwKojoJ.js.map → SavedBlocksPickBar-D7MtqG6r.js.map} +1 -1
  69. package/dist/cdn/chunks/{TemplateSettings-G-yV7C1C.js → TemplateSettings-rZiHmq24.js} +5 -5
  70. package/dist/cdn/chunks/{TemplateSettings-G-yV7C1C.js.map → TemplateSettings-rZiHmq24.js.map} +1 -1
  71. package/dist/cdn/chunks/{TestEmailModal-lOeztfTN.js → TestEmailModal-DWEyHXH2.js} +6 -6
  72. package/dist/cdn/chunks/{TestEmailModal-lOeztfTN.js.map → TestEmailModal-DWEyHXH2.js.map} +1 -1
  73. package/dist/cdn/chunks/{TestEmailPanel-CZswVkk_.js → TestEmailPanel-XXMD-Lnr.js} +2 -2
  74. package/dist/cdn/chunks/{TestEmailPanel-CZswVkk_.js.map → TestEmailPanel-XXMD-Lnr.js.map} +1 -1
  75. package/dist/cdn/chunks/{TitleEditor-CnTT2Y3H.js → TitleEditor-D1F0YoE-.js} +4 -4
  76. package/dist/cdn/chunks/{TitleEditor-CnTT2Y3H.js.map → TitleEditor-D1F0YoE-.js.map} +1 -1
  77. package/dist/cdn/chunks/{ToggleSwitch-CLHteVMO.js → ToggleSwitch-B5U9cqhi.js} +2 -2
  78. package/dist/cdn/chunks/{ToggleSwitch-CLHteVMO.js.map → ToggleSwitch-B5U9cqhi.js.map} +1 -1
  79. package/dist/cdn/chunks/{Toolbar-K4tIkpG1.js → Toolbar-C_5HfUQq.js} +55 -55
  80. package/dist/cdn/chunks/{Toolbar-K4tIkpG1.js.map → Toolbar-C_5HfUQq.js.map} +1 -1
  81. package/dist/cdn/chunks/{TplModal-OOT36AjS.js → TplModal-CYBbPCHL.js} +2 -2
  82. package/dist/cdn/chunks/{TplModal-OOT36AjS.js.map → TplModal-CYBbPCHL.js.map} +1 -1
  83. package/dist/cdn/chunks/{VersionHistoryPanels-BrpYRSfW.js → VersionHistoryPanels-Dq12VsTX.js} +2 -2
  84. package/dist/cdn/chunks/{VersionHistoryPanels-BrpYRSfW.js.map → VersionHistoryPanels-Dq12VsTX.js.map} +1 -1
  85. package/dist/cdn/chunks/{WrapperBlock-DdrnwH80.js → WrapperBlock-CJ0CLqi2.js} +2 -2
  86. package/dist/cdn/chunks/{WrapperBlock-DdrnwH80.js.map → WrapperBlock-CJ0CLqi2.js.map} +1 -1
  87. package/dist/cdn/chunks/{cloud-bhW8qTnh.js → cloud-h1vaHp2p.js} +2 -2
  88. package/dist/cdn/chunks/{cloud-bhW8qTnh.js.map → cloud-h1vaHp2p.js.map} +1 -1
  89. package/dist/cdn/chunks/{createCloudRuntime-CeRJkLR2.js → createCloudRuntime-bJN9EM1H.js} +3 -3
  90. package/dist/cdn/chunks/{createCloudRuntime-CeRJkLR2.js.map → createCloudRuntime-bJN9EM1H.js.map} +1 -1
  91. package/dist/cdn/chunks/{extensions-xjRsIjMP.js → extensions-CrmXF4MW.js} +6 -6
  92. package/dist/cdn/chunks/extensions-CrmXF4MW.js.map +1 -0
  93. package/dist/{preRenderCustomBlocks-DAS48ZCp.js → cdn/chunks/preRenderCustomBlocks-CyGB3lZr.js} +5 -3
  94. package/dist/cdn/chunks/{preRenderCustomBlocks-CFwa7nP9.js.map → preRenderCustomBlocks-CyGB3lZr.js.map} +1 -1
  95. package/dist/cdn/chunks/{socialIcons-CsYnPPll.js → socialIcons-ClJVDZwt.js} +82 -101
  96. package/dist/cdn/chunks/socialIcons-ClJVDZwt.js.map +1 -0
  97. package/dist/cdn/chunks/{src-HA9F2kvk.js → src-B0pZeTYO.js} +200 -183
  98. package/dist/cdn/chunks/src-B0pZeTYO.js.map +1 -0
  99. package/dist/cdn/chunks/{src-CkXmV2I2.js → src-BMw3u-iV.js} +213 -215
  100. package/dist/cdn/chunks/src-BMw3u-iV.js.map +1 -0
  101. package/dist/cdn/chunks/{src-BcqNlDMe.js → src-Bh0MoJ67.js} +280 -187
  102. package/dist/cdn/chunks/src-Bh0MoJ67.js.map +1 -0
  103. package/dist/cdn/chunks/{useEditorCore-BF1ZhcGu.js → useEditorCore-DuC7kVti.js} +323 -319
  104. package/dist/cdn/chunks/useEditorCore-DuC7kVti.js.map +1 -0
  105. package/dist/cdn/chunks/{useLogicTag-91bO_SOi.js → useLogicTag-B3uV3XHG.js} +2 -2
  106. package/dist/cdn/chunks/{useLogicTag-91bO_SOi.js.map → useLogicTag-B3uV3XHG.js.map} +1 -1
  107. package/dist/cdn/chunks/{useMergeTag-hwifK582.js → useMergeTag-DJLM-7WQ.js} +2 -2
  108. package/dist/cdn/chunks/{useMergeTag-hwifK582.js.map → useMergeTag-DJLM-7WQ.js.map} +1 -1
  109. package/dist/cdn/chunks/{useScrollToBlock-BDNJ25X1.js → useScrollToBlock-CpmB5KxW.js} +2 -3
  110. package/dist/cdn/chunks/useScrollToBlock-CpmB5KxW.js.map +1 -0
  111. package/dist/cdn/chunks/withCurrentFont-isIyuezD.js +21 -0
  112. package/dist/cdn/chunks/withCurrentFont-isIyuezD.js.map +1 -0
  113. package/dist/cdn/editor.css +1 -1
  114. package/dist/cdn/editor.js +435 -417
  115. package/dist/cdn/editor.js.map +1 -1
  116. package/dist/{cloud-CVfwPu19.js → cloud-DPGjMGfv.js} +1 -1
  117. package/dist/{createCloudRuntime-GRv_TDb2.js → createCloudRuntime-D0RRgWab.js} +2 -2
  118. package/dist/{dist-CSaWqmWM.js → dist-BI_LeQGl.js} +271 -200
  119. package/dist/{extensions-B65sfZRk.js → extensions-CYigjb1g.js} +13 -13
  120. package/dist/index.d.ts +34 -12
  121. package/dist/{cdn/chunks/preRenderCustomBlocks-CFwa7nP9.js → preRenderCustomBlocks-DokBGA_M.js} +3 -5
  122. package/dist/{socialIcons-CvAixjj8.js → socialIcons-Ct_IoqPQ.js} +107 -126
  123. package/dist/style.css +1 -1
  124. package/dist/templatical-editor.js +456 -438
  125. package/dist/{useEditorCore-DQSeKPE9.js → useEditorCore-BJAQMvNW.js} +482 -478
  126. package/dist/{useLogicTag-BH87j1vZ.js → useLogicTag-B5gjcMzn.js} +1 -1
  127. package/dist/{useMergeTag-DfPKX2Tk.js → useMergeTag-BwsBIDzR.js} +3 -3
  128. package/dist/{useScrollToBlock-Dr7Sb6Tr.js → useScrollToBlock-JRxhT1u_.js} +1 -2
  129. package/dist/withCurrentFont-C9vqrduu.js +19 -0
  130. package/package.json +8 -8
  131. package/dist/cdn/chunks/extensions-xjRsIjMP.js.map +0 -1
  132. package/dist/cdn/chunks/socialIcons-CsYnPPll.js.map +0 -1
  133. package/dist/cdn/chunks/src-BcqNlDMe.js.map +0 -1
  134. package/dist/cdn/chunks/src-CkXmV2I2.js.map +0 -1
  135. package/dist/cdn/chunks/src-HA9F2kvk.js.map +0 -1
  136. package/dist/cdn/chunks/useEditorCore-BF1ZhcGu.js.map +0 -1
  137. package/dist/cdn/chunks/useScrollToBlock-BDNJ25X1.js.map +0 -1
  138. package/dist/cdn/chunks/withCurrentFont-DeCbPVaE.js +0 -32
  139. package/dist/cdn/chunks/withCurrentFont-DeCbPVaE.js.map +0 -1
  140. package/dist/withCurrentFont-DeCbPVaE.js +0 -30
@@ -1,10 +1,10 @@
1
- import { $ as e, G as t, Q as n, S as r, St as i, X as a, Z as o, at as s, b as c, ct as l, et as u, ft as d, lt as f, nt as p, ot as m, rt as h, st as ee, tt as g, ut as _, v, vt as y, x as te, xt as b, y as ne, yt as x } from "./src-BcqNlDMe.js";
1
+ import { C as e, Ct as t, D as n, Dt as r, E as i, Et as a, S as o, T as s, X as c, _t as l, at as u, b as d, ct as f, dt as p, ft as m, ht as h, it as g, mt as _, nt as v, ot as y, pt as b, rt as x, st as S, tt as C, ut as ee, v as te, w as ne, wt as w, x as re } from "./src-Bh0MoJ67.js";
2
2
  //#endregion
3
3
  //#region ../renderer/src/render-context.ts
4
- var S = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
4
+ var T = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
5
5
  name: "@templatical/renderer",
6
6
  description: "Render Templatical email templates to MJML",
7
- version: "0.45.0",
7
+ version: "0.46.0",
8
8
  bugs: "https://github.com/templatical/sdk/issues",
9
9
  dependencies: { "@templatical/types": "workspace:*" },
10
10
  devDependencies: {
@@ -43,16 +43,7 @@ var S = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
43
43
  },
44
44
  type: "module",
45
45
  types: "./dist/index.d.ts"
46
- }.version}/assets/social`, re = {
47
- arial: "Arial, sans-serif",
48
- helvetica: "Helvetica, sans-serif",
49
- georgia: "Georgia, serif",
50
- "times new roman": "'Times New Roman', serif",
51
- verdana: "Verdana, sans-serif",
52
- "trebuchet ms": "'Trebuchet MS', sans-serif",
53
- "courier new": "'Courier New', monospace",
54
- tahoma: "Tahoma, sans-serif"
55
- }, C = class e {
46
+ }.version}/assets/social`, E = class e {
56
47
  containerWidth;
57
48
  customFonts;
58
49
  defaultFallbackFont;
@@ -61,31 +52,34 @@ var S = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
61
52
  socialIconsBaseUrl;
62
53
  blockRenderers;
63
54
  contentDirection;
64
- constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = S, o = {}, s = "ltr") {
55
+ constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = T, o = {}, s = "ltr") {
65
56
  this.containerWidth = e, this.customFonts = t, this.defaultFallbackFont = n, this.allowHtmlBlocks = r, this.customBlockHtml = i, this.socialIconsBaseUrl = a, this.blockRenderers = o, this.contentDirection = s;
66
57
  }
67
58
  withContainerWidth(t) {
68
59
  return new e(t, this.customFonts, this.defaultFallbackFont, this.allowHtmlBlocks, this.customBlockHtml, this.socialIconsBaseUrl, this.blockRenderers, this.contentDirection);
69
60
  }
70
61
  resolveFontFamily(e) {
71
- for (let t of this.customFonts) if (t.name.toLowerCase() === e.toLowerCase()) {
72
- let e = t.fallback ?? this.defaultFallbackFont;
73
- return `'${t.name}', ${e}`;
62
+ let t = re(e);
63
+ if (t.length !== 1) return e;
64
+ let [n] = t, r = n.name.toLowerCase();
65
+ for (let e of this.customFonts) if (e.name.toLowerCase() === r) {
66
+ let t = e.fallback ?? this.defaultFallbackFont;
67
+ return `'${e.name}', ${t}`;
74
68
  }
75
- return re[e.toLowerCase()] || e;
69
+ return te[r] || (d(n) ? e : `${o(n.name)}, ${this.defaultFallbackFont}`);
76
70
  }
77
71
  };
78
72
  //#endregion
79
73
  //#region ../renderer/src/visibility.ts
80
- function w(e) {
74
+ function D(e) {
81
75
  let t = e.visibility;
82
76
  return t ? !t.desktop && !t.mobile : !1;
83
77
  }
84
- function T(e, t = []) {
85
- let n = [E(e), ...t].filter((e) => e !== "").join(" ");
78
+ function O(e, t = []) {
79
+ let n = [k(e), ...t].filter((e) => e !== "").join(" ");
86
80
  return n === "" ? "" : ` css-class="${n}"`;
87
81
  }
88
- function E(e) {
82
+ function k(e) {
89
83
  let t = e.visibility;
90
84
  if (!t) return "";
91
85
  let n = [];
@@ -93,94 +87,98 @@ function E(e) {
93
87
  }
94
88
  //#endregion
95
89
  //#region ../renderer/src/unrenderable.ts
96
- var D = "templatical:unrenderable-block";
97
- function O(e) {
90
+ var A = "templatical:unrenderable-block";
91
+ function j(e) {
98
92
  return e.replace(/[<>]/g, "").replace(/-{2,}/g, "-");
99
93
  }
100
- function k(e) {
101
- return console.warn(`[Templatical] No renderer for block type "${e.type}" (id: ${e.id}). A placeholder comment was emitted in its place. Pass a \`blockRenderers\` entry for this type to render it.`), `<mj-raw><!-- ${D} type="${O(e.type)}" id="${O(e.id)}" --></mj-raw>`;
94
+ function M(e) {
95
+ return console.warn(`[Templatical] No renderer for block type "${e.type}" (id: ${e.id}). A placeholder comment was emitted in its place. Pass a \`blockRenderers\` entry for this type to render it.`), `<mj-raw><!-- ${A} type="${j(e.type)}" id="${j(e.id)}" --></mj-raw>`;
102
96
  }
103
97
  //#endregion
104
98
  //#region ../renderer/src/escape.ts
105
- var A = {
99
+ var N = {
106
100
  "&": "&amp;",
107
101
  "<": "&lt;",
108
102
  ">": "&gt;",
109
103
  "\"": "&quot;",
110
104
  "'": "&#039;"
111
- }, j = /[&<>"']/g;
112
- function M(e) {
113
- return e === "" ? "" : e.replace(j, (e) => A[e] ?? e);
105
+ }, P = /[&<>"']/g;
106
+ function F(e) {
107
+ return e === "" ? "" : e.replace(P, (e) => N[e] ?? e);
114
108
  }
115
- function N(e) {
116
- return e === "" ? "" : e.replace(j, (e) => A[e] ?? e);
109
+ function I(e) {
110
+ return e === "" ? "" : e.replace(P, (e) => N[e] ?? e);
117
111
  }
118
- function P(e) {
119
- return e === "" ? "" : N(e).replace(/[;{}\r\n]/g, "");
112
+ function L(e) {
113
+ return e === "" ? "" : I(e).replace(/[;{}\r\n]/g, "");
120
114
  }
121
- function F(e) {
122
- return e === "" ? "" : ie(e, (e) => I(e, "data-merge-tag") ?? I(e, "data-logic-merge-tag"));
123
- }
124
- function ie(e, t) {
125
- let n = "", r = 0;
126
- for (; r < e.length;) {
127
- let i = e.indexOf("<span", r);
128
- if (i === -1) {
129
- n += e.substring(r);
115
+ var ie = /[&<>"]/g;
116
+ function R(e) {
117
+ return e.replace(ie, (e) => N[e] ?? e);
118
+ }
119
+ function z(e) {
120
+ return e === "" ? "" : ae(e, (e) => B(e, "data-merge-tag") ?? B(e, "data-logic-merge-tag"));
121
+ }
122
+ function ae(t, n) {
123
+ let r = "", i = 0;
124
+ for (; i < t.length;) {
125
+ let a = t.indexOf("<span", i);
126
+ if (a === -1) {
127
+ r += t.substring(i);
130
128
  break;
131
129
  }
132
- let a = e[i + 5];
133
- if (a !== ">" && a !== " " && a !== " " && a !== "\n" && a !== "\r" && a !== "/") {
134
- n += e.substring(r, i + 5), r = i + 5;
130
+ let o = t[a + 5];
131
+ if (o !== ">" && o !== " " && o !== " " && o !== "\n" && o !== "\r" && o !== "/") {
132
+ r += t.substring(i, a + 5), i = a + 5;
135
133
  continue;
136
134
  }
137
- let o = v(e, i + 5);
138
- if (o === -1) {
139
- n += e.substring(r);
135
+ let s = e(t, a + 5);
136
+ if (s === -1) {
137
+ r += t.substring(i);
140
138
  break;
141
139
  }
142
- let s = e.indexOf("</span>", o + 1);
143
- if (s === -1) {
144
- n += e.substring(r);
140
+ let c = t.indexOf("</span>", s + 1);
141
+ if (c === -1) {
142
+ r += t.substring(i);
145
143
  break;
146
144
  }
147
- let c = t(e.substring(i + 5, o));
148
- c === null ? (n += e.substring(r, i + 5), r = i + 5) : (n += e.substring(r, i), n += c, r = s + 7);
145
+ let l = n(t.substring(a + 5, s));
146
+ l === null ? (r += t.substring(i, a + 5), i = a + 5) : (r += t.substring(i, a), r += l, i = c + 7);
149
147
  }
150
- return n;
148
+ return r;
151
149
  }
152
- function I(e, t) {
150
+ function B(e, t) {
153
151
  return ne(e, t);
154
152
  }
155
153
  //#endregion
156
154
  //#region ../renderer/src/padding.ts
157
- function L(e) {
155
+ function V(e) {
158
156
  return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
159
157
  }
160
158
  //#endregion
161
159
  //#region ../renderer/src/utils.ts
162
- function R(e, t) {
160
+ function H(e, t) {
163
161
  return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
164
162
  }
165
- function z(e) {
163
+ function U(e) {
166
164
  return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? "" : ` height="${e}px"`;
167
165
  }
168
- function B(e) {
169
- return Object.entries(b(e)).map(([e, t]) => ` ${e}="${P(t)}"`).join("");
166
+ function W(e) {
167
+ return Object.entries(a(e)).map(([e, t]) => ` ${e}="${L(t)}"`).join("");
170
168
  }
171
- function V(e) {
172
- let t = i(e);
169
+ function G(e) {
170
+ let t = r(e);
173
171
  return t === null ? "" : ` border-radius="${t}"`;
174
172
  }
175
173
  //#endregion
176
174
  //#region ../renderer/src/rich-text.ts
177
- var H = "tpl-rich-text";
178
- function U(e) {
179
- return `${H}-${e}`;
175
+ var K = "tpl-rich-text";
176
+ function q(e) {
177
+ return `${K}-${e}`;
180
178
  }
181
- function ae(e, t = "ltr") {
182
- let n = x, r = `.${H}`, i = [...new Set(e)].sort((e, t) => e - t).flatMap((e) => {
183
- let t = `.${U(e)}`;
179
+ function oe(e, t = "ltr") {
180
+ let n = w, r = `.${K}`, i = [...new Set(e)].sort((e, t) => e - t).flatMap((e) => {
181
+ let t = `.${q(e)}`;
184
182
  return [`${t} p { margin: 0 0 ${e}px; }`, `${t} p:last-child { margin-bottom: 0; }`];
185
183
  }), a = t === "rtl" ? "padding-right" : "padding-left";
186
184
  return [
@@ -189,41 +187,41 @@ function ae(e, t = "ltr") {
189
187
  `${r} li { margin: ${n.listItemMarginY}px 0; }`
190
188
  ].join("\n ");
191
189
  }
192
- function W(e) {
193
- return e ?? x.paragraphGap;
190
+ function J(e) {
191
+ return e ?? w.paragraphGap;
194
192
  }
195
- function oe(e) {
196
- let t = [x.paragraphGap], n = (e) => {
197
- if (e.type === "paragraph" && t.push(W(e.paragraphSpacing)), h(e)) for (let t of e.children) for (let e of t) n(e);
198
- else if (_(e)) for (let t of e.children) n(t);
193
+ function se(e) {
194
+ let t = [w.paragraphGap], n = (e) => {
195
+ if (e.type === "paragraph" && t.push(J(e.paragraphSpacing)), f(e)) for (let t of e.children) for (let e of t) n(e);
196
+ else if (h(e)) for (let t of e.children) n(t);
199
197
  };
200
198
  for (let t of e) n(t);
201
199
  return t;
202
200
  }
203
201
  //#endregion
204
202
  //#region ../renderer/src/renderers/title.ts
205
- function se(e, t) {
206
- if (w(e)) return "";
207
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = ce(F(e.content)), a = y[e.level] ?? y[2], o = e.color ? `\n color="${N(e.color)}"` : "", s = e.textAlign, c = le(e.fontFamily, t), l = T(e, [H, U(W(void 0))]), u = `h${y[e.level] ? e.level : 2}`;
203
+ function ce(e, n) {
204
+ if (D(e)) return "";
205
+ let r = V(e.styles.padding), i = H(e.styles.backgroundColor, "container"), a = le(z(e.content)), o = t[e.level] ?? t[2], s = e.color ? `\n color="${I(e.color)}"` : "", c = e.textAlign, l = ue(e.fontFamily, n), u = O(e, [K, q(J(void 0))]), d = `h${t[e.level] ? e.level : 2}`;
208
206
  return `<mj-text
209
- font-size="${a}px"${o}
210
- align="${s}"
207
+ font-size="${o}px"${s}
208
+ align="${c}"
211
209
  line-height="1.3"
212
- padding="${n}"${r}${c}${l}
213
- ><${u} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${u}></mj-text>`;
210
+ padding="${r}"${i}${l}${u}
211
+ ><${d} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${a}</${d}></mj-text>`;
214
212
  }
215
- function ce(e) {
213
+ function le(e) {
216
214
  let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
217
215
  return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
218
216
  }
219
- function le(e, t) {
220
- return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
217
+ function ue(e, t) {
218
+ return e ? ` font-family="${R(t.resolveFontFamily(e))}"` : "";
221
219
  }
222
220
  //#endregion
223
221
  //#region ../renderer/src/renderers/paragraph.ts
224
- function ue(e, t) {
225
- if (w(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
226
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = F(e.content), a = T(e, [H, U(W(e.paragraphSpacing))]);
222
+ function de(e, t) {
223
+ if (D(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
224
+ let n = V(e.styles.padding), r = H(e.styles.backgroundColor, "container"), i = z(e.content), a = O(e, [K, q(J(e.paragraphSpacing))]);
227
225
  return `<mj-text
228
226
  line-height="1.5"${t.contentDirection === "rtl" ? "\n align=\"right\"" : ""}
229
227
  padding="${n}"${r}${a}
@@ -231,14 +229,14 @@ function ue(e, t) {
231
229
  }
232
230
  //#endregion
233
231
  //#region ../renderer/src/renderers/image.ts
234
- function de(e, t) {
235
- if (w(e) || e.src === "") return "";
236
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = z(e.height), o = T(e), s = V(e.borderRadius), c = B(e.border), l = "";
237
- e.linkUrl && (l = ` href="${N(e.linkUrl)}"`, e.linkOpenInNewTab && (l += " target=\"_blank\" rel=\"noopener\""));
238
- let u = N(e.src), d = e.decorative === !0;
232
+ function fe(e, t) {
233
+ if (D(e) || e.src === "") return "";
234
+ let n = V(e.styles.padding), r = H(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = U(e.height), o = O(e), s = G(e.borderRadius), c = W(e.border), l = "";
235
+ e.linkUrl && (l = ` href="${I(e.linkUrl)}"`, e.linkOpenInNewTab && (l += " target=\"_blank\" rel=\"noopener\""));
236
+ let u = I(e.src), d = e.decorative === !0;
239
237
  return `<mj-image
240
238
  src="${u}"
241
- alt="${d ? "" : N(e.alt)}"
239
+ alt="${d ? "" : I(e.alt)}"
242
240
  width="${i}"${a}
243
241
  align="${e.align}"
244
242
  padding="${n}"${r}${c}${s}${l}${o}${d ? " role=\"presentation\"" : ""}
@@ -246,69 +244,69 @@ function de(e, t) {
246
244
  }
247
245
  //#endregion
248
246
  //#region ../renderer/src/renderers/button.ts
249
- var G = "tpl-button-full";
250
- function fe(e, t) {
251
- if (w(e)) return "";
252
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = L(e.buttonPadding), a = e.url === "" ? "" : N(e.url), o = a === "" ? "" : ` href="${a}"`, s = pe(e.backgroundColor), c = N(e.textColor), l = e.fontSize, u = he(e.borderRadius), d = M(e.text), f = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", p = me(e.fontFamily, t), m = ge(e.width), h = T(e, e.width === "full" ? [G] : []);
247
+ var Y = "tpl-button-full";
248
+ function pe(e, t) {
249
+ if (D(e)) return "";
250
+ let n = V(e.styles.padding), r = H(e.styles.backgroundColor, "container"), i = V(e.buttonPadding), a = e.url === "" ? "" : I(e.url), o = a === "" ? "" : ` href="${a}"`, s = me(e.backgroundColor), c = I(e.textColor), l = e.fontSize, u = ge(e.borderRadius), d = F(e.text), f = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", p = he(e.fontFamily, t), m = _e(e.width), h = O(e, e.width === "full" ? [Y] : []);
253
251
  return `<mj-button${o}${f}
254
252
  background-color="${s}"
255
253
  color="${c}"
256
254
  font-size="${l}px"
257
255
  font-weight="bold"
258
- border-radius="${u}"${B(e.border)}
256
+ border-radius="${u}"${W(e.border)}
259
257
  inner-padding="${i}"
260
258
  align="${e.align ?? "center"}"
261
259
  padding="${n}"${r}${p}${m}${h}
262
260
  >${d}</mj-button>`;
263
261
  }
264
- function pe(e) {
265
- return e.trim() === "" ? "transparent" : N(e);
262
+ function me(e) {
263
+ return e.trim() === "" ? "transparent" : I(e);
266
264
  }
267
- function me(e, t) {
268
- return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
269
- }
270
- function he(e) {
271
- return typeof e == "number" ? `${e}px` : i(e) ?? "0px";
265
+ function he(e, t) {
266
+ return e ? ` font-family="${R(t.resolveFontFamily(e))}"` : "";
272
267
  }
273
268
  function ge(e) {
269
+ return typeof e == "number" ? `${e}px` : r(e) ?? "0px";
270
+ }
271
+ function _e(e) {
274
272
  return e === void 0 ? "" : ` width="${e === "full" ? "100%" : `${e}px`}"`;
275
273
  }
276
274
  //#endregion
277
275
  //#region ../renderer/src/renderers/divider.ts
278
- function _e(e, t) {
279
- if (w(e)) return "";
280
- let n = L(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${N(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : typeof e.width == "number" ? `${e.width}px` : e.width;
276
+ function ve(e, t) {
277
+ if (D(e)) return "";
278
+ let n = V(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${I(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : typeof e.width == "number" ? `${e.width}px` : e.width;
281
279
  return `<mj-divider
282
280
  border-width="${e.thickness}px"
283
281
  border-style="${e.lineStyle}"
284
- border-color="${N(e.color)}"
282
+ border-color="${I(e.color)}"
285
283
  width="${i}"
286
- padding="${n}"${r}${T(e)}
284
+ padding="${n}"${r}${O(e)}
287
285
  />`;
288
286
  }
289
287
  //#endregion
290
288
  //#region ../renderer/src/renderers/spacer.ts
291
- function ve(e, t) {
292
- return w(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${N(e.styles.backgroundColor)}"` : ""}${T(e)} />`;
289
+ function ye(e, t) {
290
+ return D(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${I(e.styles.backgroundColor)}"` : ""}${O(e)} />`;
293
291
  }
294
292
  //#endregion
295
293
  //#region ../renderer/src/renderers/html.ts
296
- function ye(e, t) {
297
- if (w(e) || !t.allowHtmlBlocks) return "";
294
+ function be(e, t) {
295
+ if (D(e) || !t.allowHtmlBlocks) return "";
298
296
  let n = e.content;
299
297
  if (n === "") return "";
300
- let r = T(e);
301
- return `<mj-text padding="${L(e.styles.padding)}"${R(e.styles.backgroundColor, "container")}${r}>
298
+ let r = O(e);
299
+ return `<mj-text padding="${V(e.styles.padding)}"${H(e.styles.backgroundColor, "container")}${r}>
302
300
  ${n}
303
301
  </mj-text>`;
304
302
  }
305
303
  //#endregion
306
304
  //#region ../renderer/src/renderers/social.ts
307
- function be(e, t) {
308
- if (w(e)) return "";
305
+ function xe(e, t) {
306
+ if (D(e)) return "";
309
307
  let n = e.icons;
310
308
  if (n.length === 0) return "";
311
- let r = L(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${N(e.styles.backgroundColor)}"` : "", a = T(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = d(c, e.iconTone), u = e.spacing, f;
309
+ let r = V(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${I(e.styles.backgroundColor)}"` : "", a = O(e), o = e.align, s = e.iconSize, c = e.iconStyle, u = l(c, e.iconTone), d = e.spacing, f;
312
310
  switch (s) {
313
311
  case "small":
314
312
  f = 24;
@@ -339,83 +337,83 @@ function be(e, t) {
339
337
  padding="${r}"${i}${a}
340
338
  >
341
339
  ${n.map((e, n) => {
342
- let r = e.platform, i = N(e.url), a = `${t.socialIconsBaseUrl}/${l}/${r}.png`, o = n === m - 1 ? 0 : u;
340
+ let r = e.platform, i = I(e.url), a = `${t.socialIconsBaseUrl}/${u}/${r}.png`, o = n === m - 1 ? 0 : d;
343
341
  return `<mj-social-element src="${a}" href="${i}" icon-size="${f}px" padding="0 ${o}px 0 0" border-radius="${p}" background-color="transparent"></mj-social-element>`;
344
342
  }).join("\n")}
345
343
  </mj-social>`;
346
344
  }
347
345
  //#endregion
348
346
  //#region ../renderer/src/renderers/menu.ts
349
- function xe(e, t) {
350
- if (w(e) || e.items.length === 0) return "";
351
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = T(e), a = we(e.fontFamily, t), o = e.textAlign;
347
+ function Se(e, t) {
348
+ if (D(e) || e.items.length === 0) return "";
349
+ let n = V(e.styles.padding), r = H(e.styles.backgroundColor, "container"), i = O(e), a = Te(e.fontFamily, t), o = e.textAlign;
352
350
  return `<mj-text
353
- font-size="${e.fontSize}px"${e.color ? `\n color="${N(e.color)}"` : ""}
351
+ font-size="${e.fontSize}px"${e.color ? `\n color="${I(e.color)}"` : ""}
354
352
  align="${o}"
355
353
  line-height="1.5"
356
354
  padding="${n}"${r}${a}${i}
357
- >${Se(e)}</mj-text>`;
355
+ >${Ce(e)}</mj-text>`;
358
356
  }
359
- function Se(e) {
360
- let t = e.items, n = M(e.separator), r = P(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
361
- for (let e = 0; e < s; e++) o.push(Ce(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
357
+ function Ce(e) {
358
+ let t = e.items, n = F(e.separator), r = L(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
359
+ for (let e = 0; e < s; e++) o.push(we(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
362
360
  return o.join("");
363
361
  }
364
- function Ce(e, t) {
365
- let n = M(e.text), r = N(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
366
- return i && o.unshift(`color: ${P(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
367
- }
368
362
  function we(e, t) {
369
- return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
363
+ let n = F(e.text), r = I(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
364
+ return i && o.unshift(`color: ${L(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
365
+ }
366
+ function Te(e, t) {
367
+ return e ? ` font-family="${R(t.resolveFontFamily(e))}"` : "";
370
368
  }
371
369
  //#endregion
372
370
  //#region ../renderer/src/renderers/table.ts
373
- function Te(e, t) {
374
- if (w(e) || e.rows.length === 0) return "";
375
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = T(e), a = ke(e.fontFamily, t);
371
+ function Ee(e, t) {
372
+ if (D(e) || e.rows.length === 0) return "";
373
+ let n = V(e.styles.padding), r = H(e.styles.backgroundColor, "container"), i = O(e), a = Ae(e.fontFamily, t);
376
374
  return `<mj-text
377
- font-size="${e.fontSize}px"${e.color ? `\n color="${N(e.color)}"` : ""}
375
+ font-size="${e.fontSize}px"${e.color ? `\n color="${I(e.color)}"` : ""}
378
376
  align="${e.textAlign}"
379
377
  line-height="1.5"
380
378
  padding="${n}"${r}${a}${i}
381
- >${Ee(e)}</mj-text>`;
379
+ >${De(e)}</mj-text>`;
382
380
  }
383
- function Ee(e) {
384
- let t = P(e.borderColor), n = e.borderWidth, r = "";
381
+ function De(e) {
382
+ let t = L(e.borderColor), n = e.borderWidth, r = "";
385
383
  for (let i = 0; i < e.rows.length; i++) {
386
384
  let a = e.rows[i];
387
- r += De(a, e, e.hasHeaderRow && i === 0, t, n);
385
+ r += Oe(a, e, e.hasHeaderRow && i === 0, t, n);
388
386
  }
389
387
  return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
390
388
  }
391
- function De(e, t, n, r, i) {
389
+ function Oe(e, t, n, r, i) {
392
390
  let a = "";
393
- for (let o of e.cells) a += Oe(o, t, n, r, i);
391
+ for (let o of e.cells) a += ke(o, t, n, r, i);
394
392
  return `<tr>${a}</tr>`;
395
393
  }
396
- function Oe(e, t, n, r, i) {
394
+ function ke(e, t, n, r, i) {
397
395
  let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
398
- n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${P(t.headerBackgroundColor)}`));
399
- let s = o.join("; "), c = M(F(e.content)), l = n ? "th" : "td";
396
+ n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${L(t.headerBackgroundColor)}`));
397
+ let s = o.join("; "), c = F(z(e.content)), l = n ? "th" : "td";
400
398
  return `<${l} style="${s}">${c}</${l}>`;
401
399
  }
402
- function ke(e, t) {
403
- return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
400
+ function Ae(e, t) {
401
+ return e ? ` font-family="${R(t.resolveFontFamily(e))}"` : "";
404
402
  }
405
403
  //#endregion
406
404
  //#region ../renderer/src/renderers/custom.ts
407
- function Ae(e, t) {
408
- if (w(e)) return "";
405
+ function je(e, t) {
406
+ if (D(e)) return "";
409
407
  let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
410
408
  if (!n || n === "") return "";
411
- let r = T(e);
412
- return `<mj-text padding="${L(e.styles.padding)}"${R(e.styles.backgroundColor, "container")}${r}>
409
+ let r = O(e);
410
+ return `<mj-text padding="${V(e.styles.padding)}"${H(e.styles.backgroundColor, "container")}${r}>
413
411
  ${n}
414
412
  </mj-text>`;
415
413
  }
416
414
  //#endregion
417
415
  //#region ../renderer/src/columns.ts
418
- function K(e) {
416
+ function X(e) {
419
417
  switch (e) {
420
418
  case "2": return ["50%", "50%"];
421
419
  case "3": return [
@@ -428,7 +426,7 @@ function K(e) {
428
426
  default: return ["100%"];
429
427
  }
430
428
  }
431
- function q(e, t) {
429
+ function Me(e, t) {
432
430
  switch (e) {
433
431
  case "2": return [t * .5, t * .5];
434
432
  case "3": return [
@@ -443,7 +441,7 @@ function q(e, t) {
443
441
  }
444
442
  //#endregion
445
443
  //#region ../renderer/src/display-condition.ts
446
- function J(e, t) {
444
+ function Z(e, t) {
447
445
  if (t === "") return "";
448
446
  let n = e.displayCondition;
449
447
  return n ? `<mj-raw>${n.before}</mj-raw>
@@ -452,28 +450,28 @@ function J(e, t) {
452
450
  }
453
451
  //#endregion
454
452
  //#region ../renderer/src/renderers/section.ts
455
- function je(e, t, n) {
456
- if (w(e)) return "";
457
- let r = e.columns, i = K(r), a = q(r, t.containerWidth), o = L(e.styles.padding), s = R(e.styles.backgroundColor, "native"), c = T(e), l = V(e.borderRadius), u = B(e.border), d = t.contentDirection === "rtl" ? " direction=\"rtl\"" : "", f = e.children, p = [];
458
- for (let e = 0; e < f.length; e++) {
459
- let r = f[e], o = i[e] ?? "100%", s = Math.floor(a[e] ?? t.containerWidth), c = Me(r, t.allowHtmlBlocks).filter((e) => !h(e)), l = t.withContainerWidth(s), u = c.map((e) => J(e, n(e, l))).filter((e) => e !== "").join("\n");
460
- p.push(`<mj-column width="${o}"${d}>
453
+ function Ne(e, t, n) {
454
+ if (D(e)) return "";
455
+ let r = e.columns, i = X(r), a = Me(r, t.containerWidth), o = V(e.styles.padding), s = H(e.styles.backgroundColor, "native"), c = O(e), l = G(e.borderRadius), u = W(e.border), d = t.contentDirection === "rtl" ? " direction=\"rtl\"" : "", p = e.children, m = [];
456
+ for (let e = 0; e < p.length; e++) {
457
+ let r = p[e], o = i[e] ?? "100%", s = Math.floor(a[e] ?? t.containerWidth), c = Pe(r, t.allowHtmlBlocks).filter((e) => !f(e)), l = t.withContainerWidth(s), u = c.map((e) => Z(e, n(e, l))).filter((e) => e !== "").join("\n");
458
+ m.push(`<mj-column width="${o}"${d}>
461
459
  ${u === "" ? "<mj-text>&nbsp;</mj-text>" : u}
462
460
  </mj-column>`);
463
461
  }
464
- let m = p.join("\n");
462
+ let h = m.join("\n");
465
463
  return `<mj-section${s} padding="${o}"${u}${l}${c}${d}>
466
- ${e.stackOnMobile === !1 && p.length > 1 ? `<mj-group${d}>
467
- ${m}
468
- </mj-group>` : m}
464
+ ${e.stackOnMobile === !1 && m.length > 1 ? `<mj-group${d}>
465
+ ${h}
466
+ </mj-group>` : h}
469
467
  </mj-section>`;
470
468
  }
471
- function Me(e, t) {
469
+ function Pe(e, t) {
472
470
  return t ? e : e.filter((e) => e.type !== "html");
473
471
  }
474
472
  //#endregion
475
473
  //#region ../renderer/src/renderers/video.ts
476
- function Ne(e, t) {
474
+ function Fe(e, t) {
477
475
  if (t) return t;
478
476
  if (!e) return null;
479
477
  for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/]) {
@@ -483,79 +481,79 @@ function Ne(e, t) {
483
481
  let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
484
482
  return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
485
483
  }
486
- function Pe(e, t) {
487
- if (w(e)) return "";
488
- let n = Ne(e.url, e.thumbnailUrl);
484
+ function Ie(e, t) {
485
+ if (D(e)) return "";
486
+ let n = Fe(e.url, e.thumbnailUrl);
489
487
  if (!n) return "";
490
- let r = L(e.styles.padding), i = R(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = z(e.height), s = T(e);
488
+ let r = V(e.styles.padding), i = H(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = U(e.height), s = O(e);
491
489
  return `<mj-image
492
- src="${N(n)}"
493
- alt="${N(e.alt)}"
490
+ src="${I(n)}"
491
+ alt="${I(e.alt)}"
494
492
  width="${a}"${o}
495
493
  align="${e.align}"
496
494
  padding="${r}"
497
- href="${N(e.url)}"
495
+ href="${I(e.url)}"
498
496
  target="_blank"
499
497
  rel="noopener"${i}${s}
500
498
  />`;
501
499
  }
502
500
  //#endregion
503
501
  //#region ../renderer/src/renderers/index.ts
504
- function Y(t, r) {
505
- let i = r.blockRenderers[t.type];
506
- return i ? i(t, r) : h(t) ? je(t, r, Y) : l(t) ? se(t, r) : p(t) ? ue(t, r) : u(t) ? de(t, r) : a(t) ? fe(t, r) : n(t) ? _e(t, r) : m(t) ? ve(t, r) : e(t) ? ye(t, r) : s(t) ? be(t, r) : g(t) ? xe(t, r) : ee(t) ? Te(t, r) : f(t) ? Pe(t, r) : o(t) ? Ae(t, r) : w(t) ? "" : k(t);
502
+ function Q(e, t) {
503
+ let n = t.blockRenderers[e.type];
504
+ return n ? n(e, t) : f(e) ? Ne(e, t, Q) : b(e) ? ce(e, t) : S(e) ? de(e, t) : u(e) ? fe(e, t) : C(e) ? pe(e, t) : x(e) ? ve(e, t) : p(e) ? ye(e, t) : g(e) ? be(e, t) : ee(e) ? xe(e, t) : y(e) ? Se(e, t) : m(e) ? Ee(e, t) : _(e) ? Ie(e, t) : v(e) ? je(e, t) : D(e) ? "" : M(e);
507
505
  }
508
506
  //#endregion
509
507
  //#region ../renderer/src/index.ts
510
- var Fe = `.${G} a { display: block !important; }`;
511
- async function Ie(e, n) {
512
- let i = n?.layout ? c(n.layout, e) : (te(e), r(e), e), a = n?.customFonts ?? [], o = n?.defaultFallbackFont ?? "Arial, sans-serif", s = n?.allowHtmlBlocks ?? !0, l = Re(n?.socialIconsBaseUrl ?? S), u = await Ve(i, n?.renderCustomBlock), d = He(i, n?.getCustomBlockStylesheet), f = t(i.settings), p = new C(i.settings.width, a, o, s, u, l, n?.blockRenderers ?? {}, f), m = Q(i.blocks, s), h = p.resolveFontFamily(i.settings.fontFamily), ee = i.settings.backgroundColor, g = i.settings.textColor ? ` color="${N(i.settings.textColor)}"` : "", _ = i.settings.linkColor ? P(i.settings.linkColor) : "inherit", v = i.settings.linkUnderline ? "underline" : "none", y = m.map((e) => X(e, p)).filter((e) => e !== "").join("\n"), b = Be(a), ne = ze(i.settings.preheaderText);
513
- return `<mjml lang="${N(i.settings.locale)}" dir="${N(f)}">
514
- <mj-head>${ne}
508
+ var Le = `.${Y} a { display: block !important; }`;
509
+ async function Re(e, t) {
510
+ let r = t?.layout ? s(t.layout, e) : (i(e), n(e), e), a = t?.customFonts ?? [], o = t?.defaultFallbackFont ?? "Arial, sans-serif", l = t?.allowHtmlBlocks ?? !0, u = He(t?.socialIconsBaseUrl ?? T), d = await Ke(r, t?.renderCustomBlock), f = qe(r, t?.getCustomBlockStylesheet), p = c(r.settings), m = new E(r.settings.width, a, o, l, d, u, t?.blockRenderers ?? {}, p), h = Ge(r.blocks, l), g = m.resolveFontFamily(r.settings.fontFamily), _ = r.settings.backgroundColor, v = r.settings.textColor ? ` color="${I(r.settings.textColor)}"` : "", y = r.settings.linkColor ? L(r.settings.linkColor) : "inherit", b = r.settings.linkUnderline ? "underline" : "none", x = h.map((e) => ze(e, m)).filter((e) => e !== "").join("\n"), S = We(a), C = Ue(r.settings.preheaderText);
511
+ return `<mjml lang="${I(r.settings.locale)}" dir="${I(p)}">
512
+ <mj-head>${C}
515
513
  <mj-attributes>
516
- <mj-all font-family="${h}" />
517
- <mj-text font-size="14px"${g} />
514
+ <mj-all font-family="${R(g)}" />
515
+ <mj-text font-size="14px"${v} />
518
516
  <mj-section padding="0" />
519
517
  <mj-column padding="0" />
520
518
  <mj-image fluid-on-mobile="true" />
521
- </mj-attributes>${b}
519
+ </mj-attributes>${S}
522
520
  <mj-style inline="inline">
523
- ${ae(oe(m), f)}
524
- ${Fe}
521
+ ${oe(se(h), p)}
522
+ ${Le}
525
523
  </mj-style>
526
524
  <mj-style>
527
- a { color: ${_}; text-decoration: ${v}; }
525
+ a { color: ${y}; text-decoration: ${b}; }
528
526
  @media only screen and (max-width: 480px) {
529
527
  .tpl-hide-mobile { display: none !important; mso-hide: all !important; }
530
528
  }
531
529
  @media only screen and (min-width: 481px) {
532
530
  .tpl-hide-desktop { display: none !important; mso-hide: all !important; }
533
531
  }
534
- </mj-style>${Ue(d)}
532
+ </mj-style>${Je(f)}
535
533
  </mj-head>
536
- <mj-body width="${p.containerWidth}px" background-color="${ee}">
537
- ${y}
534
+ <mj-body width="${m.containerWidth}px" background-color="${_}">
535
+ ${x}
538
536
  </mj-body>
539
537
  </mjml>`;
540
538
  }
541
- function X(e, t) {
542
- if (_(e)) return J(e, Z(Q(e.children, t.allowHtmlBlocks).map((e) => X(e, t)).filter((e) => e !== "").join("\n"), {
539
+ function ze(e, t) {
540
+ if (h(e)) return Z(e, Be(Ge(e.children, t.allowHtmlBlocks).map((e) => ze(e, t)).filter((e) => e !== "").join("\n"), {
543
541
  backgroundColor: e.styles.backgroundColor,
544
542
  padding: e.styles.padding,
545
543
  borderRadius: e.borderRadius
546
544
  }, t.contentDirection));
547
- if (h(e)) {
548
- let n = Y(e, t);
549
- return J(e, e.wrapper && n !== "" ? Z(n, e.wrapper, t.contentDirection) : n);
545
+ if (f(e)) {
546
+ let n = Q(e, t);
547
+ return Z(e, e.wrapper && n !== "" ? Be(n, e.wrapper, t.contentDirection) : n);
550
548
  }
551
- return J(e, Le(Y(e, t), t.contentDirection));
549
+ return Z(e, Ve(Q(e, t), t.contentDirection));
552
550
  }
553
- function Z(e, t, n) {
554
- return `<mj-wrapper${R(t.backgroundColor, "native")}${` padding="${t.padding ? L(t.padding) : "0"}"`}${V(t.borderRadius)}${n === "rtl" ? " direction=\"rtl\"" : ""}>
551
+ function Be(e, t, n) {
552
+ return `<mj-wrapper${H(t.backgroundColor, "native")}${` padding="${t.padding ? V(t.padding) : "0"}"`}${G(t.borderRadius)}${n === "rtl" ? " direction=\"rtl\"" : ""}>
555
553
  ${e}
556
554
  </mj-wrapper>`;
557
555
  }
558
- function Le(e, t) {
556
+ function Ve(e, t) {
559
557
  if (e === "") return "";
560
558
  let n = t === "rtl" ? " direction=\"rtl\"" : "";
561
559
  return `<mj-section${n}>
@@ -564,21 +562,21 @@ ${e}
564
562
  </mj-column>
565
563
  </mj-section>`;
566
564
  }
567
- function Re(e) {
565
+ function He(e) {
568
566
  return e.endsWith("/") ? e.slice(0, -1) : e;
569
567
  }
570
- function ze(e) {
568
+ function Ue(e) {
571
569
  if (!e) return "";
572
570
  let t = e.trim();
573
- return t === "" ? "" : `\n <mj-preview>${M(t)}</mj-preview>`;
571
+ return t === "" ? "" : `\n <mj-preview>${F(t)}</mj-preview>`;
574
572
  }
575
- function Be(e) {
576
- return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${N(e.name)}" href="${N(e.url)}" />`).join("");
573
+ function We(e) {
574
+ return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${I(e.name)}" href="${I(e.url)}" />`).join("");
577
575
  }
578
- function Q(e, t) {
576
+ function Ge(e, t) {
579
577
  return t ? e : e.filter((e) => e.type !== "html");
580
578
  }
581
- async function Ve(e, t) {
579
+ async function Ke(e, t) {
582
580
  let n = /* @__PURE__ */ new Map();
583
581
  if (!t) return n;
584
582
  let r = [];
@@ -588,11 +586,11 @@ async function Ve(e, t) {
588
586
  return n;
589
587
  }
590
588
  function $(e, t) {
591
- for (let n of e) if (o(n)) t.push(n);
592
- else if (h(n)) for (let e of n.children) $(e, t);
593
- else _(n) && $(n.children, t);
589
+ for (let n of e) if (v(n)) t.push(n);
590
+ else if (f(n)) for (let e of n.children) $(e, t);
591
+ else h(n) && $(n.children, t);
594
592
  }
595
- function He(e, t) {
593
+ function qe(e, t) {
596
594
  if (!t) return [];
597
595
  let n = [];
598
596
  if ($(e.blocks, n), n.length === 0) return [];
@@ -607,10 +605,10 @@ function He(e, t) {
607
605
  }
608
606
  return a;
609
607
  }
610
- function Ue(e) {
608
+ function Je(e) {
611
609
  return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e}\n </mj-style>`).join("");
612
610
  }
613
611
  //#endregion
614
- export { G as BUTTON_FULL_WIDTH_CSS_CLASS, S as DEFAULT_SOCIAL_ICONS_BASE_URL, H as RICH_TEXT_CSS_CLASS, C as RenderContext, D as UNRENDERABLE_MARKER_PREFIX, F as convertMergeTagsToValues, N as escapeAttr, M as escapeHtml, T as getCssClassAttr, E as getCssClasses, K as getWidthPercentages, q as getWidthPixels, w as isHiddenOnAll, Y as renderBlock, Ie as renderToMjml, k as renderUnrenderableBlock, W as resolveParagraphGap, U as richTextGapClass, L as toPaddingString };
612
+ export { Y as BUTTON_FULL_WIDTH_CSS_CLASS, T as DEFAULT_SOCIAL_ICONS_BASE_URL, K as RICH_TEXT_CSS_CLASS, E as RenderContext, A as UNRENDERABLE_MARKER_PREFIX, z as convertMergeTagsToValues, I as escapeAttr, F as escapeHtml, O as getCssClassAttr, k as getCssClasses, X as getWidthPercentages, Me as getWidthPixels, D as isHiddenOnAll, Q as renderBlock, Re as renderToMjml, M as renderUnrenderableBlock, J as resolveParagraphGap, q as richTextGapClass, V as toPaddingString };
615
613
 
616
- //# sourceMappingURL=src-CkXmV2I2.js.map
614
+ //# sourceMappingURL=src-BMw3u-iV.js.map