@lit-pigeon/core 0.3.3 → 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.
@@ -0,0 +1,407 @@
1
+ const u = "2026-09-23T10:00:00.000Z", v = "Inter, Helvetica, Arial, sans-serif", f = "#0f172a", i = "#64748b", k = "#e2e8f0", r = (t, e = t, n = t, o = e) => ({ top: t, right: e, bottom: n, left: o }), m = r(0);
2
+ function g(t, e) {
3
+ return {
4
+ id: `starter-${t.id}`,
5
+ name: t.name,
6
+ description: t.description,
7
+ category: t.category,
8
+ createdAt: u,
9
+ updatedAt: u,
10
+ document: {
11
+ version: "1.0",
12
+ metadata: { name: t.name, previewText: t.previewText, createdAt: u, updatedAt: u },
13
+ body: {
14
+ attributes: { width: 600, backgroundColor: t.background, fontFamily: v, contentAlignment: "center" },
15
+ rows: e(w(t.id))
16
+ }
17
+ }
18
+ };
19
+ }
20
+ function w(t) {
21
+ let e = 0;
22
+ const n = (p) => `${t}-${p}${++e}`, o = (p, c = {}) => ({
23
+ id: n("r"),
24
+ type: "row",
25
+ locked: !1,
26
+ attributes: {
27
+ ...c.background ? { backgroundColor: c.background } : {},
28
+ padding: c.padding ?? r(16, 32),
29
+ fullWidth: c.fullWidth ?? !1
30
+ },
31
+ columnRatios: c.ratios ?? [12],
32
+ columns: p.map((d) => ({
33
+ id: n("c"),
34
+ type: "column",
35
+ attributes: { padding: m, verticalAlign: c.align ?? "top" },
36
+ blocks: d
37
+ }))
38
+ }), a = (p, c = "left", d = m) => ({
39
+ id: n("b"),
40
+ type: "text",
41
+ values: { content: p, padding: d, lineHeight: "1.6", textAlign: c }
42
+ }), s = (p, c, d = {}) => ({
43
+ id: n("b"),
44
+ type: "button",
45
+ values: {
46
+ content: `<p>${p}</p>`,
47
+ href: c,
48
+ backgroundColor: d.color ?? f,
49
+ textColor: "#ffffff",
50
+ borderRadius: 6,
51
+ padding: r(16, 0),
52
+ innerPadding: r(14, 28),
53
+ fontSize: 16,
54
+ fontWeight: "600",
55
+ alignment: d.align ?? "left",
56
+ fullWidth: d.fullWidth ?? !1
57
+ }
58
+ }), l = (p, c, d = {}) => ({
59
+ id: n("b"),
60
+ type: "image",
61
+ values: {
62
+ src: p,
63
+ alt: c,
64
+ width: d.width ?? "auto",
65
+ ...d.href ? { href: d.href } : {},
66
+ padding: m,
67
+ alignment: "center",
68
+ ...d.radius ? { borderRadius: d.radius } : {}
69
+ }
70
+ }), x = (p = r(8, 0)) => ({
71
+ id: n("b"),
72
+ type: "divider",
73
+ values: { borderColor: k, borderWidth: 1, borderStyle: "solid", padding: p, width: "100%" }
74
+ }), y = () => ({
75
+ id: n("b"),
76
+ type: "social",
77
+ values: {
78
+ icons: [
79
+ { type: "instagram", href: "https://instagram.com/" },
80
+ { type: "linkedin", href: "https://linkedin.com/" },
81
+ { type: "youtube", href: "https://youtube.com/" }
82
+ ],
83
+ iconSize: 24,
84
+ spacing: 8,
85
+ alignment: "center",
86
+ padding: r(8, 0)
87
+ }
88
+ });
89
+ return { row: o, text: a, button: s, image: l, divider: x, social: y, logo: (p = f) => o([[a(`<p style="margin:0;font-size:18px;font-weight:700;color:${p};">{{company}}</p>`)]], { padding: r(24, 32, 8) }), serviceFooter: (p) => o(
90
+ [[a(`<p style="margin:0;color:${i};font-size:12px;">${p}<br>{{company}} · {{companyAddress}}</p>`, "center")]],
91
+ { padding: r(24, 32) }
92
+ ), marketingFooter: () => o(
93
+ [[
94
+ y(),
95
+ a(
96
+ `<p style="margin:0;color:${i};font-size:12px;">You're receiving this because you subscribed to {{company}}.<br><a href="{{unsubscribeUrl}}" style="color:${i};">Unsubscribe</a> · <a href="{{webViewUrl}}" style="color:${i};">View in browser</a></p>`,
97
+ "center"
98
+ )
99
+ ]],
100
+ { padding: r(24, 32) }
101
+ ), line: (p, c, d = {}) => {
102
+ const h = (b) => d.strong ? `<strong>${b}</strong>` : b;
103
+ return o([[a(`<p style="margin:0;">${h(p)}</p>`)], [a(`<p style="margin:0;">${h(c)}</p>`, "right")]], {
104
+ ratios: [8, 4],
105
+ background: d.background ?? "#ffffff",
106
+ padding: r(6, 32)
107
+ });
108
+ } };
109
+ }
110
+ const z = g(
111
+ {
112
+ id: "order-confirmation",
113
+ name: "Order confirmation",
114
+ description: "Itemised receipt with totals, delivery address and a link to the order.",
115
+ category: "transactional",
116
+ previewText: "We have your order {{orderNumber}}.",
117
+ background: "#f1f5f9"
118
+ },
119
+ ({ row: t, text: e, button: n, divider: o, logo: a, serviceFooter: s, line: l }) => [
120
+ a(),
121
+ t(
122
+ [[
123
+ e(`<h1 style="margin:0 0 8px;font-size:26px;color:${f};">Thanks for your order, {{firstName}}</h1><p style="margin:0;color:${i};">Order <strong>{{orderNumber}}</strong> · placed {{orderDate}}</p>`)
124
+ ]],
125
+ { background: "#ffffff", padding: r(32, 32, 16) }
126
+ ),
127
+ t([[o()]], { background: "#ffffff", padding: r(0, 32) }),
128
+ l("Linen shirt × 1", "$48.00"),
129
+ l("Wool jumper × 1", "$84.00"),
130
+ t([[o()]], { background: "#ffffff", padding: r(0, 32) }),
131
+ l("Subtotal", "{{subtotal}}"),
132
+ l("Shipping", "{{shipping}}"),
133
+ l("Total", "{{total}}", { strong: !0 }),
134
+ t(
135
+ [
136
+ [e(`<p style="margin:0 0 4px;font-size:12px;color:${i};text-transform:uppercase;letter-spacing:1px;">Delivering to</p><p style="margin:0;">{{shippingName}}<br>{{shippingAddress}}</p>`)],
137
+ [e(`<p style="margin:0 0 4px;font-size:12px;color:${i};text-transform:uppercase;letter-spacing:1px;">Estimated delivery</p><p style="margin:0;">{{deliveryDate}}</p>`)]
138
+ ],
139
+ { ratios: [6, 6], background: "#f8fafc", padding: r(20, 32) }
140
+ ),
141
+ t([[n("View your order", "{{orderUrl}}")]], { background: "#ffffff", padding: r(24, 32, 32) }),
142
+ s("Questions about your order? Reply to this email.")
143
+ ]
144
+ ), $ = g(
145
+ {
146
+ id: "shipping-update",
147
+ name: "Shipping update",
148
+ description: "Dispatch notice with carrier, tracking number and a progress line.",
149
+ category: "transactional",
150
+ previewText: "Order {{orderNumber}} has shipped.",
151
+ background: "#f1f5f9"
152
+ },
153
+ ({ row: t, text: e, button: n, logo: o, serviceFooter: a }) => [
154
+ o(),
155
+ t(
156
+ [[
157
+ e(`<p style="margin:0 0 8px;font-size:12px;color:#2563eb;font-weight:600;text-transform:uppercase;letter-spacing:1px;">On its way</p><h1 style="margin:0 0 8px;font-size:26px;color:${f};">Your order has shipped</h1><p style="margin:0;color:${i};">Good news, {{firstName}}: order <strong>{{orderNumber}}</strong> left our warehouse today.</p>`)
158
+ ]],
159
+ { background: "#ffffff", padding: r(32, 32, 16) }
160
+ ),
161
+ t(
162
+ [
163
+ [e('<p style="margin:0;color:#2563eb;font-weight:600;">● Ordered</p>', "left")],
164
+ [e('<p style="margin:0;color:#2563eb;font-weight:600;">● Shipped</p>', "center")],
165
+ [e(`<p style="margin:0;color:${i};">○ Delivered</p>`, "right")]
166
+ ],
167
+ { ratios: [4, 4, 4], background: "#ffffff", padding: r(8, 32) }
168
+ ),
169
+ t(
170
+ [
171
+ [e(`<p style="margin:0 0 4px;font-size:12px;color:${i};">Carrier</p><p style="margin:0;"><strong>{{carrier}}</strong></p>`)],
172
+ [e(`<p style="margin:0 0 4px;font-size:12px;color:${i};">Tracking number</p><p style="margin:0;"><strong>{{trackingNumber}}</strong></p>`)],
173
+ [e(`<p style="margin:0 0 4px;font-size:12px;color:${i};">Expected</p><p style="margin:0;"><strong>{{deliveryDate}}</strong></p>`)]
174
+ ],
175
+ { ratios: [4, 4, 4], background: "#f8fafc", padding: r(20, 32) }
176
+ ),
177
+ t([[n("Track your parcel", "{{trackingUrl}}", { color: "#2563eb" })]], { background: "#ffffff", padding: r(24, 32, 32) }),
178
+ a("Tracking can take up to 24 hours to show the first scan.")
179
+ ]
180
+ ), T = g(
181
+ {
182
+ id: "password-reset",
183
+ name: "Password reset",
184
+ description: "Short, single-action reset email with an expiry note and a safety line.",
185
+ category: "transactional",
186
+ previewText: "Reset your {{company}} password.",
187
+ background: "#f1f5f9"
188
+ },
189
+ ({ row: t, text: e, button: n, divider: o, logo: a, serviceFooter: s }) => [
190
+ a(),
191
+ t(
192
+ [[
193
+ e(`<h1 style="margin:0 0 12px;font-size:24px;color:${f};">Reset your password</h1><p style="margin:0;">Hi {{firstName}}, we received a request to reset the password for <strong>{{email}}</strong>. Choose a new one with the button below.</p>`),
194
+ n("Choose a new password", "{{resetUrl}}"),
195
+ e(`<p style="margin:0;color:${i};font-size:14px;">This link expires in {{expiryMinutes}} minutes and can only be used once.</p>`),
196
+ o(r(16, 0)),
197
+ e(`<p style="margin:0;color:${i};font-size:13px;">Didn't ask for this? You can ignore this email; your password won't change. If you think someone else is trying to access your account, <a href="{{supportUrl}}" style="color:${i};">contact support</a>.</p>`)
198
+ ]],
199
+ { background: "#ffffff", padding: r(32) }
200
+ ),
201
+ s("This is an automated security message.")
202
+ ]
203
+ ), N = g(
204
+ {
205
+ id: "invoice",
206
+ name: "Invoice / receipt",
207
+ description: "Invoice with billing details, line items, tax, total due and a pay button.",
208
+ category: "transactional",
209
+ previewText: "Invoice {{invoiceNumber}} for {{total}}.",
210
+ background: "#f1f5f9"
211
+ },
212
+ ({ row: t, text: e, button: n, divider: o, serviceFooter: a, line: s }) => [
213
+ t(
214
+ [
215
+ [e(`<p style="margin:0;font-size:18px;font-weight:700;color:${f};">{{company}}</p>`)],
216
+ [e(`<p style="margin:0;font-size:22px;font-weight:700;color:${i};letter-spacing:2px;">INVOICE</p>`, "right")]
217
+ ],
218
+ { ratios: [6, 6], padding: r(24, 32, 8), align: "middle" }
219
+ ),
220
+ t(
221
+ [
222
+ [e(`<p style="margin:0 0 4px;font-size:12px;color:${i};">Billed to</p><p style="margin:0;">{{customerName}}<br>{{billingAddress}}</p>`)],
223
+ [e('<p style="margin:0;font-size:14px;">Invoice <strong>{{invoiceNumber}}</strong><br>Issued {{invoiceDate}}<br>Due {{dueDate}}</p>', "right")]
224
+ ],
225
+ { ratios: [6, 6], background: "#ffffff", padding: r(28, 32, 16) }
226
+ ),
227
+ t(
228
+ [
229
+ [e(`<p style="margin:0;font-size:12px;color:${i};text-transform:uppercase;letter-spacing:1px;">Description</p>`)],
230
+ [e(`<p style="margin:0;font-size:12px;color:${i};text-transform:uppercase;letter-spacing:1px;">Amount</p>`, "right")]
231
+ ],
232
+ { ratios: [8, 4], background: "#f8fafc", padding: r(10, 32) }
233
+ ),
234
+ s("Pro plan, monthly", "$49.00"),
235
+ s("Additional seats × 3", "$27.00"),
236
+ t([[o()]], { background: "#ffffff", padding: r(0, 32) }),
237
+ s("Subtotal", "{{subtotal}}"),
238
+ s("Tax", "{{tax}}"),
239
+ s("Total due", "{{total}}", { strong: !0 }),
240
+ t([[n("Pay this invoice", "{{paymentUrl}}", { color: "#16a34a" })]], { background: "#ffffff", padding: r(24, 32, 32) }),
241
+ a("Keep this email for your records. A PDF copy is available from your billing page.")
242
+ ]
243
+ ), A = g(
244
+ {
245
+ id: "event-invite",
246
+ name: "Event invitation",
247
+ description: "Invitation with date, time and venue, an agenda and an RSVP button.",
248
+ category: "announcement",
249
+ previewText: "You are invited: {{eventName}}.",
250
+ background: "#faf5ff"
251
+ },
252
+ ({ row: t, text: e, button: n, image: o, divider: a, marketingFooter: s }) => [
253
+ t([[o("https://placehold.co/600x260/6d28d9/ffffff?text=You%27re+invited", "You're invited")]], { padding: m, fullWidth: !0 }),
254
+ t(
255
+ [[
256
+ e(`<h1 style="margin:0 0 12px;font-size:28px;color:${f};">{{eventName}}</h1><p style="margin:0;">Hi {{firstName}}, join us for an evening of short talks, demos and conversation with the people building {{company}}.</p>`)
257
+ ]],
258
+ { background: "#ffffff", padding: r(32, 32, 16) }
259
+ ),
260
+ t(
261
+ [
262
+ [e('<p style="margin:0 0 4px;font-size:12px;color:#6d28d9;font-weight:600;">DATE</p><p style="margin:0;">{{eventDate}}</p>')],
263
+ [e('<p style="margin:0 0 4px;font-size:12px;color:#6d28d9;font-weight:600;">TIME</p><p style="margin:0;">{{eventTime}}</p>')],
264
+ [e('<p style="margin:0 0 4px;font-size:12px;color:#6d28d9;font-weight:600;">WHERE</p><p style="margin:0;">{{venue}}</p>')]
265
+ ],
266
+ { ratios: [4, 4, 4], background: "#f5f3ff", padding: r(20, 32) }
267
+ ),
268
+ t(
269
+ [[
270
+ e('<p style="margin:0 0 8px;"><strong>Agenda</strong></p><p style="margin:0;">18:00 · Doors and drinks<br>18:30 · Talks<br>19:30 · Demos and Q&amp;A<br>20:30 · Close</p>'),
271
+ a(r(16, 0)),
272
+ n("RSVP now", "{{rsvpUrl}}", { color: "#6d28d9", align: "center", fullWidth: !0 }),
273
+ e(`<p style="margin:0;color:${i};font-size:13px;">Places are limited. Please reply by {{rsvpDeadline}}.</p>`, "center", r(8, 0, 0))
274
+ ]],
275
+ { background: "#ffffff", padding: r(24, 32, 32) }
276
+ ),
277
+ s()
278
+ ]
279
+ ), I = g(
280
+ {
281
+ id: "product-launch",
282
+ name: "Product launch",
283
+ description: "Launch announcement with a hero, three feature highlights and a primary CTA.",
284
+ category: "announcement",
285
+ previewText: "Introducing {{productName}}.",
286
+ background: "#0f172a"
287
+ },
288
+ ({ row: t, text: e, button: n, image: o, marketingFooter: a }) => [
289
+ t(
290
+ [[
291
+ e('<p style="margin:0 0 12px;font-size:12px;color:#38bdf8;font-weight:600;letter-spacing:2px;">NEW</p><h1 style="margin:0 0 12px;font-size:34px;color:#ffffff;">Meet {{productName}}</h1><p style="margin:0;color:#cbd5e1;font-size:17px;">The fastest way to ship the thing your team keeps putting off.</p>', "center"),
292
+ n("See what’s new", "{{productUrl}}", { color: "#0284c7", align: "center" })
293
+ ]],
294
+ { padding: r(48, 32, 24) }
295
+ ),
296
+ t([[o("https://placehold.co/560x320/1e293b/94a3b8?text=Product+screenshot", "Product screenshot", { radius: 8 })]], { padding: r(0, 20, 32) }),
297
+ t(
298
+ [
299
+ [e('<p style="margin:0 0 6px;font-size:16px;"><strong>Faster</strong></p><p style="margin:0;color:#475569;font-size:14px;">Starts in under a second, even on large projects.</p>')],
300
+ [e('<p style="margin:0 0 6px;font-size:16px;"><strong>Simpler</strong></p><p style="margin:0;color:#475569;font-size:14px;">One settings page instead of twelve.</p>')],
301
+ [e('<p style="margin:0 0 6px;font-size:16px;"><strong>Yours</strong></p><p style="margin:0;color:#475569;font-size:14px;">Export everything, any time, in open formats.</p>')]
302
+ ],
303
+ { ratios: [4, 4, 4], background: "#ffffff", padding: r(32, 24) }
304
+ ),
305
+ t(
306
+ [[
307
+ e('<p style="margin:0;">{{firstName}}, existing customers get {{productName}} at no extra cost from today.</p>', "center"),
308
+ n("Try it now", "{{productUrl}}", { align: "center" })
309
+ ]],
310
+ { background: "#ffffff", padding: r(0, 32, 32) }
311
+ ),
312
+ a()
313
+ ]
314
+ ), S = g(
315
+ {
316
+ id: "abandoned-cart",
317
+ name: "Abandoned cart",
318
+ description: "Friendly reminder with the saved item, price and a return-to-cart button.",
319
+ category: "promo",
320
+ previewText: "You left something in your cart.",
321
+ background: "#fdf6ee"
322
+ },
323
+ ({ row: t, text: e, button: n, image: o, divider: a, logo: s, marketingFooter: l }) => [
324
+ s("#9a3412"),
325
+ t(
326
+ [[
327
+ e(`<h1 style="margin:0 0 12px;font-size:26px;color:${f};">Still thinking it over?</h1><p style="margin:0;">Hi {{firstName}}, you left something in your cart. We've saved it for you, but stock is limited.</p>`)
328
+ ]],
329
+ { background: "#ffffff", padding: r(32, 32, 16) }
330
+ ),
331
+ t(
332
+ [
333
+ [o("https://placehold.co/200x200/fed7aa/9a3412?text=Item", "{{cartItemName}}", { width: 160, radius: 6, href: "{{cartUrl}}" })],
334
+ [e('<p style="margin:0 0 4px;font-size:18px;"><strong>{{cartItemName}}</strong></p><p style="margin:0 0 4px;color:#64748b;">Qty {{cartItemQuantity}}</p><p style="margin:0;font-size:18px;">{{cartItemPrice}}</p>')]
335
+ ],
336
+ { ratios: [5, 7], background: "#ffffff", padding: r(8, 32), align: "middle" }
337
+ ),
338
+ t(
339
+ [[
340
+ a(r(16, 0)),
341
+ n("Return to your cart", "{{cartUrl}}", { color: "#ea580c", fullWidth: !0 }),
342
+ e(`<p style="margin:0;color:${i};font-size:13px;">Free returns within 30 days. Need help? Reply to this email.</p>`, "center", r(8, 0, 0))
343
+ ]],
344
+ { background: "#ffffff", padding: r(8, 32, 32) }
345
+ ),
346
+ l()
347
+ ]
348
+ ), D = g(
349
+ {
350
+ id: "monthly-digest",
351
+ name: "Monthly digest",
352
+ description: "Round-up with a lead story, two secondary stories and a numbers strip.",
353
+ category: "newsletter",
354
+ previewText: "Your {{month}} round-up from {{company}}.",
355
+ background: "#f8fafc"
356
+ },
357
+ ({ row: t, text: e, button: n, image: o, divider: a, logo: s, marketingFooter: l }) => [
358
+ s(),
359
+ t(
360
+ [[e(`<p style="margin:0;color:${i};font-size:13px;">{{month}} digest · Issue {{issueNumber}}</p>`)]],
361
+ { padding: r(0, 32, 16) }
362
+ ),
363
+ t(
364
+ [[
365
+ o("https://placehold.co/536x240/cbd5e1/334155?text=Lead+story", "Lead story", { radius: 6, href: "https://example.com/lead" }),
366
+ e(`<h2 style="margin:16px 0 8px;font-size:22px;color:${f};">What we shipped this month</h2><p style="margin:0;">A faster editor, a cleaner export and a long-requested dark mode. Here is the short version, {{firstName}}.</p>`),
367
+ n("Read the full story", "https://example.com/lead")
368
+ ]],
369
+ { background: "#ffffff", padding: r(32) }
370
+ ),
371
+ t(
372
+ [
373
+ [
374
+ o("https://placehold.co/260x160/e2e8f0/475569?text=Story+two", "Story two", { radius: 6, href: "https://example.com/two" }),
375
+ e('<p style="margin:12px 0 4px;"><strong>How one team halved its send time</strong></p><p style="margin:0;color:#475569;font-size:14px;">A customer story in five charts.</p>')
376
+ ],
377
+ [
378
+ o("https://placehold.co/260x160/e2e8f0/475569?text=Story+three", "Story three", { radius: 6, href: "https://example.com/three" }),
379
+ e('<p style="margin:12px 0 4px;"><strong>Five layouts that work in every inbox</strong></p><p style="margin:0;color:#475569;font-size:14px;">Tested in Outlook, Gmail and Apple Mail.</p>')
380
+ ]
381
+ ],
382
+ { ratios: [6, 6], background: "#ffffff", padding: r(0, 32, 24) }
383
+ ),
384
+ t([[a()]], { background: "#ffffff", padding: r(0, 32) }),
385
+ t(
386
+ [
387
+ [e(`<p style="margin:0;font-size:24px;font-weight:700;color:${f};">{{stat1}}</p><p style="margin:0;color:${i};font-size:13px;">emails sent</p>`, "center")],
388
+ [e(`<p style="margin:0;font-size:24px;font-weight:700;color:${f};">{{stat2}}</p><p style="margin:0;color:${i};font-size:13px;">new customers</p>`, "center")],
389
+ [e(`<p style="margin:0;font-size:24px;font-weight:700;color:${f};">{{stat3}}</p><p style="margin:0;color:${i};font-size:13px;">uptime</p>`, "center")]
390
+ ],
391
+ { ratios: [4, 4, 4], background: "#ffffff", padding: r(16, 32, 32) }
392
+ ),
393
+ l()
394
+ ]
395
+ ), W = Object.freeze([
396
+ z,
397
+ $,
398
+ T,
399
+ N,
400
+ A,
401
+ I,
402
+ S,
403
+ D
404
+ ]);
405
+ export {
406
+ W as GALLERY_TEMPLATES
407
+ };
package/dist/index.cjs CHANGED
@@ -1 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("immer"),N=require("nanoid");class M{constructor(t){this._steps=[],this._selection=null,this._selectionSet=!1,this._meta=new Map,this._doc=t}get steps(){return this._steps}get selection(){return this._selection}get selectionSet(){return this._selectionSet}get meta(){return this._meta}get doc(){return this._doc}addStep(t){return this._doc=t.apply(this._doc),this._steps.push(t),this}setSelection(t){return this._selection=t,this._selectionSet=!0,this}setMeta(t,e){return this._meta.set(t,e),this}getMeta(t){return this._meta.get(t)}}function m(o,t,e,n){return{type:o,path:t,apply(r){return B.produce(r,e)},invert(r){return m(`${o}:invert`,t,n,e)}}}function g(){return N.nanoid(10)}function b(o=0){return{top:o,right:o,bottom:o,left:o}}function j(){return{content:"<p>Enter your text here</p>",padding:b(10),lineHeight:"1.5",textAlign:"left"}}function z(){return{src:"",alt:"",width:"auto",padding:b(10),alignment:"center"}}function q(){return{content:"<p>Click me</p>",href:"#",backgroundColor:"#3b82f6",textColor:"#ffffff",borderRadius:4,padding:b(10),innerPadding:{top:12,right:24,bottom:12,left:24},fontSize:16,fontWeight:"600",alignment:"center",fullWidth:!1}}function U(){return{borderColor:"#e2e8f0",borderWidth:1,borderStyle:"solid",padding:b(10),width:"100%"}}function F(){return{height:20}}function K(){return{icons:[],iconSize:32,spacing:8,alignment:"center",padding:b(10)}}function Y(){return{content:"",padding:b(0)}}function G(){return{backgroundUrl:"",backgroundPosition:"center center",mode:"fluid-height",width:600,height:400,verticalAlign:"middle",padding:b(0),innerPadding:b(20),backgroundColor:"#ffffff",content:'<p style="color:#ffffff;font-size:24px;">Hero Title</p>'}}function X(){return{links:[{href:"#",text:"Home"},{href:"#",text:"About"},{href:"#",text:"Contact"}],hamburger:"hamburger",alignment:"center",padding:b(10),linkColor:"#000000",linkFontSize:14,linkPadding:"10px 15px"}}const $={text:j,image:z,button:q,divider:U,spacer:F,social:K,html:Y,hero:G,navbar:X};function y(o){const t=$[o];if(!t)throw new Error(`Unknown block type: ${o}`);return t()}let I=null;function Z(o){I=o}function J(o,t){const e=$[o];if(e)return{id:g(),type:o,values:{...e(),...t}};const n=I==null?void 0:I(o);if(n)return{id:g(),type:o,values:{...structuredClone(n),...t}};throw new Error(`Unknown block type: ${o}`)}function T(o=[]){return{id:g(),type:"column",attributes:{padding:b(0),verticalAlign:"top"},blocks:o}}function Q(o,t){const e=o??[T()],n=t??e.map(()=>Math.floor(12/e.length));return{id:g(),type:"row",attributes:{padding:b(0),fullWidth:!1},columns:e,columnRatios:n,locked:!1}}function E(o="Untitled"){const t=new Date().toISOString();return{version:"1.0",metadata:{name:o,createdAt:t,updatedAt:t},body:{attributes:{width:600,backgroundColor:"#f4f4f5",fontFamily:"Arial, Helvetica, sans-serif",contentAlignment:"center"},rows:[]}}}class S{constructor(t,e,n,r){this.doc=t,this.selection=e,this.plugins=n,this._pluginList=r}static create(t={}){const e=t.doc??E(),n=t.plugins??[],r=new Map,s=new S(e,null,r,n);for(const i of n)i.init&&r.set(i.name,i.init(s));return s}createTransaction(){return new M(this.doc)}apply(t){let e=t.doc;const n=t.selectionSet?t.selection:this.selection,r=new Map(this.plugins);for(const i of this._pluginList)if(i.apply){const l=r.get(i.name);r.set(i.name,i.apply(t,l))}t.steps.length>0&&!t.getMeta("skipTimestamp")&&(e=B.produce(e,i=>{i.metadata.updatedAt=new Date().toISOString()}));const s=new S(e,n,r,this._pluginList);for(const i of this._pluginList)i.onStateChange&&i.onStateChange(s,this);return s}getPluginState(t){return this.plugins.get(t)}}function v(o,t,e){return{type:"block",rowId:o,columnId:t,blockId:e}}function A(o){return{type:"row",rowId:o}}function tt(o,t){return{type:"column",rowId:o,columnId:t}}function et(){return{type:"body"}}function ot(o,t){return o===t?!0:!o||!t?!1:o.type===t.type&&o.rowId===t.rowId&&o.columnId===t.columnId&&o.blockId===t.blockId}function k(o,t,e){const n=o.body.rows.findIndex(s=>s.id===t);if(n===-1)return null;const r=o.body.rows[n].columns.findIndex(s=>s.id===e);return r===-1?null:{rowIndex:n,columnIndex:r}}function nt(o,t,e,n){return(r,s)=>{const i=k(r.doc,o,t);if(!i)return!1;const l=r.doc.body.rows[i.rowIndex].columns[i.columnIndex],a=n??l.blocks.length;if(s){const c=r.createTransaction(),u=m("insertBlock",`body.rows[${i.rowIndex}].columns[${i.columnIndex}].blocks`,d=>{d.body.rows[i.rowIndex].columns[i.columnIndex].blocks.splice(a,0,e)},d=>{d.body.rows[i.rowIndex].columns[i.columnIndex].blocks.splice(a,1)});c.addStep(u),c.setSelection(v(o,t,e.id)),s(c)}return!0}}function rt(o,t,e){return(n,r)=>{const s=k(n.doc,o,t);if(!s)return!1;const i=n.doc.body.rows[s.rowIndex].columns[s.columnIndex],l=i.blocks.findIndex(a=>a.id===e);if(l===-1)return!1;if(r){const a=i.blocks[l],c=n.createTransaction(),u=m("deleteBlock",`body.rows[${s.rowIndex}].columns[${s.columnIndex}].blocks`,d=>{d.body.rows[s.rowIndex].columns[s.columnIndex].blocks.splice(l,1)},d=>{d.body.rows[s.rowIndex].columns[s.columnIndex].blocks.splice(l,0,a)});c.addStep(u),c.setSelection(null),r(c)}return!0}}function st(o,t,e,n){return(r,s)=>{const i=k(r.doc,o,t);if(!i)return!1;const l=r.doc.body.rows[i.rowIndex].columns[i.columnIndex],a=l.blocks.findIndex(c=>c.id===e);if(a===-1)return!1;if(s){const c=l.blocks[a],u=r.createTransaction(),d=m("updateBlock",`body.rows[${i.rowIndex}].columns[${i.columnIndex}].blocks[${a}]`,p=>{const h=p.body.rows[i.rowIndex].columns[i.columnIndex].blocks[a];Object.assign(h.values,n)},p=>{p.body.rows[i.rowIndex].columns[i.columnIndex].blocks[a]=c});u.addStep(d),s(u)}return!0}}function it(o,t,e,n,r,s){return(i,l)=>{const a=k(i.doc,o,t);if(!a)return!1;const u=i.doc.body.rows[a.rowIndex].columns[a.columnIndex].blocks.findIndex(p=>p.id===e);if(u===-1)return!1;const d=k(i.doc,n,r);if(!d)return!1;if(l){const p=i.createTransaction(),h=m("moveBlock","body.rows",w=>{const[R]=w.body.rows[a.rowIndex].columns[a.columnIndex].blocks.splice(u,1);w.body.rows[d.rowIndex].columns[d.columnIndex].blocks.splice(s,0,R)},w=>{const[R]=w.body.rows[d.rowIndex].columns[d.columnIndex].blocks.splice(s,1);w.body.rows[a.rowIndex].columns[a.columnIndex].blocks.splice(u,0,R)});p.addStep(h),p.setSelection(v(n,r,e)),l(p)}return!0}}function lt(o,t,e){return(n,r)=>{const s=k(n.doc,o,t);if(!s)return!1;const i=n.doc.body.rows[s.rowIndex].columns[s.columnIndex],l=i.blocks.findIndex(a=>a.id===e);if(l===-1)return!1;if(r){const a=i.blocks[l],c=g(),u=structuredClone(a);u.id=c;const d=l+1,p=n.createTransaction(),h=m("duplicateBlock",`body.rows[${s.rowIndex}].columns[${s.columnIndex}].blocks`,w=>{w.body.rows[s.rowIndex].columns[s.columnIndex].blocks.splice(d,0,u)},w=>{w.body.rows[s.rowIndex].columns[s.columnIndex].blocks.splice(d,1)});p.addStep(h),p.setSelection(v(o,t,c)),r(p)}return!0}}function at(o,t){return(e,n)=>{const r=t??e.doc.body.rows.length;if(n){const s=e.createTransaction(),i=m("insertRow","body.rows",l=>{l.body.rows.splice(r,0,o)},l=>{l.body.rows.splice(r,1)});s.addStep(i),s.setSelection(A(o.id)),n(s)}return!0}}function ct(o){return(t,e)=>{const n=t.doc.body.rows.findIndex(r=>r.id===o);if(n===-1)return!1;if(e){const r=structuredClone(t.doc.body.rows[n]),s=t.createTransaction(),i=m("deleteRow","body.rows",l=>{l.body.rows.splice(n,1)},l=>{l.body.rows.splice(n,0,r)});s.addStep(i),s.setSelection(null),e(s)}return!0}}function dt(o,t){return(e,n)=>{const r=e.doc.body.rows.findIndex(s=>s.id===o);if(r===-1||r===t)return!1;if(n){const s=e.createTransaction(),i=m("moveRow","body.rows",l=>{const[a]=l.body.rows.splice(r,1);l.body.rows.splice(t,0,a)},l=>{const[a]=l.body.rows.splice(t,1);l.body.rows.splice(r,0,a)});s.addStep(i),s.setSelection(A(o)),n(s)}return!0}}function ut(o){return(t,e)=>{const n=t.doc.body.rows.findIndex(r=>r.id===o);if(n===-1)return!1;if(e){const r=t.doc.body.rows[n],s=structuredClone(r);s.id=g(),s.columns.forEach(c=>{c.id=g(),c.blocks.forEach(u=>{u.id=g()})});const i=n+1,l=t.createTransaction(),a=m("duplicateRow","body.rows",c=>{c.body.rows.splice(i,0,s)},c=>{c.body.rows.splice(i,1)});l.addStep(a),l.setSelection(A(s.id)),e(l)}return!0}}function ft(o,t){return(e,n)=>{const r=e.doc.body.rows.findIndex(s=>s.id===o);if(r===-1)return!1;if(n){const s={...e.doc.body.rows[r].attributes},i=e.createTransaction(),l=m("updateRowAttributes",`body.rows[${r}].attributes`,a=>{Object.assign(a.body.rows[r].attributes,t)},a=>{a.body.rows[r].attributes=s});i.addStep(l),n(i)}return!0}}function pt(o){return(t,e)=>{const n=t.doc.body.rows.findIndex(s=>s.id===o);if(n===-1)return!1;const r=t.doc.body.rows[n];if(r.locked||r.columns.length>=4)return!1;if(e){const s=T(),i=r.columns.length+1,l=H(i),a=[...r.columnRatios],c=t.createTransaction(),u=m("addColumn",`body.rows[${n}]`,d=>{d.body.rows[n].columns.push(s),d.body.rows[n].columnRatios=l},d=>{d.body.rows[n].columns.pop(),d.body.rows[n].columnRatios=a});c.addStep(u),e(c)}return!0}}function mt(o,t){return(e,n)=>{const r=e.doc.body.rows.findIndex(l=>l.id===o);if(r===-1)return!1;const s=e.doc.body.rows[r];if(s.locked||s.columns.length<=1)return!1;const i=s.columns.findIndex(l=>l.id===t);if(i===-1)return!1;if(n){const l=structuredClone(s.columns[i]),a=[...s.columnRatios],c=s.columns.length-1,u=H(c),d=e.createTransaction(),p=m("removeColumn",`body.rows[${r}]`,h=>{h.body.rows[r].columns.splice(i,1),h.body.rows[r].columnRatios=u},h=>{h.body.rows[r].columns.splice(i,0,l),h.body.rows[r].columnRatios=a});d.addStep(p),n(d)}return!0}}function gt(o,t){return(e,n)=>{const r=e.doc.body.rows.findIndex(l=>l.id===o);if(r===-1)return!1;const s=e.doc.body.rows[r];if(t.length!==s.columns.length||t.reduce((l,a)=>l+a,0)!==12)return!1;if(n){const l=[...s.columnRatios],a=e.createTransaction(),c=m("resizeColumns",`body.rows[${r}].columnRatios`,u=>{u.body.rows[r].columnRatios=t},u=>{u.body.rows[r].columnRatios=l});a.addStep(c),n(a)}return!0}}function H(o){const t=Math.floor(12/o),e=12-t*o,n=new Array(o).fill(t);for(let r=0;r<e;r++)n[r]+=1;return n}const bt=["text","image","button","divider","spacer","social","html","hero","navbar"];function W(o){const t=[];if(!o||typeof o!="object")return t.push({path:"",message:"Document must be an object"}),t;const e=o;if(e.version!=="1.0"&&t.push({path:"version",message:'Version must be "1.0"'}),!e.metadata||typeof e.metadata!="object"?t.push({path:"metadata",message:"Metadata is required"}):typeof e.metadata.name!="string"&&t.push({path:"metadata.name",message:"Name must be a string"}),!e.body||typeof e.body!="object")return t.push({path:"body",message:"Body is required"}),t;const n=e.body;return(!n.attributes||typeof n.attributes!="object")&&t.push({path:"body.attributes",message:"Body attributes are required"}),Array.isArray(n.rows)?(n.rows.forEach((r,s)=>{t.push(...ht(r,`body.rows[${s}]`))}),t):(t.push({path:"body.rows",message:"Rows must be an array"}),t)}function ht(o,t){const e=[];return o.id||e.push({path:`${t}.id`,message:"Row must have an id"}),o.type!=="row"&&e.push({path:`${t}.type`,message:'Row type must be "row"'}),Array.isArray(o.columns)?(Array.isArray(o.columnRatios)?o.columnRatios.length!==o.columns.length&&e.push({path:`${t}.columnRatios`,message:"Column ratios length must match columns length"}):e.push({path:`${t}.columnRatios`,message:"Column ratios must be an array"}),o.columns.forEach((n,r)=>{e.push(...yt(n,`${t}.columns[${r}]`))}),e):(e.push({path:`${t}.columns`,message:"Columns must be an array"}),e)}function yt(o,t){const e=[];return o.id||e.push({path:`${t}.id`,message:"Column must have an id"}),Array.isArray(o.blocks)?(o.blocks.forEach((n,r)=>{e.push(...wt(n,`${t}.blocks[${r}]`))}),e):(e.push({path:`${t}.blocks`,message:"Blocks must be an array"}),e)}function wt(o,t){const e=[];return o.id||e.push({path:`${t}.id`,message:"Block must have an id"}),bt.includes(o.type)||e.push({path:`${t}.type`,message:`Invalid block type: ${o.type}`}),(!o.values||typeof o.values!="object")&&e.push({path:`${t}.values`,message:"Block must have values"}),e}function kt(o){return W(o).length===0}const x=new Map,xt=[{type:"text",label:"Text",icon:"text",defaultValues:y("text")},{type:"image",label:"Image",icon:"image",defaultValues:y("image")},{type:"button",label:"Button",icon:"button",defaultValues:y("button")},{type:"divider",label:"Divider",icon:"divider",defaultValues:y("divider")},{type:"spacer",label:"Spacer",icon:"spacer",defaultValues:y("spacer")},{type:"social",label:"Social",icon:"social",defaultValues:y("social")},{type:"html",label:"HTML",icon:"html",defaultValues:y("html")},{type:"hero",label:"Hero",icon:"hero",defaultValues:y("hero")},{type:"navbar",label:"Navbar",icon:"navbar",defaultValues:y("navbar")}];function It(){for(const o of xt)x.set(o.type,o);Z(o=>{var t;return(t=x.get(o))==null?void 0:t.defaultValues})}function D(o){x.set(o.type,o)}function St(o){return x.get(o)}function vt(){return Array.from(x.values())}function At(o){return x.has(o)}It();const Ct=100;function Rt(){return{undoStack:[],redoStack:[]}}function _t(o,t){const e=[...o.undoStack,t];return e.length>Ct&&e.shift(),{undoStack:e,redoStack:[]}}function Tt(o){if(o.undoStack.length===0)return{history:o,entry:null};const t=[...o.undoStack],e=t.pop(),n=[...o.redoStack,e];return{history:{undoStack:t,redoStack:n},entry:e}}function Bt(o){if(o.redoStack.length===0)return{history:o,entry:null};const t=[...o.redoStack],e=t.pop();return{history:{undoStack:[...o.undoStack,e],redoStack:t},entry:e}}function P(o){return o.undoStack.length>0}function V(o){return o.redoStack.length>0}const C="history";function Mt(){return{name:C,init(){return Rt()},apply(o,t){const e=t;if(o.meta.get("isUndo")||o.meta.get("isRedo"))return o.meta.get("newHistory")??e;if(o.steps.length===0||o.meta.get("skipHistory"))return e;const n={steps:[...o.steps],doc:o.doc,timestamp:Date.now()};return _t(e,n)}}}function $t(o,t){const e=o.plugins.get(C);if(!e||!P(e))return!1;if(t){const{history:n,entry:r}=Tt(e);if(!r)return!1;const s=o.createTransaction();for(let i=r.steps.length-1;i>=0;i--){const l=r.steps[i].invert(s.doc);s.addStep(l)}s.setMeta("isUndo",!0),s.setMeta("newHistory",n),s.setMeta("skipTimestamp",!0),t(s)}return!0}function Et(o,t){const e=o.plugins.get(C);if(!e||!V(e))return!1;if(t){const{history:n,entry:r}=Bt(e);if(!r)return!1;const s=o.createTransaction();for(const i of r.steps)s.addStep(i);s.setMeta("isRedo",!0),s.setMeta("newHistory",n),s.setMeta("skipTimestamp",!0),t(s)}return!0}class Ht{constructor(){this._plugins=new Map}register(t){if(this._plugins.has(t.name))throw new Error(`Plugin "${t.name}" is already registered`);if(this._plugins.set(t.name,t),t.blocks)for(const e of t.blocks)D(e)}unregister(t){this._plugins.delete(t)}get(t){return this._plugins.get(t)}getAll(){return Array.from(this._plugins.values())}getCommands(){const t={};for(const e of this._plugins.values())e.commands&&Object.assign(t,e.commands);return t}has(t){return this._plugins.has(t)}}function _(o,t){if(o===t)return!0;if(o==null||t==null||typeof o!=typeof t)return!1;if(Array.isArray(o))return!Array.isArray(t)||o.length!==t.length?!1:o.every((e,n)=>_(e,t[n]));if(typeof o=="object"){const e=Object.keys(o),n=Object.keys(t);return e.length!==n.length?!1:e.every(r=>_(o[r],t[r]))}return!1}const f="2026-05-26T10:00:00.000Z",Wt={id:"starter-welcome",name:"Welcome",description:"A clean welcome email with a hero, intro paragraph, and call-to-action.",category:"welcome",createdAt:f,updatedAt:f,document:{version:"1.0",metadata:{name:"Welcome",previewText:"We're glad you're here.",createdAt:f,updatedAt:f},body:{attributes:{width:600,backgroundColor:"#f5f7fb",fontFamily:"Inter, sans-serif",contentAlignment:"center"},rows:[{id:"r-hero",type:"row",locked:!1,attributes:{padding:{top:0,right:0,bottom:0,left:0},fullWidth:!0},columnRatios:[12],columns:[{id:"c-hero",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-hero",type:"hero",values:{backgroundUrl:"https://placehold.co/600x280/0f172a/ffffff?text=Welcome",backgroundPosition:"center center",mode:"fixed-height",width:600,height:280,verticalAlign:"middle",padding:{top:0,right:0,bottom:0,left:0},innerPadding:{top:40,right:40,bottom:40,left:40},backgroundColor:"#0f172a",content:'<h1 style="color:#ffffff;font-size:32px;margin:0;">Welcome, {{firstName}}</h1>'}}]}]},{id:"r-intro",type:"row",locked:!1,attributes:{backgroundColor:"#ffffff",padding:{top:32,right:24,bottom:8,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-intro",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-intro",type:"text",values:{content:"<p>Thanks for joining — we've put together a quick guide to help you get the most out of your account.</p>",padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.6",textAlign:"left"}}]}]},{id:"r-cta",type:"row",locked:!1,attributes:{backgroundColor:"#ffffff",padding:{top:16,right:24,bottom:32,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-cta",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-cta",type:"button",values:{content:"<p>Get started</p>",href:"https://example.com/start",backgroundColor:"#3b82f6",textColor:"#ffffff",borderRadius:6,padding:{top:8,right:8,bottom:8,left:8},innerPadding:{top:12,right:24,bottom:12,left:24},fontSize:16,fontWeight:"600",alignment:"center",fullWidth:!1}}]}]}]}}},Dt={id:"starter-newsletter",name:"Newsletter",description:"A simple 3-section newsletter — headline + body + footer.",category:"newsletter",createdAt:f,updatedAt:f,document:{version:"1.0",metadata:{name:"Newsletter",previewText:"This month's updates",createdAt:f,updatedAt:f},body:{attributes:{width:600,backgroundColor:"#ffffff",fontFamily:"Inter, sans-serif",contentAlignment:"center"},rows:[{id:"r-head",type:"row",locked:!1,attributes:{padding:{top:24,right:24,bottom:8,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-head",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-head",type:"text",values:{content:'<h1 style="font-size:24px;margin:0;">This month at Acme</h1>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.3",textAlign:"left"}}]}]},{id:"r-body",type:"row",locked:!1,attributes:{padding:{top:8,right:24,bottom:24,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-body",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-body",type:"text",values:{content:"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sodales, mauris vel rhoncus sodales, eros lectus rutrum lectus.</p><p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>",padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.6",textAlign:"left"}}]}]},{id:"r-foot",type:"row",locked:!1,attributes:{backgroundColor:"#f5f7fb",padding:{top:16,right:24,bottom:16,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-foot",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-foot",type:"text",values:{content:'<p style="color:#64748b;font-size:12px;">© Acme · <a href="https://example.com/unsubscribe">Unsubscribe</a></p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"center"}}]}]}]}}},Pt={id:"starter-transactional",name:"Transactional (order confirmation)",description:"Order confirmation pattern with summary and a primary button.",category:"transactional",createdAt:f,updatedAt:f,document:{version:"1.0",metadata:{name:"Order confirmation",previewText:"Order {{orderNumber}} is on its way.",createdAt:f,updatedAt:f},body:{attributes:{width:600,backgroundColor:"#ffffff",fontFamily:"Inter, sans-serif",contentAlignment:"center"},rows:[{id:"r-h",type:"row",locked:!1,attributes:{padding:{top:32,right:24,bottom:8,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-h",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-h",type:"text",values:{content:'<h1 style="font-size:24px;margin:0 0 8px;">Thanks for your order, {{firstName}}</h1><p style="margin:0;">Order <strong>{{orderNumber}}</strong> is on its way.</p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"left"}}]}]},{id:"r-summary",type:"row",locked:!1,attributes:{backgroundColor:"#f8fafc",padding:{top:16,right:24,bottom:16,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-summary",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-summary",type:"text",values:{content:'<p style="margin:0 0 8px;"><strong>Summary</strong></p><p style="margin:0;">{{itemCount}} item(s) · {{total}}</p><p style="margin:8px 0 0;color:#64748b;font-size:12px;">Estimated delivery: {{deliveryDate}}</p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"left"}}]}]},{id:"r-cta",type:"row",locked:!1,attributes:{padding:{top:24,right:24,bottom:24,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-cta",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-cta",type:"button",values:{content:"<p>View order</p>",href:"https://example.com/orders/{{orderNumber}}",backgroundColor:"#0f172a",textColor:"#ffffff",borderRadius:6,padding:{top:0,right:0,bottom:0,left:0},innerPadding:{top:12,right:24,bottom:12,left:24},fontSize:16,fontWeight:"600",alignment:"left",fullWidth:!1}}]}]}]}}},Vt={id:"starter-promo",name:"Promo / Sale",description:"Two-column product grid with a primary CTA and a social-link footer.",category:"promo",createdAt:f,updatedAt:f,document:{version:"1.0",metadata:{name:"Spring sale",previewText:"Two days only — 30% off.",createdAt:f,updatedAt:f},body:{attributes:{width:600,backgroundColor:"#fdf6ee",fontFamily:"Inter, sans-serif",contentAlignment:"center"},rows:[{id:"r-hero",type:"row",locked:!1,attributes:{padding:{top:0,right:0,bottom:0,left:0},fullWidth:!0},columnRatios:[12],columns:[{id:"c-hero",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"middle"},blocks:[{id:"b-hero",type:"hero",values:{backgroundUrl:"https://placehold.co/600x240/e76f51/ffffff?text=30%25+off",backgroundPosition:"center center",mode:"fluid-height",width:600,height:240,verticalAlign:"middle",padding:{top:0,right:0,bottom:0,left:0},innerPadding:{top:32,right:32,bottom:32,left:32},backgroundColor:"#e76f51",content:'<h1 style="color:#ffffff;font-size:36px;margin:0 0 8px;">30% off, this weekend only</h1><p style="color:#ffffff;font-size:16px;margin:0;">Code <strong>SPRING30</strong> at checkout.</p>'}}]}]},{id:"r-grid",type:"row",locked:!1,attributes:{backgroundColor:"#ffffff",padding:{top:24,right:16,bottom:24,left:16},fullWidth:!1},columnRatios:[6,6],columns:[{id:"c-l",type:"column",attributes:{padding:{top:0,right:8,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-l-img",type:"image",values:{src:"https://placehold.co/280x200",alt:"Linen shirt",width:"auto",href:"https://example.com/p/shirt",padding:{top:0,right:0,bottom:8,left:0},alignment:"center",borderRadius:6}},{id:"b-l-txt",type:"text",values:{content:'<p style="text-align:center;margin:0;"><strong>Linen shirt</strong><br><span style="color:#64748b;">$48 · was $69</span></p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"center"}}]},{id:"c-r",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:8},verticalAlign:"top"},blocks:[{id:"b-r-img",type:"image",values:{src:"https://placehold.co/280x200",alt:"Wool jumper",width:"auto",href:"https://example.com/p/jumper",padding:{top:0,right:0,bottom:8,left:0},alignment:"center",borderRadius:6}},{id:"b-r-txt",type:"text",values:{content:'<p style="text-align:center;margin:0;"><strong>Wool jumper</strong><br><span style="color:#64748b;">$84 · was $120</span></p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"center"}}]}]},{id:"r-cta",type:"row",locked:!1,attributes:{backgroundColor:"#ffffff",padding:{top:8,right:16,bottom:24,left:16},fullWidth:!1},columnRatios:[12],columns:[{id:"c-cta",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-cta",type:"button",values:{content:"<p>Shop the sale</p>",href:"https://example.com/sale",backgroundColor:"#0f172a",textColor:"#ffffff",borderRadius:6,padding:{top:8,right:0,bottom:8,left:0},innerPadding:{top:14,right:28,bottom:14,left:28},fontSize:16,fontWeight:"600",alignment:"center",fullWidth:!0}}]}]}]}}},L=Object.freeze([Wt,Dt,Pt,Vt]);function O(){return L.map(o=>structuredClone(o))}function Lt(o){const t=L.find(e=>e.id===o);return t?structuredClone(t):null}class Ot{constructor(t={}){if(this._byId=new Map,t.includeStarters!==!1)for(const e of O())this._byId.set(e.id,e);if(t.seed)for(const e of t.seed)this._byId.set(e.id,e)}async list(){return Array.from(this._byId.values()).map(t=>structuredClone(t))}async get(t){const e=this._byId.get(t);return e?structuredClone(e):null}async save(t){if(!t.id)throw new Error("Template.id is required");const e=structuredClone(t);e.updatedAt=new Date().toISOString(),this._byId.has(e.id)||(e.createdAt=e.updatedAt),this._byId.set(e.id,e)}async delete(t){this._byId.delete(t)}}class Nt{constructor(t={}){if(this._byId=new Map,t.seed)for(const e of t.seed)this._byId.set(e.id,e)}async list(){return Array.from(this._byId.values()).map(t=>structuredClone(t))}async get(t){const e=this._byId.get(t);return e?structuredClone(e):null}async save(t){if(!t.id)throw new Error("BrandKit.id is required");const e=structuredClone(t);e.updatedAt=new Date().toISOString(),this._byId.has(e.id)||(e.createdAt=e.updatedAt),this._byId.set(e.id,e)}async delete(t){this._byId.delete(t)}}class jt{constructor(t={}){if(this._byId=new Map,t.seed)for(const e of t.seed)this._byId.set(e.id,e)}async list(t={}){let n=Array.from(this._byId.values()).map(i=>structuredClone(i)).filter(i=>zt(i,t));n.sort((i,l)=>i.updatedAt<l.updatedAt?1:i.updatedAt>l.updatedAt?-1:0);const r=t.offset??0,s=t.limit;return n=n.slice(r,s!==void 0?r+s:void 0),n}async get(t){const e=this._byId.get(t);return e?structuredClone(e):null}async save(t){if(!t.id)throw new Error("Asset.id is required");if(!t.src)throw new Error("Asset.src is required");const e=structuredClone(t);e.updatedAt=new Date().toISOString(),this._byId.has(e.id)||(e.createdAt=e.updatedAt),e.folder||(e.folder="/"),this._byId.set(e.id,e)}async delete(t){this._byId.delete(t)}async listFolders(){const t=new Set;for(const e of this._byId.values())t.add(e.folder||"/");return Array.from(t).sort()}}function zt(o,t){if(t.folder&&(o.folder||"/")!==t.folder)return!1;if(t.tags&&t.tags.length>0){const e=new Set(o.tags??[]);if(!t.tags.every(n=>e.has(n)))return!1}if(t.search){const e=t.search.toLowerCase();if(![o.name,o.alt??"",...o.tags??[]].join(" ").toLowerCase().includes(e))return!1}return!0}class qt{constructor(t={}){if(this._byId=new Map,t.seed)for(const e of t.seed)this._byId.set(e.id,e)}async list(){return Array.from(this._byId.values()).map(t=>structuredClone(t))}async get(t){const e=this._byId.get(t);return e?structuredClone(e):null}async save(t){if(!t.id)throw new Error("LibraryEntry.id is required");const e=structuredClone(t);e.updatedAt=new Date().toISOString(),this._byId.has(e.id)||(e.createdAt=e.updatedAt),this._byId.set(e.id,e)}async delete(t){this._byId.delete(t)}}function Ut(o){const t=structuredClone(o);return t.id=g(),t.columns.forEach(e=>{e.id=g(),e.blocks.forEach(n=>{n.id=g()})}),t}const Ft=[{id:"unsubscribe",label:"Unsubscribe",href:"{{unsubscribe_url}}"},{id:"view-in-browser",label:"View in browser",href:"{{view_in_browser_url}}"},{id:"email",label:"Email address",prompt:"email"},{id:"phone",label:"Phone number",prompt:"tel"}];exports.EditorState=S;exports.HISTORY_PLUGIN_NAME=C;exports.InMemoryAssetStorage=jt;exports.InMemoryBrandKitStorage=Nt;exports.InMemoryRowLibraryStorage=qt;exports.InMemoryTemplateStorage=Ot;exports.PluginRegistry=Ht;exports.SYSTEM_LINK_TYPES=Ft;exports.Transaction=M;exports.addColumn=pt;exports.canRedo=V;exports.canUndo=P;exports.cloneRowWithNewIds=Ut;exports.createBlock=J;exports.createBlockSelection=v;exports.createBodySelection=et;exports.createColumn=T;exports.createColumnSelection=tt;exports.createDefaultDocument=E;exports.createDocStep=m;exports.createHistoryPlugin=Mt;exports.createRow=Q;exports.createRowSelection=A;exports.deepEqual=_;exports.defaultSpacing=b;exports.deleteBlock=rt;exports.deleteRow=ct;exports.duplicateBlock=lt;exports.duplicateRow=ut;exports.generateId=g;exports.getAllBlockDefinitions=vt;exports.getBlockDefinition=St;exports.getDefaultValues=y;exports.getStarterTemplate=Lt;exports.getStarterTemplates=O;exports.insertBlock=nt;exports.insertRow=at;exports.isKnownBlockType=At;exports.isValidDocument=kt;exports.moveBlock=it;exports.moveRow=dt;exports.redo=Et;exports.registerBlock=D;exports.removeColumn=mt;exports.resizeColumns=gt;exports.selectionsEqual=ot;exports.undo=$t;exports.updateBlock=st;exports.updateRowAttributes=ft;exports.validateDocument=W;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("immer"),X=require("nanoid");class L{constructor(t){this._steps=[],this._selection=null,this._selectionSet=!1,this._meta=new Map,this._doc=t}get steps(){return this._steps}get selection(){return this._selection}get selectionSet(){return this._selectionSet}get meta(){return this._meta}get doc(){return this._doc}addStep(t){return this._doc=t.apply(this._doc),this._steps.push(t),this}setSelection(t){return this._selection=t,this._selectionSet=!0,this}setMeta(t,e){return this._meta.set(t,e),this}getMeta(t){return this._meta.get(t)}}function p(o,t,e,n){return{type:o,path:t,apply(r){return M.produce(r,e)},invert(r){return p(`${o}:invert`,t,n,e)}}}function g(){return X.nanoid(10)}function b(o=0){return{top:o,right:o,bottom:o,left:o}}function Z(){return{content:"<p>Enter your text here</p>",padding:b(10),lineHeight:"1.5",textAlign:"left"}}function J(){return{src:"",alt:"",width:"auto",padding:b(10),alignment:"center"}}function Q(){return{content:"<p>Click me</p>",href:"#",backgroundColor:"#3b82f6",textColor:"#ffffff",borderRadius:4,padding:b(10),innerPadding:{top:12,right:24,bottom:12,left:24},fontSize:16,fontWeight:"600",alignment:"center",fullWidth:!1}}function tt(){return{borderColor:"#e2e8f0",borderWidth:1,borderStyle:"solid",padding:b(10),width:"100%"}}function et(){return{height:20}}function ot(){return{icons:[],iconSize:32,spacing:8,alignment:"center",padding:b(10)}}function nt(){return{content:"",padding:b(0)}}function rt(){return{backgroundUrl:"",backgroundPosition:"center center",mode:"fluid-height",width:600,height:400,verticalAlign:"middle",padding:b(0),innerPadding:b(20),backgroundColor:"#ffffff",content:'<p style="color:#ffffff;font-size:24px;">Hero Title</p>'}}function st(){return{links:[{href:"#",text:"Home"},{href:"#",text:"About"},{href:"#",text:"Contact"}],hamburger:"hamburger",alignment:"center",padding:b(10),linkColor:"#000000",linkFontSize:14,linkPadding:"10px 15px"}}const P={text:Z,image:J,button:Q,divider:tt,spacer:et,social:ot,html:nt,hero:rt,navbar:st};function h(o){const t=P[o];if(!t)throw new Error(`Unknown block type: ${o}`);return t()}let S=null;function it(o){S=o}function lt(o,t){const e=P[o];if(e)return{id:g(),type:o,values:{...e(),...t}};const n=S==null?void 0:S(o);if(n)return{id:g(),type:o,values:{...structuredClone(n),...t}};throw new Error(`Unknown block type: ${o}`)}function $(o=[]){return{id:g(),type:"column",attributes:{padding:b(0),verticalAlign:"top"},blocks:o}}function at(o,t){const e=o??[$()],n=t??e.map(()=>Math.floor(12/e.length));return{id:g(),type:"row",attributes:{padding:b(0),fullWidth:!1},columns:e,columnRatios:n,locked:!1}}function D(o="Untitled"){const t=new Date().toISOString();return{version:"1.0",metadata:{name:o,createdAt:t,updatedAt:t},body:{attributes:{width:600,backgroundColor:"#f4f4f5",fontFamily:"Arial, Helvetica, sans-serif",contentAlignment:"center"},rows:[]}}}class v{constructor(t,e,n,r){this.doc=t,this.selection=e,this.plugins=n,this._pluginList=r}static create(t={}){const e=t.doc??D(),n=t.plugins??[],r=new Map,s=new v(e,null,r,n);for(const i of n)i.init&&r.set(i.name,i.init(s));return s}createTransaction(){return new L(this.doc)}apply(t){let e=t.doc;const n=t.selectionSet?t.selection:this.selection,r=new Map(this.plugins);for(const i of this._pluginList)if(i.apply){const l=r.get(i.name);r.set(i.name,i.apply(t,l))}t.steps.length>0&&!t.getMeta("skipTimestamp")&&(e=M.produce(e,i=>{i.metadata.updatedAt=new Date().toISOString()}));const s=new v(e,n,r,this._pluginList);for(const i of this._pluginList)i.onStateChange&&i.onStateChange(s,this);return s}getPluginState(t){return this.plugins.get(t)}}function A(o,t,e){return{type:"block",rowId:o,columnId:t,blockId:e}}function _(o){return{type:"row",rowId:o}}function ct(o,t){return{type:"column",rowId:o,columnId:t}}function dt(){return{type:"body"}}function ut(o,t){return o===t?!0:!o||!t?!1:o.type===t.type&&o.rowId===t.rowId&&o.columnId===t.columnId&&o.blockId===t.blockId}const k=new Map,ft=[{type:"text",label:"Text",icon:"text",defaultValues:h("text")},{type:"image",label:"Image",icon:"image",defaultValues:h("image")},{type:"button",label:"Button",icon:"button",defaultValues:h("button")},{type:"divider",label:"Divider",icon:"divider",defaultValues:h("divider")},{type:"spacer",label:"Spacer",icon:"spacer",defaultValues:h("spacer")},{type:"social",label:"Social",icon:"social",defaultValues:h("social")},{type:"html",label:"HTML",icon:"html",defaultValues:h("html")},{type:"hero",label:"Hero",icon:"hero",defaultValues:h("hero")},{type:"navbar",label:"Navbar",icon:"navbar",defaultValues:h("navbar")}];function pt(){for(const o of ft)k.set(o.type,o);it(o=>{var t;return(t=k.get(o))==null?void 0:t.defaultValues})}function H(o){k.set(o.type,o)}function mt(o){return k.get(o)}function W(){return Array.from(k.values())}let I;function gt(o){I=o?[...o]:void 0}function N(o){return I?I.includes(o):!0}function bt(){return I?I.map(o=>k.get(o)).filter(o=>o!==void 0):W()}function yt(o){return k.has(o)}pt();function x(o,t,e){const n=o.body.rows.findIndex(s=>s.id===t);if(n===-1||o.body.rows[n].locked)return null;const r=o.body.rows[n].columns.findIndex(s=>s.id===e);return r===-1?null:{rowIndex:n,columnIndex:r}}function ht(o,t,e,n){return(r,s)=>{if(!N(e.type))return!1;const i=x(r.doc,o,t);if(!i)return!1;const l=r.doc.body.rows[i.rowIndex].columns[i.columnIndex],a=n??l.blocks.length;if(s){const c=r.createTransaction(),u=p("insertBlock",`body.rows[${i.rowIndex}].columns[${i.columnIndex}].blocks`,d=>{d.body.rows[i.rowIndex].columns[i.columnIndex].blocks.splice(a,0,e)},d=>{d.body.rows[i.rowIndex].columns[i.columnIndex].blocks.splice(a,1)});c.addStep(u),c.setSelection(A(o,t,e.id)),s(c)}return!0}}function wt(o,t,e){return(n,r)=>{const s=x(n.doc,o,t);if(!s)return!1;const i=n.doc.body.rows[s.rowIndex].columns[s.columnIndex],l=i.blocks.findIndex(a=>a.id===e);if(l===-1)return!1;if(r){const a=i.blocks[l],c=n.createTransaction(),u=p("deleteBlock",`body.rows[${s.rowIndex}].columns[${s.columnIndex}].blocks`,d=>{d.body.rows[s.rowIndex].columns[s.columnIndex].blocks.splice(l,1)},d=>{d.body.rows[s.rowIndex].columns[s.columnIndex].blocks.splice(l,0,a)});c.addStep(u),c.setSelection(null),r(c)}return!0}}function kt(o,t,e,n){return(r,s)=>{const i=x(r.doc,o,t);if(!i)return!1;const l=r.doc.body.rows[i.rowIndex].columns[i.columnIndex],a=l.blocks.findIndex(c=>c.id===e);if(a===-1)return!1;if(s){const c=l.blocks[a],u=r.createTransaction(),d=p("updateBlock",`body.rows[${i.rowIndex}].columns[${i.columnIndex}].blocks[${a}]`,m=>{const y=m.body.rows[i.rowIndex].columns[i.columnIndex].blocks[a];Object.assign(y.values,n)},m=>{m.body.rows[i.rowIndex].columns[i.columnIndex].blocks[a]=c});u.addStep(d),s(u)}return!0}}function xt(o,t,e,n,r,s){return(i,l)=>{const a=x(i.doc,o,t);if(!a)return!1;const u=i.doc.body.rows[a.rowIndex].columns[a.columnIndex].blocks.findIndex(m=>m.id===e);if(u===-1)return!1;const d=x(i.doc,n,r);if(!d)return!1;if(l){const m=i.createTransaction(),y=p("moveBlock","body.rows",w=>{const[R]=w.body.rows[a.rowIndex].columns[a.columnIndex].blocks.splice(u,1);w.body.rows[d.rowIndex].columns[d.columnIndex].blocks.splice(s,0,R)},w=>{const[R]=w.body.rows[d.rowIndex].columns[d.columnIndex].blocks.splice(s,1);w.body.rows[a.rowIndex].columns[a.columnIndex].blocks.splice(u,0,R)});m.addStep(y),m.setSelection(A(n,r,e)),l(m)}return!0}}function It(o,t,e){return(n,r)=>{const s=x(n.doc,o,t);if(!s)return!1;const i=n.doc.body.rows[s.rowIndex].columns[s.columnIndex],l=i.blocks.findIndex(a=>a.id===e);if(l===-1)return!1;if(r){const a=i.blocks[l],c=g(),u=structuredClone(a);u.id=c;const d=l+1,m=n.createTransaction(),y=p("duplicateBlock",`body.rows[${s.rowIndex}].columns[${s.columnIndex}].blocks`,w=>{w.body.rows[s.rowIndex].columns[s.columnIndex].blocks.splice(d,0,u)},w=>{w.body.rows[s.rowIndex].columns[s.columnIndex].blocks.splice(d,1)});m.addStep(y),m.setSelection(A(o,t,c)),r(m)}return!0}}function St(o,t){return(e,n)=>{const r=t??e.doc.body.rows.length;if(n){const s=e.createTransaction(),i=p("insertRow","body.rows",l=>{l.body.rows.splice(r,0,o)},l=>{l.body.rows.splice(r,1)});s.addStep(i),s.setSelection(_(o.id)),n(s)}return!0}}function vt(o){return(t,e)=>{const n=t.doc.body.rows.findIndex(r=>r.id===o);if(n===-1||t.doc.body.rows[n].locked)return!1;if(e){const r=structuredClone(t.doc.body.rows[n]),s=t.createTransaction(),i=p("deleteRow","body.rows",l=>{l.body.rows.splice(n,1)},l=>{l.body.rows.splice(n,0,r)});s.addStep(i),s.setSelection(null),e(s)}return!0}}function At(o,t){return(e,n)=>{const r=e.doc.body.rows.findIndex(s=>s.id===o);if(r===-1||e.doc.body.rows[r].locked||r===t)return!1;if(n){const s=e.createTransaction(),i=p("moveRow","body.rows",l=>{const[a]=l.body.rows.splice(r,1);l.body.rows.splice(t,0,a)},l=>{const[a]=l.body.rows.splice(t,1);l.body.rows.splice(r,0,a)});s.addStep(i),s.setSelection(_(o)),n(s)}return!0}}function _t(o){return(t,e)=>{const n=t.doc.body.rows.findIndex(r=>r.id===o);if(n===-1||t.doc.body.rows[n].locked)return!1;if(e){const r=t.doc.body.rows[n],s=structuredClone(r);s.id=g(),s.columns.forEach(c=>{c.id=g(),c.blocks.forEach(u=>{u.id=g()})});const i=n+1,l=t.createTransaction(),a=p("duplicateRow","body.rows",c=>{c.body.rows.splice(i,0,s)},c=>{c.body.rows.splice(i,1)});l.addStep(a),l.setSelection(_(s.id)),e(l)}return!0}}function Ct(o,t){return(e,n)=>{const r=e.doc.body.rows.findIndex(s=>s.id===o);if(r===-1||e.doc.body.rows[r].locked)return!1;if(n){const s={...e.doc.body.rows[r].attributes},i=e.createTransaction(),l=p("updateRowAttributes",`body.rows[${r}].attributes`,a=>{Object.assign(a.body.rows[r].attributes,t)},a=>{a.body.rows[r].attributes=s});i.addStep(l),n(i)}return!0}}function Rt(o){return(t,e)=>{const n=t.doc.body.rows.findIndex(s=>s.id===o);if(n===-1)return!1;const r=t.doc.body.rows[n];if(r.locked||r.columns.length>=4)return!1;if(e){const s=$(),i=r.columns.length+1,l=V(i),a=[...r.columnRatios],c=t.createTransaction(),u=p("addColumn",`body.rows[${n}]`,d=>{d.body.rows[n].columns.push(s),d.body.rows[n].columnRatios=l},d=>{d.body.rows[n].columns.pop(),d.body.rows[n].columnRatios=a});c.addStep(u),e(c)}return!0}}function Tt(o,t){return(e,n)=>{const r=e.doc.body.rows.findIndex(l=>l.id===o);if(r===-1)return!1;const s=e.doc.body.rows[r];if(s.locked||s.columns.length<=1)return!1;const i=s.columns.findIndex(l=>l.id===t);if(i===-1)return!1;if(n){const l=structuredClone(s.columns[i]),a=[...s.columnRatios],c=s.columns.length-1,u=V(c),d=e.createTransaction(),m=p("removeColumn",`body.rows[${r}]`,y=>{y.body.rows[r].columns.splice(i,1),y.body.rows[r].columnRatios=u},y=>{y.body.rows[r].columns.splice(i,0,l),y.body.rows[r].columnRatios=a});d.addStep(m),n(d)}return!0}}function Bt(o,t){return(e,n)=>{const r=e.doc.body.rows.findIndex(l=>l.id===o);if(r===-1)return!1;const s=e.doc.body.rows[r];if(s.locked||t.length!==s.columns.length||t.reduce((l,a)=>l+a,0)!==12)return!1;if(n){const l=[...s.columnRatios],a=e.createTransaction(),c=p("resizeColumns",`body.rows[${r}].columnRatios`,u=>{u.body.rows[r].columnRatios=t},u=>{u.body.rows[r].columnRatios=l});a.addStep(c),n(a)}return!0}}function $t(o,t,e){return(n,r)=>{const s=n.doc.body.rows.findIndex(a=>a.id===o);if(s===-1)return!1;const i=n.doc.body.rows[s];if(i.locked)return!1;const l=i.columns.findIndex(a=>a.id===t);if(l===-1)return!1;if(r){const a={...i.columns[l].attributes},c=n.createTransaction(),u=p("updateColumnAttributes",`body.rows[${s}].columns[${l}].attributes`,d=>{Object.assign(d.body.rows[s].columns[l].attributes,e)},d=>{d.body.rows[s].columns[l].attributes=a});c.addStep(u),r(c)}return!0}}function V(o){const t=Math.floor(12/o),e=12-t*o,n=new Array(o).fill(t);for(let r=0;r<e;r++)n[r]+=1;return n}const Et=["text","image","button","divider","spacer","social","html","hero","navbar"];function O(o){const t=[];if(!o||typeof o!="object")return t.push({path:"",message:"Document must be an object"}),t;const e=o;if(e.version!=="1.0"&&t.push({path:"version",message:'Version must be "1.0"'}),!e.metadata||typeof e.metadata!="object"?t.push({path:"metadata",message:"Metadata is required"}):typeof e.metadata.name!="string"&&t.push({path:"metadata.name",message:"Name must be a string"}),!e.body||typeof e.body!="object")return t.push({path:"body",message:"Body is required"}),t;const n=e.body;return(!n.attributes||typeof n.attributes!="object")&&t.push({path:"body.attributes",message:"Body attributes are required"}),Array.isArray(n.rows)?(n.rows.forEach((r,s)=>{t.push(...Mt(r,`body.rows[${s}]`))}),t):(t.push({path:"body.rows",message:"Rows must be an array"}),t)}function Mt(o,t){const e=[];return o.id||e.push({path:`${t}.id`,message:"Row must have an id"}),o.type!=="row"&&e.push({path:`${t}.type`,message:'Row type must be "row"'}),Array.isArray(o.columns)?(Array.isArray(o.columnRatios)?o.columnRatios.length!==o.columns.length&&e.push({path:`${t}.columnRatios`,message:"Column ratios length must match columns length"}):e.push({path:`${t}.columnRatios`,message:"Column ratios must be an array"}),o.columns.forEach((n,r)=>{e.push(...Lt(n,`${t}.columns[${r}]`))}),e):(e.push({path:`${t}.columns`,message:"Columns must be an array"}),e)}function Lt(o,t){const e=[];return o.id||e.push({path:`${t}.id`,message:"Column must have an id"}),Array.isArray(o.blocks)?(o.blocks.forEach((n,r)=>{e.push(...Pt(n,`${t}.blocks[${r}]`))}),e):(e.push({path:`${t}.blocks`,message:"Blocks must be an array"}),e)}function Pt(o,t){const e=[];return o.id||e.push({path:`${t}.id`,message:"Block must have an id"}),Et.includes(o.type)||e.push({path:`${t}.type`,message:`Invalid block type: ${o.type}`}),(!o.values||typeof o.values!="object")&&e.push({path:`${t}.values`,message:"Block must have values"}),e}function Dt(o){return O(o).length===0}const Ht="/* pigeon-generated:";function j(o){return`${Ht} ${o} */`}function z(o){var t;return(t=/^\s*\/\*\s*pigeon-generated:\s*([\w-]+)\s*\*\//.exec(o))==null?void 0:t[1]}const E="link-style",q="a, a:visited";function Wt(o){const t=[o.color!==void 0&&`color: ${o.color};`,o.underline!==void 0&&`text-decoration: ${o.underline?"underline":"none"};`].filter(Boolean);if(t.length)return`${j(E)}
2
+ ${q} { ${t.join(" ")} }
3
+ a[x-apple-data-detectors] { color: inherit !important; text-decoration: inherit !important; }`}function Nt(o){var s,i,l;if(z(o)!==E)return;const t=((s=new RegExp(`${q}\\s*\\{([^}]*)\\}`).exec(o))==null?void 0:s[1])??"",e=(i=/(?:^|;|\s)color:\s*([^;]+)/.exec(t))==null?void 0:i[1].trim(),n=(l=/text-decoration:\s*([^;]+)/.exec(t))==null?void 0:l[1].trim(),r={...e!==void 0?{color:e}:{},...n!==void 0?{underline:n==="underline"}:{}};return Object.keys(r).length?r:void 0}const Vt=100;function Ot(){return{undoStack:[],redoStack:[]}}function jt(o,t){const e=[...o.undoStack,t];return e.length>Vt&&e.shift(),{undoStack:e,redoStack:[]}}function zt(o){if(o.undoStack.length===0)return{history:o,entry:null};const t=[...o.undoStack],e=t.pop(),n=[...o.redoStack,e];return{history:{undoStack:t,redoStack:n},entry:e}}function qt(o){if(o.redoStack.length===0)return{history:o,entry:null};const t=[...o.redoStack],e=t.pop();return{history:{undoStack:[...o.undoStack,e],redoStack:t},entry:e}}function U(o){return o.undoStack.length>0}function G(o){return o.redoStack.length>0}const C="history";function Ut(){return{name:C,init(){return Ot()},apply(o,t){const e=t;if(o.meta.get("isUndo")||o.meta.get("isRedo"))return o.meta.get("newHistory")??e;if(o.steps.length===0||o.meta.get("skipHistory"))return e;const n={steps:[...o.steps],doc:o.doc,timestamp:Date.now()};return jt(e,n)}}}function Gt(o,t){const e=o.plugins.get(C);if(!e||!U(e))return!1;if(t){const{history:n,entry:r}=zt(e);if(!r)return!1;const s=o.createTransaction();for(let i=r.steps.length-1;i>=0;i--){const l=r.steps[i].invert(s.doc);s.addStep(l)}s.setMeta("isUndo",!0),s.setMeta("newHistory",n),s.setMeta("skipTimestamp",!0),t(s)}return!0}function Kt(o,t){const e=o.plugins.get(C);if(!e||!G(e))return!1;if(t){const{history:n,entry:r}=qt(e);if(!r)return!1;const s=o.createTransaction();for(const i of r.steps)s.addStep(i);s.setMeta("isRedo",!0),s.setMeta("newHistory",n),s.setMeta("skipTimestamp",!0),t(s)}return!0}class Yt{constructor(){this._plugins=new Map}register(t){if(this._plugins.has(t.name))throw new Error(`Plugin "${t.name}" is already registered`);if(this._plugins.set(t.name,t),t.blocks)for(const e of t.blocks)H(e)}unregister(t){this._plugins.delete(t)}get(t){return this._plugins.get(t)}getAll(){return Array.from(this._plugins.values())}getCommands(){const t={};for(const e of this._plugins.values())e.commands&&Object.assign(t,e.commands);return t}has(t){return this._plugins.has(t)}}function B(o,t){if(o===t)return!0;if(o==null||t==null||typeof o!=typeof t)return!1;if(Array.isArray(o))return!Array.isArray(t)||o.length!==t.length?!1:o.every((e,n)=>B(e,t[n]));if(typeof o=="object"){const e=Object.keys(o),n=Object.keys(t);return e.length!==n.length?!1:e.every(r=>B(o[r],t[r]))}return!1}const Ft=new Set(["ar","he","fa","ur","ps","sd","dv","yi"]);function Xt(o,t){if(t)return t;const e=(o||"en").toLowerCase().split(/[-_]/)[0];return Ft.has(e)?"rtl":"ltr"}const T={repeat:"no-repeat",size:"cover",position:"top center"};function Zt(o){const t=o.attributes;if(t.backgroundImage)return{url:t.backgroundImage,repeat:t.backgroundRepeat??T.repeat,size:t.backgroundSize??T.size,position:t.backgroundPosition??T.position}}const f="2026-05-26T10:00:00.000Z",Jt={id:"starter-welcome",name:"Welcome",description:"A clean welcome email with a hero, intro paragraph, and call-to-action.",category:"welcome",createdAt:f,updatedAt:f,document:{version:"1.0",metadata:{name:"Welcome",previewText:"We're glad you're here.",createdAt:f,updatedAt:f},body:{attributes:{width:600,backgroundColor:"#f5f7fb",fontFamily:"Inter, sans-serif",contentAlignment:"center"},rows:[{id:"r-hero",type:"row",locked:!1,attributes:{padding:{top:0,right:0,bottom:0,left:0},fullWidth:!0},columnRatios:[12],columns:[{id:"c-hero",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-hero",type:"hero",values:{backgroundUrl:"https://placehold.co/600x280/0f172a/ffffff?text=Welcome",backgroundPosition:"center center",mode:"fixed-height",width:600,height:280,verticalAlign:"middle",padding:{top:0,right:0,bottom:0,left:0},innerPadding:{top:40,right:40,bottom:40,left:40},backgroundColor:"#0f172a",content:'<h1 style="color:#ffffff;font-size:32px;margin:0;">Welcome, {{firstName}}</h1>'}}]}]},{id:"r-intro",type:"row",locked:!1,attributes:{backgroundColor:"#ffffff",padding:{top:32,right:24,bottom:8,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-intro",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-intro",type:"text",values:{content:"<p>Thanks for joining — we've put together a quick guide to help you get the most out of your account.</p>",padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.6",textAlign:"left"}}]}]},{id:"r-cta",type:"row",locked:!1,attributes:{backgroundColor:"#ffffff",padding:{top:16,right:24,bottom:32,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-cta",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-cta",type:"button",values:{content:"<p>Get started</p>",href:"https://example.com/start",backgroundColor:"#3b82f6",textColor:"#ffffff",borderRadius:6,padding:{top:8,right:8,bottom:8,left:8},innerPadding:{top:12,right:24,bottom:12,left:24},fontSize:16,fontWeight:"600",alignment:"center",fullWidth:!1}}]}]}]}}},Qt={id:"starter-newsletter",name:"Newsletter",description:"A simple 3-section newsletter — headline + body + footer.",category:"newsletter",createdAt:f,updatedAt:f,document:{version:"1.0",metadata:{name:"Newsletter",previewText:"This month's updates",createdAt:f,updatedAt:f},body:{attributes:{width:600,backgroundColor:"#ffffff",fontFamily:"Inter, sans-serif",contentAlignment:"center"},rows:[{id:"r-head",type:"row",locked:!1,attributes:{padding:{top:24,right:24,bottom:8,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-head",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-head",type:"text",values:{content:'<h1 style="font-size:24px;margin:0;">This month at Acme</h1>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.3",textAlign:"left"}}]}]},{id:"r-body",type:"row",locked:!1,attributes:{padding:{top:8,right:24,bottom:24,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-body",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-body",type:"text",values:{content:"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sodales, mauris vel rhoncus sodales, eros lectus rutrum lectus.</p><p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>",padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.6",textAlign:"left"}}]}]},{id:"r-foot",type:"row",locked:!1,attributes:{backgroundColor:"#f5f7fb",padding:{top:16,right:24,bottom:16,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-foot",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-foot",type:"text",values:{content:'<p style="color:#64748b;font-size:12px;">© Acme · <a href="https://example.com/unsubscribe">Unsubscribe</a></p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"center"}}]}]}]}}},te={id:"starter-transactional",name:"Transactional (order confirmation)",description:"Order confirmation pattern with summary and a primary button.",category:"transactional",createdAt:f,updatedAt:f,document:{version:"1.0",metadata:{name:"Order confirmation",previewText:"Order {{orderNumber}} is on its way.",createdAt:f,updatedAt:f},body:{attributes:{width:600,backgroundColor:"#ffffff",fontFamily:"Inter, sans-serif",contentAlignment:"center"},rows:[{id:"r-h",type:"row",locked:!1,attributes:{padding:{top:32,right:24,bottom:8,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-h",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-h",type:"text",values:{content:'<h1 style="font-size:24px;margin:0 0 8px;">Thanks for your order, {{firstName}}</h1><p style="margin:0;">Order <strong>{{orderNumber}}</strong> is on its way.</p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"left"}}]}]},{id:"r-summary",type:"row",locked:!1,attributes:{backgroundColor:"#f8fafc",padding:{top:16,right:24,bottom:16,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-summary",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-summary",type:"text",values:{content:'<p style="margin:0 0 8px;"><strong>Summary</strong></p><p style="margin:0;">{{itemCount}} item(s) · {{total}}</p><p style="margin:8px 0 0;color:#64748b;font-size:12px;">Estimated delivery: {{deliveryDate}}</p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"left"}}]}]},{id:"r-cta",type:"row",locked:!1,attributes:{padding:{top:24,right:24,bottom:24,left:24},fullWidth:!1},columnRatios:[12],columns:[{id:"c-cta",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-cta",type:"button",values:{content:"<p>View order</p>",href:"https://example.com/orders/{{orderNumber}}",backgroundColor:"#0f172a",textColor:"#ffffff",borderRadius:6,padding:{top:0,right:0,bottom:0,left:0},innerPadding:{top:12,right:24,bottom:12,left:24},fontSize:16,fontWeight:"600",alignment:"left",fullWidth:!1}}]}]}]}}},ee={id:"starter-promo",name:"Promo / Sale",description:"Two-column product grid with a primary CTA and a social-link footer.",category:"promo",createdAt:f,updatedAt:f,document:{version:"1.0",metadata:{name:"Spring sale",previewText:"Two days only — 30% off.",createdAt:f,updatedAt:f},body:{attributes:{width:600,backgroundColor:"#fdf6ee",fontFamily:"Inter, sans-serif",contentAlignment:"center"},rows:[{id:"r-hero",type:"row",locked:!1,attributes:{padding:{top:0,right:0,bottom:0,left:0},fullWidth:!0},columnRatios:[12],columns:[{id:"c-hero",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"middle"},blocks:[{id:"b-hero",type:"hero",values:{backgroundUrl:"https://placehold.co/600x240/e76f51/ffffff?text=30%25+off",backgroundPosition:"center center",mode:"fluid-height",width:600,height:240,verticalAlign:"middle",padding:{top:0,right:0,bottom:0,left:0},innerPadding:{top:32,right:32,bottom:32,left:32},backgroundColor:"#e76f51",content:'<h1 style="color:#ffffff;font-size:36px;margin:0 0 8px;">30% off, this weekend only</h1><p style="color:#ffffff;font-size:16px;margin:0;">Code <strong>SPRING30</strong> at checkout.</p>'}}]}]},{id:"r-grid",type:"row",locked:!1,attributes:{backgroundColor:"#ffffff",padding:{top:24,right:16,bottom:24,left:16},fullWidth:!1},columnRatios:[6,6],columns:[{id:"c-l",type:"column",attributes:{padding:{top:0,right:8,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-l-img",type:"image",values:{src:"https://placehold.co/280x200",alt:"Linen shirt",width:"auto",href:"https://example.com/p/shirt",padding:{top:0,right:0,bottom:8,left:0},alignment:"center",borderRadius:6}},{id:"b-l-txt",type:"text",values:{content:'<p style="text-align:center;margin:0;"><strong>Linen shirt</strong><br><span style="color:#64748b;">$48 · was $69</span></p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"center"}}]},{id:"c-r",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:8},verticalAlign:"top"},blocks:[{id:"b-r-img",type:"image",values:{src:"https://placehold.co/280x200",alt:"Wool jumper",width:"auto",href:"https://example.com/p/jumper",padding:{top:0,right:0,bottom:8,left:0},alignment:"center",borderRadius:6}},{id:"b-r-txt",type:"text",values:{content:'<p style="text-align:center;margin:0;"><strong>Wool jumper</strong><br><span style="color:#64748b;">$84 · was $120</span></p>',padding:{top:0,right:0,bottom:0,left:0},lineHeight:"1.5",textAlign:"center"}}]}]},{id:"r-cta",type:"row",locked:!1,attributes:{backgroundColor:"#ffffff",padding:{top:8,right:16,bottom:24,left:16},fullWidth:!1},columnRatios:[12],columns:[{id:"c-cta",type:"column",attributes:{padding:{top:0,right:0,bottom:0,left:0},verticalAlign:"top"},blocks:[{id:"b-cta",type:"button",values:{content:"<p>Shop the sale</p>",href:"https://example.com/sale",backgroundColor:"#0f172a",textColor:"#ffffff",borderRadius:6,padding:{top:8,right:0,bottom:8,left:0},innerPadding:{top:14,right:28,bottom:14,left:28},fontSize:16,fontWeight:"600",alignment:"center",fullWidth:!0}}]}]}]}}},K=Object.freeze([Jt,Qt,te,ee]);function Y(){return K.map(o=>structuredClone(o))}function oe(o){const t=K.find(e=>e.id===o);return t?structuredClone(t):null}async function F(){const{GALLERY_TEMPLATES:o}=await Promise.resolve().then(()=>require("./gallery.cjs"));return o.map(t=>structuredClone(t))}class ne{constructor(t={}){if(this._byId=new Map,this._includeGallery=t.includeStarters!==!1,this._includeGallery)for(const e of Y())this._byId.set(e.id,e);if(t.seed)for(const e of t.seed)this._byId.set(e.id,e)}async list(){return await this._ready(),Array.from(this._byId.values()).map(t=>structuredClone(t))}async get(t){await this._ready();const e=this._byId.get(t);return e?structuredClone(e):null}async save(t){if(!t.id)throw new Error("Template.id is required");await this._ready();const e=structuredClone(t);e.updatedAt=new Date().toISOString(),this._byId.has(e.id)||(e.createdAt=e.updatedAt),this._byId.set(e.id,e)}async delete(t){await this._ready(),this._byId.delete(t)}_ready(){return this._includeGallery?(this._gallery??(this._gallery=F().then(t=>{for(const e of t)this._byId.has(e.id)||this._byId.set(e.id,e)})),this._gallery):Promise.resolve()}}class re{constructor(t={}){if(this._byId=new Map,t.seed)for(const e of t.seed)this._byId.set(e.id,e)}async list(){return Array.from(this._byId.values()).map(t=>structuredClone(t))}async get(t){const e=this._byId.get(t);return e?structuredClone(e):null}async save(t){if(!t.id)throw new Error("BrandKit.id is required");const e=structuredClone(t);e.updatedAt=new Date().toISOString(),this._byId.has(e.id)||(e.createdAt=e.updatedAt),this._byId.set(e.id,e)}async delete(t){this._byId.delete(t)}}class se{constructor(t={}){if(this._byId=new Map,t.seed)for(const e of t.seed)this._byId.set(e.id,e)}async list(t={}){let n=Array.from(this._byId.values()).map(i=>structuredClone(i)).filter(i=>ie(i,t));n.sort((i,l)=>i.updatedAt<l.updatedAt?1:i.updatedAt>l.updatedAt?-1:0);const r=t.offset??0,s=t.limit;return n=n.slice(r,s!==void 0?r+s:void 0),n}async get(t){const e=this._byId.get(t);return e?structuredClone(e):null}async save(t){if(!t.id)throw new Error("Asset.id is required");if(!t.src)throw new Error("Asset.src is required");const e=structuredClone(t);e.updatedAt=new Date().toISOString(),this._byId.has(e.id)||(e.createdAt=e.updatedAt),e.folder||(e.folder="/"),this._byId.set(e.id,e)}async delete(t){this._byId.delete(t)}async listFolders(){const t=new Set;for(const e of this._byId.values())t.add(e.folder||"/");return Array.from(t).sort()}}function ie(o,t){if(t.folder&&(o.folder||"/")!==t.folder)return!1;if(t.tags&&t.tags.length>0){const e=new Set(o.tags??[]);if(!t.tags.every(n=>e.has(n)))return!1}if(t.search){const e=t.search.toLowerCase();if(![o.name,o.alt??"",...o.tags??[]].join(" ").toLowerCase().includes(e))return!1}return!0}class le{constructor(t={}){if(this._byId=new Map,t.seed)for(const e of t.seed)this._byId.set(e.id,e)}async list(){return Array.from(this._byId.values()).map(t=>structuredClone(t))}async get(t){const e=this._byId.get(t);return e?structuredClone(e):null}async save(t){if(!t.id)throw new Error("LibraryEntry.id is required");const e=structuredClone(t);e.updatedAt=new Date().toISOString(),this._byId.has(e.id)||(e.createdAt=e.updatedAt),this._byId.set(e.id,e)}async delete(t){this._byId.delete(t)}}function ae(o){const t=structuredClone(o);return t.id=g(),t.columns.forEach(e=>{e.id=g(),e.blocks.forEach(n=>{n.id=g()})}),t}const ce=[{id:"unsubscribe",label:"Unsubscribe",href:"{{unsubscribe_url}}"},{id:"view-in-browser",label:"View in browser",href:"{{view_in_browser_url}}"},{id:"email",label:"Email address",prompt:"email"},{id:"phone",label:"Phone number",prompt:"tel"}];exports.EditorState=v;exports.HISTORY_PLUGIN_NAME=C;exports.InMemoryAssetStorage=se;exports.InMemoryBrandKitStorage=re;exports.InMemoryRowLibraryStorage=le;exports.InMemoryTemplateStorage=ne;exports.LINK_STYLE_NAME=E;exports.PluginRegistry=Yt;exports.SYSTEM_LINK_TYPES=ce;exports.Transaction=L;exports.addColumn=Rt;exports.canRedo=G;exports.canUndo=U;exports.cloneRowWithNewIds=ae;exports.createBlock=lt;exports.createBlockSelection=A;exports.createBodySelection=dt;exports.createColumn=$;exports.createColumnSelection=ct;exports.createDefaultDocument=D;exports.createDocStep=p;exports.createHistoryPlugin=Ut;exports.createRow=at;exports.createRowSelection=_;exports.cssToLinkStyle=Nt;exports.deepEqual=B;exports.defaultSpacing=b;exports.deleteBlock=wt;exports.deleteRow=vt;exports.duplicateBlock=It;exports.duplicateRow=_t;exports.generateId=g;exports.generatedStyleMarker=j;exports.generatedStyleName=z;exports.getAllBlockDefinitions=W;exports.getAvailableBlockDefinitions=bt;exports.getBlockDefinition=mt;exports.getDefaultValues=h;exports.getStarterTemplate=oe;exports.getStarterTemplates=Y;exports.insertBlock=ht;exports.insertRow=St;exports.isBlockTypeAvailable=N;exports.isKnownBlockType=yt;exports.isValidDocument=Dt;exports.linkStyleToCss=Wt;exports.loadGalleryTemplates=F;exports.moveBlock=xt;exports.moveRow=At;exports.redo=Kt;exports.registerBlock=H;exports.removeColumn=Tt;exports.resizeColumns=Bt;exports.resolveDirection=Xt;exports.resolveRowBackground=Zt;exports.selectionsEqual=ut;exports.setAvailableBlockTypes=gt;exports.undo=Gt;exports.updateBlock=kt;exports.updateColumnAttributes=$t;exports.updateRowAttributes=Ct;exports.validateDocument=O;