@charisol/plexo-sdk 1.0.26 → 1.0.27

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,1091 @@
1
+ //#region src/utilities/playground.constants.ts
2
+ var e = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, t = [
3
+ {
4
+ id: "all",
5
+ label: "All sources"
6
+ },
7
+ {
8
+ id: "unsplash",
9
+ label: "Unsplash"
10
+ },
11
+ {
12
+ id: "pexels",
13
+ label: "Pexels"
14
+ },
15
+ {
16
+ id: "pixabay",
17
+ label: "Pixabay"
18
+ }
19
+ ], n = [
20
+ {
21
+ id: "surface-book",
22
+ label: "Surface Book",
23
+ width: 1500,
24
+ category: "desktop"
25
+ },
26
+ {
27
+ id: "macbook-pro",
28
+ label: "MacBook Pro",
29
+ width: 1440,
30
+ category: "desktop"
31
+ },
32
+ {
33
+ id: "imac",
34
+ label: "iMac",
35
+ width: 1280,
36
+ category: "desktop"
37
+ },
38
+ {
39
+ id: "macbook",
40
+ label: "MacBook",
41
+ width: 1152,
42
+ category: "desktop"
43
+ },
44
+ {
45
+ id: "surface-pro-4",
46
+ label: "Surface Pro 4",
47
+ width: 1368,
48
+ category: "tablet"
49
+ },
50
+ {
51
+ id: "ipad-pro-129",
52
+ label: "iPad Pro 12.9\"",
53
+ width: 1024,
54
+ category: "tablet"
55
+ },
56
+ {
57
+ id: "ipad-pro-11",
58
+ label: "iPad Pro 11\"",
59
+ width: 834,
60
+ category: "tablet"
61
+ },
62
+ {
63
+ id: "ipad-mini",
64
+ label: "iPad Mini",
65
+ width: 768,
66
+ category: "tablet"
67
+ },
68
+ {
69
+ id: "iphone-15-pro-max",
70
+ label: "iPhone 15 Pro Max",
71
+ width: 430,
72
+ category: "mobile"
73
+ },
74
+ {
75
+ id: "iphone-15-plus",
76
+ label: "iPhone 15 Plus",
77
+ width: 430,
78
+ category: "mobile"
79
+ },
80
+ {
81
+ id: "iphone-se",
82
+ label: "iPhone SE",
83
+ width: 375,
84
+ category: "mobile"
85
+ }
86
+ ], r = 1280, i = [
87
+ {
88
+ id: "facebook",
89
+ label: "Facebook"
90
+ },
91
+ {
92
+ id: "instagram",
93
+ label: "Instagram"
94
+ },
95
+ {
96
+ id: "linkedin",
97
+ label: "LinkedIn"
98
+ },
99
+ {
100
+ id: "x",
101
+ label: "X"
102
+ },
103
+ {
104
+ id: "youtube",
105
+ label: "YouTube"
106
+ },
107
+ {
108
+ id: "pinterest",
109
+ label: "Pinterest"
110
+ },
111
+ {
112
+ id: "whatsapp",
113
+ label: "WhatsApp"
114
+ },
115
+ {
116
+ id: "tiktok",
117
+ label: "TikTok"
118
+ }
119
+ ], a = [
120
+ {
121
+ label: "Text",
122
+ value: "text"
123
+ },
124
+ {
125
+ label: "Email",
126
+ value: "email"
127
+ },
128
+ {
129
+ label: "Number",
130
+ value: "number"
131
+ },
132
+ {
133
+ label: "Date",
134
+ value: "date"
135
+ },
136
+ {
137
+ label: "Textarea",
138
+ value: "textarea"
139
+ },
140
+ {
141
+ label: "Select",
142
+ value: "select"
143
+ },
144
+ {
145
+ label: "Radio",
146
+ value: "radio"
147
+ },
148
+ {
149
+ label: "Checkbox",
150
+ value: "checkbox"
151
+ }
152
+ ], o = [
153
+ {
154
+ label: "1 Column",
155
+ widths: ["100%"],
156
+ percentages: ["100%"]
157
+ },
158
+ {
159
+ label: "2 Columns",
160
+ widths: ["50%", "50%"],
161
+ percentages: ["50%", "50%"]
162
+ },
163
+ {
164
+ label: "60 / 40",
165
+ widths: ["60%", "40%"],
166
+ percentages: ["60%", "40%"]
167
+ },
168
+ {
169
+ label: "40 / 60",
170
+ widths: ["40%", "60%"],
171
+ percentages: ["40%", "60%"]
172
+ },
173
+ {
174
+ label: "3 Columns",
175
+ widths: [
176
+ "33.33%",
177
+ "33.33%",
178
+ "33.33%"
179
+ ],
180
+ percentages: [
181
+ "33%",
182
+ "33%",
183
+ "33%"
184
+ ]
185
+ },
186
+ {
187
+ label: "4 Columns",
188
+ widths: [
189
+ "25%",
190
+ "25%",
191
+ "25%",
192
+ "25%"
193
+ ],
194
+ percentages: [
195
+ "25%",
196
+ "25%",
197
+ "25%",
198
+ "25%"
199
+ ]
200
+ }
201
+ ], s = [
202
+ {
203
+ label: "Roboto",
204
+ value: "'Roboto', sans-serif",
205
+ style: "sans"
206
+ },
207
+ {
208
+ label: "Open Sans",
209
+ value: "'Open Sans', sans-serif",
210
+ style: "sans"
211
+ },
212
+ {
213
+ label: "Lato",
214
+ value: "'Lato', sans-serif",
215
+ style: "sans"
216
+ },
217
+ {
218
+ label: "Montserrat",
219
+ value: "'Montserrat', sans-serif",
220
+ style: "sans"
221
+ },
222
+ {
223
+ label: "Inter",
224
+ value: "'Inter', sans-serif",
225
+ style: "sans"
226
+ },
227
+ {
228
+ label: "Poppins",
229
+ value: "'Poppins', sans-serif",
230
+ style: "sans"
231
+ },
232
+ {
233
+ label: "Raleway",
234
+ value: "'Raleway', sans-serif",
235
+ style: "sans"
236
+ },
237
+ {
238
+ label: "Nunito",
239
+ value: "'Nunito', sans-serif",
240
+ style: "sans"
241
+ },
242
+ {
243
+ label: "Nunito Sans",
244
+ value: "'Nunito Sans', sans-serif",
245
+ style: "sans"
246
+ },
247
+ {
248
+ label: "Ubuntu",
249
+ value: "'Ubuntu', sans-serif",
250
+ style: "sans"
251
+ },
252
+ {
253
+ label: "Rubik",
254
+ value: "'Rubik', sans-serif",
255
+ style: "sans"
256
+ },
257
+ {
258
+ label: "Plus Jakarta Sans",
259
+ value: "'Plus Jakarta Sans', sans-serif",
260
+ style: "sans"
261
+ },
262
+ {
263
+ label: "DM Sans",
264
+ value: "'DM Sans', sans-serif",
265
+ style: "sans"
266
+ },
267
+ {
268
+ label: "Outfit",
269
+ value: "'Outfit', sans-serif",
270
+ style: "sans"
271
+ },
272
+ {
273
+ label: "Figtree",
274
+ value: "'Figtree', sans-serif",
275
+ style: "sans"
276
+ },
277
+ {
278
+ label: "Karla",
279
+ value: "'Karla', sans-serif",
280
+ style: "sans"
281
+ },
282
+ {
283
+ label: "Barlow",
284
+ value: "'Barlow', sans-serif",
285
+ style: "sans"
286
+ },
287
+ {
288
+ label: "Work Sans",
289
+ value: "'Work Sans', sans-serif",
290
+ style: "sans"
291
+ },
292
+ {
293
+ label: "Manrope",
294
+ value: "'Manrope', sans-serif",
295
+ style: "sans"
296
+ },
297
+ {
298
+ label: "Jost",
299
+ value: "'Jost', sans-serif",
300
+ style: "sans"
301
+ },
302
+ {
303
+ label: "Sora",
304
+ value: "'Sora', sans-serif",
305
+ style: "sans"
306
+ },
307
+ {
308
+ label: "Be Vietnam Pro",
309
+ value: "'Be Vietnam Pro', sans-serif",
310
+ style: "sans"
311
+ },
312
+ {
313
+ label: "Mulish",
314
+ value: "'Mulish', sans-serif",
315
+ style: "sans"
316
+ },
317
+ {
318
+ label: "Noto Sans",
319
+ value: "'Noto Sans', sans-serif",
320
+ style: "sans"
321
+ },
322
+ {
323
+ label: "Source Sans 3",
324
+ value: "'Source Sans 3', sans-serif",
325
+ style: "sans"
326
+ },
327
+ {
328
+ label: "IBM Plex Sans",
329
+ value: "'IBM Plex Sans', sans-serif",
330
+ style: "sans"
331
+ },
332
+ {
333
+ label: "Josefin Sans",
334
+ value: "'Josefin Sans', sans-serif",
335
+ style: "sans"
336
+ },
337
+ {
338
+ label: "Quicksand",
339
+ value: "'Quicksand', sans-serif",
340
+ style: "sans"
341
+ },
342
+ {
343
+ label: "Exo 2",
344
+ value: "'Exo 2', sans-serif",
345
+ style: "sans"
346
+ },
347
+ {
348
+ label: "Titillium Web",
349
+ value: "'Titillium Web', sans-serif",
350
+ style: "sans"
351
+ },
352
+ {
353
+ label: "Merriweather",
354
+ value: "'Merriweather', serif",
355
+ style: "serif"
356
+ },
357
+ {
358
+ label: "Playfair Display",
359
+ value: "'Playfair Display', serif",
360
+ style: "serif"
361
+ },
362
+ {
363
+ label: "Lora",
364
+ value: "'Lora', serif",
365
+ style: "serif"
366
+ },
367
+ {
368
+ label: "PT Serif",
369
+ value: "'PT Serif', serif",
370
+ style: "serif"
371
+ },
372
+ {
373
+ label: "Noto Serif",
374
+ value: "'Noto Serif', serif",
375
+ style: "serif"
376
+ },
377
+ {
378
+ label: "EB Garamond",
379
+ value: "'EB Garamond', serif",
380
+ style: "serif"
381
+ },
382
+ {
383
+ label: "Libre Baskerville",
384
+ value: "'Libre Baskerville', serif",
385
+ style: "serif"
386
+ },
387
+ {
388
+ label: "Cormorant Garamond",
389
+ value: "'Cormorant Garamond', serif",
390
+ style: "serif"
391
+ },
392
+ {
393
+ label: "Crimson Text",
394
+ value: "'Crimson Text', serif",
395
+ style: "serif"
396
+ },
397
+ {
398
+ label: "DM Serif Display",
399
+ value: "'DM Serif Display', serif",
400
+ style: "serif"
401
+ },
402
+ {
403
+ label: "Domine",
404
+ value: "'Domine', serif",
405
+ style: "serif"
406
+ },
407
+ {
408
+ label: "Bitter",
409
+ value: "'Bitter', serif",
410
+ style: "serif"
411
+ },
412
+ {
413
+ label: "Spectral",
414
+ value: "'Spectral', serif",
415
+ style: "serif"
416
+ },
417
+ {
418
+ label: "Cardo",
419
+ value: "'Cardo', serif",
420
+ style: "serif"
421
+ },
422
+ {
423
+ label: "Gilda Display",
424
+ value: "'Gilda Display', serif",
425
+ style: "serif"
426
+ },
427
+ {
428
+ label: "Roboto Mono",
429
+ value: "'Roboto Mono', monospace",
430
+ style: "mono"
431
+ },
432
+ {
433
+ label: "Source Code Pro",
434
+ value: "'Source Code Pro', monospace",
435
+ style: "mono"
436
+ },
437
+ {
438
+ label: "Fira Code",
439
+ value: "'Fira Code', monospace",
440
+ style: "mono"
441
+ },
442
+ {
443
+ label: "JetBrains Mono",
444
+ value: "'JetBrains Mono', monospace",
445
+ style: "mono"
446
+ },
447
+ {
448
+ label: "IBM Plex Mono",
449
+ value: "'IBM Plex Mono', monospace",
450
+ style: "mono"
451
+ },
452
+ {
453
+ label: "Space Mono",
454
+ value: "'Space Mono', monospace",
455
+ style: "mono"
456
+ },
457
+ {
458
+ label: "Inconsolata",
459
+ value: "'Inconsolata', monospace",
460
+ style: "mono"
461
+ },
462
+ {
463
+ label: "Courier Prime",
464
+ value: "'Courier Prime', monospace",
465
+ style: "mono"
466
+ },
467
+ {
468
+ label: "Oswald",
469
+ value: "'Oswald', sans-serif",
470
+ style: "display"
471
+ },
472
+ {
473
+ label: "Anton",
474
+ value: "'Anton', sans-serif",
475
+ style: "display"
476
+ },
477
+ {
478
+ label: "Bebas Neue",
479
+ value: "'Bebas Neue', sans-serif",
480
+ style: "display"
481
+ },
482
+ {
483
+ label: "Righteous",
484
+ value: "'Righteous', sans-serif",
485
+ style: "display"
486
+ },
487
+ {
488
+ label: "Russo One",
489
+ value: "'Russo One', sans-serif",
490
+ style: "display"
491
+ },
492
+ {
493
+ label: "Chakra Petch",
494
+ value: "'Chakra Petch', sans-serif",
495
+ style: "display"
496
+ },
497
+ {
498
+ label: "Orbitron",
499
+ value: "'Orbitron', sans-serif",
500
+ style: "display"
501
+ },
502
+ {
503
+ label: "Abril Fatface",
504
+ value: "'Abril Fatface', serif",
505
+ style: "display"
506
+ },
507
+ {
508
+ label: "Lobster",
509
+ value: "'Lobster', cursive",
510
+ style: "display"
511
+ },
512
+ {
513
+ label: "Alfa Slab One",
514
+ value: "'Alfa Slab One', serif",
515
+ style: "display"
516
+ },
517
+ {
518
+ label: "Archivo Black",
519
+ value: "'Archivo Black', sans-serif",
520
+ style: "display"
521
+ },
522
+ {
523
+ label: "Bangers",
524
+ value: "'Bangers', cursive",
525
+ style: "display"
526
+ },
527
+ {
528
+ label: "Boogaloo",
529
+ value: "'Boogaloo', cursive",
530
+ style: "display"
531
+ },
532
+ {
533
+ label: "Fredoka One",
534
+ value: "'Fredoka One', cursive",
535
+ style: "display"
536
+ },
537
+ {
538
+ label: "Permanent Marker",
539
+ value: "'Permanent Marker', cursive",
540
+ style: "display"
541
+ },
542
+ {
543
+ label: "Lilita One",
544
+ value: "'Lilita One', cursive",
545
+ style: "display"
546
+ },
547
+ {
548
+ label: "Dancing Script",
549
+ value: "'Dancing Script', cursive",
550
+ style: "handwriting"
551
+ },
552
+ {
553
+ label: "Pacifico",
554
+ value: "'Pacifico', cursive",
555
+ style: "handwriting"
556
+ },
557
+ {
558
+ label: "Satisfy",
559
+ value: "'Satisfy', cursive",
560
+ style: "handwriting"
561
+ },
562
+ {
563
+ label: "Caveat",
564
+ value: "'Caveat', cursive",
565
+ style: "handwriting"
566
+ },
567
+ {
568
+ label: "Indie Flower",
569
+ value: "'Indie Flower', cursive",
570
+ style: "handwriting"
571
+ },
572
+ {
573
+ label: "Kalam",
574
+ value: "'Kalam', cursive",
575
+ style: "handwriting"
576
+ },
577
+ {
578
+ label: "Shadows Into Light",
579
+ value: "'Shadows Into Light', cursive",
580
+ style: "handwriting"
581
+ },
582
+ {
583
+ label: "Amatic SC",
584
+ value: "'Amatic SC', cursive",
585
+ style: "handwriting"
586
+ },
587
+ {
588
+ label: "Courgette",
589
+ value: "'Courgette', cursive",
590
+ style: "handwriting"
591
+ },
592
+ {
593
+ label: "Cookie",
594
+ value: "'Cookie', cursive",
595
+ style: "handwriting"
596
+ },
597
+ {
598
+ label: "Great Vibes",
599
+ value: "'Great Vibes', cursive",
600
+ style: "handwriting"
601
+ }
602
+ ], c = new Map(s.map((e) => [e.value, e.label]));
603
+ function l(e, t = []) {
604
+ let n = /* @__PURE__ */ new Set(), r = (e) => {
605
+ if (!e) return;
606
+ let t = Array.isArray(e.columns) ? e.columns : [];
607
+ for (let e of t) {
608
+ if (!e) continue;
609
+ let t = Array.isArray(e.elements) ? e.elements : [];
610
+ for (let e of t) {
611
+ let t = e?.style?.fontFamily;
612
+ typeof t == "string" && t.trim() && n.add(t.trim());
613
+ }
614
+ (Array.isArray(e.nestedRows) ? e.nestedRows : []).forEach(r);
615
+ }
616
+ };
617
+ (e || []).forEach(r);
618
+ for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
619
+ return n;
620
+ }
621
+ function u(e) {
622
+ let t = /* @__PURE__ */ new Set();
623
+ for (let n of e) {
624
+ let e = c.get(n);
625
+ e && t.add(e);
626
+ }
627
+ return t.size === 0 ? null : `https://fonts.googleapis.com/css?family=${Array.from(t).map((e) => `${encodeURIComponent(e).replace(/%20/g, "+")}:400,700`).join("|")}&display=swap`;
628
+ }
629
+ //#endregion
630
+ //#region src/utilities/compiler.ts
631
+ var d = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
632
+ function f(e) {
633
+ if (!e || typeof e != "object") return null;
634
+ if (Array.isArray(e.columns) && e.columns.length > 0) return e;
635
+ let t = (e.type || "").toLowerCase(), n = e.props || e.content || e.attributes || e.data || e.payload || e, r = e.style || {};
636
+ switch (t) {
637
+ case "hero": {
638
+ let t = n.headline || n.title || n.text || "Build faster. Scale smarter.", i = n.subheadline || n.description || n.subtitle || "", a = n.primaryButton || n.button || n.cta || "Get Started", o = n.secondaryButton || "", s = [{
639
+ type: "heading",
640
+ style: {
641
+ fontSize: "48px",
642
+ fontWeight: "800",
643
+ textAlign: "center",
644
+ marginBottom: "16px"
645
+ },
646
+ attributes: { text: t }
647
+ }];
648
+ return i && s.push({
649
+ type: "paragraph",
650
+ style: {
651
+ fontSize: "18px",
652
+ color: "#94a3b8",
653
+ textAlign: "center",
654
+ maxWidth: "700px",
655
+ margin: "0 auto 32px auto"
656
+ },
657
+ attributes: { text: i }
658
+ }), a && s.push({
659
+ type: "button",
660
+ style: {
661
+ textAlign: "center",
662
+ backgroundColor: "#8b5cf6",
663
+ color: "#ffffff",
664
+ borderRadius: "12px",
665
+ paddingTop: "14px",
666
+ paddingBottom: "14px",
667
+ paddingLeft: "28px",
668
+ paddingRight: "28px",
669
+ fontSize: "16px",
670
+ fontWeight: "600"
671
+ },
672
+ attributes: {
673
+ text: a,
674
+ href: "#signup"
675
+ }
676
+ }), o && s.push({
677
+ type: "button",
678
+ style: {
679
+ textAlign: "center",
680
+ backgroundColor: "rgba(255,255,255,0.1)",
681
+ color: "#ffffff",
682
+ borderRadius: "12px",
683
+ paddingTop: "14px",
684
+ paddingBottom: "14px",
685
+ paddingLeft: "28px",
686
+ paddingRight: "28px",
687
+ fontSize: "16px",
688
+ fontWeight: "600",
689
+ marginLeft: "12px"
690
+ },
691
+ attributes: {
692
+ text: o,
693
+ href: "#demo"
694
+ }
695
+ }), {
696
+ id: e.id || `row-hero-${Math.random().toString(36).substring(2, 7)}`,
697
+ style: {
698
+ paddingTop: "80px",
699
+ paddingBottom: "80px",
700
+ textAlign: "center",
701
+ ...r
702
+ },
703
+ columns: [{
704
+ id: `col-hero-${Math.random().toString(36).substring(2, 7)}`,
705
+ width: "100%",
706
+ elements: s
707
+ }]
708
+ };
709
+ }
710
+ case "features": {
711
+ let t = n.title || n.headline || "Features", i = Array.isArray(n.items) ? n.items : Array.isArray(n.features) ? n.features : [], a = [{
712
+ type: "heading",
713
+ style: {
714
+ fontSize: "32px",
715
+ fontWeight: "700",
716
+ textAlign: "center",
717
+ marginBottom: "40px"
718
+ },
719
+ attributes: { text: t }
720
+ }], o = [];
721
+ if (i.length > 0) {
722
+ let e = i.length === 2 ? "50%" : i.length >= 3 ? "33.33%" : "100%";
723
+ i.forEach((t, n) => {
724
+ let r = typeof t == "string" ? t : t.title || t.name || `Feature ${n + 1}`, i = typeof t == "string" ? "" : t.description || t.text || "";
725
+ o.push({
726
+ id: `col-feat-${n}`,
727
+ width: e,
728
+ elements: [{
729
+ type: "card",
730
+ style: {
731
+ backgroundColor: "#111827",
732
+ borderRadius: "16px",
733
+ padding: "24px",
734
+ borderWidth: "1px",
735
+ borderColor: "rgba(255,255,255,0.08)"
736
+ },
737
+ attributes: {
738
+ title: r,
739
+ description: i || "Powerful functionality built for performance and scale."
740
+ }
741
+ }]
742
+ });
743
+ });
744
+ }
745
+ return {
746
+ id: e.id || `row-features-${Math.random().toString(36).substring(2, 7)}`,
747
+ style: {
748
+ paddingTop: "60px",
749
+ paddingBottom: "60px",
750
+ ...r
751
+ },
752
+ columns: o.length > 0 ? o : [{
753
+ id: "col-feat-fallback",
754
+ width: "100%",
755
+ elements: a
756
+ }]
757
+ };
758
+ }
759
+ case "footer": {
760
+ let t = n.text || n.copyright || n.headline || n.title || "";
761
+ return (Array.isArray(n.links) ? n.links : []).length > 0 || !t ? null : {
762
+ id: e.id || `row-footer-${Math.random().toString(36).substring(2, 7)}`,
763
+ style: {
764
+ paddingTop: "32px",
765
+ paddingBottom: "32px",
766
+ textAlign: "center",
767
+ ...r
768
+ },
769
+ columns: [{
770
+ id: `col-footer-${Math.random().toString(36).substring(2, 7)}`,
771
+ width: "100%",
772
+ elements: [{
773
+ type: "paragraph",
774
+ style: {
775
+ fontSize: "14px",
776
+ color: "#94a3b8",
777
+ textAlign: "center"
778
+ },
779
+ attributes: { text: t }
780
+ }]
781
+ }]
782
+ };
783
+ }
784
+ case "cta": {
785
+ let t = n.headline || n.title || "Ready to transform your workflow?", i = n.button || n.primaryButton || n.cta || "Get Started";
786
+ return {
787
+ id: e.id || `row-cta-${Math.random().toString(36).substring(2, 7)}`,
788
+ style: {
789
+ backgroundColor: "rgba(139, 92, 246, 0.12)",
790
+ borderRadius: "24px",
791
+ padding: "48px",
792
+ textAlign: "center",
793
+ marginTop: "40px",
794
+ marginBottom: "60px",
795
+ borderWidth: "1px",
796
+ borderColor: "rgba(139, 92, 246, 0.3)",
797
+ ...r
798
+ },
799
+ columns: [{
800
+ id: `col-cta-${Math.random().toString(36).substring(2, 7)}`,
801
+ width: "100%",
802
+ elements: [{
803
+ type: "heading",
804
+ style: {
805
+ fontSize: "32px",
806
+ color: "#ffffff",
807
+ fontWeight: "700",
808
+ textAlign: "center",
809
+ marginBottom: "20px"
810
+ },
811
+ attributes: { text: t }
812
+ }, {
813
+ type: "button",
814
+ style: {
815
+ textAlign: "center",
816
+ backgroundColor: "#8b5cf6",
817
+ color: "#ffffff",
818
+ borderRadius: "12px",
819
+ paddingTop: "14px",
820
+ paddingBottom: "14px",
821
+ paddingLeft: "28px",
822
+ paddingRight: "28px",
823
+ fontWeight: "700"
824
+ },
825
+ attributes: {
826
+ text: i,
827
+ href: "#signup"
828
+ }
829
+ }]
830
+ }]
831
+ };
832
+ }
833
+ default: {
834
+ if (Object.values(n).some((e) => Array.isArray(e) && e.length > 0)) return null;
835
+ let t = n.headline || n.title || n.text || "", i = n.subheadline || n.description || n.subtitle || "", a = n.button || n.primaryButton || n.cta || "", o = [];
836
+ return t && o.push({
837
+ type: "heading",
838
+ style: {
839
+ fontSize: "32px",
840
+ fontWeight: "700",
841
+ marginBottom: "16px"
842
+ },
843
+ attributes: { text: t }
844
+ }), i && o.push({
845
+ type: "paragraph",
846
+ style: {
847
+ fontSize: "16px",
848
+ color: "#94a3b8",
849
+ marginBottom: "24px"
850
+ },
851
+ attributes: { text: i }
852
+ }), a && o.push({
853
+ type: "button",
854
+ style: {
855
+ backgroundColor: "#8b5cf6",
856
+ color: "#ffffff",
857
+ borderRadius: "12px",
858
+ paddingTop: "12px",
859
+ paddingBottom: "12px",
860
+ paddingLeft: "24px",
861
+ paddingRight: "24px"
862
+ },
863
+ attributes: {
864
+ text: a,
865
+ href: "#action"
866
+ }
867
+ }), {
868
+ id: e.id || `row-generic-${Math.random().toString(36).substring(2, 7)}`,
869
+ style: {
870
+ paddingTop: "40px",
871
+ paddingBottom: "40px",
872
+ ...r
873
+ },
874
+ columns: [{
875
+ id: `col-generic-${Math.random().toString(36).substring(2, 7)}`,
876
+ width: "100%",
877
+ elements: o.length > 0 ? o : [{
878
+ type: "heading",
879
+ attributes: { text: "Section" }
880
+ }]
881
+ }]
882
+ };
883
+ }
884
+ }
885
+ }
886
+ var p = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
887
+ let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
888
+ return typeof t == "number" && [
889
+ "padding",
890
+ "margin",
891
+ "fontSize",
892
+ "borderRadius",
893
+ "borderWidth",
894
+ "width",
895
+ "height"
896
+ ].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
897
+ }).join(" "), m = () => ({
898
+ backgroundColor: "#ffffff",
899
+ borderRadius: "20px",
900
+ width: "100%",
901
+ padding: "24px",
902
+ paddingTop: "24px",
903
+ paddingRight: "24px",
904
+ paddingBottom: "24px",
905
+ paddingLeft: "24px",
906
+ fieldSpacing: "12px",
907
+ borderWidth: "1px",
908
+ borderStyle: "solid",
909
+ borderColor: "#dbe4f0",
910
+ boxShadow: "0 18px 40px rgba(15, 23, 42, 0.08)",
911
+ buttonBackgroundColor: "#0f172a",
912
+ buttonTextColor: "#ffffff",
913
+ buttonBorderRadius: "12px",
914
+ buttonPaddingTop: "10px",
915
+ buttonPaddingBottom: "10px",
916
+ buttonPaddingLeft: "14px",
917
+ buttonPaddingRight: "14px",
918
+ buttonFontSize: "13px",
919
+ buttonFontWeight: "700"
920
+ }), h = (e) => (e || "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), g = (e, t) => {
921
+ if (typeof t != "string") return "";
922
+ let n = t.trim();
923
+ return n ? ` ${e}="${h(n)}"` : "";
924
+ }, _ = [
925
+ "fieldSpacing",
926
+ "buttonBackgroundColor",
927
+ "buttonTextColor",
928
+ "buttonBorderRadius",
929
+ "buttonPaddingTop",
930
+ "buttonPaddingBottom",
931
+ "buttonPaddingLeft",
932
+ "buttonPaddingRight",
933
+ "buttonFontSize",
934
+ "buttonFontWeight"
935
+ ], v = (e) => {
936
+ if (!e || typeof e != "object") return "";
937
+ let t = e.kind || "text", n = h(e.name || e.label || "field"), r = e.required ? " required" : "", i = p({
938
+ fontSize: e.fontSize,
939
+ borderRadius: e.borderRadius,
940
+ borderWidth: e.borderWidth,
941
+ borderColor: e.borderColor,
942
+ borderStyle: "solid",
943
+ color: e.inputTextColor
944
+ }), a = e.showLabel === !1 ? "" : `<label style="display: block; margin-bottom: 4px; font-size: ${e.fontSize || "12px"}; font-weight: ${e.labelFontWeight || "700"}; color: ${e.labelColor || "inherit"};">${e.label || ""}${e.required ? " <span style=\"color:#e11d48;\">*</span>" : ""}</label>`;
945
+ return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${h(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${h(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
946
+ label: e.label || "Option",
947
+ value: e.name || "option"
948
+ }]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${h(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${h(t)}" name="${n}" placeholder="${h(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
949
+ }, y = (e) => {
950
+ if (!e || typeof e != "object") return "";
951
+ let t = e.style || {}, n = p(e.type === "form_container" ? {
952
+ ...m(),
953
+ ...t
954
+ } : t), r = e.attributes || {};
955
+ switch (e.type) {
956
+ case "heading": return `<h2 style="margin-top: 0; margin-bottom: 8px; ${n}">${r.text || "Heading"}</h2>`;
957
+ case "paragraph": return `<p style="margin-top: 0; margin-bottom: 12px; ${n}">${r.text || "Paragraph text content."}</p>`;
958
+ case "text": return `<div style="${n}">${r.text || ""}</div>`;
959
+ case "button": return `<div style="text-align: ${t.textAlign || "center"};"><a href="${r.href || "#"}" target="${r.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${n}">${r.text || "Button"}</a></div>`;
960
+ case "image": {
961
+ let e = t.textAlign === "center" ? "margin: 0 auto; display: block;" : t.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;";
962
+ return `<img src="${r.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${r.alt || ""}" style="${n} ${e}" />`;
963
+ }
964
+ case "divider": return `<hr style="border: 0; border-top: ${t.borderWidth || "1px"} ${t.borderStyle || "solid"} ${t.borderColor || "#334155"}; ${n}" />`;
965
+ case "spacer": return `<div style="height: ${t.height || "24px"};"></div>`;
966
+ case "card": return `<div style="${n}">
967
+ <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${r.title || "Card Title"}</h3>
968
+ <p style="margin: 0; color: #94a3b8; font-size: 14px;">${r.description || "Card description."}</p>
969
+ </div>`;
970
+ case "form_container": {
971
+ let e = {
972
+ ...m(),
973
+ ...t
974
+ }, n = {};
975
+ for (let t of Object.keys(e)) _.includes(t) || (n[t] = e[t]);
976
+ let i = p(n), a = Array.isArray(r.fields) ? r.fields : [], o = e.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${v(e)}</div>`).join(""), c = p({
977
+ backgroundColor: e.buttonBackgroundColor,
978
+ color: e.buttonTextColor,
979
+ borderRadius: e.buttonBorderRadius,
980
+ paddingTop: e.buttonPaddingTop,
981
+ paddingBottom: e.buttonPaddingBottom,
982
+ paddingLeft: e.buttonPaddingLeft,
983
+ paddingRight: e.buttonPaddingRight,
984
+ fontSize: e.buttonFontSize,
985
+ fontWeight: e.buttonFontWeight
986
+ });
987
+ return `<form action="${h(r.actionUrl || r.action || "#")}" method="${h(r.method || "POST")}" style="${i}">${s}<button type="submit" style="border: 0; cursor: pointer; ${c}">${r.submitLabel || "Submit"}</button></form>`;
988
+ }
989
+ case "input": {
990
+ let e = r.inputType || r.type || "text", t = h(r.name || r.fieldName || "field"), i = h(r.placeholder || ""), a = r.required ? " required" : "";
991
+ return `<input type="${h(e)}" name="${t}" placeholder="${i}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${n}"${a} />`;
992
+ }
993
+ case "textarea": return `<textarea name="${h(r.name || r.fieldName || "field")}" placeholder="${h(r.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${n}"${r.required ? " required" : ""}></textarea>`;
994
+ case "select": return `<select name="${h(r.name || r.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${n}"${r.required ? " required" : ""}>${(Array.isArray(r.options) ? r.options : []).map((e) => `<option value="${h(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
995
+ case "html": return `<div style="${n}">${r.htmlContent || r.text || ""}</div>`;
996
+ default: return `<!-- Unsupported block ${e.type} -->`;
997
+ }
998
+ }, b = (e) => {
999
+ if (!e || typeof e != "object") return "";
1000
+ let t = f(e);
1001
+ if (!t) return `\n <!-- ROW SKIPPED (type="${typeof e.type == "string" ? e.type : "unknown"}"${e.id ? `, id="${e.id}"` : ""}): this row has no 'columns' array and its shorthand content (e.g. a list of items/links) can't be auto-converted without losing data. Provide a fully hydrated row with 'columns' and 'elements' instead. -->`;
1002
+ let n = p(t.style || {}), r = g("id", t.htmlId), i = g("class", t.htmlClass), a = `\n <!-- ROW START: ${t.id || "row"} -->`;
1003
+ a += `\n <div${r}${i} class="plexo-row" style="display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; ${n}">`;
1004
+ let o = Array.isArray(t.columns) ? t.columns : [];
1005
+ for (let e of o) {
1006
+ if (!e) continue;
1007
+ let t = p(e.styles || e.style || {}), n = g("id", e.attrs?.htmlId), r = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "";
1008
+ a += `\n <!-- COLUMN START: ${e.id || "col"} -->`, a += `\n <div${n} class="plexo-col${r}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; ${t}">`;
1009
+ let i = Array.isArray(e.elements) ? e.elements : [];
1010
+ for (let e of i) {
1011
+ if (!e) continue;
1012
+ let t = e.attributes || {}, n = typeof t.htmlClassNames == "string" ? t.htmlClassNames : typeof t.htmlClass == "string" ? t.htmlClass : typeof t.className == "string" ? t.className : "", r = g("id", t.htmlId), i = g("class", n), o = e.style?.display, s = o === "inline-block" || o === "inline" || o === "inline-flex" ? `margin-bottom: 16px; display: ${o}; vertical-align: top;` : "margin-bottom: 16px;";
1013
+ a += `\n <div${r}${i} style="${s}">`, a += `\n ${y(e)}`, a += "\n </div>";
1014
+ }
1015
+ let o = Array.isArray(e.nestedRows) ? e.nestedRows : [];
1016
+ for (let e of o) a += b(e);
1017
+ a += "\n </div>";
1018
+ }
1019
+ return a += "\n </div>", a;
1020
+ }, x = (e) => {
1021
+ if (!e || typeof e != "object") return "<!-- Empty template -->";
1022
+ let t = e.designJson || e.template || e, n = t.body || (Array.isArray(t.rows) ? {
1023
+ style: t.style || {},
1024
+ rows: t.rows
1025
+ } : {
1026
+ style: {},
1027
+ rows: []
1028
+ }), r = { ...n.style || {} };
1029
+ for (let e of [
1030
+ "backgroundColor",
1031
+ "background",
1032
+ "color",
1033
+ "textColor",
1034
+ "fontFamily",
1035
+ "htmlTitle"
1036
+ ]) r[e] === void 0 && (n[e] === void 0 ? t[e] !== void 0 && (r[e] = t[e]) : r[e] = n[e]);
1037
+ r.backgroundColor && !r.background ? r.background = r.backgroundColor : r.background && !r.backgroundColor && (r.backgroundColor = r.background), r.textColor && !r.color && (r.color = r.textColor);
1038
+ let i = [
1039
+ "htmlTitle",
1040
+ "htmlId",
1041
+ "htmlClass",
1042
+ "customCss",
1043
+ "customJs",
1044
+ "textColor"
1045
+ ], a = {};
1046
+ for (let e of Object.keys(r)) i.includes(e) || (a[e] = r[e]);
1047
+ let o = p(a), s = typeof r.htmlTitle == "string" && r.htmlTitle.trim() ? r.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", c = g("id", r.htmlId), f = g("class", r.htmlClass), m = typeof r.customCss == "string" && r.customCss.trim() ? r.customCss.trim() : "", _ = typeof r.customJs == "string" && r.customJs.trim() ? r.customJs.trim() : "", v = Array.isArray(n.rows) ? n.rows : Array.isArray(t.rows) ? t.rows : Array.isArray(e.rows) ? e.rows : [], y = u(l(v, [r.fontFamily])), x = `<!DOCTYPE html>
1048
+ <html>
1049
+ <head>
1050
+ <meta charset="utf-8">
1051
+ <title>${h(s)}</title>
1052
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1053
+ ${y ? `<link rel="stylesheet" href="${y}">` : ""}
1054
+ <style>
1055
+ body { margin: 0; font-family: ${d}; }
1056
+ .plexo-row {
1057
+ display: flex;
1058
+ flex-wrap: wrap;
1059
+ }
1060
+ @media (max-width: 768px) {
1061
+ .plexo-row {
1062
+ flex-direction: column !important;
1063
+ }
1064
+ .plexo-col {
1065
+ width: 100% !important;
1066
+ max-width: 100% !important;
1067
+ margin-bottom: 16px;
1068
+ }
1069
+ }
1070
+ </style>
1071
+ ${m ? `<style>\n${m}\n </style>` : ""}
1072
+ </head>
1073
+ <body${c}${f} style="${o}">
1074
+ <div style="max-width: 1200px; margin: 0 auto; width: 100%;">`;
1075
+ for (let e of v) x += b(e);
1076
+ return x += `\n </div>
1077
+ ${_ ? ` <script>\n${_}\n <\/script>` : ""}
1078
+ </body>
1079
+ </html>`, x = x.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), x;
1080
+ };
1081
+ function S(e) {
1082
+ return x(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
1083
+ }
1084
+ function C(e) {
1085
+ return x(e);
1086
+ }
1087
+ function w(e) {
1088
+ return e;
1089
+ }
1090
+ //#endregion
1091
+ export { f as a, l as c, a as d, s as f, e as g, t as h, S as i, o as l, i as m, x as n, w as o, r as p, C as r, u as s, d as t, n as u };