@templatical/editor 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/{AiChatSidebar-busJk9hm.js → AiChatSidebar-CjfhTZwo.js} +1 -1
  2. package/dist/{AiFeatureMenu-DLGv_-pj.js → AiFeatureMenu-K44aZa_P.js} +3 -3
  3. package/dist/CloudEditor-DFyuRxUV.js +926 -0
  4. package/dist/{CollaboratorBar-Dv3l52vC.js → CollaboratorBar-BuCEcdbB.js} +25 -21
  5. package/dist/{CommentsSidebar-4tjp0VU5.js → CommentsSidebar-2lcqMfIP.js} +2 -2
  6. package/dist/{DesignReferenceSidebar-CmwXvltV.js → DesignReferenceSidebar-CNMu4Zrx.js} +2 -2
  7. package/dist/{ModuleBrowserModal-lrk3Fr0H.js → ModuleBrowserModal-CvQ0xyQf.js} +6 -6
  8. package/dist/{ModulePreviewCanvas-BcBJLnwL.js → ModulePreviewCanvas-Be2B3Y07.js} +2 -2
  9. package/dist/ParagraphEditor-CcMPnbDr.js +652 -0
  10. package/dist/{RichTextEditorContent-CQqodi7p.js → RichTextEditorContent-CHJlh7HJ.js} +8 -4
  11. package/dist/{SaveModuleDialog-Bmzi72td.js → SaveModuleDialog-BaaeH5Xm.js} +5 -5
  12. package/dist/{SnapshotHistory-AEgi9Xsn.js → SnapshotHistory-BPfjiuu1.js} +2 -2
  13. package/dist/{TemplateScoringPanel-CTgMtc0-.js → TemplateScoringPanel-D58A23Vq.js} +3 -3
  14. package/dist/{TestEmailModal-Dpq1is9S.js → TestEmailModal-DIAlB3e_.js} +3 -3
  15. package/dist/{TitleEditor-CLcDdcWI.js → TitleEditor-D9DPjQkX.js} +7 -7
  16. package/dist/{TplModal-CGzRjR96.js → TplModal-CmTSvCY-.js} +2 -2
  17. package/dist/{blockTypeIcons-BpPTqcok.js → blockTypeIcons-D1RTWOkx.js} +1 -1
  18. package/dist/cdn/chunks/AiChatSidebar-CmPTbTFG.js +2 -0
  19. package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js +59 -0
  20. package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js.map +1 -0
  21. package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js +900 -0
  22. package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js.map +1 -0
  23. package/dist/cdn/chunks/CollaboratorBar-D2PKtlOw.js +51 -0
  24. package/dist/cdn/chunks/CollaboratorBar-D2PKtlOw.js.map +1 -0
  25. package/dist/cdn/chunks/CommentsSidebar-BOelj4Ca.js +2 -0
  26. package/dist/cdn/chunks/DesignReferenceSidebar-Bf6rg0A7.js +2 -0
  27. package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js +195 -0
  28. package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js.map +1 -0
  29. package/dist/cdn/chunks/ModulePreviewCanvas-DEfHampA.js +107 -0
  30. package/dist/cdn/chunks/ModulePreviewCanvas-DEfHampA.js.map +1 -0
  31. package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js +503 -0
  32. package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js.map +1 -0
  33. package/dist/cdn/chunks/RichTextEditorContent-DWUzizsC.js +106 -0
  34. package/dist/cdn/chunks/RichTextEditorContent-DWUzizsC.js.map +1 -0
  35. package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js +119 -0
  36. package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js.map +1 -0
  37. package/dist/cdn/chunks/SnapshotHistory-BFF2SsTN.js +2 -0
  38. package/dist/cdn/chunks/TemplateScoringPanel-gi8wc_m7.js +2 -0
  39. package/dist/cdn/chunks/TestEmailModal-Qtd6aC-6.js +2 -0
  40. package/dist/cdn/chunks/TitleEditor-DDf_OcHS.js +166 -0
  41. package/dist/cdn/chunks/TitleEditor-DDf_OcHS.js.map +1 -0
  42. package/dist/cdn/chunks/_rolldown_dynamic_import_helper-DMEI4TQ3.js +9 -0
  43. package/dist/cdn/chunks/blockTypeIcons-BnobReQm.js +22 -0
  44. package/dist/cdn/chunks/blockTypeIcons-BnobReQm.js.map +1 -0
  45. package/dist/cdn/chunks/de-BB3dgVOc.js +700 -0
  46. package/dist/cdn/chunks/de-BB3dgVOc.js.map +1 -0
  47. package/dist/cdn/chunks/de-BvYD17KT.js +89 -0
  48. package/dist/cdn/chunks/de-BvYD17KT.js.map +1 -0
  49. package/dist/cdn/chunks/dist-B6AUkMyh.js +2 -0
  50. package/dist/cdn/chunks/dist-B878xb_62.js +457 -0
  51. package/dist/cdn/chunks/dist-B878xb_62.js.map +1 -0
  52. package/dist/cdn/chunks/dist-Bf1Op9A1.js +2 -0
  53. package/dist/cdn/chunks/dist-BkETaOfw.js +2 -0
  54. package/dist/cdn/chunks/dist-CJcMnY7o.js +2 -0
  55. package/dist/cdn/chunks/dist-CWsl6S1K.js +2 -0
  56. package/dist/cdn/chunks/dist-CllLxIMQ.js +2 -0
  57. package/dist/cdn/chunks/dist-Cs0wFwdw.js +2 -0
  58. package/dist/cdn/chunks/dist-DLWHlekl.js +2 -0
  59. package/dist/cdn/chunks/dist-DS3_HVpX.js +2 -0
  60. package/dist/cdn/chunks/dist-DTXopj1a.js +2 -0
  61. package/dist/cdn/chunks/dist-DnwLoNLm.js +2 -0
  62. package/dist/cdn/chunks/draggable-BQNU47zu.js +11544 -0
  63. package/dist/cdn/chunks/{draggable-ClUwYCFL.js.map → draggable-BQNU47zu.js.map} +1 -1
  64. package/dist/cdn/chunks/emojiData-BVEJHcNH.js +19 -0
  65. package/dist/cdn/chunks/{emojiData-6fVLNqeH.js.map → emojiData-BVEJHcNH.js.map} +1 -1
  66. package/dist/cdn/chunks/en-CpotcOPr.js +89 -0
  67. package/dist/cdn/chunks/en-CpotcOPr.js.map +1 -0
  68. package/dist/cdn/chunks/en-DeDcpnoS.js +700 -0
  69. package/dist/cdn/chunks/en-DeDcpnoS.js.map +1 -0
  70. package/dist/cdn/chunks/extensions-B_kcV0tK.js +419 -0
  71. package/dist/cdn/chunks/{extensions-ea_ewKUl.js.map → extensions-B_kcV0tK.js.map} +1 -1
  72. package/dist/cdn/chunks/features-ofOGnSC0.js +6700 -0
  73. package/dist/cdn/chunks/features-ofOGnSC0.js.map +1 -0
  74. package/dist/cdn/chunks/icons-bIb7PBOE.js +653 -0
  75. package/dist/cdn/chunks/icons-bIb7PBOE.js.map +1 -0
  76. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js +3272 -0
  77. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +1 -0
  78. package/dist/cdn/chunks/media-library-BIYzV2Y2.js +6005 -0
  79. package/dist/cdn/chunks/media-library-BIYzV2Y2.js.map +1 -0
  80. package/dist/cdn/chunks/pusher-DJPhQnE8.js +2505 -0
  81. package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +1 -0
  82. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js +32 -0
  83. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -0
  84. package/dist/cdn/chunks/rolldown-runtime-DPITmOBR.js +20 -0
  85. package/dist/cdn/chunks/src-BuW9oYtm.js +494 -0
  86. package/dist/cdn/chunks/src-BuW9oYtm.js.map +1 -0
  87. package/dist/cdn/chunks/styleConstants-1KwsBMxJ.js +57 -0
  88. package/dist/cdn/chunks/{styleConstants-CNejCb-L.js.map → styleConstants-1KwsBMxJ.js.map} +1 -1
  89. package/dist/cdn/chunks/styles-DQFExz-T.js +3222 -0
  90. package/dist/cdn/chunks/styles-DQFExz-T.js.map +1 -0
  91. package/dist/cdn/chunks/tiptap-DplY-S-k.js +14208 -0
  92. package/dist/cdn/chunks/{tiptap-Cya4P9CN.js.map → tiptap-DplY-S-k.js.map} +1 -1
  93. package/dist/cdn/editor.css +2 -1
  94. package/dist/cdn/editor.js +260 -1
  95. package/dist/cdn/editor.js.map +1 -1
  96. package/dist/{de-B4Ob4vCo.js → de-D7TLGIPA.js} +20 -4
  97. package/dist/{dist-DmpMJbmZ.js → dist-BkIys9zn.js} +1 -1
  98. package/dist/{en-YXsspZJG.js → en-DvtiEMwP.js} +20 -4
  99. package/dist/{extensions-CKM99njP.js → extensions-DEjfEFhD.js} +3 -3
  100. package/dist/{keys-Dwa2PmdD.js → keys-C0MQRs8d.js} +3 -3
  101. package/dist/readableTextColor-LDlmVEUv.js +30 -0
  102. package/dist/{styles-DSw1VNU3.js → styles-CgLaxDfu.js} +1096 -1074
  103. package/dist/templatical-editor.css +1 -1
  104. package/dist/templatical-editor.js +113 -89
  105. package/dist/templatical-editor.umd.cjs +59 -59
  106. package/dist/{useEditorCore-Cc4RCwWq.js → useEditorCore-CjwRMl7K.js} +1152 -1014
  107. package/dist/{useI18n-DUirdXEX.js → useI18n-D6m7ZUgY.js} +1 -1
  108. package/dist/{useMergeTag-DVnlvPYJ.js → useMergeTag-BZ3X0bNr.js} +1 -1
  109. package/package.json +2 -2
  110. package/dist/CloudEditor-BDnHd6Um.js +0 -919
  111. package/dist/ParagraphEditor-DH8cSC6m.js +0 -625
  112. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +0 -3
  113. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +0 -1
  114. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +0 -2
  115. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +0 -1
  116. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +0 -3
  117. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +0 -1
  118. package/dist/cdn/chunks/dist-0UheN8rK.js +0 -1
  119. package/dist/cdn/chunks/dist-55mmbGQ9.js +0 -1
  120. package/dist/cdn/chunks/dist-B31mxKyP.js +0 -1
  121. package/dist/cdn/chunks/dist-B5JI9nIg.js +0 -1
  122. package/dist/cdn/chunks/dist-B93vLKhU.js +0 -1
  123. package/dist/cdn/chunks/dist-BDt3FJvj.js +0 -1
  124. package/dist/cdn/chunks/dist-BJRuFHmi.js +0 -1
  125. package/dist/cdn/chunks/dist-BKSzrf0L.js +0 -1
  126. package/dist/cdn/chunks/dist-BL8c5gYQ.js +0 -1
  127. package/dist/cdn/chunks/dist-CYThWMP5.js +0 -1
  128. package/dist/cdn/chunks/dist-DxZbPJYt.js +0 -1
  129. package/dist/cdn/chunks/draggable-ClUwYCFL.js +0 -17
  130. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +0 -2
  131. package/dist/cdn/chunks/extensions-ea_ewKUl.js +0 -2
  132. package/dist/cdn/chunks/icons-vmLJTaJk.js +0 -2
  133. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +0 -1
  134. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +0 -1
  135. package/dist/cdn/chunks/styleConstants-CNejCb-L.js +0 -2
  136. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +0 -145
  137. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +0 -2
  138. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +0 -1
  139. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +0 -2
  140. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +0 -1
  141. package/dist/i18n-CJsFtdbZ.js +0 -23
@@ -0,0 +1,3222 @@
1
+ import { a as e } from "./rolldown-runtime-DPITmOBR.js";
2
+ import { $ as t, B as n, E as r, F as i, H as a, I as o, N as s, R as c, S as l, U as u, Z as d, _ as f, at as p, b as m, c as h, ct as g, d as _, g as v, h as y, k as b, l as x, lt as S, m as C, n as w, p as T, s as E, st as D, t as O, u as k, v as A, y as j } from "./draggable-BQNU47zu.js";
3
+ import { $ as M, A as ee, At as N, B as te, Bt as P, Dt as ne, F, Ft as re, G as ie, H as ae, Ht as oe, I as se, It as ce, K as le, Kt as ue, L as de, Lt as fe, M as pe, Mt as me, N as he, Ot as ge, P as _e, R as ve, St as ye, U as be, Ut as xe, V as Se, Vt as Ce, W as we, Z as Te, _n as Ee, _t as De, at as Oe, bt as ke, cn as Ae, dn as je, en as Me, et as Ne, fn as Pe, gt as Fe, hn as Ie, ht as Le, j as Re, kt as ze, ln as Be, lt as Ve, mt as He, pn as Ue, qt as We, rt as Ge, tn as Ke, tt as I, vn as qe, vt as Je, wt as L, xn as Ye, yn as R, yt as Xe, zt as Ze } from "./features-ofOGnSC0.js";
4
+ import { A as Qe, B as $e, F as et, I as tt, M as nt, N as rt, O as it, P as z, T as B, _ as at, a as V, b as ot, c as st, h as ct, m as lt, o as ut, q as dt, s as ft, u as pt, v as mt } from "./icons-bIb7PBOE.js";
5
+ import { t as ht } from "./readableTextColor-Cd_cgWO_.js";
6
+ import { t as gt } from "./blockTypeIcons-BnobReQm.js";
7
+ import { c as _t, d as H, f as U, i as vt, l as yt, m as W, p as G, t as bt } from "./styleConstants-1KwsBMxJ.js";
8
+ //#region src/components/Canvas.vue?vue&type=script&setup=true&lang.ts
9
+ var xt = /* @__PURE__ */ e(O(), 1), St = ["aria-label"], Ct = { class: "tpl:relative" }, wt = {
10
+ class: "tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",
11
+ style: { "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 30%,\n transparent\n )" }
12
+ }, Tt = {
13
+ key: 0,
14
+ class: "tpl-canvas-empty tpl:m-6 tpl:flex tpl:min-h-[400px] tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-xl tpl:border-2 tpl:border-dashed tpl:px-10 tpl:py-12 tpl:text-center tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)]"
15
+ }, Et = { class: "tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]" }, Dt = { class: "tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]" }, Ot = { class: "tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]" }, kt = {
16
+ key: 0,
17
+ class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
18
+ }, At = {
19
+ key: 1,
20
+ class: "tpl:m-0 tpl:mt-4 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
21
+ }, jt = /* @__PURE__ */ M(/* @__PURE__ */ l({
22
+ __name: "Canvas",
23
+ props: {
24
+ viewport: {},
25
+ content: {},
26
+ selectedBlockId: {},
27
+ darkMode: { type: Boolean },
28
+ previewMode: { type: Boolean },
29
+ lockedBlocks: {}
30
+ },
31
+ emits: [
32
+ "select-block",
33
+ "open-ai-chat",
34
+ "open-design-reference"
35
+ ],
36
+ setup(e, { emit: t }) {
37
+ let n = {
38
+ section: se,
39
+ title: de,
40
+ paragraph: Se,
41
+ image: be,
42
+ button: ge,
43
+ divider: ie,
44
+ spacer: pe,
45
+ html: we,
46
+ social: he,
47
+ menu: ae,
48
+ table: Re,
49
+ video: ee,
50
+ countdown: ne,
51
+ custom: le
52
+ }, i = e, o = t, { t: l } = N(), d = Me(oe, "Canvas"), _ = r(Ze, null), b = r(ce, null), x = r(fe, {}), w = T(() => (x.plan?.hasFeature("ai_generation") ?? !1) && (x.ai?.isFeatureEnabled("chat") ?? !1)), E = T(() => (x.plan?.hasFeature("ai_generation") ?? !1) && (x.ai?.isFeatureEnabled("designToTemplate") ?? !1)), O = T({
53
+ get: () => i.content.blocks,
54
+ set: (e) => {
55
+ d.setContent({
56
+ ...i.content,
57
+ blocks: e
58
+ });
59
+ }
60
+ }), k = T(() => {
61
+ switch (i.viewport) {
62
+ case "mobile": return 375;
63
+ case "tablet": return 768;
64
+ default: return i.content.settings.width;
65
+ }
66
+ }), A = T(() => ({
67
+ backgroundColor: i.content.settings.backgroundColor,
68
+ fontFamily: i.content.settings.fontFamily
69
+ }));
70
+ function M(e) {
71
+ i.previewMode || e.target === e.currentTarget && o("select-block", null);
72
+ }
73
+ function P(e) {
74
+ return te(e, b, n);
75
+ }
76
+ function F(e) {
77
+ return i.lockedBlocks?.get(e) ?? null;
78
+ }
79
+ function re(e, t) {
80
+ e.type === "custom" && d.updateBlock(e.id, {
81
+ fieldValues: t.fieldValues,
82
+ dataSourceFetched: t.dataSourceFetched
83
+ });
84
+ }
85
+ return (t, n) => (s(), f("div", {
86
+ "data-testid": "canvas-wrapper",
87
+ role: "region",
88
+ "aria-label": p(l).landmarks.canvas,
89
+ class: "tpl-canvas-wrapper tpl:rounded-lg",
90
+ style: g({
91
+ width: `${k.value}px`,
92
+ backgroundColor: e.content.settings.backgroundColor,
93
+ boxShadow: e.darkMode ? "none" : "var(--tpl-shadow-xl)",
94
+ filter: e.darkMode ? "invert(1) hue-rotate(180deg)" : "none",
95
+ transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 300ms ease"
96
+ })
97
+ }, [C("div", {
98
+ class: D(["tpl-canvas tpl:rounded-lg", {
99
+ "tpl-canvas--dark-mode": e.darkMode,
100
+ "tpl-preview-mode": e.previewMode
101
+ }]),
102
+ style: g(A.value),
103
+ onClick: M
104
+ }, [m(p(xt.default), {
105
+ modelValue: O.value,
106
+ "onUpdate:modelValue": n[2] ||= (e) => O.value = e,
107
+ group: "blocks",
108
+ "item-key": "id",
109
+ animation: 150,
110
+ "ghost-class": "tpl-ghost",
111
+ "drag-class": "tpl-dragging",
112
+ handle: ".tpl-block-btn",
113
+ "invert-swap": !0,
114
+ "inverted-swap-threshold": .65,
115
+ disabled: e.previewMode,
116
+ class: "tpl-canvas-blocks"
117
+ }, {
118
+ item: a(({ element: t }) => [u(C("div", null, [C("div", Ct, [F(t.id) ? (s(), f("div", {
119
+ key: 0,
120
+ class: "tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
121
+ style: g({
122
+ outline: `2px solid ${F(t.id).color}`,
123
+ outlineOffset: "-1px"
124
+ })
125
+ }, [C("span", {
126
+ class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:flex tpl:-translate-x-1/2 tpl:-translate-y-full tpl:items-center tpl:gap-1 tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
127
+ style: g({
128
+ backgroundColor: F(t.id).color,
129
+ color: p(ht)(F(t.id).color)
130
+ })
131
+ }, [C("span", wt, S(F(t.id).name.charAt(0)), 1), j(" " + S(F(t.id).name), 1)], 4)], 4)) : v("", !0), m(ve, {
132
+ block: t,
133
+ "is-selected": !e.previewMode && e.selectedBlockId === t.id && !F(t.id),
134
+ viewport: e.viewport,
135
+ "preview-mode": e.previewMode,
136
+ onSelect: (n) => e.previewMode || F(t.id) ? void 0 : o("select-block", t.id)
137
+ }, {
138
+ default: a(() => [(s(), y(c(P(t)), {
139
+ block: t,
140
+ viewport: e.viewport,
141
+ onFetchData: (e) => re(t, e),
142
+ onUpdate: (e) => p(d).updateBlock(t.id, e)
143
+ }, null, 40, [
144
+ "block",
145
+ "viewport",
146
+ "onFetchData",
147
+ "onUpdate"
148
+ ]))]),
149
+ _: 2
150
+ }, 1032, [
151
+ "block",
152
+ "is-selected",
153
+ "viewport",
154
+ "preview-mode",
155
+ "onSelect"
156
+ ])])], 512), [[h, !p(_)?.isHidden(t.id)]])]),
157
+ footer: a(() => [O.value.length === 0 && !e.previewMode ? (s(), f("div", Tt, [
158
+ C("div", Et, [m(p(ct), {
159
+ size: 48,
160
+ "stroke-width": 1
161
+ })]),
162
+ C("p", Dt, S(p(l).canvas.noBlocks), 1),
163
+ C("p", Ot, S(p(l).canvas.dragHint), 1),
164
+ w.value ? (s(), f("p", kt, [
165
+ j(S(p(l).canvas.aiHintChat) + " ", 1),
166
+ C("button", {
167
+ class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
168
+ onClick: n[0] ||= (e) => o("open-ai-chat")
169
+ }, [m(p(Oe), {
170
+ size: 14,
171
+ "stroke-width": 2
172
+ }), j(" " + S(p(l).aiMenu.aiAssistant), 1)]),
173
+ j(" " + S(p(l).canvas.aiHintChatSuffix), 1)
174
+ ])) : v("", !0),
175
+ E.value ? (s(), f("p", At, [
176
+ j(S(p(l).canvas.aiHintDesign) + " ", 1),
177
+ C("button", {
178
+ class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
179
+ onClick: n[1] ||= (e) => o("open-design-reference")
180
+ }, [m(p(Fe), {
181
+ size: 14,
182
+ "stroke-width": 2
183
+ }), j(" " + S(p(l).aiMenu.designToTemplate), 1)]),
184
+ j(" " + S(p(l).canvas.aiHintDesignSuffix), 1)
185
+ ])) : v("", !0)
186
+ ])) : v("", !0)]),
187
+ _: 1
188
+ }, 8, ["modelValue", "disabled"])], 6)], 12, St));
189
+ }
190
+ }), [["__scopeId", "data-v-43f4b3a0"]]), Mt = ["aria-label"], Nt = {
191
+ key: 0,
192
+ class: "tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]"
193
+ }, Pt = ["aria-label"], Ft = {
194
+ key: 0,
195
+ class: "tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium"
196
+ }, It = {
197
+ key: 1,
198
+ class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]"
199
+ }, Lt = [
200
+ "data-palette-type",
201
+ "aria-label",
202
+ "onClick",
203
+ "onKeydown"
204
+ ], Rt = { class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:scale-105" }, zt = {
205
+ key: 0,
206
+ class: "tpl:truncate tpl:text-sm tpl:font-medium"
207
+ }, Bt = /* @__PURE__ */ l({
208
+ __name: "Sidebar",
209
+ setup(e) {
210
+ let { t: n, format: i } = N(), o = r(P, []), l = r(re, void 0), u = r(oe, null), d = r(fe, {}), h = T(() => (d.savedModules?.moduleCount.value ?? 0) > 0), _ = t(!1), b = [
211
+ "section",
212
+ "image",
213
+ "title",
214
+ "paragraph",
215
+ "button",
216
+ "divider",
217
+ "video",
218
+ "social",
219
+ "menu",
220
+ "table",
221
+ "spacer",
222
+ "html"
223
+ ], x = T(() => {
224
+ let e = b.map((e) => ({
225
+ type: e,
226
+ label: ze(e, n)
227
+ }));
228
+ return d.plan && e.splice(-1, 0, {
229
+ type: "countdown",
230
+ label: ze("countdown", n)
231
+ }), e;
232
+ }), w = T(() => o.map((e) => ({
233
+ type: `custom:${e.type}`,
234
+ label: e.name,
235
+ isCustom: !0,
236
+ icon: e.icon
237
+ }))), E = T(() => [...x.value, ...w.value]);
238
+ function D(e) {
239
+ if (e.isCustom) {
240
+ let t = e.type.replace("custom:", ""), n = o.find((e) => e.type === t);
241
+ if (n) return qe(n);
242
+ }
243
+ return Ee(e.type, l);
244
+ }
245
+ function O(e) {
246
+ if (!u) return;
247
+ let t = D(e);
248
+ u.addBlock(t), u.selectBlock(t.id);
249
+ }
250
+ function k(e, t) {
251
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), O(t));
252
+ }
253
+ return (e, t) => (s(), f("aside", {
254
+ "aria-label": p(n).sidebarNav.palette,
255
+ class: "tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:overflow-hidden",
256
+ style: g({
257
+ width: _.value ? "200px" : "48px",
258
+ backgroundColor: "var(--tpl-bg-elevated)",
259
+ borderRight: "1px solid var(--tpl-border)",
260
+ boxShadow: _.value ? "var(--tpl-shadow-lg)" : "none",
261
+ transition: "width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"
262
+ }),
263
+ onMouseenter: t[1] ||= (e) => _.value = !0,
264
+ onMouseleave: t[2] ||= (e) => _.value = !1,
265
+ onFocusin: t[3] ||= (e) => _.value = !0,
266
+ onFocusout: t[4] ||= (e) => _.value = !1
267
+ }, [h.value ? (s(), f("div", Nt, [C("button", {
268
+ type: "button",
269
+ "aria-label": p(n).sidebarNav.browseModules,
270
+ class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)]",
271
+ style: g({ justifyContent: _.value ? "flex-start" : "center" }),
272
+ onClick: t[0] ||= (e) => p(d).savedModules?.openBrowser()
273
+ }, [
274
+ m(p(Qe), {
275
+ size: 20,
276
+ "stroke-width": 1.5,
277
+ class: "tpl:shrink-0"
278
+ }),
279
+ _.value ? (s(), f("span", Ft, S(p(n).modules.title), 1)) : v("", !0),
280
+ _.value ? (s(), f("span", It, S(p(d).savedModules?.moduleCount.value ?? 0), 1)) : v("", !0)
281
+ ], 12, Pt)])) : v("", !0), m(p(xt.default), {
282
+ list: E.value,
283
+ group: {
284
+ name: "blocks",
285
+ pull: "clone",
286
+ put: !1
287
+ },
288
+ clone: D,
289
+ sort: !1,
290
+ "item-key": "type",
291
+ animation: 150,
292
+ "ghost-class": "tpl-ghost",
293
+ class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:p-1"
294
+ }, {
295
+ item: a(({ element: e }) => [C("button", {
296
+ type: "button",
297
+ "data-palette-type": e.type,
298
+ "aria-label": p(i)(p(n).sidebarNav.insertBlock, { block: e.label }),
299
+ class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-grab tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] active:tpl:cursor-grabbing",
300
+ style: g({ justifyContent: _.value ? "flex-start" : "center" }),
301
+ onClick: (t) => O(e),
302
+ onKeydown: (t) => k(t, e)
303
+ }, [C("div", Rt, [p(gt)[e.type] ? (s(), y(c(p(gt)[e.type]), {
304
+ key: 0,
305
+ size: 20,
306
+ "stroke-width": 1.5
307
+ })) : e.isCustom ? (s(), y(Ne, {
308
+ key: 1,
309
+ icon: e.icon,
310
+ size: 20
311
+ }, null, 8, ["icon"])) : v("", !0)]), _.value ? (s(), f("span", zt, S(e.label), 1)) : v("", !0)], 44, Lt)]),
312
+ _: 1
313
+ }, 8, ["list"])], 44, Mt));
314
+ }
315
+ }), K = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, q = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
316
+ 360 / (Math.PI * 2);
317
+ var Vt = (e) => Yt(Ht(e)), Ht = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
318
+ r: parseInt(e[0] + e[0], 16),
319
+ g: parseInt(e[1] + e[1], 16),
320
+ b: parseInt(e[2] + e[2], 16),
321
+ a: e.length === 4 ? q(parseInt(e[3] + e[3], 16) / 255, 2) : 1
322
+ } : {
323
+ r: parseInt(e.substring(0, 2), 16),
324
+ g: parseInt(e.substring(2, 4), 16),
325
+ b: parseInt(e.substring(4, 6), 16),
326
+ a: e.length === 8 ? q(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
327
+ }), Ut = (e) => Jt(Kt(e)), Wt = ({ h: e, s: t, v: n, a: r }) => {
328
+ let i = (200 - t) * n / 100;
329
+ return {
330
+ h: q(e),
331
+ s: q(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
332
+ l: q(i / 2),
333
+ a: q(r, 2)
334
+ };
335
+ }, Gt = (e) => {
336
+ let { h: t, s: n, l: r } = Wt(e);
337
+ return `hsl(${t}, ${n}%, ${r}%)`;
338
+ }, Kt = ({ h: e, s: t, v: n, a: r }) => {
339
+ e = e / 360 * 6, t /= 100, n /= 100;
340
+ let i = Math.floor(e), a = n * (1 - t), o = n * (1 - (e - i) * t), s = n * (1 - (1 - e + i) * t), c = i % 6;
341
+ return {
342
+ r: q([
343
+ n,
344
+ o,
345
+ a,
346
+ a,
347
+ s,
348
+ n
349
+ ][c] * 255),
350
+ g: q([
351
+ s,
352
+ n,
353
+ n,
354
+ o,
355
+ a,
356
+ a
357
+ ][c] * 255),
358
+ b: q([
359
+ a,
360
+ a,
361
+ s,
362
+ n,
363
+ n,
364
+ o
365
+ ][c] * 255),
366
+ a: q(r, 2)
367
+ };
368
+ }, qt = (e) => {
369
+ let t = e.toString(16);
370
+ return t.length < 2 ? "0" + t : t;
371
+ }, Jt = ({ r: e, g: t, b: n, a: r }) => {
372
+ let i = r < 1 ? qt(q(r * 255)) : "";
373
+ return "#" + qt(e) + qt(t) + qt(n) + i;
374
+ }, Yt = ({ r: e, g: t, b: n, a: r }) => {
375
+ let i = Math.max(e, t, n), a = i - Math.min(e, t, n), o = a ? i === e ? (t - n) / a : i === t ? 2 + (n - e) / a : 4 + (e - t) / a : 0;
376
+ return {
377
+ h: q(60 * (o < 0 ? o + 6 : o)),
378
+ s: q(i ? a / i * 100 : 0),
379
+ v: q(i / 255 * 100),
380
+ a: r
381
+ };
382
+ }, Xt = (e, t) => {
383
+ if (e === t) return !0;
384
+ for (let n in e) if (e[n] !== t[n]) return !1;
385
+ return !0;
386
+ }, Zt = (e, t) => e.toLowerCase() === t.toLowerCase() ? !0 : Xt(Ht(e), Ht(t)), Qt = {}, $t = (e) => {
387
+ let t = Qt[e];
388
+ return t || (t = document.createElement("template"), t.innerHTML = e, Qt[e] = t), t;
389
+ }, en = (e, t, n) => {
390
+ e.dispatchEvent(new CustomEvent(t, {
391
+ bubbles: !0,
392
+ detail: n
393
+ }));
394
+ }, J = !1, tn = (e) => "touches" in e, nn = (e) => J && !tn(e) ? !1 : (J ||= tn(e), !0), rn = (e, t) => {
395
+ let n = tn(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
396
+ en(e.el, "move", e.getMove({
397
+ x: K((n.pageX - (r.left + window.pageXOffset)) / r.width),
398
+ y: K((n.pageY - (r.top + window.pageYOffset)) / r.height)
399
+ }));
400
+ }, an = (e, t) => {
401
+ let n = t.keyCode;
402
+ n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), en(e.el, "move", e.getMove({
403
+ x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
404
+ y: n === 40 ? .01 : n === 38 ? -.01 : 0
405
+ }, !0)));
406
+ }, on = class {
407
+ constructor(e, t, n, r) {
408
+ let i = $t(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
409
+ e.appendChild(i.content.cloneNode(!0));
410
+ let a = e.querySelector(`[part=${t}]`);
411
+ a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
412
+ }
413
+ set dragging(e) {
414
+ let t = e ? document.addEventListener : document.removeEventListener;
415
+ t(J ? "touchmove" : "mousemove", this), t(J ? "touchend" : "mouseup", this);
416
+ }
417
+ handleEvent(e) {
418
+ switch (e.type) {
419
+ case "mousedown":
420
+ case "touchstart":
421
+ if (e.preventDefault(), !nn(e) || !J && e.button != 0) return;
422
+ this.el.focus(), rn(this, e), this.dragging = !0;
423
+ break;
424
+ case "mousemove":
425
+ case "touchmove":
426
+ e.preventDefault(), rn(this, e);
427
+ break;
428
+ case "mouseup":
429
+ case "touchend":
430
+ this.dragging = !1;
431
+ break;
432
+ case "keydown":
433
+ an(this, e);
434
+ break;
435
+ }
436
+ }
437
+ style(e) {
438
+ e.forEach((e, t) => {
439
+ for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
440
+ });
441
+ }
442
+ }, sn = class extends on {
443
+ constructor(e) {
444
+ super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
445
+ }
446
+ update({ h: e }) {
447
+ this.h = e, this.style([{
448
+ left: `${e / 360 * 100}%`,
449
+ color: Gt({
450
+ h: e,
451
+ s: 100,
452
+ v: 100,
453
+ a: 1
454
+ })
455
+ }]), this.el.setAttribute("aria-valuenow", `${q(e)}`);
456
+ }
457
+ getMove(e, t) {
458
+ return { h: t ? K(this.h + e.x * 360, 0, 360) : 360 * e.x };
459
+ }
460
+ }, cn = class extends on {
461
+ constructor(e) {
462
+ super(e, "saturation", "aria-label=\"Color\"", !0);
463
+ }
464
+ update(e) {
465
+ this.hsva = e, this.style([{
466
+ top: `${100 - e.v}%`,
467
+ left: `${e.s}%`,
468
+ color: Gt(e)
469
+ }, { "background-color": Gt({
470
+ h: e.h,
471
+ s: 100,
472
+ v: 100,
473
+ a: 1
474
+ }) }]), this.el.setAttribute("aria-valuetext", `Saturation ${q(e.s)}%, Brightness ${q(e.v)}%`);
475
+ }
476
+ getMove(e, t) {
477
+ return {
478
+ s: t ? K(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
479
+ v: t ? K(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
480
+ };
481
+ }
482
+ }, ln = ":host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}", un = "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", dn = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", fn = Symbol("same"), pn = Symbol("color"), mn = Symbol("hsva"), hn = Symbol("update"), gn = Symbol("parts"), _n = Symbol("css"), vn = Symbol("sliders"), yn = class extends HTMLElement {
483
+ static get observedAttributes() {
484
+ return ["color"];
485
+ }
486
+ get [_n]() {
487
+ return [
488
+ ln,
489
+ un,
490
+ dn
491
+ ];
492
+ }
493
+ get [vn]() {
494
+ return [cn, sn];
495
+ }
496
+ get color() {
497
+ return this[pn];
498
+ }
499
+ set color(e) {
500
+ if (!this[fn](e)) {
501
+ let t = this.colorModel.toHsva(e);
502
+ this[hn](t), this[pn] = e;
503
+ }
504
+ }
505
+ constructor() {
506
+ super();
507
+ let e = $t(`<style>${this[_n].join("")}</style>`), t = this.attachShadow({ mode: "open" });
508
+ t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[gn] = this[vn].map((e) => new e(t));
509
+ }
510
+ connectedCallback() {
511
+ if (this.hasOwnProperty("color")) {
512
+ let e = this.color;
513
+ delete this.color, this.color = e;
514
+ } else this.color ||= this.colorModel.defaultColor;
515
+ }
516
+ attributeChangedCallback(e, t, n) {
517
+ let r = this.colorModel.fromAttr(n);
518
+ this[fn](r) || (this.color = r);
519
+ }
520
+ handleEvent(e) {
521
+ let t = this[mn], n = {
522
+ ...t,
523
+ ...e.detail
524
+ };
525
+ this[hn](n);
526
+ let r;
527
+ !Xt(n, t) && !this[fn](r = this.colorModel.fromHsva(n)) && (this[pn] = r, en(this, "color-changed", { value: r }));
528
+ }
529
+ [fn](e) {
530
+ return this.color && this.colorModel.equal(e, this.color);
531
+ }
532
+ [hn](e) {
533
+ this[mn] = e, this[gn].forEach((t) => t.update(e));
534
+ }
535
+ }, bn = {
536
+ defaultColor: "#000",
537
+ toHsva: Vt,
538
+ fromHsva: ({ h: e, s: t, v: n }) => Ut({
539
+ h: e,
540
+ s: t,
541
+ v: n,
542
+ a: 1
543
+ }),
544
+ equal: Zt,
545
+ fromAttr: (e) => e
546
+ }, xn = class extends yn {
547
+ get colorModel() {
548
+ return bn;
549
+ }
550
+ };
551
+ customElements.define("hex-color-picker", class extends xn {});
552
+ //#endregion
553
+ //#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
554
+ var Sn = [
555
+ "disabled",
556
+ "aria-label",
557
+ "aria-expanded"
558
+ ], Cn = [
559
+ "value",
560
+ "placeholder",
561
+ "disabled",
562
+ "aria-label"
563
+ ], wn = ["color", "aria-label"], Y = /* @__PURE__ */ l({
564
+ __name: "ColorPicker",
565
+ props: {
566
+ modelValue: {},
567
+ placeholder: { default: vt },
568
+ size: { default: "default" },
569
+ swatchOnly: {
570
+ type: Boolean,
571
+ default: !1
572
+ },
573
+ disabled: {
574
+ type: Boolean,
575
+ default: !1
576
+ }
577
+ },
578
+ emits: ["update:modelValue"],
579
+ setup(e, { emit: n }) {
580
+ let r = e, i = n, { t: o } = N(), c = t(!1), l = t(), u = t();
581
+ Ke(l, () => {
582
+ c.value = !1;
583
+ }, { ignore: [u] });
584
+ let d = T({
585
+ get: () => r.modelValue || "#000000",
586
+ set: (e) => i("update:modelValue", e)
587
+ });
588
+ function h(e) {
589
+ d.value = e.detail.value;
590
+ }
591
+ function _(e) {
592
+ d.value = e.target.value;
593
+ }
594
+ return (t, n) => (s(), f("div", { class: D(["tpl:flex tpl:gap-2 tpl:relative", e.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
595
+ C("button", {
596
+ ref_key: "swatchRef",
597
+ ref: u,
598
+ type: "button",
599
+ disabled: e.disabled,
600
+ "aria-label": p(o).colorPicker.pickColor,
601
+ "aria-expanded": c.value,
602
+ class: D([
603
+ "tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
604
+ e.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
605
+ c.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !e.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
606
+ e.size === "large" ? "tpl:size-12" : "tpl:size-10"
607
+ ]),
608
+ onClick: n[0] ||= (t) => !e.disabled && (c.value = !c.value)
609
+ }, [C("span", {
610
+ class: "tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]",
611
+ style: g({ backgroundColor: d.value })
612
+ }, null, 4)], 10, Sn),
613
+ e.swatchOnly ? v("", !0) : (s(), f("input", {
614
+ key: 0,
615
+ type: "text",
616
+ class: D(p(yt)),
617
+ value: e.modelValue,
618
+ placeholder: e.placeholder,
619
+ disabled: e.disabled,
620
+ "aria-label": p(o).colorPicker.hexValue,
621
+ onInput: _
622
+ }, null, 42, Cn)),
623
+ m(w, {
624
+ "enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
625
+ "enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
626
+ "enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
627
+ "leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
628
+ "leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
629
+ "leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
630
+ }, {
631
+ default: a(() => [c.value ? (s(), f("div", {
632
+ key: 0,
633
+ ref_key: "popoverRef",
634
+ ref: l,
635
+ class: "tpl:absolute tpl:left-0 tpl:top-full tpl:z-50 tpl:mt-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg"
636
+ }, [C("hex-color-picker", {
637
+ color: d.value,
638
+ "aria-label": p(o).colorPicker.pickColor,
639
+ onColorChanged: h,
640
+ onKeydown: n[1] ||= x((e) => c.value = !1, ["escape"])
641
+ }, null, 40, wn)], 512)) : v("", !0)]),
642
+ _: 1
643
+ })
644
+ ], 2));
645
+ }
646
+ });
647
+ //#endregion
648
+ //#region src/composables/useMergeTagField.ts
649
+ function Tn(e) {
650
+ let { modelValue: n, emit: r, elementRef: i } = e, { isEnabled: a, isRequesting: o, isMergeTagValue: s, getMergeTagLabel: c, requestMergeTag: l, syntax: u } = Te(), d = t(!1), f = !1, p = T(() => {
651
+ let e = n();
652
+ if (!e) return [];
653
+ let t = [], r = `(${u.value.source}|${u.logic.source})`, i = new RegExp(r, "g"), a = 0, o;
654
+ for (; (o = i.exec(e)) !== null;) {
655
+ o.index > a && t.push({
656
+ type: "text",
657
+ value: e.slice(a, o.index)
658
+ });
659
+ let n = o[0];
660
+ s(n) ? t.push({
661
+ type: "mergeTag",
662
+ value: n,
663
+ label: c(n)
664
+ }) : Ie(n, u) ? t.push({
665
+ type: "logicMergeTag",
666
+ value: n,
667
+ keyword: Ue(n, u)
668
+ }) : t.push({
669
+ type: "text",
670
+ value: n
671
+ }), a = o.index + n.length;
672
+ }
673
+ return a < e.length && t.push({
674
+ type: "text",
675
+ value: e.slice(a)
676
+ }), t;
677
+ }), m = T(() => p.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
678
+ function h() {
679
+ d.value = !0, b(() => {
680
+ i.value?.focus();
681
+ let e = n()?.length || 0;
682
+ i.value?.setSelectionRange(e, e);
683
+ });
684
+ }
685
+ function g() {
686
+ f || (d.value = !1);
687
+ }
688
+ function _(e) {
689
+ r(e.target.value);
690
+ }
691
+ function v() {
692
+ r("");
693
+ }
694
+ async function y() {
695
+ let e = d.value && i.value ? i.value.selectionStart ?? n().length : n().length;
696
+ f = !0;
697
+ let t = await l();
698
+ if (f = !1, t) {
699
+ let a = n().slice(0, e), o = n().slice(e);
700
+ r(a + t.value + o), d.value = !0, b(() => {
701
+ let n = e + t.value.length;
702
+ i.value?.focus(), i.value?.setSelectionRange(n, n);
703
+ });
704
+ }
705
+ }
706
+ return {
707
+ segments: p,
708
+ hasMergeTags: m,
709
+ mergeTagEnabled: a,
710
+ isRequestingMergeTag: o,
711
+ isEditing: d,
712
+ startEditing: h,
713
+ stopEditing: g,
714
+ handleInput: _,
715
+ clearValue: v,
716
+ insertMergeTag: y
717
+ };
718
+ }
719
+ //#endregion
720
+ //#region src/components/MergeTagTextarea.vue?vue&type=script&setup=true&lang.ts
721
+ var En = { key: 0 }, Dn = ["aria-label"], On = ["data-tooltip"], kn = ["data-tooltip"], An = {
722
+ key: 2,
723
+ class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
724
+ }, jn = ["aria-label", "title"], Mn = [
725
+ "aria-label",
726
+ "title",
727
+ "disabled"
728
+ ], Nn = { key: 1 }, Pn = [
729
+ "value",
730
+ "placeholder",
731
+ "rows"
732
+ ], Fn = [
733
+ "aria-label",
734
+ "title",
735
+ "disabled"
736
+ ], In = "tpl:w-full tpl:resize-y tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]", Ln = "tpl:flex tpl:w-full tpl:min-h-[5rem] tpl:cursor-pointer tpl:items-start tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", Rn = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]", zn = /* @__PURE__ */ l({
737
+ __name: "MergeTagTextarea",
738
+ props: {
739
+ modelValue: {},
740
+ placeholder: { default: "" },
741
+ rows: { default: 3 }
742
+ },
743
+ emits: ["update:modelValue"],
744
+ setup(e, { emit: n }) {
745
+ let r = e, a = n, { t: o } = N(), c = t(null), { segments: l, hasMergeTags: u, mergeTagEnabled: d, isRequestingMergeTag: h, isEditing: g, startEditing: y, stopEditing: b, handleInput: w, clearValue: T, insertMergeTag: E } = Tn({
746
+ modelValue: () => r.modelValue,
747
+ emit: (e) => a("update:modelValue", e),
748
+ elementRef: c
749
+ });
750
+ return (t, n) => p(u) && !p(g) ? (s(), f("div", En, [C("div", {
751
+ role: "button",
752
+ tabindex: "0",
753
+ "aria-label": p(o).mergeTag.clickToEdit,
754
+ class: D(Ln),
755
+ onClick: n[1] ||= (...e) => p(y) && p(y)(...e),
756
+ onKeydown: [n[2] ||= x((...e) => p(y) && p(y)(...e), ["enter"]), n[3] ||= x(k((...e) => p(y) && p(y)(...e), ["prevent"]), ["space"])]
757
+ }, [(s(!0), f(_, null, i(p(l), (e, t) => (s(), f(_, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (s(), f("span", {
758
+ key: 0,
759
+ class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium",
760
+ "data-tooltip": e.value,
761
+ style: {
762
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
763
+ color: "var(--tpl-primary)"
764
+ }
765
+ }, S(e.label), 9, On)) : e.type === "logicMergeTag" ? (s(), f("span", {
766
+ key: 1,
767
+ class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase",
768
+ "data-tooltip": e.value,
769
+ style: {
770
+ "background-color": "transparent",
771
+ border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
772
+ color: "var(--tpl-primary)"
773
+ }
774
+ }, S(e.keyword), 9, kn)) : (s(), f("span", An, S(e.value), 1))], 64))), 128)), C("button", {
775
+ type: "button",
776
+ class: "tpl:ml-auto tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100",
777
+ "aria-label": p(o).mergeTag.remove,
778
+ title: p(o).mergeTag.remove,
779
+ onClick: n[0] ||= k((...e) => p(T) && p(T)(...e), ["stop"])
780
+ }, [m(p(I), {
781
+ size: 12,
782
+ "stroke-width": 2.5
783
+ })], 8, jn)], 40, Dn), p(d) ? (s(), f("button", {
784
+ key: 0,
785
+ type: "button",
786
+ class: D([Rn, "tpl:mt-1.5"]),
787
+ "aria-label": p(o).mergeTag.insert,
788
+ title: p(o).mergeTag.insert,
789
+ disabled: p(h),
790
+ onClick: n[4] ||= (...e) => p(E) && p(E)(...e)
791
+ }, [m(p(ot), {
792
+ size: 12,
793
+ "stroke-width": 2
794
+ }), j(" " + S(p(o).mergeTag.insert), 1)], 8, Mn)) : v("", !0)])) : (s(), f("div", Nn, [C("textarea", {
795
+ ref_key: "textareaRef",
796
+ ref: c,
797
+ class: D(In),
798
+ value: e.modelValue,
799
+ placeholder: e.placeholder,
800
+ rows: e.rows,
801
+ onInput: n[5] ||= (...e) => p(w) && p(w)(...e),
802
+ onBlur: n[6] ||= (...e) => p(b) && p(b)(...e),
803
+ onKeydown: n[7] ||= x((...e) => p(b) && p(b)(...e), ["escape"])
804
+ }, null, 40, Pn), p(d) ? (s(), f("button", {
805
+ key: 0,
806
+ type: "button",
807
+ class: D([Rn, "tpl:mt-1.5"]),
808
+ "aria-label": p(o).mergeTag.insert,
809
+ title: p(o).mergeTag.insert,
810
+ disabled: p(h),
811
+ onClick: n[8] ||= (...e) => p(E) && p(E)(...e)
812
+ }, [m(p(ot), {
813
+ size: 12,
814
+ "stroke-width": 2
815
+ }), j(" " + S(p(o).mergeTag.insert), 1)], 8, Fn)) : v("", !0)]));
816
+ }
817
+ }), Bn = { class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]" }, Vn = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4" }, Hn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Un = { class: "tpl:mb-3.5" }, Wn = { class: "tpl:grid tpl:grid-cols-4 tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]" }, Gn = ["onClick"], Kn = { class: "tpl:flex tpl:items-stretch" }, qn = ["value"], Jn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Yn = { class: "tpl:mb-3.5" }, Xn = ["value"], Zn = ["value"], Qn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, $n = { class: "tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, er = { class: "tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, tr = { class: "tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]" }, nr = { class: "tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3" }, rr = { class: "tpl:mb-2.5 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text-muted)]" }, ir = { class: "tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, ar = { class: "tpl:mb-1 tpl:last:mb-0" }, or = { class: "tpl:mb-1 tpl:last:mb-0" }, sr = { class: "tpl:mb-1 tpl:last:mb-0" }, cr = 150, lr = /* @__PURE__ */ l({
818
+ __name: "TemplateSettings",
819
+ props: { settings: {} },
820
+ emits: ["update"],
821
+ setup(e, { emit: t }) {
822
+ let n = e, r = t, { t: a } = N(), o = Me(xe, "TemplateSettings"), c = T(() => o.fonts.value), l = T(() => c.value.some((e) => e.value === n.settings.fontFamily) ? n.settings.fontFamily : o.defaultFont.value), u = [
823
+ {
824
+ value: 480,
825
+ label: "480px"
826
+ },
827
+ {
828
+ value: 600,
829
+ label: "600px"
830
+ },
831
+ {
832
+ value: 700,
833
+ label: "700px"
834
+ },
835
+ {
836
+ value: 800,
837
+ label: "800px"
838
+ }
839
+ ];
840
+ return (t, n) => (s(), f("aside", Bn, [C("div", Vn, [
841
+ C("div", { class: D(p(_t)) }, [
842
+ C("div", Hn, [m(p(lt), {
843
+ class: "tpl:text-[var(--tpl-text-muted)]",
844
+ size: 14,
845
+ "stroke-width": 2
846
+ }), C("span", null, S(p(a).templateSettings.layout), 1)]),
847
+ C("div", Un, [C("label", { class: D(p(W)) }, S(p(a).templateSettings.widthPreset), 3), C("div", Wn, [(s(), f(_, null, i(u, (t) => C("button", {
848
+ key: t.value,
849
+ class: "tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
850
+ style: g({
851
+ backgroundColor: e.settings.width === t.value ? "var(--tpl-bg)" : "transparent",
852
+ color: e.settings.width === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
853
+ boxShadow: e.settings.width === t.value ? "var(--tpl-shadow)" : "none"
854
+ }),
855
+ onClick: (e) => r("update", { width: t.value })
856
+ }, S(t.label), 13, Gn)), 64))])]),
857
+ C("div", null, [C("label", { class: D(p(W)) }, S(p(a).templateSettings.customWidth), 3), C("div", Kn, [C("input", {
858
+ type: "number",
859
+ class: D(p(U)),
860
+ value: e.settings.width,
861
+ min: "300",
862
+ max: "900",
863
+ onInput: n[0] ||= (e) => r("update", { width: Number(e.target.value) })
864
+ }, null, 42, qn), C("span", { class: D(p(G)) }, "px", 2)])])
865
+ ], 2),
866
+ C("div", { class: D(p(_t)) }, [
867
+ C("div", Jn, [m(p(dt), {
868
+ class: "tpl:text-[var(--tpl-text-muted)]",
869
+ size: 14,
870
+ "stroke-width": 2
871
+ }), C("span", null, S(p(a).templateSettings.appearance), 1)]),
872
+ C("div", Yn, [C("label", { class: D(p(W)) }, S(p(a).templateSettings.backgroundColor), 3), m(Y, {
873
+ "model-value": e.settings.backgroundColor,
874
+ placeholder: p(bt),
875
+ "onUpdate:modelValue": n[1] ||= (e) => r("update", { backgroundColor: e })
876
+ }, null, 8, ["model-value", "placeholder"])]),
877
+ C("div", null, [C("label", { class: D(p(W)) }, S(p(a).templateSettings.fontFamily), 3), C("select", {
878
+ class: D(p(H)),
879
+ value: l.value,
880
+ onChange: n[2] ||= (e) => r("update", { fontFamily: e.target.value })
881
+ }, [(s(!0), f(_, null, i(c.value, (e) => (s(), f("option", {
882
+ key: e.value,
883
+ value: e.value
884
+ }, S(e.label), 9, Zn))), 128))], 42, Xn)])
885
+ ], 2),
886
+ C("div", { class: D(p(_t)) }, [C("div", Qn, [m(p(De), {
887
+ class: "tpl:text-[var(--tpl-text-muted)]",
888
+ size: 14,
889
+ "stroke-width": 2
890
+ }), C("span", null, S(p(a).templateSettings.preheaderText), 1)]), C("div", null, [m(zn, {
891
+ "model-value": e.settings.preheaderText ?? "",
892
+ placeholder: p(a).templateSettings.preheaderTextPlaceholder,
893
+ rows: 2,
894
+ "onUpdate:modelValue": n[3] ||= (e) => r("update", { preheaderText: e.replace(/[\r\n]/g, " ") || void 0 })
895
+ }, null, 8, ["model-value", "placeholder"]), C("div", $n, [C("span", er, S(p(a).templateSettings.preheaderTextHint), 1), C("span", tr, S((e.settings.preheaderText ?? "").length) + "/" + S(cr), 1)])])], 2),
896
+ C("div", nr, [C("div", rr, [m(p(He), {
897
+ size: 14,
898
+ "stroke-width": 2
899
+ }), C("span", null, S(p(a).templateSettings.tips), 1)]), C("ul", ir, [
900
+ C("li", ar, S(p(a).templateSettings.tip1), 1),
901
+ C("li", or, S(p(a).templateSettings.tip2), 1),
902
+ C("li", sr, S(p(a).templateSettings.tip3), 1)
903
+ ])])
904
+ ])]));
905
+ }
906
+ }), ur = { key: 0 }, dr = ["aria-label"], fr = ["data-tooltip"], pr = ["data-tooltip"], mr = {
907
+ key: 2,
908
+ class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
909
+ }, hr = ["aria-label", "title"], gr = [
910
+ "aria-label",
911
+ "title",
912
+ "disabled"
913
+ ], _r = { key: 1 }, vr = [
914
+ "type",
915
+ "value",
916
+ "placeholder"
917
+ ], yr = [
918
+ "aria-label",
919
+ "title",
920
+ "disabled"
921
+ ], br = "tpl:flex tpl:w-full tpl:min-h-10 tpl:cursor-pointer tpl:items-center tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3.5 tpl:py-1.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", xr = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]", X = /* @__PURE__ */ M(/* @__PURE__ */ l({
922
+ __name: "MergeTagInput",
923
+ props: {
924
+ modelValue: {},
925
+ type: { default: "text" },
926
+ placeholder: { default: "" },
927
+ pulse: {
928
+ type: Boolean,
929
+ default: !1
930
+ }
931
+ },
932
+ emits: ["update:modelValue"],
933
+ setup(e, { emit: n }) {
934
+ let r = e, a = n, { t: o } = N(), c = t(null), { segments: l, hasMergeTags: u, mergeTagEnabled: d, isRequestingMergeTag: h, isEditing: g, startEditing: y, stopEditing: b, handleInput: w, clearValue: T, insertMergeTag: E } = Tn({
935
+ modelValue: () => r.modelValue,
936
+ emit: (e) => a("update:modelValue", e),
937
+ elementRef: c
938
+ });
939
+ return (t, n) => p(u) && !p(g) ? (s(), f("div", ur, [C("div", {
940
+ role: "button",
941
+ tabindex: "0",
942
+ "aria-label": p(o).mergeTag.clickToEdit,
943
+ class: D([br, { "tpl-pulse-fill": e.pulse }]),
944
+ onClick: n[1] ||= (...e) => p(y) && p(y)(...e),
945
+ onKeydown: [n[2] ||= x((...e) => p(y) && p(y)(...e), ["enter"]), n[3] ||= x(k((...e) => p(y) && p(y)(...e), ["prevent"]), ["space"])]
946
+ }, [(s(!0), f(_, null, i(p(l), (e, t) => (s(), f(_, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (s(), f("span", {
947
+ key: 0,
948
+ class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium",
949
+ "data-tooltip": e.value,
950
+ style: {
951
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
952
+ color: "var(--tpl-primary)"
953
+ }
954
+ }, S(e.label), 9, fr)) : e.type === "logicMergeTag" ? (s(), f("span", {
955
+ key: 1,
956
+ class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase",
957
+ "data-tooltip": e.value,
958
+ style: {
959
+ "background-color": "transparent",
960
+ border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
961
+ color: "var(--tpl-primary)"
962
+ }
963
+ }, S(e.keyword), 9, pr)) : (s(), f("span", mr, S(e.value), 1))], 64))), 128)), C("button", {
964
+ type: "button",
965
+ class: "tpl:ml-auto tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100",
966
+ "aria-label": p(o).mergeTag.remove,
967
+ title: p(o).mergeTag.remove,
968
+ onClick: n[0] ||= k((...e) => p(T) && p(T)(...e), ["stop"])
969
+ }, [m(p(I), {
970
+ size: 12,
971
+ "stroke-width": 2.5
972
+ })], 8, hr)], 42, dr), p(d) ? (s(), f("button", {
973
+ key: 0,
974
+ type: "button",
975
+ class: D([xr, "tpl:mt-1.5"]),
976
+ "aria-label": p(o).mergeTag.insert,
977
+ title: p(o).mergeTag.insert,
978
+ disabled: p(h),
979
+ onClick: n[4] ||= (...e) => p(E) && p(E)(...e)
980
+ }, [m(p(ot), {
981
+ size: 12,
982
+ "stroke-width": 2
983
+ }), j(" " + S(p(o).mergeTag.insert), 1)], 8, gr)) : v("", !0)])) : (s(), f("div", _r, [C("input", {
984
+ ref_key: "inputRef",
985
+ ref: c,
986
+ type: e.type,
987
+ class: D([p(H), { "tpl-pulse-fill": e.pulse }]),
988
+ value: e.modelValue,
989
+ placeholder: e.placeholder,
990
+ onInput: n[5] ||= (...e) => p(w) && p(w)(...e),
991
+ onBlur: n[6] ||= (...e) => p(b) && p(b)(...e),
992
+ onKeydown: n[7] ||= x((...e) => p(b) && p(b)(...e), ["escape"])
993
+ }, null, 42, vr), p(d) ? (s(), f("button", {
994
+ key: 0,
995
+ type: "button",
996
+ class: D([xr, "tpl:mt-1.5"]),
997
+ "aria-label": p(o).mergeTag.insert,
998
+ title: p(o).mergeTag.insert,
999
+ disabled: p(h),
1000
+ onClick: n[8] ||= (...e) => p(E) && p(E)(...e)
1001
+ }, [m(p(ot), {
1002
+ size: 12,
1003
+ "stroke-width": 2
1004
+ }), j(" " + S(p(o).mergeTag.insert), 1)], 8, yr)) : v("", !0)]));
1005
+ }
1006
+ }), [["__scopeId", "data-v-978af663"]]), Sr = { class: "tpl:mb-3.5" }, Cr = ["value"], wr = { value: "" }, Tr = ["value"], Er = { class: "tpl:mb-3.5" }, Dr = { class: "tpl:mb-3.5" }, Or = {
1007
+ key: 0,
1008
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
1009
+ }, kr = ["checked"], Ar = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, jr = { class: "tpl:mb-3.5" }, Mr = { class: "tpl:mb-3.5" }, Nr = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Pr = { class: "tpl:mb-3.5" }, Fr = { class: "tpl:flex tpl:items-stretch" }, Ir = ["value"], Lr = { class: "tpl:mb-3.5" }, Rr = { class: "tpl:flex tpl:items-stretch" }, zr = ["value"], Br = /* @__PURE__ */ l({
1010
+ __name: "ButtonToolbar",
1011
+ props: {
1012
+ block: {},
1013
+ fontFamilies: {}
1014
+ },
1015
+ emits: ["update"],
1016
+ setup(e, { emit: t }) {
1017
+ let n = t, { t: r } = N();
1018
+ function a(e, t) {
1019
+ n("update", { [e]: t });
1020
+ }
1021
+ return (t, n) => (s(), f(_, null, [
1022
+ C("div", Sr, [C("label", { class: D(p(W)) }, S(p(r).button.fontFamily), 3), C("select", {
1023
+ class: D(p(H)),
1024
+ value: e.block.fontFamily || "",
1025
+ onChange: n[0] ||= (e) => a("fontFamily", e.target.value || void 0)
1026
+ }, [C("option", wr, S(p(r).button.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
1027
+ key: e.value,
1028
+ value: e.value
1029
+ }, S(e.label), 9, Tr))), 128))], 42, Cr)]),
1030
+ C("div", Er, [C("label", { class: D(p(W)) }, S(p(r).button.text), 3), m(X, {
1031
+ "model-value": e.block.text,
1032
+ type: "text",
1033
+ "onUpdate:modelValue": n[1] ||= (e) => a("text", e)
1034
+ }, null, 8, ["model-value"])]),
1035
+ C("div", Dr, [
1036
+ C("label", { class: D(p(W)) }, S(p(r).button.url), 3),
1037
+ m(X, {
1038
+ "model-value": e.block.url,
1039
+ type: "url",
1040
+ placeholder: p(r).button.urlPlaceholder,
1041
+ "onUpdate:modelValue": n[2] ||= (e) => a("url", e)
1042
+ }, null, 8, ["model-value", "placeholder"]),
1043
+ e.block.url ? (s(), f("label", Or, [C("input", {
1044
+ type: "checkbox",
1045
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1046
+ checked: e.block.openInNewTab ?? !1,
1047
+ onChange: n[3] ||= (e) => a("openInNewTab", e.target.checked)
1048
+ }, null, 40, kr), j(" " + S(p(r).button.openInNewTab), 1)])) : v("", !0)
1049
+ ]),
1050
+ C("div", Ar, [C("div", jr, [C("label", { class: D(p(W)) }, S(p(r).button.background), 3), m(Y, {
1051
+ "model-value": e.block.backgroundColor,
1052
+ "onUpdate:modelValue": n[4] ||= (e) => a("backgroundColor", e)
1053
+ }, null, 8, ["model-value"])]), C("div", Mr, [C("label", { class: D(p(W)) }, S(p(r).button.textColor), 3), m(Y, {
1054
+ "model-value": e.block.textColor,
1055
+ "onUpdate:modelValue": n[5] ||= (e) => a("textColor", e)
1056
+ }, null, 8, ["model-value"])])]),
1057
+ C("div", Nr, [C("div", Pr, [C("label", { class: D(p(W)) }, S(p(r).button.borderRadius), 3), C("div", Fr, [C("input", {
1058
+ type: "number",
1059
+ class: D(p(U)),
1060
+ value: e.block.borderRadius,
1061
+ min: "0",
1062
+ max: "50",
1063
+ onInput: n[6] ||= (e) => a("borderRadius", Number(e.target.value))
1064
+ }, null, 42, Ir), C("span", { class: D(p(G)) }, "px", 2)])]), C("div", Lr, [C("label", { class: D(p(W)) }, S(p(r).button.fontSize), 3), C("div", Rr, [C("input", {
1065
+ type: "number",
1066
+ class: D(p(U)),
1067
+ value: e.block.fontSize,
1068
+ min: "10",
1069
+ max: "36",
1070
+ onInput: n[7] ||= (e) => a("fontSize", Number(e.target.value))
1071
+ }, null, 42, zr), C("span", { class: D(p(G)) }, "px", 2)])])])
1072
+ ], 64));
1073
+ }
1074
+ }), Vr = { class: "spacing-control" }, Hr = { class: "tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ur = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, Wr = { class: "tpl:flex tpl:items-center" }, Gr = ["aria-label"], Kr = ["value", "aria-label"], qr = ["aria-label"], Jr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Yr = { class: "tpl:flex tpl:items-center" }, Xr = ["aria-label"], Zr = ["value", "aria-label"], Qr = ["aria-label"], $r = ["aria-label", "title"], ei = { class: "tpl:flex tpl:items-center" }, ti = ["aria-label"], ni = ["value", "aria-label"], ri = ["aria-label"], ii = { class: "tpl:flex tpl:items-center" }, ai = ["aria-label"], oi = ["value", "aria-label"], si = ["aria-label"], Z = "tpl:flex tpl:items-center tpl:justify-center tpl:w-8 tpl:h-8 tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg)] tpl:border tpl:border-[var(--tpl-border)] tpl:cursor-pointer tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)] active:tpl:bg-[var(--tpl-bg-active)]", ci = "tpl:w-10 tpl:h-8 tpl:text-center tpl:text-xs tpl:font-medium tpl:border-y tpl:border-x-0 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]", li = /* @__PURE__ */ M(/* @__PURE__ */ l({
1075
+ __name: "SpacingControl",
1076
+ props: {
1077
+ modelValue: {},
1078
+ label: {}
1079
+ },
1080
+ emits: ["update:modelValue"],
1081
+ setup(e, { emit: r }) {
1082
+ let i = e, a = r, { t: o } = N(), c = T(() => i.modelValue.top === i.modelValue.right && i.modelValue.right === i.modelValue.bottom && i.modelValue.bottom === i.modelValue.left), l = t(c.value);
1083
+ n(c, (e) => {
1084
+ !e && l.value && (l.value = !1);
1085
+ });
1086
+ function u(e, t) {
1087
+ let n = Math.max(0, i.modelValue[e] + t);
1088
+ l.value ? a("update:modelValue", {
1089
+ top: n,
1090
+ right: n,
1091
+ bottom: n,
1092
+ left: n
1093
+ }) : a("update:modelValue", {
1094
+ ...i.modelValue,
1095
+ [e]: n
1096
+ });
1097
+ }
1098
+ function d(e, t) {
1099
+ let n = Math.max(0, t);
1100
+ l.value ? a("update:modelValue", {
1101
+ top: n,
1102
+ right: n,
1103
+ bottom: n,
1104
+ left: n
1105
+ }) : a("update:modelValue", {
1106
+ ...i.modelValue,
1107
+ [e]: n
1108
+ });
1109
+ }
1110
+ function h() {
1111
+ if (l.value = !l.value, l.value) {
1112
+ let e = i.modelValue.top;
1113
+ a("update:modelValue", {
1114
+ top: e,
1115
+ right: e,
1116
+ bottom: e,
1117
+ left: e
1118
+ });
1119
+ }
1120
+ }
1121
+ return (t, n) => (s(), f("div", Vr, [C("label", Hr, S(e.label), 1), C("div", Ur, [
1122
+ C("div", Wr, [
1123
+ C("button", {
1124
+ "aria-label": p(o).spacingControl.decreaseTop,
1125
+ class: D([Z, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1126
+ onClick: n[0] ||= (e) => u("top", -1)
1127
+ }, [m(p(z), {
1128
+ size: 12,
1129
+ "stroke-width": 2
1130
+ })], 10, Gr),
1131
+ C("input", {
1132
+ type: "number",
1133
+ class: D(ci),
1134
+ value: e.modelValue.top,
1135
+ "aria-label": p(o).spacingControl.top,
1136
+ min: "0",
1137
+ onInput: n[1] ||= (e) => d("top", Number(e.target.value))
1138
+ }, null, 40, Kr),
1139
+ C("button", {
1140
+ "aria-label": p(o).spacingControl.increaseTop,
1141
+ class: D([Z, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1142
+ onClick: n[2] ||= (e) => u("top", 1)
1143
+ }, [m(p(B), {
1144
+ size: 12,
1145
+ "stroke-width": 2
1146
+ })], 10, qr)
1147
+ ]),
1148
+ C("div", Jr, [
1149
+ C("div", Yr, [
1150
+ C("button", {
1151
+ "aria-label": p(o).spacingControl.decreaseLeft,
1152
+ class: D([Z, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1153
+ onClick: n[3] ||= (e) => u("left", -1)
1154
+ }, [m(p(z), {
1155
+ size: 12,
1156
+ "stroke-width": 2
1157
+ })], 10, Xr),
1158
+ C("input", {
1159
+ type: "number",
1160
+ class: D(ci),
1161
+ value: e.modelValue.left,
1162
+ "aria-label": p(o).spacingControl.left,
1163
+ min: "0",
1164
+ onInput: n[4] ||= (e) => d("left", Number(e.target.value))
1165
+ }, null, 40, Zr),
1166
+ C("button", {
1167
+ "aria-label": p(o).spacingControl.increaseLeft,
1168
+ class: D([Z, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1169
+ onClick: n[5] ||= (e) => u("left", 1)
1170
+ }, [m(p(B), {
1171
+ size: 12,
1172
+ "stroke-width": 2
1173
+ })], 10, Qr)
1174
+ ]),
1175
+ C("button", {
1176
+ class: D(["tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", l.value ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),
1177
+ "aria-label": l.value ? p(o).spacingControl.unlock : p(o).spacingControl.lockAll,
1178
+ title: l.value ? p(o).spacingControl.unlock : p(o).spacingControl.lockAll,
1179
+ onClick: h
1180
+ }, [l.value ? (s(), y(p(et), {
1181
+ key: 0,
1182
+ size: 14,
1183
+ "stroke-width": 2
1184
+ })) : (s(), y(p(tt), {
1185
+ key: 1,
1186
+ size: 14,
1187
+ "stroke-width": 2
1188
+ }))], 10, $r),
1189
+ C("div", ei, [
1190
+ C("button", {
1191
+ "aria-label": p(o).spacingControl.decreaseRight,
1192
+ class: D([Z, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1193
+ onClick: n[6] ||= (e) => u("right", -1)
1194
+ }, [m(p(z), {
1195
+ size: 12,
1196
+ "stroke-width": 2
1197
+ })], 10, ti),
1198
+ C("input", {
1199
+ type: "number",
1200
+ class: D(ci),
1201
+ value: e.modelValue.right,
1202
+ "aria-label": p(o).spacingControl.right,
1203
+ min: "0",
1204
+ onInput: n[7] ||= (e) => d("right", Number(e.target.value))
1205
+ }, null, 40, ni),
1206
+ C("button", {
1207
+ "aria-label": p(o).spacingControl.increaseRight,
1208
+ class: D([Z, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1209
+ onClick: n[8] ||= (e) => u("right", 1)
1210
+ }, [m(p(B), {
1211
+ size: 12,
1212
+ "stroke-width": 2
1213
+ })], 10, ri)
1214
+ ])
1215
+ ]),
1216
+ C("div", ii, [
1217
+ C("button", {
1218
+ "aria-label": p(o).spacingControl.decreaseBottom,
1219
+ class: D([Z, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1220
+ onClick: n[9] ||= (e) => u("bottom", -1)
1221
+ }, [m(p(z), {
1222
+ size: 12,
1223
+ "stroke-width": 2
1224
+ })], 10, ai),
1225
+ C("input", {
1226
+ type: "number",
1227
+ class: D(ci),
1228
+ value: e.modelValue.bottom,
1229
+ "aria-label": p(o).spacingControl.bottom,
1230
+ min: "0",
1231
+ onInput: n[10] ||= (e) => d("bottom", Number(e.target.value))
1232
+ }, null, 40, oi),
1233
+ C("button", {
1234
+ "aria-label": p(o).spacingControl.increaseBottom,
1235
+ class: D([Z, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1236
+ onClick: n[11] ||= (e) => u("bottom", 1)
1237
+ }, [m(p(B), {
1238
+ size: 12,
1239
+ "stroke-width": 2
1240
+ })], 10, si)
1241
+ ])
1242
+ ])]));
1243
+ }
1244
+ }), [["__scopeId", "data-v-9a9c8a07"]]), ui = { class: "tpl:mt-3" }, di = { class: "tpl:mt-4" }, fi = { class: "tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3" }, pi = { class: "tpl:mt-3" }, mi = { class: "tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3" }, hi = { class: "tpl:mt-3 tpl:space-y-2" }, gi = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, _i = ["checked"], vi = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, yi = ["checked"], bi = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, xi = ["checked"], Si = { class: "tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3" }, Ci = { class: "tpl:mt-3" }, wi = ["value", "placeholder"], Ti = {
1245
+ key: 0,
1246
+ class: "tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3"
1247
+ }, Ei = { class: "tpl:mt-3 tpl:space-y-2" }, Di = ["value"], Oi = { value: "" }, ki = ["label"], Ai = ["value"], ji = ["value"], Mi = {
1248
+ key: 0,
1249
+ value: "__custom__"
1250
+ }, Ni = {
1251
+ key: 0,
1252
+ class: "tpl:space-y-2"
1253
+ }, Pi = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Fi = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ii = { class: "tpl:flex tpl:justify-end" }, Li = ["disabled"], Ri = {
1254
+ key: 0,
1255
+ class: "tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"
1256
+ }, zi = { class: "tpl:space-y-1" }, Bi = { class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]" }, Vi = {
1257
+ key: 0,
1258
+ class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"
1259
+ }, Hi = /* @__PURE__ */ l({
1260
+ __name: "CommonBlockSettings",
1261
+ props: {
1262
+ block: {},
1263
+ isFirstSection: { type: Boolean }
1264
+ },
1265
+ emits: ["update"],
1266
+ setup(e, { emit: a }) {
1267
+ let o = e, c = a, { t: l } = N(), g = r(Ce, []), y = r(me, !1), b = d(/* @__PURE__ */ new Set());
1268
+ function x(e) {
1269
+ b.has(e) ? b.delete(e) : b.add(e);
1270
+ }
1271
+ let w = T(() => g.length > 0 || y), O = t(!1), k = t(""), A = t(""), M = T(() => o.block.displayCondition ? !g.some((e) => e.label === o.block.displayCondition?.label) : !1);
1272
+ function ee() {
1273
+ O.value = !0, M.value && o.block.displayCondition ? (k.value = o.block.displayCondition.before, A.value = o.block.displayCondition.after ?? "") : (k.value = "", A.value = "");
1274
+ }
1275
+ function te() {
1276
+ k.value.trim() && (c("update", { displayCondition: {
1277
+ label: l.blockSettings.customCondition,
1278
+ before: k.value.trim(),
1279
+ after: A.value.trim()
1280
+ } }), O.value = !1, k.value = "", A.value = "");
1281
+ }
1282
+ n(() => o.block.displayCondition, (e) => {
1283
+ if (!e) {
1284
+ O.value = !1, k.value = "", A.value = "";
1285
+ return;
1286
+ }
1287
+ M.value && (k.value = e.before, A.value = e.after ?? "");
1288
+ }, { immediate: !0 });
1289
+ let P = T(() => {
1290
+ let e = {};
1291
+ for (let t of g) {
1292
+ let n = t.group ?? "";
1293
+ e[n] || (e[n] = []), e[n].push(t);
1294
+ }
1295
+ return e;
1296
+ });
1297
+ function ne(e, t) {
1298
+ c("update", { styles: {
1299
+ ...o.block.styles,
1300
+ [e]: t
1301
+ } });
1302
+ }
1303
+ return (t, n) => (s(), f("div", { class: D(["tpl:flex tpl:flex-col", e.isFirstSection ? "" : "tpl:mt-4"]) }, [
1304
+ C("div", { class: D(["tpl:py-3", e.isFirstSection ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [C("button", {
1305
+ type: "button",
1306
+ class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
1307
+ onClick: n[0] ||= (e) => x("spacing")
1308
+ }, [m(p(L), {
1309
+ class: D(["tpl:transition-transform tpl:duration-200", b.has("spacing") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1310
+ size: 12,
1311
+ "stroke-width": 2
1312
+ }, null, 8, ["class"]), C("span", null, S(p(l).blockSettings.spacing), 1)]), u(C("div", ui, [m(li, {
1313
+ label: p(l).blockSettings.padding,
1314
+ "model-value": e.block.styles.padding,
1315
+ "onUpdate:modelValue": n[1] ||= (e) => ne("padding", e)
1316
+ }, null, 8, ["label", "model-value"]), C("div", di, [m(li, {
1317
+ label: p(l).blockSettings.margin,
1318
+ "model-value": e.block.styles.margin,
1319
+ "onUpdate:modelValue": n[2] ||= (e) => ne("margin", e)
1320
+ }, null, 8, ["label", "model-value"])])], 512), [[h, b.has("spacing")]])], 2),
1321
+ C("div", fi, [C("button", {
1322
+ type: "button",
1323
+ class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
1324
+ onClick: n[3] ||= (e) => x("bg")
1325
+ }, [m(p(L), {
1326
+ class: D(["tpl:transition-transform tpl:duration-200", b.has("bg") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1327
+ size: 12,
1328
+ "stroke-width": 2
1329
+ }, null, 8, ["class"]), C("span", null, S(p(l).blockSettings.background), 1)]), u(C("div", pi, [C("label", { class: D(p(W)) }, S(p(l).blockSettings.color), 3), m(Y, {
1330
+ size: "large",
1331
+ "model-value": e.block.styles.backgroundColor || p("#ffffff"),
1332
+ "onUpdate:modelValue": n[4] ||= (e) => ne("backgroundColor", e)
1333
+ }, null, 8, ["model-value"])], 512), [[h, b.has("bg")]])]),
1334
+ C("div", mi, [C("button", {
1335
+ type: "button",
1336
+ class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
1337
+ onClick: n[5] ||= (e) => x("display")
1338
+ }, [m(p(L), {
1339
+ class: D(["tpl:transition-transform tpl:duration-200", b.has("display") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1340
+ size: 12,
1341
+ "stroke-width": 2
1342
+ }, null, 8, ["class"]), C("span", null, S(p(l).blockSettings.display), 1)]), u(C("div", hi, [
1343
+ C("label", gi, [
1344
+ C("input", {
1345
+ type: "checkbox",
1346
+ class: "tpl:accent-[var(--tpl-primary)]",
1347
+ checked: e.block.visibility?.desktop !== !1,
1348
+ onChange: n[6] ||= (t) => c("update", { visibility: {
1349
+ desktop: e.block.visibility?.desktop === !1,
1350
+ tablet: e.block.visibility?.tablet !== !1,
1351
+ mobile: e.block.visibility?.mobile !== !1
1352
+ } })
1353
+ }, null, 40, _i),
1354
+ m(p(rt), {
1355
+ size: 14,
1356
+ "stroke-width": 1.5
1357
+ }),
1358
+ j(" " + S(p(l).blockSettings.showOnDesktop), 1)
1359
+ ]),
1360
+ C("label", vi, [
1361
+ C("input", {
1362
+ type: "checkbox",
1363
+ class: "tpl:accent-[var(--tpl-primary)]",
1364
+ checked: e.block.visibility?.tablet !== !1,
1365
+ onChange: n[7] ||= (t) => c("update", { visibility: {
1366
+ desktop: e.block.visibility?.desktop !== !1,
1367
+ tablet: e.block.visibility?.tablet === !1,
1368
+ mobile: e.block.visibility?.mobile !== !1
1369
+ } })
1370
+ }, null, 40, yi),
1371
+ m(p(st), {
1372
+ size: 14,
1373
+ "stroke-width": 1.5
1374
+ }),
1375
+ j(" " + S(p(l).blockSettings.showOnTablet), 1)
1376
+ ]),
1377
+ C("label", bi, [
1378
+ C("input", {
1379
+ type: "checkbox",
1380
+ class: "tpl:accent-[var(--tpl-primary)]",
1381
+ checked: e.block.visibility?.mobile !== !1,
1382
+ onChange: n[8] ||= (t) => c("update", { visibility: {
1383
+ desktop: e.block.visibility?.desktop !== !1,
1384
+ tablet: e.block.visibility?.tablet !== !1,
1385
+ mobile: e.block.visibility?.mobile === !1
1386
+ } })
1387
+ }, null, 40, xi),
1388
+ m(p(at), {
1389
+ size: 14,
1390
+ "stroke-width": 1.5
1391
+ }),
1392
+ j(" " + S(p(l).blockSettings.showOnMobile), 1)
1393
+ ])
1394
+ ], 512), [[h, b.has("display")]])]),
1395
+ C("div", Si, [C("button", {
1396
+ type: "button",
1397
+ class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
1398
+ onClick: n[9] ||= (e) => x("css")
1399
+ }, [m(p(L), {
1400
+ class: D(["tpl:transition-transform tpl:duration-200", b.has("css") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1401
+ size: 12,
1402
+ "stroke-width": 2
1403
+ }, null, 8, ["class"]), C("span", null, S(p(l).blockSettings.customCss), 1)]), u(C("div", Ci, [C("label", { class: D(p(W)) }, S(p(l).blockSettings.css), 3), C("textarea", {
1404
+ value: e.block.customCss || "",
1405
+ placeholder: p(l).blockSettings.cssPlaceholder,
1406
+ rows: "3",
1407
+ class: "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",
1408
+ onInput: n[10] ||= (e) => c("update", { customCss: e.target.value })
1409
+ }, null, 40, wi)], 512), [[h, b.has("css")]])]),
1410
+ w.value ? (s(), f("div", Ti, [C("button", {
1411
+ type: "button",
1412
+ class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
1413
+ onClick: n[11] ||= (e) => x("condition")
1414
+ }, [m(p(L), {
1415
+ class: D(["tpl:transition-transform tpl:duration-200", b.has("condition") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1416
+ size: 12,
1417
+ "stroke-width": 2
1418
+ }, null, 8, ["class"]), C("span", null, S(p(l).blockSettings.displayCondition), 1)]), u(C("div", Ei, [C("select", {
1419
+ class: D(["tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:duration-150 tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", e.block.displayCondition ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"]),
1420
+ value: O.value || M.value ? "__custom__" : e.block.displayCondition?.label ?? "",
1421
+ onChange: n[12] ||= (e) => {
1422
+ let t = e.target.value;
1423
+ if (t === "__custom__") {
1424
+ ee();
1425
+ return;
1426
+ }
1427
+ if (O.value = !1, !t) {
1428
+ c("update", { displayCondition: void 0 });
1429
+ return;
1430
+ }
1431
+ let n = p(g).find((e) => e.label === t);
1432
+ n && c("update", { displayCondition: n });
1433
+ }
1434
+ }, [
1435
+ C("option", Oi, S(p(l).blockSettings.noCondition), 1),
1436
+ (s(!0), f(_, null, i(P.value, (e, t) => (s(), f(_, { key: t }, [t ? (s(), f("optgroup", {
1437
+ key: 0,
1438
+ label: String(t)
1439
+ }, [(s(!0), f(_, null, i(e, (e) => (s(), f("option", {
1440
+ key: e.label,
1441
+ value: e.label
1442
+ }, S(e.label), 9, Ai))), 128))], 8, ki)) : (s(!0), f(_, { key: 1 }, i(e, (e) => (s(), f("option", {
1443
+ key: e.label,
1444
+ value: e.label
1445
+ }, S(e.label), 9, ji))), 128))], 64))), 128)),
1446
+ p(y) ? (s(), f("option", Mi, S(p(l).blockSettings.customCondition), 1)) : v("", !0)
1447
+ ], 42, Di), O.value || M.value ? (s(), f("div", Ni, [
1448
+ C("div", null, [C("label", Pi, S(p(l).blockSettings.customConditionBefore), 1), u(C("textarea", {
1449
+ "onUpdate:modelValue": n[13] ||= (e) => k.value = e,
1450
+ rows: "2",
1451
+ class: "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]"
1452
+ }, null, 512), [[E, k.value]])]),
1453
+ C("div", null, [C("label", Fi, S(p(l).blockSettings.customConditionAfter), 1), u(C("textarea", {
1454
+ "onUpdate:modelValue": n[14] ||= (e) => A.value = e,
1455
+ rows: "2",
1456
+ class: "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]"
1457
+ }, null, 512), [[E, A.value]])]),
1458
+ C("div", Ii, [C("button", {
1459
+ type: "button",
1460
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:opacity-50",
1461
+ disabled: !k.value.trim(),
1462
+ onClick: te
1463
+ }, S(p(l).blockSettings.applyCondition), 9, Li)])
1464
+ ])) : e.block.displayCondition && !M.value ? (s(), f(_, { key: 1 }, [e.block.displayCondition.description ? (s(), f("p", Ri, S(e.block.displayCondition.description), 1)) : v("", !0), C("div", zi, [C("pre", Bi, S(e.block.displayCondition.before), 1), e.block.displayCondition.after ? (s(), f("pre", Vi, S(e.block.displayCondition.after), 1)) : v("", !0)])], 64)) : v("", !0)], 512), [[h, b.has("condition")]])])) : v("", !0)
1465
+ ], 2));
1466
+ }
1467
+ }), Ui = [
1468
+ "aria-checked",
1469
+ "aria-label",
1470
+ "title",
1471
+ "onClick"
1472
+ ], Wi = { key: 1 }, Q = /* @__PURE__ */ l({
1473
+ __name: "SlidingPillSelect",
1474
+ props: {
1475
+ options: {},
1476
+ modelValue: {}
1477
+ },
1478
+ emits: ["update:modelValue"],
1479
+ setup(e, { emit: t }) {
1480
+ let n = e, r = t, a = T(() => {
1481
+ let e = n.options.findIndex((e) => e.value === n.modelValue);
1482
+ return `translateX(${Math.max(e, 0) * 100}%)`;
1483
+ });
1484
+ return (t, n) => (s(), f("div", {
1485
+ role: "radiogroup",
1486
+ class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
1487
+ style: g({
1488
+ gridTemplateColumns: `repeat(${e.options.length}, 1fr)`,
1489
+ backgroundColor: "var(--tpl-bg-hover)"
1490
+ })
1491
+ }, [C("div", {
1492
+ class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
1493
+ style: g({
1494
+ left: "4px",
1495
+ width: `calc((100% - 8px) / ${e.options.length})`,
1496
+ transform: a.value,
1497
+ backgroundColor: "var(--tpl-bg)",
1498
+ boxShadow: "var(--tpl-shadow)",
1499
+ transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
1500
+ })
1501
+ }, null, 4), (s(!0), f(_, null, i(e.options, (t) => (s(), f("button", {
1502
+ key: t.value,
1503
+ role: "radio",
1504
+ "aria-checked": e.modelValue === t.value,
1505
+ "aria-label": t.label,
1506
+ class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium",
1507
+ style: g({
1508
+ color: e.modelValue === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
1509
+ transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
1510
+ }),
1511
+ title: t.label,
1512
+ onClick: (e) => r("update:modelValue", t.value)
1513
+ }, [t.icon ? (s(), y(c(t.icon), {
1514
+ key: 0,
1515
+ size: 14,
1516
+ "stroke-width": 2
1517
+ })) : (s(), f("span", Wi, S(t.label), 1))], 12, Ui))), 128))], 4));
1518
+ }
1519
+ }), Gi = { class: "tpl:mb-3.5" }, Ki = ["value"], qi = { class: "tpl:mb-3.5" }, Ji = ["value"], Yi = { class: "tpl:mb-3.5" }, Xi = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-2" }, Zi = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, Qi = ["checked"], $i = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, ea = ["checked"], ta = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, na = ["checked"], ra = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, ia = ["checked"], aa = { class: "tpl:mb-3.5" }, oa = { class: "tpl:mb-3.5" }, sa = ["value"], ca = { value: "" }, la = ["value"], ua = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, da = { class: "tpl:mb-3.5" }, fa = { class: "tpl:flex tpl:items-stretch" }, pa = ["value"], ma = { class: "tpl:mb-3.5" }, ha = { class: "tpl:flex tpl:items-stretch" }, ga = ["value"], _a = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, va = { class: "tpl:mb-3.5" }, ya = { class: "tpl:mb-3.5" }, ba = { class: "tpl:mb-3.5" }, xa = { class: "tpl:mb-3.5" }, Sa = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-2" }, Ca = ["value", "placeholder"], wa = ["value", "placeholder"], Ta = ["value", "placeholder"], Ea = ["value", "placeholder"], Da = { class: "tpl:mb-3.5" }, Oa = ["value", "placeholder"], ka = { class: "tpl:mb-3.5" }, Aa = ["value"], ja = { class: "tpl:mb-3.5 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, Ma = ["checked"], Na = /* @__PURE__ */ l({
1520
+ __name: "CountdownToolbar",
1521
+ props: {
1522
+ block: {},
1523
+ fontFamilies: {}
1524
+ },
1525
+ emits: ["update"],
1526
+ setup(e, { emit: t }) {
1527
+ let n = t, { t: r } = N();
1528
+ function a(e, t) {
1529
+ n("update", { [e]: t });
1530
+ }
1531
+ return (t, n) => (s(), f(_, null, [
1532
+ C("div", Gi, [C("label", { class: D(p(W)) }, S(p(r).countdown.targetDate), 3), C("input", {
1533
+ type: "datetime-local",
1534
+ class: D(p(H)),
1535
+ value: e.block.targetDate,
1536
+ onInput: n[0] ||= (e) => a("targetDate", e.target.value)
1537
+ }, null, 42, Ki)]),
1538
+ C("div", qi, [C("label", { class: D(p(W)) }, S(p(r).countdown.timezone), 3), C("select", {
1539
+ class: D(p(H)),
1540
+ value: e.block.timezone,
1541
+ onChange: n[1] ||= (e) => a("timezone", e.target.value)
1542
+ }, [...n[20] ||= [A("<option value=\"UTC\">UTC</option><option value=\"America/New_York\">America/New_York</option><option value=\"America/Chicago\">America/Chicago</option><option value=\"America/Denver\">America/Denver</option><option value=\"America/Los_Angeles\">America/Los_Angeles</option><option value=\"Europe/London\">Europe/London</option><option value=\"Europe/Berlin\">Europe/Berlin</option><option value=\"Europe/Paris\">Europe/Paris</option><option value=\"Europe/Moscow\">Europe/Moscow</option><option value=\"Asia/Dubai\">Asia/Dubai</option><option value=\"Asia/Kolkata\">Asia/Kolkata</option><option value=\"Asia/Shanghai\">Asia/Shanghai</option><option value=\"Asia/Tokyo\">Asia/Tokyo</option><option value=\"Australia/Sydney\">Australia/Sydney</option><option value=\"Pacific/Auckland\">Pacific/Auckland</option>", 15)]], 42, Ji)]),
1543
+ C("div", Yi, [C("label", { class: D(p(W)) }, S(p(r).countdown.display), 3), C("div", Xi, [
1544
+ C("label", Zi, [C("input", {
1545
+ type: "checkbox",
1546
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1547
+ checked: e.block.showDays,
1548
+ onChange: n[2] ||= (e) => a("showDays", e.target.checked)
1549
+ }, null, 40, Qi), j(" " + S(p(r).countdown.days), 1)]),
1550
+ C("label", $i, [C("input", {
1551
+ type: "checkbox",
1552
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1553
+ checked: e.block.showHours,
1554
+ onChange: n[3] ||= (e) => a("showHours", e.target.checked)
1555
+ }, null, 40, ea), j(" " + S(p(r).countdown.hours), 1)]),
1556
+ C("label", ta, [C("input", {
1557
+ type: "checkbox",
1558
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1559
+ checked: e.block.showMinutes,
1560
+ onChange: n[4] ||= (e) => a("showMinutes", e.target.checked)
1561
+ }, null, 40, na), j(" " + S(p(r).countdown.minutes), 1)]),
1562
+ C("label", ra, [C("input", {
1563
+ type: "checkbox",
1564
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1565
+ checked: e.block.showSeconds,
1566
+ onChange: n[5] ||= (e) => a("showSeconds", e.target.checked)
1567
+ }, null, 40, ia), j(" " + S(p(r).countdown.seconds), 1)])
1568
+ ])]),
1569
+ C("div", aa, [C("label", { class: D(p(W)) }, S(p(r).countdown.separator), 3), m(Q, {
1570
+ options: [
1571
+ {
1572
+ value: ":",
1573
+ label: ":"
1574
+ },
1575
+ {
1576
+ value: "-",
1577
+ label: "-"
1578
+ },
1579
+ {
1580
+ value: " ",
1581
+ label: "␣"
1582
+ }
1583
+ ],
1584
+ "model-value": e.block.separator,
1585
+ "onUpdate:modelValue": n[6] ||= (e) => a("separator", e)
1586
+ }, null, 8, ["model-value"])]),
1587
+ C("div", oa, [C("label", { class: D(p(W)) }, S(p(r).countdown.fontFamily), 3), C("select", {
1588
+ class: D(p(H)),
1589
+ value: e.block.fontFamily || "",
1590
+ onChange: n[7] ||= (e) => a("fontFamily", e.target.value || void 0)
1591
+ }, [C("option", ca, S(p(r).countdown.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
1592
+ key: e.value,
1593
+ value: e.value
1594
+ }, S(e.label), 9, la))), 128))], 42, sa)]),
1595
+ C("div", ua, [C("div", da, [C("label", { class: D(p(W)) }, S(p(r).countdown.digitFontSize), 3), C("div", fa, [C("input", {
1596
+ type: "number",
1597
+ class: D(p(U)),
1598
+ value: e.block.digitFontSize,
1599
+ min: "12",
1600
+ max: "72",
1601
+ onInput: n[8] ||= (e) => a("digitFontSize", Number(e.target.value))
1602
+ }, null, 42, pa), C("span", { class: D(p(G)) }, "px", 2)])]), C("div", ma, [C("label", { class: D(p(W)) }, S(p(r).countdown.labelFontSize), 3), C("div", ha, [C("input", {
1603
+ type: "number",
1604
+ class: D(p(U)),
1605
+ value: e.block.labelFontSize,
1606
+ min: "8",
1607
+ max: "24",
1608
+ onInput: n[9] ||= (e) => a("labelFontSize", Number(e.target.value))
1609
+ }, null, 42, ga), C("span", { class: D(p(G)) }, "px", 2)])])]),
1610
+ C("div", _a, [C("div", va, [C("label", { class: D(p(W)) }, S(p(r).countdown.digitColor), 3), m(Y, {
1611
+ "model-value": e.block.digitColor,
1612
+ "onUpdate:modelValue": n[10] ||= (e) => a("digitColor", e)
1613
+ }, null, 8, ["model-value"])]), C("div", ya, [C("label", { class: D(p(W)) }, S(p(r).countdown.labelColor), 3), m(Y, {
1614
+ "model-value": e.block.labelColor,
1615
+ "onUpdate:modelValue": n[11] ||= (e) => a("labelColor", e)
1616
+ }, null, 8, ["model-value"])])]),
1617
+ C("div", ba, [C("label", { class: D(p(W)) }, S(p(r).countdown.background), 3), m(Y, {
1618
+ "model-value": e.block.backgroundColor,
1619
+ "onUpdate:modelValue": n[12] ||= (e) => a("backgroundColor", e)
1620
+ }, null, 8, ["model-value"])]),
1621
+ C("div", xa, [C("label", { class: D(p(W)) }, S(p(r).countdown.labels), 3), C("div", Sa, [
1622
+ C("input", {
1623
+ type: "text",
1624
+ class: D(p(H)),
1625
+ value: e.block.labelDays,
1626
+ placeholder: p(r).countdown.days,
1627
+ onInput: n[13] ||= (e) => a("labelDays", e.target.value)
1628
+ }, null, 42, Ca),
1629
+ C("input", {
1630
+ type: "text",
1631
+ class: D(p(H)),
1632
+ value: e.block.labelHours,
1633
+ placeholder: p(r).countdown.hours,
1634
+ onInput: n[14] ||= (e) => a("labelHours", e.target.value)
1635
+ }, null, 42, wa),
1636
+ C("input", {
1637
+ type: "text",
1638
+ class: D(p(H)),
1639
+ value: e.block.labelMinutes,
1640
+ placeholder: p(r).countdown.minutes,
1641
+ onInput: n[15] ||= (e) => a("labelMinutes", e.target.value)
1642
+ }, null, 42, Ta),
1643
+ C("input", {
1644
+ type: "text",
1645
+ class: D(p(H)),
1646
+ value: e.block.labelSeconds,
1647
+ placeholder: p(r).countdown.seconds,
1648
+ onInput: n[16] ||= (e) => a("labelSeconds", e.target.value)
1649
+ }, null, 42, Ea)
1650
+ ])]),
1651
+ C("div", Da, [C("label", { class: D(p(W)) }, S(p(r).countdown.expiry), 3), C("input", {
1652
+ type: "text",
1653
+ class: D(p(H)),
1654
+ value: e.block.expiredMessage,
1655
+ placeholder: p(r).countdown.expiredMessagePlaceholder,
1656
+ onInput: n[17] ||= (e) => a("expiredMessage", e.target.value)
1657
+ }, null, 42, Oa)]),
1658
+ C("div", ka, [C("label", { class: D(p(W)) }, S(p(r).countdown.expiredImageUrl), 3), C("input", {
1659
+ type: "url",
1660
+ class: D(p(H)),
1661
+ value: e.block.expiredImageUrl,
1662
+ placeholder: "https://...",
1663
+ onInput: n[18] ||= (e) => a("expiredImageUrl", e.target.value)
1664
+ }, null, 42, Aa)]),
1665
+ C("label", ja, [C("input", {
1666
+ type: "checkbox",
1667
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1668
+ checked: e.block.hideOnExpiry,
1669
+ onChange: n[19] ||= (e) => a("hideOnExpiry", e.target.checked)
1670
+ }, null, 40, Ma), j(" " + S(p(r).countdown.hideOnExpiry), 1)])
1671
+ ], 64));
1672
+ }
1673
+ }), Pa = ["title"], Fa = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ia = {
1674
+ key: 1,
1675
+ class: "tpl:text-[var(--tpl-danger)]"
1676
+ }, La = [
1677
+ "aria-checked",
1678
+ "aria-label",
1679
+ "disabled"
1680
+ ], Ra = /* @__PURE__ */ l({
1681
+ __name: "BooleanField",
1682
+ props: {
1683
+ field: {},
1684
+ modelValue: { type: Boolean },
1685
+ readOnly: { type: Boolean }
1686
+ },
1687
+ emits: ["update:modelValue"],
1688
+ setup(e, { emit: t }) {
1689
+ let n = t, { t: r } = N();
1690
+ return (t, i) => (s(), f("div", {
1691
+ class: "tpl:mb-3.5",
1692
+ title: e.readOnly ? p(r).customBlocks.dataSource.readOnlyTooltip : void 0
1693
+ }, [C("label", { class: D(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2", e.readOnly ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer"]) }, [C("span", Fa, [
1694
+ j(S(e.field.label) + " ", 1),
1695
+ e.readOnly ? (s(), y(p(et), {
1696
+ key: 0,
1697
+ size: 12,
1698
+ class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1699
+ })) : v("", !0),
1700
+ e.field.required ? (s(), f("span", Ia, " * ")) : v("", !0)
1701
+ ]), C("button", {
1702
+ type: "button",
1703
+ role: "switch",
1704
+ "aria-checked": e.modelValue,
1705
+ "aria-label": e.field.label,
1706
+ class: D([
1707
+ "tpl:relative tpl:inline-flex tpl:h-5 tpl:w-9 tpl:shrink-0 tpl:rounded-full tpl:border-2 tpl:border-transparent tpl:transition-colors tpl:duration-200",
1708
+ e.modelValue ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-border)]",
1709
+ e.readOnly ? "tpl:opacity-60 tpl:cursor-not-allowed" : "tpl:cursor-pointer"
1710
+ ]),
1711
+ disabled: e.readOnly,
1712
+ onClick: i[0] ||= (t) => !e.readOnly && n("update:modelValue", !e.modelValue)
1713
+ }, [C("span", { class: D(["tpl:pointer-events-none tpl:inline-block tpl:size-4 tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:shadow tpl:transition-transform tpl:duration-200", e.modelValue ? "tpl:translate-x-4" : "tpl:translate-x-0"]) }, null, 2)], 10, La)], 2)], 8, Pa));
1714
+ }
1715
+ }), za = { class: "tpl:mb-3.5" }, Ba = {
1716
+ key: 1,
1717
+ class: "tpl:text-[var(--tpl-danger)]"
1718
+ }, $ = /* @__PURE__ */ l({
1719
+ __name: "FieldWrapper",
1720
+ props: {
1721
+ label: {},
1722
+ required: { type: Boolean },
1723
+ readOnly: { type: Boolean }
1724
+ },
1725
+ setup(e) {
1726
+ return (t, n) => (s(), f("div", za, [C("label", { class: D(p(W)) }, [
1727
+ j(S(e.label) + " ", 1),
1728
+ e.readOnly ? (s(), y(p(et), {
1729
+ key: 0,
1730
+ size: 12,
1731
+ class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1732
+ })) : v("", !0),
1733
+ e.required ? (s(), f("span", Ba, "*")) : v("", !0)
1734
+ ], 2), o(t.$slots, "default")]));
1735
+ }
1736
+ }), Va = /* @__PURE__ */ l({
1737
+ __name: "ColorField",
1738
+ props: {
1739
+ field: {},
1740
+ modelValue: {},
1741
+ readOnly: { type: Boolean }
1742
+ },
1743
+ emits: ["update:modelValue"],
1744
+ setup(e, { emit: t }) {
1745
+ let n = t, { t: r } = N();
1746
+ return (t, i) => (s(), y($, {
1747
+ label: e.field.label,
1748
+ required: e.field.required,
1749
+ "read-only": e.readOnly
1750
+ }, {
1751
+ default: a(() => [m(Y, {
1752
+ "model-value": e.modelValue || p("#000000"),
1753
+ placeholder: e.field.placeholder || p("#000000"),
1754
+ disabled: e.readOnly,
1755
+ title: e.readOnly ? p(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1756
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1757
+ }, null, 8, [
1758
+ "model-value",
1759
+ "placeholder",
1760
+ "disabled",
1761
+ "title"
1762
+ ])]),
1763
+ _: 1
1764
+ }, 8, [
1765
+ "label",
1766
+ "required",
1767
+ "read-only"
1768
+ ]));
1769
+ }
1770
+ }), Ha = [
1771
+ "value",
1772
+ "placeholder",
1773
+ "title"
1774
+ ], Ua = ["value", "placeholder"], Wa = /* @__PURE__ */ l({
1775
+ __name: "ImageField",
1776
+ props: {
1777
+ field: {},
1778
+ modelValue: {},
1779
+ readOnly: { type: Boolean }
1780
+ },
1781
+ emits: ["update:modelValue"],
1782
+ setup(e, { emit: t }) {
1783
+ let n = t, { t: i } = N(), o = r(We, null), c = T(() => !!o);
1784
+ async function l() {
1785
+ let e = await o?.({ accept: ["images"] });
1786
+ e && n("update:modelValue", e.url);
1787
+ }
1788
+ return (t, r) => (s(), y($, {
1789
+ label: e.field.label,
1790
+ required: e.field.required,
1791
+ "read-only": e.readOnly
1792
+ }, {
1793
+ default: a(() => [e.readOnly ? (s(), f("input", {
1794
+ key: 0,
1795
+ type: "url",
1796
+ class: D([p(H), "tpl:opacity-60 tpl:cursor-not-allowed"]),
1797
+ value: e.modelValue,
1798
+ placeholder: e.field.placeholder || "https://...",
1799
+ disabled: "",
1800
+ title: p(i).customBlocks.dataSource.readOnlyTooltip
1801
+ }, null, 10, Ha)) : (s(), f("input", {
1802
+ key: 1,
1803
+ type: "url",
1804
+ class: D(p(H)),
1805
+ value: e.modelValue,
1806
+ placeholder: e.field.placeholder || "https://...",
1807
+ onInput: r[0] ||= (e) => n("update:modelValue", e.target.value)
1808
+ }, null, 42, Ua)), c.value && !e.readOnly ? (s(), f("button", {
1809
+ key: 2,
1810
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
1811
+ onClick: r[1] ||= (e) => l()
1812
+ }, [m(p(Le), {
1813
+ size: 14,
1814
+ "stroke-width": 1.5
1815
+ }), j(" " + S(p(i).image.browseMedia), 1)])) : v("", !0)]),
1816
+ _: 1
1817
+ }, 8, [
1818
+ "label",
1819
+ "required",
1820
+ "read-only"
1821
+ ]));
1822
+ }
1823
+ }), Ga = [
1824
+ "value",
1825
+ "placeholder",
1826
+ "min",
1827
+ "max",
1828
+ "step",
1829
+ "disabled",
1830
+ "title"
1831
+ ], Ka = /* @__PURE__ */ l({
1832
+ __name: "NumberField",
1833
+ props: {
1834
+ field: {},
1835
+ modelValue: {},
1836
+ readOnly: { type: Boolean }
1837
+ },
1838
+ emits: ["update:modelValue"],
1839
+ setup(e, { emit: t }) {
1840
+ let n = t, { t: r } = N();
1841
+ return (t, i) => (s(), y($, {
1842
+ label: e.field.label,
1843
+ required: e.field.required,
1844
+ "read-only": e.readOnly
1845
+ }, {
1846
+ default: a(() => [C("input", {
1847
+ type: "number",
1848
+ class: D([p(H), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
1849
+ value: e.modelValue,
1850
+ placeholder: e.field.placeholder,
1851
+ min: e.field.min,
1852
+ max: e.field.max,
1853
+ step: e.field.step,
1854
+ disabled: e.readOnly,
1855
+ title: e.readOnly ? p(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1856
+ onInput: i[0] ||= (t) => !e.readOnly && n("update:modelValue", Number(t.target.value))
1857
+ }, null, 42, Ga)]),
1858
+ _: 1
1859
+ }, 8, [
1860
+ "label",
1861
+ "required",
1862
+ "read-only"
1863
+ ]));
1864
+ }
1865
+ }), qa = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Ja = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, Ya = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, Xa = ["title", "onClick"], Za = {
1866
+ key: 1,
1867
+ class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
1868
+ }, Qa = /* @__PURE__ */ l({
1869
+ __name: "RepeatableField",
1870
+ props: {
1871
+ field: {},
1872
+ modelValue: {},
1873
+ readOnly: { type: Boolean }
1874
+ },
1875
+ emits: ["update:modelValue"],
1876
+ setup(e, { emit: t }) {
1877
+ let n = e, r = t, { t: o } = N(), l = T(() => n.modelValue || []), u = T(() => !n.field.maxItems || l.value.length < n.field.maxItems), d = T(() => !n.field.minItems || l.value.length > n.field.minItems);
1878
+ function h() {
1879
+ if (!u.value || n.readOnly) return;
1880
+ let e = {};
1881
+ for (let t of n.field.fields) e[t.key] = t.default ?? "";
1882
+ r("update:modelValue", [...l.value, e]);
1883
+ }
1884
+ function g(e) {
1885
+ if (!d.value || n.readOnly) return;
1886
+ let t = [...l.value];
1887
+ t.splice(e, 1), r("update:modelValue", t);
1888
+ }
1889
+ function b(e, t, n) {
1890
+ r("update:modelValue", l.value.map((r, i) => i === e ? {
1891
+ ...r,
1892
+ [t]: n
1893
+ } : r));
1894
+ }
1895
+ return (t, n) => (s(), y($, {
1896
+ label: e.field.label,
1897
+ required: e.field.required,
1898
+ "read-only": e.readOnly
1899
+ }, {
1900
+ default: a(() => [C("div", qa, [
1901
+ (s(!0), f(_, null, i(l.value, (t, n) => (s(), f("div", {
1902
+ key: `${e.field.key}-${n}`,
1903
+ class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
1904
+ }, [C("div", Ja, [C("span", Ya, " #" + S(n + 1), 1), d.value && !e.readOnly ? (s(), f("button", {
1905
+ key: 0,
1906
+ type: "button",
1907
+ class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
1908
+ title: p(o).customBlocks.fields.removeItem,
1909
+ onClick: (e) => g(n)
1910
+ }, [m(p(Ge), {
1911
+ size: 12,
1912
+ "stroke-width": 2
1913
+ })], 8, Xa)) : v("", !0)]), (s(!0), f(_, null, i(e.field.fields, (r) => (s(), y(c(p(so)(r.type)), {
1914
+ key: r.key,
1915
+ field: r,
1916
+ "model-value": t[r.key],
1917
+ "read-only": e.readOnly,
1918
+ "onUpdate:modelValue": (e) => b(n, r.key, e)
1919
+ }, null, 8, [
1920
+ "field",
1921
+ "model-value",
1922
+ "read-only",
1923
+ "onUpdate:modelValue"
1924
+ ]))), 128))]))), 128)),
1925
+ u.value && !e.readOnly ? (s(), f("button", {
1926
+ key: 0,
1927
+ type: "button",
1928
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
1929
+ onClick: h
1930
+ }, [m(p(B), {
1931
+ size: 14,
1932
+ "stroke-width": 2
1933
+ }), j(" " + S(p(o).customBlocks.fields.addItem), 1)])) : v("", !0),
1934
+ !u.value && !e.readOnly ? (s(), f("p", Za, S(p(o).customBlocks.fields.maxItemsReached), 1)) : v("", !0)
1935
+ ])]),
1936
+ _: 1
1937
+ }, 8, [
1938
+ "label",
1939
+ "required",
1940
+ "read-only"
1941
+ ]));
1942
+ }
1943
+ }), $a = [
1944
+ "value",
1945
+ "disabled",
1946
+ "title"
1947
+ ], eo = ["value"], to = /* @__PURE__ */ l({
1948
+ __name: "SelectField",
1949
+ props: {
1950
+ field: {},
1951
+ modelValue: {},
1952
+ readOnly: { type: Boolean }
1953
+ },
1954
+ emits: ["update:modelValue"],
1955
+ setup(e, { emit: t }) {
1956
+ let n = t, { t: r } = N();
1957
+ return (t, o) => (s(), y($, {
1958
+ label: e.field.label,
1959
+ required: e.field.required,
1960
+ "read-only": e.readOnly
1961
+ }, {
1962
+ default: a(() => [C("select", {
1963
+ class: D([p(H), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
1964
+ value: e.modelValue,
1965
+ disabled: e.readOnly,
1966
+ title: e.readOnly ? p(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1967
+ onChange: o[0] ||= (t) => !e.readOnly && n("update:modelValue", t.target.value)
1968
+ }, [(s(!0), f(_, null, i(e.field.options, (e) => (s(), f("option", {
1969
+ key: e.value,
1970
+ value: e.value
1971
+ }, S(e.label), 9, eo))), 128))], 42, $a)]),
1972
+ _: 1
1973
+ }, 8, [
1974
+ "label",
1975
+ "required",
1976
+ "read-only"
1977
+ ]));
1978
+ }
1979
+ }), no = [
1980
+ "value",
1981
+ "placeholder",
1982
+ "title"
1983
+ ], ro = /* @__PURE__ */ l({
1984
+ __name: "TextField",
1985
+ props: {
1986
+ field: {},
1987
+ modelValue: {},
1988
+ readOnly: { type: Boolean }
1989
+ },
1990
+ emits: ["update:modelValue"],
1991
+ setup(e, { emit: t }) {
1992
+ let n = t, { t: r } = N();
1993
+ return (t, i) => (s(), y($, {
1994
+ label: e.field.label,
1995
+ required: e.field.required,
1996
+ "read-only": e.readOnly
1997
+ }, {
1998
+ default: a(() => [e.readOnly ? (s(), f("input", {
1999
+ key: 0,
2000
+ type: "text",
2001
+ class: D([p(H), "tpl:opacity-60 tpl:cursor-not-allowed"]),
2002
+ value: e.modelValue,
2003
+ placeholder: e.field.placeholder,
2004
+ disabled: "",
2005
+ title: p(r).customBlocks.dataSource.readOnlyTooltip
2006
+ }, null, 10, no)) : (s(), y(X, {
2007
+ key: 1,
2008
+ "model-value": e.modelValue,
2009
+ placeholder: e.field.placeholder,
2010
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
2011
+ }, null, 8, ["model-value", "placeholder"]))]),
2012
+ _: 1
2013
+ }, 8, [
2014
+ "label",
2015
+ "required",
2016
+ "read-only"
2017
+ ]));
2018
+ }
2019
+ }), io = [
2020
+ "value",
2021
+ "placeholder",
2022
+ "title"
2023
+ ], ao = "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:opacity-60 tpl:cursor-not-allowed", oo = {
2024
+ text: ro,
2025
+ textarea: /* @__PURE__ */ l({
2026
+ __name: "TextareaField",
2027
+ props: {
2028
+ field: {},
2029
+ modelValue: {},
2030
+ readOnly: { type: Boolean }
2031
+ },
2032
+ emits: ["update:modelValue"],
2033
+ setup(e, { emit: t }) {
2034
+ let n = t, { t: r } = N();
2035
+ return (t, i) => (s(), y($, {
2036
+ label: e.field.label,
2037
+ required: e.field.required,
2038
+ "read-only": e.readOnly
2039
+ }, {
2040
+ default: a(() => [e.readOnly ? (s(), f("textarea", {
2041
+ key: 0,
2042
+ value: e.modelValue,
2043
+ placeholder: e.field.placeholder,
2044
+ rows: "3",
2045
+ disabled: "",
2046
+ title: p(r).customBlocks.dataSource.readOnlyTooltip,
2047
+ class: D(ao)
2048
+ }, null, 8, io)) : (s(), y(zn, {
2049
+ key: 1,
2050
+ "model-value": e.modelValue,
2051
+ placeholder: e.field.placeholder,
2052
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
2053
+ }, null, 8, ["model-value", "placeholder"]))]),
2054
+ _: 1
2055
+ }, 8, [
2056
+ "label",
2057
+ "required",
2058
+ "read-only"
2059
+ ]));
2060
+ }
2061
+ }),
2062
+ image: Wa,
2063
+ color: Va,
2064
+ number: Ka,
2065
+ select: to,
2066
+ boolean: Ra,
2067
+ repeatable: Qa
2068
+ };
2069
+ function so(e) {
2070
+ return oo[e] ?? ro;
2071
+ }
2072
+ //#endregion
2073
+ //#region src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
2074
+ var co = {
2075
+ key: 0,
2076
+ class: "tpl:p-4"
2077
+ }, lo = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, uo = { key: 1 }, fo = {
2078
+ key: 0,
2079
+ class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
2080
+ }, po = {
2081
+ key: 1,
2082
+ class: "tpl:mb-4"
2083
+ }, mo = {
2084
+ key: 1,
2085
+ class: "tpl:flex tpl:h-[32px] tpl:items-center"
2086
+ }, ho = {
2087
+ key: 0,
2088
+ class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
2089
+ }, go = {
2090
+ key: 2,
2091
+ class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
2092
+ }, _o = /* @__PURE__ */ l({
2093
+ __name: "CustomBlockToolbar",
2094
+ props: { block: {} },
2095
+ emits: ["updateFieldValues", "updateDataSourceFetched"],
2096
+ setup(e, { emit: t }) {
2097
+ let n = e, a = t, { t: o } = N(), l = r(P, []), u = T(() => l.find((e) => e.type === n.block.customType)), { isFetching: d, fetchError: h, fetch: g, hasDataSource: b, needsFetch: x } = Be({
2098
+ definition: u,
2099
+ block: T(() => n.block),
2100
+ onUpdate: (e, t) => {
2101
+ a("updateFieldValues", e), a("updateDataSourceFetched", t);
2102
+ }
2103
+ });
2104
+ function w(e) {
2105
+ return e.readOnly === !0 && b.value && !!n.block.dataSourceFetched;
2106
+ }
2107
+ function E(e, t) {
2108
+ a("updateFieldValues", {
2109
+ ...n.block.fieldValues,
2110
+ [e]: t
2111
+ });
2112
+ }
2113
+ return (t, n) => u.value ? (s(), f("div", uo, [
2114
+ u.value.description ? (s(), f("p", fo, S(u.value.description), 1)) : v("", !0),
2115
+ p(b) ? (s(), f("div", po, [p(x) && !p(d) ? (s(), f("button", {
2116
+ key: 0,
2117
+ type: "button",
2118
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-md tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:bg-[var(--tpl-primary)]",
2119
+ onClick: n[0] ||= (...e) => p(g) && p(g)(...e)
2120
+ }, S(u.value?.dataSource?.label || p(o).customBlocks.dataSource.fetchButton), 1)) : (s(), f("div", mo, [p(d) ? (s(), f("div", ho, S(p(o).customBlocks.dataSource.fetching), 1)) : (s(), f("button", {
2121
+ key: 1,
2122
+ type: "button",
2123
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
2124
+ onClick: n[1] ||= (...e) => p(g) && p(g)(...e)
2125
+ }, [m(p(Ve), { size: 12 }), j(" " + S(p(o).customBlocks.dataSource.changeButton), 1)]))])), p(h) ? (s(), f("p", go, [m(p(ye), {
2126
+ size: 14,
2127
+ class: "tpl:shrink-0"
2128
+ }), j(" " + S(p(o).customBlocks.dataSource.fetchError), 1)])) : v("", !0)])) : v("", !0),
2129
+ (s(!0), f(_, null, i(u.value.fields, (t) => (s(), y(c(p(so)(t.type)), {
2130
+ key: t.key,
2131
+ field: t,
2132
+ "model-value": e.block.fieldValues[t.key],
2133
+ "read-only": w(t),
2134
+ "onUpdate:modelValue": (e) => E(t.key, e)
2135
+ }, null, 8, [
2136
+ "field",
2137
+ "model-value",
2138
+ "read-only",
2139
+ "onUpdate:modelValue"
2140
+ ]))), 128))
2141
+ ])) : (s(), f("div", co, [C("p", lo, S(p(o).customBlocks.toolbar.noDefinition), 1)]));
2142
+ }
2143
+ }), vo = { class: "tpl:mb-3.5" }, yo = { class: "tpl:mb-3.5" }, bo = { class: "tpl:mb-3.5" }, xo = { class: "tpl:flex tpl:items-stretch" }, So = ["value"], Co = /* @__PURE__ */ l({
2144
+ __name: "DividerToolbar",
2145
+ props: { block: {} },
2146
+ emits: ["update"],
2147
+ setup(e, { emit: t }) {
2148
+ let n = t, { t: r } = N();
2149
+ function i(e, t) {
2150
+ n("update", { [e]: t });
2151
+ }
2152
+ return (t, n) => (s(), f(_, null, [
2153
+ C("div", vo, [C("label", { class: D(p(W)) }, S(p(r).divider.style), 3), m(Q, {
2154
+ options: [
2155
+ {
2156
+ value: "solid",
2157
+ label: p(r).divider.solid
2158
+ },
2159
+ {
2160
+ value: "dashed",
2161
+ label: p(r).divider.dashed
2162
+ },
2163
+ {
2164
+ value: "dotted",
2165
+ label: p(r).divider.dotted
2166
+ }
2167
+ ],
2168
+ "model-value": e.block.lineStyle,
2169
+ "onUpdate:modelValue": n[0] ||= (e) => i("lineStyle", e)
2170
+ }, null, 8, ["options", "model-value"])]),
2171
+ C("div", yo, [C("label", { class: D(p(W)) }, S(p(r).divider.color), 3), m(Y, {
2172
+ "model-value": e.block.color,
2173
+ "onUpdate:modelValue": n[1] ||= (e) => i("color", e)
2174
+ }, null, 8, ["model-value"])]),
2175
+ C("div", bo, [C("label", { class: D(p(W)) }, S(p(r).divider.thickness), 3), C("div", xo, [C("input", {
2176
+ type: "number",
2177
+ class: D(p(U)),
2178
+ value: e.block.thickness,
2179
+ min: "1",
2180
+ max: "10",
2181
+ onInput: n[2] ||= (e) => i("thickness", Number(e.target.value))
2182
+ }, null, 42, So), C("span", { class: D(p(G)) }, "px", 2)])])
2183
+ ], 64));
2184
+ }
2185
+ }), wo = { class: "tpl:mb-3.5" }, To = ["value"], Eo = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, Do = /* @__PURE__ */ l({
2186
+ __name: "HtmlToolbar",
2187
+ props: { block: {} },
2188
+ emits: ["update"],
2189
+ setup(e, { emit: t }) {
2190
+ let n = t, { t: r } = N();
2191
+ return (t, i) => (s(), f("div", wo, [
2192
+ C("label", { class: D(p(W)) }, S(p(r).html.content), 3),
2193
+ C("textarea", {
2194
+ value: e.block.content,
2195
+ placeholder: "<div>...</div>",
2196
+ rows: "10",
2197
+ class: "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",
2198
+ onInput: i[0] ||= (e) => n("update", { content: e.target.value })
2199
+ }, null, 40, To),
2200
+ C("p", Eo, [m(p(He), {
2201
+ size: 12,
2202
+ class: "tpl:mt-0.5 tpl:shrink-0"
2203
+ }), j(" " + S(p(r).html.sanitizationHint), 1)])
2204
+ ]));
2205
+ }
2206
+ }), Oo = { class: "tpl:mb-3.5" }, ko = {
2207
+ key: 0,
2208
+ class: "tpl:mb-3.5"
2209
+ }, Ao = ["value", "placeholder"], jo = { class: "tpl:mb-3.5" }, Mo = { class: "tpl:mb-3.5" }, No = ["value"], Po = { value: "full" }, Fo = { class: "tpl:mb-3.5" }, Io = { class: "tpl:mb-3.5" }, Lo = {
2210
+ key: 0,
2211
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
2212
+ }, Ro = ["checked"], zo = /* @__PURE__ */ l({
2213
+ __name: "ImageToolbar",
2214
+ props: { block: {} },
2215
+ emits: ["update"],
2216
+ setup(e, { emit: n }) {
2217
+ let i = n, { t: a } = N(), o = r(We, null), c = r(ue, je.liquid), l = T(() => !!o), u = t(!1), d = t(!1), { start: h } = Ae(() => {
2218
+ u.value = !1;
2219
+ }, 1e3, { immediate: !1 });
2220
+ function g(e, t) {
2221
+ i("update", { [e]: t });
2222
+ }
2223
+ async function y() {
2224
+ let e = await o?.({ accept: ["images"] });
2225
+ e && (g("src", e.url), e.alt && (g("alt", e.alt), d.value = !0), u.value = !0, h());
2226
+ }
2227
+ return (t, n) => (s(), f(_, null, [
2228
+ C("div", Oo, [
2229
+ C("label", { class: D(p(W)) }, S(p(a).image.imageUrl), 3),
2230
+ m(X, {
2231
+ "model-value": e.block.src,
2232
+ type: "url",
2233
+ placeholder: p(a).image.imageUrlPlaceholder,
2234
+ pulse: u.value,
2235
+ "onUpdate:modelValue": n[0] ||= (e) => g("src", e)
2236
+ }, null, 8, [
2237
+ "model-value",
2238
+ "placeholder",
2239
+ "pulse"
2240
+ ]),
2241
+ l.value ? (s(), f("button", {
2242
+ key: 0,
2243
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2244
+ style: {
2245
+ "border-color": "var(--tpl-border)",
2246
+ color: "var(--tpl-primary)",
2247
+ "background-color": "var(--tpl-bg)"
2248
+ },
2249
+ onClick: y
2250
+ }, [m(p(Le), {
2251
+ size: 14,
2252
+ "stroke-width": 1.5
2253
+ }), j(" " + S(p(a).image.browseMedia), 1)])) : v("", !0)
2254
+ ]),
2255
+ p(Pe)(e.block.src, p(c)) ? (s(), f("div", ko, [C("label", { class: D(p(W)) }, [j(S(p(a).image.placeholderUrl) + " ", 1), n[7] ||= C("span", { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, S("(optional)"), -1)], 2), C("input", {
2256
+ type: "url",
2257
+ class: D(p(H)),
2258
+ value: e.block.placeholderUrl || "",
2259
+ placeholder: p(a).image.placeholderUrlPlaceholder,
2260
+ onInput: n[1] ||= (e) => g("placeholderUrl", e.target.value)
2261
+ }, null, 42, Ao)])) : v("", !0),
2262
+ C("div", jo, [C("label", { class: D(p(W)) }, S(p(a).image.altText), 3), m(X, {
2263
+ "model-value": e.block.alt,
2264
+ type: "text",
2265
+ placeholder: p(a).image.altTextPlaceholder,
2266
+ pulse: d.value,
2267
+ "onUpdate:modelValue": n[2] ||= (e) => g("alt", e)
2268
+ }, null, 8, [
2269
+ "model-value",
2270
+ "placeholder",
2271
+ "pulse"
2272
+ ])]),
2273
+ C("div", Mo, [C("label", { class: D(p(W)) }, S(p(a).image.width), 3), C("select", {
2274
+ class: D(p(H)),
2275
+ value: e.block.width,
2276
+ onChange: n[3] ||= (e) => g("width", e.target.value === "full" ? "full" : Number(e.target.value))
2277
+ }, [
2278
+ C("option", Po, S(p(a).image.fullWidth), 1),
2279
+ n[8] ||= C("option", { value: "300" }, "300px", -1),
2280
+ n[9] ||= C("option", { value: "400" }, "400px", -1),
2281
+ n[10] ||= C("option", { value: "500" }, "500px", -1)
2282
+ ], 42, No)]),
2283
+ C("div", Fo, [C("label", { class: D(p(W)) }, S(p(a).title.align), 3), m(Q, {
2284
+ options: [
2285
+ {
2286
+ value: "left",
2287
+ label: p(a).title.alignLeft
2288
+ },
2289
+ {
2290
+ value: "center",
2291
+ label: p(a).title.alignCenter
2292
+ },
2293
+ {
2294
+ value: "right",
2295
+ label: p(a).title.alignRight
2296
+ }
2297
+ ],
2298
+ "model-value": e.block.align,
2299
+ "onUpdate:modelValue": n[4] ||= (e) => g("align", e)
2300
+ }, null, 8, ["options", "model-value"])]),
2301
+ C("div", Io, [
2302
+ C("label", { class: D(p(W)) }, S(p(a).image.linkUrl), 3),
2303
+ m(X, {
2304
+ "model-value": e.block.linkUrl || "",
2305
+ type: "url",
2306
+ placeholder: p(a).image.imageUrlPlaceholder,
2307
+ "onUpdate:modelValue": n[5] ||= (e) => g("linkUrl", e)
2308
+ }, null, 8, ["model-value", "placeholder"]),
2309
+ e.block.linkUrl ? (s(), f("label", Lo, [C("input", {
2310
+ type: "checkbox",
2311
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
2312
+ checked: e.block.linkOpenInNewTab ?? !1,
2313
+ onChange: n[6] ||= (e) => g("linkOpenInNewTab", e.target.checked)
2314
+ }, null, 40, Ro), j(" " + S(p(a).image.openInNewTab), 1)])) : v("", !0)
2315
+ ])
2316
+ ], 64));
2317
+ }
2318
+ }), Bo = { class: "tpl:mb-3.5" }, Vo = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Ho = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Uo = [
2319
+ "value",
2320
+ "placeholder",
2321
+ "onInput"
2322
+ ], Wo = ["title", "onClick"], Go = { class: "tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Ko = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1" }, qo = ["checked", "onChange"], Jo = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1" }, Yo = ["checked", "onChange"], Xo = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1" }, Zo = ["checked", "onChange"], Qo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, $o = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, es = { class: "tpl:mb-3.5" }, ts = ["value"], ns = { value: "" }, rs = ["value"], is = { class: "tpl:mb-3.5" }, as = { class: "tpl:flex tpl:items-stretch" }, os = ["value"], ss = { class: "tpl:mb-3.5" }, cs = { class: "tpl:mb-3.5" }, ls = { class: "tpl:mb-3.5" }, us = { class: "tpl:mb-3.5" }, ds = ["value"], fs = { class: "tpl:mb-3.5" }, ps = { class: "tpl:mb-3.5" }, ms = { class: "tpl:flex tpl:items-stretch" }, hs = ["value"], gs = /* @__PURE__ */ l({
2323
+ __name: "MenuToolbar",
2324
+ props: {
2325
+ block: {},
2326
+ fontFamilies: {}
2327
+ },
2328
+ emits: ["update"],
2329
+ setup(e, { emit: t }) {
2330
+ let n = e, r = t, { t: a } = N();
2331
+ function o(e, t) {
2332
+ r("update", { [e]: t });
2333
+ }
2334
+ function c() {
2335
+ let e = {
2336
+ id: R(),
2337
+ text: "",
2338
+ url: "",
2339
+ openInNewTab: !1,
2340
+ bold: !1,
2341
+ underline: !1
2342
+ };
2343
+ r("update", { items: [...n.block.items, e] });
2344
+ }
2345
+ function l(e, t, i) {
2346
+ r("update", { items: n.block.items.map((n) => n.id === e ? {
2347
+ ...n,
2348
+ [t]: i
2349
+ } : n) });
2350
+ }
2351
+ function u(e) {
2352
+ r("update", { items: n.block.items.filter((t) => t.id !== e) });
2353
+ }
2354
+ return (t, n) => (s(), f(_, null, [
2355
+ C("div", Bo, [C("label", { class: D(p(W)) }, S(p(a).menu.items), 3), C("div", Vo, [(s(!0), f(_, null, i(e.block.items, (t) => (s(), f("div", {
2356
+ key: t.id,
2357
+ class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
2358
+ }, [
2359
+ C("div", Ho, [C("input", {
2360
+ type: "text",
2361
+ class: D([p(H), "tpl:flex-1"]),
2362
+ value: t.text,
2363
+ placeholder: p(a).menu.text,
2364
+ onInput: (e) => l(t.id, "text", e.target.value)
2365
+ }, null, 42, Uo), C("button", {
2366
+ class: "tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
2367
+ title: p(a).menu.removeItem,
2368
+ onClick: (e) => u(t.id)
2369
+ }, [m(p(I), {
2370
+ size: 14,
2371
+ "stroke-width": 2
2372
+ })], 8, Wo)]),
2373
+ m(X, {
2374
+ "model-value": t.url,
2375
+ type: "url",
2376
+ placeholder: p(a).menu.urlPlaceholder,
2377
+ "onUpdate:modelValue": (e) => l(t.id, "url", e)
2378
+ }, null, 8, [
2379
+ "model-value",
2380
+ "placeholder",
2381
+ "onUpdate:modelValue"
2382
+ ]),
2383
+ C("div", Go, [
2384
+ C("label", Ko, [C("input", {
2385
+ type: "checkbox",
2386
+ checked: t.openInNewTab,
2387
+ class: "tpl:accent-[var(--tpl-primary)]",
2388
+ onChange: (e) => l(t.id, "openInNewTab", e.target.checked)
2389
+ }, null, 40, qo), j(" " + S(p(a).menu.openInNewTab), 1)]),
2390
+ C("label", Jo, [C("input", {
2391
+ type: "checkbox",
2392
+ checked: t.bold,
2393
+ class: "tpl:accent-[var(--tpl-primary)]",
2394
+ onChange: (e) => l(t.id, "bold", e.target.checked)
2395
+ }, null, 40, Yo), j(" " + S(p(a).menu.bold), 1)]),
2396
+ C("label", Xo, [C("input", {
2397
+ type: "checkbox",
2398
+ checked: t.underline,
2399
+ class: "tpl:accent-[var(--tpl-primary)]",
2400
+ onChange: (e) => l(t.id, "underline", e.target.checked)
2401
+ }, null, 40, Zo), j(" " + S(p(a).menu.underline), 1)])
2402
+ ]),
2403
+ C("div", Qo, [C("label", $o, S(p(a).menu.color), 1), m(Y, {
2404
+ "swatch-only": "",
2405
+ "model-value": t.color || e.block.linkColor || e.block.color,
2406
+ "onUpdate:modelValue": (e) => l(t.id, "color", e)
2407
+ }, null, 8, ["model-value", "onUpdate:modelValue"])])
2408
+ ]))), 128)), C("button", {
2409
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
2410
+ onClick: c
2411
+ }, [m(p(B), {
2412
+ size: 14,
2413
+ "stroke-width": 2
2414
+ }), j(" " + S(p(a).menu.addItem), 1)])])]),
2415
+ C("div", es, [C("label", { class: D(p(W)) }, S(p(a).menu.fontFamily), 3), C("select", {
2416
+ class: D(p(H)),
2417
+ value: e.block.fontFamily || "",
2418
+ onChange: n[0] ||= (e) => o("fontFamily", e.target.value || void 0)
2419
+ }, [C("option", ns, S(p(a).title.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
2420
+ key: e.value,
2421
+ value: e.value
2422
+ }, S(e.label), 9, rs))), 128))], 42, ts)]),
2423
+ C("div", is, [C("label", { class: D(p(W)) }, S(p(a).menu.fontSize), 3), C("div", as, [C("input", {
2424
+ type: "number",
2425
+ class: D(p(U)),
2426
+ value: e.block.fontSize,
2427
+ min: "8",
2428
+ max: "48",
2429
+ onInput: n[1] ||= (e) => o("fontSize", Number(e.target.value))
2430
+ }, null, 42, os), C("span", { class: D(p(G)) }, "px", 2)])]),
2431
+ C("div", ss, [C("label", { class: D(p(W)) }, S(p(a).menu.color), 3), m(Y, {
2432
+ "model-value": e.block.color,
2433
+ "onUpdate:modelValue": n[2] ||= (e) => o("color", e)
2434
+ }, null, 8, ["model-value"])]),
2435
+ C("div", cs, [C("label", { class: D(p(W)) }, S(p(a).menu.linkColor), 3), m(Y, {
2436
+ "model-value": e.block.linkColor || e.block.color,
2437
+ "onUpdate:modelValue": n[3] ||= (e) => o("linkColor", e || void 0)
2438
+ }, null, 8, ["model-value"])]),
2439
+ C("div", ls, [C("label", { class: D(p(W)) }, S(p(a).menu.textAlign), 3), m(Q, {
2440
+ options: [
2441
+ {
2442
+ value: "left",
2443
+ label: p(a).title.alignLeft,
2444
+ icon: p(V)
2445
+ },
2446
+ {
2447
+ value: "center",
2448
+ label: p(a).title.alignCenter,
2449
+ icon: p(ft)
2450
+ },
2451
+ {
2452
+ value: "right",
2453
+ label: p(a).title.alignRight,
2454
+ icon: p(ut)
2455
+ }
2456
+ ],
2457
+ "model-value": e.block.textAlign,
2458
+ "onUpdate:modelValue": n[4] ||= (e) => o("textAlign", e)
2459
+ }, null, 8, ["options", "model-value"])]),
2460
+ C("div", us, [C("label", { class: D(p(W)) }, S(p(a).menu.separator), 3), C("input", {
2461
+ type: "text",
2462
+ class: D(p(H)),
2463
+ value: e.block.separator,
2464
+ onInput: n[5] ||= (e) => o("separator", e.target.value)
2465
+ }, null, 42, ds)]),
2466
+ C("div", fs, [C("label", { class: D(p(W)) }, S(p(a).menu.separatorColor), 3), m(Y, {
2467
+ "model-value": e.block.separatorColor,
2468
+ "onUpdate:modelValue": n[6] ||= (e) => o("separatorColor", e)
2469
+ }, null, 8, ["model-value"])]),
2470
+ C("div", ps, [C("label", { class: D(p(W)) }, S(p(a).menu.spacing), 3), C("div", ms, [C("input", {
2471
+ type: "number",
2472
+ class: D(p(U)),
2473
+ value: e.block.spacing,
2474
+ min: "0",
2475
+ max: "50",
2476
+ onInput: n[7] ||= (e) => o("spacing", Number(e.target.value))
2477
+ }, null, 42, hs), C("span", { class: D(p(G)) }, "px", 2)])])
2478
+ ], 64));
2479
+ }
2480
+ }), _s = { class: "tpl:mb-3.5" }, vs = ["value"], ys = ["value"], bs = /* @__PURE__ */ l({
2481
+ __name: "SectionToolbar",
2482
+ props: { block: {} },
2483
+ emits: ["update"],
2484
+ setup(e, { emit: t }) {
2485
+ let n = t, { t: r } = N(), a = T(() => [
2486
+ {
2487
+ value: "1",
2488
+ label: r.section.column1
2489
+ },
2490
+ {
2491
+ value: "2",
2492
+ label: r.section.column2
2493
+ },
2494
+ {
2495
+ value: "3",
2496
+ label: r.section.column3
2497
+ },
2498
+ {
2499
+ value: "1-2",
2500
+ label: r.section.ratio12
2501
+ },
2502
+ {
2503
+ value: "2-1",
2504
+ label: r.section.ratio21
2505
+ }
2506
+ ]);
2507
+ return (t, o) => (s(), f("div", _s, [C("label", { class: D(p(W)) }, S(p(r).section.columns), 3), C("select", {
2508
+ class: D(p(H)),
2509
+ value: e.block.columns,
2510
+ onChange: o[0] ||= (e) => n("update", { columns: e.target.value })
2511
+ }, [(s(!0), f(_, null, i(a.value, (e) => (s(), f("option", {
2512
+ key: e.value,
2513
+ value: e.value
2514
+ }, S(e.label), 9, ys))), 128))], 42, vs)]));
2515
+ }
2516
+ }), xs = { class: "tpl:mb-3.5" }, Ss = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Cs = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ws = ["value", "onChange"], Ts = ["value"], Es = ["title", "onClick"], Ds = { class: "tpl:mb-3.5" }, Os = { class: "tpl:mb-3.5" }, ks = { class: "tpl:mb-3.5" }, As = { class: "tpl:flex tpl:items-stretch" }, js = ["value"], Ms = { class: "tpl:mb-3.5" }, Ns = /* @__PURE__ */ l({
2517
+ __name: "SocialToolbar",
2518
+ props: { block: {} },
2519
+ emits: ["update"],
2520
+ setup(e, { emit: t }) {
2521
+ let n = e, r = t, { t: a } = N();
2522
+ function o(e, t) {
2523
+ r("update", { [e]: t });
2524
+ }
2525
+ function c() {
2526
+ let e = {
2527
+ id: R(),
2528
+ platform: "facebook",
2529
+ url: ""
2530
+ };
2531
+ r("update", { icons: [...n.block.icons, e] });
2532
+ }
2533
+ function l(e, t, i) {
2534
+ r("update", { icons: n.block.icons.map((n) => n.id === e ? {
2535
+ ...n,
2536
+ [t]: i
2537
+ } : n) });
2538
+ }
2539
+ function u(e) {
2540
+ r("update", { icons: n.block.icons.filter((t) => t.id !== e) });
2541
+ }
2542
+ return (t, n) => (s(), f(_, null, [
2543
+ C("div", xs, [C("label", { class: D(p(W)) }, S(p(a).social.icons), 3), C("div", Ss, [(s(!0), f(_, null, i(e.block.icons, (e) => (s(), f("div", {
2544
+ key: e.id,
2545
+ class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
2546
+ }, [C("div", Cs, [C("select", {
2547
+ class: D([p(H), "tpl:flex-1"]),
2548
+ value: e.platform,
2549
+ onChange: (t) => l(e.id, "platform", t.target.value)
2550
+ }, [(s(!0), f(_, null, i(p(F), (e) => (s(), f("option", {
2551
+ key: e,
2552
+ value: e
2553
+ }, S(p(_e)[e].name), 9, Ts))), 128))], 42, ws), C("button", {
2554
+ class: "tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
2555
+ title: p(a).social.removeIcon,
2556
+ onClick: (t) => u(e.id)
2557
+ }, [m(p(I), {
2558
+ size: 14,
2559
+ "stroke-width": 2
2560
+ })], 8, Es)]), m(X, {
2561
+ "model-value": e.url,
2562
+ type: "url",
2563
+ placeholder: p(a).social.urlPlaceholder,
2564
+ "onUpdate:modelValue": (t) => l(e.id, "url", t)
2565
+ }, null, 8, [
2566
+ "model-value",
2567
+ "placeholder",
2568
+ "onUpdate:modelValue"
2569
+ ])]))), 128)), C("button", {
2570
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
2571
+ onClick: c
2572
+ }, [m(p(B), {
2573
+ size: 14,
2574
+ "stroke-width": 2
2575
+ }), j(" " + S(p(a).social.addIcon), 1)])])]),
2576
+ C("div", Ds, [C("label", { class: D(p(W)) }, S(p(a).social.style), 3), m(Q, {
2577
+ options: [
2578
+ {
2579
+ value: "solid",
2580
+ label: p(a).social.styleSolid
2581
+ },
2582
+ {
2583
+ value: "outlined",
2584
+ label: p(a).social.styleOutlined
2585
+ },
2586
+ {
2587
+ value: "rounded",
2588
+ label: p(a).social.styleRounded
2589
+ },
2590
+ {
2591
+ value: "square",
2592
+ label: p(a).social.styleSquare
2593
+ },
2594
+ {
2595
+ value: "circle",
2596
+ label: p(a).social.styleCircle
2597
+ }
2598
+ ],
2599
+ "model-value": e.block.iconStyle,
2600
+ "onUpdate:modelValue": n[0] ||= (e) => o("iconStyle", e)
2601
+ }, null, 8, ["options", "model-value"])]),
2602
+ C("div", Os, [C("label", { class: D(p(W)) }, S(p(a).social.size), 3), m(Q, {
2603
+ options: [
2604
+ {
2605
+ value: "small",
2606
+ label: p(a).social.sizeSmall
2607
+ },
2608
+ {
2609
+ value: "medium",
2610
+ label: p(a).social.sizeMedium
2611
+ },
2612
+ {
2613
+ value: "large",
2614
+ label: p(a).social.sizeLarge
2615
+ }
2616
+ ],
2617
+ "model-value": e.block.iconSize,
2618
+ "onUpdate:modelValue": n[1] ||= (e) => o("iconSize", e)
2619
+ }, null, 8, ["options", "model-value"])]),
2620
+ C("div", ks, [C("label", { class: D(p(W)) }, S(p(a).social.spacing), 3), C("div", As, [C("input", {
2621
+ type: "number",
2622
+ class: D(p(U)),
2623
+ value: e.block.spacing,
2624
+ min: "0",
2625
+ max: "50",
2626
+ onInput: n[2] ||= (e) => o("spacing", Number(e.target.value))
2627
+ }, null, 42, js), C("span", { class: D(p(G)) }, "px", 2)])]),
2628
+ C("div", Ms, [C("label", { class: D(p(W)) }, S(p(a).social.align), 3), m(Q, {
2629
+ options: [
2630
+ {
2631
+ value: "left",
2632
+ label: p(a).title.alignLeft,
2633
+ icon: p(V)
2634
+ },
2635
+ {
2636
+ value: "center",
2637
+ label: p(a).title.alignCenter,
2638
+ icon: p(ft)
2639
+ },
2640
+ {
2641
+ value: "right",
2642
+ label: p(a).title.alignRight,
2643
+ icon: p(ut)
2644
+ }
2645
+ ],
2646
+ "model-value": e.block.align,
2647
+ "onUpdate:modelValue": n[3] ||= (e) => o("align", e)
2648
+ }, null, 8, ["options", "model-value"])])
2649
+ ], 64));
2650
+ }
2651
+ }), Ps = { class: "tpl:mb-3.5" }, Fs = { class: "tpl:flex tpl:items-stretch" }, Is = ["value"], Ls = ["value"], Rs = /* @__PURE__ */ l({
2652
+ __name: "SpacerToolbar",
2653
+ props: { block: {} },
2654
+ emits: ["update"],
2655
+ setup(e, { emit: t }) {
2656
+ let n = t, { t: r } = N();
2657
+ return (t, i) => (s(), f("div", Ps, [
2658
+ C("label", { class: D(p(W)) }, S(p(r).spacer.height), 3),
2659
+ C("div", Fs, [C("input", {
2660
+ type: "number",
2661
+ class: D(p(U)),
2662
+ value: e.block.height,
2663
+ min: "10",
2664
+ max: "100",
2665
+ onInput: i[0] ||= (e) => n("update", { height: Number(e.target.value) })
2666
+ }, null, 42, Is), C("span", { class: D(p(G)) }, "px", 2)]),
2667
+ C("input", {
2668
+ type: "range",
2669
+ class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
2670
+ value: e.block.height,
2671
+ min: "10",
2672
+ max: "100",
2673
+ onInput: i[1] ||= (e) => n("update", { height: Number(e.target.value) })
2674
+ }, null, 40, Ls)
2675
+ ]));
2676
+ }
2677
+ }), zs = { class: "tpl:mb-3.5" }, Bs = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Vs = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Hs = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Us = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, Ws = ["disabled"], Gs = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Ks = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, qs = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Js = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, Ys = ["disabled"], Xs = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Zs = { class: "tpl:mb-3.5" }, Qs = { class: "tpl:mb-1.5 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, $s = ["checked"], ec = {
2678
+ key: 0,
2679
+ class: "tpl:mb-3.5"
2680
+ }, tc = { class: "tpl:mb-3.5" }, nc = { class: "tpl:mb-3.5" }, rc = { class: "tpl:flex tpl:items-stretch" }, ic = ["value"], ac = { class: "tpl:mb-3.5" }, oc = { class: "tpl:flex tpl:items-stretch" }, sc = ["value"], cc = { class: "tpl:mb-3.5" }, lc = ["value"], uc = { value: "" }, dc = ["value"], fc = { class: "tpl:mb-3.5" }, pc = { class: "tpl:flex tpl:items-stretch" }, mc = ["value"], hc = { class: "tpl:mb-3.5" }, gc = { class: "tpl:mb-3.5" }, _c = /* @__PURE__ */ l({
2681
+ __name: "TableToolbar",
2682
+ props: {
2683
+ block: {},
2684
+ fontFamilies: {}
2685
+ },
2686
+ emits: ["update"],
2687
+ setup(e, { emit: t }) {
2688
+ let n = e, r = t, { t: a } = N(), o = T(() => n.block.rows.length > 0 ? n.block.rows[0].cells.length : 0);
2689
+ function c(e, t) {
2690
+ r("update", { [e]: t });
2691
+ }
2692
+ function l() {
2693
+ let e = n.block.rows.length > 0 ? n.block.rows[0].cells.length : 3, t = {
2694
+ id: R(),
2695
+ cells: Array.from({ length: e }, () => ({
2696
+ id: R(),
2697
+ content: ""
2698
+ }))
2699
+ };
2700
+ r("update", { rows: [...n.block.rows, t] });
2701
+ }
2702
+ function u(e) {
2703
+ r("update", { rows: n.block.rows.filter((t) => t.id !== e) });
2704
+ }
2705
+ function d() {
2706
+ r("update", { rows: n.block.rows.map((e) => ({
2707
+ ...e,
2708
+ cells: [...e.cells, {
2709
+ id: R(),
2710
+ content: ""
2711
+ }]
2712
+ })) });
2713
+ }
2714
+ function h(e) {
2715
+ r("update", { rows: n.block.rows.map((t) => ({
2716
+ ...t,
2717
+ cells: t.cells.filter((t, n) => n !== e)
2718
+ })) });
2719
+ }
2720
+ return (t, n) => (s(), f(_, null, [
2721
+ C("div", zs, [C("label", { class: D(p(W)) }, S(p(a).table.dimensions), 3), C("div", Bs, [C("div", Vs, [C("span", Hs, S(p(a).table.rows), 1), C("div", Us, [
2722
+ C("button", {
2723
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
2724
+ disabled: e.block.rows.length <= 1,
2725
+ onClick: n[0] ||= (t) => u(e.block.rows[e.block.rows.length - 1].id)
2726
+ }, [m(p(z), {
2727
+ size: 12,
2728
+ "stroke-width": 2
2729
+ })], 8, Ws),
2730
+ C("span", Gs, S(e.block.rows.length), 1),
2731
+ C("button", {
2732
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
2733
+ onClick: l
2734
+ }, [m(p(B), {
2735
+ size: 12,
2736
+ "stroke-width": 2
2737
+ })])
2738
+ ])]), C("div", Ks, [C("span", qs, S(p(a).table.columns), 1), C("div", Js, [
2739
+ C("button", {
2740
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
2741
+ disabled: o.value <= 1,
2742
+ onClick: n[1] ||= (e) => h(o.value - 1)
2743
+ }, [m(p(z), {
2744
+ size: 12,
2745
+ "stroke-width": 2
2746
+ })], 8, Ys),
2747
+ C("span", Xs, S(o.value), 1),
2748
+ C("button", {
2749
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
2750
+ onClick: d
2751
+ }, [m(p(B), {
2752
+ size: 12,
2753
+ "stroke-width": 2
2754
+ })])
2755
+ ])])])]),
2756
+ C("div", Zs, [C("label", Qs, [C("input", {
2757
+ type: "checkbox",
2758
+ checked: e.block.hasHeaderRow,
2759
+ class: "tpl:accent-[var(--tpl-primary)]",
2760
+ onChange: n[2] ||= (e) => c("hasHeaderRow", e.target.checked)
2761
+ }, null, 40, $s), j(" " + S(p(a).table.hasHeaderRow), 1)])]),
2762
+ e.block.hasHeaderRow ? (s(), f("div", ec, [C("label", { class: D(p(W)) }, S(p(a).table.headerBackgroundColor), 3), m(Y, {
2763
+ "model-value": e.block.headerBackgroundColor || p("#f2f2f2"),
2764
+ placeholder: p(a).table.noHeaderBg,
2765
+ "onUpdate:modelValue": n[3] ||= (e) => c("headerBackgroundColor", e || null)
2766
+ }, null, 8, ["model-value", "placeholder"])])) : v("", !0),
2767
+ C("div", tc, [C("label", { class: D(p(W)) }, S(p(a).table.borderColor), 3), m(Y, {
2768
+ "model-value": e.block.borderColor,
2769
+ "onUpdate:modelValue": n[4] ||= (e) => c("borderColor", e)
2770
+ }, null, 8, ["model-value"])]),
2771
+ C("div", nc, [C("label", { class: D(p(W)) }, S(p(a).table.borderWidth), 3), C("div", rc, [C("input", {
2772
+ type: "number",
2773
+ class: D(p(U)),
2774
+ value: e.block.borderWidth,
2775
+ min: "0",
2776
+ max: "10",
2777
+ onInput: n[5] ||= (e) => c("borderWidth", Number(e.target.value))
2778
+ }, null, 42, ic), C("span", { class: D(p(G)) }, "px", 2)])]),
2779
+ C("div", ac, [C("label", { class: D(p(W)) }, S(p(a).table.cellPadding), 3), C("div", oc, [C("input", {
2780
+ type: "number",
2781
+ class: D(p(U)),
2782
+ value: e.block.cellPadding,
2783
+ min: "0",
2784
+ max: "30",
2785
+ onInput: n[6] ||= (e) => c("cellPadding", Number(e.target.value))
2786
+ }, null, 42, sc), C("span", { class: D(p(G)) }, "px", 2)])]),
2787
+ C("div", cc, [C("label", { class: D(p(W)) }, S(p(a).table.fontFamily), 3), C("select", {
2788
+ class: D(p(H)),
2789
+ value: e.block.fontFamily || "",
2790
+ onChange: n[7] ||= (e) => c("fontFamily", e.target.value || void 0)
2791
+ }, [C("option", uc, S(p(a).title.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
2792
+ key: e.value,
2793
+ value: e.value
2794
+ }, S(e.label), 9, dc))), 128))], 42, lc)]),
2795
+ C("div", fc, [C("label", { class: D(p(W)) }, S(p(a).table.fontSize), 3), C("div", pc, [C("input", {
2796
+ type: "number",
2797
+ class: D(p(U)),
2798
+ value: e.block.fontSize,
2799
+ min: "10",
2800
+ max: "32",
2801
+ onInput: n[8] ||= (e) => c("fontSize", Number(e.target.value))
2802
+ }, null, 42, mc), C("span", { class: D(p(G)) }, "px", 2)])]),
2803
+ C("div", hc, [C("label", { class: D(p(W)) }, S(p(a).table.color), 3), m(Y, {
2804
+ "model-value": e.block.color,
2805
+ "onUpdate:modelValue": n[9] ||= (e) => c("color", e)
2806
+ }, null, 8, ["model-value"])]),
2807
+ C("div", gc, [C("label", { class: D(p(W)) }, S(p(a).table.textAlign), 3), m(Q, {
2808
+ options: [
2809
+ {
2810
+ value: "left",
2811
+ label: p(a).title.alignLeft,
2812
+ icon: p(V)
2813
+ },
2814
+ {
2815
+ value: "center",
2816
+ label: p(a).title.alignCenter,
2817
+ icon: p(ft)
2818
+ },
2819
+ {
2820
+ value: "right",
2821
+ label: p(a).title.alignRight,
2822
+ icon: p(ut)
2823
+ }
2824
+ ],
2825
+ "model-value": e.block.textAlign,
2826
+ "onUpdate:modelValue": n[10] ||= (e) => c("textAlign", e)
2827
+ }, null, 8, ["options", "model-value"])])
2828
+ ], 64));
2829
+ }
2830
+ }), vc = { class: "tpl:mb-3.5" }, yc = ["value"], bc = { value: 1 }, xc = { value: 2 }, Sc = { value: 3 }, Cc = { value: 4 }, wc = { class: "tpl:mb-3.5" }, Tc = ["value"], Ec = { value: "" }, Dc = ["value"], Oc = { class: "tpl:mb-3.5" }, kc = { class: "tpl:mb-3.5" }, Ac = /* @__PURE__ */ l({
2831
+ __name: "TitleToolbar",
2832
+ props: {
2833
+ block: {},
2834
+ fontFamilies: {}
2835
+ },
2836
+ emits: ["update"],
2837
+ setup(e, { emit: t }) {
2838
+ let n = t, { t: r } = N();
2839
+ function a(e, t) {
2840
+ n("update", { [e]: t });
2841
+ }
2842
+ return (t, n) => (s(), f(_, null, [
2843
+ C("div", vc, [C("label", { class: D(p(W)) }, S(p(r).title.level), 3), C("select", {
2844
+ class: D(p(H)),
2845
+ value: e.block.level,
2846
+ onChange: n[0] ||= (e) => a("level", Number(e.target.value))
2847
+ }, [
2848
+ C("option", bc, S(p(r).title.heading1), 1),
2849
+ C("option", xc, S(p(r).title.heading2), 1),
2850
+ C("option", Sc, S(p(r).title.heading3), 1),
2851
+ C("option", Cc, S(p(r).title.heading4), 1)
2852
+ ], 42, yc)]),
2853
+ C("div", wc, [C("label", { class: D(p(W)) }, S(p(r).title.fontFamily), 3), C("select", {
2854
+ class: D(p(H)),
2855
+ value: e.block.fontFamily || "",
2856
+ onChange: n[1] ||= (e) => a("fontFamily", e.target.value || void 0)
2857
+ }, [C("option", Ec, S(p(r).title.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
2858
+ key: e.value,
2859
+ value: e.value
2860
+ }, S(e.label), 9, Dc))), 128))], 42, Tc)]),
2861
+ C("div", Oc, [C("label", { class: D(p(W)) }, S(p(r).title.color), 3), m(Y, {
2862
+ "model-value": e.block.color,
2863
+ "onUpdate:modelValue": n[2] ||= (e) => a("color", e)
2864
+ }, null, 8, ["model-value"])]),
2865
+ C("div", kc, [C("label", { class: D(p(W)) }, S(p(r).title.align), 3), m(Q, {
2866
+ options: [
2867
+ {
2868
+ value: "left",
2869
+ label: p(r).title.alignLeft,
2870
+ icon: p(V)
2871
+ },
2872
+ {
2873
+ value: "center",
2874
+ label: p(r).title.alignCenter,
2875
+ icon: p(ft)
2876
+ },
2877
+ {
2878
+ value: "right",
2879
+ label: p(r).title.alignRight,
2880
+ icon: p(ut)
2881
+ }
2882
+ ],
2883
+ "model-value": e.block.textAlign,
2884
+ "onUpdate:modelValue": n[3] ||= (e) => a("textAlign", e)
2885
+ }, null, 8, ["options", "model-value"])])
2886
+ ], 64));
2887
+ }
2888
+ }), jc = ["aria-label"], Mc = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, Nc = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, Pc = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Fc = { class: "tpl:flex tpl:gap-1" }, Ic = ["title"], Lc = ["title"], Rc = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, zc = /* @__PURE__ */ M(/* @__PURE__ */ l({
2889
+ __name: "Toolbar",
2890
+ props: { block: {} },
2891
+ emits: [
2892
+ "update",
2893
+ "delete",
2894
+ "duplicate"
2895
+ ],
2896
+ setup(e, { emit: t }) {
2897
+ let n = e, i = t, { t: a } = N(), o = Me(xe, "Toolbar"), l = r(P, []), u = T(() => n.block.type), d = T(() => Ye(n.block)), h = T(() => {
2898
+ if (d.value) return l.find((e) => e.type === n.block.customType);
2899
+ }), g = T(() => d.value ? h.value?.name ?? n.block.customType : ze(u.value, a)), b = o.fonts;
2900
+ function x(e) {
2901
+ i("update", e);
2902
+ }
2903
+ return (t, n) => (s(), f("aside", {
2904
+ "aria-label": p(a).landmarks.blockToolbar,
2905
+ class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
2906
+ }, [C("div", Mc, [C("div", Nc, [p(gt)[u.value] ? (s(), y(c(p(gt)[u.value]), {
2907
+ key: 0,
2908
+ size: 16,
2909
+ "stroke-width": 1.5
2910
+ })) : d.value ? (s(), y(p(ke), {
2911
+ key: 1,
2912
+ size: 16,
2913
+ "stroke-width": 1.5
2914
+ })) : v("", !0), C("h3", Pc, S(g.value), 1)]), C("div", Fc, [C("button", {
2915
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)] tpl:hover:text-[var(--tpl-text)]",
2916
+ title: p(a).toolbar.duplicate,
2917
+ onClick: n[0] ||= (e) => i("duplicate")
2918
+ }, [m(p(Xe), {
2919
+ size: 14,
2920
+ "stroke-width": 2
2921
+ })], 8, Ic), C("button", {
2922
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
2923
+ title: p(a).toolbar.delete,
2924
+ onClick: n[1] ||= (e) => i("delete")
2925
+ }, [m(p(Ge), {
2926
+ size: 14,
2927
+ "stroke-width": 2
2928
+ })], 8, Lc)])]), C("div", Rc, [d.value ? (s(), y(_o, {
2929
+ key: 0,
2930
+ block: e.block,
2931
+ onUpdateFieldValues: n[2] ||= (e) => i("update", { fieldValues: e }),
2932
+ onUpdateDataSourceFetched: n[3] ||= (e) => i("update", { dataSourceFetched: e })
2933
+ }, null, 8, ["block"])) : u.value === "section" ? (s(), y(bs, {
2934
+ key: 1,
2935
+ block: e.block,
2936
+ onUpdate: x
2937
+ }, null, 8, ["block"])) : u.value === "title" ? (s(), y(Ac, {
2938
+ key: 2,
2939
+ block: e.block,
2940
+ "font-families": p(b),
2941
+ onUpdate: x
2942
+ }, null, 8, ["block", "font-families"])) : u.value === "paragraph" ? (s(), f(_, { key: 3 }, [], 64)) : u.value === "image" ? (s(), y(zo, {
2943
+ key: 4,
2944
+ block: e.block,
2945
+ onUpdate: x
2946
+ }, null, 8, ["block"])) : u.value === "button" ? (s(), y(Br, {
2947
+ key: 5,
2948
+ block: e.block,
2949
+ "font-families": p(b),
2950
+ onUpdate: x
2951
+ }, null, 8, ["block", "font-families"])) : u.value === "divider" ? (s(), y(Co, {
2952
+ key: 6,
2953
+ block: e.block,
2954
+ onUpdate: x
2955
+ }, null, 8, ["block"])) : u.value === "social" ? (s(), y(Ns, {
2956
+ key: 7,
2957
+ block: e.block,
2958
+ onUpdate: x
2959
+ }, null, 8, ["block"])) : u.value === "menu" ? (s(), y(gs, {
2960
+ key: 8,
2961
+ block: e.block,
2962
+ "font-families": p(b),
2963
+ onUpdate: x
2964
+ }, null, 8, ["block", "font-families"])) : u.value === "table" ? (s(), y(_c, {
2965
+ key: 9,
2966
+ block: e.block,
2967
+ "font-families": p(b),
2968
+ onUpdate: x
2969
+ }, null, 8, ["block", "font-families"])) : u.value === "spacer" ? (s(), y(Rs, {
2970
+ key: 10,
2971
+ block: e.block,
2972
+ onUpdate: x
2973
+ }, null, 8, ["block"])) : u.value === "html" ? (s(), y(Do, {
2974
+ key: 11,
2975
+ block: e.block,
2976
+ onUpdate: x
2977
+ }, null, 8, ["block"])) : u.value === "countdown" ? (s(), y(Na, {
2978
+ key: 12,
2979
+ block: e.block,
2980
+ "font-families": p(b),
2981
+ onUpdate: x
2982
+ }, null, 8, ["block", "font-families"])) : v("", !0), m(Hi, {
2983
+ block: e.block,
2984
+ "is-first-section": u.value === "paragraph",
2985
+ onUpdate: x
2986
+ }, null, 8, ["block", "is-first-section"])])], 8, jc));
2987
+ }
2988
+ }), [["__scopeId", "data-v-fb6efed6"]]), Bc = ["aria-label"], Vc = {
2989
+ role: "tablist",
2990
+ class: "tpl:relative tpl:flex tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
2991
+ }, Hc = ["aria-selected"], Uc = ["aria-selected"], Wc = {
2992
+ key: 0,
2993
+ id: "tpl-tabpanel-content",
2994
+ role: "tabpanel",
2995
+ "aria-labelledby": "tpl-tab-content",
2996
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
2997
+ }, Gc = {
2998
+ key: 1,
2999
+ class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:px-6 tpl:py-10 tpl:text-center tpl:text-[var(--tpl-text-muted)]"
3000
+ }, Kc = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, qc = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Jc = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, Yc = {
3001
+ key: 1,
3002
+ id: "tpl-tabpanel-settings",
3003
+ role: "tabpanel",
3004
+ "aria-labelledby": "tpl-tab-settings",
3005
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
3006
+ }, Xc = /* @__PURE__ */ l({
3007
+ __name: "RightSidebar",
3008
+ props: {
3009
+ selectedBlock: {},
3010
+ settings: {},
3011
+ shiftedLeft: { type: Boolean }
3012
+ },
3013
+ emits: [
3014
+ "update-block",
3015
+ "delete-block",
3016
+ "duplicate-block",
3017
+ "update-settings"
3018
+ ],
3019
+ setup(e, { emit: r }) {
3020
+ let i = e, a = r, { t: o } = N(), c = t("content"), l = T(() => c.value === "content" ? "tpl:translate-x-0" : "tpl:translate-x-full");
3021
+ return n(() => i.selectedBlock, (e) => {
3022
+ e && (c.value = "content");
3023
+ }), (t, n) => (s(), f("aside", {
3024
+ "aria-label": p(o).landmarks.rightSidebar,
3025
+ class: D(["tpl-right-sidebar tpl:absolute tpl:top-14 tpl:bottom-0 tpl:z-40 tpl:flex tpl:w-[320px] tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)] tpl:transition-all tpl:duration-200 tpl:border-l tpl:border-[var(--tpl-border)]", e.shiftedLeft ? "tpl:right-[360px]" : "tpl:right-0"])
3026
+ }, [
3027
+ C("div", Vc, [
3028
+ C("div", { class: D(["tpl:absolute tpl:bottom-0 tpl:left-0 tpl:h-full tpl:w-1/2 tpl:p-1.5 tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", l.value]) }, [...n[6] ||= [C("div", { class: "tpl:h-full tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow)]" }, null, -1)]], 2),
3029
+ C("button", {
3030
+ id: "tpl-tab-content",
3031
+ role: "tab",
3032
+ "aria-selected": c.value === "content",
3033
+ "aria-controls": "tpl-tabpanel-content",
3034
+ class: D(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]", c.value === "content" ? "tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),
3035
+ onClick: n[0] ||= (e) => c.value = "content"
3036
+ }, [m(p(it), {
3037
+ size: 14,
3038
+ "stroke-width": 2
3039
+ }), j(" " + S(p(o).sidebar.content), 1)], 10, Hc),
3040
+ C("button", {
3041
+ id: "tpl-tab-settings",
3042
+ role: "tab",
3043
+ "aria-selected": c.value === "settings",
3044
+ "aria-controls": "tpl-tabpanel-settings",
3045
+ class: D(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]", c.value === "settings" ? "tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),
3046
+ onClick: n[1] ||= (e) => c.value = "settings"
3047
+ }, [m(p(mt), {
3048
+ size: 14,
3049
+ "stroke-width": 1.5
3050
+ }), j(" " + S(p(o).sidebar.settings), 1)], 10, Uc)
3051
+ ]),
3052
+ c.value === "content" ? (s(), f("div", Wc, [e.selectedBlock ? (s(), y(zc, {
3053
+ key: 0,
3054
+ block: e.selectedBlock,
3055
+ onUpdate: n[2] ||= (e) => a("update-block", e),
3056
+ onDelete: n[3] ||= (e) => a("delete-block"),
3057
+ onDuplicate: n[4] ||= (e) => a("duplicate-block")
3058
+ }, null, 8, ["block"])) : (s(), f("div", Gc, [
3059
+ C("div", Kc, [m(p($e), {
3060
+ size: 40,
3061
+ "stroke-width": 1.5
3062
+ })]),
3063
+ C("h3", qc, S(p(o).sidebar.noSelection), 1),
3064
+ C("p", Jc, S(p(o).sidebar.noSelectionHint), 1)
3065
+ ]))])) : v("", !0),
3066
+ c.value === "settings" ? (s(), f("div", Yc, [m(lr, {
3067
+ settings: e.settings,
3068
+ onUpdate: n[5] ||= (e) => a("update-settings", e)
3069
+ }, null, 8, ["settings"])])) : v("", !0)
3070
+ ], 10, Bc));
3071
+ }
3072
+ }), Zc = ["aria-label"], Qc = [
3073
+ "aria-checked",
3074
+ "aria-label",
3075
+ "title",
3076
+ "onClick"
3077
+ ], $c = /* @__PURE__ */ l({
3078
+ __name: "ViewportToggle",
3079
+ props: { viewport: {} },
3080
+ emits: ["change"],
3081
+ setup(e, { emit: t }) {
3082
+ let n = e, r = t, { t: a } = N(), o = T(() => [
3083
+ {
3084
+ value: "desktop",
3085
+ label: a.viewport.desktop
3086
+ },
3087
+ {
3088
+ value: "tablet",
3089
+ label: a.viewport.tablet
3090
+ },
3091
+ {
3092
+ value: "mobile",
3093
+ label: a.viewport.mobile
3094
+ }
3095
+ ]), c = T(() => `translateX(${o.value.findIndex((e) => e.value === n.viewport) * 100}%)`);
3096
+ return (t, n) => (s(), f("div", {
3097
+ role: "radiogroup",
3098
+ "aria-label": p(a).viewport.label,
3099
+ class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
3100
+ style: g({
3101
+ gridTemplateColumns: `repeat(${o.value.length}, 1fr)`,
3102
+ backgroundColor: "var(--tpl-bg-hover)"
3103
+ })
3104
+ }, [C("div", {
3105
+ class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
3106
+ style: g({
3107
+ left: "4px",
3108
+ width: `calc((100% - 8px) / ${o.value.length})`,
3109
+ transform: c.value,
3110
+ backgroundColor: "var(--tpl-bg)",
3111
+ boxShadow: "var(--tpl-shadow)",
3112
+ transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
3113
+ })
3114
+ }, null, 4), (s(!0), f(_, null, i(o.value, (t) => (s(), f("button", {
3115
+ key: t.value,
3116
+ role: "radio",
3117
+ "aria-checked": e.viewport === t.value,
3118
+ "aria-label": t.label,
3119
+ class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium",
3120
+ style: g({
3121
+ color: e.viewport === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3122
+ transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
3123
+ }),
3124
+ title: t.label,
3125
+ onClick: (e) => r("change", t.value)
3126
+ }, [t.value === "desktop" ? (s(), y(p(rt), {
3127
+ key: 0,
3128
+ size: 18,
3129
+ "stroke-width": 1.5
3130
+ })) : t.value === "tablet" ? (s(), y(p(st), {
3131
+ key: 1,
3132
+ size: 18,
3133
+ "stroke-width": 1.5
3134
+ })) : (s(), y(p(at), {
3135
+ key: 2,
3136
+ size: 18,
3137
+ "stroke-width": 1.5
3138
+ })), C("span", null, S(t.label), 1)], 12, Qc))), 128))], 12, Zc));
3139
+ }
3140
+ }), el = [
3141
+ "aria-label",
3142
+ "title",
3143
+ "aria-pressed"
3144
+ ], tl = /* @__PURE__ */ M(/* @__PURE__ */ l({
3145
+ __name: "PreviewToggle",
3146
+ props: { previewMode: { type: Boolean } },
3147
+ emits: ["change"],
3148
+ setup(e, { emit: t }) {
3149
+ let n = t, { t: r } = N();
3150
+ return (t, i) => (s(), f("button", {
3151
+ class: "tpl-preview-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
3152
+ style: g({
3153
+ color: e.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3154
+ backgroundColor: e.previewMode ? "var(--tpl-primary-light)" : "transparent"
3155
+ }),
3156
+ "aria-label": e.previewMode ? p(r).previewMode.disable : p(r).previewMode.enable,
3157
+ title: e.previewMode ? p(r).previewMode.disable : p(r).previewMode.enable,
3158
+ "aria-pressed": e.previewMode,
3159
+ onClick: i[0] ||= (t) => n("change", !e.previewMode)
3160
+ }, [m(w, {
3161
+ "enter-active-class": "tpl-icon-enter-active",
3162
+ "leave-active-class": "tpl-icon-leave-active",
3163
+ "enter-from-class": "tpl-icon-enter-from",
3164
+ "leave-to-class": "tpl-icon-leave-to",
3165
+ mode: "out-in"
3166
+ }, {
3167
+ default: a(() => [e.previewMode ? (s(), y(p(De), {
3168
+ key: "eye",
3169
+ size: 18,
3170
+ "stroke-width": 1.5
3171
+ })) : (s(), y(p(Je), {
3172
+ key: "eye-off",
3173
+ size: 18,
3174
+ "stroke-width": 1.5
3175
+ }))]),
3176
+ _: 1
3177
+ })], 12, el));
3178
+ }
3179
+ }), [["__scopeId", "data-v-af87d02a"]]), nl = [
3180
+ "aria-label",
3181
+ "title",
3182
+ "aria-pressed"
3183
+ ], rl = /* @__PURE__ */ M(/* @__PURE__ */ l({
3184
+ __name: "DarkModeToggle",
3185
+ props: { darkMode: { type: Boolean } },
3186
+ emits: ["change"],
3187
+ setup(e, { emit: t }) {
3188
+ let n = t, { t: r } = N();
3189
+ return (t, i) => (s(), f("button", {
3190
+ class: "tpl-dark-mode-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
3191
+ style: g({
3192
+ color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3193
+ backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
3194
+ }),
3195
+ "aria-label": e.darkMode ? p(r).darkMode.disable : p(r).darkMode.enable,
3196
+ title: e.darkMode ? p(r).darkMode.disable : p(r).darkMode.enable,
3197
+ "aria-pressed": e.darkMode,
3198
+ onClick: i[0] ||= (t) => n("change", !e.darkMode)
3199
+ }, [m(w, {
3200
+ "enter-active-class": "tpl-icon-enter-active",
3201
+ "leave-active-class": "tpl-icon-leave-active",
3202
+ "enter-from-class": "tpl-icon-enter-from",
3203
+ "leave-to-class": "tpl-icon-leave-to",
3204
+ mode: "out-in"
3205
+ }, {
3206
+ default: a(() => [e.darkMode ? (s(), y(p(nt), {
3207
+ key: "moon",
3208
+ size: 18,
3209
+ "stroke-width": 1.5
3210
+ })) : (s(), y(p(pt), {
3211
+ key: "sun",
3212
+ size: 18,
3213
+ "stroke-width": 1.5
3214
+ }))]),
3215
+ _: 1
3216
+ })], 12, nl));
3217
+ }
3218
+ }), [["__scopeId", "data-v-f8694f76"]]);
3219
+ //#endregion
3220
+ export { Bt as a, Xc as i, tl as n, jt as o, $c as r, rl as t };
3221
+
3222
+ //# sourceMappingURL=styles-DQFExz-T.js.map