@templatical/editor 0.29.1 → 0.30.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 (130) hide show
  1. package/dist/{AiChatSidebar-DsYJwCLT.js → AiChatSidebar-Bq99wU01.js} +1 -1
  2. package/dist/{AiFeatureMenu-CehKC-dh.js → AiFeatureMenu-F-C59LAV.js} +1 -1
  3. package/dist/{BlockPreviewCanvas-BQZ7aTPr.js → BlockPreviewCanvas-CqU1kwmG.js} +1 -1
  4. package/dist/{CloudHeaderExtras-CaRdlYpY.js → CloudHeaderExtras-vnGV_mLD.js} +1 -1
  5. package/dist/{CloudPanels-CYqHk1Az.js → CloudPanels-Dv-MD1Tc.js} +1 -1
  6. package/dist/{CollaboratorBar-BZi12Mut.js → CollaboratorBar-DmssyJoB.js} +1 -1
  7. package/dist/{CountdownToolbar-ByQVLqFF.js → CountdownToolbar-SwmE7CIk.js} +16 -16
  8. package/dist/{DesignReferenceSidebar-B9anB-Q0.js → DesignReferenceSidebar-9cLTzOqP.js} +1 -1
  9. package/dist/{NumberWithSuffix-C-k0BP1m.js → FieldRow-0-UbQR4a.js} +23 -16
  10. package/dist/{MergeTagModeToggle-sBEGugix.js → MergeTagModeToggle-DtD_Xl9w.js} +1 -1
  11. package/dist/{ParagraphEditor-gbp5gbFv.js → ParagraphEditor-C0NbqDmV.js} +2 -2
  12. package/dist/{RestoreVersionDialog-DIHpGfFr.js → RestoreVersionDialog-DCX0rJiV.js} +1 -1
  13. package/dist/{SaveBlockDialog-QSj7tf1p.js → SaveBlockDialog-e5LtQRVk.js} +3 -3
  14. package/dist/{SavedBlocksBrowserModal-Bz2xaBzJ.js → SavedBlocksBrowserModal-ZQIQoARO.js} +4 -4
  15. package/dist/{SavedBlocksPanels-RNgOnK9j.js → SavedBlocksPanels-pGZWjSmp.js} +1 -1
  16. package/dist/{SavedBlocksPickBar-CRmd3sD9.js → SavedBlocksPickBar-OZaOG1Si.js} +1 -1
  17. package/dist/{TestEmailModal-DclmELUc.js → TestEmailModal-PVa1VL2p.js} +5 -5
  18. package/dist/{TestEmailPanel-4i4n9Kup.js → TestEmailPanel-RekBdAtO.js} +1 -1
  19. package/dist/{TitleEditor-DMAeSWx3.js → TitleEditor-Cs2tELCL.js} +2 -2
  20. package/dist/{TplModal-CjuKT36J.js → TplModal-Bw1i8_eE.js} +1 -1
  21. package/dist/{VersionHistoryPanels-MqgexkhW.js → VersionHistoryPanels-TqTC4ofA.js} +1 -1
  22. package/dist/{blockTypeIcons-ejNais7n.js → blockTypeIcons-C7WedEOG.js} +1 -1
  23. package/dist/bundle-stats.json +6 -6
  24. package/dist/{cdn/chunks/ca-DY0AYOLG.js → ca-DZSrLNXK.js} +2 -2
  25. package/dist/cdn/chunks/{AiChatSidebar-BE97qqqb.js → AiChatSidebar-DmZ1Nvxo.js} +2 -2
  26. package/dist/cdn/chunks/{AiChatSidebar-BE97qqqb.js.map → AiChatSidebar-DmZ1Nvxo.js.map} +1 -1
  27. package/dist/cdn/chunks/{AiFeatureMenu-CNP54HPc.js → AiFeatureMenu-D4tax9j3.js} +2 -2
  28. package/dist/cdn/chunks/{AiFeatureMenu-CNP54HPc.js.map → AiFeatureMenu-D4tax9j3.js.map} +1 -1
  29. package/dist/cdn/chunks/{BlockPreviewCanvas-CUEZIwJ4.js → BlockPreviewCanvas-DDOqFJlT.js} +2 -2
  30. package/dist/cdn/chunks/{BlockPreviewCanvas-CUEZIwJ4.js.map → BlockPreviewCanvas-DDOqFJlT.js.map} +1 -1
  31. package/dist/cdn/chunks/{CloudHeaderExtras-Bz--_dKu.js → CloudHeaderExtras-g-_SFPna.js} +2 -2
  32. package/dist/cdn/chunks/{CloudHeaderExtras-Bz--_dKu.js.map → CloudHeaderExtras-g-_SFPna.js.map} +1 -1
  33. package/dist/cdn/chunks/{CloudPanels-BXcdYgy0.js → CloudPanels-Cnh07_2G.js} +3 -3
  34. package/dist/cdn/chunks/{CloudPanels-BXcdYgy0.js.map → CloudPanels-Cnh07_2G.js.map} +1 -1
  35. package/dist/cdn/chunks/{CollaboratorBar-CvvoIrKS.js → CollaboratorBar-CLGB0prG.js} +2 -2
  36. package/dist/cdn/chunks/{CollaboratorBar-CvvoIrKS.js.map → CollaboratorBar-CLGB0prG.js.map} +1 -1
  37. package/dist/cdn/chunks/{CountdownToolbar-BD90NpY1.js → CountdownToolbar-CO6xLgYc.js} +17 -17
  38. package/dist/cdn/chunks/{CountdownToolbar-BD90NpY1.js.map → CountdownToolbar-CO6xLgYc.js.map} +1 -1
  39. package/dist/cdn/chunks/{DesignReferenceSidebar-DY-laxO5.js → DesignReferenceSidebar-DRGqm33h.js} +2 -2
  40. package/dist/cdn/chunks/{DesignReferenceSidebar-DY-laxO5.js.map → DesignReferenceSidebar-DRGqm33h.js.map} +1 -1
  41. package/dist/cdn/chunks/{NumberWithSuffix-DOG0zHvY.js → FieldRow-CbcpsxZ4.js} +24 -17
  42. package/dist/cdn/chunks/FieldRow-CbcpsxZ4.js.map +1 -0
  43. package/dist/cdn/chunks/{MergeTagModeToggle-BRW3qErZ.js → MergeTagModeToggle-DZtnCj0F.js} +2 -2
  44. package/dist/cdn/chunks/{MergeTagModeToggle-BRW3qErZ.js.map → MergeTagModeToggle-DZtnCj0F.js.map} +1 -1
  45. package/dist/cdn/chunks/{ParagraphEditor-CPVnO48U.js → ParagraphEditor-BalgLjBt.js} +3 -3
  46. package/dist/cdn/chunks/{ParagraphEditor-CPVnO48U.js.map → ParagraphEditor-BalgLjBt.js.map} +1 -1
  47. package/dist/cdn/chunks/{RestoreVersionDialog--Blx-VKu.js → RestoreVersionDialog-DGOXQ0ou.js} +2 -2
  48. package/dist/cdn/chunks/{RestoreVersionDialog--Blx-VKu.js.map → RestoreVersionDialog-DGOXQ0ou.js.map} +1 -1
  49. package/dist/cdn/chunks/{SaveBlockDialog-DXQ2g_38.js → SaveBlockDialog-Dod3jX9X.js} +4 -4
  50. package/dist/cdn/chunks/{SaveBlockDialog-DXQ2g_38.js.map → SaveBlockDialog-Dod3jX9X.js.map} +1 -1
  51. package/dist/cdn/chunks/{SavedBlocksBrowserModal-DWBvVkuk.js → SavedBlocksBrowserModal-BysGB8zb.js} +4 -4
  52. package/dist/cdn/chunks/{SavedBlocksBrowserModal-DWBvVkuk.js.map → SavedBlocksBrowserModal-BysGB8zb.js.map} +1 -1
  53. package/dist/cdn/chunks/{SavedBlocksPanels-GgdpiPUq.js → SavedBlocksPanels-DJ4fceEM.js} +2 -2
  54. package/dist/cdn/chunks/{SavedBlocksPanels-GgdpiPUq.js.map → SavedBlocksPanels-DJ4fceEM.js.map} +1 -1
  55. package/dist/cdn/chunks/{SavedBlocksPickBar-Dyb5xi1B.js → SavedBlocksPickBar-DGgbqAsb.js} +2 -2
  56. package/dist/cdn/chunks/{SavedBlocksPickBar-Dyb5xi1B.js.map → SavedBlocksPickBar-DGgbqAsb.js.map} +1 -1
  57. package/dist/cdn/chunks/{TestEmailModal-B9SmAIKZ.js → TestEmailModal-DvZFnhWa.js} +6 -6
  58. package/dist/cdn/chunks/{TestEmailModal-B9SmAIKZ.js.map → TestEmailModal-DvZFnhWa.js.map} +1 -1
  59. package/dist/cdn/chunks/{TestEmailPanel-Q6alElB1.js → TestEmailPanel-BdxpMiWc.js} +2 -2
  60. package/dist/cdn/chunks/{TestEmailPanel-Q6alElB1.js.map → TestEmailPanel-BdxpMiWc.js.map} +1 -1
  61. package/dist/cdn/chunks/{TitleEditor-Tudoac5f.js → TitleEditor-CfHWnThg.js} +3 -3
  62. package/dist/cdn/chunks/{TitleEditor-Tudoac5f.js.map → TitleEditor-CfHWnThg.js.map} +1 -1
  63. package/dist/cdn/chunks/{TplModal-BNJIFnyj.js → TplModal-BMTW5bEN.js} +2 -2
  64. package/dist/cdn/chunks/{TplModal-BNJIFnyj.js.map → TplModal-BMTW5bEN.js.map} +1 -1
  65. package/dist/cdn/chunks/{VersionHistoryPanels-Crw5JA89.js → VersionHistoryPanels-2l_FLtix.js} +2 -2
  66. package/dist/cdn/chunks/{VersionHistoryPanels-Crw5JA89.js.map → VersionHistoryPanels-2l_FLtix.js.map} +1 -1
  67. package/dist/{ca-DY0AYOLG.js → cdn/chunks/ca-DZSrLNXK.js} +4 -0
  68. package/dist/cdn/chunks/ca-DZSrLNXK.js.map +1 -0
  69. package/dist/cdn/chunks/{cloud-C29LPXYn.js → cloud-CITqEHEc.js} +2 -2
  70. package/dist/cdn/chunks/{cloud-C29LPXYn.js.map → cloud-CITqEHEc.js.map} +1 -1
  71. package/dist/cdn/chunks/{createCloudRuntime-C6MJN7M6.js → createCloudRuntime-jLhuyKds.js} +4 -4
  72. package/dist/cdn/chunks/{createCloudRuntime-C6MJN7M6.js.map → createCloudRuntime-jLhuyKds.js.map} +1 -1
  73. package/dist/cdn/chunks/{de-CYLWugqb.js → de-DbayqpK-.js} +3 -1
  74. package/dist/cdn/chunks/{de-CYLWugqb.js.map → de-DbayqpK-.js.map} +1 -1
  75. package/dist/cdn/chunks/en-CwXyUb6-.js +2 -0
  76. package/dist/cdn/chunks/{en-C3TM249M.js → en-l0ib5X0f.js} +3 -1
  77. package/dist/cdn/chunks/en-l0ib5X0f.js.map +1 -0
  78. package/dist/{es-D1SF4nCR.js → cdn/chunks/es-CMQ-5PJP.js} +4 -0
  79. package/dist/cdn/chunks/es-CMQ-5PJP.js.map +1 -0
  80. package/dist/cdn/chunks/{extensions-BQefRevf.js → extensions-D30V0hzj.js} +3 -3
  81. package/dist/cdn/chunks/{extensions-BQefRevf.js.map → extensions-D30V0hzj.js.map} +1 -1
  82. package/dist/cdn/chunks/{fr-CdLhJ7kw.js → fr-DNXmZWAq.js} +3 -1
  83. package/dist/cdn/chunks/fr-DNXmZWAq.js.map +1 -0
  84. package/dist/{nl-BvsLoyKp.js → cdn/chunks/nl-BylRRHYJ.js} +4 -0
  85. package/dist/cdn/chunks/nl-BylRRHYJ.js.map +1 -0
  86. package/dist/cdn/chunks/{preRenderCustomBlocks-CbA3RcAy.js → preRenderCustomBlocks-DyCIgmqJ.js} +2 -2
  87. package/dist/cdn/chunks/{preRenderCustomBlocks-CbA3RcAy.js.map → preRenderCustomBlocks-DyCIgmqJ.js.map} +1 -1
  88. package/dist/cdn/chunks/{pt-BR-CAGS5YXp.js → pt-BR-BVoJhpie.js} +3 -1
  89. package/dist/cdn/chunks/pt-BR-BVoJhpie.js.map +1 -0
  90. package/dist/cdn/chunks/{src-fxaI2EQc.js → src-65H3RNcb.js} +3 -3
  91. package/dist/cdn/chunks/{src-fxaI2EQc.js.map → src-65H3RNcb.js.map} +1 -1
  92. package/dist/cdn/chunks/{src-Cx70q30o.js → src-6J-yyZoD.js} +2 -2
  93. package/dist/cdn/chunks/{src-Cx70q30o.js.map → src-6J-yyZoD.js.map} +1 -1
  94. package/dist/cdn/chunks/{src-B_QJduQD.js → src-BD60gqPW.js} +72 -67
  95. package/dist/cdn/chunks/src-BD60gqPW.js.map +1 -0
  96. package/dist/cdn/chunks/{src-CjSrA_o4.js → src-CLTXM4PM.js} +166 -136
  97. package/dist/cdn/chunks/src-CLTXM4PM.js.map +1 -0
  98. package/dist/cdn/chunks/{useEditorCore-o2emEjgF.js → useEditorCore-BQeEwEQ9.js} +351 -356
  99. package/dist/cdn/chunks/{useEditorCore-o2emEjgF.js.map → useEditorCore-BQeEwEQ9.js.map} +1 -1
  100. package/dist/cdn/chunks/{useMergeTag-BWt1DQS1.js → useMergeTag-lWo7So18.js} +2 -2
  101. package/dist/cdn/chunks/{useMergeTag-BWt1DQS1.js.map → useMergeTag-lWo7So18.js.map} +1 -1
  102. package/dist/cdn/editor.css +1 -1
  103. package/dist/cdn/editor.js +941 -909
  104. package/dist/cdn/editor.js.map +1 -1
  105. package/dist/{cloud-CHHQWdaR.js → cloud-DwJ8ebNl.js} +1 -1
  106. package/dist/{createCloudRuntime-WwKt9mgb.js → createCloudRuntime-CdXQdl34.js} +2 -2
  107. package/dist/{de-CYLWugqb.js → de-DbayqpK-.js} +2 -0
  108. package/dist/{dist-B1kLn1rs.js → dist-CzVIVbSa.js} +90 -85
  109. package/dist/{en-C3TM249M.js → en-l0ib5X0f.js} +2 -0
  110. package/dist/{cdn/chunks/es-D1SF4nCR.js → es-CMQ-5PJP.js} +2 -2
  111. package/dist/{extensions-B4gwZ36u.js → extensions-Bjsdx6Vm.js} +12 -12
  112. package/dist/{fr-CdLhJ7kw.js → fr-DNXmZWAq.js} +2 -0
  113. package/dist/{cdn/chunks/nl-BvsLoyKp.js → nl-BylRRHYJ.js} +2 -2
  114. package/dist/{preRenderCustomBlocks-BebjKtmw.js → preRenderCustomBlocks-2KyBJocY.js} +1 -1
  115. package/dist/{pt-BR-CAGS5YXp.js → pt-BR-BVoJhpie.js} +2 -0
  116. package/dist/style.css +1 -1
  117. package/dist/templatical-editor.js +983 -951
  118. package/dist/{useEditorCore-CJp84vJY.js → useEditorCore-Du9Vx-qr.js} +868 -873
  119. package/dist/{useMergeTag-D1Rsn4BO.js → useMergeTag-Cx36rtrt.js} +3 -3
  120. package/package.json +7 -7
  121. package/dist/cdn/chunks/NumberWithSuffix-DOG0zHvY.js.map +0 -1
  122. package/dist/cdn/chunks/ca-DY0AYOLG.js.map +0 -1
  123. package/dist/cdn/chunks/en-C3TM249M.js.map +0 -1
  124. package/dist/cdn/chunks/en-DIwntrh3.js +0 -2
  125. package/dist/cdn/chunks/es-D1SF4nCR.js.map +0 -1
  126. package/dist/cdn/chunks/fr-CdLhJ7kw.js.map +0 -1
  127. package/dist/cdn/chunks/nl-BvsLoyKp.js.map +0 -1
  128. package/dist/cdn/chunks/pt-BR-CAGS5YXp.js.map +0 -1
  129. package/dist/cdn/chunks/src-B_QJduQD.js.map +0 -1
  130. package/dist/cdn/chunks/src-CjSrA_o4.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { $ as e, G as t, H as n, J as r, K as i, Q as a, U as o, V as s, W as c, X as l, Y as u, Z as d, q as f, tt as p, v as m, y as h } from "./src-B_QJduQD.js";
1
+ import { $ as e, G as t, H as n, J as r, K as i, Q as a, U as o, V as s, W as c, X as l, Y as u, Z as d, nt as f, q as p, tt as m, v as h, y as g } from "./src-BD60gqPW.js";
2
2
  //#endregion
3
3
  //#region ../renderer/src/render-context.ts
4
- var g = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
4
+ var _ = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
5
5
  name: "@templatical/renderer",
6
6
  description: "Render Templatical email templates to MJML",
7
- version: "0.29.1",
7
+ version: "0.30.0",
8
8
  bugs: "https://github.com/templatical/sdk/issues",
9
9
  dependencies: { "@templatical/types": "workspace:*" },
10
10
  devDependencies: {
@@ -42,7 +42,7 @@ var g = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
42
42
  },
43
43
  type: "module",
44
44
  types: "./dist/index.d.ts"
45
- }.version}/assets/social`, _ = {
45
+ }.version}/assets/social`, v = {
46
46
  arial: "Arial, sans-serif",
47
47
  helvetica: "Helvetica, sans-serif",
48
48
  georgia: "Georgia, serif",
@@ -51,7 +51,7 @@ var g = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
51
51
  "trebuchet ms": "'Trebuchet MS', sans-serif",
52
52
  "courier new": "'Courier New', monospace",
53
53
  tahoma: "Tahoma, sans-serif"
54
- }, v = class e {
54
+ }, y = class e {
55
55
  containerWidth;
56
56
  customFonts;
57
57
  defaultFallbackFont;
@@ -59,7 +59,7 @@ var g = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
59
59
  customBlockHtml;
60
60
  socialIconsBaseUrl;
61
61
  blockRenderers;
62
- constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = g, o = {}) {
62
+ constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = _, o = {}) {
63
63
  this.containerWidth = e, this.customFonts = t, this.defaultFallbackFont = n, this.allowHtmlBlocks = r, this.customBlockHtml = i, this.socialIconsBaseUrl = a, this.blockRenderers = o;
64
64
  }
65
65
  withContainerWidth(t) {
@@ -70,20 +70,20 @@ var g = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
70
70
  let e = t.fallback ?? this.defaultFallbackFont;
71
71
  return `'${t.name}', ${e}`;
72
72
  }
73
- return _[e.toLowerCase()] || e;
73
+ return v[e.toLowerCase()] || e;
74
74
  }
75
75
  };
76
76
  //#endregion
77
77
  //#region ../renderer/src/visibility.ts
78
- function y(e) {
78
+ function b(e) {
79
79
  let t = e.visibility;
80
80
  return t ? !t.desktop && !t.mobile : !1;
81
81
  }
82
- function b(e) {
83
- let t = x(e);
84
- return t === "" ? "" : ` css-class="${t}"`;
82
+ function x(e, t = []) {
83
+ let n = [S(e), ...t].filter((e) => e !== "").join(" ");
84
+ return n === "" ? "" : ` css-class="${n}"`;
85
85
  }
86
- function x(e) {
86
+ function S(e) {
87
87
  let t = e.visibility;
88
88
  if (!t) return "";
89
89
  let n = [];
@@ -91,33 +91,33 @@ function x(e) {
91
91
  }
92
92
  //#endregion
93
93
  //#region ../renderer/src/unrenderable.ts
94
- var S = "templatical:unrenderable-block";
95
- function C(e) {
94
+ var C = "templatical:unrenderable-block";
95
+ function w(e) {
96
96
  return e.replace(/[<>]/g, "").replace(/-{2,}/g, "-");
97
97
  }
98
- function w(e) {
99
- 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><!-- ${S} type="${C(e.type)}" id="${C(e.id)}" --></mj-raw>`;
98
+ function T(e) {
99
+ 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><!-- ${C} type="${w(e.type)}" id="${w(e.id)}" --></mj-raw>`;
100
100
  }
101
101
  //#endregion
102
102
  //#region ../renderer/src/escape.ts
103
- var T = {
103
+ var E = {
104
104
  "&": "&amp;",
105
105
  "<": "&lt;",
106
106
  ">": "&gt;",
107
107
  "\"": "&quot;",
108
108
  "'": "&#039;"
109
- }, E = /[&<>"']/g;
110
- function D(e) {
111
- return e === "" ? "" : e.replace(E, (e) => T[e] ?? e);
112
- }
109
+ }, D = /[&<>"']/g;
113
110
  function O(e) {
114
- return e === "" ? "" : e.replace(E, (e) => T[e] ?? e);
111
+ return e === "" ? "" : e.replace(D, (e) => E[e] ?? e);
115
112
  }
116
113
  function k(e) {
117
- return e === "" ? "" : O(e).replace(/[;{}\r\n]/g, "");
114
+ return e === "" ? "" : e.replace(D, (e) => E[e] ?? e);
118
115
  }
119
116
  function A(e) {
120
- return e === "" ? "" : ee(e, (e) => j(e, "data-merge-tag") ?? j(e, "data-logic-merge-tag"));
117
+ return e === "" ? "" : k(e).replace(/[;{}\r\n]/g, "");
118
+ }
119
+ function j(e) {
120
+ return e === "" ? "" : ee(e, (e) => M(e, "data-merge-tag") ?? M(e, "data-logic-merge-tag"));
121
121
  }
122
122
  function ee(e, t) {
123
123
  let n = "", r = 0;
@@ -132,7 +132,7 @@ function ee(e, t) {
132
132
  n += e.substring(r, i + 5), r = i + 5;
133
133
  continue;
134
134
  }
135
- let o = m(e, i + 5);
135
+ let o = h(e, i + 5);
136
136
  if (o === -1) {
137
137
  n += e.substring(r);
138
138
  break;
@@ -151,27 +151,54 @@ function ee(e, t) {
151
151
  }
152
152
  return n;
153
153
  }
154
- function j(e, t) {
155
- return h(e, t);
154
+ function M(e, t) {
155
+ return g(e, t);
156
156
  }
157
157
  //#endregion
158
158
  //#region ../renderer/src/padding.ts
159
- function M(e) {
159
+ function N(e) {
160
160
  return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
161
161
  }
162
162
  //#endregion
163
163
  //#region ../renderer/src/utils.ts
164
- function N(e, t) {
164
+ function P(e, t) {
165
165
  return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
166
166
  }
167
- function P(e) {
167
+ function F(e) {
168
168
  return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? "" : ` height="${e}px"`;
169
169
  }
170
170
  //#endregion
171
+ //#region ../renderer/src/rich-text.ts
172
+ var I = "tpl-rich-text";
173
+ function L(e) {
174
+ return `${I}-${e}`;
175
+ }
176
+ function te(e) {
177
+ let t = f, n = `.${I}`;
178
+ return [
179
+ ...[...new Set(e)].sort((e, t) => e - t).flatMap((e) => {
180
+ let t = `.${L(e)}`;
181
+ return [`${t} p { margin: 0 0 ${e}px; }`, `${t} p:last-child { margin-bottom: 0; }`];
182
+ }),
183
+ `${n} ul, ${n} ol { margin: ${t.listMarginY}px 0; padding-left: ${t.listPaddingLeft}px; }`,
184
+ `${n} li { margin: ${t.listItemMarginY}px 0; }`
185
+ ].join("\n ");
186
+ }
187
+ function R(e) {
188
+ return e ?? f.paragraphGap;
189
+ }
190
+ function ne(e) {
191
+ let t = [f.paragraphGap], n = (e) => {
192
+ if (e.type === "paragraph" && t.push(R(e.paragraphSpacing)), r(e)) for (let t of e.children) for (let e of t) n(e);
193
+ };
194
+ for (let t of e) n(t);
195
+ return t;
196
+ }
197
+ //#endregion
171
198
  //#region ../renderer/src/renderers/title.ts
172
- function te(e, t) {
173
- if (y(e)) return "";
174
- let n = M(e.styles.padding), r = N(e.styles.backgroundColor, "container"), i = ne(A(e.content)), a = p[e.level] ?? p[2], o = e.color ? `\n color="${O(e.color)}"` : "", s = e.textAlign, c = re(e.fontFamily, t), l = b(e), u = `h${p[e.level] ? e.level : 2}`;
199
+ function re(e, t) {
200
+ if (b(e)) return "";
201
+ let n = N(e.styles.padding), r = P(e.styles.backgroundColor, "container"), i = ie(j(e.content)), a = m[e.level] ?? m[2], o = e.color ? `\n color="${k(e.color)}"` : "", s = e.textAlign, c = ae(e.fontFamily, t), l = x(e, [I, L(R(void 0))]), u = `h${m[e.level] ? e.level : 2}`;
175
202
  return `<mj-text
176
203
  font-size="${a}px"${o}
177
204
  align="${s}"
@@ -179,43 +206,43 @@ function te(e, t) {
179
206
  padding="${n}"${r}${c}${l}
180
207
  ><${u} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${u}></mj-text>`;
181
208
  }
182
- function ne(e) {
209
+ function ie(e) {
183
210
  let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
184
211
  return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
185
212
  }
186
- function re(e, t) {
213
+ function ae(e, t) {
187
214
  return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
188
215
  }
189
216
  //#endregion
190
217
  //#region ../renderer/src/renderers/paragraph.ts
191
- function ie(e, t) {
192
- if (y(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
193
- let n = M(e.styles.padding), r = N(e.styles.backgroundColor, "container"), i = A(e.content);
218
+ function oe(e, t) {
219
+ if (b(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
220
+ let n = N(e.styles.padding), r = P(e.styles.backgroundColor, "container"), i = j(e.content);
194
221
  return `<mj-text
195
222
  line-height="1.5"
196
- padding="${n}"${r}${b(e)}
223
+ padding="${n}"${r}${x(e, [I, L(R(e.paragraphSpacing))])}
197
224
  >${i}</mj-text>`;
198
225
  }
199
226
  //#endregion
200
227
  //#region ../renderer/src/renderers/image.ts
201
- function ae(e, t) {
202
- if (y(e) || e.src === "") return "";
203
- let n = M(e.styles.padding), r = N(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = P(e.height), o = b(e), s = "";
204
- e.linkUrl && (s = ` href="${O(e.linkUrl)}"`, e.linkOpenInNewTab && (s += " target=\"_blank\" rel=\"noopener\""));
205
- let c = O(e.src), l = e.decorative === !0;
228
+ function z(e, t) {
229
+ if (b(e) || e.src === "") return "";
230
+ let n = N(e.styles.padding), r = P(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = F(e.height), o = x(e), s = e.borderRadius && e.borderRadius > 0 ? ` border-radius="${e.borderRadius}px"` : "", c = "";
231
+ e.linkUrl && (c = ` href="${k(e.linkUrl)}"`, e.linkOpenInNewTab && (c += " target=\"_blank\" rel=\"noopener\""));
232
+ let l = k(e.src), u = e.decorative === !0;
206
233
  return `<mj-image
207
- src="${c}"
208
- alt="${l ? "" : O(e.alt)}"
234
+ src="${l}"
235
+ alt="${u ? "" : k(e.alt)}"
209
236
  width="${i}"${a}
210
237
  align="${e.align}"
211
- padding="${n}"${r}${s}${o}${l ? " role=\"presentation\"" : ""}
238
+ padding="${n}"${r}${s}${c}${o}${u ? " role=\"presentation\"" : ""}
212
239
  />`;
213
240
  }
214
241
  //#endregion
215
242
  //#region ../renderer/src/renderers/button.ts
216
- function oe(e, t) {
217
- if (y(e)) return "";
218
- let n = M(e.styles.padding), r = N(e.styles.backgroundColor, "container"), i = M(e.buttonPadding), a = e.url === "" ? "" : O(e.url), o = a === "" ? "" : ` href="${a}"`, s = O(e.backgroundColor), c = O(e.textColor), l = e.fontSize, u = e.borderRadius, d = D(e.text), f = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", p = F(e.fontFamily, t), m = I(e.width), h = b(e);
243
+ function B(e, t) {
244
+ if (b(e)) return "";
245
+ let n = N(e.styles.padding), r = P(e.styles.backgroundColor, "container"), i = N(e.buttonPadding), a = e.url === "" ? "" : k(e.url), o = a === "" ? "" : ` href="${a}"`, s = k(e.backgroundColor), c = k(e.textColor), l = e.fontSize, u = e.borderRadius, d = O(e.text), f = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", p = V(e.fontFamily, t), m = H(e.width), h = x(e);
219
246
  return `<mj-button${o}${f}
220
247
  background-color="${s}"
221
248
  color="${c}"
@@ -227,48 +254,48 @@ function oe(e, t) {
227
254
  padding="${n}"${r}${p}${m}${h}
228
255
  >${d}</mj-button>`;
229
256
  }
230
- function F(e, t) {
257
+ function V(e, t) {
231
258
  return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
232
259
  }
233
- function I(e) {
260
+ function H(e) {
234
261
  return e === void 0 ? "" : ` width="${e === "full" ? "100%" : `${e}px`}"`;
235
262
  }
236
263
  //#endregion
237
264
  //#region ../renderer/src/renderers/divider.ts
238
- function L(e, t) {
239
- if (y(e)) return "";
240
- let n = M(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${O(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
265
+ function U(e, t) {
266
+ if (b(e)) return "";
267
+ let n = N(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${k(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
241
268
  return `<mj-divider
242
269
  border-width="${e.thickness}px"
243
270
  border-style="${e.lineStyle}"
244
- border-color="${O(e.color)}"
271
+ border-color="${k(e.color)}"
245
272
  width="${i}"
246
- padding="${n}"${r}${b(e)}
273
+ padding="${n}"${r}${x(e)}
247
274
  />`;
248
275
  }
249
276
  //#endregion
250
277
  //#region ../renderer/src/renderers/spacer.ts
251
- function R(e, t) {
252
- return y(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${O(e.styles.backgroundColor)}"` : ""}${b(e)} />`;
278
+ function W(e, t) {
279
+ return b(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${k(e.styles.backgroundColor)}"` : ""}${x(e)} />`;
253
280
  }
254
281
  //#endregion
255
282
  //#region ../renderer/src/renderers/html.ts
256
- function z(e, t) {
257
- if (y(e) || !t.allowHtmlBlocks) return "";
283
+ function G(e, t) {
284
+ if (b(e) || !t.allowHtmlBlocks) return "";
258
285
  let n = e.content;
259
286
  if (n === "") return "";
260
- let r = b(e);
261
- return `<mj-text padding="${M(e.styles.padding)}"${N(e.styles.backgroundColor, "container")}${r}>
287
+ let r = x(e);
288
+ return `<mj-text padding="${N(e.styles.padding)}"${P(e.styles.backgroundColor, "container")}${r}>
262
289
  ${n}
263
290
  </mj-text>`;
264
291
  }
265
292
  //#endregion
266
293
  //#region ../renderer/src/renderers/social.ts
267
- function B(e, t) {
268
- if (y(e)) return "";
294
+ function K(e, t) {
295
+ if (b(e)) return "";
269
296
  let n = e.icons;
270
297
  if (n.length === 0) return "";
271
- let r = M(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${O(e.styles.backgroundColor)}"` : "", a = b(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
298
+ let r = N(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${k(e.styles.backgroundColor)}"` : "", a = x(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
272
299
  switch (s) {
273
300
  case "small":
274
301
  u = 24;
@@ -299,77 +326,77 @@ function B(e, t) {
299
326
  padding="${r}"${i}${a}
300
327
  >
301
328
  ${n.map((e, n) => {
302
- let r = e.platform, i = O(e.url), a = `${t.socialIconsBaseUrl}/${c}/${r}.png`, o = n === f - 1 ? 0 : l;
329
+ let r = e.platform, i = k(e.url), a = `${t.socialIconsBaseUrl}/${c}/${r}.png`, o = n === f - 1 ? 0 : l;
303
330
  return `<mj-social-element src="${a}" href="${i}" icon-size="${u}px" padding="0 ${o}px 0 0" border-radius="${d}" background-color="transparent"></mj-social-element>`;
304
331
  }).join("\n")}
305
332
  </mj-social>`;
306
333
  }
307
334
  //#endregion
308
335
  //#region ../renderer/src/renderers/menu.ts
309
- function V(e, t) {
310
- if (y(e) || e.items.length === 0) return "";
311
- let n = M(e.styles.padding), r = N(e.styles.backgroundColor, "container"), i = b(e), a = W(e.fontFamily, t), o = e.textAlign;
336
+ function q(e, t) {
337
+ if (b(e) || e.items.length === 0) return "";
338
+ let n = N(e.styles.padding), r = P(e.styles.backgroundColor, "container"), i = x(e), a = le(e.fontFamily, t), o = e.textAlign;
312
339
  return `<mj-text
313
- font-size="${e.fontSize}px"${e.color ? `\n color="${O(e.color)}"` : ""}
340
+ font-size="${e.fontSize}px"${e.color ? `\n color="${k(e.color)}"` : ""}
314
341
  align="${o}"
315
342
  line-height="1.5"
316
343
  padding="${n}"${r}${a}${i}
317
- >${H(e)}</mj-text>`;
344
+ >${se(e)}</mj-text>`;
318
345
  }
319
- function H(e) {
320
- let t = e.items, n = D(e.separator), r = k(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
321
- for (let e = 0; e < s; e++) o.push(U(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
346
+ function se(e) {
347
+ let t = e.items, n = O(e.separator), r = A(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
348
+ 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>`);
322
349
  return o.join("");
323
350
  }
324
- function U(e, t) {
325
- let n = D(e.text), r = O(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
326
- return i && o.unshift(`color: ${k(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
351
+ function ce(e, t) {
352
+ let n = O(e.text), r = k(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
353
+ return i && o.unshift(`color: ${A(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
327
354
  }
328
- function W(e, t) {
355
+ function le(e, t) {
329
356
  return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
330
357
  }
331
358
  //#endregion
332
359
  //#region ../renderer/src/renderers/table.ts
333
- function G(e, t) {
334
- if (y(e) || e.rows.length === 0) return "";
335
- let n = M(e.styles.padding), r = N(e.styles.backgroundColor, "container"), i = b(e), a = ce(e.fontFamily, t);
360
+ function ue(e, t) {
361
+ if (b(e) || e.rows.length === 0) return "";
362
+ let n = N(e.styles.padding), r = P(e.styles.backgroundColor, "container"), i = x(e), a = me(e.fontFamily, t);
336
363
  return `<mj-text
337
- font-size="${e.fontSize}px"${e.color ? `\n color="${O(e.color)}"` : ""}
364
+ font-size="${e.fontSize}px"${e.color ? `\n color="${k(e.color)}"` : ""}
338
365
  align="${e.textAlign}"
339
366
  line-height="1.5"
340
367
  padding="${n}"${r}${a}${i}
341
- >${K(e)}</mj-text>`;
368
+ >${de(e)}</mj-text>`;
342
369
  }
343
- function K(e) {
344
- let t = k(e.borderColor), n = e.borderWidth, r = "";
370
+ function de(e) {
371
+ let t = A(e.borderColor), n = e.borderWidth, r = "";
345
372
  for (let i = 0; i < e.rows.length; i++) {
346
373
  let a = e.rows[i];
347
- r += q(a, e, e.hasHeaderRow && i === 0, t, n);
374
+ r += fe(a, e, e.hasHeaderRow && i === 0, t, n);
348
375
  }
349
376
  return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
350
377
  }
351
- function q(e, t, n, r, i) {
378
+ function fe(e, t, n, r, i) {
352
379
  let a = "";
353
- for (let o of e.cells) a += se(o, t, n, r, i);
380
+ for (let o of e.cells) a += pe(o, t, n, r, i);
354
381
  return `<tr>${a}</tr>`;
355
382
  }
356
- function se(e, t, n, r, i) {
383
+ function pe(e, t, n, r, i) {
357
384
  let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
358
- n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${k(t.headerBackgroundColor)}`));
359
- let s = o.join("; "), c = D(A(e.content)), l = n ? "th" : "td";
385
+ n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${A(t.headerBackgroundColor)}`));
386
+ let s = o.join("; "), c = O(j(e.content)), l = n ? "th" : "td";
360
387
  return `<${l} style="${s}">${c}</${l}>`;
361
388
  }
362
- function ce(e, t) {
389
+ function me(e, t) {
363
390
  return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
364
391
  }
365
392
  //#endregion
366
393
  //#region ../renderer/src/renderers/custom.ts
367
- function le(e, t) {
368
- if (y(e)) return "";
394
+ function he(e, t) {
395
+ if (b(e)) return "";
369
396
  let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
370
397
  if (!n || n === "") return "";
371
- let r = b(e);
372
- return `<mj-text padding="${M(e.styles.padding)}"${N(e.styles.backgroundColor, "container")}${r}>
398
+ let r = x(e);
399
+ return `<mj-text padding="${N(e.styles.padding)}"${P(e.styles.backgroundColor, "container")}${r}>
373
400
  ${n}
374
401
  </mj-text>`;
375
402
  }
@@ -412,11 +439,11 @@ function X(e, t) {
412
439
  }
413
440
  //#endregion
414
441
  //#region ../renderer/src/renderers/section.ts
415
- function ue(e, t, n) {
416
- if (y(e)) return "";
417
- let i = e.columns, a = J(i), o = Y(i, t.containerWidth), s = M(e.styles.padding), c = N(e.styles.backgroundColor, "native"), l = b(e), u = e.borderRadius && e.borderRadius > 0 ? ` border-radius="${e.borderRadius}px"` : "", d = e.children, f = [];
442
+ function ge(e, t, n) {
443
+ if (b(e)) return "";
444
+ let i = e.columns, a = J(i), o = Y(i, t.containerWidth), s = N(e.styles.padding), c = P(e.styles.backgroundColor, "native"), l = x(e), u = e.borderRadius && e.borderRadius > 0 ? ` border-radius="${e.borderRadius}px"` : "", d = e.children, f = [];
418
445
  for (let e = 0; e < d.length; e++) {
419
- let i = d[e], s = a[e] ?? "100%", c = Math.floor(o[e] ?? t.containerWidth), l = de(i, t.allowHtmlBlocks).filter((e) => !r(e)), u = t.withContainerWidth(c), p = l.map((e) => X(e, n(e, u))).filter((e) => e !== "").join("\n");
446
+ let i = d[e], s = a[e] ?? "100%", c = Math.floor(o[e] ?? t.containerWidth), l = _e(i, t.allowHtmlBlocks).filter((e) => !r(e)), u = t.withContainerWidth(c), p = l.map((e) => X(e, n(e, u))).filter((e) => e !== "").join("\n");
420
447
  f.push(`<mj-column width="${s}">
421
448
  ${p === "" ? "<mj-text>&nbsp;</mj-text>" : p}
422
449
  </mj-column>`);
@@ -428,12 +455,12 @@ ${p}
428
455
  </mj-group>` : p}
429
456
  </mj-section>`;
430
457
  }
431
- function de(e, t) {
458
+ function _e(e, t) {
432
459
  return t ? e : e.filter((e) => e.type !== "html");
433
460
  }
434
461
  //#endregion
435
462
  //#region ../renderer/src/renderers/video.ts
436
- function fe(e, t) {
463
+ function ve(e, t) {
437
464
  if (t) return t;
438
465
  if (!e) return null;
439
466
  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})/]) {
@@ -443,41 +470,44 @@ function fe(e, t) {
443
470
  let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
444
471
  return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
445
472
  }
446
- function pe(e, t) {
447
- if (y(e)) return "";
448
- let n = fe(e.url, e.thumbnailUrl);
473
+ function ye(e, t) {
474
+ if (b(e)) return "";
475
+ let n = ve(e.url, e.thumbnailUrl);
449
476
  if (!n) return "";
450
- let r = M(e.styles.padding), i = N(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = P(e.height), s = b(e);
477
+ let r = N(e.styles.padding), i = P(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = F(e.height), s = x(e);
451
478
  return `<mj-image
452
- src="${O(n)}"
453
- alt="${O(e.alt)}"
479
+ src="${k(n)}"
480
+ alt="${k(e.alt)}"
454
481
  width="${a}"${o}
455
482
  align="${e.align}"
456
483
  padding="${r}"
457
- href="${O(e.url)}"
484
+ href="${k(e.url)}"
458
485
  target="_blank"
459
486
  rel="noopener"${i}${s}
460
487
  />`;
461
488
  }
462
489
  //#endregion
463
490
  //#region ../renderer/src/renderers/index.ts
464
- function Z(p, m) {
465
- let h = m.blockRenderers[p.type];
466
- return h ? h(p, m) : r(p) ? ue(p, m, Z) : a(p) ? te(p, m) : f(p) ? ie(p, m) : t(p) ? ae(p, m) : s(p) ? oe(p, m) : o(p) ? L(p, m) : l(p) ? R(p, m) : c(p) ? z(p, m) : u(p) ? B(p, m) : i(p) ? V(p, m) : d(p) ? G(p, m) : e(p) ? pe(p, m) : n(p) ? le(p, m) : y(p) ? "" : w(p);
491
+ function Z(f, m) {
492
+ let h = m.blockRenderers[f.type];
493
+ return h ? h(f, m) : r(f) ? ge(f, m, Z) : a(f) ? re(f, m) : p(f) ? oe(f, m) : t(f) ? z(f, m) : s(f) ? B(f, m) : o(f) ? U(f, m) : l(f) ? W(f, m) : c(f) ? G(f, m) : u(f) ? K(f, m) : i(f) ? q(f, m) : d(f) ? ue(f, m) : e(f) ? ye(f, m) : n(f) ? he(f, m) : b(f) ? "" : T(f);
467
494
  }
468
495
  //#endregion
469
496
  //#region ../renderer/src/index.ts
470
- async function me(e, t) {
471
- let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = _e(t?.socialIconsBaseUrl ?? g), o = await xe(e, t?.renderCustomBlock), s = Se(e, t?.getCustomBlockStylesheet), c = new v(e.settings.width, n, r, i, o, a, t?.blockRenderers ?? {}), l = be(e.blocks, i), u = c.resolveFontFamily(e.settings.fontFamily), d = e.settings.backgroundColor, f = e.settings.textColor ? ` color="${O(e.settings.textColor)}"` : "", p = e.settings.linkColor ? k(e.settings.linkColor) : "inherit", m = e.settings.linkUnderline ? "underline" : "none", h = l.map((e) => Q(e, c)).filter((e) => e !== "").join("\n"), _ = ye(n), y = ve(e.settings.preheaderText);
472
- return `<mjml lang="${O(e.settings.locale)}">
473
- <mj-head>${y}
497
+ async function be(e, t) {
498
+ let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = Ce(t?.socialIconsBaseUrl ?? _), o = await De(e, t?.renderCustomBlock), s = Oe(e, t?.getCustomBlockStylesheet), c = new y(e.settings.width, n, r, i, o, a, t?.blockRenderers ?? {}), l = Ee(e.blocks, i), u = c.resolveFontFamily(e.settings.fontFamily), d = e.settings.backgroundColor, f = e.settings.textColor ? ` color="${k(e.settings.textColor)}"` : "", p = e.settings.linkColor ? A(e.settings.linkColor) : "inherit", m = e.settings.linkUnderline ? "underline" : "none", h = l.map((e) => xe(e, c)).filter((e) => e !== "").join("\n"), g = Te(n), v = we(e.settings.preheaderText);
499
+ return `<mjml lang="${k(e.settings.locale)}">
500
+ <mj-head>${v}
474
501
  <mj-attributes>
475
502
  <mj-all font-family="${u}" />
476
503
  <mj-text font-size="14px"${f} />
477
504
  <mj-section padding="0" />
478
505
  <mj-column padding="0" />
479
506
  <mj-image fluid-on-mobile="true" />
480
- </mj-attributes>${_}
507
+ </mj-attributes>${g}
508
+ <mj-style inline="inline">
509
+ ${te(ne(l))}
510
+ </mj-style>
481
511
  <mj-style>
482
512
  a { color: ${p}; text-decoration: ${m}; }
483
513
  @media only screen and (max-width: 480px) {
@@ -486,47 +516,47 @@ async function me(e, t) {
486
516
  @media only screen and (min-width: 481px) {
487
517
  .tpl-hide-desktop { display: none !important; mso-hide: all !important; }
488
518
  }
489
- </mj-style>${Ce(s)}
519
+ </mj-style>${ke(s)}
490
520
  </mj-head>
491
521
  <mj-body width="${c.containerWidth}px" background-color="${d}">
492
522
  ${h}
493
523
  </mj-body>
494
524
  </mjml>`;
495
525
  }
496
- function Q(e, t) {
526
+ function xe(e, t) {
497
527
  if (r(e)) {
498
528
  let n = Z(e, t);
499
- return X(e, e.wrapper && n !== "" ? he(n, e.wrapper) : n);
529
+ return X(e, e.wrapper && n !== "" ? Q(n, e.wrapper) : n);
500
530
  }
501
- return X(e, ge(Z(e, t)));
531
+ return X(e, Se(Z(e, t)));
502
532
  }
503
- function he(e, t) {
504
- return `<mj-wrapper${N(t.backgroundColor, "native")}${` padding="${t.padding ? M(t.padding) : "0"}"`}${t.borderRadius && t.borderRadius > 0 ? ` border-radius="${t.borderRadius}px"` : ""}>
533
+ function Q(e, t) {
534
+ return `<mj-wrapper${P(t.backgroundColor, "native")}${` padding="${t.padding ? N(t.padding) : "0"}"`}${t.borderRadius && t.borderRadius > 0 ? ` border-radius="${t.borderRadius}px"` : ""}>
505
535
  ${e}
506
536
  </mj-wrapper>`;
507
537
  }
508
- function ge(e) {
538
+ function Se(e) {
509
539
  return e === "" ? "" : `<mj-section>
510
540
  <mj-column>
511
541
  ${e}
512
542
  </mj-column>
513
543
  </mj-section>`;
514
544
  }
515
- function _e(e) {
545
+ function Ce(e) {
516
546
  return e.endsWith("/") ? e.slice(0, -1) : e;
517
547
  }
518
- function ve(e) {
548
+ function we(e) {
519
549
  if (!e) return "";
520
550
  let t = e.trim();
521
- return t === "" ? "" : `\n <mj-preview>${D(t)}</mj-preview>`;
551
+ return t === "" ? "" : `\n <mj-preview>${O(t)}</mj-preview>`;
522
552
  }
523
- function ye(e) {
524
- return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${O(e.name)}" href="${O(e.url)}" />`).join("");
553
+ function Te(e) {
554
+ return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${k(e.name)}" href="${k(e.url)}" />`).join("");
525
555
  }
526
- function be(e, t) {
556
+ function Ee(e, t) {
527
557
  return t ? e : e.filter((e) => e.type !== "html");
528
558
  }
529
- async function xe(e, t) {
559
+ async function De(e, t) {
530
560
  let n = /* @__PURE__ */ new Map();
531
561
  if (!t) return n;
532
562
  let r = [];
@@ -544,7 +574,7 @@ function $(e, t) {
544
574
  if (r(i)) for (let e of i.children) $(e, t);
545
575
  }
546
576
  }
547
- function Se(e, t) {
577
+ function Oe(e, t) {
548
578
  if (!t) return [];
549
579
  let n = [];
550
580
  if ($(e.blocks, n), n.length === 0) return [];
@@ -559,10 +589,10 @@ function Se(e, t) {
559
589
  }
560
590
  return a;
561
591
  }
562
- function Ce(e) {
592
+ function ke(e) {
563
593
  return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e}\n </mj-style>`).join("");
564
594
  }
565
595
  //#endregion
566
- export { g as DEFAULT_SOCIAL_ICONS_BASE_URL, v as RenderContext, S as UNRENDERABLE_MARKER_PREFIX, A as convertMergeTagsToValues, O as escapeAttr, D as escapeHtml, b as getCssClassAttr, x as getCssClasses, J as getWidthPercentages, Y as getWidthPixels, y as isHiddenOnAll, Z as renderBlock, me as renderToMjml, w as renderUnrenderableBlock, M as toPaddingString };
596
+ export { _ as DEFAULT_SOCIAL_ICONS_BASE_URL, I as RICH_TEXT_CSS_CLASS, y as RenderContext, C as UNRENDERABLE_MARKER_PREFIX, j as convertMergeTagsToValues, k as escapeAttr, O as escapeHtml, x as getCssClassAttr, S as getCssClasses, J as getWidthPercentages, Y as getWidthPixels, b as isHiddenOnAll, Z as renderBlock, be as renderToMjml, T as renderUnrenderableBlock, R as resolveParagraphGap, L as richTextGapClass, N as toPaddingString };
567
597
 
568
- //# sourceMappingURL=src-CjSrA_o4.js.map
598
+ //# sourceMappingURL=src-CLTXM4PM.js.map