@leancodepl/mail-translation 9.7.2 → 9.7.4

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 (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +201 -0
  3. package/dist/bin.cjs +2 -0
  4. package/dist/bin.d.ts +3 -0
  5. package/dist/bin.d.ts.map +1 -0
  6. package/dist/bin.js +66 -0
  7. package/{src → dist}/compileMjml.d.ts +1 -0
  8. package/dist/compileMjml.d.ts.map +1 -0
  9. package/{src → dist}/config.d.ts +2 -1
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/generate.d.ts +3 -0
  12. package/dist/generate.d.ts.map +1 -0
  13. package/dist/generateConfigSchema.d.ts +2 -0
  14. package/dist/generateConfigSchema.d.ts.map +1 -0
  15. package/{src → dist}/generateKratosOutputTemplates.d.ts +2 -1
  16. package/dist/generateKratosOutputTemplates.d.ts.map +1 -0
  17. package/{src → dist}/generateOutputTemplates.d.ts +3 -2
  18. package/dist/generateOutputTemplates.d.ts.map +1 -0
  19. package/{src → dist}/generateRazorOutputTemplates.d.ts +2 -1
  20. package/dist/generateRazorOutputTemplates.d.ts.map +1 -0
  21. package/dist/index.cjs +1 -0
  22. package/dist/index.d.ts +3 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +5 -0
  25. package/dist/loadConfig.d.ts +3 -0
  26. package/dist/loadConfig.d.ts.map +1 -0
  27. package/{src → dist}/loadTemplates.d.ts +3 -2
  28. package/dist/loadTemplates.d.ts.map +1 -0
  29. package/{src → dist}/loadTranslations.d.ts +1 -0
  30. package/dist/loadTranslations.d.ts.map +1 -0
  31. package/{src → dist}/processTemplate.d.ts +5 -4
  32. package/dist/processTemplate.d.ts.map +1 -0
  33. package/{src → dist}/processTranslations.d.ts +2 -1
  34. package/dist/processTranslations.d.ts.map +1 -0
  35. package/dist/saveOutputs-CLBuFr2L.js +281 -0
  36. package/dist/saveOutputs-RV5ZMO78.cjs +10 -0
  37. package/{src → dist}/saveOutputs.d.ts +2 -1
  38. package/dist/saveOutputs.d.ts.map +1 -0
  39. package/package.json +22 -6
  40. package/src/bin.d.ts +0 -2
  41. package/src/bin.js +0 -19
  42. package/src/bin.js.map +0 -1
  43. package/src/compileMjml.js +0 -29
  44. package/src/compileMjml.js.map +0 -1
  45. package/src/config.js +0 -35
  46. package/src/config.js.map +0 -1
  47. package/src/generate.d.ts +0 -2
  48. package/src/generate.js +0 -23
  49. package/src/generate.js.map +0 -1
  50. package/src/generateConfigSchema.d.ts +0 -1
  51. package/src/generateConfigSchema.js +0 -17
  52. package/src/generateConfigSchema.js.map +0 -1
  53. package/src/generateKratosOutputTemplates.js +0 -48
  54. package/src/generateKratosOutputTemplates.js.map +0 -1
  55. package/src/generateOutputTemplates.js +0 -18
  56. package/src/generateOutputTemplates.js.map +0 -1
  57. package/src/generateRazorOutputTemplates.js +0 -50
  58. package/src/generateRazorOutputTemplates.js.map +0 -1
  59. package/src/index.d.ts +0 -2
  60. package/src/index.js +0 -6
  61. package/src/index.js.map +0 -1
  62. package/src/loadConfig.d.ts +0 -2
  63. package/src/loadConfig.js +0 -41
  64. package/src/loadConfig.js.map +0 -1
  65. package/src/loadTemplates.js +0 -47
  66. package/src/loadTemplates.js.map +0 -1
  67. package/src/loadTranslations.js +0 -37
  68. package/src/loadTranslations.js.map +0 -1
  69. package/src/processTemplate.js +0 -36
  70. package/src/processTemplate.js.map +0 -1
  71. package/src/processTranslations.js +0 -31
  72. package/src/processTranslations.js.map +0 -1
  73. package/src/saveOutputs.js +0 -16
  74. package/src/saveOutputs.js.map +0 -1
@@ -0,0 +1,281 @@
1
+ import { readdir as f, readFile as h, mkdir as $, writeFile as j } from "node:fs/promises";
2
+ import { extname as g, basename as x, join as p } from "node:path";
3
+ import E from "js-beautify";
4
+ import v from "mjml";
5
+ import F from "intl-messageformat";
6
+ import { createCliLogger as O } from "@leancodepl/logger/cli";
7
+ async function M(t) {
8
+ try {
9
+ const r = (await f(t)).filter((e) => g(e) === ".mjml");
10
+ return Promise.all(
11
+ r.map(async (e) => {
12
+ const a = x(e, ".mjml"), o = p(t, e), i = await h(o, "utf8");
13
+ return {
14
+ name: a,
15
+ content: i,
16
+ isPlaintext: !1
17
+ };
18
+ })
19
+ );
20
+ } catch (n) {
21
+ throw new Error(`Failed to load templates: ${n}`);
22
+ }
23
+ }
24
+ async function k({
25
+ plaintextMailsPath: t,
26
+ outputMode: n
27
+ }) {
28
+ try {
29
+ const r = await f(t), e = n === "kratos" ? r.filter((a) => a.endsWith(".plaintext.gotmpl")) : r.filter((a) => a.endsWith(".txt.cshtml"));
30
+ return Promise.all(
31
+ e.map(async (a) => {
32
+ const o = n === "kratos" ? a.replace(/\.plaintext\.gotmpl$/, "") : a.replace(/\.txt\.cshtml$/, ""), i = p(t, a), s = await h(i, "utf8");
33
+ return {
34
+ name: o,
35
+ content: s,
36
+ isPlaintext: !0
37
+ };
38
+ })
39
+ );
40
+ } catch (r) {
41
+ throw new Error(`Failed to load plaintext templates: ${r}`);
42
+ }
43
+ }
44
+ const c = O();
45
+ async function C(t) {
46
+ const n = {};
47
+ if (!t)
48
+ return n;
49
+ try {
50
+ const e = (await f(t)).filter((a) => g(a) === ".json");
51
+ if (e.length === 0)
52
+ return c.warn(`No translation files found in: ${t}. Continuing without translations.`), n;
53
+ for (const a of e) {
54
+ const o = x(a, ".json"), i = p(t, a);
55
+ try {
56
+ const s = await h(i, "utf8"), l = JSON.parse(s);
57
+ n[o] = l;
58
+ } catch (s) {
59
+ c.warn(`Failed to load translation file ${a}:`, s);
60
+ }
61
+ }
62
+ return n;
63
+ } catch (r) {
64
+ return c.warn(`Failed to load translations: ${r}. Continuing without translations.`), n;
65
+ }
66
+ }
67
+ const { html: b } = E;
68
+ function N({ mjmlContent: t, filePath: n }) {
69
+ try {
70
+ const r = v(t, {
71
+ keepComments: !1,
72
+ validationLevel: "soft",
73
+ filePath: n
74
+ });
75
+ return {
76
+ html: b(r.html, {
77
+ indent_size: 2,
78
+ preserve_newlines: !0,
79
+ max_preserve_newlines: 1
80
+ }),
81
+ mjmlParseErrors: r.errors || []
82
+ };
83
+ } catch (r) {
84
+ throw new Error(`MJML compilation failed: ${r}`);
85
+ }
86
+ }
87
+ function R({
88
+ translatedTemplates: t,
89
+ defaultLanguage: n,
90
+ kratosLanguageVariable: r
91
+ }) {
92
+ const e = t.filter((s) => s.isPlaintext), a = t.filter((s) => !s.isPlaintext), o = a.map((s) => ({
93
+ filename: `${s.name}.gotmpl`,
94
+ content: d({
95
+ templates: a,
96
+ defaultLanguage: n,
97
+ kratosLanguageVariable: r
98
+ })
99
+ })), i = e.map((s) => ({
100
+ filename: `${s.name}.plaintext.gotmpl`,
101
+ content: d({
102
+ templates: e,
103
+ defaultLanguage: n,
104
+ kratosLanguageVariable: r
105
+ })
106
+ }));
107
+ return [...o, ...i];
108
+ }
109
+ function d({
110
+ templates: t,
111
+ defaultLanguage: n,
112
+ kratosLanguageVariable: r = ".Identity.traits.lang"
113
+ }) {
114
+ if (t.length === 1 || !n)
115
+ return t[0].content;
116
+ let e = "";
117
+ return t.forEach((o) => {
118
+ e += `{{define "${o.language}"}}
119
+ `, e += o.content, e += `
120
+ {{end}}
121
+
122
+ `;
123
+ }), t.filter((o) => o.language !== n).map((o) => o.language).forEach((o, i) => {
124
+ e += `{{- ${i === 0 ? "if" : "else if"} eq ${r} "${o}" -}}
125
+ `, e += `{{ template "${o}" . }}
126
+ `;
127
+ }), e += `{{- else -}}
128
+ `, e += `{{ template "${n}" . }}
129
+ `, e += `{{- end -}}
130
+ `, e;
131
+ }
132
+ function z({
133
+ translatedTemplates: t,
134
+ defaultLanguage: n
135
+ }) {
136
+ return t.map((r) => ({
137
+ filename: L({ template: r, defaultLanguage: n }),
138
+ content: J(r.content)
139
+ }));
140
+ }
141
+ function J(t) {
142
+ const n = [
143
+ "annotation",
144
+ "character-variant",
145
+ "charset",
146
+ "color-profile",
147
+ "container",
148
+ "counter-style",
149
+ "font-face",
150
+ "font-feature-values",
151
+ "font-palette-values",
152
+ "import",
153
+ "keyframes",
154
+ "-webkit-keyframes",
155
+ "layer",
156
+ "media",
157
+ "namespace",
158
+ "ornaments",
159
+ "page",
160
+ "position-try",
161
+ "property",
162
+ "scope",
163
+ "starting-style",
164
+ "styleset",
165
+ "stylistic",
166
+ "supports",
167
+ "swash",
168
+ "view-transition"
169
+ ].join("|");
170
+ return t.replaceAll(new RegExp(`(?<!@)@(${n})`, "g"), "@@$1");
171
+ }
172
+ function L({
173
+ template: t,
174
+ defaultLanguage: n
175
+ }) {
176
+ const r = !!n && !!t.language && t.language !== n;
177
+ return [
178
+ t.name,
179
+ ...r ? [t.language] : [],
180
+ ...t.isPlaintext ? ["txt"] : [],
181
+ "cshtml"
182
+ ].join(".");
183
+ }
184
+ function _({
185
+ translatedTemplates: t,
186
+ outputMode: n,
187
+ defaultLanguage: r,
188
+ kratosLanguageVariable: e
189
+ }) {
190
+ switch (n) {
191
+ case "kratos":
192
+ return R({
193
+ translatedTemplates: t,
194
+ defaultLanguage: r,
195
+ kratosLanguageVariable: e
196
+ });
197
+ case "razor":
198
+ return z({ translatedTemplates: t, defaultLanguage: r });
199
+ }
200
+ }
201
+ function A({
202
+ template: t,
203
+ translations: n,
204
+ language: r
205
+ }) {
206
+ const e = /\(\(t\s+["']([^"']+)["']\s*(?:,\s*({.*?}))?\s*\)\)/g;
207
+ return t.replaceAll(e, (o, i, s) => {
208
+ const l = n[i];
209
+ if (!l || !r)
210
+ return c.warn(`Translation is missing for key "${i}"` + (r ? ` for "${r}" language` : "")), i;
211
+ if (s && r)
212
+ try {
213
+ const m = JSON.parse(s);
214
+ return new F(l, r).format(m);
215
+ } catch (m) {
216
+ return c.warn(`Error parsing JSON parameters or formatting message for key "${i}":`, m), i;
217
+ }
218
+ else
219
+ return l;
220
+ });
221
+ }
222
+ function D({
223
+ template: t,
224
+ translationData: n,
225
+ outputMode: r,
226
+ defaultLanguage: e,
227
+ kratosLanguageVariable: a,
228
+ mailsPath: o
229
+ }) {
230
+ const i = Object.keys(n), s = i.length > 0 ? i : [e], l = t.isPlaintext ? void 0 : N({ mjmlContent: t.content, filePath: o }), m = t.isPlaintext ? t.content : l?.html ?? "", w = s.map((u) => {
231
+ const T = u ? n[u] ?? {} : {}, P = A({ template: m, translations: T, language: u });
232
+ return {
233
+ name: t.name,
234
+ content: P,
235
+ isPlaintext: t.isPlaintext,
236
+ language: u
237
+ };
238
+ }), y = _({
239
+ translatedTemplates: w,
240
+ outputMode: r,
241
+ defaultLanguage: e,
242
+ kratosLanguageVariable: a
243
+ });
244
+ return {
245
+ name: t.name,
246
+ mjmlParseErrors: l?.mjmlParseErrors ?? [],
247
+ outputTemplates: y
248
+ };
249
+ }
250
+ async function H(t) {
251
+ const n = await C(t.translationsPath), r = await M(t.mailsPath), e = await k({
252
+ plaintextMailsPath: t.plaintextMailsPath ?? t.mailsPath,
253
+ outputMode: t.outputMode
254
+ });
255
+ return [...r, ...e].map(
256
+ (a) => D({
257
+ template: a,
258
+ translationData: n,
259
+ outputMode: t.outputMode,
260
+ defaultLanguage: t.defaultLanguage,
261
+ kratosLanguageVariable: t.kratosLanguageVariable,
262
+ mailsPath: t.mailsPath
263
+ })
264
+ );
265
+ }
266
+ async function V({
267
+ processedTemplates: t,
268
+ outputPath: n
269
+ }) {
270
+ await $(n, { recursive: !0 });
271
+ const r = t.flatMap((e) => e.outputTemplates);
272
+ await Promise.all(
273
+ r.map((e) => j(p(n, e.filename), e.content, "utf8"))
274
+ );
275
+ for (const e of t)
276
+ e.mjmlParseErrors.length > 0 && c.warn(`Errors in ${e.name}:`, e.mjmlParseErrors);
277
+ }
278
+ export {
279
+ H as g,
280
+ V as s
281
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";const m=require("node:fs/promises"),c=require("node:path"),j=require("js-beautify"),y=require("mjml"),T=require("intl-messageformat"),P=require("@leancodepl/logger/cli");async function $(t){try{const r=(await m.readdir(t)).filter(e=>c.extname(e)===".mjml");return Promise.all(r.map(async e=>{const a=c.basename(e,".mjml"),s=c.join(t,e),i=await m.readFile(s,"utf8");return{name:a,content:i,isPlaintext:!1}}))}catch(n){throw new Error(`Failed to load templates: ${n}`)}}async function v({plaintextMailsPath:t,outputMode:n}){try{const r=await m.readdir(t),e=n==="kratos"?r.filter(a=>a.endsWith(".plaintext.gotmpl")):r.filter(a=>a.endsWith(".txt.cshtml"));return Promise.all(e.map(async a=>{const s=n==="kratos"?a.replace(/\.plaintext\.gotmpl$/,""):a.replace(/\.txt\.cshtml$/,""),i=c.join(t,a),o=await m.readFile(i,"utf8");return{name:s,content:o,isPlaintext:!0}}))}catch(r){throw new Error(`Failed to load plaintext templates: ${r}`)}}const u=P.createCliLogger();async function E(t){const n={};if(!t)return n;try{const e=(await m.readdir(t)).filter(a=>c.extname(a)===".json");if(e.length===0)return u.warn(`No translation files found in: ${t}. Continuing without translations.`),n;for(const a of e){const s=c.basename(a,".json"),i=c.join(t,a);try{const o=await m.readFile(i,"utf8"),l=JSON.parse(o);n[s]=l}catch(o){u.warn(`Failed to load translation file ${a}:`,o)}}return n}catch(r){return u.warn(`Failed to load translations: ${r}. Continuing without translations.`),n}}const{html:F}=j;function O({mjmlContent:t,filePath:n}){try{const r=y(t,{keepComments:!1,validationLevel:"soft",filePath:n});return{html:F(r.html,{indent_size:2,preserve_newlines:!0,max_preserve_newlines:1}),mjmlParseErrors:r.errors||[]}}catch(r){throw new Error(`MJML compilation failed: ${r}`)}}function M({translatedTemplates:t,defaultLanguage:n,kratosLanguageVariable:r}){const e=t.filter(o=>o.isPlaintext),a=t.filter(o=>!o.isPlaintext),s=a.map(o=>({filename:`${o.name}.gotmpl`,content:d({templates:a,defaultLanguage:n,kratosLanguageVariable:r})})),i=e.map(o=>({filename:`${o.name}.plaintext.gotmpl`,content:d({templates:e,defaultLanguage:n,kratosLanguageVariable:r})}));return[...s,...i]}function d({templates:t,defaultLanguage:n,kratosLanguageVariable:r=".Identity.traits.lang"}){if(t.length===1||!n)return t[0].content;let e="";return t.forEach(s=>{e+=`{{define "${s.language}"}}
2
+ `,e+=s.content,e+=`
3
+ {{end}}
4
+
5
+ `}),t.filter(s=>s.language!==n).map(s=>s.language).forEach((s,i)=>{e+=`{{- ${i===0?"if":"else if"} eq ${r} "${s}" -}}
6
+ `,e+=`{{ template "${s}" . }}
7
+ `}),e+=`{{- else -}}
8
+ `,e+=`{{ template "${n}" . }}
9
+ `,e+=`{{- end -}}
10
+ `,e}function k({translatedTemplates:t,defaultLanguage:n}){return t.map(r=>({filename:b({template:r,defaultLanguage:n}),content:C(r.content)}))}function C(t){const n=["annotation","character-variant","charset","color-profile","container","counter-style","font-face","font-feature-values","font-palette-values","import","keyframes","-webkit-keyframes","layer","media","namespace","ornaments","page","position-try","property","scope","starting-style","styleset","stylistic","supports","swash","view-transition"].join("|");return t.replaceAll(new RegExp(`(?<!@)@(${n})`,"g"),"@@$1")}function b({template:t,defaultLanguage:n}){const r=!!n&&!!t.language&&t.language!==n;return[t.name,...r?[t.language]:[],...t.isPlaintext?["txt"]:[],"cshtml"].join(".")}function q({translatedTemplates:t,outputMode:n,defaultLanguage:r,kratosLanguageVariable:e}){switch(n){case"kratos":return M({translatedTemplates:t,defaultLanguage:r,kratosLanguageVariable:e});case"razor":return k({translatedTemplates:t,defaultLanguage:r})}}function N({template:t,translations:n,language:r}){const e=/\(\(t\s+["']([^"']+)["']\s*(?:,\s*({.*?}))?\s*\)\)/g;return t.replaceAll(e,(s,i,o)=>{const l=n[i];if(!l||!r)return u.warn(`Translation is missing for key "${i}"`+(r?` for "${r}" language`:"")),i;if(o&&r)try{const p=JSON.parse(o);return new T(l,r).format(p)}catch(p){return u.warn(`Error parsing JSON parameters or formatting message for key "${i}":`,p),i}else return l})}function R({template:t,translationData:n,outputMode:r,defaultLanguage:e,kratosLanguageVariable:a,mailsPath:s}){const i=Object.keys(n),o=i.length>0?i:[e],l=t.isPlaintext?void 0:O({mjmlContent:t.content,filePath:s}),p=t.isPlaintext?t.content:l?.html??"",h=o.map(f=>{const g=f?n[f]??{}:{},x=N({template:p,translations:g,language:f});return{name:t.name,content:x,isPlaintext:t.isPlaintext,language:f}}),w=q({translatedTemplates:h,outputMode:r,defaultLanguage:e,kratosLanguageVariable:a});return{name:t.name,mjmlParseErrors:l?.mjmlParseErrors??[],outputTemplates:w}}async function _(t){const n=await E(t.translationsPath),r=await $(t.mailsPath),e=await v({plaintextMailsPath:t.plaintextMailsPath??t.mailsPath,outputMode:t.outputMode});return[...r,...e].map(a=>R({template:a,translationData:n,outputMode:t.outputMode,defaultLanguage:t.defaultLanguage,kratosLanguageVariable:t.kratosLanguageVariable,mailsPath:t.mailsPath}))}async function z({processedTemplates:t,outputPath:n}){await m.mkdir(n,{recursive:!0});const r=t.flatMap(e=>e.outputTemplates);await Promise.all(r.map(e=>m.writeFile(c.join(n,e.filename),e.content,"utf8")));for(const e of t)e.mjmlParseErrors.length>0&&u.warn(`Errors in ${e.name}:`,e.mjmlParseErrors)}exports.generate=_;exports.saveOutputs=z;
@@ -1,5 +1,6 @@
1
- import { ProcessedTemplate } from "./processTemplate";
1
+ import { ProcessedTemplate } from './processTemplate';
2
2
  export declare function saveOutputs({ processedTemplates, outputPath, }: {
3
3
  processedTemplates: ProcessedTemplate[];
4
4
  outputPath: string;
5
5
  }): Promise<void>;
6
+ //# sourceMappingURL=saveOutputs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saveOutputs.d.ts","sourceRoot":"","sources":["../src/saveOutputs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,wBAAsB,WAAW,CAAC,EAChC,kBAAkB,EAClB,UAAU,GACX,EAAE;IACD,kBAAkB,EAAE,iBAAiB,EAAE,CAAA;IACvC,UAAU,EAAE,MAAM,CAAA;CACnB,iBAcA"}
package/package.json CHANGED
@@ -1,11 +1,24 @@
1
1
  {
2
2
  "name": "@leancodepl/mail-translation",
3
- "version": "9.7.2",
3
+ "version": "9.7.4",
4
4
  "license": "Apache-2.0",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ "./package.json": "./package.json",
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
5
17
  "bin": {
6
- "mail-translation": "src/bin.js"
18
+ "mail-translation": "./dist/bin.js"
7
19
  },
8
20
  "dependencies": {
21
+ "@leancodepl/logger": "9.7.4",
9
22
  "intl-messageformat": "^10.7.16",
10
23
  "js-beautify": "^1.15.4",
11
24
  "lilconfig": "^3.1.3",
@@ -26,7 +39,7 @@
26
39
  "registry": "https://registry.npmjs.org/"
27
40
  },
28
41
  "engines": {
29
- "node": ">=18.0.0"
42
+ "node": ">=22.0.0"
30
43
  },
31
44
  "repository": {
32
45
  "type": "git",
@@ -54,7 +67,10 @@
54
67
  "name": "LeanCode",
55
68
  "url": "https://leancode.co"
56
69
  },
57
- "types": "./src/index.d.ts",
58
- "main": "./src/index.js",
59
- "type": "commonjs"
70
+ "files": [
71
+ "dist",
72
+ "CHANGELOG.md",
73
+ "schema.json",
74
+ "!**/*.tsbuildinfo"
75
+ ]
60
76
  }
package/src/bin.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/src/bin.js DELETED
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const tslib_1 = require("tslib");
5
- const helpers_1 = require("yargs/helpers");
6
- const yargs_1 = tslib_1.__importDefault(require("yargs/yargs"));
7
- const generate_1 = require("./generate");
8
- const loadConfig_1 = require("./loadConfig");
9
- const saveOutputs_1 = require("./saveOutputs");
10
- const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
11
- .option("config", {
12
- alias: "c",
13
- type: "string",
14
- description: "Config file location",
15
- })
16
- .parseSync();
17
- const config = (0, loadConfig_1.loadConfig)(argv.config);
18
- (0, generate_1.generate)(config).then(processedTemplates => (0, saveOutputs_1.saveOutputs)({ processedTemplates, outputPath: config.outputPath }));
19
- //# sourceMappingURL=bin.js.map
package/src/bin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../../../../packages/mail-translation/src/bin.ts"],"names":[],"mappings":";;;;AAEA,2CAAuC;AACvC,gEAA+B;AAC/B,yCAAqC;AACrC,6CAAyC;AACzC,+CAA2C;AAE3C,MAAM,IAAI,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACtC,MAAM,CAAC,QAAQ,EAAE;IAChB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,sBAAsB;CACpC,CAAC;KACD,SAAS,EAAE,CAAA;AAEd,MAAM,MAAM,GAAG,IAAA,uBAAU,EAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAEtC,IAAA,mBAAQ,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,IAAA,yBAAW,EAAC,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compileMjml = compileMjml;
4
- const tslib_1 = require("tslib");
5
- const js_beautify_1 = require("js-beautify");
6
- const mjml_1 = tslib_1.__importDefault(require("mjml"));
7
- function compileMjml({ mjmlContent, filePath }) {
8
- try {
9
- const result = (0, mjml_1.default)(mjmlContent, {
10
- keepComments: false,
11
- validationLevel: "soft",
12
- filePath,
13
- });
14
- // js-beautify is used to format the HTML as beautify option is deprecated in mjml-core
15
- const html = (0, js_beautify_1.html)(result.html, {
16
- indent_size: 2,
17
- preserve_newlines: true,
18
- max_preserve_newlines: 1,
19
- });
20
- return {
21
- html,
22
- mjmlParseErrors: result.errors || [],
23
- };
24
- }
25
- catch (error) {
26
- throw new Error(`MJML compilation failed: ${error}`);
27
- }
28
- }
29
- //# sourceMappingURL=compileMjml.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compileMjml.js","sourceRoot":"","sources":["../../../../packages/mail-translation/src/compileMjml.ts"],"names":[],"mappings":";;AAcA,kCAsBC;;AApCD,6CAAkD;AAClD,wDAA4B;AAa5B,SAAgB,WAAW,CAAC,EAAE,WAAW,EAAE,QAAQ,EAA6C;IAC9F,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,cAAS,EAAC,WAAW,EAAE;YACpC,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,MAAM;YACvB,QAAQ;SACT,CAAC,CAAA;QAEF,uFAAuF;QACvF,MAAM,IAAI,GAAG,IAAA,kBAAY,EAAC,MAAM,CAAC,IAAI,EAAE;YACrC,WAAW,EAAE,CAAC;YACd,iBAAiB,EAAE,IAAI;YACvB,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAA;QAEF,OAAO;YACL,IAAI;YACJ,eAAe,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;SACrC,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAA;IACtD,CAAC;AACH,CAAC"}
package/src/config.js DELETED
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mailTranslationConfigSchema = void 0;
4
- const v4_1 = require("zod/v4");
5
- const outputModeSchema = v4_1.z.enum(["kratos", "razor"]);
6
- exports.mailTranslationConfigSchema = v4_1.z.object({
7
- translationsPath: v4_1.z
8
- .string()
9
- .optional()
10
- .describe("Path to directory containing translation JSON files. When omitted, templates are compiled without translations. Each JSON file should be named with the language code (e.g., en.json, pl.json)."),
11
- mailsPath: v4_1.z
12
- .string()
13
- .describe("Path to directory containing MJML email templates. All .mjml files in this directory will be processed."),
14
- plaintextMailsPath: v4_1.z
15
- .string()
16
- .optional()
17
- .describe("Path to directory containing plaintext templates. If not specified, defaults to the same value as mailsPath. Used for generating text-only versions of emails alongside HTML versions."),
18
- outputPath: v4_1.z
19
- .string()
20
- .describe("Directory where processed templates will be saved. The tool will create this directory if it doesn't exist."),
21
- outputMode: outputModeSchema.describe("Target templating system format: 'kratos' for Go template files compatible with Ory Kratos, 'razor' for C# Razor template files."),
22
- defaultLanguage: v4_1.z
23
- .string()
24
- .optional()
25
- .describe("Default language code for templates with translations. Required when translationsPath is provided."),
26
- languages: v4_1.z
27
- .array(v4_1.z.string())
28
- .optional()
29
- .describe("Array of language codes to process. When omitted, all languages found in translation files are automatically processed. Use this to limit output to specific languages."),
30
- kratosLanguageVariable: v4_1.z
31
- .string()
32
- .optional()
33
- .describe("Variable path used for language detection in Kratos templates. Defaults to '.Identity.traits.lang'. This determines how the generated template will access the user's language preference. Only used in Kratos mode."),
34
- });
35
- //# sourceMappingURL=config.js.map
package/src/config.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../packages/mail-translation/src/config.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAE1B,MAAM,gBAAgB,GAAG,MAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;AAIvC,QAAA,2BAA2B,GAAG,MAAC,CAAC,MAAM,CAAC;IAClD,gBAAgB,EAAE,MAAC;SAChB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,iMAAiM,CAClM;IACH,SAAS,EAAE,MAAC;SACT,MAAM,EAAE;SACR,QAAQ,CACP,yGAAyG,CAC1G;IACH,kBAAkB,EAAE,MAAC;SAClB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,wLAAwL,CACzL;IACH,UAAU,EAAE,MAAC;SACV,MAAM,EAAE;SACR,QAAQ,CACP,6GAA6G,CAC9G;IACH,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CACnC,kIAAkI,CACnI;IACD,eAAe,EAAE,MAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,oGAAoG,CAAC;IACjH,SAAS,EAAE,MAAC;SACT,KAAK,CAAC,MAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,yKAAyK,CAC1K;IACH,sBAAsB,EAAE,MAAC;SACtB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,sNAAsN,CACvN;CACJ,CAAC,CAAA"}
package/src/generate.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { MailTranslationConfig } from "./config";
2
- export declare function generate(config: Omit<MailTranslationConfig, "outputPath">): Promise<import("./processTemplate").ProcessedTemplate[]>;
package/src/generate.js DELETED
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = generate;
4
- const loadTemplates_1 = require("./loadTemplates");
5
- const loadTranslations_1 = require("./loadTranslations");
6
- const processTemplate_1 = require("./processTemplate");
7
- async function generate(config) {
8
- const translationData = await (0, loadTranslations_1.loadTranslations)(config.translationsPath);
9
- const mjmlTemplates = await (0, loadTemplates_1.loadMjmlTemplates)(config.mailsPath);
10
- const plaintextTemplates = await (0, loadTemplates_1.loadPlaintextTemplates)({
11
- plaintextMailsPath: config.plaintextMailsPath ?? config.mailsPath,
12
- outputMode: config.outputMode,
13
- });
14
- return [...mjmlTemplates, ...plaintextTemplates].map(template => (0, processTemplate_1.processTemplate)({
15
- template,
16
- translationData,
17
- outputMode: config.outputMode,
18
- defaultLanguage: config.defaultLanguage,
19
- kratosLanguageVariable: config.kratosLanguageVariable,
20
- mailsPath: config.mailsPath,
21
- }));
22
- }
23
- //# sourceMappingURL=generate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../packages/mail-translation/src/generate.ts"],"names":[],"mappings":";;AAKA,4BAmBC;AAvBD,mDAA2E;AAC3E,yDAAqD;AACrD,uDAAmD;AAE5C,KAAK,UAAU,QAAQ,CAAC,MAAiD;IAC9E,MAAM,eAAe,GAAG,MAAM,IAAA,mCAAgB,EAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAEvE,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAiB,EAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC/D,MAAM,kBAAkB,GAAG,MAAM,IAAA,sCAAsB,EAAC;QACtD,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,IAAI,MAAM,CAAC,SAAS;QACjE,UAAU,EAAE,MAAM,CAAC,UAAU;KAC9B,CAAC,CAAA;IAEF,OAAO,CAAC,GAAG,aAAa,EAAE,GAAG,kBAAkB,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAC9D,IAAA,iCAAe,EAAC;QACd,QAAQ;QACR,eAAe;QACf,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,sBAAsB,EAAE,MAAM,CAAC,sBAAsB;QACrD,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAC,CACH,CAAA;AACH,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs_1 = require("fs");
4
- const path_1 = require("path");
5
- const v4_1 = require("zod/v4");
6
- const config_1 = require("./config");
7
- const jsonSchema = v4_1.z.toJSONSchema(config_1.mailTranslationConfigSchema);
8
- const output = {
9
- $schema: "http://json-schema.org/draft-07/schema#",
10
- title: "@leancodepl/mail-translation Configuration",
11
- description: "Schema for @leancodepl/mail-translation configuration",
12
- ...jsonSchema,
13
- };
14
- const packageRoot = (0, path_1.join)(__dirname, "..");
15
- const outputPath = (0, path_1.join)(packageRoot, "schema.json");
16
- (0, fs_1.writeFileSync)(outputPath, JSON.stringify(output, null, 2) + "\n");
17
- //# sourceMappingURL=generateConfigSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateConfigSchema.js","sourceRoot":"","sources":["../../../../packages/mail-translation/src/generateConfigSchema.ts"],"names":[],"mappings":";;AAAA,2BAAkC;AAClC,+BAA2B;AAC3B,+BAA0B;AAC1B,qCAAsD;AAEtD,MAAM,UAAU,GAAG,MAAC,CAAC,YAAY,CAAC,oCAA2B,CAAC,CAAA;AAE9D,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,yCAAyC;IAClD,KAAK,EAAE,4CAA4C;IACnD,WAAW,EAAE,uDAAuD;IACpE,GAAG,UAAU;CACd,CAAA;AAED,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAA;AACzC,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,WAAW,EAAE,aAAa,CAAC,CAAA;AAEnD,IAAA,kBAAa,EAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateKratosOutputTemplates = generateKratosOutputTemplates;
4
- function generateKratosOutputTemplates({ translatedTemplates, defaultLanguage, kratosLanguageVariable, }) {
5
- const plainTextTemplates = translatedTemplates.filter(template => template.isPlaintext);
6
- const htmlTemplates = translatedTemplates.filter(template => !template.isPlaintext);
7
- const htmlOutputTemplates = htmlTemplates.map(template => ({
8
- filename: `${template.name}.gotmpl`,
9
- content: generateKratosOutputTemplate({
10
- templates: htmlTemplates,
11
- defaultLanguage,
12
- kratosLanguageVariable,
13
- }),
14
- }));
15
- const plainTextOutputTemplates = plainTextTemplates.map(template => ({
16
- filename: `${template.name}.plaintext.gotmpl`,
17
- content: generateKratosOutputTemplate({
18
- templates: plainTextTemplates,
19
- defaultLanguage,
20
- kratosLanguageVariable,
21
- }),
22
- }));
23
- return [...htmlOutputTemplates, ...plainTextOutputTemplates];
24
- }
25
- function generateKratosOutputTemplate({ templates, defaultLanguage, kratosLanguageVariable = ".Identity.traits.lang", }) {
26
- if (templates.length === 1 || !defaultLanguage) {
27
- return templates[0].content;
28
- }
29
- let outputTemplate = "";
30
- templates.forEach(template => {
31
- outputTemplate += `{{define "${template.language}"}}\n`;
32
- outputTemplate += template.content;
33
- outputTemplate += "\n{{end}}\n\n";
34
- });
35
- const nonDefaultLanguages = templates
36
- .filter(template => template.language !== defaultLanguage)
37
- .map(template => template.language);
38
- nonDefaultLanguages.forEach((language, index) => {
39
- const condition = index === 0 ? "if" : "else if";
40
- outputTemplate += `{{- ${condition} eq ${kratosLanguageVariable} "${language}" -}}\n`;
41
- outputTemplate += `{{ template "${language}" . }}\n`;
42
- });
43
- outputTemplate += "{{- else -}}\n";
44
- outputTemplate += `{{ template "${defaultLanguage}" . }}\n`;
45
- outputTemplate += "{{- end -}}\n";
46
- return outputTemplate;
47
- }
48
- //# sourceMappingURL=generateKratosOutputTemplates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateKratosOutputTemplates.js","sourceRoot":"","sources":["../../../../packages/mail-translation/src/generateKratosOutputTemplates.ts"],"names":[],"mappings":";;AAEA,sEA+BC;AA/BD,SAAgB,6BAA6B,CAAC,EAC5C,mBAAmB,EACnB,eAAe,EACf,sBAAsB,GAKvB;IACC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;IACvF,MAAM,aAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;IAEnF,MAAM,mBAAmB,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACzD,QAAQ,EAAE,GAAG,QAAQ,CAAC,IAAI,SAAS;QACnC,OAAO,EAAE,4BAA4B,CAAC;YACpC,SAAS,EAAE,aAAa;YACxB,eAAe;YACf,sBAAsB;SACvB,CAAC;KACH,CAAC,CAAC,CAAA;IAEH,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACnE,QAAQ,EAAE,GAAG,QAAQ,CAAC,IAAI,mBAAmB;QAC7C,OAAO,EAAE,4BAA4B,CAAC;YACpC,SAAS,EAAE,kBAAkB;YAC7B,eAAe;YACf,sBAAsB;SACvB,CAAC;KACH,CAAC,CAAC,CAAA;IAEH,OAAO,CAAC,GAAG,mBAAmB,EAAE,GAAG,wBAAwB,CAAC,CAAA;AAC9D,CAAC;AAED,SAAS,4BAA4B,CAAC,EACpC,SAAS,EACT,eAAe,EACf,sBAAsB,GAAG,uBAAuB,GAKjD;IACC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAC7B,CAAC;IAED,IAAI,cAAc,GAAG,EAAE,CAAA;IAEvB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC3B,cAAc,IAAI,aAAa,QAAQ,CAAC,QAAQ,OAAO,CAAA;QACvD,cAAc,IAAI,QAAQ,CAAC,OAAO,CAAA;QAClC,cAAc,IAAI,eAAe,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,MAAM,mBAAmB,GAAG,SAAS;SAClC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,KAAK,eAAe,CAAC;SACzD,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAErC,mBAAmB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QAC9C,MAAM,SAAS,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;QAEhD,cAAc,IAAI,OAAO,SAAS,OAAO,sBAAsB,KAAK,QAAQ,SAAS,CAAA;QACrF,cAAc,IAAI,gBAAgB,QAAQ,UAAU,CAAA;IACtD,CAAC,CAAC,CAAA;IAEF,cAAc,IAAI,gBAAgB,CAAA;IAClC,cAAc,IAAI,gBAAgB,eAAe,UAAU,CAAA;IAC3D,cAAc,IAAI,eAAe,CAAA;IAEjC,OAAO,cAAc,CAAA;AACvB,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateOutputTemplates = generateOutputTemplates;
4
- const generateKratosOutputTemplates_1 = require("./generateKratosOutputTemplates");
5
- const generateRazorOutputTemplates_1 = require("./generateRazorOutputTemplates");
6
- function generateOutputTemplates({ translatedTemplates, outputMode, defaultLanguage, kratosLanguageVariable, }) {
7
- switch (outputMode) {
8
- case "kratos":
9
- return (0, generateKratosOutputTemplates_1.generateKratosOutputTemplates)({
10
- translatedTemplates,
11
- defaultLanguage,
12
- kratosLanguageVariable,
13
- });
14
- case "razor":
15
- return (0, generateRazorOutputTemplates_1.generateRazorOutputTemplates)({ translatedTemplates, defaultLanguage });
16
- }
17
- }
18
- //# sourceMappingURL=generateOutputTemplates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateOutputTemplates.js","sourceRoot":"","sources":["../../../../packages/mail-translation/src/generateOutputTemplates.ts"],"names":[],"mappings":";;AAUA,0DAqBC;AA9BD,mFAA+E;AAC/E,iFAA6E;AAQ7E,SAAgB,uBAAuB,CAAC,EACtC,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,sBAAsB,GAMvB;IACC,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO,IAAA,6DAA6B,EAAC;gBACnC,mBAAmB;gBACnB,eAAe;gBACf,sBAAsB;aACvB,CAAC,CAAA;QACJ,KAAK,OAAO;YACV,OAAO,IAAA,2DAA4B,EAAC,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC,CAAA;IACjF,CAAC;AACH,CAAC"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateRazorOutputTemplates = generateRazorOutputTemplates;
4
- function generateRazorOutputTemplates({ translatedTemplates, defaultLanguage, }) {
5
- return translatedTemplates.map(template => ({
6
- filename: getFilename({ template, defaultLanguage }),
7
- content: escapeRazorConflicts(template.content),
8
- }));
9
- }
10
- function escapeRazorConflicts(templateContent) {
11
- const cssAtRules = [
12
- "annotation",
13
- "character-variant",
14
- "charset",
15
- "color-profile",
16
- "container",
17
- "counter-style",
18
- "font-face",
19
- "font-feature-values",
20
- "font-palette-values",
21
- "import",
22
- "keyframes",
23
- "-webkit-keyframes",
24
- "layer",
25
- "media",
26
- "namespace",
27
- "ornaments",
28
- "page",
29
- "position-try",
30
- "property",
31
- "scope",
32
- "starting-style",
33
- "styleset",
34
- "stylistic",
35
- "supports",
36
- "swash",
37
- "view-transition",
38
- ].join("|");
39
- return templateContent.replace(new RegExp(`(?<!@)@(${cssAtRules})`, "g"), "@@$1");
40
- }
41
- function getFilename({ template, defaultLanguage, }) {
42
- const includeLanguage = !!defaultLanguage && !!template.language && template.language !== defaultLanguage;
43
- return [
44
- template.name,
45
- ...(includeLanguage ? [template.language] : []),
46
- ...(template.isPlaintext ? ["txt"] : []),
47
- "cshtml",
48
- ].join(".");
49
- }
50
- //# sourceMappingURL=generateRazorOutputTemplates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateRazorOutputTemplates.js","sourceRoot":"","sources":["../../../../packages/mail-translation/src/generateRazorOutputTemplates.ts"],"names":[],"mappings":";;AAEA,oEAWC;AAXD,SAAgB,4BAA4B,CAAC,EAC3C,mBAAmB,EACnB,eAAe,GAIhB;IACC,OAAO,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC1C,QAAQ,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;QACpD,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC;KAChD,CAAC,CAAC,CAAA;AACL,CAAC;AAED,SAAS,oBAAoB,CAAC,eAAuB;IACnD,MAAM,UAAU,GAAG;QACjB,YAAY;QACZ,mBAAmB;QACnB,SAAS;QACT,eAAe;QACf,WAAW;QACX,eAAe;QACf,WAAW;QACX,qBAAqB;QACrB,qBAAqB;QACrB,QAAQ;QACR,WAAW;QACX,mBAAmB;QACnB,OAAO;QACP,OAAO;QACP,WAAW;QACX,WAAW;QACX,MAAM;QACN,cAAc;QACd,UAAU;QACV,OAAO;QACP,gBAAgB;QAChB,UAAU;QACV,WAAW;QACX,UAAU;QACV,OAAO;QACP,iBAAiB;KAClB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAEX,OAAO,eAAe,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,WAAW,UAAU,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,CAAA;AACnF,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,QAAQ,EACR,eAAe,GAIhB;IACC,MAAM,eAAe,GAAG,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,KAAK,eAAe,CAAA;IAEzG,OAAO;QACL,QAAQ,CAAC,IAAI;QACb,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxC,QAAQ;KACT,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACb,CAAC"}