@emabuild/core 0.3.0 → 0.4.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.
- package/dist/canvas/column-renderer.d.ts.map +1 -1
- package/dist/canvas/content-renderer.d.ts.map +1 -1
- package/dist/canvas/editor-canvas.d.ts +2 -0
- package/dist/canvas/editor-canvas.d.ts.map +1 -1
- package/dist/canvas/row-renderer.d.ts.map +1 -1
- package/dist/{form-tool-C7760Hvm.js → form-tool-DsPgMShR.js} +2 -2
- package/dist/{form-tool-C7760Hvm.js.map → form-tool-DsPgMShR.js.map} +1 -1
- package/dist/{html-tool-4zZO2hqE.js → html-tool-BxhBGl4L.js} +2 -2
- package/dist/{html-tool-4zZO2hqE.js.map → html-tool-BxhBGl4L.js.map} +1 -1
- package/dist/{index-zy5NbC2E.js → index-2S5kBS5_.js} +302 -169
- package/dist/index-2S5kBS5_.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/mail-editor.d.ts.map +1 -1
- package/dist/{menu-tool-Cu5D_VYs.js → menu-tool-IZqYp8Vb.js} +2 -2
- package/dist/{menu-tool-Cu5D_VYs.js.map → menu-tool-IZqYp8Vb.js.map} +1 -1
- package/dist/properties/property-panel.d.ts.map +1 -1
- package/dist/properties/widgets/image-upload-widget.d.ts +4 -0
- package/dist/properties/widgets/image-upload-widget.d.ts.map +1 -0
- package/dist/properties/widgets/index.d.ts +1 -0
- package/dist/properties/widgets/index.d.ts.map +1 -1
- package/dist/sidebar/editor-sidebar.d.ts.map +1 -1
- package/dist/{social-tool-kPuP-4n6.js → social-tool-C1FeCyUm.js} +2 -2
- package/dist/{social-tool-kPuP-4n6.js.map → social-tool-C1FeCyUm.js.map} +1 -1
- package/dist/state/editor-store.d.ts +6 -1
- package/dist/state/editor-store.d.ts.map +1 -1
- package/dist/{table-tool-CcWFvTSc.js → table-tool-BD72-Fuj.js} +2 -2
- package/dist/{table-tool-CcWFvTSc.js.map → table-tool-BD72-Fuj.js.map} +1 -1
- package/dist/{timer-tool-CG1oul_Z.js → timer-tool-Dpw9p0uW.js} +2 -2
- package/dist/{timer-tool-CG1oul_Z.js.map → timer-tool-Dpw9p0uW.js.map} +1 -1
- package/dist/{video-tool-CttMka8Z.js → video-tool-CHhPfHaS.js} +2 -2
- package/dist/{video-tool-CttMka8Z.js.map → video-tool-CHhPfHaS.js.map} +1 -1
- package/package.json +26 -13
- package/dist/index-zy5NbC2E.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/column-renderer.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,uBAAuB,CAAC;AAE/B,qBACa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"column-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/column-renderer.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,uBAAuB,CAAC;AAE/B,qBACa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,MAAM,0BAkCX;IAEF,OAAO,CAAC,SAAS,CAAyC;IAE1B,MAAM,EAAG,YAAY,CAAC;IAEtD,IACI,KAAK,CAAC,CAAC,EAAE,WAAW,EAAiC;IACzD,IAAI,KAAK,IAAI,WAAW,CAAkC;IAE1B,YAAY,EAAG,YAAY,CAAC;IAChC,YAAY,SAAO;IAE/C,MAAM;CA8BP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/content-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,qBAAqB,CAAC;AAW7B,qBACa,eAAgB,SAAQ,UAAU;IAC7C,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"content-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/content-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,qBAAqB,CAAC;AAW7B,qBACa,eAAgB,SAAQ,UAAU;IAC7C,MAAM,CAAC,MAAM,0BAqGX;IAEF,OAAO,CAAC,SAAS,CAAkE;IAEnD,OAAO,EAAG,aAAa,CAAC;IAExD,IACI,KAAK,CAAC,CAAC,EAAE,WAAW,EAAiC;IACzD,IAAI,KAAK,IAAI,WAAW,CAAkC;IAE1B,YAAY,EAAG,YAAY,CAAC;IAEnD,OAAO,CAAC,OAAO,CAAS;IAEjC,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,UAAU,CAA4B;IAI9C,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,eAAe;IAgBvB,6DAA6D;IAC7D,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,YAAY;IAuDpB,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,iBAAiB,CAKvB;IAEF,OAAO,CAAC,gBAAgB,CAUtB;IAEF,6CAA6C;IAC7C,OAAO,CAAC,iBAAiB,CAUvB;IAEF,OAAO,CAAC,mBAAmB,CAMzB;IAEF,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,UAAU,CAA6B;IAI/C,iBAAiB;IAejB,oBAAoB;IAUpB,MAAM;IAyEN,4EAA4E;IAC5E,OAAO,CAAC,eAAe;CA0CxB"}
|
|
@@ -13,6 +13,8 @@ export declare class EditorCanvas extends LitElement {
|
|
|
13
13
|
connectedCallback(): void;
|
|
14
14
|
disconnectedCallback(): void;
|
|
15
15
|
private handleCanvasClick;
|
|
16
|
+
/** Flash the canvas border to confirm undo/redo */
|
|
17
|
+
flashUndo(): void;
|
|
16
18
|
private setViewMode;
|
|
17
19
|
private openQuickAdd;
|
|
18
20
|
private closeQuickAdd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-canvas.d.ts","sourceRoot":"","sources":["../../src/canvas/editor-canvas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,mBAAmB,CAAC;AAE3B,qBACa,YAAa,SAAQ,UAAU;IAC1C,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"editor-canvas.d.ts","sourceRoot":"","sources":["../../src/canvas/editor-canvas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,mBAAmB,CAAC;AAE3B,qBACa,YAAa,SAAQ,UAAU;IAC1C,MAAM,CAAC,MAAM,0BA8MX;IAEF,OAAO,CAAC,SAAS,CAAqD;IAEtE,IACI,KAAK,CAAC,CAAC,EAAE,WAAW,EAAiC;IACzD,IAAI,KAAK,IAAI,WAAW,CAAkC;IAE1B,YAAY,EAAG,YAAY,CAAC;IAEnD,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,WAAW,CAAkB;IAE9C,OAAO,CAAC,kBAAkB,CAAiC;IAElD,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,CAAC,iBAAiB;IAIzB,mDAAmD;IACnD,SAAS;IAQT,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;YAMP,YAAY;IAW1B,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,kBAAkB;IAsD1B,MAAM;CA4DP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/row-renderer.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,sBAAsB,CAAC;AAE9B,qBACa,WAAY,SAAQ,UAAU;IACzC,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"row-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/row-renderer.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,sBAAsB,CAAC;AAE9B,qBACa,WAAY,SAAQ,UAAU;IACzC,MAAM,CAAC,MAAM,0BAuHX;IAEF,OAAO,CAAC,SAAS,CAAqD;IAEtC,GAAG,EAAG,SAAS,CAAC;IAEhD,IACI,KAAK,CAAC,CAAC,EAAE,WAAW,EAAiC;IACzD,IAAI,KAAK,IAAI,WAAW,CAAkC;IAE1B,YAAY,EAAG,YAAY,CAAC;IAE5D,OAAO,CAAC,eAAe,CAOrB;IAEF,OAAO,CAAC,aAAa,CAGnB;IAEF,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,YAAY;IAOpB,MAAM;CA4EP"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html as p } from "lit";
|
|
2
|
-
import { s as o, j as b, e as u } from "./index-
|
|
2
|
+
import { s as o, j as b, e as u } from "./index-2S5kBS5_.js";
|
|
3
3
|
const n = [
|
|
4
4
|
{ label: "Name", name: "name", type: "text", placeholder: "Your name" },
|
|
5
5
|
{ label: "Email", name: "email", type: "email", placeholder: "your@email.com" }
|
|
@@ -67,4 +67,4 @@ const n = [
|
|
|
67
67
|
export {
|
|
68
68
|
y as formTool
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=form-tool-
|
|
70
|
+
//# sourceMappingURL=form-tool-DsPgMShR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-tool-
|
|
1
|
+
{"version":3,"file":"form-tool-DsPgMShR.js","sources":["../src/tools/built-in/form-tool.ts"],"sourcesContent":["/**\n * @module form-tool\n *\n * Input form with configurable fields and submit button.\n * Only available in \"web\" display mode (forms don't work in email).\n *\n * Email compatibility: N/A — this tool is for web/popup display mode only.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport type { ContentValues } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str, jsonParse } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\nimport type { FormField } from '../helpers/types.js';\n\nconst DEFAULT_FIELDS: FormField[] = [\n { label: 'Name', name: 'name', type: 'text', placeholder: 'Your name' },\n { label: 'Email', name: 'email', type: 'email', placeholder: 'your@email.com' },\n];\n\nexport const formTool: LitToolDefinition = {\n name: 'form',\n label: 'Form',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M7 7h10\"/><path d=\"M7 12h10\"/><path d=\"M7 17h6\"/></svg>`,\n supportedDisplayModes: ['web'],\n position: 13,\n options: {\n form: {\n title: 'Form',\n options: {\n actionUrl: { label: 'Action URL', defaultValue: '#', widget: 'text' },\n method: { label: 'Method', defaultValue: 'POST', widget: 'text' },\n submitText: { label: 'Submit Text', defaultValue: 'Submit', widget: 'text' },\n fields: { label: 'Fields (JSON)', defaultValue: JSON.stringify(DEFAULT_FIELDS), widget: 'rich_text' },\n },\n },\n style: {\n title: 'Style',\n options: {\n buttonBg: { label: 'Button Color', defaultValue: '#3b82f6', widget: 'color_picker' },\n buttonColor: { label: 'Button Text', defaultValue: '#ffffff', widget: 'color_picker' },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n actionUrl: '#', method: 'POST', submitText: 'Submit',\n fields: JSON.stringify(DEFAULT_FIELDS), buttonBg: '#3b82f6',\n buttonColor: '#ffffff', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const submitText = str(values, 'submitText', 'Submit');\n const btnBg = str(values, 'buttonBg', '#3b82f6');\n const btnColor = str(values, 'buttonColor', '#ffffff');\n const fields = jsonParse<FormField[]>(values.fields, DEFAULT_FIELDS);\n\n return html`\n <div style=\"font-family:arial,sans-serif;\">\n ${fields.map((f) => html`\n <div style=\"margin-bottom:12px;\">\n <label style=\"display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;\">${f.label}</label>\n <input type=${f.type || 'text'} placeholder=${f.placeholder || ''} style=\"width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;\" />\n </div>\n `)}\n <button style=\"background:${btnBg};color:${btnColor};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;\">${submitText}</button>\n </div>\n `;\n },\n renderHtml(values: ContentValues): string {\n const padding = str(values, 'containerPadding', '10px');\n const actionUrl = str(values, 'actionUrl', '#');\n const method = str(values, 'method', 'POST');\n const submitText = str(values, 'submitText', 'Submit');\n const btnBg = str(values, 'buttonBg', '#3b82f6');\n const btnColor = str(values, 'buttonColor', '#ffffff');\n const fields = jsonParse<FormField[]>(values.fields, DEFAULT_FIELDS);\n const font = 'font-family:arial,helvetica,sans-serif;';\n\n const fieldsHtml = fields.map((f) =>\n `<div style=\"margin-bottom:12px;\"><label style=\"display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;${font}\">${f.label}</label><input type=\"${f.type || 'text'}\" name=\"${f.name}\" placeholder=\"${f.placeholder || ''}\" style=\"width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;${font}\" /></div>`\n ).join('');\n\n const inner = `<form action=\"${actionUrl}\" method=\"${method}\">${fieldsHtml}<button type=\"submit\" style=\"background-color:${btnBg};color:${btnColor};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;${font}\">${submitText}</button></form>`;\n return emailTableCell(inner, { padding });\n },\n },\n};\n"],"names":["DEFAULT_FIELDS","formTool","values","str","submitText","btnBg","btnColor","fields","jsonParse","html","f","padding","actionUrl","method","font","fieldsHtml","inner","emailTableCell"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html as l } from "lit";
|
|
2
2
|
import { unsafeHTML as i } from "lit/directives/unsafe-html.js";
|
|
3
|
-
import { e as o, s as t } from "./index-
|
|
3
|
+
import { e as o, s as t } from "./index-2S5kBS5_.js";
|
|
4
4
|
const r = {
|
|
5
5
|
name: "html",
|
|
6
6
|
label: "HTML",
|
|
@@ -46,4 +46,4 @@ const r = {
|
|
|
46
46
|
export {
|
|
47
47
|
r as htmlTool
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=html-tool-
|
|
49
|
+
//# sourceMappingURL=html-tool-BxhBGl4L.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-tool-
|
|
1
|
+
{"version":3,"file":"html-tool-BxhBGl4L.js","sources":["../src/tools/built-in/html-tool.ts"],"sourcesContent":["/**\n * @module html-tool\n *\n * Raw HTML content block for custom code injection.\n *\n * Email compatibility: Content is inserted as-is inside a table cell.\n * The user is responsible for email-safe HTML in this block.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport type { ContentValues } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\n\nexport const htmlTool: LitToolDefinition = {\n name: 'html',\n label: 'HTML',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 6,\n options: {\n html: {\n title: 'HTML',\n options: {\n html: {\n label: 'Custom HTML',\n defaultValue: '<div style=\"padding:20px;text-align:center;color:#999;\">Custom HTML Block</div>',\n widget: 'rich_text',\n },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'text' } },\n },\n general: {\n title: 'General',\n options: {\n hideDesktop: { label: 'Hide on Desktop', defaultValue: false, widget: 'toggle' },\n hideMobile: { label: 'Hide on Mobile', defaultValue: false, widget: 'toggle' },\n },\n },\n },\n defaultValues: {\n html: '<div style=\"padding:20px;text-align:center;color:#999;\">Custom HTML Block</div>',\n containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n return html`<div style=\"\">${unsafeHTML(str(values, 'html'))}</div>`;\n },\n renderHtml(values: ContentValues): string {\n return emailTableCell(str(values, 'html'), { padding: str(values, 'containerPadding', '10px') });\n },\n },\n};\n"],"names":["htmlTool","values","html","unsafeHTML","str","emailTableCell"],"mappings":";;;AAgBO,MAAMA,IAA8B;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,uBAAuB,CAAC,SAAS,KAAK;AAAA,EACtC,UAAU;AAAA,EACV,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,QACP,MAAM;AAAA,UACJ,OAAO;AAAA,UACP,cAAc;AAAA,UACd,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IACF;AAAA,IAEF,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS,EAAE,kBAAkB,EAAE,OAAO,WAAW,cAAc,QAAQ,QAAQ,OAAA,EAAO;AAAA,IAAE;AAAA,IAE1F,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,QACP,aAAa,EAAE,OAAO,mBAAmB,cAAc,IAAO,QAAQ,SAAA;AAAA,QACtE,YAAY,EAAE,OAAO,kBAAkB,cAAc,IAAO,QAAQ,SAAA;AAAA,MAAS;AAAA,IAC/E;AAAA,EACF;AAAA,EAEF,eAAe;AAAA,IACb,MAAM;AAAA,IACN,kBAAkB;AAAA,EAAA;AAAA,EAEpB,UAAU;AAAA,IACR,aAAaC,GAAuC;AAClD,aAAOC,kBAAqBC,EAAWC,EAAIH,GAAQ,MAAM,CAAC,CAAC;AAAA,IAC7D;AAAA,IACA,WAAWA,GAA+B;AACxC,aAAOI,EAAeD,EAAIH,GAAQ,MAAM,GAAG,EAAE,SAASG,EAAIH,GAAQ,oBAAoB,MAAM,EAAA,CAAG;AAAA,IACjG;AAAA,EAAA;AAEJ;"}
|