@chaibuilder/sdk 4.0.0-beta.3 → 4.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/{2SSKDMRQ-BnsZi3K3.cjs → 2SSKDMRQ-CopJgtZb.cjs} +1 -1
  2. package/dist/{2SSKDMRQ-CnSDkQcy.js → 2SSKDMRQ-Difo_1pg.js} +2 -2
  3. package/dist/{AP7HFJJL-CymCmW14.js → AP7HFJJL-BPuPBqj4.js} +1 -1
  4. package/dist/{AP7HFJJL-B31839PG.cjs → AP7HFJJL-DYxDgaOs.cjs} +1 -1
  5. package/dist/{IconPicker-B1rWC-Ex.js → IconPicker-B2-oriq2.js} +8 -7
  6. package/dist/IconPicker-C0oycHbs.cjs +1 -0
  7. package/dist/{WDYDFRGG-BxhOCHc3.cjs → WDYDFRGG-DbejaRPK.cjs} +1 -1
  8. package/dist/{WDYDFRGG-BUVnbAci.js → WDYDFRGG-KK8pkcW1.js} +2 -2
  9. package/dist/{actions-registery-YnFmU21O.cjs → actions-registery-JdxhXhT6.cjs} +1 -1
  10. package/dist/{actions-registery-CZ1w0NKa.js → actions-registery-y_ENc8zj.js} +2 -2
  11. package/dist/actions.cjs +1 -1
  12. package/dist/actions.js +2 -2
  13. package/dist/active-in-another-tab-Cu_ASKtx.cjs +1 -0
  14. package/dist/active-in-another-tab-DkR2HWI4.js +35 -0
  15. package/dist/add-new-language-page-BXuwluuU.cjs +1 -0
  16. package/dist/{add-new-language-page-WmlCnytQ.js → add-new-language-page-CBY0RR6q.js} +54 -53
  17. package/dist/{add-new-page-soZ8GAkN.cjs → add-new-page-C_PzKby8.cjs} +1 -1
  18. package/dist/{add-new-page-VW2wAYZp.js → add-new-page-DJLJFLAd.js} +2 -2
  19. package/dist/{ai-panel-content-D_o7Q_A-.js → ai-panel-content--YM01Aly.js} +12 -11
  20. package/dist/ai-panel-content-rRmJdH7L.cjs +1 -0
  21. package/dist/{ai-panel-default-lang-DnElspF0.js → ai-panel-default-lang-BZl0tPYo.js} +40 -40
  22. package/dist/{ai-panel-default-lang-COYaxNwn.cjs → ai-panel-default-lang-D2zhXvKP.cjs} +2 -2
  23. package/dist/{ai-panel-other-lang-Dp0E9_Hx.js → ai-panel-other-lang-Bfjk2CYZ.js} +8 -8
  24. package/dist/{ai-panel-other-lang-CkynNlAU.cjs → ai-panel-other-lang-Y4bEKHoG.cjs} +1 -1
  25. package/dist/{ai-prompt-input-Bhc0ds7X.js → ai-prompt-input-DueQYNf-.js} +68 -67
  26. package/dist/ai-prompt-input-N9PcYCFa.cjs +1 -0
  27. package/dist/{ai-translation-prompt-CZ55HQmo.js → ai-translation-prompt-B36F3d7K.js} +2 -2
  28. package/dist/ai-translation-prompt-IAdWMNZb.cjs +1 -0
  29. package/dist/{apply-binding-6iwlED02.js → apply-binding-BvWfJCSZ.js} +204 -196
  30. package/dist/apply-binding-IsUf6UWJ.cjs +1 -0
  31. package/dist/{code-display-DhD_RBcg.js → code-display-Ck81Id9K.js} +1 -1
  32. package/dist/code-display-DloSPyPr.cjs +1 -0
  33. package/dist/{code-editor-DRIAnNbb.js → code-editor-Bb7JumZy.js} +11 -10
  34. package/dist/code-editor-DQB8lAOk.cjs +1 -0
  35. package/dist/{continue-editing-in-this-client-CS2aQ7yY.js → continue-editing-in-this-client-Dm9cCj7K.js} +10 -9
  36. package/dist/continue-editing-in-this-client-DmGFLHXw.cjs +1 -0
  37. package/dist/core-Dr7QYemB.js +56 -0
  38. package/dist/core-Y0lXLwkq.cjs +1 -0
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.d.ts +3 -3
  41. package/dist/core.js +41 -39
  42. package/dist/{css-import-modal-Byg6wV0O.js → css-import-modal-9P_0uNa4.js} +5 -3
  43. package/dist/css-import-modal-Rh1QAVxo.cjs +13 -0
  44. package/dist/{delete-design-token-DkVs1oBf.cjs → delete-design-token-BG8yHcS5.cjs} +1 -1
  45. package/dist/{delete-design-token-BRZZiWtQ.js → delete-design-token-COvR4G1S.js} +1 -1
  46. package/dist/{delete-page-BzyX9TN-.js → delete-page-CNucxe4P.js} +11 -10
  47. package/dist/delete-page-DAvEjHwF.cjs +1 -0
  48. package/dist/design-token-usage-CXglXgcJ.cjs +1 -0
  49. package/dist/{design-token-usage-xQs6SlaJ.js → design-token-usage-MNYsFlPG.js} +14 -13
  50. package/dist/digital-asset-manager-CB5MRBcW.cjs +1 -0
  51. package/dist/{digital-asset-manager-DbtwzxRz.js → digital-asset-manager-CqCWBO0s.js} +6 -5
  52. package/dist/{duplicate-page-BR7Dlo9d.js → duplicate-page-BknLfqr0.js} +19 -18
  53. package/dist/duplicate-page-DzZByALW.cjs +1 -0
  54. package/dist/{dynamic-page-selector-Cb5r_W8s.js → dynamic-page-selector-DoW7OyUB.js} +15 -14
  55. package/dist/dynamic-page-selector-WA007Sni.cjs +1 -0
  56. package/dist/get-chai-builder-tailwind-config-BFePCEIS.cjs +1 -0
  57. package/dist/{get-chai-builder-tailwind-config-DjoVOuAf.js → get-chai-builder-tailwind-config-BXf_xLHk.js} +5 -5
  58. package/dist/{get-chai-builder-theme-Dl72X7cz.cjs → get-chai-builder-theme-BApShjRz.cjs} +1 -1
  59. package/dist/{get-chai-builder-theme-BYtp20KD.js → get-chai-builder-theme-DDVRJQ6Z.js} +1 -1
  60. package/dist/{image-editor-DV8kUKhl.js → image-editor-CQnNtak2.js} +1 -1
  61. package/dist/{image-editor-G-K28aTS.cjs → image-editor-CqwaVxO2.cjs} +1 -1
  62. package/dist/index-C0-pgg_p.cjs +5 -0
  63. package/dist/index-C99FhuF1.cjs +160 -0
  64. package/dist/{index-ZuacEL1j.js → index-Dno42B0a.js} +672 -670
  65. package/dist/{index-Ct7ElCGK.js → index-rAcNbjk_.js} +3744 -3920
  66. package/dist/{json-diff-viewer-D7z4zNvv.cjs → json-diff-viewer-CLuUHiPU.cjs} +3 -3
  67. package/dist/{json-diff-viewer-krslPepD.js → json-diff-viewer-CMvGUvJ2.js} +5 -4
  68. package/dist/{lang-panel-BwIewMyw.js → lang-panel-CnwTb05j.js} +15 -14
  69. package/dist/lang-panel-fDCYm5Jm.cjs +1 -0
  70. package/dist/{manage-design-tokens-Caz_20VK.js → manage-design-tokens-BsSZE9Vs.js} +12 -11
  71. package/dist/manage-design-tokens-BvH5KTJX.cjs +1 -0
  72. package/dist/mark-as-template-CpWEBJGd.cjs +1 -0
  73. package/dist/{mark-as-template-D295ZQtU.js → mark-as-template-DBLshWb5.js} +17 -16
  74. package/dist/{nested-path-selector-content-CKYYK-C5.js → nested-path-selector-content-6OBJ8LG8.js} +24 -23
  75. package/dist/nested-path-selector-content-C2sD9dkq.cjs +1 -0
  76. package/dist/no-language-page-content-BvPDdccK.cjs +1 -0
  77. package/dist/{no-language-page-content-BvqRBP6y.js → no-language-page-content-CzENgtnu.js} +10 -9
  78. package/dist/{no-language-page-dialog-PjNqTUpl.js → no-language-page-dialog-CbYI2cVg.js} +2 -2
  79. package/dist/{no-language-page-dialog-BcEoqyQB.cjs → no-language-page-dialog-CgW4yJBC.cjs} +1 -1
  80. package/dist/{page-creator-DiOITEMw.js → page-creator-Cc83uQqw.js} +113 -112
  81. package/dist/page-creator-g8GqgcKH.cjs +1 -0
  82. package/dist/{page-lock-Bfbs6RgL.js → page-lock-BJUkyxdh.js} +2 -2
  83. package/dist/{page-lock-BdYmCks0.cjs → page-lock-CT7SmQqp.cjs} +1 -1
  84. package/dist/page-locked-dialog-Co5b9XIZ.cjs +1 -0
  85. package/dist/{page-locked-dialog-B6MKTRfY.js → page-locked-dialog-DsEbWRed.js} +18 -15
  86. package/dist/{page-manager-new-CzX22g2n.js → page-manager-new-5rFP5DyQ.js} +30 -29
  87. package/dist/page-manager-new-BOkJImo2.cjs +1 -0
  88. package/dist/page-manager-search-and-filter-Bfm0j1gg.cjs +1 -0
  89. package/dist/{page-manager-search-and-filter-CM0UMb6U.js → page-manager-search-and-filter-zq-LfhQ1.js} +13 -12
  90. package/dist/{page-revisions-content-NH9JK4Ey.js → page-revisions-content-D38G2tJM.js} +34 -31
  91. package/dist/page-revisions-content-ag-MHBGr.cjs +1 -0
  92. package/dist/pages.cjs +1 -1
  93. package/dist/pages.d.ts +4 -4
  94. package/dist/pages.js +1 -1
  95. package/dist/{plugin-C6rgJDNQ.cjs → plugin-BGlQf0iy.cjs} +1 -1
  96. package/dist/{plugin-3ZKK6RXm.js → plugin-C-ht41UZ.js} +1 -1
  97. package/dist/publish-pages-content-BiX-GMLw.cjs +1 -0
  98. package/dist/{publish-pages-content-D9aixMN5.js → publish-pages-content-CS7f41Ac.js} +66 -65
  99. package/dist/register-chai-top-bar-BqwKw4uy.cjs +1 -0
  100. package/dist/register-chai-top-bar-ESJHs5s-.js +237 -0
  101. package/dist/render.cjs +2 -2
  102. package/dist/render.d.ts +2 -2
  103. package/dist/render.js +87 -80
  104. package/dist/rte-widget-modal-BKNx2wln.cjs +1 -0
  105. package/dist/{rte-widget-modal-DOJEXLIf.js → rte-widget-modal-D6Zik0Ta.js} +15 -14
  106. package/dist/runtime.cjs +1 -1
  107. package/dist/runtime.d.ts +168 -4
  108. package/dist/runtime.js +68 -38
  109. package/dist/{save-to-lib-eiOc_SSN.js → save-to-lib-WwOzbgiF.js} +39 -38
  110. package/dist/save-to-lib-ffjCZYJ5.cjs +1 -0
  111. package/dist/sdk.css +1 -1
  112. package/dist/{selected-block-display-CBFePS19.js → selected-block-display-B1SG_UXw.js} +37 -36
  113. package/dist/selected-block-display-BOgnQRLF.cjs +16 -0
  114. package/dist/{seo-panel-C1-iMOR1.js → seo-panel-BkOgRoWd.js} +12 -11
  115. package/dist/seo-panel-FjS1UF_y.cjs +2 -0
  116. package/dist/{shared-json-ld-B4PxAM_0.js → shared-json-ld-uka9TOgA.js} +68 -67
  117. package/dist/shared-json-ld-yJkXjENy.cjs +1 -0
  118. package/dist/slug-input-Cyd6NR6J.cjs +1 -0
  119. package/dist/{slug-input-AwNJs9im.js → slug-input-DHLmUNrH.js} +9 -8
  120. package/dist/supabase-actions.cjs +1 -1
  121. package/dist/supabase-actions.d.ts +1 -1
  122. package/dist/supabase-actions.js +1 -1
  123. package/dist/{take-over-request-C4FeDtN_.js → take-over-request-Ca0X-qyf.js} +17 -16
  124. package/dist/take-over-request-CmpJVe9T.cjs +1 -0
  125. package/dist/{theme-panel-footer-uBQqSJXm.js → theme-panel-footer-BUXIu252.js} +11 -10
  126. package/dist/theme-panel-footer-CKO9YYwZ.cjs +1 -0
  127. package/dist/{translation-warning-modal-B64YqlbI.js → translation-warning-modal-DrpFeI83.js} +9 -8
  128. package/dist/translation-warning-modal-pSZVKcNW.cjs +1 -0
  129. package/dist/{unmark-as-template-CZ9sQp_P.js → unmark-as-template-BMqgelv-.js} +11 -10
  130. package/dist/unmark-as-template-DF1Ms4VN.cjs +1 -0
  131. package/dist/unpublish-page-BJ0Bsvt2.js +28 -0
  132. package/dist/unpublish-page-Bsq2yEqQ.cjs +1 -0
  133. package/dist/utils.cjs +1 -1
  134. package/dist/utils.d.ts +4 -1
  135. package/dist/utils.js +2 -2
  136. package/dist/web-blocks.cjs +1 -1
  137. package/dist/web-blocks.js +46 -46
  138. package/dist/{web-preview-Djy6WIyj.js → web-preview-D6h1L2nV.js} +2 -2
  139. package/dist/web-preview-kres0aG7.cjs +1 -0
  140. package/package.json +4 -2
  141. package/dist/IconPicker-DREyo007.cjs +0 -1
  142. package/dist/active-in-another-tab-B47YjQGN.cjs +0 -1
  143. package/dist/active-in-another-tab-CyjngVA6.js +0 -34
  144. package/dist/add-new-language-page-88xzrUy8.cjs +0 -1
  145. package/dist/ai-panel-content-7zCil042.cjs +0 -1
  146. package/dist/ai-prompt-input-CThbVp0_.cjs +0 -1
  147. package/dist/ai-translation-prompt-C2kJQFDX.cjs +0 -1
  148. package/dist/apply-binding-KKp5PnpZ.cjs +0 -1
  149. package/dist/code-display-BnqzqzoP.cjs +0 -1
  150. package/dist/code-editor-o3___nu2.cjs +0 -1
  151. package/dist/continue-editing-in-this-client-CtMYsk-A.cjs +0 -1
  152. package/dist/core-BoRDjj4h.cjs +0 -1
  153. package/dist/core-yvI6kCyw.js +0 -56
  154. package/dist/css-import-modal-CyqkXWCO.cjs +0 -13
  155. package/dist/delete-page-DxX7PFIE.cjs +0 -1
  156. package/dist/design-token-usage-CAHzEGgJ.cjs +0 -1
  157. package/dist/digital-asset-manager--uO8Agia.cjs +0 -1
  158. package/dist/duplicate-page-CaNAbXwV.cjs +0 -1
  159. package/dist/dynamic-page-selector-Cxk_gjni.cjs +0 -1
  160. package/dist/get-chai-builder-tailwind-config-B9rCyiQo.cjs +0 -1
  161. package/dist/index-DF5DEvqb.cjs +0 -160
  162. package/dist/index-WQwzsC7A.cjs +0 -5
  163. package/dist/lang-panel-DT96k1xg.cjs +0 -1
  164. package/dist/manage-design-tokens-CrmLe7UT.cjs +0 -1
  165. package/dist/mark-as-template-W3LmpiqN.cjs +0 -1
  166. package/dist/nested-path-selector-content-CoS_d3dc.cjs +0 -1
  167. package/dist/no-language-page-content-DkfeMl90.cjs +0 -1
  168. package/dist/page-creator-C4gc5NSC.cjs +0 -1
  169. package/dist/page-locked-dialog-B1FAtK92.cjs +0 -1
  170. package/dist/page-manager-new-CHDueBDk.cjs +0 -1
  171. package/dist/page-manager-search-and-filter-DkkRIH86.cjs +0 -1
  172. package/dist/page-revisions-content-ChY-4f2V.cjs +0 -1
  173. package/dist/publish-pages-content-x-JuSFJ9.cjs +0 -1
  174. package/dist/rte-widget-modal-BaHIuEjF.cjs +0 -1
  175. package/dist/save-to-lib-Cgpxw8-g.cjs +0 -1
  176. package/dist/selected-block-display-BgRY82CT.cjs +0 -16
  177. package/dist/seo-panel-DfAb8U7W.cjs +0 -2
  178. package/dist/shared-json-ld-DzG398hr.cjs +0 -1
  179. package/dist/slug-input-C_ijLQ_X.cjs +0 -1
  180. package/dist/take-over-request-BNxcjY2j.cjs +0 -1
  181. package/dist/theme-panel-footer-Cq9pljro.cjs +0 -1
  182. package/dist/translation-warning-modal-BZAcwM2_.cjs +0 -1
  183. package/dist/unmark-as-template-EVvk0vmp.cjs +0 -1
  184. package/dist/unpublish-page-D4VwOlxc.js +0 -27
  185. package/dist/unpublish-page-bdSmwAVQ.cjs +0 -1
  186. package/dist/web-preview-Cio70gk5.cjs +0 -1
@@ -1,22 +1,22 @@
1
- import { g as lt, c as P } from "./common-functions-D2lMFR6K.js";
2
- import { memoize as rt, get as y, cloneDeep as q, forEach as N, keys as R, isString as $, startsWith as k, isArray as I, isEmpty as _, includes as B, flatten as ct, flatMapDeep as pt, set as w, find as m, startCase as ut, camelCase as dt, has as A, filter as G, some as yt, capitalize as ht, compact as mt, map as gt, trim as bt, each as xt, last as ft } from "lodash-es";
1
+ import { g as rt, c as R } from "./common-functions-D2lMFR6K.js";
2
+ import { memoize as ct, get as y, cloneDeep as q, forEach as N, keys as W, isString as $, startsWith as k, isArray as I, isEmpty as _, includes as B, flatten as pt, flatMapDeep as ut, set as w, find as m, startCase as dt, camelCase as G, has as P, filter as Q, some as yt, capitalize as ht, compact as mt, map as gt, trim as bt, each as xt, last as ft } from "lodash-es";
3
3
  import { parse as _t, stringify as C } from "himalaya";
4
- import { e as kt, i as vt } from "./core-yvI6kCyw.js";
4
+ import { e as kt, i as vt } from "./core-Dr7QYemB.js";
5
5
  import { twMerge as wt } from "tailwind-merge";
6
- const x = "#styles:", jt = "__ADD_BLOCK_INTERNAL_ROOT", qt = "@", Bt = "#", Q = "dt#", et = (e) => {
7
- if (e = e.replace(x, ""), !e) return { baseClasses: "", classes: "" };
8
- const n = e.split(/,(?![^\[]*\])/);
6
+ const x = "#styles:", Ht = "__ADD_BLOCK_INTERNAL_ROOT", qt = "@", Bt = "#", tt = "dt#", st = (s) => {
7
+ if (s = s.replace(x, ""), !s) return { baseClasses: "", classes: "" };
8
+ const n = s.split(/,(?![^\[]*\])/);
9
9
  if (n.length === 1)
10
10
  return { baseClasses: "", classes: n[0].trim() };
11
- const [t, ...s] = n;
11
+ const [t, ...e] = n;
12
12
  return {
13
13
  baseClasses: t.trim(),
14
- classes: s.join(",").trim().replace(/ +(?= )/g, "")
14
+ classes: e.join(",").trim().replace(/ +(?= )/g, "")
15
15
  };
16
16
  };
17
17
  import.meta.vitest && describe("getSplitChaiClasses", () => {
18
18
  it("should return the base classes and the classes", () => {
19
- const e = {
19
+ const s = {
20
20
  ",styles-2": { baseClasses: "", classes: "styles-2" },
21
21
  "styles-1,styles-2": { baseClasses: "styles-1", classes: "styles-2" },
22
22
  ",bg-[linear-gradient(-10deg,black,transparent_100%)]": {
@@ -40,79 +40,79 @@ import.meta.vitest && describe("getSplitChaiClasses", () => {
40
40
  classes: "bg-[linear-gradient(-10deg,black,transparent_100%)]"
41
41
  }
42
42
  };
43
- for (let n in e) {
44
- const t = et(`${x}${n}`);
45
- expect(t).toEqual(e[n]);
43
+ for (const [n, t] of Object.entries(s)) {
44
+ const e = st(`${x}${n}`);
45
+ expect(e).toEqual(t);
46
46
  }
47
47
  });
48
48
  });
49
- function Mt(e, n, t) {
50
- const s = y(t, "i18nProps", []);
51
- if (_(n) || _(s)) return e;
52
- const a = q(e);
53
- return N(R(a), (o) => {
54
- if (B(s, o) && !_(n)) {
49
+ function Ot(s, n, t) {
50
+ const e = y(t, "i18nProps", []);
51
+ if (_(n) || _(e)) return s;
52
+ const a = q(s);
53
+ return N(W(a), (o) => {
54
+ if (B(e, o) && !_(n)) {
55
55
  const i = y(a, o), l = y(a, `${o}-${n}`, "");
56
56
  $(i) ? a[o] = $(l) && !_(l.trim()) && l.trimStart() || i : a[o] = _(l) ? i : l;
57
57
  }
58
58
  }), a;
59
59
  }
60
- const st = (e, n) => {
61
- const { baseClasses: t, classes: s } = et(e), o = s.split(" ").filter((l) => l.startsWith(Q)).map((l) => {
60
+ const at = (s, n) => {
61
+ const { baseClasses: t, classes: e } = st(s), o = e.split(" ").filter((l) => l.startsWith(tt)).map((l) => {
62
62
  var u;
63
63
  return (u = n[l]) == null ? void 0 : u.value;
64
- }), i = s.split(" ").filter((l) => !l.startsWith(Q)).join(" ");
64
+ }), i = e.split(" ").filter((l) => !l.startsWith(tt)).join(" ");
65
65
  return wt.apply(null, [t, ...o, i]);
66
66
  };
67
- function Tt(e, n) {
68
- return y(e, `${n}_attrs`, {});
67
+ function Tt(s, n) {
68
+ return y(s, `${n}_attrs`, {});
69
69
  }
70
- function Ot(e, n = !0, t = {}) {
71
- const s = {};
72
- return Object.keys(e).forEach((a) => {
73
- if ($(e[a]) && e[a].startsWith(x)) {
74
- const o = st(e[a], t), i = Tt(e, a);
75
- s[a] = {
70
+ function Mt(s, n = !0, t = {}) {
71
+ const e = {};
72
+ return Object.keys(s).forEach((a) => {
73
+ if ($(s[a]) && s[a].startsWith(x)) {
74
+ const o = at(s[a], t), i = Tt(s, a);
75
+ e[a] = {
76
76
  ...!_(o) && { className: o },
77
77
  ...i,
78
78
  ...n ? {
79
79
  "data-style-prop": a,
80
- "data-block-parent": e._id,
81
- "data-style-id": `${a}-${e._id}`
80
+ "data-block-parent": s._id,
81
+ "data-style-id": `${a}-${s._id}`
82
82
  } : {}
83
83
  };
84
84
  }
85
- }), s;
85
+ }), e;
86
86
  }
87
- const Vt = rt((e) => {
88
- const n = kt(e), t = y(n, "schema.properties", {});
89
- return Object.fromEntries(Object.entries(t).filter(([, s]) => y(s, "runtime", !1)));
90
- }), Jt = (e, n) => {
91
- if (!I(e)) return e;
92
- let t = e, s;
93
- return typeof n.limit == "number" && n.limit > 0 && (s = n.limit), s !== void 0 && (t = t.slice(0, s)), t;
94
- }, zt = (e, n) => {
95
- const t = q(e);
96
- return N(R(t), (s) => {
97
- if ($(t[s]) && !k(s, "_")) {
98
- let a = t[s];
99
- s === "repeaterItems" && (t.repeaterItemsBinding = a);
87
+ const Vt = ct((s) => {
88
+ const n = kt(s), t = y(n, "schema.properties", {});
89
+ return Object.fromEntries(Object.entries(t).filter(([, e]) => y(e, "runtime", !1)));
90
+ }), Jt = (s, n) => {
91
+ if (!I(s)) return s;
92
+ let t = s, e;
93
+ return typeof n.limit == "number" && n.limit > 0 && (e = n.limit), e !== void 0 && (t = t.slice(0, e)), t;
94
+ }, zt = (s, n) => {
95
+ const t = q(s);
96
+ return N(W(t), (e) => {
97
+ if ($(t[e]) && !k(e, "_")) {
98
+ let a = t[e];
99
+ e === "repeaterItems" && (t.repeaterItemsBinding = a);
100
100
  const o = /\{\{(.*?)\}\}/g, i = a.match(o);
101
101
  i && i.forEach((l) => {
102
102
  let u = l.slice(2, -2);
103
103
  const r = y(n, u, l);
104
104
  a = I(r) ? r : a.replace(l, r);
105
- }), t[s] = a;
105
+ }), t[e] = a;
106
106
  }
107
107
  }), t;
108
- }, Et = (e) => {
108
+ }, Et = (s) => {
109
109
  const n = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, t = /(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;
110
- return n.test(e) || t.test(e);
111
- }, $t = (e) => {
112
- if (_(e)) return e;
113
- const n = /<video[^>]+src=['"]([^'">]+)['"]/, t = /<iframe[^>]+src=['"]([^'">]+)['"]/, s = e.match(n), a = e.match(t), o = s ? s[1] : a ? a[1] : null, i = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, l = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
114
- return o && (i.test(o) || l.test(o)) ? o : e;
115
- }, at = ["chai-name", "data-chai-name"], Nt = {
110
+ return n.test(s) || t.test(s);
111
+ }, $t = (s) => {
112
+ if (_(s)) return s;
113
+ const n = /<video[^>]+src=['"]([^'">]+)['"]/, t = /<iframe[^>]+src=['"]([^'">]+)['"]/, e = s.match(n), a = s.match(t), o = e ? e[1] : a ? a[1] : null, i = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, l = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
114
+ return o && (i.test(o) || l.test(o)) ? o : s;
115
+ }, nt = ["chai-name", "data-chai-name"], Nt = {
116
116
  img: { alt: "alt", width: "width", height: "height", src: "image" },
117
117
  video: {
118
118
  src: "url",
@@ -148,12 +148,15 @@ const Vt = rt((e) => {
148
148
  form: {
149
149
  action: "action"
150
150
  }
151
- }, St = (e, n) => e.children.length === 1 && B(
152
- ["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link", "RichText"],
153
- n._type
154
- ), H = (e) => e.map((n) => n.type === "text" ? y(n, "content", "") : _(n.children) ? "" : H(n.children)).join(""), W = (e) => e === null ? "" : e, nt = (e) => {
155
- const n = mt(gt(e.split(/\s+/), bt)), t = m(n, (l) => /^w-/.test(l)), s = m(n, (l) => /^h-/.test(l));
156
- if (!s || !t) return { height: "", width: "" };
151
+ }, St = (s, n) => {
152
+ var t;
153
+ return ((t = s.children) == null ? void 0 : t.length) === 1 && B(
154
+ ["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link", "RichText"],
155
+ n._type
156
+ );
157
+ }, j = (s) => s.map((n) => n.type === "text" ? y(n, "content", "") : _(n.children) ? "" : j(n.children || [])).join(""), A = (s) => s === null ? "" : s, ot = (s) => {
158
+ const n = mt(gt(s.split(/\s+/), bt)), t = m(n, (l) => /^w-/.test(l)), e = m(n, (l) => /^h-/.test(l));
159
+ if (!e || !t) return { height: "", width: "" };
157
160
  const a = (l) => {
158
161
  if (!l) return;
159
162
  const u = l.match(/^[wh]-(?:\[(.*?)\]|(.+))$/);
@@ -161,38 +164,38 @@ const Vt = rt((e) => {
161
164
  if (u[1]) return u[1];
162
165
  const r = u[2];
163
166
  return /^\d+(\.\d+)?$/.test(r) ? `${Number(r) * 4}px` : r === "auto" || B(r, "%") ? r : "16px";
164
- }, o = a(t), i = a(s);
167
+ }, o = a(t), i = a(e);
165
168
  return {
166
169
  width: B(o, "px") ? o : "16px",
167
170
  height: B(i, "px") ? i : "16px"
168
171
  };
169
- }, tt = (e) => {
170
- if (e.tagName === "svg") return {};
171
- const n = {}, t = Nt[e.tagName] || {}, s = e.attributes;
172
- return N(s, ({ key: a, value: o }) => {
172
+ }, et = (s) => {
173
+ if (s.tagName === "svg") return {};
174
+ const n = {}, t = Nt[s.tagName || ""] || {}, e = s.attributes || [];
175
+ return N(e, ({ key: a, value: o }) => {
173
176
  var i;
174
- if (!B(at, a))
175
- if (a === "bid" && (n._bid = W(o)), t[a]) {
176
- if (e.tagName === "img" && a === "src" && !o.startsWith("http")) {
177
- const l = m(e.attributes, { key: "width" }), u = m(e.attributes, { key: "height" });
177
+ if (!B(nt, a))
178
+ if (a === "bid" && (n._bid = A(o)), t[a]) {
179
+ if (s.tagName === "img" && a === "src" && !o.startsWith("http")) {
180
+ const l = m(s.attributes, { key: "width" }), u = m(s.attributes, { key: "height" });
178
181
  l && u ? o = `https://picsum.photos/${l == null ? void 0 : l.value}x${u == null ? void 0 : u.value}` : o = "https://picsum.photos/150x150";
179
- } else if (e.tagName === "a") {
180
- const l = m(e.attributes, { key: "href" });
182
+ } else if (s.tagName === "a") {
183
+ const l = m(s.attributes, { key: "href" });
181
184
  l && typeof (l == null ? void 0 : l.value) == "string" && ((i = l == null ? void 0 : l.value) != null && i.startsWith("pageType:")) && w(n, "link.type", "pageType");
182
185
  }
183
- w(n, t[a], W(o));
184
- } else B(["style", "class", "srcset", "bid"], a) || (A(n, "styles_attrs") || (n.styles_attrs = {}), k(a, "@") && (a = a.replace("@", "x-on:")), n.styles_attrs[`${a}`] = W(o));
186
+ w(n, t[a], A(o));
187
+ } else B(["style", "class", "srcset", "bid"], a) || (n.styles_attrs = n.styles_attrs || {}, k(a, "@") && (a = a.replace("@", "x-on:")), n.styles_attrs[`${a}`] = A(o));
185
188
  }), delete n.class, n;
186
- }, It = (e, n = "styles") => {
187
- if (!e.attributes) return { [n]: `${x},` };
188
- const t = m(e.attributes, { key: "class" });
189
+ }, It = (s, n = "styles") => {
190
+ if (!s.attributes) return { [n]: `${x},` };
191
+ const t = m(s.attributes, { key: "class" });
189
192
  if (t) {
190
- const s = t.value;
191
- return { [n]: `${x},${s}` };
193
+ const e = t.value;
194
+ return { [n]: `${x},${e}` };
192
195
  }
193
196
  return { [n]: `${x},` };
194
- }, Dt = (e) => {
195
- const n = y(e, "attributes", []), t = n.find((r) => r.key === "data-chai-richtext" || r.key === "chai-richtext"), s = n.find((r) => r.key === "data-chai-lightbox" || r.key === "chai-lightbox"), a = n.find((r) => r.key === "data-chai-dropdown" || r.key === "chai-dropdown"), o = n.find(
197
+ }, Dt = (s) => {
198
+ const n = y(s, "attributes", []), t = n.find((r) => r.key === "data-chai-richtext" || r.key === "chai-richtext"), e = n.find((r) => r.key === "data-chai-lightbox" || r.key === "chai-lightbox"), a = n.find((r) => r.key === "data-chai-dropdown" || r.key === "chai-dropdown"), o = n.find(
196
199
  (r) => r.key === "data-chai-dropdown-button" || r.key === "chai-dropdown-button"
197
200
  ), i = n.find(
198
201
  (r) => r.key === "data-chai-dropdown-content" || r.key === "chai-dropdown-content"
@@ -205,9 +208,9 @@ const Vt = rt((e) => {
205
208
  return { _type: "DropdownContent" };
206
209
  if (t || u)
207
210
  return { _type: "Paragraph" };
208
- if (s)
211
+ if (e)
209
212
  return { _type: "LightBoxLink" };
210
- switch (e.tagName) {
213
+ switch (s.tagName) {
211
214
  // self closing tags
212
215
  case "img":
213
216
  return { _type: "Image" };
@@ -240,18 +243,18 @@ const Vt = rt((e) => {
240
243
  case "dl":
241
244
  return {
242
245
  _type: "List",
243
- tag: e.tagName,
244
- _listType: e.tagName === "ol" ? "list-decimal" : "list-none"
246
+ tag: s.tagName,
247
+ _listType: s.tagName === "ol" ? "list-decimal" : "list-none"
245
248
  };
246
249
  case "li":
247
250
  case "dt":
248
- return { _type: "ListItem", tag: e.tagName };
251
+ return { _type: "ListItem", tag: s.tagName };
249
252
  // non self closing tags
250
253
  // free flow structure
251
254
  case "span":
252
255
  case "figcaption":
253
256
  case "legend":
254
- return { _type: "Span", tag: e.tagName };
257
+ return { _type: "Span", tag: s.tagName };
255
258
  case "p":
256
259
  return { _type: "Paragraph", content: "" };
257
260
  case "a":
@@ -270,14 +273,14 @@ const Vt = rt((e) => {
270
273
  case "h4":
271
274
  case "h5":
272
275
  case "h6":
273
- return { _type: "Heading", tag: e.tagName };
276
+ return { _type: "Heading", tag: s.tagName };
274
277
  case "table":
275
278
  return { _type: "Table" };
276
279
  case "tr":
277
280
  return { _type: "TableRow" };
278
281
  case "td":
279
282
  case "th":
280
- return { _type: "TableCell", tag: e.tagName };
283
+ return { _type: "TableCell", tag: s.tagName };
281
284
  case "thead":
282
285
  return { _type: "TableHead" };
283
286
  case "tbody":
@@ -285,34 +288,34 @@ const Vt = rt((e) => {
285
288
  case "tfoot":
286
289
  return { _type: "TableFooter" };
287
290
  default: {
288
- const r = y(e, "children", []).length > 0 ? "Box" : "EmptyBox";
291
+ const r = y(s, "children", []).length > 0 ? "Box" : "EmptyBox";
289
292
  return {
290
293
  _type: r,
291
- tag: e.tagName,
292
- _name: r == "EmptyBox" || e.tagName === "div" ? r : ht(e.tagName)
294
+ tag: s.tagName,
295
+ _name: r == "EmptyBox" || s.tagName === "div" ? r : ht(s.tagName)
293
296
  };
294
297
  }
295
298
  }
296
- }, j = (e, n = null) => pt(e, (t) => {
297
- var M, O, V, J, z, F, U, Y, K, X;
299
+ }, H = (s, n = null) => ut(s, (t) => {
300
+ var O, M, V, J, z, F, U, Y, K, X;
298
301
  if (t.type === "comment") return [];
299
- let s = { _id: lt() };
300
- if (n && (s._parent = n.block._id), t.type === "text")
301
- return _(y(t, "content", "")) ? [] : n && St(n.node, n.block) ? (w(n, "block.content", y(t, "content", "")), []) : { ...s, _type: "Text", content: y(t, "content", "") };
302
+ let e = { _id: rt() };
303
+ if (n && (e._parent = n.block._id), t.type === "text")
304
+ return _(y(t, "content", "")) ? [] : n && St(n.node, n.block) ? (w(n, "block.content", y(t, "content", "")), []) : { ...e, _type: "Text", content: y(t, "content", "") };
302
305
  if (k(t.tagName, "chai-")) {
303
- const c = t.attributes, p = m(c, { key: "chai-type" }), d = (p == null ? void 0 : p.value) || ut(t.tagName.replace("chai-", "")).replace(/\s+/g, "");
304
- s._type = d, N(c, ({ key: g, value: Z }) => {
306
+ const c = t.attributes || [], p = m(c, { key: "chai-type" }), d = (p == null ? void 0 : p.value) || dt(G(t.tagName || "")).replace(/ /g, "").replace(/\s+/g, "");
307
+ e._type = d, N(c, ({ key: g, value: Z }) => {
305
308
  if (g === "about-this-component" || g === "chai-type" || g === "can-move" || g === "can-delete") return;
306
309
  if (g === "id") {
307
- s._id = Z;
310
+ e._id = Z;
308
311
  return;
309
312
  }
310
- const ot = k(g, "_") ? g : dt(g);
311
- let S = W(Z);
312
- typeof S == "string" && k(S, "#styles:") && (S = S.replace("#styles:", "#styles:,")), s[ot] = S;
313
+ const lt = k(g, "_") ? g : G(g);
314
+ let S = A(Z);
315
+ typeof S == "string" && k(S, "#styles:") && (S = S.replace("#styles:", "#styles:,")), e[lt] = S;
313
316
  });
314
- const h = j(t.children, { block: s, node: t });
315
- return [s, ...h];
317
+ const h = H(t.children || [], { block: e, node: t });
318
+ return [e, ...h];
316
319
  }
317
320
  const a = y(t, "attributes", []), o = t.tagName === "p" || a.find((c) => c.key === "data-chai-richtext" || c.key === "chai-richtext"), i = a.find((c) => c.key === "class"), l = i && i.value.split(/\s+/).includes("rte"), u = a.find(
318
321
  (c) => c.key === "data-chai-lightbox" || c.key === "chai-lightbox"
@@ -323,17 +326,17 @@ const Vt = rt((e) => {
323
326
  ), D = a.find(
324
327
  (c) => c.key === "data-chai-dropdown-content" || c.key === "chai-dropdown-content"
325
328
  );
326
- if (s = {
327
- ...s,
329
+ if (e = {
330
+ ...e,
328
331
  ...Dt(t),
329
- ...tt(t),
332
+ ...et(t),
330
333
  ...It(t)
331
334
  }, t.attributes) {
332
- const c = t.attributes.find((p) => B(at, p.key));
333
- c && (s._name = c.value);
335
+ const c = t.attributes.find((p) => B(nt, p.key));
336
+ c && (e._name = c.value);
334
337
  }
335
338
  if (o || l)
336
- return s.content = `<p>${C(t.children || [])}</p>`, A(s, "styles_attrs.data-chai-richtext") && delete s.styles_attrs["data-chai-richtext"], A(s, "styles_attrs.chai-richtext") && delete s.styles_attrs["chai-richtext"], [s];
339
+ return e.content = `<p>${C(t.children || [])}</p>`, P(e, "styles_attrs.data-chai-richtext") && delete e.styles_attrs["data-chai-richtext"], P(e, "styles_attrs.chai-richtext") && delete e.styles_attrs["chai-richtext"], [e];
337
340
  if (u) {
338
341
  const c = [
339
342
  "data-chai-lightbox",
@@ -345,22 +348,22 @@ const Vt = rt((e) => {
345
348
  "data-gall",
346
349
  "href"
347
350
  ];
348
- s = {
349
- ...s,
350
- href: ((M = a.find((p) => p.key === "href")) == null ? void 0 : M.value) || "",
351
- hrefType: ((O = a.find((p) => p.key === "data-vbtype")) == null ? void 0 : O.value) || "video",
351
+ e = {
352
+ ...e,
353
+ href: ((O = a.find((p) => p.key === "href")) == null ? void 0 : O.value) || "",
354
+ hrefType: ((M = a.find((p) => p.key === "data-vbtype")) == null ? void 0 : M.value) || "video",
352
355
  autoplay: ((V = a.find((p) => p.key === "data-autoplay")) == null ? void 0 : V.value) === "true" ? "true" : "false",
353
356
  maxWidth: ((z = (J = a.find((p) => p.key === "data-maxwidth")) == null ? void 0 : J.value) == null ? void 0 : z.replace("px", "")) || "",
354
357
  backdropColor: ((F = a.find((p) => p.key === "data-overlay")) == null ? void 0 : F.value) || "",
355
358
  galleryName: ((U = a.find((p) => p.key === "data-gall")) == null ? void 0 : U.value) || ""
356
359
  }, N(c, (p) => {
357
- A(s, `styles_attrs.${p}`) && delete s.styles_attrs[p];
360
+ P(e, `styles_attrs.${p}`) && delete e.styles_attrs[p];
358
361
  });
359
362
  }
360
- if (r && (delete s.styles_attrs, s.showDropdown = !1), D && delete s.styles_attrs, T) {
361
- delete s.styles_attrs;
362
- const c = G(t.children || [], (d) => (d == null ? void 0 : d.tagName) !== "span");
363
- s.content = H(c);
363
+ if (r && (delete e.styles_attrs, e.showDropdown = !1), D && delete e.styles_attrs, T) {
364
+ delete e.styles_attrs;
365
+ const c = Q(t.children || [], (d) => (d == null ? void 0 : d.tagName) !== "span");
366
+ e.content = j(c);
364
367
  const p = m(
365
368
  t.children || [],
366
369
  (d) => (d == null ? void 0 : d.tagName) === "span" && yt(d.children || [], (h) => (h == null ? void 0 : h.tagName) === "svg")
@@ -368,70 +371,70 @@ const Vt = rt((e) => {
368
371
  if (p) {
369
372
  const d = m(p.children || [], (h) => (h == null ? void 0 : h.tagName) === "svg");
370
373
  if (d) {
371
- s.icon = C([d]);
374
+ e.icon = C([d]);
372
375
  const { height: h, width: g } = Ct(d, "16px", "16px");
373
- s.iconHeight = h, s.iconWidth = g;
376
+ e.iconHeight = h, e.iconWidth = g;
374
377
  }
375
378
  }
376
- return [s];
379
+ return [e];
377
380
  }
378
- if (s._type === "Input") {
379
- const c = s.inputType || "text";
380
- c === "checkbox" ? w(s, "_type", "Checkbox") : c === "radio" && w(s, "_type", "Radio");
381
+ if (e._type === "Input") {
382
+ const c = e.inputType || "text";
383
+ c === "checkbox" ? w(e, "_type", "Checkbox") : c === "radio" && w(e, "_type", "Radio");
381
384
  } else if (t.tagName === "video" || t.tagName === "iframe") {
382
385
  const c = C([t]);
383
- return Et(c) && (w(s, "_type", "Video"), w(s, "url", $t(c)), w(s, "styles", `${x},`), w(s, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), s.content = c, [s];
386
+ return Et(c) && (w(e, "_type", "Video"), w(e, "url", $t(c)), w(e, "styles", `${x},`), w(e, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), e.content = c, [e];
384
387
  } else if (t.tagName === "svg") {
385
- const c = y(m(t.attributes, { key: "class" }), "value", ""), { height: p, width: d } = nt(c);
388
+ const c = y(m(t.attributes, { key: "class" }), "value", ""), { height: p, width: d } = ot(c);
386
389
  if (p && d)
387
- s.styles = `${x}, ${P(`w-${d} h-${p}`, c)}`.trim(), s.height = p == null ? void 0 : p.replace("px", ""), s.width = d == null ? void 0 : d.replace("px", "");
390
+ e.styles = `${x}, ${R(`w-${d} h-${p}`, c)}`.trim(), e.height = p == null ? void 0 : p.replace("px", ""), e.width = d == null ? void 0 : d.replace("px", "");
388
391
  else {
389
392
  const h = (Y = m(t.attributes, { key: "height" })) == null ? void 0 : Y.value, g = (K = m(t.attributes, { key: "width" })) == null ? void 0 : K.value;
390
- h && g ? (s.styles = `${x}, ${P(`w-[${g}px] h-[${h}px]`, c)}`.trim(), s.height = h, s.width = g) : s.styles = `${x}, ${P("w-full h-full", c)}`.trim();
393
+ h && g ? (e.styles = `${x}, ${R(`w-[${g}px] h-[${h}px]`, c)}`.trim(), e.height = h, e.width = g) : e.styles = `${x}, ${R("w-full h-full", c)}`.trim();
391
394
  }
392
- return t.attributes = G(t.attributes, (h) => !B(["style", "width", "height", "class"], h.key)), s.icon = C([t]), [s];
395
+ return t.attributes = Q(t.attributes, (h) => !B(["style", "width", "height", "class"], h.key)), e.icon = C([t]), [e];
393
396
  } else if (t.tagName == "option" && n && ((X = n.block) == null ? void 0 : X._type) === "Select")
394
397
  return n.block.options.push({
395
- label: H(t.children),
396
- ...tt(t)
398
+ label: j(t.children || []),
399
+ ...et(t)
397
400
  }), [];
398
- const E = j(t.children, { block: s, node: t });
399
- return [s, ...E];
400
- }), Ct = (e, n, t) => {
401
+ const E = H(t.children || [], { block: e, node: t });
402
+ return [e, ...E];
403
+ }), Ct = (s, n, t) => {
401
404
  var u, r;
402
- const s = y(e, "attributes", []), { height: a, width: o } = nt(
403
- y(m(s, { key: "class" }), "value", "")
405
+ const e = y(s, "attributes", []), { height: a, width: o } = ot(
406
+ y(m(e, { key: "class" }), "value", "")
404
407
  );
405
408
  if (a && o)
406
409
  return {
407
410
  height: `[${a}px]`,
408
411
  width: `[${o}px]`
409
412
  };
410
- const i = (u = m(s, { key: "height" })) == null ? void 0 : u.value, l = (r = m(s, { key: "width" })) == null ? void 0 : r.value;
413
+ const i = (u = m(e, { key: "height" })) == null ? void 0 : u.value, l = (r = m(e, { key: "width" })) == null ? void 0 : r.value;
411
414
  return {
412
415
  height: i ? `[${i}px]` : t,
413
416
  width: l ? `[${l}px]` : n
414
417
  };
415
- }, Lt = (e) => {
416
- e = e.replace(/(\w+)=\\?"(.*?)\\?"/g, (s, a, o) => {
418
+ }, Lt = (s) => {
419
+ s = s.replace(/(\w+)=\\?"(.*?)\\?"/g, (e, a, o) => {
417
420
  let i = o.replace(/\\"/g, '"');
418
421
  return i = i.replace(/{([^}]+)}/g, (l) => l.replace(/"/g, '\\"')), `${a}="${i.replace(/\\"/g, '"')}"`;
419
- }), e = e.replace(/\\n/g, "").replace(/\\\\/g, "").replace(/\\([/<>])/g, "$1").replace(/\\./g, "").replace(/[\n\r\t\f\v]/g, ""), e = e.replace(/\$name="[^"]*"/g, "");
420
- const n = e.match(/<body[^>]*>[\s\S]*?<\/body>/);
421
- return (n && n.length > 0 ? n[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : e).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
422
- }, Ft = (e) => {
423
- const n = _t(Lt(e));
424
- if (_(e)) return [];
425
- const t = ct(j(n));
422
+ }), s = s.replace(/\\n/g, "").replace(/\\\\/g, "").replace(/\\([/<>])/g, "$1").replace(/\\./g, "").replace(/[\n\r\t\f\v]/g, ""), s = s.replace(/\$name="[^"]*"/g, "");
423
+ const n = s.match(/<body[^>]*>[\s\S]*?<\/body>/);
424
+ return (n && n.length > 0 ? n[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : s).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
425
+ }, Ft = (s) => {
426
+ const n = _t(Lt(s));
427
+ if (_(s)) return [];
428
+ const t = pt(H(n));
426
429
  return vt(t);
427
- }, f = (e, n) => e.map((t) => {
428
- const s = R(t).filter((a) => $(t[a]) && t[a].startsWith(x));
429
- return xt(s, (a) => {
430
- t[a] = `${x},${st(t[a], n)}`;
430
+ }, f = (s, n) => s.map((t) => {
431
+ const e = W(t).filter((a) => $(t[a]) && t[a].startsWith(x));
432
+ return xt(e, (a) => {
433
+ t[a] = `${x},${at(t[a], n)}`;
431
434
  }), t;
432
435
  });
433
436
  import.meta.vitest && describe("applyDesignTokens", () => {
434
- const e = {
437
+ const s = {
435
438
  "dt#token1": { name: "primary-color", value: "bg-blue-500" },
436
439
  "dt#token2": { name: "text-size", value: "text-lg" },
437
440
  "dt#token3": { name: "spacing", value: "p-4" }
@@ -459,29 +462,29 @@ import.meta.vitest && describe("applyDesignTokens", () => {
459
462
  }
460
463
  ];
461
464
  it("should process blocks and replace style properties with generated class names", () => {
462
- const t = f(n, e);
465
+ const t = f(n, s);
463
466
  expect(t).toHaveLength(3), expect(t[0].styles).toBe("#styles:,bg-white text-sm"), expect(t[0].className).toBe("#styles:,text-lg p-4"), expect(t[0].otherProp).toBe("not-a-style"), expect(t[0]._id).toBe("block1"), expect(t[0]._type).toBe("div");
464
467
  }), it("should handle blocks with no style properties", () => {
465
- const t = f(n, e);
468
+ const t = f(n, s);
466
469
  expect(t[2].noStyles).toBe("regular-string"), expect(t[2]._id).toBe("block3");
467
470
  }), it("should handle empty blocks array", () => {
468
- const t = f([], e);
471
+ const t = f([], s);
469
472
  expect(t).toEqual([]);
470
473
  }), it("should handle empty design tokens", () => {
471
474
  const t = f(n, {});
472
475
  expect(t[0].styles).toBe("#styles:,bg-white text-sm");
473
476
  }), it("should handle blocks with only style prefix", () => {
474
- const s = f([
477
+ const e = f([
475
478
  {
476
479
  _id: "block1",
477
480
  _type: "div",
478
481
  styles: "#styles:",
479
482
  _name: "Prefix Only"
480
483
  }
481
- ], e);
482
- expect(s[0].styles).toBe("#styles:,");
484
+ ], s);
485
+ expect(e[0].styles).toBe("#styles:,");
483
486
  }), it("should handle blocks with multiple style properties", () => {
484
- const s = f([
487
+ const e = f([
485
488
  {
486
489
  _id: "block1",
487
490
  _type: "div",
@@ -490,10 +493,10 @@ import.meta.vitest && describe("applyDesignTokens", () => {
490
493
  focusStyles: "#styles:outline-none dt#token3",
491
494
  _name: "Multi Style"
492
495
  }
493
- ], e);
494
- expect(s[0].styles).toBe("#styles:,bg-white"), expect(s[0].hoverStyles).toBe("#styles:,text-lg bg-gray-100"), expect(s[0].focusStyles).toBe("#styles:,p-4 outline-none");
496
+ ], s);
497
+ expect(e[0].styles).toBe("#styles:,bg-white"), expect(e[0].hoverStyles).toBe("#styles:,text-lg bg-gray-100"), expect(e[0].focusStyles).toBe("#styles:,p-4 outline-none");
495
498
  }), it("should not modify non-string properties that start with #styles:", () => {
496
- const s = f([
499
+ const e = f([
497
500
  {
498
501
  _id: "block1",
499
502
  _type: "div",
@@ -502,10 +505,10 @@ import.meta.vitest && describe("applyDesignTokens", () => {
502
505
  arrayStyles: ["#styles:bg-red-500"],
503
506
  _name: "Non String Styles"
504
507
  }
505
- ], e);
506
- expect(s[0].styles).toBe("#styles:,bg-white"), expect(s[0].objectStyles).toEqual({ startsWith: "#styles:" }), expect(s[0].arrayStyles).toEqual(["#styles:bg-red-500"]);
508
+ ], s);
509
+ expect(e[0].styles).toBe("#styles:,bg-white"), expect(e[0].objectStyles).toEqual({ startsWith: "#styles:" }), expect(e[0].arrayStyles).toEqual(["#styles:bg-red-500"]);
507
510
  }), it("should handle undefined and null values", () => {
508
- const s = f([
511
+ const e = f([
509
512
  {
510
513
  _id: "block1",
511
514
  _type: "div",
@@ -514,11 +517,11 @@ import.meta.vitest && describe("applyDesignTokens", () => {
514
517
  undefinedStyles: void 0,
515
518
  _name: " Null Undefined"
516
519
  }
517
- ], e);
518
- expect(s[0].styles).toBe("#styles:,bg-white"), expect(s[0].nullStyles).toBeNull(), expect(s[0].undefinedStyles).toBeUndefined();
520
+ ], s);
521
+ expect(e[0].styles).toBe("#styles:,bg-white"), expect(e[0].nullStyles).toBeNull(), expect(e[0].undefinedStyles).toBeUndefined();
519
522
  }), it("should preserve block structure and non-style properties", () => {
520
- f(n, e).forEach((s, a) => {
521
- expect(s._id).toBe(n[a]._id), expect(s._type).toBe(n[a]._type), expect(s._name).toBe(n[a]._name);
523
+ f(n, s).forEach((e, a) => {
524
+ expect(e._id).toBe(n[a]._id), expect(e._type).toBe(n[a]._type), expect(e._name).toBe(n[a]._name);
522
525
  });
523
526
  }), it("should handle complex design token values", () => {
524
527
  const a = f([
@@ -548,21 +551,21 @@ import.meta.vitest && describe("applyDesignTokens", () => {
548
551
  expect(a[0].styles).toBe("#styles:,bg-white");
549
552
  });
550
553
  });
551
- const v = (e) => {
552
- const n = ft(e);
553
- return e.map((t) => {
554
- const s = Object.keys(t);
555
- for (let a = 0; a < s.length; a++)
556
- if ($(t[s[a]]) && k(s[a], "content")) {
554
+ const v = (s) => {
555
+ const n = ft(s);
556
+ return s.map((t) => {
557
+ const e = Object.keys(t);
558
+ for (let a = 0; a < e.length; a++)
559
+ if ($(t[e[a]]) && k(e[a], "content")) {
557
560
  const o = t === n ? "" : " ";
558
- t[s[a]] = `${t[s[a]].trim()}${o}`;
561
+ t[e[a]] = `${t[e[a]].trim()}${o}`;
559
562
  }
560
563
  return t;
561
564
  });
562
565
  };
563
566
  if (import.meta.vitest) {
564
- const { describe: e, it: n, expect: t } = import.meta.vitest;
565
- e("adjustSpacingInContentBlocks", () => {
567
+ const { describe: s, it: n, expect: t } = import.meta.vitest;
568
+ s("adjustSpacingInContentBlocks", () => {
566
569
  n("should add space after content fields except for the last block", () => {
567
570
  const a = v([
568
571
  { _id: "1", _type: "Text", content: "First" },
@@ -615,14 +618,14 @@ if (import.meta.vitest) {
615
618
  });
616
619
  });
617
620
  }
618
- const b = (e, n, { index: t, key: s }, a) => {
619
- if ($(e)) {
620
- let o = e;
621
- const i = /\{\{(.*?)\}\}/g, l = e.match(i);
621
+ const b = (s, n, { index: t, key: e }, a) => {
622
+ if ($(s)) {
623
+ let o = s;
624
+ const i = /\{\{(.*?)\}\}/g, l = s.match(i);
622
625
  if (l) {
623
626
  const u = a === "image" || a === "mobileImage";
624
627
  l.forEach((r) => {
625
- let T = r.slice(2, -2).trim(), D = s.slice(2, -2).trim();
628
+ let T = r.slice(2, -2).trim(), D = e.slice(2, -2).trim();
626
629
  t !== -1 && k(T, "$index.") ? T = `${D}.${t}.${T.slice(7)}` : t !== -1 && k(T, "$index") && (T = `${D}.${t}`);
627
630
  const E = y(n, T);
628
631
  E === void 0 ? o = o.replace(r, "") : u && !I(E) ? o = E : o = I(E) ? E : o.replace(r, E);
@@ -630,18 +633,23 @@ const b = (e, n, { index: t, key: s }, a) => {
630
633
  }
631
634
  return o;
632
635
  }
633
- if (I(e))
634
- return e.map((o) => b(o, n, { index: t, key: s }, a));
635
- if (e && typeof e == "object") {
636
+ if (I(s))
637
+ return s.map((o) => b(o, n, { index: t, key: e }, a));
638
+ if (s && typeof s == "object") {
636
639
  const o = {};
637
- return N(R(e), (i) => {
638
- !k(i, "_") && i !== "$repeaterItemsKey" ? o[i] = b(e[i], n, { index: t, key: s }, i) : o[i] = e[i];
640
+ return N(W(s), (i) => {
641
+ !k(i, "_") && i !== "$repeaterItemsKey" ? o[i] = b(
642
+ s[i],
643
+ n,
644
+ { index: t, key: e },
645
+ i
646
+ ) : o[i] = s[i];
639
647
  }), o;
640
648
  }
641
- return e;
642
- }, L = (e, n, { index: t, key: s }) => {
643
- let a = q(e);
644
- return a.repeaterItems && (a.$repeaterItemsKey = a.repeaterItems, k(a.repeaterItems, `{{${Bt}`) && (a.$repeaterItemsKey = a.repeaterItems = `${a.repeaterItems.replace("}}", `/${a._id}}}`)}`), !_(a.repeaterItems) && a.pagination && (a.repeaterTotalItems = `${a.repeaterItems.replace("}}", `/${a._id}/totalItems}}`)}`)), b(a, n, { index: t, key: s });
649
+ return s;
650
+ }, L = (s, n, { index: t, key: e }) => {
651
+ let a = q(s);
652
+ return a.repeaterItems && (a.$repeaterItemsKey = a.repeaterItems, k(a.repeaterItems, `{{${Bt}`) && (a.$repeaterItemsKey = a.repeaterItems = `${a.repeaterItems.replace("}}", `/${a._id}}}`)}`), !_(a.repeaterItems) && a.pagination && (a.repeaterTotalItems = `${a.repeaterItems.replace("}}", `/${a._id}/totalItems}}`)}`)), b(a, n, { index: t, key: e });
645
653
  };
646
654
  import.meta.vitest && (describe("applyBindingToValue", () => {
647
655
  it("should handle string values with bindings", () => {
@@ -816,18 +824,18 @@ import.meta.vitest && (describe("applyBindingToValue", () => {
816
824
  }));
817
825
  export {
818
826
  Bt as C,
819
- Q as D,
827
+ tt as D,
820
828
  qt as R,
821
829
  x as S,
822
830
  L as a,
823
- Mt as b,
824
- Ot as c,
831
+ Ot as b,
832
+ Mt as c,
825
833
  Vt as d,
826
834
  Jt as e,
827
835
  v as f,
828
836
  Ft as g,
829
837
  zt as h,
830
838
  f as i,
831
- et as j,
832
- jt as k
839
+ st as j,
840
+ Ht as k
833
841
  };