@templatical/editor 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/{AiChatSidebar-B0-U5-sb.js → AiChatSidebar-BIKvYREk.js} +57 -56
  2. package/dist/{AiFeatureMenu-DxDwLS8B.js → AiFeatureMenu-QbD82crt.js} +23 -23
  3. package/dist/{BlockIssueBadge-C-EPqWsh.js → BlockIssueBadge-B3xVgMTh.js} +11 -11
  4. package/dist/CloudEditor-DptuSf7A.js +1234 -0
  5. package/dist/{CollaboratorBar-DgwjisX2.js → CollaboratorBar-DrA_K69w.js} +20 -20
  6. package/dist/{CommentsSidebar-CpRLN40c.js → CommentsSidebar-D_tSGvTX.js} +158 -157
  7. package/dist/CountdownBlock-apiYUhkQ.js +92 -0
  8. package/dist/CountdownToolbar-CS0axcjz.js +210 -0
  9. package/dist/{DesignReferenceSidebar-BgPDbOsl.js → DesignReferenceSidebar-DWYK9nTk.js} +58 -57
  10. package/dist/{IssuesPanel-I0z6k6-H.js → IssuesPanel-CR1MPaDE.js} +40 -40
  11. package/dist/{LoadingTrack-C7mGWPHS.js → LoadingTrack-DsecR8Rw.js} +1 -1
  12. package/dist/MergeTagSuggestion-CH2SUxBo.js +1327 -0
  13. package/dist/ModuleBrowserModal-D45rBj5C.js +202 -0
  14. package/dist/{ModulePreviewCanvas-Dni9kK4j.js → ModulePreviewCanvas-BiQ6B2-l.js} +29 -29
  15. package/dist/{NumberWithSuffix-D3fdj0iO.js → NumberWithSuffix-CrA6quxx.js} +143 -142
  16. package/dist/ParagraphEditor-1NaUJpZO.js +721 -0
  17. package/dist/{RichTextEditorContent-Q5altsx1.js → RichTextEditorContent-BqLHIZY7.js} +45 -44
  18. package/dist/{SaveModuleDialog-C38VqN2T.js → SaveModuleDialog-B0sPOTgO.js} +38 -37
  19. package/dist/{SnapshotHistory-ByloTpwh.js → SnapshotHistory-DslVzmSb.js} +34 -33
  20. package/dist/{TemplateScoringPanel-CUxiPtEf.js → TemplateScoringPanel-CZ62rGHz.js} +83 -82
  21. package/dist/{TestEmailModal-BvZBMBad.js → TestEmailModal-DWGniJVu.js} +22 -21
  22. package/dist/TitleEditor-D4t_gZZJ.js +193 -0
  23. package/dist/{TplModal-BYb-X5Bj.js → TplModal-Br2VG6cn.js} +14 -13
  24. package/dist/{blockTypeIcons-CyAom3iI.js → blockTypeIcons-CXhCS5WV.js} +5 -5
  25. package/dist/bundle-stats.json +8 -8
  26. package/dist/cdn/chunks/{AiFeatureMenu-BSoy-SoF.js → AiFeatureMenu-3Slo_LGA.js} +8 -8
  27. package/dist/cdn/chunks/{AiFeatureMenu-BSoy-SoF.js.map → AiFeatureMenu-3Slo_LGA.js.map} +1 -1
  28. package/dist/cdn/chunks/{BlockIssueBadge-BQDUuJxy.js → BlockIssueBadge-BxwEiiF3.js} +5 -5
  29. package/dist/cdn/chunks/{BlockIssueBadge-BQDUuJxy.js.map → BlockIssueBadge-BxwEiiF3.js.map} +1 -1
  30. package/dist/cdn/chunks/{CloudEditor-BZuzsQOZ.js → CloudEditor-DFIFWD9G.js} +163 -161
  31. package/dist/cdn/chunks/CloudEditor-DFIFWD9G.js.map +1 -0
  32. package/dist/cdn/chunks/{CollaboratorBar-DUpSrtDr.js → CollaboratorBar-Cu3vuN66.js} +4 -4
  33. package/dist/cdn/chunks/{CollaboratorBar-DUpSrtDr.js.map → CollaboratorBar-Cu3vuN66.js.map} +1 -1
  34. package/dist/cdn/chunks/{CountdownBlock-DChGTAsH.js → CountdownBlock-BEVAJQtQ.js} +3 -3
  35. package/dist/cdn/chunks/{CountdownBlock-DChGTAsH.js.map → CountdownBlock-BEVAJQtQ.js.map} +1 -1
  36. package/dist/cdn/chunks/{CountdownToolbar-C6gX2SJr.js → CountdownToolbar-CI2sQZv5.js} +4 -4
  37. package/dist/cdn/chunks/{CountdownToolbar-C6gX2SJr.js.map → CountdownToolbar-CI2sQZv5.js.map} +1 -1
  38. package/dist/cdn/chunks/{IssuesPanel-Bo1uhdSe.js → IssuesPanel-BdeDoTcn.js} +11 -11
  39. package/dist/cdn/chunks/{IssuesPanel-Bo1uhdSe.js.map → IssuesPanel-BdeDoTcn.js.map} +1 -1
  40. package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js +213 -0
  41. package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js.map +1 -0
  42. package/dist/cdn/chunks/{ModuleBrowserModal-a-tZRCcD.js → ModuleBrowserModal-Dz-I5zfj.js} +11 -8
  43. package/dist/cdn/chunks/{ModuleBrowserModal-a-tZRCcD.js.map → ModuleBrowserModal-Dz-I5zfj.js.map} +1 -1
  44. package/dist/cdn/chunks/{ModulePreviewCanvas-Bm6k0Op0.js → ModulePreviewCanvas-BfinyuAN.js} +21 -21
  45. package/dist/cdn/chunks/{ModulePreviewCanvas-Bm6k0Op0.js.map → ModulePreviewCanvas-BfinyuAN.js.map} +1 -1
  46. package/dist/cdn/chunks/{NumberWithSuffix-HTbuD3VJ.js → NumberWithSuffix-CDjEa08X.js} +4 -4
  47. package/dist/cdn/chunks/{NumberWithSuffix-HTbuD3VJ.js.map → NumberWithSuffix-CDjEa08X.js.map} +1 -1
  48. package/dist/cdn/chunks/{ParagraphEditor-pGrfSccu.js → ParagraphEditor-B3fG0vge.js} +130 -110
  49. package/dist/cdn/chunks/ParagraphEditor-B3fG0vge.js.map +1 -0
  50. package/dist/cdn/chunks/{RichTextEditorContent-D7XZix_1.js → RichTextEditorContent-C6YPCp9j.js} +4 -4
  51. package/dist/cdn/chunks/{RichTextEditorContent-D7XZix_1.js.map → RichTextEditorContent-C6YPCp9j.js.map} +1 -1
  52. package/dist/cdn/chunks/{SaveModuleDialog-C9PQ9x6j.js → SaveModuleDialog-C6UIIVAM.js} +6 -6
  53. package/dist/cdn/chunks/{SaveModuleDialog-C9PQ9x6j.js.map → SaveModuleDialog-C6UIIVAM.js.map} +1 -1
  54. package/dist/cdn/chunks/{TitleEditor-BvFbL16O.js → TitleEditor-BiZbLYF1.js} +62 -46
  55. package/dist/cdn/chunks/TitleEditor-BiZbLYF1.js.map +1 -0
  56. package/dist/cdn/chunks/blockTypeIcons-BernVG06.js +22 -0
  57. package/dist/cdn/chunks/{blockTypeIcons-Kd1MT0u8.js.map → blockTypeIcons-BernVG06.js.map} +1 -1
  58. package/dist/{de-C2wOXoxs.js → cdn/chunks/de-LsV0u1tP.js} +19 -1
  59. package/dist/cdn/chunks/de-LsV0u1tP.js.map +1 -0
  60. package/dist/cdn/chunks/{draggable-Bci-fq8y.js → draggable-kG-D5Xsm.js} +19 -10
  61. package/dist/cdn/chunks/draggable-kG-D5Xsm.js.map +1 -0
  62. package/dist/cdn/chunks/{en-dR7zfNC3.js → en-Bb8X1bOs.js} +18 -2
  63. package/dist/cdn/chunks/en-Bb8X1bOs.js.map +1 -0
  64. package/dist/cdn/chunks/extensions-Drp8UDc6.js +421 -0
  65. package/dist/cdn/chunks/extensions-Drp8UDc6.js.map +1 -0
  66. package/dist/cdn/chunks/{features-DU6lA8l1.js → features-Dpczf9Su.js} +1171 -994
  67. package/dist/cdn/chunks/features-Dpczf9Su.js.map +1 -0
  68. package/dist/cdn/chunks/{icons-BjHUZZyJ.js → icons-CuxnJiGQ.js} +170 -164
  69. package/dist/cdn/chunks/icons-CuxnJiGQ.js.map +1 -0
  70. package/dist/cdn/chunks/{liquid.browser-DKKBzRQu.js → liquid.browser-BJOEu6Cg.js} +693 -678
  71. package/dist/cdn/chunks/liquid.browser-BJOEu6Cg.js.map +1 -0
  72. package/dist/cdn/chunks/{media-library-Byelliig.js → media-library-CiYl_BO7.js} +556 -554
  73. package/dist/cdn/chunks/{media-library-Byelliig.js.map → media-library-CiYl_BO7.js.map} +1 -1
  74. package/dist/cdn/chunks/{pt-BR-BZ86xqK6.js → pt-BR-BwJY_cvb.js} +18 -2
  75. package/dist/cdn/chunks/pt-BR-BwJY_cvb.js.map +1 -0
  76. package/dist/cdn/chunks/{pusher-BICWUP2j.js → pusher-CIwiKF8H.js} +9 -6
  77. package/dist/cdn/chunks/{pusher-BICWUP2j.js.map → pusher-CIwiKF8H.js.map} +1 -1
  78. package/dist/cdn/chunks/quality-CNjGxBG0.js +2176 -0
  79. package/dist/cdn/chunks/{quality-DNnYAntR.js.map → quality-CNjGxBG0.js.map} +1 -1
  80. package/dist/cdn/chunks/{renderer-CZKO-Tav.js → renderer-CFkg8h-K.js} +40 -31
  81. package/dist/cdn/chunks/renderer-CFkg8h-K.js.map +1 -0
  82. package/dist/cdn/chunks/{src-DsqSXXjk.js → src-DRpKu4Dy.js} +11 -11
  83. package/dist/cdn/chunks/{src-DsqSXXjk.js.map → src-DRpKu4Dy.js.map} +1 -1
  84. package/dist/cdn/chunks/styles-B7wryV0l.js +3943 -0
  85. package/dist/cdn/chunks/styles-B7wryV0l.js.map +1 -0
  86. package/dist/cdn/chunks/{tiptap-CwScfbsM.js → tiptap-DF9PEiqH.js} +5429 -5373
  87. package/dist/cdn/chunks/tiptap-DF9PEiqH.js.map +1 -0
  88. package/dist/cdn/editor.css +1 -1
  89. package/dist/cdn/editor.js +117 -115
  90. package/dist/cdn/editor.js.map +1 -1
  91. package/dist/{check-BRzXxFHr.js → check-rl7ok6uJ.js} +1 -1
  92. package/dist/{chevron-down-DmEgzmYT.js → chevron-down-BKe__NOD.js} +1 -1
  93. package/dist/{circle-alert-BStvZr3O.js → circle-alert-C8xmpMsK.js} +1 -1
  94. package/dist/{clock-Blwp_1R6.js → clock-BW4JuDCN.js} +1 -1
  95. package/dist/{cloud-_olro76D.js → cloud-BQusL53H.js} +208 -208
  96. package/dist/createLucideIcon-Dx-EjR9r.js +43 -0
  97. package/dist/{cdn/chunks/de-C2wOXoxs.js → de-LsV0u1tP.js} +17 -3
  98. package/dist/{dist-BlG7k25W.js → dist-B5Sov3sS.js} +7 -7
  99. package/dist/dist-BEWiuOMi.js +251 -0
  100. package/dist/{dist-b7Ak-CuM.js → dist-BFmE-7hB.js} +2 -2
  101. package/dist/{dist-o73iaGqy.js → dist-BMoa33wT.js} +2 -2
  102. package/dist/{dist-BctFrpeA.js → dist-BibU4HNl.js} +74 -65
  103. package/dist/{dist-D6x1cQeh.js → dist-BsCGIDSt.js} +103 -102
  104. package/dist/dist-CNLKj9wa.js +5 -0
  105. package/dist/{dist-DULfKmTh.js → dist-CNXDNYQn.js} +729 -695
  106. package/dist/{dist-412xXefB.js → dist-COG3IdPK.js} +3 -3
  107. package/dist/{dist-Cz79qrLL.js → dist-CQZxDvFw.js} +3 -3
  108. package/dist/{dist-BwgjpLfr.js → dist-CRsjOQM-.js} +2 -2
  109. package/dist/dist-CTT6WYJ6.js +134 -0
  110. package/dist/dist-Cqa6aeAJ.js +5 -0
  111. package/dist/{dist-BCQZZUE9.js → dist-SXJJ2v41.js} +2 -2
  112. package/dist/{dist-DhKTdU52.js → dist-itdjZraK.js} +1445 -1420
  113. package/dist/{en-dR7zfNC3.js → en-Bb8X1bOs.js} +17 -1
  114. package/dist/extensions-DwaZAqm6.js +423 -0
  115. package/dist/{image-up-BFPbw_Zq.js → image-up-BwBCmQ4P.js} +1 -1
  116. package/dist/index.d.ts +17 -0
  117. package/dist/{info-B_qLEBN2.js → info-TCn7uWR5.js} +1 -1
  118. package/dist/keys-Cv8-8GsD.js +10 -0
  119. package/dist/{liquid.browser-CVjP5Mex.js → liquid.browser-DZLtv26k.js} +692 -677
  120. package/dist/{list-checks-CGg7JxPm.js → list-checks-CSrOWNgq.js} +1 -1
  121. package/dist/{loader-circle-CDF8eR_Q.js → loader-circle-BLmicnPG.js} +1 -1
  122. package/dist/{message-circle-C3cHsCJl.js → message-circle-C9hHMQCI.js} +1 -1
  123. package/dist/{pt-BR-BZ86xqK6.js → pt-BR-BwJY_cvb.js} +17 -1
  124. package/dist/{refresh-cw-Butml7Q4.js → refresh-cw-D1JQ1LNa.js} +1 -1
  125. package/dist/runtime-dom.esm-bundler-BzuoCyNp.js +523 -0
  126. package/dist/scan-line-DgijVq9y.js +31 -0
  127. package/dist/{send-k7npFJNO.js → send-DjPdq69F.js} +1 -1
  128. package/dist/{shield-check-CV6GbmCu.js → shield-check-Bqluu8FS.js} +1 -1
  129. package/dist/{sparkles-C965Xop4.js → sparkles-M4azPVSP.js} +1 -1
  130. package/dist/style.css +1 -1
  131. package/dist/styles-D7fQ7f_1.js +4164 -0
  132. package/dist/templatical-editor.js +155 -152
  133. package/dist/{text-align-start-Bxnps8fH.js → text-align-start-CMya5pCQ.js} +11 -11
  134. package/dist/{trash-2-DpGb7fIt.js → trash-2-C-81rkLS.js} +1 -1
  135. package/dist/{triangle-alert-BKYElAwz.js → triangle-alert-BuRWnynk.js} +1 -1
  136. package/dist/{upload-BF7sxd1_.js → upload-CWBIoLd4.js} +1 -1
  137. package/dist/{useAliveFlag-BinvbqQR.js → useAliveFlag-CECL_OUb.js} +1 -1
  138. package/dist/{useCloudI18n-L3H2XvdW.js → useCloudI18n-AKCy98qD.js} +2 -2
  139. package/dist/{useEditorCore-DKYZ7aKk.js → useEditorCore-vcWLdnjN.js} +1480 -1310
  140. package/dist/{useI18n-CTs_bP9d.js → useI18n-C-TDeJBt.js} +2 -2
  141. package/dist/{useMergeTag-e3RSY-s3.js → useMergeTag-DSrBY0-2.js} +6 -6
  142. package/dist/usePopoverRoot-DKUDnr55.js +8 -0
  143. package/dist/{vue.runtime.esm-bundler-B2k01iQh.js → vue.runtime.esm-bundler-l0XAqiyv.js} +639 -1151
  144. package/dist/{x-CGjkjdKK.js → x-CQSvXnGR.js} +1 -1
  145. package/package.json +27 -27
  146. package/dist/CloudEditor-DaEfipBn.js +0 -1230
  147. package/dist/CountdownBlock-DO9fziwf.js +0 -92
  148. package/dist/CountdownToolbar-BeII06yJ.js +0 -210
  149. package/dist/ModuleBrowserModal-DsZRr87F.js +0 -198
  150. package/dist/ParagraphEditor-CZ-cmhX3.js +0 -700
  151. package/dist/TitleEditor-DbNOcvhR.js +0 -177
  152. package/dist/cdn/chunks/CloudEditor-BZuzsQOZ.js.map +0 -1
  153. package/dist/cdn/chunks/ParagraphEditor-pGrfSccu.js.map +0 -1
  154. package/dist/cdn/chunks/TitleEditor-BvFbL16O.js.map +0 -1
  155. package/dist/cdn/chunks/blockTypeIcons-Kd1MT0u8.js +0 -22
  156. package/dist/cdn/chunks/de-C2wOXoxs.js.map +0 -1
  157. package/dist/cdn/chunks/draggable-Bci-fq8y.js.map +0 -1
  158. package/dist/cdn/chunks/en-dR7zfNC3.js.map +0 -1
  159. package/dist/cdn/chunks/extensions-CuUjSmuA.js +0 -605
  160. package/dist/cdn/chunks/extensions-CuUjSmuA.js.map +0 -1
  161. package/dist/cdn/chunks/features-DU6lA8l1.js.map +0 -1
  162. package/dist/cdn/chunks/icons-BjHUZZyJ.js.map +0 -1
  163. package/dist/cdn/chunks/liquid.browser-DKKBzRQu.js.map +0 -1
  164. package/dist/cdn/chunks/pt-BR-BZ86xqK6.js.map +0 -1
  165. package/dist/cdn/chunks/quality-DNnYAntR.js +0 -2176
  166. package/dist/cdn/chunks/renderer-CZKO-Tav.js.map +0 -1
  167. package/dist/cdn/chunks/styles-DiAdtiz9.js +0 -3428
  168. package/dist/cdn/chunks/styles-DiAdtiz9.js.map +0 -1
  169. package/dist/cdn/chunks/tiptap-CwScfbsM.js.map +0 -1
  170. package/dist/createLucideIcon-CmPAC-gt.js +0 -43
  171. package/dist/dist-BNEdeWub.js +0 -5
  172. package/dist/dist-Cgry6fNv.js +0 -382
  173. package/dist/dist-u0iIJH3V.js +0 -5
  174. package/dist/extensions-XPlNAKIL.js +0 -1720
  175. package/dist/keys-mFiJ5N0_.js +0 -10
  176. package/dist/scan-line-XYEqim_E.js +0 -25
  177. package/dist/styles-D0RCAWhB.js +0 -3647
  178. package/dist/usePopoverRoot-DVh7NY1q.js +0 -8
@@ -0,0 +1,3943 @@
1
+ import { C as e, F as t, G as n, H as r, J as i, K as a, L as o, M as s, O as c, P as l, T as u, V as d, Y as f, Z as p, b as m, c as h, ct as g, f as _, g as v, h as y, it as b, l as x, m as S, n as C, o as w, ot as T, p as E, s as D, st as O, t as k, u as A, v as j, x as M, y as N, z as P } from "./draggable-kG-D5Xsm.js";
2
+ import { $t as F, B as I, Cn as L, Ct as ee, Dn as R, Dt as z, En as B, Et as te, F as ne, Ft as re, G as V, H as ie, Ht as ae, I as oe, In as se, It as ce, J as le, Jt as H, K as ue, Kt as de, L as fe, Lt as U, M as pe, Mn as me, N as he, Nn as ge, O as _e, On as ve, P as ye, Pt as be, Qt as xe, R as Se, Sn as Ce, St as we, Tt as Te, U as Ee, Ut as De, V as Oe, Vt as ke, W as Ae, Xt as je, Yt as Me, Z as Ne, Zt as Pe, an as Fe, at as Ie, bn as Le, bt as Re, cn as ze, ct as Be, en as Ve, ft as He, gn as Ue, gt as We, j as Ge, jn as Ke, jt as qe, k as Je, kt as Ye, ln as Xe, nn as Ze, nt as Qe, on as $e, ot as et, q as tt, qt as nt, sn as rt, st as it, tn as at, tt as ot, ut as st, wn as ct, wt as lt, xt as ut, yn as dt, zt as ft } from "./features-Dpczf9Su.js";
3
+ import { A as pt, F as mt, G as ht, I as gt, M as _t, N as vt, O as yt, P as bt, T as W, V as xt, X as St, Y as Ct, _ as wt, b as Tt, c as Et, h as Dt, m as Ot, o as kt, s as At, u as jt, v as Mt, y as Nt, z as Pt } from "./icons-CuxnJiGQ.js";
4
+ import { t as Ft } from "./readableTextColor-f8Kykfnh.js";
5
+ import { t as It } from "./CountdownBlock-BEVAJQtQ.js";
6
+ import { t as Lt } from "./blockTypeIcons-BernVG06.js";
7
+ import { _ as Rt, c as zt, f as G, g as Bt, h as K, l as Vt, m as q, p as J, r as Ht, t as Ut } from "./styleConstants-lGobwiLH.js";
8
+ import { i as Y, n as X, r as Z, t as Wt } from "./NumberWithSuffix-CDjEa08X.js";
9
+ import { n as Gt, r as Kt } from "./MergeTagSuggestion-BsCAo4Co.js";
10
+ //#region src/utils/resolveLintOptions.ts
11
+ function qt(e) {
12
+ return {
13
+ ...e.lint,
14
+ locale: e.locale
15
+ };
16
+ }
17
+ //#endregion
18
+ //#region src/components/Canvas.vue?vue&type=script&setup=true&lang.ts
19
+ var Jt = ["aria-label"], Yt = {
20
+ key: 0,
21
+ class: "tpl-canvas-empty-content tpl:flex tpl:flex-col tpl:items-center"
22
+ }, Xt = { class: "tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]" }, Zt = { class: "tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]" }, Qt = { class: "tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]" }, $t = {
23
+ key: 0,
24
+ 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)]"
25
+ }, en = {
26
+ key: 1,
27
+ 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)]"
28
+ }, tn = { class: "tpl:relative" }, nn = {
29
+ class: "tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",
30
+ style: { "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 30%,\n transparent\n )" }
31
+ }, rn = 96, an = /*#__PURE__*/ Ie(/* @__PURE__ */ M({
32
+ __name: "Canvas",
33
+ props: {
34
+ viewport: {},
35
+ content: {},
36
+ selectedBlockId: {},
37
+ darkMode: { type: Boolean },
38
+ previewMode: { type: Boolean },
39
+ lockedBlocks: {}
40
+ },
41
+ emits: [
42
+ "select-block",
43
+ "open-ai-chat",
44
+ "open-design-reference"
45
+ ],
46
+ setup(e, { emit: t }) {
47
+ let n = {
48
+ section: oe,
49
+ title: fe,
50
+ paragraph: Oe,
51
+ image: Ee,
52
+ button: be,
53
+ divider: tt,
54
+ spacer: he,
55
+ html: ue,
56
+ social: ye,
57
+ menu: ie,
58
+ table: pe,
59
+ video: Ge,
60
+ countdown: It,
61
+ custom: le
62
+ }, i = e, a = t, { t: c } = U(), { t: f } = Qe(), m = Xe(je, "Canvas"), h = u(de, null), x = u(ae, null), C = u(De, {}), w = _(() => (C.plan?.hasFeature("ai_generation") ?? !1) && (C.ai?.isFeatureEnabled("chat") ?? !1)), M = _(() => (C.plan?.hasFeature("ai_generation") ?? !1) && (C.ai?.isFeatureEnabled("designToTemplate") ?? !1)), P = _({
63
+ get: () => i.content.blocks,
64
+ set: (e) => {
65
+ m.setContent({
66
+ ...i.content,
67
+ blocks: e
68
+ });
69
+ }
70
+ }), F = _(() => {
71
+ switch (i.viewport) {
72
+ case "mobile": return 375;
73
+ default: return i.content.settings.width;
74
+ }
75
+ }), L = _(() => F.value + rn * 2), R = _(() => ({ fontFamily: i.content.settings.fontFamily })), z = _(() => P.value.length === 0 && !i.previewMode), B = p(0), te = _(() => z.value && B.value > 0);
76
+ function ne() {
77
+ z.value && (B.value += 1);
78
+ }
79
+ function re() {
80
+ z.value && (B.value = Math.max(0, B.value - 1));
81
+ }
82
+ function V() {
83
+ B.value = 0;
84
+ }
85
+ function se(e) {
86
+ i.previewMode || e.target === e.currentTarget && a("select-block", null);
87
+ }
88
+ function ce(e) {
89
+ return I(e, x, n);
90
+ }
91
+ function H(e) {
92
+ return i.lockedBlocks?.get(e) ?? null;
93
+ }
94
+ function me(e, t) {
95
+ e.type === "custom" && m.updateBlock(e.id, {
96
+ fieldValues: t.fieldValues,
97
+ dataSourceFetched: t.dataSourceFetched
98
+ });
99
+ }
100
+ return (t, n) => (s(), v("div", {
101
+ class: "tpl-canvas-stage tpl:relative tpl:flex tpl:justify-center tpl:rounded-lg",
102
+ style: O({
103
+ width: `${L.value}px`,
104
+ boxShadow: e.darkMode ? "none" : "var(--tpl-shadow-xl)",
105
+ transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)"
106
+ })
107
+ }, [E("div", {
108
+ class: "tpl-canvas-bg tpl:absolute tpl:inset-0 tpl:rounded-lg tpl:pointer-events-none",
109
+ style: O({
110
+ backgroundColor: e.content.settings.backgroundColor,
111
+ ...e.darkMode ? { filter: "invert(1) hue-rotate(180deg)" } : {},
112
+ transition: "filter 300ms ease"
113
+ })
114
+ }, null, 4), E("div", {
115
+ "data-testid": "canvas-wrapper",
116
+ role: "region",
117
+ "aria-label": b(c).landmarks.canvas,
118
+ class: "tpl-canvas-wrapper tpl:relative",
119
+ style: O({
120
+ width: `${F.value}px`,
121
+ transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)"
122
+ })
123
+ }, [E("div", {
124
+ class: T(["tpl-canvas tpl:relative tpl:rounded-lg", {
125
+ "tpl-canvas--dark-mode": e.darkMode,
126
+ "tpl-preview-mode": e.previewMode
127
+ }]),
128
+ style: O(R.value),
129
+ onClick: se
130
+ }, [N(b(k), {
131
+ modelValue: P.value,
132
+ "onUpdate:modelValue": n[2] ||= (e) => P.value = e,
133
+ group: "blocks",
134
+ animation: 150,
135
+ "ghost-class": "tpl-ghost",
136
+ "drag-class": "tpl-dragging",
137
+ handle: ".tpl-block-btn",
138
+ "invert-swap": !0,
139
+ "inverted-swap-threshold": .65,
140
+ disabled: e.previewMode,
141
+ draggable: ".tpl-block-item",
142
+ "force-fallback": !0,
143
+ class: T([
144
+ "tpl-canvas-blocks",
145
+ z.value ? "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:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)] tpl:transition-colors tpl:duration-150" : "",
146
+ z.value && te.value ? "tpl-canvas-empty--drag-over tpl:border-[var(--tpl-primary-hover)] tpl:bg-[var(--tpl-primary-light)]" : "",
147
+ z.value && !te.value ? "tpl:border-[var(--tpl-primary)]" : ""
148
+ ]),
149
+ onDragenter: ne,
150
+ onDragleave: re,
151
+ onDrop: V
152
+ }, {
153
+ default: d(() => [z.value ? (s(), v("div", Yt, [
154
+ E("div", Xt, [N(b(Dt), {
155
+ size: 48,
156
+ "stroke-width": 1
157
+ })]),
158
+ E("p", Zt, g(b(c).canvas.noBlocks), 1),
159
+ E("p", Qt, g(b(c).canvas.dragHint), 1),
160
+ w.value && b(f) ? (s(), v("p", $t, [
161
+ j(g(b(c).canvas.aiHintChat) + " ", 1),
162
+ E("button", {
163
+ 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)]",
164
+ onClick: n[0] ||= (e) => a("open-ai-chat")
165
+ }, [N(b(He), {
166
+ size: 14,
167
+ "stroke-width": 2
168
+ }), j(" " + g(b(f).aiMenu.aiAssistant), 1)]),
169
+ j(" " + g(b(c).canvas.aiHintChatSuffix), 1)
170
+ ])) : y("", !0),
171
+ M.value && b(f) ? (s(), v("p", en, [
172
+ j(g(b(c).canvas.aiHintDesign) + " ", 1),
173
+ E("button", {
174
+ 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)]",
175
+ onClick: n[1] ||= (e) => a("open-design-reference")
176
+ }, [N(b(ee), {
177
+ size: 14,
178
+ "stroke-width": 2
179
+ }), j(" " + g(b(f).aiMenu.designToTemplate), 1)]),
180
+ j(" " + g(b(c).canvas.aiHintDesignSuffix), 1)
181
+ ])) : y("", !0)
182
+ ])) : y("", !0), (s(!0), v(A, null, l(P.value, (t) => r((s(), v("div", {
183
+ key: t.id,
184
+ class: "tpl-block-item"
185
+ }, [E("div", tn, [H(t.id) ? (s(), v("div", {
186
+ key: 0,
187
+ class: "tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
188
+ style: O({
189
+ outline: `2px solid ${H(t.id).color}`,
190
+ outlineOffset: "-1px"
191
+ })
192
+ }, [E("span", {
193
+ 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",
194
+ style: O({
195
+ backgroundColor: H(t.id).color,
196
+ color: b(Ft)(H(t.id).color)
197
+ })
198
+ }, [E("span", nn, g(H(t.id).name.charAt(0)), 1), j(" " + g(H(t.id).name), 1)], 4)], 4)) : y("", !0), N(Se, {
199
+ block: t,
200
+ "is-selected": !e.previewMode && e.selectedBlockId === t.id && !H(t.id),
201
+ viewport: e.viewport,
202
+ "preview-mode": e.previewMode,
203
+ onSelect: (n) => e.previewMode || H(t.id) ? void 0 : a("select-block", t.id)
204
+ }, {
205
+ default: d(() => [(s(), S(o(ce(t)), {
206
+ block: t,
207
+ viewport: e.viewport,
208
+ onFetchData: (e) => me(t, e),
209
+ onUpdate: (e) => b(m).updateBlock(t.id, e)
210
+ }, null, 40, [
211
+ "block",
212
+ "viewport",
213
+ "onFetchData",
214
+ "onUpdate"
215
+ ]))]),
216
+ _: 2
217
+ }, 1032, [
218
+ "block",
219
+ "is-selected",
220
+ "viewport",
221
+ "preview-mode",
222
+ "onSelect"
223
+ ])])])), [[D, !b(h)?.isHidden(t.id)]])), 128))]),
224
+ _: 1
225
+ }, 8, [
226
+ "modelValue",
227
+ "disabled",
228
+ "class"
229
+ ])], 6)], 12, Jt)], 4));
230
+ }
231
+ }), [["__scopeId", "data-v-a9a1158b"]]), on = M({
232
+ name: "CustomBlockStylesheets",
233
+ setup() {
234
+ let t = u(H, null);
235
+ return () => t ? t.value.map((t, n) => e("style", {
236
+ key: n,
237
+ "data-tpl-custom-block-stylesheet": "",
238
+ innerHTML: t
239
+ })) : null;
240
+ }
241
+ });
242
+ //#endregion
243
+ //#region src/utils/resolvePaletteBlocks.ts
244
+ function sn(e, t) {
245
+ if (!t || t.length === 0) return {
246
+ items: e,
247
+ unknown: []
248
+ };
249
+ let n = new Map(e.map((e) => [e.type, e])), r = [], i = [], a = /* @__PURE__ */ new Set();
250
+ for (let e of t) {
251
+ if (a.has(e)) continue;
252
+ a.add(e);
253
+ let t = n.get(e);
254
+ t ? r.push(t) : i.push(e);
255
+ }
256
+ return {
257
+ items: r,
258
+ unknown: i
259
+ };
260
+ }
261
+ //#endregion
262
+ //#region src/components/Sidebar.vue?vue&type=script&setup=true&lang.ts
263
+ var cn = ["aria-label"], ln = {
264
+ key: 0,
265
+ class: "tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]"
266
+ }, un = ["aria-label"], dn = {
267
+ key: 0,
268
+ class: "tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium"
269
+ }, fn = {
270
+ key: 1,
271
+ 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)]"
272
+ }, pn = [
273
+ "data-palette-type",
274
+ "aria-label",
275
+ "onClick",
276
+ "onKeydown"
277
+ ], mn = { 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" }, hn = {
278
+ key: 0,
279
+ class: "tpl:truncate tpl:text-sm tpl:font-medium"
280
+ }, gn = /* @__PURE__ */ M({
281
+ __name: "Sidebar",
282
+ setup(e) {
283
+ let { t, format: n } = U(), { t: r } = Qe(), i = u(nt, []), a = u(Ze, void 0), c = u(ke, void 0), f = u(je, null), m = u(De, {}), h = _(() => (m.savedModules?.moduleCount.value ?? 0) > 0), x = p(!1), C = p(!1);
284
+ function w() {
285
+ C.value || (x.value = !1);
286
+ }
287
+ function T() {
288
+ C.value = !0;
289
+ }
290
+ function D() {
291
+ C.value = !1;
292
+ }
293
+ let j = [
294
+ "section",
295
+ "image",
296
+ "title",
297
+ "paragraph",
298
+ "button",
299
+ "divider",
300
+ "video",
301
+ "social",
302
+ "menu",
303
+ "table",
304
+ "spacer",
305
+ "html"
306
+ ], M = _(() => {
307
+ let e = j.map((e) => ({
308
+ type: e,
309
+ label: ce(e, t)
310
+ }));
311
+ return m.plan && e.splice(-1, 0, {
312
+ type: "countdown",
313
+ label: ce("countdown", t)
314
+ }), e;
315
+ }), F = _(() => i.map((e) => ({
316
+ type: `custom:${e.type}`,
317
+ label: e.name,
318
+ isCustom: !0,
319
+ icon: e.icon
320
+ }))), I = _(() => [...M.value, ...F.value]), L = _(() => sn(I.value, a)), ee = _(() => L.value.items), R = /* @__PURE__ */ new Set();
321
+ P(() => L.value.unknown, (e) => {
322
+ for (let t of e) R.has(t) || (R.add(t), re.warn(`config.paletteBlocks: "${t}" is not a built-in or registered custom block (use the "custom:" prefix for custom blocks) — skipping it in the palette.`));
323
+ }, { immediate: !0 });
324
+ function z(e) {
325
+ if (e.isCustom) {
326
+ let t = e.type.replace("custom:", ""), n = i.find((e) => e.type === t);
327
+ if (n) return me(n);
328
+ }
329
+ return Ke(e.type, c);
330
+ }
331
+ function B(e) {
332
+ if (!f) return;
333
+ let t = z(e);
334
+ f.addBlock(t), f.selectBlock(t.id);
335
+ }
336
+ function te(e, t) {
337
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), B(t));
338
+ }
339
+ return (e, i) => (s(), v("aside", {
340
+ "aria-label": b(t).sidebarNav.palette,
341
+ class: "tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:flex tpl:flex-col tpl:overflow-hidden",
342
+ style: O({
343
+ width: x.value ? "200px" : "48px",
344
+ backgroundColor: "var(--tpl-bg-elevated)",
345
+ borderRight: "1px solid var(--tpl-border)",
346
+ boxShadow: x.value ? "var(--tpl-shadow-lg)" : "none",
347
+ transition: "width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"
348
+ }),
349
+ onMouseenter: i[1] ||= (e) => x.value = !0,
350
+ onMouseleave: w,
351
+ onFocusin: i[2] ||= (e) => x.value = !0,
352
+ onFocusout: i[3] ||= (e) => x.value = !1
353
+ }, [h.value && b(r) ? (s(), v("div", ln, [E("button", {
354
+ type: "button",
355
+ "aria-label": b(t).sidebarNav.browseModules,
356
+ 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)]",
357
+ style: O({ justifyContent: x.value ? "flex-start" : "center" }),
358
+ onClick: i[0] ||= (e) => b(m).savedModules?.openBrowser()
359
+ }, [
360
+ N(b(pt), {
361
+ size: 20,
362
+ "stroke-width": 1.5,
363
+ class: "tpl:shrink-0"
364
+ }),
365
+ x.value ? (s(), v("span", dn, g(b(r).modules.title), 1)) : y("", !0),
366
+ x.value ? (s(), v("span", fn, g(b(m).savedModules?.moduleCount.value ?? 0), 1)) : y("", !0)
367
+ ], 12, un)])) : y("", !0), N(b(k), {
368
+ "model-value": ee.value,
369
+ group: {
370
+ name: "blocks",
371
+ pull: "clone",
372
+ put: !1
373
+ },
374
+ clone: z,
375
+ sort: !1,
376
+ animation: 150,
377
+ "force-fallback": !0,
378
+ class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-0.5 tpl:overflow-y-auto tpl:p-1",
379
+ onChoose: T,
380
+ onEnd: D
381
+ }, {
382
+ default: d(() => [(s(!0), v(A, null, l(ee.value, (e) => (s(), v("button", {
383
+ key: e.type,
384
+ type: "button",
385
+ "data-palette-type": e.type,
386
+ "aria-label": b(n)(b(t).sidebarNav.insertBlock, { block: e.label }),
387
+ class: "tpl:flex tpl:h-10 tpl:w-full tpl:shrink-0 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",
388
+ style: O({ justifyContent: x.value ? "flex-start" : "center" }),
389
+ onClick: (t) => B(e),
390
+ onKeydown: (t) => te(t, e)
391
+ }, [E("div", mn, [b(Lt)[e.type] ? (s(), S(o(b(Lt)[e.type]), {
392
+ key: 0,
393
+ size: 20,
394
+ "stroke-width": 1.5
395
+ })) : e.isCustom ? (s(), S(et, {
396
+ key: 1,
397
+ icon: e.icon,
398
+ size: 20
399
+ }, null, 8, ["icon"])) : y("", !0)]), x.value ? (s(), v("span", hn, g(e.label), 1)) : y("", !0)], 44, pn))), 128))]),
400
+ _: 1
401
+ }, 8, ["model-value"])], 44, cn));
402
+ }
403
+ });
404
+ //#endregion
405
+ //#region src/utils/mergeTagTrigger.ts
406
+ function _n(e, t, n, r) {
407
+ if (!n) return null;
408
+ let i = e.slice(0, t), a = i.lastIndexOf(n);
409
+ if (a === -1) return null;
410
+ let o = i.slice(a + n.length);
411
+ return /\s/.test(o) || r && o.includes(r) ? null : {
412
+ triggerStart: a,
413
+ caret: t,
414
+ query: o
415
+ };
416
+ }
417
+ //#endregion
418
+ //#region src/utils/textFieldCaret.ts
419
+ var vn = /* @__PURE__ */ "boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.borderStyle.paddingTop.paddingRight.paddingBottom.paddingLeft.fontStyle.fontVariant.fontWeight.fontStretch.fontSize.lineHeight.fontFamily.textAlign.textTransform.textIndent.letterSpacing.wordSpacing.tabSize.whiteSpace.wordWrap.wordBreak".split(".");
420
+ function yn(e, t, n) {
421
+ return {
422
+ left: e,
423
+ top: t,
424
+ bottom: n,
425
+ right: e,
426
+ width: 0,
427
+ height: n - t,
428
+ x: e,
429
+ y: t,
430
+ toJSON: () => ({})
431
+ };
432
+ }
433
+ function bn(e, t) {
434
+ let n = e.ownerDocument, r = n.defaultView;
435
+ if (!r) return null;
436
+ let i = e.tagName === "INPUT", a = r.getComputedStyle(e), o = n.createElement("div");
437
+ o.setAttribute("aria-hidden", "true");
438
+ let s = o.style;
439
+ s.position = "absolute", s.visibility = "hidden", s.top = "0", s.left = "0", s.overflow = "hidden", s.whiteSpace = i ? "pre" : "pre-wrap", s.wordWrap = i ? "normal" : "break-word";
440
+ let c = s, l = a;
441
+ for (let e of vn) c[e] = l[e];
442
+ i && (s.width = "auto", s.whiteSpace = "pre");
443
+ let u = e.value, d = u.slice(0, t);
444
+ i && (d = d.replace(/\s/g, "\xA0")), o.textContent = d;
445
+ let f = n.createElement("span");
446
+ f.textContent = u.slice(t) || ".", o.appendChild(f), n.body.appendChild(o);
447
+ let p = f.offsetTop, m = f.offsetLeft;
448
+ n.body.removeChild(o);
449
+ let h = e.getBoundingClientRect(), g = parseFloat(a.borderTopWidth) || 0, _ = parseFloat(a.borderLeftWidth) || 0, v = parseFloat(a.lineHeight) || parseFloat(a.fontSize) || 0, y = h.left + m + _ - e.scrollLeft;
450
+ if (i) return yn(y, h.top, h.bottom);
451
+ let b = h.top + p + g - e.scrollTop;
452
+ return yn(y, b, b + v);
453
+ }
454
+ //#endregion
455
+ //#region src/composables/useMergeTagAutocomplete.ts
456
+ var xn = /* @__PURE__ */ new Set([
457
+ "ArrowLeft",
458
+ "ArrowRight",
459
+ "Home",
460
+ "End"
461
+ ]);
462
+ function Sn(e) {
463
+ let { elementRef: t, modelValue: r, emit: o, mergeTags: s, syntax: l, enabled: d, onInsert: f } = e, p = R(l), m = B(l), h = d && p !== null && s.length > 0, g = u(rt, null), _ = Gt((a(g) ? g.value : g)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", Je()), v = !1;
464
+ n() && i(() => {
465
+ v = !0, _.close();
466
+ });
467
+ function y(e) {
468
+ let t = e.value ?? "";
469
+ return _n(t, e.selectionStart ?? t.length, p, m);
470
+ }
471
+ function b(e, n, i) {
472
+ let a = e.value ?? r(), s = a.slice(n.caret), l = m && s.startsWith(m) ? m.length : 0, u = a.slice(0, n.triggerStart), d = a.slice(n.caret + l), p = u + i.value + d, h = u.length + i.value.length;
473
+ f?.(), o(p), _.close(), c(() => {
474
+ if (v) return;
475
+ let e = t.value;
476
+ e?.focus(), e?.setSelectionRange(h, h);
477
+ });
478
+ }
479
+ function x() {
480
+ if (!h || v) return;
481
+ let e = t.value;
482
+ if (!e) {
483
+ _.close();
484
+ return;
485
+ }
486
+ let n = y(e);
487
+ if (!n) {
488
+ _.close();
489
+ return;
490
+ }
491
+ let r = Kt(s, n.query), i = () => bn(e, n.triggerStart), a = (t) => b(e, n, t);
492
+ _.isOpen() ? _.update({
493
+ items: r,
494
+ getRect: i,
495
+ onCommand: a
496
+ }) : _.open({
497
+ items: r,
498
+ getRect: i,
499
+ anchorEl: e,
500
+ onCommand: a
501
+ });
502
+ }
503
+ function S(e) {
504
+ return _.isOpen() ? e.key === "Escape" ? (_.close(), !0) : xn.has(e.key) ? (_.close(), !1) : _.handleKeyDown(e) : !1;
505
+ }
506
+ return {
507
+ available: h,
508
+ refresh: x,
509
+ handleKeydown: S,
510
+ close: () => _.close(),
511
+ isOpen: () => _.isOpen()
512
+ };
513
+ }
514
+ //#endregion
515
+ //#region src/composables/useMergeTagField.ts
516
+ function Cn(e) {
517
+ let { modelValue: t, emit: r, elementRef: a } = e, { mergeTags: o, canRequestMergeTag: s, isRequesting: l, isMergeTagValue: u, getMergeTagLabel: d, requestMergeTag: f, syntax: m, autocomplete: h } = ot(), { canInsertLogicTag: g, isRequesting: v, requestLogicTag: y } = Ne(), b = p(!1), x = !1, S = !1;
518
+ n() && i(() => {
519
+ S = !0;
520
+ });
521
+ let C = Sn({
522
+ elementRef: a,
523
+ modelValue: t,
524
+ emit: r,
525
+ mergeTags: o,
526
+ syntax: m,
527
+ enabled: h,
528
+ onInsert: () => {
529
+ b.value = !0;
530
+ }
531
+ }), w = _(() => {
532
+ let e = t();
533
+ if (!e) return [];
534
+ let n = [], r = `(${m.value.source}|${m.logic.source})`, i = new RegExp(r, "g"), a = 0, o;
535
+ for (; (o = i.exec(e)) !== null;) {
536
+ o.index > a && n.push({
537
+ type: "text",
538
+ value: e.slice(a, o.index)
539
+ });
540
+ let t = o[0];
541
+ u(t) ? n.push({
542
+ type: "mergeTag",
543
+ value: t,
544
+ label: d(t)
545
+ }) : ve(t, m) ? n.push({
546
+ type: "logicMergeTag",
547
+ value: t,
548
+ keyword: ct(t, m)
549
+ }) : n.push({
550
+ type: "text",
551
+ value: t
552
+ }), a = o.index + t.length;
553
+ }
554
+ return a < e.length && n.push({
555
+ type: "text",
556
+ value: e.slice(a)
557
+ }), n;
558
+ }), T = _(() => w.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
559
+ function E() {
560
+ b.value = !0, c(() => {
561
+ a.value?.focus();
562
+ let e = t()?.length || 0;
563
+ a.value?.setSelectionRange(e, e);
564
+ });
565
+ }
566
+ function D() {
567
+ x || (b.value = !1);
568
+ }
569
+ function O(e) {
570
+ r(e.target.value), C.refresh();
571
+ }
572
+ function k(e) {
573
+ if (C.handleKeydown(e)) {
574
+ e.preventDefault();
575
+ return;
576
+ }
577
+ e.key === "Escape" && D();
578
+ }
579
+ function A() {
580
+ C.refresh();
581
+ }
582
+ function j() {
583
+ C.close(), D();
584
+ }
585
+ function M() {
586
+ r("");
587
+ }
588
+ async function N() {
589
+ let e = b.value && a.value ? a.value.selectionStart ?? t().length : t().length;
590
+ x = !0;
591
+ let n;
592
+ try {
593
+ n = await f();
594
+ } finally {
595
+ x = !1;
596
+ }
597
+ if (!S && n) {
598
+ let i = t().slice(0, e), o = t().slice(e), s = i + n.value + o;
599
+ r(s), b.value = !0, c(() => {
600
+ if (S) return;
601
+ let t = e + n.value.length;
602
+ a.value?.focus(), a.value?.setSelectionRange(t, t);
603
+ });
604
+ }
605
+ }
606
+ async function P() {
607
+ let e = a.value, n = e?.selectionStart ?? t().length, i = e?.selectionEnd ?? n;
608
+ x = !0;
609
+ let o;
610
+ try {
611
+ o = await y();
612
+ } finally {
613
+ x = !1;
614
+ }
615
+ if (S || !o) return;
616
+ let s = t(), l, u;
617
+ "before" in o ? (l = s.slice(0, n) + o.before + s.slice(n, i) + o.after + s.slice(i), u = n + o.before.length + (i - n)) : (l = s.slice(0, n) + o.value + s.slice(n), u = n + o.value.length), r(l), b.value = !0, c(() => {
618
+ S || (a.value?.focus(), a.value?.setSelectionRange(u, u));
619
+ });
620
+ }
621
+ return {
622
+ segments: w,
623
+ hasMergeTags: T,
624
+ canRequestMergeTag: s,
625
+ isRequestingMergeTag: l,
626
+ canInsertLogicTag: g,
627
+ isRequestingLogicTag: v,
628
+ isEditing: b,
629
+ startEditing: E,
630
+ stopEditing: D,
631
+ handleInput: O,
632
+ handleKeydown: k,
633
+ handleClick: A,
634
+ handleBlur: j,
635
+ clearValue: M,
636
+ insertMergeTag: N,
637
+ insertLogicTag: P,
638
+ autocompleteAvailable: C.available
639
+ };
640
+ }
641
+ //#endregion
642
+ //#region src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
643
+ var wn = ["aria-label", "onKeydown"], Tn = ["data-tooltip"], En = ["data-tooltip"], Dn = {
644
+ key: 2,
645
+ class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
646
+ }, On = ["aria-label", "title"], kn = /* @__PURE__ */ M({
647
+ __name: "MergeTagSegments",
648
+ props: {
649
+ segments: {},
650
+ displayClass: {},
651
+ pulse: { type: Boolean }
652
+ },
653
+ emits: ["edit", "clear"],
654
+ setup(e, { emit: t }) {
655
+ let n = t, { t: r } = U();
656
+ function i() {
657
+ n("edit");
658
+ }
659
+ return (t, a) => (s(), v("div", {
660
+ role: "button",
661
+ tabindex: "0",
662
+ "aria-label": b(r).mergeTag.clickToEdit,
663
+ class: T([e.displayClass, { "tpl-pulse-fill": e.pulse }]),
664
+ onClick: i,
665
+ onKeydown: [h(i, ["enter"]), h(x(i, ["prevent"]), ["space"])]
666
+ }, [(s(!0), v(A, null, l(e.segments, (e, t) => (s(), v(A, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (s(), v("span", {
667
+ key: 0,
668
+ 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",
669
+ "data-tooltip": e.value,
670
+ style: {
671
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
672
+ color: "var(--tpl-primary)"
673
+ }
674
+ }, g(e.label), 9, Tn)) : e.type === "logicMergeTag" ? (s(), v("span", {
675
+ key: 1,
676
+ 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",
677
+ "data-tooltip": e.value,
678
+ style: {
679
+ "background-color": "transparent",
680
+ border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
681
+ color: "var(--tpl-primary)"
682
+ }
683
+ }, g(e.keyword), 9, En)) : (s(), v("span", Dn, g(e.value), 1))], 64))), 128)), E("button", {
684
+ type: "button",
685
+ 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",
686
+ "aria-label": b(r).mergeTag.remove,
687
+ title: b(r).mergeTag.remove,
688
+ onClick: a[0] ||= x((e) => n("clear"), ["stop"])
689
+ }, [N(b(it), {
690
+ size: 12,
691
+ "stroke-width": 2.5
692
+ })], 8, On)], 42, wn));
693
+ }
694
+ }), An = [
695
+ "aria-label",
696
+ "title",
697
+ "disabled"
698
+ ], jn = "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)]", Mn = /* @__PURE__ */ M({
699
+ __name: "MergeTagInsertButton",
700
+ props: { disabled: { type: Boolean } },
701
+ emits: ["insert"],
702
+ setup(e) {
703
+ let { t } = U();
704
+ return (n, r) => (s(), v("button", {
705
+ type: "button",
706
+ class: T([jn, "tpl:mt-1.5"]),
707
+ "aria-label": b(t).mergeTag.insert,
708
+ title: b(t).mergeTag.insert,
709
+ disabled: e.disabled,
710
+ onMousedown: r[0] ||= x(() => {}, ["prevent"]),
711
+ onClick: r[1] ||= (e) => n.$emit("insert")
712
+ }, [N(b(Tt), {
713
+ size: 12,
714
+ "stroke-width": 2
715
+ }), j(" " + g(b(t).mergeTag.insertShort), 1)], 42, An));
716
+ }
717
+ }), Nn = [
718
+ "aria-label",
719
+ "title",
720
+ "disabled"
721
+ ], Pn = "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)]", Fn = /* @__PURE__ */ M({
722
+ __name: "LogicTagInsertButton",
723
+ props: { disabled: { type: Boolean } },
724
+ emits: ["insert"],
725
+ setup(e) {
726
+ let { t } = U();
727
+ return (n, r) => (s(), v("button", {
728
+ type: "button",
729
+ class: T([Pn, "tpl:mt-1.5"]),
730
+ "aria-label": b(t).logicTag.insert,
731
+ title: b(t).logicTag.insert,
732
+ disabled: e.disabled,
733
+ "data-testid": "field-insert-logic-button",
734
+ onMousedown: r[0] ||= x(() => {}, ["prevent"]),
735
+ onClick: r[1] ||= (e) => n.$emit("insert")
736
+ }, [N(b(St), {
737
+ size: 12,
738
+ "stroke-width": 2
739
+ }), j(" " + g(b(t).logicTag.insertShort), 1)], 42, Nn));
740
+ }
741
+ }), In = { key: 0 }, Ln = {
742
+ key: 0,
743
+ class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
744
+ }, Rn = { key: 1 }, zn = [
745
+ "value",
746
+ "placeholder",
747
+ "rows"
748
+ ], Bn = {
749
+ key: 0,
750
+ class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
751
+ }, Vn = "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)]", Hn = "tpl:flex tpl:w-full tpl:min-h-20 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)]", Un = /* @__PURE__ */ M({
752
+ __name: "MergeTagTextarea",
753
+ props: {
754
+ modelValue: {},
755
+ placeholder: { default: "" },
756
+ rows: { default: 3 }
757
+ },
758
+ emits: ["update:modelValue"],
759
+ setup(e, { emit: t }) {
760
+ let n = e, r = t, i = p(null), { segments: a, hasMergeTags: o, canRequestMergeTag: c, isRequestingMergeTag: l, canInsertLogicTag: u, isRequestingLogicTag: d, isEditing: f, startEditing: m, handleInput: h, handleKeydown: g, handleClick: _, handleBlur: x, clearValue: C, insertMergeTag: w, insertLogicTag: D } = Cn({
761
+ modelValue: () => n.modelValue,
762
+ emit: (e) => r("update:modelValue", e),
763
+ elementRef: i
764
+ });
765
+ return (t, n) => b(o) && !b(f) ? (s(), v("div", In, [N(kn, {
766
+ segments: b(a),
767
+ "display-class": Hn,
768
+ onEdit: b(m),
769
+ onClear: b(C)
770
+ }, null, 8, [
771
+ "segments",
772
+ "onEdit",
773
+ "onClear"
774
+ ]), b(c) || b(u) ? (s(), v("div", Ln, [b(c) ? (s(), S(Mn, {
775
+ key: 0,
776
+ disabled: b(l),
777
+ onInsert: b(w)
778
+ }, null, 8, ["disabled", "onInsert"])) : y("", !0), b(u) ? (s(), S(Fn, {
779
+ key: 1,
780
+ disabled: b(d),
781
+ onInsert: b(D)
782
+ }, null, 8, ["disabled", "onInsert"])) : y("", !0)])) : y("", !0)])) : (s(), v("div", Rn, [E("textarea", {
783
+ ref_key: "textareaRef",
784
+ ref: i,
785
+ class: T(Vn),
786
+ value: e.modelValue,
787
+ placeholder: e.placeholder,
788
+ rows: e.rows,
789
+ onInput: n[0] ||= (...e) => b(h) && b(h)(...e),
790
+ onKeydown: n[1] ||= (...e) => b(g) && b(g)(...e),
791
+ onClick: n[2] ||= (...e) => b(_) && b(_)(...e),
792
+ onBlur: n[3] ||= (...e) => b(x) && b(x)(...e)
793
+ }, null, 40, zn), b(c) || b(u) ? (s(), v("div", Bn, [b(c) ? (s(), S(Mn, {
794
+ key: 0,
795
+ disabled: b(l),
796
+ onInsert: b(w)
797
+ }, null, 8, ["disabled", "onInsert"])) : y("", !0), b(u) ? (s(), S(Fn, {
798
+ key: 1,
799
+ disabled: b(d),
800
+ onInsert: b(D)
801
+ }, null, 8, ["disabled", "onInsert"])) : y("", !0)])) : y("", !0)]));
802
+ }
803
+ }), Wn = { class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]" }, Gn = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4" }, Kn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, qn = { class: "tpl:mb-3.5" }, Jn = { 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)]" }, Yn = ["onClick"], Xn = { class: "tpl:flex tpl:items-stretch" }, 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:mb-3.5" }, er = ["value"], tr = ["value"], nr = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, rr = ["value"], ir = { class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, ar = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, or = { class: "tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, sr = { class: "tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, cr = { class: "tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]" }, lr = { class: "tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3" }, ur = { 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)]" }, dr = { class: "tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, fr = { class: "tpl:mb-1 tpl:last:mb-0" }, pr = { class: "tpl:mb-1 tpl:last:mb-0" }, mr = { class: "tpl:mb-1 tpl:last:mb-0" }, hr = 150, gr = /* @__PURE__ */ M({
804
+ __name: "TemplateSettings",
805
+ props: { settings: {} },
806
+ emits: ["update"],
807
+ setup(e, { emit: t }) {
808
+ let n = e, r = t, { t: i } = U(), a = Xe(Pe, "TemplateSettings"), o = _(() => a.fonts.value), c = _(() => o.value.some((e) => e.value === n.settings.fontFamily) ? n.settings.fontFamily : a.defaultFont.value), u = [
809
+ {
810
+ value: 480,
811
+ label: "480px"
812
+ },
813
+ {
814
+ value: 600,
815
+ label: "600px"
816
+ },
817
+ {
818
+ value: 700,
819
+ label: "700px"
820
+ },
821
+ {
822
+ value: 800,
823
+ label: "800px"
824
+ }
825
+ ];
826
+ return (t, n) => (s(), v("aside", Wn, [E("div", Gn, [
827
+ E("div", { class: T(b(Vt)) }, [
828
+ E("div", Kn, [N(b(Ot), {
829
+ class: "tpl:text-[var(--tpl-text-muted)]",
830
+ size: 14,
831
+ "stroke-width": 2
832
+ }), E("span", null, g(b(i).templateSettings.layout), 1)]),
833
+ E("div", qn, [E("label", { class: T(b(K)) }, g(b(i).templateSettings.widthPreset), 3), E("div", Jn, [(s(), v(A, null, l(u, (t) => E("button", {
834
+ key: t.value,
835
+ 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)]",
836
+ style: O({
837
+ backgroundColor: e.settings.width === t.value ? "var(--tpl-bg)" : "transparent",
838
+ color: e.settings.width === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
839
+ boxShadow: e.settings.width === t.value ? "var(--tpl-shadow)" : "none"
840
+ }),
841
+ onClick: (e) => r("update", { width: t.value })
842
+ }, g(t.label), 13, Yn)), 64))])]),
843
+ E("div", null, [E("label", { class: T(b(K)) }, g(b(i).templateSettings.customWidth), 3), E("div", Xn, [E("input", {
844
+ type: "number",
845
+ class: T(b(J)),
846
+ value: e.settings.width,
847
+ min: "300",
848
+ max: "900",
849
+ onInput: n[0] ||= (e) => r("update", { width: Number(e.target.value) })
850
+ }, null, 42, Zn), E("span", { class: T(b(q)) }, "px", 2)])])
851
+ ], 2),
852
+ E("div", { class: T(b(Vt)) }, [
853
+ E("div", Qn, [N(b(Ct), {
854
+ class: "tpl:text-[var(--tpl-text-muted)]",
855
+ size: 14,
856
+ "stroke-width": 2
857
+ }), E("span", null, g(b(i).templateSettings.appearance), 1)]),
858
+ E("div", $n, [E("label", { class: T(b(K)) }, g(b(i).templateSettings.backgroundColor), 3), N(Y, {
859
+ "model-value": e.settings.backgroundColor,
860
+ placeholder: b(Ut),
861
+ "onUpdate:modelValue": n[1] ||= (e) => r("update", { backgroundColor: e })
862
+ }, null, 8, ["model-value", "placeholder"])]),
863
+ E("div", null, [E("label", { class: T(b(K)) }, g(b(i).templateSettings.fontFamily), 3), E("select", {
864
+ class: T(b(G)),
865
+ value: c.value,
866
+ onChange: n[2] ||= (e) => r("update", { fontFamily: e.target.value })
867
+ }, [(s(!0), v(A, null, l(o.value, (e) => (s(), v("option", {
868
+ key: e.value,
869
+ value: e.value
870
+ }, g(e.label), 9, tr))), 128))], 42, er)])
871
+ ], 2),
872
+ E("div", { class: T(b(Vt)) }, [E("div", nr, [N(b(ht), {
873
+ class: "tpl:text-[var(--tpl-text-muted)]",
874
+ size: 14,
875
+ "stroke-width": 2
876
+ }), E("span", null, g(b(i).templateSettings.language), 1)]), E("div", null, [
877
+ E("label", { class: T(b(K)) }, g(b(i).templateSettings.contentLocale), 3),
878
+ E("input", {
879
+ type: "text",
880
+ class: T(b(G)),
881
+ value: e.settings.locale ?? "",
882
+ placeholder: "en",
883
+ spellcheck: "false",
884
+ autocapitalize: "off",
885
+ autocomplete: "off",
886
+ onInput: n[3] ||= (e) => r("update", { locale: e.target.value.trim() || void 0 })
887
+ }, null, 42, rr),
888
+ E("p", ir, g(b(i).templateSettings.contentLocaleHint), 1)
889
+ ])], 2),
890
+ E("div", { class: T(b(Vt)) }, [E("div", ar, [N(b(lt), {
891
+ class: "tpl:text-[var(--tpl-text-muted)]",
892
+ size: 14,
893
+ "stroke-width": 2
894
+ }), E("span", null, g(b(i).templateSettings.preheaderText), 1)]), E("div", null, [N(Un, {
895
+ "model-value": e.settings.preheaderText ?? "",
896
+ placeholder: b(i).templateSettings.preheaderTextPlaceholder,
897
+ rows: 2,
898
+ "onUpdate:modelValue": n[4] ||= (e) => r("update", { preheaderText: e.replace(/[\r\n]/g, " ") || void 0 })
899
+ }, null, 8, ["model-value", "placeholder"]), E("div", or, [E("span", sr, g(b(i).templateSettings.preheaderTextHint), 1), E("span", cr, g((e.settings.preheaderText ?? "").length) + "/" + g(hr), 1)])])], 2),
900
+ E("div", lr, [E("div", ur, [N(b(ut), {
901
+ size: 14,
902
+ "stroke-width": 2
903
+ }), E("span", null, g(b(i).templateSettings.tips), 1)]), E("ul", dr, [
904
+ E("li", fr, g(b(i).templateSettings.tip1), 1),
905
+ E("li", pr, g(b(i).templateSettings.tip2), 1),
906
+ E("li", mr, g(b(i).templateSettings.tip3), 1)
907
+ ])])
908
+ ])]));
909
+ }
910
+ }), _r = { key: 0 }, vr = {
911
+ key: 0,
912
+ class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
913
+ }, yr = { key: 1 }, br = [
914
+ "type",
915
+ "value",
916
+ "placeholder"
917
+ ], xr = {
918
+ key: 0,
919
+ class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
920
+ }, Sr = "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)]", Q = /*#__PURE__*/ Ie(/* @__PURE__ */ M({
921
+ __name: "MergeTagInput",
922
+ props: {
923
+ modelValue: {},
924
+ type: { default: "text" },
925
+ placeholder: { default: "" },
926
+ pulse: {
927
+ type: Boolean,
928
+ default: !1
929
+ }
930
+ },
931
+ emits: ["update:modelValue"],
932
+ setup(e, { emit: t }) {
933
+ let n = e, r = t, i = p(null), { segments: a, hasMergeTags: o, canRequestMergeTag: c, isRequestingMergeTag: l, canInsertLogicTag: u, isRequestingLogicTag: d, isEditing: f, startEditing: m, handleInput: h, handleKeydown: g, handleClick: _, handleBlur: x, clearValue: C, insertMergeTag: w, insertLogicTag: D } = Cn({
934
+ modelValue: () => n.modelValue,
935
+ emit: (e) => r("update:modelValue", e),
936
+ elementRef: i
937
+ });
938
+ return (t, n) => b(o) && !b(f) ? (s(), v("div", _r, [N(kn, {
939
+ segments: b(a),
940
+ "display-class": Sr,
941
+ pulse: e.pulse,
942
+ onEdit: b(m),
943
+ onClear: b(C)
944
+ }, null, 8, [
945
+ "segments",
946
+ "pulse",
947
+ "onEdit",
948
+ "onClear"
949
+ ]), b(c) || b(u) ? (s(), v("div", vr, [b(c) ? (s(), S(Mn, {
950
+ key: 0,
951
+ disabled: b(l),
952
+ onInsert: b(w)
953
+ }, null, 8, ["disabled", "onInsert"])) : y("", !0), b(u) ? (s(), S(Fn, {
954
+ key: 1,
955
+ disabled: b(d),
956
+ onInsert: b(D)
957
+ }, null, 8, ["disabled", "onInsert"])) : y("", !0)])) : y("", !0)])) : (s(), v("div", yr, [E("input", {
958
+ ref_key: "inputRef",
959
+ ref: i,
960
+ type: e.type,
961
+ class: T([b(G), { "tpl-pulse-fill": e.pulse }]),
962
+ value: e.modelValue,
963
+ placeholder: e.placeholder,
964
+ onInput: n[0] ||= (...e) => b(h) && b(h)(...e),
965
+ onKeydown: n[1] ||= (...e) => b(g) && b(g)(...e),
966
+ onClick: n[2] ||= (...e) => b(_) && b(_)(...e),
967
+ onBlur: n[3] ||= (...e) => b(x) && b(x)(...e)
968
+ }, null, 42, br), b(c) || b(u) ? (s(), v("div", xr, [b(c) ? (s(), S(Mn, {
969
+ key: 0,
970
+ disabled: b(l),
971
+ onInsert: b(w)
972
+ }, null, 8, ["disabled", "onInsert"])) : y("", !0), b(u) ? (s(), S(Fn, {
973
+ key: 1,
974
+ disabled: b(d),
975
+ onInsert: b(D)
976
+ }, null, 8, ["disabled", "onInsert"])) : y("", !0)])) : y("", !0)]));
977
+ }
978
+ }), [["__scopeId", "data-v-d6563be6"]]), Cr = { class: "tpl:mb-3.5" }, wr = ["value"], Tr = { value: "" }, Er = ["value"], Dr = { class: "tpl:mb-3.5" }, Or = { class: "tpl:mb-3.5" }, kr = {
979
+ key: 0,
980
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
981
+ }, Ar = ["checked"], 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 = { class: "tpl:mb-3.5" }, Vr = ["value"], Hr = { value: "auto" }, Ur = { value: "full" }, Wr = { value: "custom" }, Gr = {
982
+ key: 0,
983
+ class: "tpl:mt-2 tpl:flex tpl:items-stretch"
984
+ }, Kr = ["value"], qr = 200, Jr = /* @__PURE__ */ M({
985
+ __name: "ButtonToolbar",
986
+ props: {
987
+ block: {},
988
+ fontFamilies: {}
989
+ },
990
+ emits: ["update"],
991
+ setup(e, { emit: t }) {
992
+ let n = e, r = t, { t: i } = U(), a = _(() => n.block.width === "full" ? "full" : typeof n.block.width == "number" ? "custom" : "auto");
993
+ function o(e, t) {
994
+ r("update", { [e]: t });
995
+ }
996
+ function c(e) {
997
+ if (e === "full") {
998
+ o("width", "full");
999
+ return;
1000
+ }
1001
+ if (e === "custom") {
1002
+ o("width", typeof n.block.width == "number" ? n.block.width : qr);
1003
+ return;
1004
+ }
1005
+ o("width", void 0);
1006
+ }
1007
+ function u(e) {
1008
+ let t = Number(e);
1009
+ !Number.isFinite(t) || t <= 0 || o("width", t);
1010
+ }
1011
+ return (t, n) => (s(), v(A, null, [
1012
+ E("div", Cr, [E("label", { class: T(b(K)) }, g(b(i).button.fontFamily), 3), E("select", {
1013
+ class: T(b(G)),
1014
+ value: e.block.fontFamily || "",
1015
+ onChange: n[0] ||= (e) => o("fontFamily", e.target.value || void 0)
1016
+ }, [E("option", Tr, g(b(i).button.inheritFont), 1), (s(!0), v(A, null, l(e.fontFamilies, (e) => (s(), v("option", {
1017
+ key: e.value,
1018
+ value: e.value
1019
+ }, g(e.label), 9, Er))), 128))], 42, wr)]),
1020
+ E("div", Dr, [E("label", { class: T(b(K)) }, g(b(i).button.text), 3), N(Q, {
1021
+ "model-value": e.block.text,
1022
+ type: "text",
1023
+ "onUpdate:modelValue": n[1] ||= (e) => o("text", e)
1024
+ }, null, 8, ["model-value"])]),
1025
+ E("div", Or, [
1026
+ E("label", { class: T(b(K)) }, g(b(i).button.url), 3),
1027
+ N(Q, {
1028
+ "model-value": e.block.url,
1029
+ type: "url",
1030
+ placeholder: b(i).button.urlPlaceholder,
1031
+ "onUpdate:modelValue": n[2] ||= (e) => o("url", e)
1032
+ }, null, 8, ["model-value", "placeholder"]),
1033
+ e.block.url ? (s(), v("label", kr, [E("input", {
1034
+ type: "checkbox",
1035
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1036
+ checked: e.block.openInNewTab ?? !1,
1037
+ onChange: n[3] ||= (e) => o("openInNewTab", e.target.checked)
1038
+ }, null, 40, Ar), j(" " + g(b(i).button.openInNewTab), 1)])) : y("", !0)
1039
+ ]),
1040
+ E("div", jr, [E("label", { class: T(b(K)) }, g(b(i).button.background), 3), N(Y, {
1041
+ "model-value": e.block.backgroundColor,
1042
+ "onUpdate:modelValue": n[4] ||= (e) => o("backgroundColor", e)
1043
+ }, null, 8, ["model-value"])]),
1044
+ E("div", Mr, [E("label", { class: T(b(K)) }, g(b(i).button.textColor), 3), N(Y, {
1045
+ "model-value": e.block.textColor,
1046
+ "onUpdate:modelValue": n[5] ||= (e) => o("textColor", e)
1047
+ }, null, 8, ["model-value"])]),
1048
+ E("div", Nr, [E("div", Pr, [E("label", { class: T(b(K)) }, g(b(i).button.borderRadius), 3), E("div", Fr, [E("input", {
1049
+ type: "number",
1050
+ class: T(b(J)),
1051
+ value: e.block.borderRadius,
1052
+ min: "0",
1053
+ max: "50",
1054
+ onInput: n[6] ||= (e) => o("borderRadius", Number(e.target.value))
1055
+ }, null, 42, Ir), E("span", { class: T(b(q)) }, "px", 2)])]), E("div", Lr, [E("label", { class: T(b(K)) }, g(b(i).button.fontSize), 3), E("div", Rr, [E("input", {
1056
+ type: "number",
1057
+ class: T(b(J)),
1058
+ value: e.block.fontSize,
1059
+ min: "10",
1060
+ max: "36",
1061
+ onInput: n[7] ||= (e) => o("fontSize", Number(e.target.value))
1062
+ }, null, 42, zr), E("span", { class: T(b(q)) }, "px", 2)])])]),
1063
+ E("div", Br, [
1064
+ E("label", { class: T(b(K)) }, g(b(i).button.width), 3),
1065
+ E("select", {
1066
+ class: T(b(G)),
1067
+ value: a.value,
1068
+ onChange: n[8] ||= (e) => c(e.target.value)
1069
+ }, [
1070
+ E("option", Hr, g(b(i).button.widthAuto), 1),
1071
+ E("option", Ur, g(b(i).button.fullWidth), 1),
1072
+ E("option", Wr, g(b(i).button.widthCustom), 1)
1073
+ ], 42, Vr),
1074
+ a.value === "custom" ? (s(), v("div", Gr, [E("input", {
1075
+ type: "number",
1076
+ class: T(b(J)),
1077
+ value: typeof e.block.width == "number" ? e.block.width : qr,
1078
+ min: "20",
1079
+ onInput: n[9] ||= (e) => u(e.target.value)
1080
+ }, null, 42, Kr), E("span", { class: T(b(q)) }, "px", 2)])) : y("", !0)
1081
+ ])
1082
+ ], 64));
1083
+ }
1084
+ }), Yr = { class: "spacing-control" }, Xr = { class: "tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Zr = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, Qr = { class: "tpl:flex tpl:items-center" }, $r = ["aria-label"], ei = ["value", "aria-label"], ti = ["aria-label"], ni = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ri = { class: "tpl:flex tpl:items-center" }, ii = ["aria-label"], ai = ["value", "aria-label"], oi = ["aria-label"], si = ["aria-label", "title"], ci = { class: "tpl:flex tpl:items-center" }, li = ["aria-label"], ui = ["value", "aria-label"], di = ["aria-label"], fi = { class: "tpl:flex tpl:items-center" }, pi = ["aria-label"], mi = ["value", "aria-label"], hi = ["aria-label"], $ = "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)]", gi = "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)]", _i = /*#__PURE__*/ Ie(/* @__PURE__ */ M({
1085
+ __name: "SpacingControl",
1086
+ props: {
1087
+ modelValue: {},
1088
+ label: {}
1089
+ },
1090
+ emits: ["update:modelValue"],
1091
+ setup(e, { emit: t }) {
1092
+ let n = e, r = t, { t: i } = U(), a = _(() => n.modelValue.top === n.modelValue.right && n.modelValue.right === n.modelValue.bottom && n.modelValue.bottom === n.modelValue.left), o = p(a.value);
1093
+ P(a, (e) => {
1094
+ !e && o.value && (o.value = !1);
1095
+ });
1096
+ function c(e, t) {
1097
+ let i = Math.max(0, n.modelValue[e] + t);
1098
+ o.value ? r("update:modelValue", {
1099
+ top: i,
1100
+ right: i,
1101
+ bottom: i,
1102
+ left: i
1103
+ }) : r("update:modelValue", {
1104
+ ...n.modelValue,
1105
+ [e]: i
1106
+ });
1107
+ }
1108
+ function l(e, t) {
1109
+ let i = Math.max(0, t);
1110
+ o.value ? r("update:modelValue", {
1111
+ top: i,
1112
+ right: i,
1113
+ bottom: i,
1114
+ left: i
1115
+ }) : r("update:modelValue", {
1116
+ ...n.modelValue,
1117
+ [e]: i
1118
+ });
1119
+ }
1120
+ function u() {
1121
+ if (o.value = !o.value, o.value) {
1122
+ let e = n.modelValue.top;
1123
+ r("update:modelValue", {
1124
+ top: e,
1125
+ right: e,
1126
+ bottom: e,
1127
+ left: e
1128
+ });
1129
+ }
1130
+ }
1131
+ return (t, n) => (s(), v("div", Yr, [E("label", Xr, g(e.label), 1), E("div", Zr, [
1132
+ E("div", Qr, [
1133
+ E("button", {
1134
+ "aria-label": b(i).spacingControl.decreaseTop,
1135
+ class: T([$, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1136
+ onClick: n[0] ||= (e) => c("top", -1)
1137
+ }, [N(b(bt), {
1138
+ size: 12,
1139
+ "stroke-width": 2
1140
+ })], 10, $r),
1141
+ E("input", {
1142
+ type: "number",
1143
+ class: T(gi),
1144
+ value: e.modelValue.top,
1145
+ "aria-label": b(i).spacingControl.top,
1146
+ min: "0",
1147
+ onInput: n[1] ||= (e) => l("top", Number(e.target.value))
1148
+ }, null, 40, ei),
1149
+ E("button", {
1150
+ "aria-label": b(i).spacingControl.increaseTop,
1151
+ class: T([$, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1152
+ onClick: n[2] ||= (e) => c("top", 1)
1153
+ }, [N(b(W), {
1154
+ size: 12,
1155
+ "stroke-width": 2
1156
+ })], 10, ti)
1157
+ ]),
1158
+ E("div", ni, [
1159
+ E("div", ri, [
1160
+ E("button", {
1161
+ "aria-label": b(i).spacingControl.decreaseLeft,
1162
+ class: T([$, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1163
+ onClick: n[3] ||= (e) => c("left", -1)
1164
+ }, [N(b(bt), {
1165
+ size: 12,
1166
+ "stroke-width": 2
1167
+ })], 10, ii),
1168
+ E("input", {
1169
+ type: "number",
1170
+ class: T(gi),
1171
+ value: e.modelValue.left,
1172
+ "aria-label": b(i).spacingControl.left,
1173
+ min: "0",
1174
+ onInput: n[4] ||= (e) => l("left", Number(e.target.value))
1175
+ }, null, 40, ai),
1176
+ E("button", {
1177
+ "aria-label": b(i).spacingControl.increaseLeft,
1178
+ class: T([$, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1179
+ onClick: n[5] ||= (e) => c("left", 1)
1180
+ }, [N(b(W), {
1181
+ size: 12,
1182
+ "stroke-width": 2
1183
+ })], 10, oi)
1184
+ ]),
1185
+ E("button", {
1186
+ class: T(["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)]", o.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)]"]),
1187
+ "aria-label": o.value ? b(i).spacingControl.unlock : b(i).spacingControl.lockAll,
1188
+ title: o.value ? b(i).spacingControl.unlock : b(i).spacingControl.lockAll,
1189
+ onClick: u
1190
+ }, [o.value ? (s(), S(b(mt), {
1191
+ key: 0,
1192
+ size: 14,
1193
+ "stroke-width": 2
1194
+ })) : (s(), S(b(gt), {
1195
+ key: 1,
1196
+ size: 14,
1197
+ "stroke-width": 2
1198
+ }))], 10, si),
1199
+ E("div", ci, [
1200
+ E("button", {
1201
+ "aria-label": b(i).spacingControl.decreaseRight,
1202
+ class: T([$, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1203
+ onClick: n[6] ||= (e) => c("right", -1)
1204
+ }, [N(b(bt), {
1205
+ size: 12,
1206
+ "stroke-width": 2
1207
+ })], 10, li),
1208
+ E("input", {
1209
+ type: "number",
1210
+ class: T(gi),
1211
+ value: e.modelValue.right,
1212
+ "aria-label": b(i).spacingControl.right,
1213
+ min: "0",
1214
+ onInput: n[7] ||= (e) => l("right", Number(e.target.value))
1215
+ }, null, 40, ui),
1216
+ E("button", {
1217
+ "aria-label": b(i).spacingControl.increaseRight,
1218
+ class: T([$, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1219
+ onClick: n[8] ||= (e) => c("right", 1)
1220
+ }, [N(b(W), {
1221
+ size: 12,
1222
+ "stroke-width": 2
1223
+ })], 10, di)
1224
+ ])
1225
+ ]),
1226
+ E("div", fi, [
1227
+ E("button", {
1228
+ "aria-label": b(i).spacingControl.decreaseBottom,
1229
+ class: T([$, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1230
+ onClick: n[9] ||= (e) => c("bottom", -1)
1231
+ }, [N(b(bt), {
1232
+ size: 12,
1233
+ "stroke-width": 2
1234
+ })], 10, pi),
1235
+ E("input", {
1236
+ type: "number",
1237
+ class: T(gi),
1238
+ value: e.modelValue.bottom,
1239
+ "aria-label": b(i).spacingControl.bottom,
1240
+ min: "0",
1241
+ onInput: n[10] ||= (e) => l("bottom", Number(e.target.value))
1242
+ }, null, 40, mi),
1243
+ E("button", {
1244
+ "aria-label": b(i).spacingControl.increaseBottom,
1245
+ class: T([$, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1246
+ onClick: n[11] ||= (e) => c("bottom", 1)
1247
+ }, [N(b(W), {
1248
+ size: 12,
1249
+ "stroke-width": 2
1250
+ })], 10, hi)
1251
+ ])
1252
+ ])]));
1253
+ }
1254
+ }), [["__scopeId", "data-v-9a9c8a07"]]), vi = { class: "tpl:mt-3" }, yi = /* @__PURE__ */ M({
1255
+ __name: "CollapsibleSection",
1256
+ props: {
1257
+ title: {},
1258
+ open: { type: Boolean },
1259
+ noBorder: { type: Boolean }
1260
+ },
1261
+ emits: ["toggle"],
1262
+ setup(e) {
1263
+ return (n, i) => (s(), v("div", { class: T(["tpl:py-3", e.noBorder ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [E("button", {
1264
+ type: "button",
1265
+ 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)]",
1266
+ onClick: i[0] ||= (e) => n.$emit("toggle")
1267
+ }, [N(b(qe), {
1268
+ class: T(["tpl:transition-transform tpl:duration-200", e.open ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1269
+ size: 12,
1270
+ "stroke-width": 2
1271
+ }, null, 8, ["class"]), E("span", null, g(e.title), 1)]), r(E("div", vi, [t(n.$slots, "default")], 512), [[D, e.open]])], 2));
1272
+ }
1273
+ }), bi = { class: "tpl:space-y-2" }, xi = ["checked", "onChange"], Si = { class: "tpl:space-y-2" }, Ci = ["value"], wi = { value: "" }, Ti = ["label"], Ei = ["value"], Di = ["value"], Oi = {
1274
+ key: 0,
1275
+ value: "__custom__"
1276
+ }, ki = {
1277
+ key: 0,
1278
+ class: "tpl:space-y-2"
1279
+ }, Ai = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, ji = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Mi = { class: "tpl:flex tpl:justify-end" }, Ni = ["disabled"], Pi = {
1280
+ key: 0,
1281
+ class: "tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"
1282
+ }, Fi = { class: "tpl:space-y-1" }, Ii = { 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)]" }, Li = {
1283
+ key: 0,
1284
+ 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)]"
1285
+ }, Ri = /* @__PURE__ */ M({
1286
+ __name: "CommonBlockSettings",
1287
+ props: {
1288
+ block: {},
1289
+ isFirstSection: { type: Boolean }
1290
+ },
1291
+ emits: ["update"],
1292
+ setup(e, { emit: t }) {
1293
+ let n = e, i = t, { t: a } = U(), c = u(Me, []), m = u(ft, !1), h = f(/* @__PURE__ */ new Set()), x = p(!1), C = p(""), D = p(""), O = [{
1294
+ key: "desktop",
1295
+ icon: vt,
1296
+ labelKey: "showOnDesktop"
1297
+ }, {
1298
+ key: "mobile",
1299
+ icon: wt,
1300
+ labelKey: "showOnMobile"
1301
+ }];
1302
+ function k(e) {
1303
+ h.has(e) ? h.delete(e) : h.add(e);
1304
+ }
1305
+ let M = _(() => c.length > 0 || m), F = _(() => n.block.displayCondition ? !c.some((e) => e.label === n.block.displayCondition?.label) : !1);
1306
+ function I() {
1307
+ x.value = !0, F.value && n.block.displayCondition ? (C.value = n.block.displayCondition.before, D.value = n.block.displayCondition.after ?? "") : (C.value = "", D.value = "");
1308
+ }
1309
+ function L() {
1310
+ C.value.trim() && (i("update", { displayCondition: {
1311
+ label: a.blockSettings.customCondition,
1312
+ before: C.value.trim(),
1313
+ after: D.value.trim()
1314
+ } }), x.value = !1, C.value = "", D.value = "");
1315
+ }
1316
+ P(() => n.block.displayCondition, (e) => {
1317
+ if (!e) {
1318
+ x.value = !1, C.value = "", D.value = "";
1319
+ return;
1320
+ }
1321
+ F.value && (C.value = e.before, D.value = e.after ?? "");
1322
+ }, { immediate: !0 });
1323
+ let ee = _(() => {
1324
+ let e = {};
1325
+ for (let t of c) {
1326
+ let n = t.group ?? "";
1327
+ e[n] || (e[n] = []), e[n].push(t);
1328
+ }
1329
+ return e;
1330
+ });
1331
+ function R(e, t) {
1332
+ i("update", { styles: {
1333
+ ...n.block.styles,
1334
+ [e]: t
1335
+ } });
1336
+ }
1337
+ function z(e) {
1338
+ return n.block.visibility?.[e] !== !1;
1339
+ }
1340
+ function B(e) {
1341
+ let t = {
1342
+ desktop: z("desktop"),
1343
+ mobile: z("mobile")
1344
+ };
1345
+ t[e] = !t[e], i("update", { visibility: t });
1346
+ }
1347
+ return (t, n) => (s(), v("div", { class: T(["tpl:flex tpl:flex-col", e.isFirstSection ? "" : "tpl:mt-4"]) }, [
1348
+ N(yi, {
1349
+ title: b(a).blockSettings.spacing,
1350
+ open: h.has("spacing"),
1351
+ "no-border": e.isFirstSection,
1352
+ onToggle: n[1] ||= (e) => k("spacing")
1353
+ }, {
1354
+ default: d(() => [N(_i, {
1355
+ label: b(a).blockSettings.padding,
1356
+ "model-value": e.block.styles.padding,
1357
+ "onUpdate:modelValue": n[0] ||= (e) => R("padding", e)
1358
+ }, null, 8, ["label", "model-value"])]),
1359
+ _: 1
1360
+ }, 8, [
1361
+ "title",
1362
+ "open",
1363
+ "no-border"
1364
+ ]),
1365
+ N(yi, {
1366
+ title: b(a).blockSettings.background,
1367
+ open: h.has("bg"),
1368
+ onToggle: n[3] ||= (e) => k("bg")
1369
+ }, {
1370
+ default: d(() => [E("label", { class: T(b(K)) }, g(b(a).blockSettings.color), 3), N(Y, {
1371
+ "model-value": e.block.styles.backgroundColor ?? "",
1372
+ "onUpdate:modelValue": n[2] ||= (e) => R("backgroundColor", e)
1373
+ }, null, 8, ["model-value"])]),
1374
+ _: 1
1375
+ }, 8, ["title", "open"]),
1376
+ N(yi, {
1377
+ title: b(a).blockSettings.display,
1378
+ open: h.has("display"),
1379
+ onToggle: n[4] ||= (e) => k("display")
1380
+ }, {
1381
+ default: d(() => [E("div", bi, [(s(), v(A, null, l(O, (e) => E("label", {
1382
+ key: e.key,
1383
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]"
1384
+ }, [
1385
+ E("input", {
1386
+ type: "checkbox",
1387
+ class: "tpl:accent-[var(--tpl-primary)]",
1388
+ checked: z(e.key),
1389
+ onChange: (t) => B(e.key)
1390
+ }, null, 40, xi),
1391
+ (s(), S(o(e.icon), {
1392
+ size: 14,
1393
+ "stroke-width": 1.5
1394
+ })),
1395
+ j(" " + g(b(a).blockSettings[e.labelKey]), 1)
1396
+ ])), 64))])]),
1397
+ _: 1
1398
+ }, 8, ["title", "open"]),
1399
+ M.value ? (s(), S(yi, {
1400
+ key: 0,
1401
+ title: b(a).blockSettings.displayCondition,
1402
+ open: h.has("condition"),
1403
+ onToggle: n[8] ||= (e) => k("condition")
1404
+ }, {
1405
+ default: d(() => [E("div", Si, [E("select", {
1406
+ class: T(["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)]"]),
1407
+ value: x.value || F.value ? "__custom__" : e.block.displayCondition?.label ?? "",
1408
+ onChange: n[5] ||= (e) => {
1409
+ let t = e.target.value;
1410
+ if (t === "__custom__") {
1411
+ I();
1412
+ return;
1413
+ }
1414
+ if (x.value = !1, !t) {
1415
+ i("update", { displayCondition: void 0 });
1416
+ return;
1417
+ }
1418
+ let n = b(c).find((e) => e.label === t);
1419
+ n && i("update", { displayCondition: n });
1420
+ }
1421
+ }, [
1422
+ E("option", wi, g(b(a).blockSettings.noCondition), 1),
1423
+ (s(!0), v(A, null, l(ee.value, (e, t) => (s(), v(A, { key: t }, [t ? (s(), v("optgroup", {
1424
+ key: 0,
1425
+ label: String(t)
1426
+ }, [(s(!0), v(A, null, l(e, (e) => (s(), v("option", {
1427
+ key: e.label,
1428
+ value: e.label
1429
+ }, g(e.label), 9, Ei))), 128))], 8, Ti)) : (s(!0), v(A, { key: 1 }, l(e, (e) => (s(), v("option", {
1430
+ key: e.label,
1431
+ value: e.label
1432
+ }, g(e.label), 9, Di))), 128))], 64))), 128)),
1433
+ b(m) ? (s(), v("option", Oi, g(b(a).blockSettings.customCondition), 1)) : y("", !0)
1434
+ ], 42, Ci), x.value || F.value ? (s(), v("div", ki, [
1435
+ E("div", null, [E("label", Ai, g(b(a).blockSettings.customConditionBefore), 1), r(E("textarea", {
1436
+ "onUpdate:modelValue": n[6] ||= (e) => C.value = e,
1437
+ rows: "2",
1438
+ class: T(b(Bt))
1439
+ }, null, 2), [[w, C.value]])]),
1440
+ E("div", null, [E("label", ji, g(b(a).blockSettings.customConditionAfter), 1), r(E("textarea", {
1441
+ "onUpdate:modelValue": n[7] ||= (e) => D.value = e,
1442
+ rows: "2",
1443
+ class: T(b(Bt))
1444
+ }, null, 2), [[w, D.value]])]),
1445
+ E("div", Mi, [E("button", {
1446
+ type: "button",
1447
+ 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",
1448
+ disabled: !C.value.trim(),
1449
+ onClick: L
1450
+ }, g(b(a).blockSettings.applyCondition), 9, Ni)])
1451
+ ])) : e.block.displayCondition && !F.value ? (s(), v(A, { key: 1 }, [e.block.displayCondition.description ? (s(), v("p", Pi, g(e.block.displayCondition.description), 1)) : y("", !0), E("div", Fi, [E("pre", Ii, g(e.block.displayCondition.before), 1), e.block.displayCondition.after ? (s(), v("pre", Li, g(e.block.displayCondition.after), 1)) : y("", !0)])], 64)) : y("", !0)])]),
1452
+ _: 1
1453
+ }, 8, ["title", "open"])) : y("", !0)
1454
+ ], 2));
1455
+ }
1456
+ }), zi = ["title"], Bi = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Vi = {
1457
+ key: 1,
1458
+ class: "tpl:text-[var(--tpl-danger)]"
1459
+ }, Hi = [
1460
+ "aria-checked",
1461
+ "aria-label",
1462
+ "disabled"
1463
+ ], Ui = /* @__PURE__ */ M({
1464
+ __name: "BooleanField",
1465
+ props: {
1466
+ field: {},
1467
+ modelValue: { type: Boolean },
1468
+ readOnly: { type: Boolean }
1469
+ },
1470
+ emits: ["update:modelValue"],
1471
+ setup(e, { emit: t }) {
1472
+ let n = t, { t: r } = U();
1473
+ return (t, i) => (s(), v("div", {
1474
+ class: "tpl:mb-3.5",
1475
+ title: e.readOnly ? b(r).customBlocks.dataSource.readOnlyTooltip : void 0
1476
+ }, [E("label", { class: T(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2", e.readOnly ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer"]) }, [E("span", Bi, [
1477
+ j(g(e.field.label) + " ", 1),
1478
+ e.readOnly ? (s(), S(b(mt), {
1479
+ key: 0,
1480
+ size: 12,
1481
+ class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1482
+ })) : y("", !0),
1483
+ e.field.required ? (s(), v("span", Vi, " * ")) : y("", !0)
1484
+ ]), E("button", {
1485
+ type: "button",
1486
+ role: "switch",
1487
+ "aria-checked": e.modelValue,
1488
+ "aria-label": e.field.label,
1489
+ class: T([
1490
+ "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",
1491
+ e.modelValue ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-border)]",
1492
+ e.readOnly ? "tpl:opacity-60 tpl:cursor-not-allowed" : "tpl:cursor-pointer"
1493
+ ]),
1494
+ disabled: e.readOnly,
1495
+ onClick: i[0] ||= (t) => !e.readOnly && n("update:modelValue", !e.modelValue)
1496
+ }, [E("span", { class: T(["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, Hi)], 2)], 8, zi));
1497
+ }
1498
+ }), Wi = { class: "tpl:mb-3.5" }, Gi = {
1499
+ key: 1,
1500
+ class: "tpl:text-[var(--tpl-danger)]"
1501
+ }, Ki = /* @__PURE__ */ M({
1502
+ __name: "FieldWrapper",
1503
+ props: {
1504
+ label: {},
1505
+ required: { type: Boolean },
1506
+ readOnly: { type: Boolean }
1507
+ },
1508
+ setup(e) {
1509
+ return (n, r) => (s(), v("div", Wi, [E("label", { class: T(b(K)) }, [
1510
+ j(g(e.label) + " ", 1),
1511
+ e.readOnly ? (s(), S(b(mt), {
1512
+ key: 0,
1513
+ size: 12,
1514
+ class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1515
+ })) : y("", !0),
1516
+ e.required ? (s(), v("span", Gi, "*")) : y("", !0)
1517
+ ], 2), t(n.$slots, "default")]));
1518
+ }
1519
+ }), qi = /* @__PURE__ */ M({
1520
+ __name: "ColorField",
1521
+ props: {
1522
+ field: {},
1523
+ modelValue: {},
1524
+ readOnly: { type: Boolean }
1525
+ },
1526
+ emits: ["update:modelValue"],
1527
+ setup(e, { emit: t }) {
1528
+ let n = t, { t: r } = U();
1529
+ return (t, i) => (s(), S(Ki, {
1530
+ label: e.field.label,
1531
+ required: e.field.required,
1532
+ "read-only": e.readOnly
1533
+ }, {
1534
+ default: d(() => [N(Y, {
1535
+ "model-value": e.modelValue,
1536
+ placeholder: e.field.placeholder,
1537
+ disabled: e.readOnly,
1538
+ title: e.readOnly ? b(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1539
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1540
+ }, null, 8, [
1541
+ "model-value",
1542
+ "placeholder",
1543
+ "disabled",
1544
+ "title"
1545
+ ])]),
1546
+ _: 1
1547
+ }, 8, [
1548
+ "label",
1549
+ "required",
1550
+ "read-only"
1551
+ ]));
1552
+ }
1553
+ }), Ji = {
1554
+ key: 0,
1555
+ class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
1556
+ style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 90%, transparent)" }
1557
+ }, Yi = [
1558
+ "value",
1559
+ "placeholder",
1560
+ "title"
1561
+ ], Xi = ["value", "placeholder"], Zi = /* @__PURE__ */ M({
1562
+ __name: "ImageField",
1563
+ props: {
1564
+ field: {},
1565
+ modelValue: {},
1566
+ readOnly: { type: Boolean }
1567
+ },
1568
+ emits: ["update:modelValue"],
1569
+ setup(e, { emit: t }) {
1570
+ let n = e, r = t, { t: i } = U(), a = u(at, null), o = V(), c = _(() => !!a);
1571
+ async function l() {
1572
+ let e = await a?.({ accept: ["images"] });
1573
+ o.alive && e && r("update:modelValue", e.url);
1574
+ }
1575
+ let f = p(), m = p(!1), h = _(() => c.value && !m.value && !n.readOnly);
1576
+ async function x(e) {
1577
+ if (a) {
1578
+ m.value = !0;
1579
+ try {
1580
+ let t = await a({
1581
+ accept: ["images"],
1582
+ files: e
1583
+ });
1584
+ if (!o.alive) return;
1585
+ t && r("update:modelValue", t.url);
1586
+ } finally {
1587
+ o.alive && (m.value = !1);
1588
+ }
1589
+ }
1590
+ }
1591
+ let { isOver: C } = Ae({
1592
+ target: f,
1593
+ enabled: h,
1594
+ onFiles: x
1595
+ });
1596
+ return (t, n) => (s(), S(Ki, {
1597
+ label: e.field.label,
1598
+ required: e.field.required,
1599
+ "read-only": e.readOnly
1600
+ }, {
1601
+ default: d(() => [E("div", {
1602
+ ref_key: "dropZoneRef",
1603
+ ref: f,
1604
+ class: "tpl:relative"
1605
+ }, [
1606
+ h.value && (b(C) || m.value) ? (s(), v("div", Ji, [m.value ? (s(), v(A, { key: 0 }, [N(b(Re), {
1607
+ class: "tpl-spinner",
1608
+ size: 18,
1609
+ "stroke-width": 2
1610
+ }), j(" " + g(b(i).image.uploading), 1)], 64)) : (s(), v(A, { key: 1 }, [N(b(Be), {
1611
+ size: 18,
1612
+ "stroke-width": 1.5
1613
+ }), j(" " + g(b(i).image.dropToUpload), 1)], 64))])) : y("", !0),
1614
+ e.readOnly ? (s(), v("input", {
1615
+ key: 1,
1616
+ type: "url",
1617
+ class: T([b(G), "tpl:opacity-60 tpl:cursor-not-allowed"]),
1618
+ value: e.modelValue,
1619
+ placeholder: e.field.placeholder || "https://...",
1620
+ disabled: "",
1621
+ title: b(i).customBlocks.dataSource.readOnlyTooltip
1622
+ }, null, 10, Yi)) : (s(), v("input", {
1623
+ key: 2,
1624
+ type: "url",
1625
+ class: T(b(G)),
1626
+ value: e.modelValue,
1627
+ placeholder: e.field.placeholder || "https://...",
1628
+ onInput: n[0] ||= (e) => r("update:modelValue", e.target.value)
1629
+ }, null, 42, Xi)),
1630
+ c.value && !e.readOnly ? (s(), v("button", {
1631
+ key: 3,
1632
+ 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)]",
1633
+ onClick: n[1] ||= (e) => l()
1634
+ }, [N(b(we), {
1635
+ size: 14,
1636
+ "stroke-width": 1.5
1637
+ }), j(" " + g(b(i).image.browseMedia), 1)])) : y("", !0)
1638
+ ], 512)]),
1639
+ _: 1
1640
+ }, 8, [
1641
+ "label",
1642
+ "required",
1643
+ "read-only"
1644
+ ]));
1645
+ }
1646
+ }), Qi = [
1647
+ "value",
1648
+ "placeholder",
1649
+ "min",
1650
+ "max",
1651
+ "step",
1652
+ "disabled",
1653
+ "title"
1654
+ ], $i = /* @__PURE__ */ M({
1655
+ __name: "NumberField",
1656
+ props: {
1657
+ field: {},
1658
+ modelValue: {},
1659
+ readOnly: { type: Boolean }
1660
+ },
1661
+ emits: ["update:modelValue"],
1662
+ setup(e, { emit: t }) {
1663
+ let n = t, { t: r } = U();
1664
+ return (t, i) => (s(), S(Ki, {
1665
+ label: e.field.label,
1666
+ required: e.field.required,
1667
+ "read-only": e.readOnly
1668
+ }, {
1669
+ default: d(() => [E("input", {
1670
+ type: "number",
1671
+ class: T([b(G), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
1672
+ value: e.modelValue,
1673
+ placeholder: e.field.placeholder,
1674
+ min: e.field.min,
1675
+ max: e.field.max,
1676
+ step: e.field.step,
1677
+ disabled: e.readOnly,
1678
+ title: e.readOnly ? b(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1679
+ onInput: i[0] ||= (t) => !e.readOnly && n("update:modelValue", Number(t.target.value))
1680
+ }, null, 42, Qi)]),
1681
+ _: 1
1682
+ }, 8, [
1683
+ "label",
1684
+ "required",
1685
+ "read-only"
1686
+ ]));
1687
+ }
1688
+ }), ea = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, ta = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, na = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, ra = ["title", "onClick"], ia = {
1689
+ key: 1,
1690
+ class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
1691
+ }, aa = /* @__PURE__ */ M({
1692
+ __name: "RepeatableField",
1693
+ props: {
1694
+ field: {},
1695
+ modelValue: {},
1696
+ readOnly: { type: Boolean }
1697
+ },
1698
+ emits: ["update:modelValue"],
1699
+ setup(e, { emit: t }) {
1700
+ let n = e, r = t, { t: i } = U(), a = _(() => n.modelValue || []), c = _(() => !n.field.maxItems || a.value.length < n.field.maxItems), u = _(() => !n.field.minItems || a.value.length > n.field.minItems);
1701
+ function f() {
1702
+ if (!c.value || n.readOnly) return;
1703
+ let e = {};
1704
+ for (let t of n.field.fields) e[t.key] = t.default ?? "";
1705
+ r("update:modelValue", [...a.value, e]);
1706
+ }
1707
+ function p(e) {
1708
+ if (!u.value || n.readOnly) return;
1709
+ let t = [...a.value];
1710
+ t.splice(e, 1), r("update:modelValue", t);
1711
+ }
1712
+ function m(e, t, n) {
1713
+ let i = a.value.map((r, i) => i === e ? {
1714
+ ...r,
1715
+ [t]: n
1716
+ } : r);
1717
+ r("update:modelValue", i);
1718
+ }
1719
+ return (t, n) => (s(), S(Ki, {
1720
+ label: e.field.label,
1721
+ required: e.field.required,
1722
+ "read-only": e.readOnly
1723
+ }, {
1724
+ default: d(() => [E("div", ea, [
1725
+ (s(!0), v(A, null, l(a.value, (t, n) => (s(), v("div", {
1726
+ key: `${e.field.key}-${n}`,
1727
+ class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
1728
+ }, [E("div", ta, [E("span", na, " #" + g(n + 1), 1), u.value && !e.readOnly ? (s(), v("button", {
1729
+ key: 0,
1730
+ type: "button",
1731
+ 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)]",
1732
+ title: b(i).customBlocks.fields.removeItem,
1733
+ onClick: (e) => p(n)
1734
+ }, [N(b(st), {
1735
+ size: 12,
1736
+ "stroke-width": 2
1737
+ })], 8, ra)) : y("", !0)]), (s(!0), v(A, null, l(e.field.fields, (r) => (s(), S(o(b(ma)(r.type)), {
1738
+ key: r.key,
1739
+ field: r,
1740
+ "model-value": t[r.key],
1741
+ "read-only": e.readOnly,
1742
+ "onUpdate:modelValue": (e) => m(n, r.key, e)
1743
+ }, null, 8, [
1744
+ "field",
1745
+ "model-value",
1746
+ "read-only",
1747
+ "onUpdate:modelValue"
1748
+ ]))), 128))]))), 128)),
1749
+ c.value && !e.readOnly ? (s(), v("button", {
1750
+ key: 0,
1751
+ type: "button",
1752
+ class: T(b(zt)),
1753
+ onClick: f
1754
+ }, [N(b(W), {
1755
+ size: 14,
1756
+ "stroke-width": 2
1757
+ }), j(" " + g(b(i).customBlocks.fields.addItem), 1)], 2)) : y("", !0),
1758
+ !c.value && !e.readOnly ? (s(), v("p", ia, g(b(i).customBlocks.fields.maxItemsReached), 1)) : y("", !0)
1759
+ ])]),
1760
+ _: 1
1761
+ }, 8, [
1762
+ "label",
1763
+ "required",
1764
+ "read-only"
1765
+ ]));
1766
+ }
1767
+ }), oa = [
1768
+ "value",
1769
+ "disabled",
1770
+ "title"
1771
+ ], sa = ["value"], ca = /* @__PURE__ */ M({
1772
+ __name: "SelectField",
1773
+ props: {
1774
+ field: {},
1775
+ modelValue: {},
1776
+ readOnly: { type: Boolean }
1777
+ },
1778
+ emits: ["update:modelValue"],
1779
+ setup(e, { emit: t }) {
1780
+ let n = t, { t: r } = U();
1781
+ return (t, i) => (s(), S(Ki, {
1782
+ label: e.field.label,
1783
+ required: e.field.required,
1784
+ "read-only": e.readOnly
1785
+ }, {
1786
+ default: d(() => [E("select", {
1787
+ class: T([b(G), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
1788
+ value: e.modelValue,
1789
+ disabled: e.readOnly,
1790
+ title: e.readOnly ? b(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1791
+ onChange: i[0] ||= (t) => !e.readOnly && n("update:modelValue", t.target.value)
1792
+ }, [(s(!0), v(A, null, l(e.field.options, (e) => (s(), v("option", {
1793
+ key: e.value,
1794
+ value: e.value
1795
+ }, g(e.label), 9, sa))), 128))], 42, oa)]),
1796
+ _: 1
1797
+ }, 8, [
1798
+ "label",
1799
+ "required",
1800
+ "read-only"
1801
+ ]));
1802
+ }
1803
+ }), la = [
1804
+ "value",
1805
+ "placeholder",
1806
+ "title"
1807
+ ], ua = /* @__PURE__ */ M({
1808
+ __name: "TextField",
1809
+ props: {
1810
+ field: {},
1811
+ modelValue: {},
1812
+ readOnly: { type: Boolean }
1813
+ },
1814
+ emits: ["update:modelValue"],
1815
+ setup(e, { emit: t }) {
1816
+ let n = t, { t: r } = U();
1817
+ return (t, i) => (s(), S(Ki, {
1818
+ label: e.field.label,
1819
+ required: e.field.required,
1820
+ "read-only": e.readOnly
1821
+ }, {
1822
+ default: d(() => [e.readOnly ? (s(), v("input", {
1823
+ key: 0,
1824
+ type: "text",
1825
+ class: T([b(G), "tpl:opacity-60 tpl:cursor-not-allowed"]),
1826
+ value: e.modelValue,
1827
+ placeholder: e.field.placeholder,
1828
+ disabled: "",
1829
+ title: b(r).customBlocks.dataSource.readOnlyTooltip
1830
+ }, null, 10, la)) : (s(), S(Q, {
1831
+ key: 1,
1832
+ "model-value": e.modelValue,
1833
+ placeholder: e.field.placeholder,
1834
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1835
+ }, null, 8, ["model-value", "placeholder"]))]),
1836
+ _: 1
1837
+ }, 8, [
1838
+ "label",
1839
+ "required",
1840
+ "read-only"
1841
+ ]));
1842
+ }
1843
+ }), da = [
1844
+ "value",
1845
+ "placeholder",
1846
+ "title"
1847
+ ], fa = "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", pa = {
1848
+ text: ua,
1849
+ textarea: /* @__PURE__ */ M({
1850
+ __name: "TextareaField",
1851
+ props: {
1852
+ field: {},
1853
+ modelValue: {},
1854
+ readOnly: { type: Boolean }
1855
+ },
1856
+ emits: ["update:modelValue"],
1857
+ setup(e, { emit: t }) {
1858
+ let n = t, { t: r } = U();
1859
+ return (t, i) => (s(), S(Ki, {
1860
+ label: e.field.label,
1861
+ required: e.field.required,
1862
+ "read-only": e.readOnly
1863
+ }, {
1864
+ default: d(() => [e.readOnly ? (s(), v("textarea", {
1865
+ key: 0,
1866
+ value: e.modelValue,
1867
+ placeholder: e.field.placeholder,
1868
+ rows: "3",
1869
+ disabled: "",
1870
+ title: b(r).customBlocks.dataSource.readOnlyTooltip,
1871
+ class: T(fa)
1872
+ }, null, 8, da)) : (s(), S(Un, {
1873
+ key: 1,
1874
+ "model-value": e.modelValue,
1875
+ placeholder: e.field.placeholder,
1876
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1877
+ }, null, 8, ["model-value", "placeholder"]))]),
1878
+ _: 1
1879
+ }, 8, [
1880
+ "label",
1881
+ "required",
1882
+ "read-only"
1883
+ ]));
1884
+ }
1885
+ }),
1886
+ image: Zi,
1887
+ color: qi,
1888
+ number: $i,
1889
+ select: ca,
1890
+ boolean: Ui,
1891
+ repeatable: aa
1892
+ };
1893
+ function ma(e) {
1894
+ return pa[e] ?? ua;
1895
+ }
1896
+ //#endregion
1897
+ //#region src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
1898
+ var ha = {
1899
+ key: 0,
1900
+ class: "tpl:p-4"
1901
+ }, ga = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, _a = { key: 1 }, va = {
1902
+ key: 0,
1903
+ class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
1904
+ }, ya = {
1905
+ key: 1,
1906
+ class: "tpl:mb-4"
1907
+ }, ba = {
1908
+ key: 1,
1909
+ class: "tpl:flex tpl:h-[32px] tpl:items-center"
1910
+ }, xa = {
1911
+ key: 0,
1912
+ class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
1913
+ }, Sa = {
1914
+ key: 2,
1915
+ class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
1916
+ }, Ca = /* @__PURE__ */ M({
1917
+ __name: "CustomBlockToolbar",
1918
+ props: { block: {} },
1919
+ emits: ["updateFieldValues", "updateDataSourceFetched"],
1920
+ setup(e, { emit: t }) {
1921
+ let n = e, r = t, { t: i } = U(), a = u(nt, []), c = _(() => a.find((e) => e.type === n.block.customType)), { isFetching: d, fetchError: f, fetch: p, hasDataSource: m, needsFetch: h } = Le({
1922
+ definition: c,
1923
+ block: _(() => n.block),
1924
+ onUpdate: (e, t) => {
1925
+ r("updateFieldValues", e), r("updateDataSourceFetched", t);
1926
+ }
1927
+ });
1928
+ function x(e) {
1929
+ return e.readOnly === !0 && m.value && !!n.block.dataSourceFetched;
1930
+ }
1931
+ function C(e, t) {
1932
+ r("updateFieldValues", {
1933
+ ...n.block.fieldValues,
1934
+ [e]: t
1935
+ });
1936
+ }
1937
+ return (t, n) => c.value ? (s(), v("div", _a, [
1938
+ c.value.description ? (s(), v("p", va, g(c.value.description), 1)) : y("", !0),
1939
+ b(m) ? (s(), v("div", ya, [b(h) && !b(d) ? (s(), v("button", {
1940
+ key: 0,
1941
+ type: "button",
1942
+ 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)]",
1943
+ onClick: n[0] ||= (...e) => b(p) && b(p)(...e)
1944
+ }, g(c.value?.dataSource?.label || b(i).customBlocks.dataSource.fetchButton), 1)) : (s(), v("div", ba, [b(d) ? (s(), v("div", xa, g(b(i).customBlocks.dataSource.fetching), 1)) : (s(), v("button", {
1945
+ key: 1,
1946
+ type: "button",
1947
+ 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)]",
1948
+ onClick: n[1] ||= (...e) => b(p) && b(p)(...e)
1949
+ }, [N(b(We), { size: 12 }), j(" " + g(b(i).customBlocks.dataSource.changeButton), 1)]))])), b(f) ? (s(), v("p", Sa, [N(b(Ye), {
1950
+ size: 14,
1951
+ class: "tpl:shrink-0"
1952
+ }), j(" " + g(b(i).customBlocks.dataSource.fetchError), 1)])) : y("", !0)])) : y("", !0),
1953
+ (s(!0), v(A, null, l(c.value.fields, (t) => (s(), S(o(b(ma)(t.type)), {
1954
+ key: t.key,
1955
+ field: t,
1956
+ "model-value": e.block.fieldValues[t.key],
1957
+ "read-only": x(t),
1958
+ "onUpdate:modelValue": (e) => C(t.key, e)
1959
+ }, null, 8, [
1960
+ "field",
1961
+ "model-value",
1962
+ "read-only",
1963
+ "onUpdate:modelValue"
1964
+ ]))), 128))
1965
+ ])) : (s(), v("div", ha, [E("p", ga, g(b(i).customBlocks.toolbar.noDefinition), 1)]));
1966
+ }
1967
+ }), wa = { class: "tpl:mb-3.5" }, Ta = { class: "tpl:mb-3.5" }, Ea = { class: "tpl:mb-3.5" }, Da = { class: "tpl:flex tpl:items-stretch" }, Oa = ["value"], ka = /* @__PURE__ */ M({
1968
+ __name: "DividerToolbar",
1969
+ props: { block: {} },
1970
+ emits: ["update"],
1971
+ setup(e, { emit: t }) {
1972
+ let n = t, { t: r } = U();
1973
+ function i(e, t) {
1974
+ n("update", { [e]: t });
1975
+ }
1976
+ return (t, n) => (s(), v(A, null, [
1977
+ E("div", wa, [E("label", { class: T(b(K)) }, g(b(r).divider.style), 3), N(Z, {
1978
+ options: [
1979
+ {
1980
+ value: "solid",
1981
+ label: b(r).divider.solid
1982
+ },
1983
+ {
1984
+ value: "dashed",
1985
+ label: b(r).divider.dashed
1986
+ },
1987
+ {
1988
+ value: "dotted",
1989
+ label: b(r).divider.dotted
1990
+ }
1991
+ ],
1992
+ "model-value": e.block.lineStyle,
1993
+ "onUpdate:modelValue": n[0] ||= (e) => i("lineStyle", e)
1994
+ }, null, 8, ["options", "model-value"])]),
1995
+ E("div", Ta, [E("label", { class: T(b(K)) }, g(b(r).divider.color), 3), N(Y, {
1996
+ "model-value": e.block.color,
1997
+ "onUpdate:modelValue": n[1] ||= (e) => i("color", e)
1998
+ }, null, 8, ["model-value"])]),
1999
+ E("div", Ea, [E("label", { class: T(b(K)) }, g(b(r).divider.thickness), 3), E("div", Da, [E("input", {
2000
+ type: "number",
2001
+ class: T(b(J)),
2002
+ value: e.block.thickness,
2003
+ min: "1",
2004
+ max: "10",
2005
+ onInput: n[2] ||= (e) => i("thickness", Number(e.target.value))
2006
+ }, null, 42, Oa), E("span", { class: T(b(q)) }, "px", 2)])])
2007
+ ], 64));
2008
+ }
2009
+ }), Aa = { class: "tpl:mb-3.5" }, ja = ["value"], Ma = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, Na = /* @__PURE__ */ M({
2010
+ __name: "HtmlToolbar",
2011
+ props: { block: {} },
2012
+ emits: ["update"],
2013
+ setup(e, { emit: t }) {
2014
+ let n = t, { t: r } = U();
2015
+ return (t, i) => (s(), v("div", Aa, [
2016
+ E("label", { class: T(b(K)) }, g(b(r).html.content), 3),
2017
+ E("textarea", {
2018
+ value: e.block.content,
2019
+ placeholder: "<div>...</div>",
2020
+ rows: "10",
2021
+ class: T(b(Bt)),
2022
+ onInput: i[0] ||= (e) => n("update", { content: e.target.value })
2023
+ }, null, 42, ja),
2024
+ E("p", Ma, [N(b(ut), {
2025
+ size: 12,
2026
+ class: "tpl:mt-0.5 tpl:shrink-0"
2027
+ }), j(" " + g(b(r).html.sanitizationHint), 1)])
2028
+ ]));
2029
+ }
2030
+ }), Pa = { class: "tpl:mb-3.5" }, Fa = {
2031
+ key: 0,
2032
+ class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
2033
+ style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 90%, transparent)" }
2034
+ }, Ia = {
2035
+ key: 0,
2036
+ class: "tpl:mb-3.5"
2037
+ }, La = ["value", "placeholder"], Ra = { class: "tpl:mb-3.5" }, za = { class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]" }, Ba = ["checked"], Va = { class: "tpl:block tpl:text-[var(--tpl-text-dim)]" }, Ha = { class: "tpl:mb-3.5" }, Ua = ["value"], Wa = { value: "full" }, Ga = { value: "custom" }, Ka = {
2038
+ key: 0,
2039
+ class: "tpl:mt-2 tpl:flex tpl:items-stretch"
2040
+ }, qa = ["value"], Ja = { class: "tpl:mb-3.5" }, Ya = { class: "tpl:mb-3.5" }, Xa = {
2041
+ key: 0,
2042
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
2043
+ }, Za = ["checked"], Qa = 350, $a = /* @__PURE__ */ M({
2044
+ __name: "ImageToolbar",
2045
+ props: { block: {} },
2046
+ emits: ["update"],
2047
+ setup(e, { emit: t }) {
2048
+ let n = e, r = t, { t: i } = U(), a = u(at, null), o = u(Ve, Ce.liquid), c = V(), l = _(() => !!a), d = p(!1), f = p(!1), { start: m } = dt(() => {
2049
+ d.value = !1;
2050
+ }, 1e3, { immediate: !1 }), h = [
2051
+ 300,
2052
+ 400,
2053
+ 500
2054
+ ], x = _(() => {
2055
+ let e = n.block.width;
2056
+ return e === "full" ? "full" : h.includes(e) ? String(e) : "custom";
2057
+ });
2058
+ function S(e, t) {
2059
+ r("update", { [e]: t });
2060
+ }
2061
+ function C(e) {
2062
+ if (e === "custom") {
2063
+ let e = n.block.width;
2064
+ (typeof e != "number" || h.includes(e)) && S("width", Qa);
2065
+ return;
2066
+ }
2067
+ S("width", e === "full" ? "full" : Number(e));
2068
+ }
2069
+ function w(e) {
2070
+ let t = Number(e);
2071
+ !Number.isFinite(t) || t <= 0 || S("width", t);
2072
+ }
2073
+ async function D() {
2074
+ let e = await a?.({ accept: ["images"] });
2075
+ c.alive && e && (S("src", e.url), e.alt && (S("alt", e.alt), f.value = !0), d.value = !0, m());
2076
+ }
2077
+ let O = p(), k = p(!1), M = _(() => L(n.block.src, o)), P = _(() => l.value && !k.value && !M.value);
2078
+ async function F(e) {
2079
+ if (a) {
2080
+ k.value = !0;
2081
+ try {
2082
+ let t = await a({
2083
+ accept: ["images"],
2084
+ files: e
2085
+ });
2086
+ if (!c.alive) return;
2087
+ t && (S("src", t.url), t.alt && (S("alt", t.alt), f.value = !0), d.value = !0, m());
2088
+ } finally {
2089
+ c.alive && (k.value = !1);
2090
+ }
2091
+ }
2092
+ }
2093
+ let { isOver: I } = Ae({
2094
+ target: O,
2095
+ enabled: P,
2096
+ onFiles: F
2097
+ });
2098
+ return (t, n) => (s(), v(A, null, [
2099
+ E("div", Pa, [E("label", { class: T(b(K)) }, g(b(i).image.imageUrl), 3), E("div", {
2100
+ ref_key: "dropZoneRef",
2101
+ ref: O,
2102
+ class: "tpl:relative"
2103
+ }, [
2104
+ P.value && (b(I) || k.value) ? (s(), v("div", Fa, [k.value ? (s(), v(A, { key: 0 }, [N(b(Re), {
2105
+ class: "tpl-spinner",
2106
+ size: 18,
2107
+ "stroke-width": 2
2108
+ }), j(" " + g(b(i).image.uploading), 1)], 64)) : (s(), v(A, { key: 1 }, [N(b(Be), {
2109
+ size: 18,
2110
+ "stroke-width": 1.5
2111
+ }), j(" " + g(b(i).image.dropToUpload), 1)], 64))])) : y("", !0),
2112
+ N(Q, {
2113
+ "model-value": e.block.src,
2114
+ type: "url",
2115
+ placeholder: b(i).image.imageUrlPlaceholder,
2116
+ pulse: d.value,
2117
+ "onUpdate:modelValue": n[0] ||= (e) => S("src", e)
2118
+ }, null, 8, [
2119
+ "model-value",
2120
+ "placeholder",
2121
+ "pulse"
2122
+ ]),
2123
+ l.value ? (s(), v("button", {
2124
+ key: 1,
2125
+ 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",
2126
+ style: {
2127
+ "border-color": "var(--tpl-border)",
2128
+ color: "var(--tpl-primary)",
2129
+ "background-color": "var(--tpl-bg)"
2130
+ },
2131
+ onClick: D
2132
+ }, [N(b(we), {
2133
+ size: 14,
2134
+ "stroke-width": 1.5
2135
+ }), j(" " + g(b(i).image.browseMedia), 1)])) : y("", !0)
2136
+ ], 512)]),
2137
+ b(L)(e.block.src, b(o)) ? (s(), v("div", Ia, [E("label", { class: T(b(K)) }, [j(g(b(i).image.placeholderUrl) + " ", 1), n[9] ||= E("span", { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, g("(optional)"), -1)], 2), E("input", {
2138
+ type: "url",
2139
+ class: T(b(G)),
2140
+ value: e.block.placeholderUrl || "",
2141
+ placeholder: b(i).image.placeholderUrlPlaceholder,
2142
+ onInput: n[1] ||= (e) => S("placeholderUrl", e.target.value)
2143
+ }, null, 42, La)])) : y("", !0),
2144
+ E("div", Ra, [
2145
+ E("label", { class: T(b(K)) }, g(b(i).image.altText), 3),
2146
+ N(Q, {
2147
+ "model-value": e.block.alt,
2148
+ type: "text",
2149
+ placeholder: b(i).image.altTextPlaceholder,
2150
+ pulse: f.value,
2151
+ disabled: e.block.decorative === !0,
2152
+ "onUpdate:modelValue": n[2] ||= (e) => S("alt", e)
2153
+ }, null, 8, [
2154
+ "model-value",
2155
+ "placeholder",
2156
+ "pulse",
2157
+ "disabled"
2158
+ ]),
2159
+ E("label", za, [E("input", {
2160
+ type: "checkbox",
2161
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
2162
+ checked: e.block.decorative === !0,
2163
+ onChange: n[3] ||= (e) => S("decorative", e.target.checked)
2164
+ }, null, 40, Ba), E("span", null, [j(g(b(i).image.decorative) + " ", 1), E("span", Va, g(b(i).image.decorativeHint), 1)])])
2165
+ ]),
2166
+ E("div", Ha, [
2167
+ E("label", { class: T(b(K)) }, g(b(i).image.width), 3),
2168
+ E("select", {
2169
+ class: T(b(G)),
2170
+ value: x.value,
2171
+ onChange: n[4] ||= (e) => C(e.target.value)
2172
+ }, [
2173
+ E("option", Wa, g(b(i).image.fullWidth), 1),
2174
+ n[10] ||= E("option", { value: "300" }, "300px", -1),
2175
+ n[11] ||= E("option", { value: "400" }, "400px", -1),
2176
+ n[12] ||= E("option", { value: "500" }, "500px", -1),
2177
+ E("option", Ga, g(b(i).image.widthCustom), 1)
2178
+ ], 42, Ua),
2179
+ x.value === "custom" ? (s(), v("div", Ka, [E("input", {
2180
+ type: "number",
2181
+ class: T(b(J)),
2182
+ value: typeof e.block.width == "number" ? e.block.width : Qa,
2183
+ min: "20",
2184
+ onInput: n[5] ||= (e) => w(e.target.value)
2185
+ }, null, 42, qa), E("span", { class: T(b(q)) }, "px", 2)])) : y("", !0)
2186
+ ]),
2187
+ E("div", Ja, [E("label", { class: T(b(K)) }, g(b(i).title.align), 3), N(Z, {
2188
+ options: [
2189
+ {
2190
+ value: "left",
2191
+ label: b(i).title.alignLeft
2192
+ },
2193
+ {
2194
+ value: "center",
2195
+ label: b(i).title.alignCenter
2196
+ },
2197
+ {
2198
+ value: "right",
2199
+ label: b(i).title.alignRight
2200
+ }
2201
+ ],
2202
+ "model-value": e.block.align,
2203
+ "onUpdate:modelValue": n[6] ||= (e) => S("align", e)
2204
+ }, null, 8, ["options", "model-value"])]),
2205
+ E("div", Ya, [
2206
+ E("label", { class: T(b(K)) }, g(b(i).image.linkUrl), 3),
2207
+ N(Q, {
2208
+ "model-value": e.block.linkUrl || "",
2209
+ type: "url",
2210
+ placeholder: b(i).image.imageUrlPlaceholder,
2211
+ "onUpdate:modelValue": n[7] ||= (e) => S("linkUrl", e)
2212
+ }, null, 8, ["model-value", "placeholder"]),
2213
+ e.block.linkUrl ? (s(), v("label", Xa, [E("input", {
2214
+ type: "checkbox",
2215
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
2216
+ checked: e.block.linkOpenInNewTab ?? !1,
2217
+ onChange: n[8] ||= (e) => S("linkOpenInNewTab", e.target.checked)
2218
+ }, null, 40, Za), j(" " + g(b(i).image.openInNewTab), 1)])) : y("", !0)
2219
+ ])
2220
+ ], 64));
2221
+ }
2222
+ }), eo = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, to = { class: "tpl:flex tpl:items-center tpl:gap-2" }, no = [
2223
+ "value",
2224
+ "placeholder",
2225
+ "onInput"
2226
+ ], ro = ["title", "onClick"], io = { class: "tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, ao = ["checked", "onChange"], oo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, so = ["value"], co = { value: "" }, lo = ["value"], uo = ["value"], fo = /* @__PURE__ */ M({
2227
+ __name: "MenuToolbar",
2228
+ props: {
2229
+ block: {},
2230
+ fontFamilies: {}
2231
+ },
2232
+ emits: ["update"],
2233
+ setup(e, { emit: t }) {
2234
+ let n = e, r = t, { t: i } = U(), a = _(() => [
2235
+ {
2236
+ key: "openInNewTab",
2237
+ label: i.menu.openInNewTab
2238
+ },
2239
+ {
2240
+ key: "bold",
2241
+ label: i.menu.bold
2242
+ },
2243
+ {
2244
+ key: "underline",
2245
+ label: i.menu.underline
2246
+ }
2247
+ ]), o = _(() => [
2248
+ {
2249
+ value: "left",
2250
+ label: i.title.alignLeft,
2251
+ icon: kt
2252
+ },
2253
+ {
2254
+ value: "center",
2255
+ label: i.title.alignCenter,
2256
+ icon: At
2257
+ },
2258
+ {
2259
+ value: "right",
2260
+ label: i.title.alignRight,
2261
+ icon: Et
2262
+ }
2263
+ ]);
2264
+ function c(e, t) {
2265
+ r("update", { [e]: t });
2266
+ }
2267
+ function u() {
2268
+ let e = {
2269
+ id: ge(),
2270
+ text: "",
2271
+ url: "",
2272
+ openInNewTab: !1,
2273
+ bold: !1,
2274
+ underline: !1
2275
+ };
2276
+ r("update", { items: [...n.block.items, e] });
2277
+ }
2278
+ function f(e, t, i) {
2279
+ let a = n.block.items.map((n) => n.id === e ? {
2280
+ ...n,
2281
+ [t]: i
2282
+ } : n);
2283
+ r("update", { items: a });
2284
+ }
2285
+ function p(e) {
2286
+ r("update", { items: n.block.items.filter((t) => t.id !== e) });
2287
+ }
2288
+ return (t, n) => (s(), v(A, null, [
2289
+ N(X, { label: b(i).menu.items }, {
2290
+ default: d(() => [E("div", eo, [(s(!0), v(A, null, l(e.block.items, (t) => (s(), v("div", {
2291
+ key: t.id,
2292
+ 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"
2293
+ }, [
2294
+ E("div", to, [E("input", {
2295
+ type: "text",
2296
+ class: T([b(G), "tpl:flex-1"]),
2297
+ value: t.text,
2298
+ placeholder: b(i).menu.text,
2299
+ onInput: (e) => f(t.id, "text", e.target.value)
2300
+ }, null, 42, no), E("button", {
2301
+ class: T(b(Rt)),
2302
+ title: b(i).menu.removeItem,
2303
+ onClick: (e) => p(t.id)
2304
+ }, [N(b(it), {
2305
+ size: 14,
2306
+ "stroke-width": 2
2307
+ })], 10, ro)]),
2308
+ N(Q, {
2309
+ "model-value": t.url,
2310
+ type: "url",
2311
+ placeholder: b(i).menu.urlPlaceholder,
2312
+ "onUpdate:modelValue": (e) => f(t.id, "url", e)
2313
+ }, null, 8, [
2314
+ "model-value",
2315
+ "placeholder",
2316
+ "onUpdate:modelValue"
2317
+ ]),
2318
+ E("div", io, [(s(!0), v(A, null, l(a.value, (e) => (s(), v("label", {
2319
+ key: e.key,
2320
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1"
2321
+ }, [E("input", {
2322
+ type: "checkbox",
2323
+ checked: t[e.key],
2324
+ class: "tpl:accent-[var(--tpl-primary)]",
2325
+ onChange: (n) => f(t.id, e.key, n.target.checked)
2326
+ }, null, 40, ao), j(" " + g(e.label), 1)]))), 128))]),
2327
+ E("div", oo, [E("label", { class: T([b(K), "tpl:!mb-0"]) }, g(b(i).menu.color), 3), N(Y, {
2328
+ "swatch-only": "",
2329
+ "model-value": t.color || e.block.linkColor || e.block.color,
2330
+ "onUpdate:modelValue": (e) => f(t.id, "color", e)
2331
+ }, null, 8, ["model-value", "onUpdate:modelValue"])])
2332
+ ]))), 128)), E("button", {
2333
+ class: T(b(zt)),
2334
+ onClick: u
2335
+ }, [N(b(W), {
2336
+ size: 14,
2337
+ "stroke-width": 2
2338
+ }), j(" " + g(b(i).menu.addItem), 1)], 2)])]),
2339
+ _: 1
2340
+ }, 8, ["label"]),
2341
+ N(X, { label: b(i).menu.fontFamily }, {
2342
+ default: d(() => [E("select", {
2343
+ class: T(b(G)),
2344
+ value: e.block.fontFamily || "",
2345
+ onChange: n[0] ||= (e) => c("fontFamily", e.target.value || void 0)
2346
+ }, [E("option", co, g(b(i).title.inheritFont), 1), (s(!0), v(A, null, l(e.fontFamilies, (e) => (s(), v("option", {
2347
+ key: e.value,
2348
+ value: e.value
2349
+ }, g(e.label), 9, lo))), 128))], 42, so)]),
2350
+ _: 1
2351
+ }, 8, ["label"]),
2352
+ N(X, { label: b(i).menu.fontSize }, {
2353
+ default: d(() => [N(Wt, {
2354
+ "model-value": e.block.fontSize,
2355
+ min: 8,
2356
+ max: 48,
2357
+ suffix: "px",
2358
+ "onUpdate:modelValue": n[1] ||= (e) => c("fontSize", e)
2359
+ }, null, 8, ["model-value"])]),
2360
+ _: 1
2361
+ }, 8, ["label"]),
2362
+ N(X, { label: b(i).menu.color }, {
2363
+ default: d(() => [N(Y, {
2364
+ "model-value": e.block.color,
2365
+ "onUpdate:modelValue": n[2] ||= (e) => c("color", e)
2366
+ }, null, 8, ["model-value"])]),
2367
+ _: 1
2368
+ }, 8, ["label"]),
2369
+ N(X, { label: b(i).menu.linkColor }, {
2370
+ default: d(() => [N(Y, {
2371
+ "model-value": e.block.linkColor || e.block.color,
2372
+ "onUpdate:modelValue": n[3] ||= (e) => c("linkColor", e || void 0)
2373
+ }, null, 8, ["model-value"])]),
2374
+ _: 1
2375
+ }, 8, ["label"]),
2376
+ N(X, { label: b(i).menu.textAlign }, {
2377
+ default: d(() => [N(Z, {
2378
+ options: o.value,
2379
+ "model-value": e.block.textAlign,
2380
+ "onUpdate:modelValue": n[4] ||= (e) => c("textAlign", e)
2381
+ }, null, 8, ["options", "model-value"])]),
2382
+ _: 1
2383
+ }, 8, ["label"]),
2384
+ N(X, { label: b(i).menu.separator }, {
2385
+ default: d(() => [E("input", {
2386
+ type: "text",
2387
+ class: T(b(G)),
2388
+ value: e.block.separator,
2389
+ onInput: n[5] ||= (e) => c("separator", e.target.value)
2390
+ }, null, 42, uo)]),
2391
+ _: 1
2392
+ }, 8, ["label"]),
2393
+ N(X, { label: b(i).menu.separatorColor }, {
2394
+ default: d(() => [N(Y, {
2395
+ "model-value": e.block.separatorColor,
2396
+ "onUpdate:modelValue": n[6] ||= (e) => c("separatorColor", e)
2397
+ }, null, 8, ["model-value"])]),
2398
+ _: 1
2399
+ }, 8, ["label"]),
2400
+ N(X, { label: b(i).menu.spacing }, {
2401
+ default: d(() => [N(Wt, {
2402
+ "model-value": e.block.spacing,
2403
+ min: 0,
2404
+ max: 50,
2405
+ suffix: "px",
2406
+ "onUpdate:modelValue": n[7] ||= (e) => c("spacing", e)
2407
+ }, null, 8, ["model-value"])]),
2408
+ _: 1
2409
+ }, 8, ["label"])
2410
+ ], 64));
2411
+ }
2412
+ });
2413
+ //#endregion
2414
+ //#region src/utils/rebalanceColumnChildren.ts
2415
+ function po(e) {
2416
+ return e === "1" ? 1 : e === "3" ? 3 : 2;
2417
+ }
2418
+ function mo(e, t) {
2419
+ let n = po(t);
2420
+ if (e.length === n) return e;
2421
+ if (e.length < n) {
2422
+ let t = Array.from({ length: n - e.length }, () => []);
2423
+ return [...e, ...t];
2424
+ }
2425
+ let r = e.slice(0, n), i = e.slice(n).flat(), a = [...r[n - 1], ...i];
2426
+ return [...r.slice(0, n - 1), a];
2427
+ }
2428
+ //#endregion
2429
+ //#region src/components/toolbar/SectionToolbar.vue?vue&type=script&setup=true&lang.ts
2430
+ var ho = { class: "tpl:mb-3.5" }, go = ["value"], _o = ["value"], vo = { class: "tpl:mb-3.5" }, yo = { class: "tpl:flex tpl:items-stretch" }, bo = ["value"], xo = { class: "tpl:mb-3.5" }, So = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, Co = ["checked"], wo = {
2431
+ key: 0,
2432
+ class: "tpl:mt-3 tpl:ml-0.5 tpl:space-y-3 tpl:border-l tpl:border-[var(--tpl-border)] tpl:pl-3"
2433
+ }, To = { class: "tpl:flex tpl:items-stretch" }, Eo = ["value"], Do = /* @__PURE__ */ M({
2434
+ __name: "SectionToolbar",
2435
+ props: { block: {} },
2436
+ emits: ["update"],
2437
+ setup(e, { emit: t }) {
2438
+ let n = e, r = t, { t: i } = U(), a = _(() => [
2439
+ {
2440
+ value: "1",
2441
+ label: i.section.column1
2442
+ },
2443
+ {
2444
+ value: "2",
2445
+ label: i.section.column2
2446
+ },
2447
+ {
2448
+ value: "3",
2449
+ label: i.section.column3
2450
+ },
2451
+ {
2452
+ value: "1-2",
2453
+ label: i.section.ratio12
2454
+ },
2455
+ {
2456
+ value: "2-1",
2457
+ label: i.section.ratio21
2458
+ }
2459
+ ]);
2460
+ function o(e) {
2461
+ let t = e.target.value, i = mo(n.block.children, t);
2462
+ r("update", {
2463
+ columns: t,
2464
+ children: i
2465
+ });
2466
+ }
2467
+ function c(e) {
2468
+ let t = Number(e.target.value);
2469
+ r("update", { borderRadius: t });
2470
+ }
2471
+ function u(e) {
2472
+ r("update", { wrapper: e ? { padding: {
2473
+ top: 20,
2474
+ right: 20,
2475
+ bottom: 20,
2476
+ left: 20
2477
+ } } : void 0 });
2478
+ }
2479
+ function d(e) {
2480
+ r("update", { wrapper: {
2481
+ ...n.block.wrapper,
2482
+ ...e
2483
+ } });
2484
+ }
2485
+ function f(e) {
2486
+ d({ padding: e });
2487
+ }
2488
+ function p(e) {
2489
+ d({ borderRadius: Number(e.target.value) });
2490
+ }
2491
+ return (t, n) => (s(), v(A, null, [
2492
+ E("div", ho, [E("label", { class: T(b(K)) }, g(b(i).section.columns), 3), E("select", {
2493
+ class: T(b(G)),
2494
+ value: e.block.columns,
2495
+ onChange: o
2496
+ }, [(s(!0), v(A, null, l(a.value, (e) => (s(), v("option", {
2497
+ key: e.value,
2498
+ value: e.value
2499
+ }, g(e.label), 9, _o))), 128))], 42, go)]),
2500
+ E("div", vo, [E("label", { class: T(b(K)) }, g(b(i).section.borderRadius), 3), E("div", yo, [E("input", {
2501
+ type: "number",
2502
+ class: T(b(J)),
2503
+ value: e.block.borderRadius ?? 0,
2504
+ min: "0",
2505
+ max: "50",
2506
+ onInput: c
2507
+ }, null, 42, bo), E("span", { class: T(b(q)) }, "px", 2)])]),
2508
+ E("div", xo, [E("label", So, [E("input", {
2509
+ type: "checkbox",
2510
+ class: "tpl:accent-[var(--tpl-primary)]",
2511
+ checked: !!e.block.wrapper,
2512
+ onChange: n[0] ||= (e) => u(e.target.checked)
2513
+ }, null, 40, Co), j(" " + g(b(i).section.wrapperEnable), 1)]), e.block.wrapper ? (s(), v("div", wo, [
2514
+ E("div", null, [E("label", { class: T(b(K)) }, g(b(i).blockSettings.color), 3), N(Y, {
2515
+ "model-value": e.block.wrapper.backgroundColor ?? "",
2516
+ "onUpdate:modelValue": n[1] ||= (e) => d({ backgroundColor: e })
2517
+ }, null, 8, ["model-value"])]),
2518
+ N(_i, {
2519
+ label: b(i).blockSettings.padding,
2520
+ "model-value": e.block.wrapper.padding ?? {
2521
+ top: 0,
2522
+ right: 0,
2523
+ bottom: 0,
2524
+ left: 0
2525
+ },
2526
+ "onUpdate:modelValue": f
2527
+ }, null, 8, ["label", "model-value"]),
2528
+ E("div", null, [E("label", { class: T(b(K)) }, g(b(i).section.borderRadius), 3), E("div", To, [E("input", {
2529
+ type: "number",
2530
+ class: T(b(J)),
2531
+ value: e.block.wrapper.borderRadius ?? 0,
2532
+ min: "0",
2533
+ max: "50",
2534
+ onInput: p
2535
+ }, null, 42, Eo), E("span", { class: T(b(q)) }, "px", 2)])])
2536
+ ])) : y("", !0)])
2537
+ ], 64));
2538
+ }
2539
+ }), Oo = { class: "tpl:mb-3.5" }, ko = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Ao = { class: "tpl:flex tpl:items-center tpl:gap-2" }, jo = ["value", "onChange"], Mo = ["value"], No = ["title", "onClick"], Po = { class: "tpl:mb-3.5" }, Fo = ["value"], Io = { value: "solid" }, Lo = { value: "outlined" }, Ro = { value: "rounded" }, zo = { value: "square" }, Bo = { value: "circle" }, Vo = { class: "tpl:mb-3.5" }, Ho = { class: "tpl:mb-3.5" }, Uo = { class: "tpl:flex tpl:items-stretch" }, Wo = ["value"], Go = { class: "tpl:mb-3.5" }, Ko = /* @__PURE__ */ M({
2540
+ __name: "SocialToolbar",
2541
+ props: { block: {} },
2542
+ emits: ["update"],
2543
+ setup(e, { emit: t }) {
2544
+ let n = e, r = t, { t: i } = U();
2545
+ function a(e, t) {
2546
+ r("update", { [e]: t });
2547
+ }
2548
+ function o() {
2549
+ let e = {
2550
+ id: ge(),
2551
+ platform: "facebook",
2552
+ url: ""
2553
+ };
2554
+ r("update", { icons: [...n.block.icons, e] });
2555
+ }
2556
+ function c(e, t, i) {
2557
+ let a = n.block.icons.map((n) => n.id === e ? {
2558
+ ...n,
2559
+ [t]: i
2560
+ } : n);
2561
+ r("update", { icons: a });
2562
+ }
2563
+ function u(e) {
2564
+ r("update", { icons: n.block.icons.filter((t) => t.id !== e) });
2565
+ }
2566
+ return (t, n) => (s(), v(A, null, [
2567
+ E("div", Oo, [E("label", { class: T(b(K)) }, g(b(i).social.icons), 3), E("div", ko, [(s(!0), v(A, null, l(e.block.icons, (e) => (s(), v("div", {
2568
+ key: e.id,
2569
+ 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"
2570
+ }, [E("div", Ao, [E("select", {
2571
+ "data-testid": "social-platform-select",
2572
+ class: T([b(G), "tpl:flex-1"]),
2573
+ value: e.platform,
2574
+ onChange: (t) => c(e.id, "platform", t.target.value)
2575
+ }, [(s(!0), v(A, null, l(b(ne), (e) => (s(), v("option", {
2576
+ key: e,
2577
+ value: e
2578
+ }, g(b(i).social.platforms[e]), 9, Mo))), 128))], 42, jo), E("button", {
2579
+ class: T(b(Rt)),
2580
+ title: b(i).social.removeIcon,
2581
+ onClick: (t) => u(e.id)
2582
+ }, [N(b(it), {
2583
+ size: 14,
2584
+ "stroke-width": 2
2585
+ })], 10, No)]), N(Q, {
2586
+ "model-value": e.url,
2587
+ type: "url",
2588
+ placeholder: b(i).social.urlPlaceholder,
2589
+ "onUpdate:modelValue": (t) => c(e.id, "url", t)
2590
+ }, null, 8, [
2591
+ "model-value",
2592
+ "placeholder",
2593
+ "onUpdate:modelValue"
2594
+ ])]))), 128)), E("button", {
2595
+ class: T(b(zt)),
2596
+ onClick: o
2597
+ }, [N(b(W), {
2598
+ size: 14,
2599
+ "stroke-width": 2
2600
+ }), j(" " + g(b(i).social.addIcon), 1)], 2)])]),
2601
+ E("div", Po, [E("label", { class: T(b(K)) }, g(b(i).social.style), 3), E("select", {
2602
+ class: T(b(G)),
2603
+ value: e.block.iconStyle,
2604
+ onChange: n[0] ||= (e) => a("iconStyle", e.target.value)
2605
+ }, [
2606
+ E("option", Io, g(b(i).social.styleSolid), 1),
2607
+ E("option", Lo, g(b(i).social.styleOutlined), 1),
2608
+ E("option", Ro, g(b(i).social.styleRounded), 1),
2609
+ E("option", zo, g(b(i).social.styleSquare), 1),
2610
+ E("option", Bo, g(b(i).social.styleCircle), 1)
2611
+ ], 42, Fo)]),
2612
+ E("div", Vo, [E("label", { class: T(b(K)) }, g(b(i).social.size), 3), N(Z, {
2613
+ options: [
2614
+ {
2615
+ value: "small",
2616
+ label: b(i).social.sizeSmall
2617
+ },
2618
+ {
2619
+ value: "medium",
2620
+ label: b(i).social.sizeMedium
2621
+ },
2622
+ {
2623
+ value: "large",
2624
+ label: b(i).social.sizeLarge
2625
+ }
2626
+ ],
2627
+ "model-value": e.block.iconSize,
2628
+ "onUpdate:modelValue": n[1] ||= (e) => a("iconSize", e)
2629
+ }, null, 8, ["options", "model-value"])]),
2630
+ E("div", Ho, [E("label", { class: T(b(K)) }, g(b(i).social.spacing), 3), E("div", Uo, [E("input", {
2631
+ type: "number",
2632
+ class: T(b(J)),
2633
+ value: e.block.spacing,
2634
+ min: "0",
2635
+ max: "50",
2636
+ onInput: n[2] ||= (e) => a("spacing", Number(e.target.value))
2637
+ }, null, 42, Wo), E("span", { class: T(b(q)) }, "px", 2)])]),
2638
+ E("div", Go, [E("label", { class: T(b(K)) }, g(b(i).social.align), 3), N(Z, {
2639
+ options: [
2640
+ {
2641
+ value: "left",
2642
+ label: b(i).title.alignLeft,
2643
+ icon: b(kt)
2644
+ },
2645
+ {
2646
+ value: "center",
2647
+ label: b(i).title.alignCenter,
2648
+ icon: b(At)
2649
+ },
2650
+ {
2651
+ value: "right",
2652
+ label: b(i).title.alignRight,
2653
+ icon: b(Et)
2654
+ }
2655
+ ],
2656
+ "model-value": e.block.align,
2657
+ "onUpdate:modelValue": n[3] ||= (e) => a("align", e)
2658
+ }, null, 8, ["options", "model-value"])])
2659
+ ], 64));
2660
+ }
2661
+ }), qo = { class: "tpl:mb-3.5" }, Jo = { class: "tpl:flex tpl:items-stretch" }, Yo = ["value"], Xo = ["value"], Zo = /* @__PURE__ */ M({
2662
+ __name: "SpacerToolbar",
2663
+ props: { block: {} },
2664
+ emits: ["update"],
2665
+ setup(e, { emit: t }) {
2666
+ let n = t, { t: r } = U();
2667
+ return (t, i) => (s(), v("div", qo, [
2668
+ E("label", { class: T(b(K)) }, g(b(r).spacer.height), 3),
2669
+ E("div", Jo, [E("input", {
2670
+ type: "number",
2671
+ class: T(b(J)),
2672
+ value: e.block.height,
2673
+ min: "10",
2674
+ max: "100",
2675
+ onInput: i[0] ||= (e) => n("update", { height: Number(e.target.value) })
2676
+ }, null, 42, Yo), E("span", { class: T(b(q)) }, "px", 2)]),
2677
+ E("input", {
2678
+ type: "range",
2679
+ class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
2680
+ value: e.block.height,
2681
+ min: "10",
2682
+ max: "100",
2683
+ onInput: i[1] ||= (e) => n("update", { height: Number(e.target.value) })
2684
+ }, null, 40, Xo)
2685
+ ]));
2686
+ }
2687
+ }), Qo = { class: "tpl:mb-3.5" }, $o = { class: "tpl:flex tpl:items-center tpl:gap-3" }, es = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, ts = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, ns = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, rs = ["disabled"], is = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, as = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, os = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, ss = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, cs = ["disabled"], ls = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, us = { class: "tpl:mb-3.5" }, ds = { 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)]" }, fs = ["checked"], ps = {
2688
+ key: 0,
2689
+ class: "tpl:mb-3.5"
2690
+ }, ms = { class: "tpl:mb-3.5" }, hs = { class: "tpl:mb-3.5" }, gs = { class: "tpl:flex tpl:items-stretch" }, _s = ["value"], vs = { class: "tpl:mb-3.5" }, ys = { class: "tpl:flex tpl:items-stretch" }, bs = ["value"], xs = { class: "tpl:mb-3.5" }, Ss = ["value"], Cs = { value: "" }, ws = ["value"], Ts = { class: "tpl:mb-3.5" }, Es = { class: "tpl:flex tpl:items-stretch" }, Ds = ["value"], Os = { class: "tpl:mb-3.5" }, ks = { class: "tpl:mb-3.5" }, As = /* @__PURE__ */ M({
2691
+ __name: "TableToolbar",
2692
+ props: {
2693
+ block: {},
2694
+ fontFamilies: {}
2695
+ },
2696
+ emits: ["update"],
2697
+ setup(e, { emit: t }) {
2698
+ let n = e, r = t, { t: i } = U(), a = _(() => n.block.rows.length > 0 ? n.block.rows[0].cells.length : 0);
2699
+ function o(e, t) {
2700
+ r("update", { [e]: t });
2701
+ }
2702
+ function c() {
2703
+ let e = n.block.rows.length > 0 ? n.block.rows[0].cells.length : 3, t = {
2704
+ id: ge(),
2705
+ cells: Array.from({ length: e }, () => ({
2706
+ id: ge(),
2707
+ content: ""
2708
+ }))
2709
+ };
2710
+ r("update", { rows: [...n.block.rows, t] });
2711
+ }
2712
+ function u(e) {
2713
+ r("update", { rows: n.block.rows.filter((t) => t.id !== e) });
2714
+ }
2715
+ function d() {
2716
+ let e = n.block.rows.map((e) => ({
2717
+ ...e,
2718
+ cells: [...e.cells, {
2719
+ id: ge(),
2720
+ content: ""
2721
+ }]
2722
+ }));
2723
+ r("update", { rows: e });
2724
+ }
2725
+ function f(e) {
2726
+ let t = n.block.rows.map((t) => ({
2727
+ ...t,
2728
+ cells: t.cells.filter((t, n) => n !== e)
2729
+ }));
2730
+ r("update", { rows: t });
2731
+ }
2732
+ return (t, n) => (s(), v(A, null, [
2733
+ E("div", Qo, [E("label", { class: T(b(K)) }, g(b(i).table.dimensions), 3), E("div", $o, [E("div", es, [E("span", ts, g(b(i).table.rows), 1), E("div", ns, [
2734
+ E("button", {
2735
+ 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",
2736
+ disabled: e.block.rows.length <= 1,
2737
+ onClick: n[0] ||= (t) => u(e.block.rows[e.block.rows.length - 1].id)
2738
+ }, [N(b(bt), {
2739
+ size: 12,
2740
+ "stroke-width": 2
2741
+ })], 8, rs),
2742
+ E("span", is, g(e.block.rows.length), 1),
2743
+ E("button", {
2744
+ 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)]",
2745
+ onClick: c
2746
+ }, [N(b(W), {
2747
+ size: 12,
2748
+ "stroke-width": 2
2749
+ })])
2750
+ ])]), E("div", as, [E("span", os, g(b(i).table.columns), 1), E("div", ss, [
2751
+ E("button", {
2752
+ 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",
2753
+ disabled: a.value <= 1,
2754
+ onClick: n[1] ||= (e) => f(a.value - 1)
2755
+ }, [N(b(bt), {
2756
+ size: 12,
2757
+ "stroke-width": 2
2758
+ })], 8, cs),
2759
+ E("span", ls, g(a.value), 1),
2760
+ E("button", {
2761
+ 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)]",
2762
+ onClick: d
2763
+ }, [N(b(W), {
2764
+ size: 12,
2765
+ "stroke-width": 2
2766
+ })])
2767
+ ])])])]),
2768
+ E("div", us, [E("label", ds, [E("input", {
2769
+ type: "checkbox",
2770
+ checked: e.block.hasHeaderRow,
2771
+ class: "tpl:accent-[var(--tpl-primary)]",
2772
+ onChange: n[2] ||= (e) => o("hasHeaderRow", e.target.checked)
2773
+ }, null, 40, fs), j(" " + g(b(i).table.hasHeaderRow), 1)])]),
2774
+ e.block.hasHeaderRow ? (s(), v("div", ps, [E("label", { class: T(b(K)) }, g(b(i).table.headerBackgroundColor), 3), N(Y, {
2775
+ "model-value": e.block.headerBackgroundColor ?? "",
2776
+ "seed-color": b(Ht),
2777
+ placeholder: b(i).table.noHeaderBg,
2778
+ "onUpdate:modelValue": n[3] ||= (e) => o("headerBackgroundColor", e || null)
2779
+ }, null, 8, [
2780
+ "model-value",
2781
+ "seed-color",
2782
+ "placeholder"
2783
+ ])])) : y("", !0),
2784
+ E("div", ms, [E("label", { class: T(b(K)) }, g(b(i).table.borderColor), 3), N(Y, {
2785
+ "model-value": e.block.borderColor,
2786
+ "onUpdate:modelValue": n[4] ||= (e) => o("borderColor", e)
2787
+ }, null, 8, ["model-value"])]),
2788
+ E("div", hs, [E("label", { class: T(b(K)) }, g(b(i).table.borderWidth), 3), E("div", gs, [E("input", {
2789
+ type: "number",
2790
+ class: T(b(J)),
2791
+ value: e.block.borderWidth,
2792
+ min: "0",
2793
+ max: "10",
2794
+ onInput: n[5] ||= (e) => o("borderWidth", Number(e.target.value))
2795
+ }, null, 42, _s), E("span", { class: T(b(q)) }, "px", 2)])]),
2796
+ E("div", vs, [E("label", { class: T(b(K)) }, g(b(i).table.cellPadding), 3), E("div", ys, [E("input", {
2797
+ type: "number",
2798
+ class: T(b(J)),
2799
+ value: e.block.cellPadding,
2800
+ min: "0",
2801
+ max: "30",
2802
+ onInput: n[6] ||= (e) => o("cellPadding", Number(e.target.value))
2803
+ }, null, 42, bs), E("span", { class: T(b(q)) }, "px", 2)])]),
2804
+ E("div", xs, [E("label", { class: T(b(K)) }, g(b(i).table.fontFamily), 3), E("select", {
2805
+ class: T(b(G)),
2806
+ value: e.block.fontFamily || "",
2807
+ onChange: n[7] ||= (e) => o("fontFamily", e.target.value || void 0)
2808
+ }, [E("option", Cs, g(b(i).title.inheritFont), 1), (s(!0), v(A, null, l(e.fontFamilies, (e) => (s(), v("option", {
2809
+ key: e.value,
2810
+ value: e.value
2811
+ }, g(e.label), 9, ws))), 128))], 42, Ss)]),
2812
+ E("div", Ts, [E("label", { class: T(b(K)) }, g(b(i).table.fontSize), 3), E("div", Es, [E("input", {
2813
+ type: "number",
2814
+ class: T(b(J)),
2815
+ value: e.block.fontSize,
2816
+ min: "10",
2817
+ max: "32",
2818
+ onInput: n[8] ||= (e) => o("fontSize", Number(e.target.value))
2819
+ }, null, 42, Ds), E("span", { class: T(b(q)) }, "px", 2)])]),
2820
+ E("div", Os, [E("label", { class: T(b(K)) }, g(b(i).table.color), 3), N(Y, {
2821
+ "model-value": e.block.color,
2822
+ "onUpdate:modelValue": n[9] ||= (e) => o("color", e)
2823
+ }, null, 8, ["model-value"])]),
2824
+ E("div", ks, [E("label", { class: T(b(K)) }, g(b(i).table.textAlign), 3), N(Z, {
2825
+ options: [
2826
+ {
2827
+ value: "left",
2828
+ label: b(i).title.alignLeft,
2829
+ icon: b(kt)
2830
+ },
2831
+ {
2832
+ value: "center",
2833
+ label: b(i).title.alignCenter,
2834
+ icon: b(At)
2835
+ },
2836
+ {
2837
+ value: "right",
2838
+ label: b(i).title.alignRight,
2839
+ icon: b(Et)
2840
+ }
2841
+ ],
2842
+ "model-value": e.block.textAlign,
2843
+ "onUpdate:modelValue": n[10] ||= (e) => o("textAlign", e)
2844
+ }, null, 8, ["options", "model-value"])])
2845
+ ], 64));
2846
+ }
2847
+ }), js = { class: "tpl:mb-3.5" }, Ms = ["value"], Ns = { value: 1 }, Ps = { value: 2 }, Fs = { value: 3 }, Is = { value: 4 }, Ls = { class: "tpl:mb-3.5" }, Rs = ["value"], zs = { value: "" }, Bs = ["value"], Vs = { class: "tpl:mb-3.5" }, Hs = { class: "tpl:mb-3.5" }, Us = /* @__PURE__ */ M({
2848
+ __name: "TitleToolbar",
2849
+ props: {
2850
+ block: {},
2851
+ fontFamilies: {}
2852
+ },
2853
+ emits: ["update"],
2854
+ setup(e, { emit: t }) {
2855
+ let n = t, { t: r } = U();
2856
+ function i(e, t) {
2857
+ n("update", { [e]: t });
2858
+ }
2859
+ return (t, n) => (s(), v(A, null, [
2860
+ E("div", js, [E("label", { class: T(b(K)) }, g(b(r).title.level), 3), E("select", {
2861
+ class: T(b(G)),
2862
+ value: e.block.level,
2863
+ onChange: n[0] ||= (e) => i("level", Number(e.target.value))
2864
+ }, [
2865
+ E("option", Ns, g(b(r).title.heading1), 1),
2866
+ E("option", Ps, g(b(r).title.heading2), 1),
2867
+ E("option", Fs, g(b(r).title.heading3), 1),
2868
+ E("option", Is, g(b(r).title.heading4), 1)
2869
+ ], 42, Ms)]),
2870
+ E("div", Ls, [E("label", { class: T(b(K)) }, g(b(r).title.fontFamily), 3), E("select", {
2871
+ class: T(b(G)),
2872
+ value: e.block.fontFamily || "",
2873
+ onChange: n[1] ||= (e) => i("fontFamily", e.target.value || void 0)
2874
+ }, [E("option", zs, g(b(r).title.inheritFont), 1), (s(!0), v(A, null, l(e.fontFamilies, (e) => (s(), v("option", {
2875
+ key: e.value,
2876
+ value: e.value
2877
+ }, g(e.label), 9, Bs))), 128))], 42, Rs)]),
2878
+ E("div", Vs, [E("label", { class: T(b(K)) }, g(b(r).title.color), 3), N(Y, {
2879
+ "model-value": e.block.color,
2880
+ "onUpdate:modelValue": n[2] ||= (e) => i("color", e)
2881
+ }, null, 8, ["model-value"])]),
2882
+ E("div", Hs, [E("label", { class: T(b(K)) }, g(b(r).title.align), 3), N(Z, {
2883
+ options: [
2884
+ {
2885
+ value: "left",
2886
+ label: b(r).title.alignLeft,
2887
+ icon: b(kt)
2888
+ },
2889
+ {
2890
+ value: "center",
2891
+ label: b(r).title.alignCenter,
2892
+ icon: b(At)
2893
+ },
2894
+ {
2895
+ value: "right",
2896
+ label: b(r).title.alignRight,
2897
+ icon: b(Et)
2898
+ }
2899
+ ],
2900
+ "model-value": e.block.textAlign,
2901
+ "onUpdate:modelValue": n[3] ||= (e) => i("textAlign", e)
2902
+ }, null, 8, ["options", "model-value"])])
2903
+ ], 64));
2904
+ }
2905
+ }), Ws = { class: "tpl:mb-3.5" }, Gs = {
2906
+ key: 0,
2907
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
2908
+ }, Ks = ["checked"], qs = {
2909
+ key: 0,
2910
+ class: "tpl:mb-3.5"
2911
+ }, Js = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Ys = [
2912
+ "value",
2913
+ "placeholder",
2914
+ "title"
2915
+ ], Xs = { class: "tpl:mb-3.5" }, Zs = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Qs = { class: "tpl:mb-3.5" }, $s = { class: "tpl:mb-3.5" }, ec = ["value"], tc = { value: "full" }, nc = { class: "tpl:mb-3.5" }, rc = /* @__PURE__ */ M({
2916
+ __name: "VideoToolbar",
2917
+ props: { block: {} },
2918
+ emits: ["update"],
2919
+ setup(e, { emit: t }) {
2920
+ let n = e, r = t, { t: i } = U(), a = u(at, null), o = u(Ve, Ce.liquid), c = V(), l = _(() => !!a), d = _(() => L(n.block.url, o)), f = p(!1), { start: m } = dt(() => {
2921
+ f.value = !1;
2922
+ }, 1e3, { immediate: !1 });
2923
+ function h(e, t) {
2924
+ r("update", { [e]: t });
2925
+ }
2926
+ async function x() {
2927
+ let e = await a?.({ accept: ["images"] });
2928
+ c.alive && e && (h("thumbnailUrl", e.url), f.value = !0, m());
2929
+ }
2930
+ return (t, n) => (s(), v(A, null, [
2931
+ E("div", Ws, [
2932
+ E("label", { class: T(b(K)) }, g(b(i).video.videoUrl), 3),
2933
+ N(Q, {
2934
+ "model-value": e.block.url,
2935
+ type: "url",
2936
+ placeholder: b(i).video.videoUrlPlaceholder,
2937
+ "onUpdate:modelValue": n[0] ||= (e) => h("url", e)
2938
+ }, null, 8, ["model-value", "placeholder"]),
2939
+ e.block.url ? (s(), v("label", Gs, [E("input", {
2940
+ type: "checkbox",
2941
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
2942
+ checked: e.block.openInNewTab ?? !1,
2943
+ onChange: n[1] ||= (e) => h("openInNewTab", e.target.checked)
2944
+ }, null, 40, Ks), j(" " + g(b(i).video.openInNewTab), 1)])) : y("", !0)
2945
+ ]),
2946
+ d.value ? (s(), v("div", qs, [E("label", { class: T(b(K)) }, [j(g(b(i).video.placeholderUrl) + " ", 1), E("span", Js, g(b(i).video.optional), 1)], 2), E("input", {
2947
+ type: "url",
2948
+ class: T(b(G)),
2949
+ value: e.block.placeholderUrl || "",
2950
+ placeholder: b(i).video.placeholderUrlPlaceholder,
2951
+ title: b(i).video.placeholderUrlTooltip,
2952
+ onInput: n[2] ||= (e) => h("placeholderUrl", e.target.value)
2953
+ }, null, 42, Ys)])) : y("", !0),
2954
+ E("div", Xs, [
2955
+ E("label", { class: T(b(K)) }, [j(g(b(i).video.customThumbnail) + " ", 1), E("span", Zs, g(b(i).video.optional), 1)], 2),
2956
+ N(Q, {
2957
+ "model-value": e.block.thumbnailUrl,
2958
+ type: "url",
2959
+ placeholder: b(i).video.thumbnailPlaceholder,
2960
+ pulse: f.value,
2961
+ "onUpdate:modelValue": n[3] ||= (e) => h("thumbnailUrl", e)
2962
+ }, null, 8, [
2963
+ "model-value",
2964
+ "placeholder",
2965
+ "pulse"
2966
+ ]),
2967
+ l.value ? (s(), v("button", {
2968
+ key: 0,
2969
+ 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",
2970
+ style: {
2971
+ "border-color": "var(--tpl-border)",
2972
+ color: "var(--tpl-primary)",
2973
+ "background-color": "var(--tpl-bg)"
2974
+ },
2975
+ onClick: x
2976
+ }, [N(b(we), {
2977
+ size: 14,
2978
+ "stroke-width": 1.5
2979
+ }), j(" " + g(b(i).image.browseMedia), 1)])) : y("", !0)
2980
+ ]),
2981
+ E("div", Qs, [E("label", { class: T(b(K)) }, g(b(i).video.altText), 3), N(Q, {
2982
+ "model-value": e.block.alt,
2983
+ type: "text",
2984
+ placeholder: b(i).video.altTextPlaceholder,
2985
+ "onUpdate:modelValue": n[4] ||= (e) => h("alt", e)
2986
+ }, null, 8, ["model-value", "placeholder"])]),
2987
+ E("div", $s, [E("label", { class: T(b(K)) }, g(b(i).video.width), 3), E("select", {
2988
+ class: T(b(G)),
2989
+ value: e.block.width,
2990
+ onChange: n[5] ||= (e) => h("width", e.target.value === "full" ? "full" : Number(e.target.value))
2991
+ }, [
2992
+ E("option", tc, g(b(i).video.fullWidth), 1),
2993
+ n[7] ||= E("option", { value: "300" }, "300px", -1),
2994
+ n[8] ||= E("option", { value: "400" }, "400px", -1),
2995
+ n[9] ||= E("option", { value: "500" }, "500px", -1)
2996
+ ], 42, ec)]),
2997
+ E("div", nc, [E("label", { class: T(b(K)) }, g(b(i).title.align), 3), N(Z, {
2998
+ options: [
2999
+ {
3000
+ value: "left",
3001
+ label: b(i).title.alignLeft
3002
+ },
3003
+ {
3004
+ value: "center",
3005
+ label: b(i).title.alignCenter
3006
+ },
3007
+ {
3008
+ value: "right",
3009
+ label: b(i).title.alignRight
3010
+ }
3011
+ ],
3012
+ "model-value": e.block.align,
3013
+ "onUpdate:modelValue": n[6] ||= (e) => h("align", e)
3014
+ }, null, 8, ["options", "model-value"])])
3015
+ ], 64));
3016
+ }
3017
+ }), ic = ["aria-label"], ac = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, oc = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, sc = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, cc = { class: "tpl:flex tpl:gap-1" }, lc = ["title"], uc = ["title"], dc = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, fc = /*#__PURE__*/ Ie(/* @__PURE__ */ M({
3018
+ __name: "Toolbar",
3019
+ props: { block: {} },
3020
+ emits: [
3021
+ "update",
3022
+ "delete",
3023
+ "duplicate"
3024
+ ],
3025
+ setup(e, { emit: t }) {
3026
+ let n = m(() => import("./CountdownToolbar-CI2sQZv5.js")), r = e, i = t, { t: a } = U(), c = Xe(Pe, "Toolbar"), l = u(nt, []), d = _(() => r.block.type), f = _(() => se(r.block)), p = _(() => {
3027
+ if (f.value) return l.find((e) => e.type === r.block.customType);
3028
+ }), h = _(() => f.value ? p.value?.name ?? r.block.customType : ce(d.value, a)), x = c.fonts;
3029
+ function C(e) {
3030
+ i("update", e);
3031
+ }
3032
+ return (t, r) => (s(), v("aside", {
3033
+ "aria-label": b(a).landmarks.blockToolbar,
3034
+ class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
3035
+ }, [E("div", ac, [E("div", oc, [b(Lt)[d.value] ? (s(), S(o(b(Lt)[d.value]), {
3036
+ key: 0,
3037
+ size: 16,
3038
+ "stroke-width": 1.5
3039
+ })) : f.value ? (s(), S(b(z), {
3040
+ key: 1,
3041
+ size: 16,
3042
+ "stroke-width": 1.5
3043
+ })) : y("", !0), E("h3", sc, g(h.value), 1)]), E("div", cc, [E("button", {
3044
+ 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)]",
3045
+ title: b(a).toolbar.duplicate,
3046
+ onClick: r[0] ||= (e) => i("duplicate")
3047
+ }, [N(b(te), {
3048
+ size: 14,
3049
+ "stroke-width": 2
3050
+ })], 8, lc), E("button", {
3051
+ 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)]",
3052
+ title: b(a).toolbar.delete,
3053
+ onClick: r[1] ||= (e) => i("delete")
3054
+ }, [N(b(st), {
3055
+ size: 14,
3056
+ "stroke-width": 2
3057
+ })], 8, uc)])]), E("div", dc, [f.value ? (s(), S(Ca, {
3058
+ key: 0,
3059
+ block: e.block,
3060
+ onUpdateFieldValues: r[2] ||= (e) => i("update", { fieldValues: e }),
3061
+ onUpdateDataSourceFetched: r[3] ||= (e) => i("update", { dataSourceFetched: e })
3062
+ }, null, 8, ["block"])) : d.value === "section" ? (s(), S(Do, {
3063
+ key: 1,
3064
+ block: e.block,
3065
+ onUpdate: C
3066
+ }, null, 8, ["block"])) : d.value === "title" ? (s(), S(Us, {
3067
+ key: 2,
3068
+ block: e.block,
3069
+ "font-families": b(x),
3070
+ onUpdate: C
3071
+ }, null, 8, ["block", "font-families"])) : d.value === "paragraph" ? (s(), v(A, { key: 3 }, [], 64)) : d.value === "image" ? (s(), S($a, {
3072
+ key: 4,
3073
+ block: e.block,
3074
+ onUpdate: C
3075
+ }, null, 8, ["block"])) : d.value === "video" ? (s(), S(rc, {
3076
+ key: 5,
3077
+ block: e.block,
3078
+ onUpdate: C
3079
+ }, null, 8, ["block"])) : d.value === "button" ? (s(), S(Jr, {
3080
+ key: 6,
3081
+ block: e.block,
3082
+ "font-families": b(x),
3083
+ onUpdate: C
3084
+ }, null, 8, ["block", "font-families"])) : d.value === "divider" ? (s(), S(ka, {
3085
+ key: 7,
3086
+ block: e.block,
3087
+ onUpdate: C
3088
+ }, null, 8, ["block"])) : d.value === "social" ? (s(), S(Ko, {
3089
+ key: 8,
3090
+ block: e.block,
3091
+ onUpdate: C
3092
+ }, null, 8, ["block"])) : d.value === "menu" ? (s(), S(fo, {
3093
+ key: 9,
3094
+ block: e.block,
3095
+ "font-families": b(x),
3096
+ onUpdate: C
3097
+ }, null, 8, ["block", "font-families"])) : d.value === "table" ? (s(), S(As, {
3098
+ key: 10,
3099
+ block: e.block,
3100
+ "font-families": b(x),
3101
+ onUpdate: C
3102
+ }, null, 8, ["block", "font-families"])) : d.value === "spacer" ? (s(), S(Zo, {
3103
+ key: 11,
3104
+ block: e.block,
3105
+ onUpdate: C
3106
+ }, null, 8, ["block"])) : d.value === "html" ? (s(), S(Na, {
3107
+ key: 12,
3108
+ block: e.block,
3109
+ onUpdate: C
3110
+ }, null, 8, ["block"])) : d.value === "countdown" ? (s(), S(b(n), {
3111
+ key: 13,
3112
+ block: e.block,
3113
+ "font-families": b(x),
3114
+ onUpdate: C
3115
+ }, null, 8, ["block", "font-families"])) : y("", !0), N(Ri, {
3116
+ block: e.block,
3117
+ "is-first-section": d.value === "paragraph",
3118
+ onUpdate: C
3119
+ }, null, 8, ["block", "is-first-section"])])], 8, ic));
3120
+ }
3121
+ }), [["__scopeId", "data-v-2ac88283"]]), pc = ["aria-label"], mc = {
3122
+ role: "tablist",
3123
+ class: "tpl:relative tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-active)] tpl:p-1.5"
3124
+ }, hc = [
3125
+ "aria-selected",
3126
+ "aria-label",
3127
+ "title"
3128
+ ], gc = { key: 0 }, _c = [
3129
+ "aria-selected",
3130
+ "aria-label",
3131
+ "title"
3132
+ ], vc = { key: 0 }, yc = [
3133
+ "aria-selected",
3134
+ "aria-label",
3135
+ "title"
3136
+ ], bc = { key: 0 }, xc = {
3137
+ key: 1,
3138
+ class: "tpl:ml-1 tpl:rounded-full tpl:bg-[var(--tpl-bg-hover)] tpl:px-1.5 tpl:text-[10px]"
3139
+ }, Sc = {
3140
+ key: 0,
3141
+ id: "tpl-tabpanel-content",
3142
+ role: "tabpanel",
3143
+ "aria-labelledby": "tpl-tab-content",
3144
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
3145
+ }, Cc = {
3146
+ key: 1,
3147
+ 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)]"
3148
+ }, wc = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, Tc = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ec = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, Dc = {
3149
+ key: 1,
3150
+ id: "tpl-tabpanel-settings",
3151
+ role: "tabpanel",
3152
+ "aria-labelledby": "tpl-tab-settings",
3153
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
3154
+ }, Oc = {
3155
+ key: 2,
3156
+ id: "tpl-tabpanel-issues",
3157
+ role: "tabpanel",
3158
+ "aria-labelledby": "tpl-tab-issues",
3159
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
3160
+ }, kc = /* @__PURE__ */ M({
3161
+ __name: "RightSidebar",
3162
+ props: {
3163
+ selectedBlock: {},
3164
+ settings: {},
3165
+ shiftedLeft: { type: Boolean }
3166
+ },
3167
+ emits: [
3168
+ "update-block",
3169
+ "delete-block",
3170
+ "duplicate-block",
3171
+ "update-settings"
3172
+ ],
3173
+ setup(e, { emit: t }) {
3174
+ let n = m(() => import("./IssuesPanel-BdeDoTcn.js")), r = e, i = t, { t: a } = U(), o = p("content"), c = u(Fe, null), l = _(() => c !== null), d = _(() => c?.issues.value.length ?? 0);
3175
+ function f(e) {
3176
+ return o.value === e ? "tpl:flex-1 tpl:text-[var(--tpl-primary)]" : "tpl:shrink-0 tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]";
3177
+ }
3178
+ function h(e) {
3179
+ return o.value === e ? {
3180
+ backgroundColor: "var(--tpl-bg)",
3181
+ boxShadow: "var(--tpl-shadow-md)"
3182
+ } : { backgroundColor: "transparent" };
3183
+ }
3184
+ return P(() => r.selectedBlock, (e) => {
3185
+ e && (o.value = "content");
3186
+ }), (t, r) => (s(), v("aside", {
3187
+ "aria-label": b(a).landmarks.rightSidebar,
3188
+ class: T(["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"])
3189
+ }, [
3190
+ E("div", mc, [
3191
+ E("button", {
3192
+ id: "tpl-tab-content",
3193
+ role: "tab",
3194
+ "aria-selected": o.value === "content",
3195
+ "aria-controls": "tpl-tabpanel-content",
3196
+ "aria-label": b(a).sidebar.content,
3197
+ title: b(a).sidebar.content,
3198
+ class: T(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", f("content")]),
3199
+ style: O(h("content")),
3200
+ onClick: r[0] ||= (e) => o.value = "content"
3201
+ }, [N(b(yt), {
3202
+ size: 14,
3203
+ "stroke-width": 2
3204
+ }), o.value === "content" ? (s(), v("span", gc, g(b(a).sidebar.content), 1)) : y("", !0)], 14, hc),
3205
+ E("button", {
3206
+ id: "tpl-tab-settings",
3207
+ role: "tab",
3208
+ "aria-selected": o.value === "settings",
3209
+ "aria-controls": "tpl-tabpanel-settings",
3210
+ "aria-label": b(a).sidebar.settings,
3211
+ title: b(a).sidebar.settings,
3212
+ class: T(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", f("settings")]),
3213
+ style: O(h("settings")),
3214
+ onClick: r[1] ||= (e) => o.value = "settings"
3215
+ }, [N(b(Mt), {
3216
+ size: 14,
3217
+ "stroke-width": 1.5
3218
+ }), o.value === "settings" ? (s(), v("span", vc, g(b(a).sidebar.settings), 1)) : y("", !0)], 14, _c),
3219
+ l.value ? (s(), v("button", {
3220
+ key: 0,
3221
+ id: "tpl-tab-issues",
3222
+ role: "tab",
3223
+ "aria-selected": o.value === "issues",
3224
+ "aria-controls": "tpl-tabpanel-issues",
3225
+ "aria-label": b(a).issues.panelTabLabel,
3226
+ title: b(a).issues.panelTabLabel,
3227
+ class: T(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", f("issues")]),
3228
+ style: O(h("issues")),
3229
+ onClick: r[2] ||= (e) => o.value = "issues"
3230
+ }, [
3231
+ N(b(Pt), {
3232
+ size: 14,
3233
+ "stroke-width": 1.5
3234
+ }),
3235
+ o.value === "issues" ? (s(), v("span", bc, g(b(a).issues.panelTabLabel), 1)) : y("", !0),
3236
+ d.value > 0 ? (s(), v("span", xc, g(d.value), 1)) : y("", !0)
3237
+ ], 14, yc)) : y("", !0)
3238
+ ]),
3239
+ o.value === "content" ? (s(), v("div", Sc, [e.selectedBlock ? (s(), S(fc, {
3240
+ key: 0,
3241
+ block: e.selectedBlock,
3242
+ onUpdate: r[3] ||= (e) => i("update-block", e),
3243
+ onDelete: r[4] ||= (e) => i("delete-block"),
3244
+ onDuplicate: r[5] ||= (e) => i("duplicate-block")
3245
+ }, null, 8, ["block"])) : (s(), v("div", Cc, [
3246
+ E("div", wc, [N(b(xt), {
3247
+ size: 40,
3248
+ "stroke-width": 1.5
3249
+ })]),
3250
+ E("h3", Tc, g(b(a).sidebar.noSelection), 1),
3251
+ E("p", Ec, g(b(a).sidebar.noSelectionHint), 1)
3252
+ ]))])) : y("", !0),
3253
+ o.value === "settings" ? (s(), v("div", Dc, [N(gr, {
3254
+ settings: e.settings,
3255
+ onUpdate: r[6] ||= (e) => i("update-settings", e)
3256
+ }, null, 8, ["settings"])])) : y("", !0),
3257
+ o.value === "issues" && l.value ? (s(), v("div", Oc, [N(b(n))])) : y("", !0)
3258
+ ], 10, pc));
3259
+ }
3260
+ }), Ac = {
3261
+ class: "tpl-small-screen-notice tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-6 tpl:py-10 tpl:text-center tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)]",
3262
+ style: { "z-index": "10001" },
3263
+ role: "status",
3264
+ "data-testid": "small-screen-notice"
3265
+ }, jc = { class: "tpl:text-[var(--tpl-text-dim)]" }, Mc = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Nc = { class: "tpl:m-0 tpl:max-w-sm tpl:text-sm tpl:leading-normal" }, Pc = /* @__PURE__ */ M({
3266
+ __name: "SmallScreenNotice",
3267
+ setup(e) {
3268
+ let { t } = U();
3269
+ return (e, n) => (s(), v("div", Ac, [
3270
+ E("div", jc, [N(b(vt), {
3271
+ size: 48,
3272
+ "stroke-width": 1.5
3273
+ })]),
3274
+ E("h2", Mc, g(b(t).smallScreen.title), 1),
3275
+ E("p", Nc, g(b(t).smallScreen.message), 1)
3276
+ ]));
3277
+ }
3278
+ }), Fc = ["aria-label"], Ic = [
3279
+ "aria-checked",
3280
+ "aria-label",
3281
+ "title",
3282
+ "onClick"
3283
+ ], Lc = /* @__PURE__ */ M({
3284
+ __name: "ViewportToggle",
3285
+ props: { viewport: {} },
3286
+ emits: ["change"],
3287
+ setup(e, { emit: t }) {
3288
+ let n = e, r = t, { t: i } = U(), a = _(() => [{
3289
+ value: "desktop",
3290
+ label: i.viewport.desktop
3291
+ }, {
3292
+ value: "mobile",
3293
+ label: i.viewport.mobile
3294
+ }]), o = _(() => `translateX(${a.value.findIndex((e) => e.value === n.viewport) * 100}%)`);
3295
+ return (t, n) => (s(), v("div", {
3296
+ role: "radiogroup",
3297
+ "aria-label": b(i).viewport.label,
3298
+ class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
3299
+ style: O({
3300
+ gridTemplateColumns: `repeat(${a.value.length}, 1fr)`,
3301
+ backgroundColor: "var(--tpl-bg-hover)"
3302
+ })
3303
+ }, [E("div", {
3304
+ class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
3305
+ style: O({
3306
+ left: "4px",
3307
+ width: `calc((100% - 8px) / ${a.value.length})`,
3308
+ transform: o.value,
3309
+ backgroundColor: "var(--tpl-bg)",
3310
+ boxShadow: "var(--tpl-shadow)",
3311
+ transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
3312
+ })
3313
+ }, null, 4), (s(!0), v(A, null, l(a.value, (t) => (s(), v("button", {
3314
+ key: t.value,
3315
+ role: "radio",
3316
+ "aria-checked": e.viewport === t.value,
3317
+ "aria-label": t.label,
3318
+ 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",
3319
+ style: O({
3320
+ color: e.viewport === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3321
+ transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
3322
+ }),
3323
+ title: t.label,
3324
+ onClick: (e) => r("change", t.value)
3325
+ }, [t.value === "desktop" ? (s(), S(b(vt), {
3326
+ key: 0,
3327
+ size: 18,
3328
+ "stroke-width": 1.5
3329
+ })) : (s(), S(b(wt), {
3330
+ key: 1,
3331
+ size: 18,
3332
+ "stroke-width": 1.5
3333
+ })), E("span", null, g(t.label), 1)], 12, Ic))), 128))], 12, Fc));
3334
+ }
3335
+ }), Rc = [
3336
+ "aria-label",
3337
+ "title",
3338
+ "aria-pressed"
3339
+ ], zc = /*#__PURE__*/ Ie(/* @__PURE__ */ M({
3340
+ __name: "PreviewToggle",
3341
+ props: { previewMode: { type: Boolean } },
3342
+ emits: ["change"],
3343
+ setup(e, { emit: t }) {
3344
+ let n = t, { t: r } = U();
3345
+ return (t, i) => (s(), v("button", {
3346
+ 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",
3347
+ style: O({
3348
+ color: e.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3349
+ backgroundColor: e.previewMode ? "var(--tpl-primary-light)" : "transparent"
3350
+ }),
3351
+ "aria-label": e.previewMode ? b(r).previewMode.disable : b(r).previewMode.enable,
3352
+ title: e.previewMode ? b(r).previewMode.disable : b(r).previewMode.enable,
3353
+ "aria-pressed": e.previewMode,
3354
+ onClick: i[0] ||= (t) => n("change", !e.previewMode)
3355
+ }, [N(C, {
3356
+ "enter-active-class": "tpl-icon-enter-active",
3357
+ "leave-active-class": "tpl-icon-leave-active",
3358
+ "enter-from-class": "tpl-icon-enter-from",
3359
+ "leave-to-class": "tpl-icon-leave-to",
3360
+ mode: "out-in"
3361
+ }, {
3362
+ default: d(() => [e.previewMode ? (s(), S(b(lt), {
3363
+ key: "eye",
3364
+ size: 18,
3365
+ "stroke-width": 1.5
3366
+ })) : (s(), S(b(Te), {
3367
+ key: "eye-off",
3368
+ size: 18,
3369
+ "stroke-width": 1.5
3370
+ }))]),
3371
+ _: 1
3372
+ })], 12, Rc));
3373
+ }
3374
+ }), [["__scopeId", "data-v-af87d02a"]]), Bc = [
3375
+ "aria-label",
3376
+ "title",
3377
+ "aria-pressed"
3378
+ ], Vc = /*#__PURE__*/ Ie(/* @__PURE__ */ M({
3379
+ __name: "DarkModeToggle",
3380
+ props: { darkMode: { type: Boolean } },
3381
+ emits: ["change"],
3382
+ setup(e, { emit: t }) {
3383
+ let n = t, { t: r } = U();
3384
+ return (t, i) => (s(), v("button", {
3385
+ 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",
3386
+ style: O({
3387
+ color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3388
+ backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
3389
+ }),
3390
+ "aria-label": e.darkMode ? b(r).darkMode.disable : b(r).darkMode.enable,
3391
+ title: e.darkMode ? b(r).darkMode.disable : b(r).darkMode.enable,
3392
+ "aria-pressed": e.darkMode,
3393
+ onClick: i[0] ||= (t) => n("change", !e.darkMode)
3394
+ }, [N(C, {
3395
+ "enter-active-class": "tpl-icon-enter-active",
3396
+ "leave-active-class": "tpl-icon-leave-active",
3397
+ "enter-from-class": "tpl-icon-enter-from",
3398
+ "leave-to-class": "tpl-icon-leave-to",
3399
+ mode: "out-in"
3400
+ }, {
3401
+ default: d(() => [e.darkMode ? (s(), S(b(_t), {
3402
+ key: "moon",
3403
+ size: 18,
3404
+ "stroke-width": 1.5
3405
+ })) : (s(), S(b(jt), {
3406
+ key: "sun",
3407
+ size: 18,
3408
+ "stroke-width": 1.5
3409
+ }))]),
3410
+ _: 1
3411
+ })], 12, Bc));
3412
+ }
3413
+ }), [["__scopeId", "data-v-f8694f76"]]), Hc = {
3414
+ class: "tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",
3415
+ style: {
3416
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-canvas-bg) 85%,\n transparent\n )",
3417
+ "backdrop-filter": "blur(8px)",
3418
+ "-webkit-backdrop-filter": "blur(8px)"
3419
+ }
3420
+ }, Uc = {
3421
+ href: "https://github.com/templatical/sdk",
3422
+ target: "_blank",
3423
+ rel: "noopener noreferrer",
3424
+ class: "tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]",
3425
+ style: { "text-decoration": "none" }
3426
+ }, Wc = /* @__PURE__ */ M({
3427
+ __name: "EditorFooter",
3428
+ props: { positionClass: {} },
3429
+ setup(e) {
3430
+ let { t } = U();
3431
+ return (n, r) => (s(), v("footer", { class: T(["tpl:pointer-events-none tpl:absolute tpl:bottom-0 tpl:z-50 tpl:flex tpl:h-8 tpl:items-center tpl:justify-end tpl:pr-4 tpl:text-[9px] tpl:opacity-90 tpl:transition-all tpl:duration-300 tpl:text-[var(--tpl-text-dim)]", e.positionClass]) }, [E("div", Hc, [
3432
+ E("span", null, g(b(t).footer.poweredBy), 1),
3433
+ r[0] ||= E("a", {
3434
+ href: "https://templatical.com",
3435
+ target: "_blank",
3436
+ rel: "noopener noreferrer",
3437
+ class: "tpl:inline-flex tpl:items-center tpl:gap-1 tpl:font-medium tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-muted)]",
3438
+ style: { "text-decoration": "none" }
3439
+ }, [E("img", {
3440
+ width: "14",
3441
+ height: "14",
3442
+ src: "https://templatical.com/logo.svg",
3443
+ alt: ""
3444
+ }), j(" Templatical ")], -1),
3445
+ r[1] ||= E("span", { class: "tpl:text-[var(--tpl-border)]" }, "·", -1),
3446
+ E("a", Uc, g(b(t).footer.openSource), 1)
3447
+ ])], 2));
3448
+ }
3449
+ }), Gc = ["aria-labelledby", "data-tpl-theme"], Kc = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:gap-3 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, qc = ["id"], Jc = ["aria-label"], Yc = { class: "tpl:relative tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, Xc = [
3450
+ "id",
3451
+ "placeholder",
3452
+ "aria-label",
3453
+ "aria-activedescendant"
3454
+ ], Zc = {
3455
+ key: 0,
3456
+ class: "tpl:flex tpl:gap-1.5 tpl:overflow-x-auto tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2",
3457
+ "data-testid": "merge-tag-picker-group-pills"
3458
+ }, Qc = ["data-group-name", "onClick"], $c = ["aria-label"], el = {
3459
+ key: 0,
3460
+ class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
3461
+ "data-testid": "merge-tag-picker-empty"
3462
+ }, tl = {
3463
+ key: 1,
3464
+ class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
3465
+ "data-testid": "merge-tag-picker-empty"
3466
+ }, nl = [
3467
+ "aria-expanded",
3468
+ "data-group-name",
3469
+ "data-group-collapsed",
3470
+ "onClick"
3471
+ ], rl = { class: "tpl:ml-1 tpl:font-normal" }, il = [
3472
+ "id",
3473
+ "aria-selected",
3474
+ "data-selected",
3475
+ "data-merge-tag-index",
3476
+ "data-merge-tag-value",
3477
+ "title",
3478
+ "onMousemove",
3479
+ "onClick"
3480
+ ], al = { class: "tpl:text-sm tpl:font-medium" }, ol = { class: "tpl:line-clamp-2 tpl:font-mono tpl:text-xs tpl:text-ellipsis tpl:break-all tpl:text-[var(--tpl-text-dim)]" }, sl = {
3481
+ key: 0,
3482
+ class: "tpl:line-clamp-2 tpl:text-xs tpl:text-ellipsis tpl:text-[var(--tpl-text-dim)]"
3483
+ }, cl = "tpl-merge-tag-picker-list", ll = /* @__PURE__ */ M({
3484
+ __name: "MergeTagPickerModal",
3485
+ setup(e) {
3486
+ let t = Xe(F, "MergeTagPickerModal"), { t: n, format: i } = U(), a = u($e, null), o = u(ze, null), f = p(""), m = Ue(f, 200), C = p(null), D = _(() => m.value.trim().length > 0), k = p(0), j = _(() => t.tags.value.some((e) => !!e.group)), M = p(/* @__PURE__ */ new Set());
3487
+ function I(e) {
3488
+ return M.value.has(e);
3489
+ }
3490
+ function L(e) {
3491
+ let t = new Set(M.value);
3492
+ t.has(e) ? t.delete(e) : t.add(e), M.value = t, k.value = 0;
3493
+ }
3494
+ let ee = _(() => {
3495
+ let e = m.value.trim().toLowerCase();
3496
+ return e ? t.tags.value.filter((t) => [
3497
+ t.label,
3498
+ t.value,
3499
+ t.description ?? ""
3500
+ ].join(" ").toLowerCase().includes(e)) : t.tags.value;
3501
+ }), R = _(() => {
3502
+ if (!j.value) return [];
3503
+ let e = n.mergeTag.picker.otherGroup, r = /* @__PURE__ */ new Set(), i = [];
3504
+ for (let n of t.tags.value) {
3505
+ let t = n.group ?? e;
3506
+ r.has(t) || (r.add(t), i.push(t));
3507
+ }
3508
+ return i;
3509
+ }), z = _(() => {
3510
+ let e = ee.value;
3511
+ if (!j.value || D.value) return e.map((e, t) => ({
3512
+ kind: "tag",
3513
+ tag: e,
3514
+ index: t
3515
+ }));
3516
+ let t = n.mergeTag.picker.otherGroup, r = /* @__PURE__ */ new Map(), i = [];
3517
+ for (let n of e) {
3518
+ let e = n.group ?? t;
3519
+ r.has(e) || (r.set(e, []), i.push(e)), r.get(e).push(n);
3520
+ }
3521
+ let a = [], o = 0;
3522
+ for (let e of i) {
3523
+ let t = r.get(e);
3524
+ if (a.push({
3525
+ kind: "header",
3526
+ group: e,
3527
+ count: t.length
3528
+ }), !M.value.has(e)) for (let e of t) a.push({
3529
+ kind: "tag",
3530
+ tag: e,
3531
+ index: o
3532
+ }), o++;
3533
+ }
3534
+ return a;
3535
+ }), B = _(() => z.value.flatMap((e) => e.kind === "tag" ? [e.tag] : []));
3536
+ P(() => t.isOpen.value, (e) => {
3537
+ e && (f.value = "", k.value = 0, M.value = /* @__PURE__ */ new Set(), c(() => {
3538
+ C.value?.focus();
3539
+ }));
3540
+ }), P(B, (e) => {
3541
+ k.value >= e.length && (k.value = Math.max(0, e.length - 1));
3542
+ });
3543
+ function te(e) {
3544
+ t.resolve(e);
3545
+ }
3546
+ function ne() {
3547
+ t.resolve(null);
3548
+ }
3549
+ function re(e) {
3550
+ if (B.value.length === 0) return;
3551
+ let t = k.value + e;
3552
+ k.value = Math.max(0, Math.min(B.value.length - 1, t)), oe();
3553
+ }
3554
+ let V = p(null), ie = p({});
3555
+ function ae(e, t) {
3556
+ ie.value[e] = t ?? null;
3557
+ }
3558
+ function oe() {
3559
+ c(() => {
3560
+ let e = V.value;
3561
+ e && e.querySelector(`[data-merge-tag-index="${k.value}"]`)?.scrollIntoView({ block: "nearest" });
3562
+ });
3563
+ }
3564
+ function se(e) {
3565
+ if (M.value.has(e)) {
3566
+ let t = new Set(M.value);
3567
+ t.delete(e), M.value = t;
3568
+ }
3569
+ c(() => {
3570
+ let t = V.value;
3571
+ if (!t) return;
3572
+ let n = 0, r = !1;
3573
+ for (let i of Array.from(t.children)) {
3574
+ if (i.dataset.testid === "merge-tag-picker-group-header" && i.dataset.groupName === e) {
3575
+ r = !0;
3576
+ break;
3577
+ }
3578
+ n += i.offsetHeight;
3579
+ }
3580
+ r && t.scrollTo({
3581
+ top: n,
3582
+ behavior: "smooth"
3583
+ });
3584
+ });
3585
+ }
3586
+ function ce(e) {
3587
+ if (e.key === "ArrowDown") e.preventDefault(), re(1);
3588
+ else if (e.key === "ArrowUp") e.preventDefault(), re(-1);
3589
+ else if (e.key === "Enter") {
3590
+ e.preventDefault();
3591
+ let t = B.value[k.value];
3592
+ t && te(t);
3593
+ }
3594
+ }
3595
+ function le() {
3596
+ if (B.value.length !== 0) return `${cl}-opt-${k.value}`;
3597
+ }
3598
+ function H(e) {
3599
+ return `${cl}-opt-${e}`;
3600
+ }
3601
+ let ue = _(() => t.tags.value.length === 0), de = _(() => !ue.value && ee.value.length === 0), fe = _(() => j.value && R.value.length > 1 && !D.value);
3602
+ return (e, c) => (s(), S(_e, {
3603
+ visible: b(t).isOpen.value,
3604
+ onClose: ne,
3605
+ onKeydown: ce
3606
+ }, {
3607
+ default: d(() => [E("div", {
3608
+ role: "dialog",
3609
+ "aria-modal": "true",
3610
+ "aria-labelledby": `${cl}-title`,
3611
+ "data-tpl-theme": b(o),
3612
+ "data-testid": "merge-tag-picker-modal",
3613
+ class: "tpl tpl:flex tpl:max-h-[80vh] tpl:w-[min(420px,92vw)] tpl:flex-col tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:shadow-[var(--tpl-shadow-lg)]",
3614
+ style: O(b(a))
3615
+ }, [
3616
+ E("header", Kc, [E("h2", {
3617
+ id: `${cl}-title`,
3618
+ class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
3619
+ }, g(b(n).mergeTag.picker.title), 9, qc), E("button", {
3620
+ type: "button",
3621
+ class: "tpl:flex tpl:h-7 tpl:w-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
3622
+ "aria-label": b(n).mergeTag.picker.close,
3623
+ "data-testid": "merge-tag-picker-close",
3624
+ onClick: ne
3625
+ }, [N(b(it), {
3626
+ size: 16,
3627
+ "stroke-width": 2
3628
+ })], 8, Jc)]),
3629
+ E("div", Yc, [N(b(Nt), {
3630
+ class: "tpl:pointer-events-none tpl:absolute tpl:top-1/2 tpl:left-5 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]",
3631
+ size: 14,
3632
+ "stroke-width": 2
3633
+ }), r(E("input", {
3634
+ id: `${cl}-search`,
3635
+ ref_key: "searchInputRef",
3636
+ ref: C,
3637
+ "onUpdate:modelValue": c[0] ||= (e) => f.value = e,
3638
+ type: "text",
3639
+ class: "tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)]",
3640
+ placeholder: b(n).mergeTag.picker.searchPlaceholder,
3641
+ "aria-label": b(n).mergeTag.picker.searchAriaLabel,
3642
+ "aria-controls": cl,
3643
+ "aria-activedescendant": le(),
3644
+ "data-testid": "merge-tag-picker-search",
3645
+ onKeydown: c[1] ||= h(x(() => {}, ["prevent"]), ["enter"])
3646
+ }, null, 40, Xc), [[w, f.value]])]),
3647
+ fe.value ? (s(), v("div", Zc, [(s(!0), v(A, null, l(R.value, (e) => (s(), v("button", {
3648
+ key: e,
3649
+ type: "button",
3650
+ class: "tpl:flex tpl:flex-shrink-0 tpl:cursor-pointer tpl:items-center tpl:rounded-full tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-2.5 tpl:py-0.5 tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
3651
+ "data-testid": "merge-tag-picker-group-pill",
3652
+ "data-group-name": e,
3653
+ onClick: (t) => se(e)
3654
+ }, g(e), 9, Qc))), 128))])) : y("", !0),
3655
+ E("div", {
3656
+ id: cl,
3657
+ ref_key: "listRef",
3658
+ ref: V,
3659
+ class: "tpl:relative tpl:max-h-[60vh] tpl:flex-1 tpl:overflow-y-auto",
3660
+ role: "listbox",
3661
+ "aria-label": b(n).mergeTag.picker.title,
3662
+ "data-testid": "merge-tag-picker-list"
3663
+ }, [ue.value ? (s(), v("div", el, g(b(n).mergeTag.picker.empty), 1)) : de.value ? (s(), v("div", tl, g(b(n).mergeTag.picker.noResults), 1)) : (s(!0), v(A, { key: 2 }, l(z.value, (e, t) => (s(), v(A, { key: t }, [e.kind === "header" ? (s(), v("button", {
3664
+ key: 0,
3665
+ ref_for: !0,
3666
+ ref: (t) => ae(e.group, t),
3667
+ type: "button",
3668
+ "aria-expanded": !I(e.group),
3669
+ "aria-controls": cl,
3670
+ class: "tpl:sticky tpl:top-0 tpl:z-10 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-[var(--tpl-bg-elevated)] tpl:px-3 tpl:pt-2.5 tpl:pb-1 tpl:text-left tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)]",
3671
+ "data-testid": "merge-tag-picker-group-header",
3672
+ "data-group-name": e.group,
3673
+ "data-group-collapsed": I(e.group) ? "true" : "false",
3674
+ onClick: (t) => L(e.group)
3675
+ }, [
3676
+ N(b(qe), {
3677
+ size: 12,
3678
+ "stroke-width": 2,
3679
+ class: T(["tpl:transition-transform", I(e.group) ? "tpl:-rotate-90" : ""])
3680
+ }, null, 8, ["class"]),
3681
+ E("span", null, g(e.group), 1),
3682
+ E("span", rl, " (" + g(b(i)(b(n).mergeTag.picker.groupCount, { count: e.count })) + ") ", 1)
3683
+ ], 8, nl)) : (s(), v("button", {
3684
+ key: 1,
3685
+ id: H(e.index),
3686
+ type: "button",
3687
+ role: "option",
3688
+ "aria-selected": e.index === k.value,
3689
+ "data-selected": e.index === k.value ? "true" : "false",
3690
+ "data-merge-tag-index": e.index,
3691
+ "data-merge-tag-value": e.tag.value,
3692
+ title: e.tag.description ? `${e.tag.value} — ${e.tag.description}` : e.tag.value,
3693
+ class: T(["tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:border-none tpl:px-3 tpl:py-1.5 tpl:text-left tpl:transition-colors", e.index === k.value ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:bg-transparent tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
3694
+ "data-testid": "merge-tag-picker-item",
3695
+ onMousemove: (t) => k.value = e.index,
3696
+ onClick: (t) => te(e.tag)
3697
+ }, [
3698
+ E("span", al, g(e.tag.label), 1),
3699
+ E("span", ol, g(e.tag.value), 1),
3700
+ e.tag.description ? (s(), v("span", sl, g(e.tag.description), 1)) : y("", !0)
3701
+ ], 42, il))], 64))), 128))], 8, $c)
3702
+ ], 12, Gc)]),
3703
+ _: 1
3704
+ }, 8, ["visible"]));
3705
+ }
3706
+ }), ul = ["data-logic-keyword"], dl = /* @__PURE__ */ M({
3707
+ __name: "LogicTagBadge",
3708
+ props: {
3709
+ value: {},
3710
+ syntax: {}
3711
+ },
3712
+ setup(e) {
3713
+ let t = e, n = _(() => ve(t.value, t.syntax)), r = _(() => ct(t.value, t.syntax));
3714
+ return (e, t) => n.value ? (s(), v("span", {
3715
+ key: 0,
3716
+ class: "tpl:inline-flex tpl:flex-shrink-0 tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:leading-none tpl:font-bold tpl:tracking-wide tpl:uppercase",
3717
+ style: {
3718
+ border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
3719
+ color: "var(--tpl-primary)"
3720
+ },
3721
+ "data-testid": "merge-tag-logic-badge",
3722
+ "data-logic-keyword": r.value
3723
+ }, g(r.value), 9, ul)) : y("", !0);
3724
+ }
3725
+ }), fl = ["aria-labelledby", "data-tpl-theme"], pl = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:gap-3 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, ml = ["id"], hl = ["aria-label"], gl = { class: "tpl:relative tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, _l = [
3726
+ "id",
3727
+ "placeholder",
3728
+ "aria-label",
3729
+ "aria-activedescendant"
3730
+ ], vl = ["aria-label"], yl = {
3731
+ key: 0,
3732
+ class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
3733
+ "data-testid": "logic-picker-empty"
3734
+ }, bl = {
3735
+ key: 1,
3736
+ class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
3737
+ "data-testid": "logic-picker-empty"
3738
+ }, xl = ["data-group-name"], Sl = [
3739
+ "id",
3740
+ "aria-selected",
3741
+ "data-selected",
3742
+ "data-logic-index",
3743
+ "data-logic-kind",
3744
+ "onMousemove",
3745
+ "onClick"
3746
+ ], Cl = { class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-between tpl:gap-2" }, wl = { class: "tpl:text-sm tpl:font-medium" }, Tl = {
3747
+ key: 0,
3748
+ class: "tpl:flex tpl:items-center"
3749
+ }, El = {
3750
+ key: 1,
3751
+ class: "tpl:flex tpl:items-center tpl:gap-1"
3752
+ }, Dl = { class: "tpl:line-clamp-2 tpl:font-mono tpl:text-xs tpl:text-ellipsis tpl:break-all tpl:text-[var(--tpl-text-dim)]" }, Ol = {
3753
+ key: 0,
3754
+ class: "tpl:line-clamp-2 tpl:text-xs tpl:text-ellipsis tpl:text-[var(--tpl-text-dim)]"
3755
+ }, kl = "tpl-logic-picker-list", Al = /* @__PURE__ */ M({
3756
+ __name: "LogicTagPickerModal",
3757
+ setup(e) {
3758
+ let t = Xe(xe, "LogicTagPickerModal"), { t: n } = U(), i = u(Ve, Ce.liquid), a = u($e, null), o = u(ze, null), f = p(""), m = Ue(f, 200), C = p(null), D = _(() => m.value.trim().length > 0), k = p(0);
3759
+ function j(e) {
3760
+ let t = m.value.trim().toLowerCase();
3761
+ return !t || e.filter(Boolean).join(" ").toLowerCase().includes(t);
3762
+ }
3763
+ let M = _(() => t.tags.value.filter((e) => j([
3764
+ e.label,
3765
+ e.value,
3766
+ e.description
3767
+ ]))), F = _(() => t.pairs.value.filter((e) => j([
3768
+ e.label,
3769
+ e.before,
3770
+ e.after,
3771
+ e.description
3772
+ ]))), I = _(() => [...F.value.map((e) => ({
3773
+ kind: "pair",
3774
+ pair: e,
3775
+ group: e.group
3776
+ })), ...M.value.map((e) => ({
3777
+ kind: "tag",
3778
+ tag: e,
3779
+ group: e.group
3780
+ }))]), L = _(() => t.tags.value.some((e) => !!e.group) || t.pairs.value.some((e) => !!e.group));
3781
+ function ee(e) {
3782
+ let t = n.logicTag.picker.otherGroup, r = /* @__PURE__ */ new Map(), i = [];
3783
+ for (let n of e) {
3784
+ let e = n.group ?? t;
3785
+ r.has(e) || (r.set(e, []), i.push(e)), r.get(e).push(n);
3786
+ }
3787
+ return i.map((e) => [e, r.get(e)]);
3788
+ }
3789
+ let R = _(() => {
3790
+ let e = [], t = [], n = 0, r = (r) => {
3791
+ r.kind === "tag" ? (e.push({
3792
+ kind: "tag",
3793
+ tag: r.tag,
3794
+ index: n
3795
+ }), t.push(r.tag)) : (e.push({
3796
+ kind: "pair",
3797
+ pair: r.pair,
3798
+ index: n
3799
+ }), t.push(r.pair)), n++;
3800
+ }, i = I.value;
3801
+ if (D.value || !L.value) for (let e of i) r(e);
3802
+ else for (let [t, n] of ee(i)) {
3803
+ e.push({
3804
+ kind: "header",
3805
+ label: t
3806
+ });
3807
+ for (let e of n) r(e);
3808
+ }
3809
+ return {
3810
+ rows: e,
3811
+ items: t
3812
+ };
3813
+ }), z = _(() => R.value.items), B = _(() => t.tags.value.length === 0 && t.pairs.value.length === 0), te = _(() => !B.value && z.value.length === 0);
3814
+ P(() => t.isOpen.value, (e) => {
3815
+ e && (f.value = "", k.value = 0, c(() => C.value?.focus()));
3816
+ }), P(z, (e) => {
3817
+ k.value >= e.length && (k.value = Math.max(0, e.length - 1));
3818
+ });
3819
+ let ne = p(null);
3820
+ function re(e) {
3821
+ t.resolve(e);
3822
+ }
3823
+ function V() {
3824
+ t.resolve(null);
3825
+ }
3826
+ function ie(e) {
3827
+ z.value.length !== 0 && (k.value = Math.max(0, Math.min(z.value.length - 1, k.value + e)), c(() => {
3828
+ ne.value?.querySelector(`[data-logic-index="${k.value}"]`)?.scrollIntoView({ block: "nearest" });
3829
+ }));
3830
+ }
3831
+ function ae(e) {
3832
+ if (e.key === "ArrowDown") e.preventDefault(), ie(1);
3833
+ else if (e.key === "ArrowUp") e.preventDefault(), ie(-1);
3834
+ else if (e.key === "Enter") {
3835
+ e.preventDefault();
3836
+ let t = z.value[k.value];
3837
+ t && re(t);
3838
+ }
3839
+ }
3840
+ function oe(e) {
3841
+ return `${kl}-opt-${e}`;
3842
+ }
3843
+ function se() {
3844
+ return z.value.length === 0 ? void 0 : `${kl}-opt-${k.value}`;
3845
+ }
3846
+ return (e, c) => (s(), S(_e, {
3847
+ visible: b(t).isOpen.value,
3848
+ onClose: V,
3849
+ onKeydown: ae
3850
+ }, {
3851
+ default: d(() => [E("div", {
3852
+ role: "dialog",
3853
+ "aria-modal": "true",
3854
+ "aria-labelledby": `${kl}-title`,
3855
+ "data-tpl-theme": b(o),
3856
+ "data-testid": "logic-picker-modal",
3857
+ class: "tpl tpl:flex tpl:max-h-[80vh] tpl:w-[min(420px,92vw)] tpl:flex-col tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:shadow-[var(--tpl-shadow-lg)]",
3858
+ style: O(b(a))
3859
+ }, [
3860
+ E("header", pl, [E("h2", {
3861
+ id: `${kl}-title`,
3862
+ class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
3863
+ }, g(b(n).logicTag.picker.title), 9, ml), E("button", {
3864
+ type: "button",
3865
+ class: "tpl:flex tpl:h-7 tpl:w-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
3866
+ "aria-label": b(n).logicTag.picker.close,
3867
+ "data-testid": "logic-picker-close",
3868
+ onClick: V
3869
+ }, [N(b(it), {
3870
+ size: 16,
3871
+ "stroke-width": 2
3872
+ })], 8, hl)]),
3873
+ E("div", gl, [N(b(Nt), {
3874
+ class: "tpl:pointer-events-none tpl:absolute tpl:top-1/2 tpl:left-5 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]",
3875
+ size: 14,
3876
+ "stroke-width": 2
3877
+ }), r(E("input", {
3878
+ id: `${kl}-search`,
3879
+ ref_key: "searchInputRef",
3880
+ ref: C,
3881
+ "onUpdate:modelValue": c[0] ||= (e) => f.value = e,
3882
+ type: "text",
3883
+ class: "tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)]",
3884
+ placeholder: b(n).logicTag.picker.searchPlaceholder,
3885
+ "aria-label": b(n).logicTag.picker.searchAriaLabel,
3886
+ "aria-controls": kl,
3887
+ "aria-activedescendant": se(),
3888
+ "data-testid": "logic-picker-search",
3889
+ onKeydown: c[1] ||= h(x(() => {}, ["prevent"]), ["enter"])
3890
+ }, null, 40, _l), [[w, f.value]])]),
3891
+ E("div", {
3892
+ id: kl,
3893
+ ref_key: "listRef",
3894
+ ref: ne,
3895
+ class: "tpl:relative tpl:max-h-[60vh] tpl:flex-1 tpl:overflow-y-auto",
3896
+ role: "listbox",
3897
+ "aria-label": b(n).logicTag.picker.title,
3898
+ "data-testid": "logic-picker-list"
3899
+ }, [B.value ? (s(), v("div", yl, g(b(n).logicTag.picker.empty), 1)) : te.value ? (s(), v("div", bl, g(b(n).logicTag.picker.noResults), 1)) : (s(!0), v(A, { key: 2 }, l(R.value.rows, (e, t) => (s(), v(A, { key: t }, [e.kind === "header" ? (s(), v("div", {
3900
+ key: 0,
3901
+ class: "tpl:px-3 tpl:pt-2.5 tpl:pb-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]",
3902
+ "data-testid": "logic-picker-header",
3903
+ "data-group-name": e.label
3904
+ }, g(e.label), 9, xl)) : (s(), v("button", {
3905
+ key: 1,
3906
+ id: oe(e.index),
3907
+ type: "button",
3908
+ role: "option",
3909
+ "aria-selected": e.index === k.value,
3910
+ "data-selected": e.index === k.value ? "true" : "false",
3911
+ "data-logic-index": e.index,
3912
+ "data-logic-kind": e.kind,
3913
+ class: T(["tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:border-none tpl:px-3 tpl:py-1.5 tpl:text-left tpl:transition-colors", e.index === k.value ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:bg-transparent tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
3914
+ "data-testid": "logic-picker-item",
3915
+ onMousemove: (t) => k.value = e.index,
3916
+ onClick: (t) => re(e.kind === "tag" ? e.tag : e.pair)
3917
+ }, [
3918
+ E("span", Cl, [E("span", wl, g(e.kind === "tag" ? e.tag.label : e.pair.label), 1), e.kind === "tag" ? (s(), v("span", Tl, [N(dl, {
3919
+ value: e.tag.value,
3920
+ syntax: b(i)
3921
+ }, null, 8, ["value", "syntax"])])) : (s(), v("span", El, [
3922
+ N(dl, {
3923
+ value: e.pair.before,
3924
+ syntax: b(i)
3925
+ }, null, 8, ["value", "syntax"]),
3926
+ c[2] ||= E("span", { class: "tpl:text-[var(--tpl-text-dim)]" }, "…", -1),
3927
+ N(dl, {
3928
+ value: e.pair.after,
3929
+ syntax: b(i)
3930
+ }, null, 8, ["value", "syntax"])
3931
+ ]))]),
3932
+ E("span", Dl, g(e.kind === "tag" ? e.tag.value : `${e.pair.before} … ${e.pair.after}`), 1),
3933
+ (e.kind === "tag" ? e.tag.description : e.pair.description) ? (s(), v("span", Ol, g(e.kind === "tag" ? e.tag.description : e.pair.description), 1)) : y("", !0)
3934
+ ], 42, Sl))], 64))), 128))], 8, vl)
3935
+ ], 12, fl)]),
3936
+ _: 1
3937
+ }, 8, ["visible"]));
3938
+ }
3939
+ });
3940
+ //#endregion
3941
+ export { zc as a, kc as c, an as d, qt as f, Vc as i, gn as l, ll as n, Lc as o, Wc as r, Pc as s, Al as t, on as u };
3942
+
3943
+ //# sourceMappingURL=styles-B7wryV0l.js.map