@chaibuilder/sdk 1.2.26 → 1.2.28

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 (81) hide show
  1. package/dist/{AddBlocks-l1JENNvq.js → AddBlocks-0sW6gkCO.js} +5 -5
  2. package/dist/AddBlocks-YJPdSqcY.cjs +1 -0
  3. package/dist/{BrandingOptions-udtH5yJs.js → BrandingOptions--vgnQvD1.js} +8 -8
  4. package/dist/{BrandingOptions-DkpqGARR.cjs → BrandingOptions-RDn_Nhcq.cjs} +1 -1
  5. package/dist/CanvasArea-41QoxuLf.cjs +55 -0
  6. package/dist/CanvasArea-aii0PyU-.js +1179 -0
  7. package/dist/{Class-lGzsNBOK.js → Class-6Hz2KzYb.js} +1 -1
  8. package/dist/{Class-PoYusiA5.cjs → Class-Zc8hpE7f.cjs} +1 -1
  9. package/dist/{CurrentPage-tJUjXWdb.js → CurrentPage-06Iacwyp.js} +6 -6
  10. package/dist/{CurrentPage-Hl52iub_.cjs → CurrentPage-2W1pdAOG.cjs} +1 -1
  11. package/dist/ListTree-DnA8gj-7.js +314 -0
  12. package/dist/ListTree-pdQ14QJC.cjs +1 -0
  13. package/dist/MODIFIERS-YPHRtwrM.cjs +1 -0
  14. package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-cBT31iqE.js} +3 -11
  15. package/dist/{PagesPanel-WzCocl6u.cjs → PagesPanel-PBFzPSNY.cjs} +1 -1
  16. package/dist/{PagesPanel-6rrLXEO-.js → PagesPanel-_1CDTUdE.js} +7 -7
  17. package/dist/{ProjectPanel-o7gdcwPn.cjs → ProjectPanel-755bbzEQ.cjs} +1 -1
  18. package/dist/{ProjectPanel-tz3bjdXy.js → ProjectPanel-pUMeIiUW.js} +7 -7
  19. package/dist/Settings-G9Xtqr7n.cjs +1 -0
  20. package/dist/{Settings-4s2LUVmC.js → Settings-dnO-s6x0.js} +596 -560
  21. package/dist/{SidePanels-3o6Okmvu.cjs → SidePanels-Gq2LdVuY.cjs} +1 -1
  22. package/dist/{SidePanels-bugFfInz.js → SidePanels-VxSXXkt_.js} +56 -56
  23. package/dist/{Topbar-pWzBEOed.js → Topbar-5zbOSGF6.js} +3 -3
  24. package/dist/{Topbar-CqW7G360.cjs → Topbar-J2tb4SA1.cjs} +1 -1
  25. package/dist/{UnsplashImages-qvwFbV-E.js → UnsplashImages-4WAWgA4s.js} +9 -9
  26. package/dist/{UnsplashImages-NGskB93R.cjs → UnsplashImages-XwjKheek.cjs} +1 -1
  27. package/dist/{UploadImages-9NapgXBq.js → UploadImages-PONIHtn6.js} +3 -3
  28. package/dist/{UploadImages-Oh7Glr9A.cjs → UploadImages-y7LAQVrT.cjs} +1 -1
  29. package/dist/{add-page-modal-k2Kb92HS.js → add-page-modal-4VrFvgEm.js} +7 -7
  30. package/dist/{add-page-modal--6TTBRYa.cjs → add-page-modal-jWcp0w-S.cjs} +1 -1
  31. package/dist/{confirm-alert-C4M9eF-o.cjs → confirm-alert-4OQlXZTJ.cjs} +1 -1
  32. package/dist/{confirm-alert-GUhZ_G8w.js → confirm-alert-j7b88hsW.js} +3 -3
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +4 -4
  35. package/dist/{delete-page-modal-zONvdebd.js → delete-page-modal--xHHdRAq.js} +6 -6
  36. package/dist/{delete-page-modal-cFoL-wdo.cjs → delete-page-modal-p6b0upz4.cjs} +1 -1
  37. package/dist/email-blocks.cjs +1 -1
  38. package/dist/email-blocks.js +1 -1
  39. package/dist/email.cjs +1 -1
  40. package/dist/email.js +4 -4
  41. package/dist/{form-STUz-6nE.js → form-_GJb9YcB.js} +1 -1
  42. package/dist/{form-lBQ_76Uw.cjs → form-jQj7E-hS.cjs} +1 -1
  43. package/dist/html-to-json-LJyJsnmZ.js +228 -0
  44. package/dist/html-to-json-vP1ESB_e.cjs +1 -0
  45. package/dist/{index-SkyM3d6Q.js → index-0QJwevON.js} +2 -2
  46. package/dist/index-12HbDLon.cjs +1 -0
  47. package/dist/{index-llTXLDGE.js → index-Eb5zyh2F.js} +4 -4
  48. package/dist/{index-mbyqq81O.cjs → index-KArv7pNz.cjs} +1 -1
  49. package/dist/{index-Gk6sASBd.js → index-UHaqEdws.js} +993 -957
  50. package/dist/{index-OB199Izc.cjs → index-mlMvwv2b.cjs} +2 -2
  51. package/dist/lib.cjs +1 -1
  52. package/dist/lib.js +4 -4
  53. package/dist/{page-viewer-Pdg9F5Hv.js → page-viewer-00Xx4u8e.js} +7 -7
  54. package/dist/{page-viewer-2kwnKM6v.cjs → page-viewer-SZNm7b1n.cjs} +1 -1
  55. package/dist/{project-general-setting-CnNL98NM.cjs → project-general-setting-C_pHNuZE.cjs} +1 -1
  56. package/dist/{project-general-setting-f8Ebsn6K.js → project-general-setting-asDxlmhZ.js} +7 -7
  57. package/dist/{project-seo-setting-pX34Qsym.js → project-seo-setting-DuAaDfDR.js} +4 -4
  58. package/dist/{project-seo-setting-mlxL_e2_.cjs → project-seo-setting-q2953ybQ.cjs} +1 -1
  59. package/dist/render.cjs +1 -1
  60. package/dist/render.js +1 -1
  61. package/dist/{single-page-detail-dpe5LT0M.js → single-page-detail-UNxXvhl4.js} +14 -14
  62. package/dist/{single-page-detail-XfzrGlzA.cjs → single-page-detail-oqj6zsLU.cjs} +1 -1
  63. package/dist/studio.cjs +1 -1
  64. package/dist/studio.js +6 -6
  65. package/dist/ui.cjs +1 -1
  66. package/dist/ui.js +9 -9
  67. package/dist/useCanvasSettings-MR0Glu1b.cjs +1 -0
  68. package/dist/useCanvasSettings-R6br4J9i.js +6 -0
  69. package/dist/web-blocks.cjs +33 -6
  70. package/dist/web-blocks.js +461 -388
  71. package/package.json +1 -1
  72. package/dist/AddBlocks-zPPKkeKs.cjs +0 -1
  73. package/dist/CanvasArea-h0W-Tyha.js +0 -951
  74. package/dist/CanvasArea-zme1r3Zi.cjs +0 -55
  75. package/dist/ListTree-WvTjY5rr.cjs +0 -1
  76. package/dist/ListTree-cZ-Ihlt3.js +0 -309
  77. package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
  78. package/dist/Settings-AqoKwR92.cjs +0 -1
  79. package/dist/html-to-json-efmv1pCj.cjs +0 -1
  80. package/dist/html-to-json-ngX9ef2u.js +0 -185
  81. package/dist/index-h-hd6EvN.cjs +0 -1
@@ -1,28 +1,29 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import * as de from "react";
3
- import $, { useState as w, useMemo as _, useEffect as L, useCallback as V, memo as mt, createContext as Ke, useContext as oe } from "react";
3
+ import $, { useState as w, useMemo as _, useEffect as L, useCallback as H, memo as bt, createContext as Ke, useContext as ae } from "react";
4
4
  import { useThrottledCallback as fe } from "@react-hookz/web";
5
- import { forEach as Re, isArray as pe, omit as bt, truncate as ft, includes as M, get as x, first as ae, split as vt, startCase as E, toLower as le, isEmpty as b, map as k, find as jt, last as wt, filter as ve, set as Ge, debounce as Ct, keys as je, cloneDeep as kt, each as Nt, capitalize as we, reject as _t, nth as $e, startsWith as G, isNumber as Tt, parseInt as St, isNaN as qe, findLast as Rt, flatten as q, intersection as Je, has as ce, kebabCase as Vt, isNull as Ht } from "lodash-es";
5
+ import { forEach as Re, isArray as ue, omit as ft, truncate as vt, includes as M, get as g, first as oe, split as jt, startCase as E, toLower as le, isEmpty as b, map as k, find as Ge, last as wt, filter as ve, set as qe, debounce as Ct, keys as je, cloneDeep as kt, each as Nt, capitalize as we, reject as _t, nth as $e, startsWith as W, isNumber as St, parseInt as Tt, isNaN as Je, findLast as Rt, flatten as q, intersection as Qe, has as ce, kebabCase as Vt, isNull as Ht } from "lodash-es";
6
6
  import { useTranslation as z } from "react-i18next";
7
- import { PlusIcon as Ve, Cross2Icon as Qe, EyeOpenIcon as Dt, EyeClosedIcon as Ae, BorderAllIcon as A, WidthIcon as S, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as Bt, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as It, ArrowBottomLeftIcon as $t, AlignLeftIcon as At, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Et, StretchHorizontallyIcon as Lt, FontItalicIcon as Ot, UnderlineIcon as Ft, OverlineIcon as Yt, LetterCaseUppercaseIcon as zt, Cross1Icon as Xt, InfoCircledIcon as He, MinusIcon as Zt, BoxIcon as et, RowSpacingIcon as Wt, TriangleDownIcon as Ut, CrossCircledIcon as Kt, CaretDownIcon as Gt, MixerHorizontalIcon as tt } from "@radix-ui/react-icons";
8
- import { aV as qt, aW as Jt, B as U, aX as Qt, aY as er, aZ as tr, a_ as rr, a$ as sr, b0 as lr, b1 as or, a1 as K, af as ar, ag as nr, ah as ir, b2 as dr, ad as cr, ao as pr, ae as ur, ap as O, aq as F, ar as Y, b3 as xr, b4 as gr, b5 as hr, b6 as yr, b7 as mr, b8 as br, a6 as rt, a5 as st, h as fr, b9 as lt, ba as Ce, bb as ke, bc as Ne, ac as ue, M as De, _ as ot, r as at, aB as nt, bd as _e, v as vr, be as jr, $ as xe, V as wr, a4 as it, N as Me, aG as Cr, aH as kr, aI as Nr, bf as Be, aJ as Ee, aK as Le, bg as Oe, bh as Fe, bi as Ye, a7 as _r, aj as Tr, ak as Sr, al as Rr, am as Vr, an as H, au as Hr, av as Dr, aw as he, ax as ye } from "./index-Gk6sASBd.js";
9
- import { u as Br } from "./controls-OfJWSEqC.js";
10
- import { Check as Pr, EditIcon as Ir, TrashIcon as $r, BrushIcon as Ar, DeleteIcon as Mr } from "lucide-react";
11
- import { getBlockComponent as Pe, getChaiDataProviders as Er, useGlobalStylingPresets as Lr } from "@chaibuilder/runtime";
12
- import { E as dt, u as ct } from "./index-SkyM3d6Q.js";
13
- import { J as Or, a as Fr, d as Yr } from "./index-e0c8PmRQ.js";
14
- import zr from "@rjsf/core";
15
- import Xr from "@rjsf/validator-ajv8";
16
- import Zr from "react-autosuggest";
17
- import Wr from "fuse.js";
18
- import { A as Ur, C as ge, g as Kr } from "./Class-lGzsNBOK.js";
19
- import { a as Gr } from "./STRINGS--j49GZJP.js";
7
+ import { PlusIcon as Ve, Cross2Icon as et, EyeOpenIcon as Dt, EyeClosedIcon as Ae, BorderAllIcon as A, WidthIcon as T, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as Bt, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as It, ArrowBottomLeftIcon as $t, AlignLeftIcon as At, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Et, StretchHorizontallyIcon as Lt, FontItalicIcon as Ot, UnderlineIcon as Ft, OverlineIcon as Yt, LetterCaseUppercaseIcon as zt, Cross1Icon as Xt, InfoCircledIcon as He, MinusIcon as Zt, BoxIcon as tt, RowSpacingIcon as Wt, TriangleDownIcon as Ut, CrossCircledIcon as Kt, CaretDownIcon as Gt, MixerHorizontalIcon as rt } from "@radix-ui/react-icons";
8
+ import { aW as qt, aX as Jt, B as K, aY as Qt, aZ as er, a_ as tr, a$ as rr, b0 as sr, b1 as lr, b2 as ar, a1 as G, af as or, ag as nr, ah as ir, b3 as dr, ad as cr, ao as pr, ae as ur, ap as O, aq as F, ar as Y, b4 as xr, b5 as gr, b6 as hr, b7 as yr, b8 as mr, b9 as br, ba as fr, a6 as st, a5 as lt, h as vr, bb as at, bc as Ce, bd as ke, be as Ne, ac as xe, M as De, _ as ot, r as nt, aB as it, bf as _e, v as jr, bg as wr, $ as ge, V as Cr, a4 as dt, N as Me, aG as kr, aH as Nr, aI as _r, bh as Be, aJ as Ee, aK as Le, bi as Oe, bj as Fe, bk as Ye, a7 as Sr, bl as Tr, aj as Rr, ak as Vr, al as Hr, am as Dr, an as V, bm as Br, au as Pr, av as Ir, aw as ye, ax as me } from "./index-UHaqEdws.js";
9
+ import { u as $r } from "./controls-OfJWSEqC.js";
10
+ import { Check as Ar, EditIcon as Mr, TrashIcon as Er, BrushIcon as Lr, DeleteIcon as Or } from "lucide-react";
11
+ import { getBlockComponent as Pe, getChaiDataProviders as Fr, useGlobalStylingPresets as Yr } from "@chaibuilder/runtime";
12
+ import { E as ct, u as pt } from "./index-0QJwevON.js";
13
+ import { J as zr, a as Xr, d as Zr } from "./index-e0c8PmRQ.js";
14
+ import Wr from "@rjsf/core";
15
+ import Ur from "@rjsf/validator-ajv8";
16
+ import { u as Kr } from "./useCanvasSettings-R6br4J9i.js";
17
+ import Gr from "react-autosuggest";
18
+ import qr from "fuse.js";
19
+ import { A as Jr, C as he, g as Qr } from "./Class-6Hz2KzYb.js";
20
+ import { a as es } from "./STRINGS--j49GZJP.js";
20
21
  import "./_commonjsHelpers-UyOWmZb0.js";
21
22
  import "./Functions-7jnEwJyw.js";
22
23
  import "clsx";
23
24
  import "tailwind-merge";
24
25
  import "jotai";
25
- import "./MODIFIERS-dytZ-osO.js";
26
+ import "./MODIFIERS-cBT31iqE.js";
26
27
  import "@radix-ui/react-toggle";
27
28
  import "class-variance-authority";
28
29
  import "@radix-ui/react-switch";
@@ -50,29 +51,29 @@ import "i18next";
50
51
  import "@floating-ui/react-dom";
51
52
  import "flagged";
52
53
  import "react-hotkeys-hook";
53
- function qr(r) {
54
- const s = [], t = {};
55
- function d(l, n) {
56
- Re(n, (o, p) => {
57
- const i = l ? `${l}.${p}` : p, c = pe(o) ? "list" : typeof o;
58
- s.push(i), t[i] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !pe(o) && d(i, o);
54
+ function ts(r) {
55
+ const l = [], t = {};
56
+ function i(s, n) {
57
+ Re(n, (a, d) => {
58
+ const o = s ? `${s}.${d}` : d, c = ue(a) ? "list" : typeof a;
59
+ l.push(o), t[o] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !ue(a) && i(o, a);
59
60
  });
60
61
  }
61
- return d("", bt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
62
+ return i("", ft(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: l, pathsType: t };
62
63
  }
63
- const Te = ({ data: r, fullView: s }) => {
64
+ const Se = ({ data: r, fullView: l }) => {
64
65
  if (!r)
65
66
  return null;
66
67
  const t = typeof r;
67
- return s ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
68
+ return l ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
68
69
  /* @__PURE__ */ e.jsx("div", { className: "h-3" }),
69
- /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(
70
- Or,
70
+ /* @__PURE__ */ e.jsx(ct, { children: /* @__PURE__ */ e.jsx(
71
+ zr,
71
72
  {
72
73
  data: r,
73
- shouldExpandNode: Fr,
74
+ shouldExpandNode: Xr,
74
75
  style: {
75
- ...Yr,
76
+ ...Zr,
76
77
  container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
77
78
  stringValue: "text-orange-600",
78
79
  label: "text-green-900 font-semibold pr-1 tracking-wider"
@@ -82,35 +83,35 @@ const Te = ({ data: r, fullView: s }) => {
82
83
  ] }) : /* @__PURE__ */ e.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
83
84
  /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
84
85
  r
85
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: ft(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
86
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: vt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
86
87
  }, ze = ({
87
88
  type: r,
88
- value: s = "",
89
+ value: l = "",
89
90
  setValue: t,
90
- data: d,
91
- onChange: l,
91
+ data: i,
92
+ onChange: s,
92
93
  dataType: n,
93
- appliedBindings: o
94
+ appliedBindings: a
94
95
  }) => {
95
- const { paths: p, pathsType: i } = qr(d), c = r === "PROP" ? Pe(d == null ? void 0 : d._type) : {}, h = r === "PROP", [a, g] = w(!1), y = _(() => r === "PROP" ? p.filter(
96
- (u) => !M(o, u) && x(c, `props.${ae(vt(u, "."))}.binding`)
97
- ) : p.filter((u) => n === x(i, u, "")), [r, p, o, n, c]);
96
+ const { paths: d, pathsType: o } = ts(i), c = r === "PROP" ? Pe(i == null ? void 0 : i._type) : {}, h = r === "PROP", [p, x] = w(!1), y = _(() => r === "PROP" ? d.filter(
97
+ (u) => !M(a, u) && g(c, `props.${oe(jt(u, "."))}.binding`)
98
+ ) : d.filter((u) => n === g(o, u, "")), [r, d, a, n, c]);
98
99
  return L(() => {
99
- s && l(s);
100
- }, [s, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
100
+ l && s(l);
101
+ }, [l, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
101
102
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
102
103
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: E(le(r)) }),
103
- /* @__PURE__ */ e.jsxs(qt, { open: a, onOpenChange: g, children: [
104
+ /* @__PURE__ */ e.jsxs(qt, { open: p, onOpenChange: x, children: [
104
105
  /* @__PURE__ */ e.jsx(Jt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
105
- U,
106
+ K,
106
107
  {
107
108
  variant: "outline",
108
109
  size: "sm",
109
- className: ` ${b(s) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
110
- children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
110
+ className: ` ${b(l) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
111
+ children: l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
111
112
  /* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
112
113
  h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: E(n) }),
113
- s
114
+ l
114
115
  ] }),
115
116
  /* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
116
117
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -124,19 +125,19 @@ const Te = ({ data: r, fullView: s }) => {
124
125
  /* @__PURE__ */ e.jsxs(rr, { children: [
125
126
  /* @__PURE__ */ e.jsx(sr, { children: "No results found." }),
126
127
  /* @__PURE__ */ e.jsx(lr, { children: k(y, (u) => /* @__PURE__ */ e.jsxs(
127
- or,
128
+ ar,
128
129
  {
129
130
  value: u,
130
131
  className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
131
132
  onSelect: (f) => {
132
- t(jt(y, (j) => j === f) || null), g(!1);
133
+ t(Ge(y, (j) => j === f) || null), x(!1);
133
134
  },
134
135
  children: [
135
136
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
136
- /* @__PURE__ */ e.jsx(Pr, { className: `h-4 w-4 text-green-500 ${s === u ? "" : "opacity-0"}` }),
137
+ /* @__PURE__ */ e.jsx(Ar, { className: `h-4 w-4 text-green-500 ${l === u ? "" : "opacity-0"}` }),
137
138
  u
138
139
  ] }),
139
- h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: E(x(i, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(Te, { data: x(d, u) }) })
140
+ h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: E(g(o, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(Se, { data: g(i, u) }) })
140
141
  ]
141
142
  },
142
143
  u
@@ -145,30 +146,30 @@ const Te = ({ data: r, fullView: s }) => {
145
146
  ] }) })
146
147
  ] })
147
148
  ] }),
148
- !h && !b(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Te, { data: x(d, s, ""), fullView: !0 }) })
149
+ !h && !b(l) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Se, { data: g(i, l, ""), fullView: !0 }) })
149
150
  ] });
150
- }, Jr = ({
151
+ }, rs = ({
151
152
  appliedBindings: r = [],
152
- onAddBinding: s,
153
+ onAddBinding: l,
153
154
  editMode: t,
154
- item: d
155
+ item: i
155
156
  }) => {
156
- const [l, n] = w(t ? d.key : ""), [o, p] = w(t ? d.value : ""), i = K(), [c] = ct(), h = V(
157
+ const [s, n] = w(t ? i.key : ""), [a, d] = w(t ? i.value : ""), o = G(), [c] = pt(), h = H(
157
158
  (y, u) => {
158
159
  if (b(y))
159
160
  return "";
160
161
  {
161
- const f = x(u === "PROP" ? i : c, y, "");
162
- if (pe(f))
162
+ const f = g(u === "PROP" ? o : c, y, "");
163
+ if (ue(f))
163
164
  return "list";
164
165
  const j = typeof f;
165
166
  return j === "string" ? "text" : j === "object" ? "model" : j;
166
167
  }
167
168
  },
168
- [i, c]
169
- ), [a, g] = w(t ? h(d.key, "PROP") : "");
169
+ [o, c]
170
+ ), [p, x] = w(t ? h(i.key, "PROP") : "");
170
171
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
171
- /* @__PURE__ */ e.jsxs(ar, { children: [
172
+ /* @__PURE__ */ e.jsxs(or, { children: [
172
173
  /* @__PURE__ */ e.jsx(nr, { children: "Add Data Binding" }),
173
174
  /* @__PURE__ */ e.jsx(ir, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
174
175
  ] }),
@@ -179,14 +180,14 @@ const Te = ({ data: r, fullView: s }) => {
179
180
  type: "PROP",
180
181
  isDisabled: !1,
181
182
  placeholder: "Enter prop key",
182
- value: l,
183
+ value: s,
183
184
  setValue: n,
184
185
  onChange: (y) => {
185
186
  const u = h(y, "PROP");
186
- n(y), a !== u && p(""), g(u);
187
+ n(y), p !== u && d(""), x(u);
187
188
  },
188
- data: i,
189
- dataType: a,
189
+ data: o,
190
+ dataType: p,
190
191
  appliedBindings: r
191
192
  }
192
193
  ),
@@ -195,166 +196,166 @@ const Te = ({ data: r, fullView: s }) => {
195
196
  ze,
196
197
  {
197
198
  type: "PATH",
198
- isDisabled: b(l),
199
+ isDisabled: b(s),
199
200
  placeholder: "Enter data path",
200
- value: o,
201
- setValue: p,
201
+ value: a,
202
+ setValue: d,
202
203
  onChange: (y) => {
203
204
  const u = h(y, "PATH");
204
- p(a === u ? y : "");
205
+ d(p === u ? y : "");
205
206
  },
206
207
  data: c,
207
- dataType: a,
208
+ dataType: p,
208
209
  appliedBindings: r
209
210
  }
210
211
  )
211
212
  ] }),
212
213
  /* @__PURE__ */ e.jsx(dr, { children: /* @__PURE__ */ e.jsx(
213
- U,
214
+ K,
214
215
  {
215
216
  type: "submit",
216
217
  className: "mt-4",
217
- disabled: b(l) && b(o),
218
- onClick: () => s({ key: l, value: o }),
218
+ disabled: b(s) && b(a),
219
+ onClick: () => l({ key: s, value: a }),
219
220
  children: "Save"
220
221
  }
221
222
  ) })
222
223
  ] });
223
- }, pt = ({ disabled: r, children: s, onAddBinding: t, appliedBindings: d, editMode: l = !0, item: n = {} }) => {
224
- const [o, p] = w(!1);
224
+ }, ut = ({ disabled: r, children: l, onAddBinding: t, appliedBindings: i, editMode: s = !0, item: n = {} }) => {
225
+ const [a, d] = w(!1);
225
226
  return /* @__PURE__ */ e.jsxs(cr, { children: [
226
- /* @__PURE__ */ e.jsx(pr, { disabled: r, asChild: !0, onClick: () => p(!0), children: s }),
227
- o && /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
228
- Jr,
227
+ /* @__PURE__ */ e.jsx(pr, { disabled: r, asChild: !0, onClick: () => d(!0), children: l }),
228
+ a && /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
229
+ rs,
229
230
  {
230
231
  item: n,
231
- editMode: l,
232
- appliedBindings: d,
233
- onAddBinding: (i) => {
234
- t(i), p(!1);
232
+ editMode: s,
233
+ appliedBindings: i,
234
+ onAddBinding: (o) => {
235
+ t(o), d(!1);
235
236
  }
236
237
  }
237
238
  ) })
238
239
  ] });
239
- }, Qr = ({
240
+ }, ss = ({
240
241
  item: r,
241
- onAddBinding: s,
242
+ onAddBinding: l,
242
243
  onRemove: t,
243
- selectedBlock: d,
244
- dataProvider: l,
244
+ selectedBlock: i,
245
+ dataProvider: s,
245
246
  appliedBindings: n
246
247
  }) => {
247
- const [o, p] = w("string"), i = (c, h) => {
248
+ const [a, d] = w("string"), o = (c, h) => {
248
249
  if (b(c))
249
250
  return "";
250
251
  {
251
- const a = x(h === "PROP" ? d : l, c, "");
252
- if (pe(a))
252
+ const p = g(h === "PROP" ? i : s, c, "");
253
+ if (ue(p))
253
254
  return "list";
254
- const g = typeof a;
255
- return g === "string" ? "text" : g === "object" ? "model" : g;
255
+ const x = typeof p;
256
+ return x === "string" ? "text" : x === "object" ? "model" : x;
256
257
  }
257
258
  };
258
- return L(() => p(() => i(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
259
+ return L(() => d(() => o(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
259
260
  /* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
260
261
  /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
261
- /* @__PURE__ */ e.jsx(Te, { data: x(l, r.value, "") }),
262
+ /* @__PURE__ */ e.jsx(Se, { data: g(s, r.value, "") }),
262
263
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
263
- /* @__PURE__ */ e.jsx(pt, { editMode: !0, onAddBinding: s, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(Ir, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
264
+ /* @__PURE__ */ e.jsx(ut, { editMode: !0, onAddBinding: l, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(Mr, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
264
265
  /* @__PURE__ */ e.jsx(
265
- $r,
266
+ Er,
266
267
  {
267
268
  onClick: () => t(),
268
269
  className: "mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"
269
270
  }
270
271
  )
271
272
  ] }),
272
- !b(o) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: E(o) })
273
+ !b(a) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: E(a) })
273
274
  ] });
274
- }, es = ({ bindingData: r, onChange: s }) => {
275
- const t = K(), [d] = ct(), l = Er(), [n, o] = w(
276
- k(r, (a, g) => ({ key: g, value: a }))
275
+ }, ls = ({ bindingData: r, onChange: l }) => {
276
+ const t = G(), [i] = pt(), s = Fr(), [n, a] = w(
277
+ k(r, (p, x) => ({ key: x, value: p }))
277
278
  );
278
279
  L(() => {
279
- o(k(r, (a, g) => ({ key: g, value: a })));
280
+ a(k(r, (p, x) => ({ key: x, value: p })));
280
281
  }, [t == null ? void 0 : t._id, r]);
281
- const p = _(() => {
282
- if (b(d))
282
+ const d = _(() => {
283
+ if (b(i))
283
284
  return !0;
284
285
  if (b(n))
285
286
  return !1;
286
- const a = wt(n);
287
- return b(a == null ? void 0 : a.key) || b(a == null ? void 0 : a.value);
288
- }, [d, n]), i = (a) => {
289
- const g = ve(n, (y) => y.key !== a.key);
290
- o([...g, a]), h([...g, a]);
291
- }, c = (a) => {
292
- const g = ve(n, (y, u) => a !== u);
293
- h([...g]);
294
- }, h = V(
295
- (a = []) => {
296
- if (o(a), b(a)) {
297
- s({});
287
+ const p = wt(n);
288
+ return b(p == null ? void 0 : p.key) || b(p == null ? void 0 : p.value);
289
+ }, [i, n]), o = (p) => {
290
+ const x = ve(n, (y) => y.key !== p.key);
291
+ a([...x, p]), h([...x, p]);
292
+ }, c = (p) => {
293
+ const x = ve(n, (y, u) => p !== u);
294
+ h([...x]);
295
+ }, h = H(
296
+ (p = []) => {
297
+ if (a(p), b(p)) {
298
+ l({});
298
299
  return;
299
300
  }
300
- const g = {};
301
- Re(a, (y) => {
302
- !b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && Ge(g, y.key, y.value);
303
- }), s(g);
301
+ const x = {};
302
+ Re(p, (y) => {
303
+ !b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && qe(x, y.key, y.value);
304
+ }), l(x);
304
305
  },
305
- [s]
306
+ [l]
306
307
  );
307
- return b(l) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
308
+ return b(s) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
308
309
  "You have no data providers registered. Please add a data provider to your project. ",
309
310
  /* @__PURE__ */ e.jsx("br", {}),
310
311
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
311
312
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
312
- k(n, (a, g) => /* @__PURE__ */ e.jsx(
313
- Qr,
313
+ k(n, (p, x) => /* @__PURE__ */ e.jsx(
314
+ ss,
314
315
  {
315
- item: a,
316
- onAddBinding: i,
317
- onRemove: () => c(g),
316
+ item: p,
317
+ onAddBinding: o,
318
+ onRemove: () => c(x),
318
319
  selectedBlock: t,
319
- dataProvider: d,
320
+ dataProvider: i,
320
321
  appliedBindings: k(n, "key")
321
322
  },
322
- a.key
323
+ p.key
323
324
  )),
324
325
  /* @__PURE__ */ e.jsxs(O, { delayDuration: 200, children: [
325
- /* @__PURE__ */ e.jsx(F, { disabled: b(d), className: "w-full", children: /* @__PURE__ */ e.jsx(
326
- pt,
326
+ /* @__PURE__ */ e.jsx(F, { disabled: b(i), className: "w-full", children: /* @__PURE__ */ e.jsx(
327
+ ut,
327
328
  {
328
- disabled: p,
329
+ disabled: d,
329
330
  appliedBindings: k(n, "key"),
330
- onAddBinding: i,
331
+ onAddBinding: o,
331
332
  children: /* @__PURE__ */ e.jsx(
332
333
  "span",
333
334
  {
334
- className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${p ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
335
- children: b(d) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
335
+ className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${d ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
336
+ children: b(i) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
336
337
  }
337
338
  )
338
339
  }
339
340
  ) }),
340
- p && /* @__PURE__ */ e.jsx(Y, { sideOffset: -55, className: "text-[11px]", children: b(d) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
341
+ d && /* @__PURE__ */ e.jsx(Y, { sideOffset: -55, className: "text-[11px]", children: b(i) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
341
342
  ] })
342
343
  ] });
343
- }, ts = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), me = mt(({ id: r, properties: s, formData: t, onChange: d }) => {
344
- const [l, n] = w(t), o = { type: "object", properties: {} }, p = {};
345
- return Object.keys(s).forEach((i) => {
346
- const c = s[i];
344
+ }, as = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), pe = bt(({ id: r, properties: l, formData: t, onChange: i }) => {
345
+ const [s, n] = w(t), a = { type: "object", properties: {} }, d = {};
346
+ return Object.keys(l).forEach((o) => {
347
+ const c = l[o];
347
348
  if (M(["slot", "styles"], c.type))
348
349
  return;
349
- const h = i;
350
- o.properties[h] = xr(c), p[h] = gr(c);
350
+ const h = o;
351
+ a.properties[h] = xr(c), d[h] = gr(c);
351
352
  }), L(() => {
352
353
  n(t);
353
354
  }, [r]), /* @__PURE__ */ e.jsx(
354
- zr,
355
+ Wr,
355
356
  {
356
357
  widgets: {
357
- binding: ts,
358
+ binding: as,
358
359
  richtext: hr,
359
360
  icon: yr,
360
361
  image: mr
@@ -365,61 +366,84 @@ const Te = ({ data: r, fullView: s }) => {
365
366
  omitExtraData: !1,
366
367
  liveOmit: !1,
367
368
  liveValidate: !1,
368
- validator: Xr,
369
- uiSchema: p,
370
- schema: o,
371
- formData: l,
372
- onChange: ({ formData: i }, c) => {
373
- c && (n(i), d({ formData: i }, c));
369
+ validator: Ur,
370
+ uiSchema: d,
371
+ schema: a,
372
+ formData: s,
373
+ onChange: ({ formData: o }, c) => {
374
+ c && (n(o), i({ formData: o }, c));
374
375
  }
375
376
  }
376
377
  );
377
- });
378
- function rs() {
379
- const r = K(), s = rt(), t = st(), d = Pe(r._type), l = { ...r }, [n, o] = w(l), p = fr("dataBindingSupport", !1), i = ({ formData: u }, f, j) => {
378
+ }), os = () => {
379
+ const [r, l] = Kr(), t = fr(), i = (a, d) => {
380
+ l((o) => ({ ...o, [a]: d }));
381
+ };
382
+ if (b(t))
383
+ return null;
384
+ const { block: s, settings: n } = t;
385
+ return /* @__PURE__ */ e.jsxs("div", { className: "text-xs hover:no-underline", children: [
386
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 bg-gray-100 px-4 py-2", children: [
387
+ t.block._type,
388
+ " settings"
389
+ ] }),
390
+ /* @__PURE__ */ e.jsx("div", { className: "bg-white pb-2", children: /* @__PURE__ */ e.jsx(
391
+ pe,
392
+ {
393
+ id: s == null ? void 0 : s._id,
394
+ onChange: ({ formData: a }) => i(s._id, a),
395
+ formData: g(r, s._id, {}),
396
+ properties: n
397
+ }
398
+ ) })
399
+ ] });
400
+ };
401
+ function ns() {
402
+ const r = G(), l = st(), t = lt(), i = Pe(r._type), s = { ...r }, [n, a] = w(s), d = vr("dataBindingSupport", !1), o = ({ formData: u }, f, j) => {
380
403
  if (f && (n == null ? void 0 : n._id) === r._id) {
381
404
  const B = f.replace("root.", "");
382
- t([r._id], { [B]: x(u, B) }, j);
405
+ t([r._id], { [B]: g(u, B) }, j);
383
406
  }
384
- }, c = V(
407
+ }, c = H(
385
408
  Ct(({ formData: u }, f, j) => {
386
- i({ formData: u }, f, j), o(u);
409
+ o({ formData: u }, f, j), a(u);
387
410
  }, 1500),
388
411
  [r == null ? void 0 : r._id]
389
412
  ), h = ({ formData: u }, f) => {
390
413
  if (f) {
391
414
  const j = f.replace("root.", "");
392
- s([r._id], { [j]: x(u, j) }), c({ formData: u }, f, { [j]: x(n, j) });
415
+ l([r._id], { [j]: g(u, j) }), c({ formData: u }, f, { [j]: g(n, j) });
393
416
  }
394
- }, a = {
395
- _name: Br({
417
+ }, p = {
418
+ _name: $r({
396
419
  title: "Name",
397
- default: x(r, "_name", r._type)
420
+ default: g(r, "_name", r._type)
398
421
  })
399
- }, g = je(x(l, "_bindings", {})), y = _(() => {
400
- const u = kt(x(d, "props", {}));
401
- return p && Nt(g, (f) => delete u[f]), u;
402
- }, [d, g, p]);
422
+ }, x = je(g(s, "_bindings", {})), y = _(() => {
423
+ const u = kt(g(i, "props", {}));
424
+ return d && Nt(x, (f) => delete u[f]), u;
425
+ }, [i, x, d]);
403
426
  return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
404
- /* @__PURE__ */ e.jsx(me, { id: r == null ? void 0 : r._id, onChange: h, formData: l, properties: a }),
427
+ /* @__PURE__ */ e.jsx(pe, { id: r == null ? void 0 : r._id, onChange: h, formData: s, properties: p }),
405
428
  /* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
406
- p ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
429
+ /* @__PURE__ */ e.jsx(os, {}),
430
+ d ? /* @__PURE__ */ e.jsxs(at, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
407
431
  /* @__PURE__ */ e.jsxs(Ce, { value: "BINDING", children: [
408
432
  /* @__PURE__ */ e.jsx(ke, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
409
433
  /* @__PURE__ */ e.jsx(
410
434
  "div",
411
435
  {
412
- className: `h-[8px] w-[8px] rounded-full ${b(x(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
436
+ className: `h-[8px] w-[8px] rounded-full ${b(g(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
413
437
  }
414
438
  ),
415
439
  "Data Binding"
416
440
  ] }) }),
417
441
  /* @__PURE__ */ e.jsx(Ne, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
418
- es,
442
+ ls,
419
443
  {
420
- bindingData: x(r, "_bindings", {}),
444
+ bindingData: g(r, "_bindings", {}),
421
445
  onChange: (u) => {
422
- i({ formData: { _bindings: u } }, "root._bindings");
446
+ o({ formData: { _bindings: u } }, "root._bindings");
423
447
  }
424
448
  }
425
449
  ) })
@@ -430,61 +454,61 @@ function rs() {
430
454
  "Static Content"
431
455
  ] }) }),
432
456
  /* @__PURE__ */ e.jsxs(Ne, { className: "pt-4", children: [
433
- b(g) ? null : /* @__PURE__ */ e.jsxs("div", { className: "mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500", children: [
457
+ b(x) ? null : /* @__PURE__ */ e.jsxs("div", { className: "mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500", children: [
434
458
  "Data binding is set for ",
435
- /* @__PURE__ */ e.jsx("b", { children: k(g, we).join(", ") }),
459
+ /* @__PURE__ */ e.jsx("b", { children: k(x, we).join(", ") }),
436
460
  " ",
437
- g.length === 1 ? "property" : "properties",
461
+ x.length === 1 ? "property" : "properties",
438
462
  ". Remove data binding to edit static content."
439
463
  ] }),
440
464
  /* @__PURE__ */ e.jsx(
441
- me,
465
+ pe,
442
466
  {
443
467
  id: r == null ? void 0 : r._id,
444
468
  onChange: h,
445
- formData: l,
469
+ formData: s,
446
470
  properties: y
447
471
  }
448
472
  )
449
473
  ] })
450
474
  ] })
451
475
  ] }) : /* @__PURE__ */ e.jsx(
452
- me,
476
+ pe,
453
477
  {
454
478
  id: r == null ? void 0 : r._id,
455
479
  onChange: h,
456
- formData: l,
480
+ formData: s,
457
481
  properties: y
458
482
  }
459
483
  ),
460
484
  /* @__PURE__ */ e.jsx("div", { className: "pb-60" })
461
485
  ] });
462
486
  }
463
- const Xe = new Wr(Ur, {
487
+ const Xe = new qr(Jr, {
464
488
  isCaseSensitive: !1,
465
489
  threshold: 0.2,
466
490
  minMatchCharLength: 2,
467
491
  keys: ["name"]
468
492
  });
469
- function ss() {
493
+ function is() {
470
494
  var B;
471
- const [r] = ue(), s = K(), t = De(), d = ot(), [l] = at(), [n, o] = w(""), p = (B = ae(r)) == null ? void 0 : B.prop, i = _t((x(s, p, "").replace(Gr, "").split(",").pop() || "").split(" "), b), c = () => {
495
+ const [r] = xe(), l = G(), t = De(), i = ot(), [s] = nt(), [n, a] = w(""), d = (B = oe(r)) == null ? void 0 : B.prop, o = _t((g(l, d, "").replace(es, "").split(",").pop() || "").split(" "), b), c = () => {
472
496
  const C = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
473
- t(l, C, !0), o("");
474
- }, [h, a] = w([]), g = ({ value: C }) => {
497
+ t(s, C, !0), a("");
498
+ }, [h, p] = w([]), x = ({ value: C }) => {
475
499
  const I = C.trim().toLowerCase(), X = I.match(/.+:/g);
476
500
  let N = [];
477
501
  if (X && X.length > 0) {
478
- const [P] = X, W = I.replace(P, "");
479
- N = Xe.search(W).map((m) => ({
502
+ const [P] = X, U = I.replace(P, "");
503
+ N = Xe.search(U).map((m) => ({
480
504
  ...m,
481
505
  item: { ...m.item, name: P + m.item.name }
482
506
  }));
483
507
  } else
484
508
  N = Xe.search(I);
485
- a(k(N, "item"));
509
+ p(k(N, "item"));
486
510
  }, y = () => {
487
- a([]);
511
+ p([]);
488
512
  }, u = (C) => C.name, f = (C) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: C.name }), j = {
489
513
  autoComplete: "off",
490
514
  autoCorrect: "off",
@@ -495,7 +519,7 @@ function ss() {
495
519
  onKeyDown: (C) => {
496
520
  C.key === "Enter" && n.trim() !== "" && c();
497
521
  },
498
- onChange: (C, { newValue: I }) => o(I),
522
+ onChange: (C, { newValue: I }) => a(I),
499
523
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
500
524
  };
501
525
  return /* @__PURE__ */ e.jsxs(
@@ -503,13 +527,13 @@ function ss() {
503
527
  {
504
528
  className: `no-scrollbar flex ${h.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
505
529
  children: [
506
- /* @__PURE__ */ e.jsx(nt, { className: "mt-2", children: "Add Tailwind classes" }),
530
+ /* @__PURE__ */ e.jsx(it, { className: "mt-2", children: "Add Tailwind classes" }),
507
531
  /* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
508
532
  /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
509
- Zr,
533
+ Gr,
510
534
  {
511
535
  suggestions: h,
512
- onSuggestionsFetchRequested: g,
536
+ onSuggestionsFetchRequested: x,
513
537
  onSuggestionsClearRequested: y,
514
538
  getSuggestionValue: u,
515
539
  renderSuggestion: f,
@@ -525,7 +549,7 @@ function ss() {
525
549
  }
526
550
  ) }),
527
551
  /* @__PURE__ */ e.jsx(
528
- U,
552
+ K,
529
553
  {
530
554
  variant: "outline",
531
555
  className: "h-6 border-gray-700",
@@ -537,18 +561,18 @@ function ss() {
537
561
  )
538
562
  ] }),
539
563
  /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
540
- b(i) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
564
+ b(o) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
541
565
  de.Children.toArray(
542
- i.map((C) => /* @__PURE__ */ e.jsxs(
566
+ o.map((C) => /* @__PURE__ */ e.jsxs(
543
567
  "div",
544
568
  {
545
569
  className: "group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",
546
570
  children: [
547
571
  C,
548
572
  /* @__PURE__ */ e.jsx(
549
- Qe,
573
+ et,
550
574
  {
551
- onClick: () => d(l, [C]),
575
+ onClick: () => i(s, [C]),
552
576
  className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
553
577
  }
554
578
  )
@@ -562,7 +586,7 @@ function ss() {
562
586
  }
563
587
  );
564
588
  }
565
- const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
589
+ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
566
590
  heading: "flex.heading",
567
591
  items: [
568
592
  { type: "arbitrary", label: "flex.basis", units: D, property: "flexBasis" },
@@ -571,7 +595,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
571
595
  { type: "dropdown", label: "flex.grow", property: "flexGrow" },
572
596
  { type: "dropdown", label: "flex.shrink", property: "flexShrink" }
573
597
  ]
574
- }, os = {
598
+ }, cs = {
575
599
  heading: "grid.heading",
576
600
  items: [
577
601
  { type: "range", label: "grid.col_span", property: "gridColSpan" },
@@ -582,7 +606,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
582
606
  { type: "range", label: "grid.row_end", property: "gridRowEnd" },
583
607
  { type: "range", label: "grid.order", property: "order" }
584
608
  ]
585
- }, as = [
609
+ }, ps = [
586
610
  {
587
611
  heading: "layout.heading",
588
612
  items: [
@@ -984,9 +1008,9 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
984
1008
  },
985
1009
  {
986
1010
  heading: "classes.heading",
987
- items: [{ component: ss }]
1011
+ items: [{ component: is }]
988
1012
  }
989
- ], ut = {
1013
+ ], xt = {
990
1014
  "not-italic": () => /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z", fill: "white" }) }),
991
1015
  // visibility
992
1016
  visible: Dt,
@@ -994,32 +1018,32 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
994
1018
  // display
995
1019
  hidden: Ae,
996
1020
  gap: A,
997
- gapX: S,
1021
+ gapX: T,
998
1022
  gapY: R,
999
- spaceX: S,
1023
+ spaceX: T,
1000
1024
  spaceY: R,
1001
1025
  overscroll: A,
1002
- overscrollX: S,
1026
+ overscrollX: T,
1003
1027
  overscrollY: R,
1004
1028
  overflow: A,
1005
- overflowX: S,
1029
+ overflowX: T,
1006
1030
  overflowY: R,
1007
1031
  top: ee,
1008
1032
  right: te,
1009
1033
  bottom: re,
1010
1034
  left: se,
1011
1035
  inset: A,
1012
- insetX: S,
1036
+ insetX: T,
1013
1037
  insetY: R,
1014
1038
  border: A,
1015
- borderX: S,
1039
+ borderX: T,
1016
1040
  borderY: R,
1017
1041
  borderTop: ee,
1018
1042
  borderRight: te,
1019
1043
  borderBottom: re,
1020
1044
  borderLeft: se,
1021
1045
  borderRadius: A,
1022
- borderRadiusX: S,
1046
+ borderRadiusX: T,
1023
1047
  borderRadiusY: R,
1024
1048
  borderRadiusTop: ee,
1025
1049
  borderRadiusRight: te,
@@ -1029,18 +1053,18 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
1029
1053
  borderRadiusTopRight: Pt,
1030
1054
  borderRadiusBottomRight: It,
1031
1055
  borderRadiusBottomLeft: $t,
1032
- divideXWidth: S,
1056
+ divideXWidth: T,
1033
1057
  divideYWidth: R,
1034
1058
  scale: A,
1035
- scaleX: S,
1059
+ scaleX: T,
1036
1060
  scaleY: R,
1037
- skewX: S,
1061
+ skewX: T,
1038
1062
  skewY: R,
1039
- translateX: S,
1063
+ translateX: T,
1040
1064
  translateY: R,
1041
1065
  // padding
1042
1066
  padding: A,
1043
- paddingX: S,
1067
+ paddingX: T,
1044
1068
  paddingY: R,
1045
1069
  paddingTop: ee,
1046
1070
  paddingRight: te,
@@ -1048,7 +1072,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
1048
1072
  paddingLeft: se,
1049
1073
  // margin
1050
1074
  margin: A,
1051
- marginX: S,
1075
+ marginX: T,
1052
1076
  marginY: R,
1053
1077
  marginTop: ee,
1054
1078
  marginRight: te,
@@ -1107,7 +1131,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
1107
1131
  }
1108
1132
  )
1109
1133
  ] }),
1110
- "float-none": Qe,
1134
+ "float-none": et,
1111
1135
  // position
1112
1136
  fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1113
1137
  /* @__PURE__ */ e.jsx(
@@ -1180,100 +1204,100 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
1180
1204
  )
1181
1205
  ] }),
1182
1206
  static: Xt
1183
- }, ne = Ke({ canReset: !1, canChange: !0 }), ns = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
1207
+ }, ne = Ke({ canReset: !1, canChange: !0 }), us = ({ children: r, canReset: l = !1, canChange: t = !0 }) => (
1184
1208
  // eslint-disable-next-line react/jsx-no-constructed-context-values
1185
- /* @__PURE__ */ e.jsx(ne.Provider, { value: { canReset: s, canChange: t }, children: r })
1186
- ), xt = ({ label: r, property: s, onChange: t }) => {
1187
- const d = _(() => x(ge, `${s}.classes`, [""]), [s]), l = ie(s), n = _(() => x(l, "cls", ""), [l]), { canChange: o } = oe(ne), p = /\[.*\]/g.test(n);
1188
- return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: p ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1209
+ /* @__PURE__ */ e.jsx(ne.Provider, { value: { canReset: l, canChange: t }, children: r })
1210
+ ), gt = ({ label: r, property: l, onChange: t }) => {
1211
+ const i = _(() => g(he, `${l}.classes`, [""]), [l]), s = ie(l), n = _(() => g(s, "cls", ""), [s]), { canChange: a } = ae(ne), d = /\[.*\]/g.test(n);
1212
+ return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: d ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1189
1213
  /* @__PURE__ */ e.jsx(_e, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
1190
1214
  /* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
1191
1215
  /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(He, {}) }) }),
1192
1216
  /* @__PURE__ */ e.jsx(Y, { children: "Current value is using a Tailwind arbitrary value." })
1193
1217
  ] })
1194
1218
  ] }) : /* @__PURE__ */ e.jsx(
1195
- Se,
1219
+ Te,
1196
1220
  {
1197
1221
  rounded: r,
1198
- onChange: (i) => t(i, s),
1222
+ onChange: (o) => t(o, l),
1199
1223
  selected: n,
1200
- options: d,
1201
- disabled: !o
1224
+ options: i,
1225
+ disabled: !a
1202
1226
  }
1203
1227
  ) });
1204
1228
  };
1205
- function Se({ selected: r, onChange: s, rounded: t = !1, options: d, disabled: l = !1 }) {
1206
- const n = r.replace(/.*:/g, "").trim(), { undo: o, redo: p } = vr();
1229
+ function Te({ selected: r, onChange: l, rounded: t = !1, options: i, disabled: s = !1 }) {
1230
+ const n = r.replace(/.*:/g, "").trim(), { undo: a, redo: d } = jr();
1207
1231
  return /* @__PURE__ */ e.jsxs(
1208
1232
  "select",
1209
1233
  {
1210
- disabled: !d.length || l,
1234
+ disabled: !i.length || s,
1211
1235
  className: `${t ? "rounded-md border border-border" : "border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
1212
- onChange: (i) => s(i.target.value),
1213
- onKeyDown: (i) => {
1214
- i.ctrlKey && (i.key === "z" && o(), i.key === "y" && p());
1236
+ onChange: (o) => l(o.target.value),
1237
+ onKeyDown: (o) => {
1238
+ o.ctrlKey && (o.key === "z" && a(), o.key === "y" && d());
1215
1239
  },
1216
1240
  value: n,
1217
1241
  children: [
1218
1242
  /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
1219
1243
  $.Children.toArray(
1220
- d.map((i) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: i, children: i }))
1244
+ i.map((o) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: o, children: o }))
1221
1245
  )
1222
1246
  ]
1223
1247
  }
1224
1248
  );
1225
1249
  }
1226
- const is = ({ property: r, onChange: s }) => {
1227
- const { canReset: t, canChange: d } = oe(ne), l = ie(r), n = _(() => x(l, "cls", ""), [l]), o = _(() => x(ge, `${r}.classes`, [""]), [r]), p = o.indexOf(n) > -1 ? o.indexOf(n) : 0, i = /\[.*\]/g.test(n);
1228
- return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: i ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1250
+ const xs = ({ property: r, onChange: l }) => {
1251
+ const { canReset: t, canChange: i } = ae(ne), s = ie(r), n = _(() => g(s, "cls", ""), [s]), a = _(() => g(he, `${r}.classes`, [""]), [r]), d = a.indexOf(n) > -1 ? a.indexOf(n) : 0, o = /\[.*\]/g.test(n);
1252
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: o ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1229
1253
  /* @__PURE__ */ e.jsx(
1230
1254
  "button",
1231
1255
  {
1232
1256
  type: "button",
1233
1257
  className: "box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
1234
- disabled: !d && (!t || p - 1 < 0),
1235
- onClick: () => s($e(o, p - 1), r),
1258
+ disabled: !i && (!t || d - 1 < 0),
1259
+ onClick: () => l($e(a, d - 1), r),
1236
1260
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1237
1261
  Zt,
1238
1262
  {
1239
- className: !d && (!t || p - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1263
+ className: !i && (!t || d - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1240
1264
  }
1241
1265
  ) })
1242
1266
  }
1243
1267
  ),
1244
- /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(xt, { label: !1, property: r, onChange: s }) }),
1268
+ /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(gt, { label: !1, property: r, onChange: l }) }),
1245
1269
  /* @__PURE__ */ e.jsx(
1246
1270
  "button",
1247
1271
  {
1248
1272
  type: "button",
1249
1273
  className: "w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
1250
- disabled: !d && (!t || p + 1 >= o.length),
1251
- onClick: () => s($e(o, p + 1), r),
1274
+ disabled: !i && (!t || d + 1 >= a.length),
1275
+ onClick: () => l($e(a, d + 1), r),
1252
1276
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1253
1277
  Ve,
1254
1278
  {
1255
- className: !d && (!t || p + 1 >= o.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1279
+ className: !i && (!t || d + 1 >= a.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1256
1280
  }
1257
1281
  ) })
1258
1282
  }
1259
1283
  )
1260
1284
  ] }) });
1261
- }, ds = ({ property: r, onChange: s }) => {
1262
- const t = _(() => x(ge, `${r}.classes`, [""]), [r]), { canChange: d } = oe(ne), l = ie(r), n = _(() => x(l, "cls", ""), [l]);
1263
- return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (o) => /* @__PURE__ */ e.jsxs(O, { children: [
1285
+ }, gs = ({ property: r, onChange: l }) => {
1286
+ const t = _(() => g(he, `${r}.classes`, [""]), [r]), { canChange: i } = ae(ne), s = ie(r), n = _(() => g(s, "cls", ""), [s]);
1287
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (a) => /* @__PURE__ */ e.jsxs(O, { children: [
1264
1288
  /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1265
1289
  "button",
1266
1290
  {
1267
1291
  type: "button",
1268
- disabled: !d,
1269
- onClick: () => s(o, r),
1270
- className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === o ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1271
- children: $.createElement(x(ut, o, et))
1292
+ disabled: !i,
1293
+ onClick: () => l(a, r),
1294
+ className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === a ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1295
+ children: $.createElement(g(xt, a, tt))
1272
1296
  }
1273
1297
  ) }),
1274
- /* @__PURE__ */ e.jsx(Y, { children: E(le(o)) })
1298
+ /* @__PURE__ */ e.jsx(Y, { children: E(le(a)) })
1275
1299
  ] })) });
1276
- }, cs = {
1300
+ }, hs = {
1277
1301
  backgroundColor: "bg",
1278
1302
  textColor: "text",
1279
1303
  borderColor: "border",
@@ -1285,39 +1309,39 @@ const is = ({ property: r, onChange: s }) => {
1285
1309
  toColor: "to",
1286
1310
  ringColor: "ring",
1287
1311
  ringOffsetColor: "ring-offset"
1288
- }, ps = ({ property: r, onChange: s }) => {
1289
- const t = ie(r), d = _(() => x(t, "cls", ""), [t]), { canChange: l } = oe(ne), [n, o] = w([]), [p, i] = w({ color: "", shade: "" }), c = d.split("-"), h = x(c, "1", ""), a = x(c, "2", ""), g = V(
1312
+ }, ys = ({ property: r, onChange: l }) => {
1313
+ const t = ie(r), i = _(() => g(t, "cls", ""), [t]), { canChange: s } = ae(ne), [n, a] = w([]), [d, o] = w({ color: "", shade: "" }), c = i.split("-"), h = g(c, "1", ""), p = g(c, "2", ""), x = H(
1290
1314
  // eslint-disable-next-line no-shadow
1291
1315
  (u) => {
1292
- ["current", "inherit", "transparent", "black", "white"].includes(u) ? (o([]), i({ color: u })) : (o(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), i((f) => ({ ...f, color: u, shade: f.shade ? f.shade : "500" })));
1316
+ ["current", "inherit", "transparent", "black", "white"].includes(u) ? (a([]), o({ color: u })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), o((f) => ({ ...f, color: u, shade: f.shade ? f.shade : "500" })));
1293
1317
  },
1294
- [o, i]
1318
+ [a, o]
1295
1319
  );
1296
1320
  L(() => {
1297
1321
  if (["current", "inherit", "transparent", "black", "white"].includes(h))
1298
- return o([]);
1299
- o(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1322
+ return a([]);
1323
+ a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1300
1324
  }, [h]);
1301
- const y = V(
1325
+ const y = H(
1302
1326
  // eslint-disable-next-line no-shadow
1303
1327
  (u) => {
1304
- i({ color: h, shade: u });
1328
+ o({ color: h, shade: u });
1305
1329
  },
1306
1330
  [h]
1307
1331
  );
1308
1332
  return L(() => {
1309
- i({ color: "", shade: "" });
1333
+ o({ color: "", shade: "" });
1310
1334
  }, [t]), L(() => {
1311
- const f = `${x(cs, r, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
1312
- f.match(new RegExp(x(ge, `${r}.regExp`, ""))) && s(f, r);
1313
- }, [p, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1335
+ const f = `${g(hs, r, "")}-${d.color}${d.shade ? `-${d.shade}` : ""}`;
1336
+ f.match(new RegExp(g(he, `${r}.regExp`, ""))) && l(f, r);
1337
+ }, [d, l, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1314
1338
  /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
1315
- Se,
1339
+ Te,
1316
1340
  {
1317
- disabled: !l,
1341
+ disabled: !s,
1318
1342
  rounded: !0,
1319
1343
  selected: h,
1320
- onChange: g,
1344
+ onChange: x,
1321
1345
  options: [
1322
1346
  "current",
1323
1347
  "transparent",
@@ -1350,20 +1374,20 @@ const is = ({ property: r, onChange: s }) => {
1350
1374
  ]
1351
1375
  }
1352
1376
  ) }),
1353
- /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Se, { rounded: !0, selected: a, disabled: !h || !l, onChange: y, options: n }) })
1377
+ /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Te, { rounded: !0, selected: p, disabled: !h || !s, onChange: y, options: n }) })
1354
1378
  ] });
1355
- }, Ze = (r, s) => {
1379
+ }, Ze = (r, l) => {
1356
1380
  r = r.toLowerCase();
1357
1381
  let t = r.trim().replace(/ |\+/g, "");
1358
- if ((t === "auto" || t === "none") && s.includes(t))
1382
+ if ((t === "auto" || t === "none") && l.includes(t))
1359
1383
  return { value: "", unit: t };
1360
- const d = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
1361
- t = t.replace(d, "");
1362
- const l = r.match(d), n = l && l.length > 1, o = !b(t) && Number.isNaN(Number(t));
1363
- return n || o ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
1384
+ const i = l.length ? new RegExp(l.join("|"), "g") : /XXXXXX/g;
1385
+ t = t.replace(i, "");
1386
+ const s = r.match(i), n = s && s.length > 1, a = !b(t) && Number.isNaN(Number(t));
1387
+ return n || a ? { error: "Invalid value" } : s && (s[0] === "auto" || s[0] === "none") ? { value: s[0], unit: "" } : { value: t, unit: s ? s[0] : "" };
1364
1388
  };
1365
- const us = (r) => {
1366
- const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1389
+ const ms = (r) => {
1390
+ const l = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1367
1391
  if (["auto", "none"].includes(t))
1368
1392
  return { value: "", unit: t };
1369
1393
  if (t === "px")
@@ -1373,25 +1397,25 @@ const us = (r) => {
1373
1397
  if (t === "full")
1374
1398
  return { value: "100", unit: "%" };
1375
1399
  if (M(r, "skew-"))
1376
- return { value: `${s}${t}`, unit: "deg" };
1400
+ return { value: `${l}${t}`, unit: "deg" };
1377
1401
  if (M(r, "rotate-"))
1378
- return { value: `${s}${t}`, unit: "deg" };
1402
+ return { value: `${l}${t}`, unit: "deg" };
1379
1403
  if (M(r, "opacity-"))
1380
1404
  return { value: `${t / 100}`, unit: "-" };
1381
1405
  if (M(r, "duration-") || M(r, "delay-"))
1382
1406
  return { value: `${t}`, unit: "ms" };
1383
1407
  if (M(r, "translate-") && !t.includes("/"))
1384
- return { value: `${s}${`${t / 4}`}`, unit: "rem" };
1408
+ return { value: `${l}${`${t / 4}`}`, unit: "rem" };
1385
1409
  if (M(r, "scale-"))
1386
- return { value: `${s}${`${t / 100}`}`, unit: "-" };
1387
- if (G(r, "border")) {
1388
- const d = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1389
- if (d)
1390
- return { value: d[0].split("-").pop(), unit: "px" };
1410
+ return { value: `${l}${`${t / 100}`}`, unit: "-" };
1411
+ if (W(r, "border")) {
1412
+ const i = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1413
+ if (i)
1414
+ return { value: i[0].split("-").pop(), unit: "px" };
1391
1415
  if (r.match(/border-?(x|y|t|r|b|l)?/g))
1392
1416
  return { value: "1", unit: "px" };
1393
1417
  }
1394
- if (G(r, "max-w-")) {
1418
+ if (W(r, "max-w-")) {
1395
1419
  if (r === "max-w-screen-sm")
1396
1420
  return { value: "640", unit: "px" };
1397
1421
  if (r === "max-w-screen-md")
@@ -1427,7 +1451,7 @@ const us = (r) => {
1427
1451
  if (t === "prose")
1428
1452
  return { value: "65", unit: "ch" };
1429
1453
  }
1430
- if (G(r, "text-")) {
1454
+ if (W(r, "text-")) {
1431
1455
  if (t === "xs")
1432
1456
  return { value: "12", unit: "px" };
1433
1457
  if (t === "sm")
@@ -1455,7 +1479,7 @@ const us = (r) => {
1455
1479
  if (t === "9xl")
1456
1480
  return { value: "128", unit: "px" };
1457
1481
  }
1458
- if (G(r, "leading-")) {
1482
+ if (W(r, "leading-")) {
1459
1483
  if (t === "none")
1460
1484
  return { value: "1", unit: "-" };
1461
1485
  if (t === "tight")
@@ -1469,7 +1493,7 @@ const us = (r) => {
1469
1493
  if (t === "loose")
1470
1494
  return { value: "2", unit: "-" };
1471
1495
  }
1472
- if (G(r, "tracking-")) {
1496
+ if (W(r, "tracking-")) {
1473
1497
  if (t === "tighter")
1474
1498
  return { value: "-0.05", unit: "em" };
1475
1499
  if (t === "tight")
@@ -1486,113 +1510,113 @@ const us = (r) => {
1486
1510
  if (["max", "min", "fit"].includes(t))
1487
1511
  return { value: r, unit: "class" };
1488
1512
  if (t.includes("/")) {
1489
- const [d, l] = k(t.split("/"), (n) => parseInt(n, 10));
1490
- return { value: s + (d / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1513
+ const [i, s] = k(t.split("/"), (n) => parseInt(n, 10));
1514
+ return { value: l + (i / s * 100).toFixed(2).replace(".00", ""), unit: "%" };
1491
1515
  }
1492
- return Tt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1516
+ return St(parseFloat(t)) ? { value: `${l + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1493
1517
  };
1494
- const xs = (r) => {
1518
+ const bs = (r) => {
1495
1519
  if (b(r))
1496
1520
  return { value: "", unit: "" };
1497
- const s = r.match(/\[.*\]/g);
1498
- if (s === null)
1499
- return gs(r);
1500
- const t = x(s, "0", "").replace(/\[|\]/g, ""), d = r.startsWith("-") ? "-" : "", l = ae(t.match(/\d+.\d+|\d+/g));
1501
- return { value: `${d}${l}`, unit: t.replace(l, "") };
1502
- }, gs = (r) => b(r) ? { value: "", unit: "" } : us(r), gt = $.createContext({
1521
+ const l = r.match(/\[.*\]/g);
1522
+ if (l === null)
1523
+ return fs(r);
1524
+ const t = g(l, "0", "").replace(/\[|\]/g, ""), i = r.startsWith("-") ? "-" : "", s = oe(t.match(/\d+.\d+|\d+/g));
1525
+ return { value: `${i}${s}`, unit: t.replace(s, "") };
1526
+ }, fs = (r) => b(r) ? { value: "", unit: "" } : ms(r), ht = $.createContext({
1503
1527
  setDragData: () => {
1504
1528
  }
1505
- }), hs = ({
1529
+ }), vs = ({
1506
1530
  unit: r,
1507
- currentValue: s,
1531
+ currentValue: l,
1508
1532
  onDrag: t,
1509
- onDragEnd: d,
1510
- onDragStart: l,
1533
+ onDragEnd: i,
1534
+ onDragStart: s,
1511
1535
  negative: n,
1512
- cssProperty: o
1536
+ cssProperty: a
1513
1537
  }) => {
1514
- const { setDragData: p } = oe(gt);
1538
+ const { setDragData: d } = ae(ht);
1515
1539
  return /* @__PURE__ */ e.jsx(
1516
1540
  "button",
1517
1541
  {
1518
1542
  type: "button",
1519
- onMouseDown: (i) => {
1543
+ onMouseDown: (o) => {
1520
1544
  const c = {
1521
1545
  onDrag: t,
1522
- onDragEnd: d,
1546
+ onDragEnd: i,
1523
1547
  dragging: !0,
1524
- dragStartY: i.pageY,
1525
- dragStartValue: `${s}`,
1548
+ dragStartY: o.pageY,
1549
+ dragStartValue: `${l}`,
1526
1550
  dragUnit: r,
1527
1551
  negative: n,
1528
- cssProperty: o
1552
+ cssProperty: a
1529
1553
  };
1530
- l(c), p(c);
1554
+ s(c), d(c);
1531
1555
  },
1532
1556
  color: void 0,
1533
1557
  className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1534
1558
  children: /* @__PURE__ */ e.jsx(Wt, {})
1535
1559
  }
1536
1560
  );
1537
- }, ys = ({ onSelect: r, current: s, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((d) => /* @__PURE__ */ e.jsx(
1538
- U,
1561
+ }, js = ({ onSelect: r, current: l, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((i) => /* @__PURE__ */ e.jsx(
1562
+ K,
1539
1563
  {
1540
1564
  className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1541
- color: s === d ? "primary" : void 0,
1565
+ color: l === i ? "primary" : void 0,
1542
1566
  size: "sm",
1543
- onClick: (l) => {
1544
- l.stopPropagation(), r(d);
1567
+ onClick: (s) => {
1568
+ s.stopPropagation(), r(i);
1545
1569
  },
1546
- children: d
1570
+ children: i
1547
1571
  },
1548
- d
1549
- )) }), We = 50, ms = (r) => {
1550
- const [s, t] = w(!1), [d, l] = w(""), { currentClass: n, onChange: o, classPrefix: p, cssProperty: i, units: c, negative: h } = r, [a, g] = w(i != null && i.toLowerCase().includes("width") ? "%" : c[0]), [y, u] = w(!1), [f, j] = w(""), [B, C] = w(!1), [I, X] = w(!1);
1572
+ i
1573
+ )) }), We = 50, ws = (r) => {
1574
+ const [l, t] = w(!1), [i, s] = w(""), { currentClass: n, onChange: a, classPrefix: d, cssProperty: o, units: c, negative: h } = r, [p, x] = w(o != null && o.toLowerCase().includes("width") ? "%" : c[0]), [y, u] = w(!1), [f, j] = w(""), [B, C] = w(!1), [I, X] = w(!1);
1551
1575
  L(() => {
1552
- const { value: m, unit: v } = xs(n);
1576
+ const { value: m, unit: v } = bs(n);
1553
1577
  if (v === "") {
1554
- l(m), g(i != null && i.toLowerCase().includes("width") ? "%" : ae(c));
1578
+ s(m), x(o != null && o.toLowerCase().includes("width") ? "%" : oe(c));
1555
1579
  return;
1556
1580
  }
1557
- g(v), l(v === "class" || b(m) ? "" : m);
1558
- }, [n, i, c]);
1559
- const N = fe((m) => o(m), [o], We), P = fe((m) => o(m, !1), [o], We), W = V(
1581
+ x(v), s(v === "class" || b(m) ? "" : m);
1582
+ }, [n, o, c]);
1583
+ const N = fe((m) => a(m), [a], We), P = fe((m) => a(m, !1), [a], We), U = H(
1560
1584
  (m = !1) => {
1561
- const v = Ze(`${d}`, c);
1562
- if (x(v, "error", !1)) {
1585
+ const v = Ze(`${i}`, c);
1586
+ if (g(v, "error", !1)) {
1563
1587
  u(!0);
1564
1588
  return;
1565
1589
  }
1566
- const T = x(v, "unit") !== "" ? x(v, "unit") : a;
1567
- if (T === "auto" || T === "none") {
1568
- N(`${p}${T}`);
1590
+ const S = g(v, "unit") !== "" ? g(v, "unit") : p;
1591
+ if (S === "auto" || S === "none") {
1592
+ N(`${d}${S}`);
1569
1593
  return;
1570
1594
  }
1571
- if (x(v, "value") === "")
1595
+ if (g(v, "value") === "")
1572
1596
  return;
1573
- const Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
1597
+ const Q = `${g(v, "value", "").startsWith("-") ? "-" : ""}${d}[${g(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1574
1598
  m ? P(Q) : N(Q);
1575
1599
  },
1576
- [N, P, d, a, p, c]
1577
- ), J = V(
1600
+ [N, P, i, p, d, c]
1601
+ ), J = H(
1578
1602
  (m) => {
1579
- const v = Ze(`${d}`, c);
1580
- if (x(v, "error", !1)) {
1603
+ const v = Ze(`${i}`, c);
1604
+ if (g(v, "error", !1)) {
1581
1605
  u(!0);
1582
1606
  return;
1583
1607
  }
1584
1608
  if (m === "auto" || m === "none") {
1585
- N(`${p}${m}`);
1609
+ N(`${d}${m}`);
1586
1610
  return;
1587
1611
  }
1588
- if (x(v, "value") === "")
1612
+ if (g(v, "value") === "")
1589
1613
  return;
1590
- const T = x(v, "unit") !== "" ? x(v, "unit") : m, Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
1614
+ const S = g(v, "unit") !== "" ? g(v, "unit") : m, Q = `${g(v, "value", "").startsWith("-") ? "-" : ""}${d}[${g(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1591
1615
  N(Q);
1592
1616
  },
1593
- [N, d, p, c]
1617
+ [N, i, d, c]
1594
1618
  );
1595
- return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: a === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1619
+ return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: p === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1596
1620
  /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
1597
1621
  /* @__PURE__ */ e.jsxs(O, { children: [
1598
1622
  /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(He, {}) }) }),
@@ -1600,94 +1624,94 @@ const xs = (r) => {
1600
1624
  ] })
1601
1625
  ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${B ? "z-auto" : ""}`, children: [
1602
1626
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1603
- ["none", "auto"].indexOf(a) !== -1 ? null : /* @__PURE__ */ e.jsx(
1627
+ ["none", "auto"].indexOf(p) !== -1 ? null : /* @__PURE__ */ e.jsx(
1604
1628
  "input",
1605
1629
  {
1606
- readOnly: a === "class",
1630
+ readOnly: p === "class",
1607
1631
  onKeyPress: (m) => {
1608
- m.key === "Enter" && W();
1632
+ m.key === "Enter" && U();
1609
1633
  },
1610
1634
  onKeyDown: (m) => {
1611
1635
  if (m.keyCode !== 38 && m.keyCode !== 40)
1612
1636
  return;
1613
1637
  m.preventDefault(), X(!0);
1614
- const v = St(m.target.value);
1615
- let T = qe(v) ? 0 : v;
1616
- m.keyCode === 38 && (T += 1), m.keyCode === 40 && (T -= 1);
1617
- const Z = `${T}`, yt = `${Z.startsWith("-") ? "-" : ""}${p}[${Z.replace("-", "")}${a === "-" ? "" : a}]`;
1618
- P(yt);
1638
+ const v = Tt(m.target.value);
1639
+ let S = Je(v) ? 0 : v;
1640
+ m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
1641
+ const Z = `${S}`, mt = `${Z.startsWith("-") ? "-" : ""}${d}[${Z.replace("-", "")}${p === "-" ? "" : p}]`;
1642
+ P(mt);
1619
1643
  },
1620
1644
  onKeyUp: (m) => {
1621
1645
  I && (m.preventDefault(), X(!1));
1622
1646
  },
1623
- onBlur: () => W(),
1647
+ onBlur: () => U(),
1624
1648
  onChange: (m) => {
1625
- u(!1), l(m.target.value);
1649
+ u(!1), s(m.target.value);
1626
1650
  },
1627
1651
  onClick: (m) => {
1628
1652
  var v;
1629
1653
  (v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
1630
1654
  },
1631
- value: B ? f : d,
1655
+ value: B ? f : i,
1632
1656
  className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1633
1657
  " ",
1634
1658
  y ? "border-red-500 text-red-500" : "border-foreground/20"
1635
1659
  )
1636
1660
  }
1637
1661
  ),
1638
- /* @__PURE__ */ e.jsxs(O, { open: s, delayDuration: 100, children: [
1662
+ /* @__PURE__ */ e.jsxs(O, { open: l, delayDuration: 100, children: [
1639
1663
  /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1640
1664
  "button",
1641
1665
  {
1642
1666
  type: "button",
1643
- onClick: () => t(!s),
1667
+ onClick: () => t(!l),
1644
1668
  className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1645
1669
  children: [
1646
- /* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: a }),
1670
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: p }),
1647
1671
  c.length > 1 ? /* @__PURE__ */ e.jsx(Ut, {}) : null
1648
1672
  ]
1649
1673
  }
1650
1674
  ) }),
1651
- /* @__PURE__ */ e.jsx(jr, { children: /* @__PURE__ */ e.jsx(Y, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1652
- ys,
1675
+ /* @__PURE__ */ e.jsx(wr, { children: /* @__PURE__ */ e.jsx(Y, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1676
+ js,
1653
1677
  {
1654
1678
  units: c,
1655
- current: a,
1679
+ current: p,
1656
1680
  onSelect: (m) => {
1657
- t(!1), g(m), J(m);
1681
+ t(!1), x(m), J(m);
1658
1682
  }
1659
1683
  }
1660
1684
  ) }) })
1661
1685
  ] })
1662
1686
  ] }),
1663
- ["none", "auto"].indexOf(a) !== -1 || B ? null : /* @__PURE__ */ e.jsx(
1664
- hs,
1687
+ ["none", "auto"].indexOf(p) !== -1 || B ? null : /* @__PURE__ */ e.jsx(
1688
+ vs,
1665
1689
  {
1666
1690
  onDragStart: () => C(!0),
1667
1691
  onDragEnd: (m) => {
1668
1692
  if (j(() => ""), C(!1), b(m))
1669
1693
  return;
1670
- const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${a === "-" ? "" : a}]`;
1694
+ const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${p === "-" ? "" : p}]`;
1671
1695
  N(Z);
1672
1696
  },
1673
1697
  onDrag: (m) => {
1674
1698
  if (b(m))
1675
1699
  return;
1676
1700
  j(m);
1677
- const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${a === "-" ? "" : a}]`;
1701
+ const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${p === "-" ? "" : p}]`;
1678
1702
  P(Z);
1679
1703
  },
1680
- currentValue: d,
1681
- unit: a,
1704
+ currentValue: i,
1705
+ unit: p,
1682
1706
  negative: h,
1683
- cssProperty: i
1707
+ cssProperty: o
1684
1708
  }
1685
1709
  )
1686
1710
  ] }) }) });
1687
1711
  }, ie = (r) => {
1688
- const s = xe();
1689
- return Rt(s, { property: r });
1690
- }, bs = (r, s) => {
1712
+ const l = ge();
1713
+ return Rt(l, { property: r });
1714
+ }, Cs = (r, l) => {
1691
1715
  const t = {
1692
1716
  xs: 0,
1693
1717
  sm: 1,
@@ -1696,8 +1720,8 @@ const xs = (r) => {
1696
1720
  xl: 4,
1697
1721
  "2xl": 5
1698
1722
  };
1699
- return t[x(r, "mq", "xs")] <= t[s];
1700
- }, fs = {
1723
+ return t[g(r, "mq", "xs")] <= t[l];
1724
+ }, ks = {
1701
1725
  width: "w-",
1702
1726
  height: "h-",
1703
1727
  minWidth: "min-w-",
@@ -1770,23 +1794,23 @@ const xs = (r) => {
1770
1794
  lg: "1024px",
1771
1795
  xl: "1280px",
1772
1796
  "2xl": "1536px"
1773
- }, vs = (r) => `${r.toUpperCase()} ${Ue[r] ? `(${Ue[r]} & up)` : ""}`, Ie = (r) => {
1774
- const { t: s } = z(), { type: t = "icons", label: d, property: l, onEmitChange: n = () => {
1775
- }, units: o, negative: p = !1 } = r, [i] = wr(), [c] = it(), [, h] = Me(), a = ie(l), g = De(), y = ot(), [u] = at(), f = _(() => x(a, "fullCls", ""), [a]), j = V(
1776
- (P, W = !0) => {
1777
- const J = { dark: i, mq: h, mod: c, cls: P, property: l, fullCls: "" };
1778
- (i || c !== "") && (J.mq = "xs");
1779
- const m = Kr(J);
1780
- g(u, [m], W);
1797
+ }, Ns = (r) => `${r.toUpperCase()} ${Ue[r] ? `(${Ue[r]} & up)` : ""}`, Ie = (r) => {
1798
+ const { t: l } = z(), { type: t = "icons", label: i, property: s, onEmitChange: n = () => {
1799
+ }, units: a, negative: d = !1 } = r, [o] = Cr(), [c] = dt(), [, h] = Me(), p = ie(s), x = De(), y = ot(), [u] = nt(), f = _(() => g(p, "fullCls", ""), [p]), j = H(
1800
+ (P, U = !0) => {
1801
+ const J = { dark: o, mq: h, mod: c, cls: P, property: s, fullCls: "" };
1802
+ (o || c !== "") && (J.mq = "xs");
1803
+ const m = Qr(J);
1804
+ x(u, [m], U);
1781
1805
  },
1782
- [u, i, h, c, l, g]
1783
- ), B = V(() => {
1806
+ [u, o, h, c, s, x]
1807
+ ), B = H(() => {
1784
1808
  y(u, [f]);
1785
- }, [u, f, y]), C = _(() => bs(a, h), [a, h]);
1809
+ }, [u, f, y]), C = _(() => Cs(p, h), [p, h]);
1786
1810
  L(() => {
1787
- n(C, a);
1788
- }, [C, n, a]);
1789
- const [, , I] = Me(), X = V(
1811
+ n(C, p);
1812
+ }, [C, n, p]);
1813
+ const [, , I] = Me(), X = H(
1790
1814
  (P) => {
1791
1815
  I({
1792
1816
  xs: 400,
@@ -1798,28 +1822,28 @@ const xs = (r) => {
1798
1822
  }[P]);
1799
1823
  },
1800
1824
  [I]
1801
- ), N = x(a, "dark", null) === i && x(a, "mod", null) === c && x(a, "mq", null) === h;
1802
- return /* @__PURE__ */ e.jsx(ns, { canChange: C, canReset: a && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1803
- /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${a && !N ? "text-foreground" : ""}`, children: s(d) }) }),
1825
+ ), N = g(p, "dark", null) === o && g(p, "mod", null) === c && g(p, "mq", null) === h;
1826
+ return /* @__PURE__ */ e.jsx(us, { canChange: C, canReset: p && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1827
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${p && !N ? "text-foreground" : ""}`, children: l(i) }) }),
1804
1828
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
1805
1829
  /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
1806
1830
  t === "arbitrary" ? /* @__PURE__ */ e.jsx(
1807
- ms,
1831
+ ws,
1808
1832
  {
1809
- currentClass: x(a, "cls", ""),
1810
- classPrefix: x(fs, l, ""),
1811
- units: o || [],
1833
+ currentClass: g(p, "cls", ""),
1834
+ classPrefix: g(ks, s, ""),
1835
+ units: a || [],
1812
1836
  onChange: j,
1813
- negative: p,
1814
- cssProperty: l
1837
+ negative: d,
1838
+ cssProperty: s
1815
1839
  }
1816
1840
  ) : null,
1817
- t === "icons" && /* @__PURE__ */ e.jsx(ds, { property: l, onChange: j }),
1818
- t === "range" && /* @__PURE__ */ e.jsx(is, { property: l, onChange: j }),
1819
- t === "color" && /* @__PURE__ */ e.jsx(ps, { property: l, onChange: j }),
1820
- t === "dropdown" && /* @__PURE__ */ e.jsx(xt, { label: d, property: l, onChange: j })
1841
+ t === "icons" && /* @__PURE__ */ e.jsx(gs, { property: s, onChange: j }),
1842
+ t === "range" && /* @__PURE__ */ e.jsx(xs, { property: s, onChange: j }),
1843
+ t === "color" && /* @__PURE__ */ e.jsx(ys, { property: s, onChange: j }),
1844
+ t === "dropdown" && /* @__PURE__ */ e.jsx(gt, { label: i, property: s, onChange: j })
1821
1845
  ] }),
1822
- /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => B(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Kt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : C && a ? /* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
1846
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => B(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Kt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : C && p ? /* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
1823
1847
  /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1824
1848
  "button",
1825
1849
  {
@@ -1831,19 +1855,19 @@ const xs = (r) => {
1831
1855
  /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1832
1856
  "Current style is set at  ",
1833
1857
  /* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
1834
- vs(x(a, "mq")),
1835
- i && !a.dark ? "(Light mode)" : ""
1858
+ Ns(g(p, "mq")),
1859
+ o && !p.dark ? "(Light mode)" : ""
1836
1860
  ] }),
1837
1861
  /* @__PURE__ */ e.jsx("br", {}),
1838
1862
  /* @__PURE__ */ e.jsxs(
1839
1863
  "button",
1840
1864
  {
1841
1865
  type: "button",
1842
- onClick: () => X(x(a, "mq")),
1866
+ onClick: () => X(g(p, "mq")),
1843
1867
  className: "block w-full cursor-default text-right font-semibold text-blue-500",
1844
1868
  children: [
1845
1869
  "Switch to ",
1846
- x(a, "mq").toUpperCase()
1870
+ g(p, "mq").toUpperCase()
1847
1871
  ]
1848
1872
  }
1849
1873
  )
@@ -1851,141 +1875,141 @@ const xs = (r) => {
1851
1875
  ] }) : null })
1852
1876
  ] })
1853
1877
  ] }) });
1854
- }, js = ["px", "%", "em", "rem", "ch", "vh", "vw"], ht = ({
1878
+ }, _s = ["px", "%", "em", "rem", "ch", "vh", "vw"], yt = ({
1855
1879
  label: r,
1856
- options: s,
1880
+ options: l,
1857
1881
  borderB: t = !1,
1858
- borderT: d = !1,
1859
- type: l = "arbitrary",
1860
- units: n = js,
1861
- negative: o = !1
1882
+ borderT: i = !1,
1883
+ type: s = "arbitrary",
1884
+ units: n = _s,
1885
+ negative: a = !1
1862
1886
  }) => {
1863
- const { t: p } = z(), [i, c] = w(s[0].key), h = xe(), a = V((g) => k(h, "property").includes(g), [h]);
1887
+ const { t: d } = z(), [o, c] = w(l[0].key), h = ge(), p = H((x) => k(h, "property").includes(x), [h]);
1864
1888
  return /* @__PURE__ */ e.jsxs(
1865
1889
  "div",
1866
1890
  {
1867
- className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${d ? "border-t" : ""}`,
1891
+ className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${i ? "border-t" : ""}`,
1868
1892
  children: [
1869
1893
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
1870
- r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: p(r) }),
1894
+ r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: d(r) }),
1871
1895
  /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
1872
- s.map(({ label: g, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(O, { children: [
1896
+ l.map(({ label: x, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(O, { children: [
1873
1897
  /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1874
1898
  "button",
1875
1899
  {
1876
1900
  type: "button",
1877
1901
  onClick: () => c(y),
1878
- className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1902
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === o ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1879
1903
  children: [
1880
1904
  $.createElement("div", {
1881
- className: a(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1905
+ className: p(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1882
1906
  }),
1883
- $.createElement(x(ut, y, et), { className: "text-inherit w-3 h-3" })
1907
+ $.createElement(g(xt, y, tt), { className: "text-inherit w-3 h-3" })
1884
1908
  ]
1885
1909
  }
1886
1910
  ) }),
1887
- /* @__PURE__ */ e.jsx(Y, { children: E(le(g)) })
1911
+ /* @__PURE__ */ e.jsx(Y, { children: E(le(x)) })
1888
1912
  ] }) }))
1889
1913
  ) })
1890
1914
  ] }),
1891
1915
  /* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
1892
1916
  Ie,
1893
1917
  {
1894
- type: l,
1918
+ type: s,
1895
1919
  units: [...n],
1896
1920
  label: "",
1897
- property: i,
1898
- negative: o
1921
+ property: o,
1922
+ negative: a
1899
1923
  }
1900
1924
  ) })
1901
1925
  ]
1902
1926
  }
1903
1927
  );
1904
- }, ws = ({ heading: r, items: s }) => {
1905
- const { t } = z(), d = xe(), l = _(() => {
1906
- const n = (i) => q(
1907
- i.map((c) => c.styleType === "multiple" ? k(c.options, "key") : c.property)
1908
- ), o = q(
1909
- s.map((i) => i.styleType === "accordion" ? n(i.items) : i.styleType === "multiple" ? k(i.options, "key") : i.property)
1910
- ), p = k(d, "property");
1911
- return Je(o, p).length > 0;
1912
- }, [d, s]);
1928
+ }, Ss = ({ heading: r, items: l }) => {
1929
+ const { t } = z(), i = ge(), s = _(() => {
1930
+ const n = (o) => q(
1931
+ o.map((c) => c.styleType === "multiple" ? k(c.options, "key") : c.property)
1932
+ ), a = q(
1933
+ l.map((o) => o.styleType === "accordion" ? n(o.items) : o.styleType === "multiple" ? k(o.options, "key") : o.property)
1934
+ ), d = k(i, "property");
1935
+ return Qe(a, d).length > 0;
1936
+ }, [i, l]);
1913
1937
  return /* @__PURE__ */ e.jsxs("details", { children: [
1914
1938
  /* @__PURE__ */ e.jsx("summary", { className: "my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground", children: /* @__PURE__ */ e.jsxs("div", { className: "inline", children: [
1915
1939
  t(r),
1916
- l ? /* @__PURE__ */ e.jsx(
1940
+ s ? /* @__PURE__ */ e.jsx(
1917
1941
  "span",
1918
1942
  {
1919
- className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
1943
+ className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${s ? "bg-blue-500" : "bg-gray-300"}`
1920
1944
  }
1921
1945
  ) : null
1922
1946
  ] }) }),
1923
- /* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Ie, { ...n }, n.label)) })
1947
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: l.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(yt, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Ie, { ...n }, n.label)) })
1924
1948
  ] });
1925
- }, Cs = Ke({}), be = ({ section: r }) => {
1926
- const { t: s } = z(), t = xe(), d = V(
1927
- (o = []) => {
1928
- const p = {};
1949
+ }, Ts = Ke({}), be = ({ section: r }) => {
1950
+ const { t: l } = z(), t = ge(), i = H(
1951
+ (a = []) => {
1952
+ const d = {};
1929
1953
  for (let c = 0; c < t.length; c++)
1930
- p[t[c].property] = t[c].cls;
1931
- let i = !0;
1932
- for (const c in o)
1933
- if (!ce(p, c) || p[c] !== o[c]) {
1934
- i = !1;
1954
+ d[t[c].property] = t[c].cls;
1955
+ let o = !0;
1956
+ for (const c in a)
1957
+ if (!ce(d, c) || d[c] !== a[c]) {
1958
+ o = !1;
1935
1959
  break;
1936
1960
  }
1937
- return i;
1961
+ return o;
1938
1962
  },
1939
1963
  [t]
1940
- ), l = _(() => {
1964
+ ), s = _(() => {
1941
1965
  if (t.length > 0 && r.heading === "classes.heading")
1942
1966
  return !0;
1943
- const o = (c) => q(
1967
+ const a = (c) => q(
1944
1968
  c.map((h) => h.styleType === "multiple" ? q(k(h.options, "key")) : h.property)
1945
- ), p = q(
1946
- r.items.map((c) => c.styleType === "accordion" ? o(c.items) : c.styleType === "multiple" ? q(k(c.options, "key")) : c.property)
1947
- ), i = k(t, "property");
1948
- return Je(p, i).length > 0;
1969
+ ), d = q(
1970
+ r.items.map((c) => c.styleType === "accordion" ? a(c.items) : c.styleType === "multiple" ? q(k(c.options, "key")) : c.property)
1971
+ ), o = k(t, "property");
1972
+ return Qe(d, o).length > 0;
1949
1973
  }, [t, r.heading, r.items]), n = _(() => ({}), []);
1950
- return /* @__PURE__ */ e.jsx(Cs.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(Ce, { value: r.heading, children: [
1974
+ return /* @__PURE__ */ e.jsx(Ts.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(Ce, { value: r.heading, children: [
1951
1975
  /* @__PURE__ */ e.jsx(ke, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1952
- /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
1953
- s(r.heading)
1976
+ /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${s ? "bg-blue-500" : "bg-gray-300"}` }),
1977
+ l(r.heading)
1954
1978
  ] }) }),
1955
1979
  /* @__PURE__ */ e.jsx(Ne, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
1956
- r.items.map((o) => ce(o, "component") ? $.createElement(o.component, { key: o.label }) : ce(o, "styleType") ? o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...o }, o.label) : o.styleType === "accordion" && d(o == null ? void 0 : o.conditions) ? /* @__PURE__ */ e.jsx(ws, { ...o }, o.label) : null : /* @__PURE__ */ e.jsx(Ie, { ...o }, o.label))
1980
+ r.items.map((a) => ce(a, "component") ? $.createElement(a.component, { key: a.label }) : ce(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(yt, { ...a }, a.label) : a.styleType === "accordion" && i(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(Ss, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Ie, { ...a }, a.label))
1957
1981
  ) })
1958
1982
  ] }) });
1959
- }, ks = () => {
1960
- const r = K(), [s] = ue(), { t } = z(), d = Lr(), l = De(), n = Pe(r._type), o = x(ae(s), "prop"), p = x(n.props, `${o}.presets`, {});
1961
- if (b(d) && (!ce(n, "props") || b(p)))
1983
+ }, Rs = () => {
1984
+ const r = G(), [l] = xe(), { t } = z(), i = Yr(), s = De(), n = Pe(r._type), a = g(oe(l), "prop"), d = g(n.props, `${a}.presets`, {});
1985
+ if (b(i) && (!ce(n, "props") || b(d)))
1962
1986
  return null;
1963
- const i = (c) => {
1987
+ const o = (c) => {
1964
1988
  const h = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
1965
- l([r._id], h, !0);
1989
+ s([r._id], h, !0);
1966
1990
  };
1967
- return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Cr, { children: [
1968
- /* @__PURE__ */ e.jsx(kr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(U, { variant: "default", className: "w-full", size: "sm", children: [
1991
+ return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(kr, { children: [
1992
+ /* @__PURE__ */ e.jsx(Nr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(K, { variant: "default", className: "w-full", size: "sm", children: [
1969
1993
  t("Apply Presets"),
1970
1994
  /* @__PURE__ */ e.jsx(Gt, {})
1971
1995
  ] }) }) }),
1972
- /* @__PURE__ */ e.jsx(Nr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(Be, { className: "no-scrollbar h-full", children: [
1973
- b(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1996
+ /* @__PURE__ */ e.jsx(_r, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(Be, { className: "no-scrollbar h-full", children: [
1997
+ b(d) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1974
1998
  /* @__PURE__ */ e.jsxs(Ee, { children: [
1975
1999
  n.type,
1976
2000
  " ",
1977
2001
  t("presets")
1978
2002
  ] }),
1979
2003
  /* @__PURE__ */ e.jsx(Le, {}),
1980
- /* @__PURE__ */ e.jsx(Oe, { children: je(p).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => i(p[c]), children: [
2004
+ /* @__PURE__ */ e.jsx(Oe, { children: je(d).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => o(d[c]), children: [
1981
2005
  we(E(t(c))),
1982
2006
  /* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
1983
2007
  ] })) })
1984
2008
  ] }),
1985
- b(d) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2009
+ b(i) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1986
2010
  /* @__PURE__ */ e.jsx(Ee, { children: t("Global presets") }),
1987
2011
  /* @__PURE__ */ e.jsx(Le, {}),
1988
- /* @__PURE__ */ e.jsx(Oe, { children: je(d).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => i(d[c]), children: [
2012
+ /* @__PURE__ */ e.jsx(Oe, { children: je(i).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => o(i[c]), children: [
1989
2013
  we(E(t(c))),
1990
2014
  /* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
1991
2015
  ] })) })
@@ -1993,60 +2017,62 @@ const xs = (r) => {
1993
2017
  ] }) })
1994
2018
  ] }) });
1995
2019
  };
1996
- function Ns() {
1997
- const [r, s] = it(), { flexChild: t, gridChild: d } = _r(), { t: l } = z(), [n] = ue();
1998
- return b(n) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
1999
- /* @__PURE__ */ e.jsx(tt, { className: "mx-auto text-3xl" }),
2000
- /* @__PURE__ */ e.jsx("h1", { children: l("no_styling_block_selected") })
2020
+ function Vs() {
2021
+ const [r, l] = dt(), { flexChild: t, gridChild: i } = Sr(), { t: s } = z(), n = Tr(), [a] = xe();
2022
+ return b(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2023
+ /* @__PURE__ */ e.jsx(rt, { className: "mx-auto text-3xl" }),
2024
+ /* @__PURE__ */ e.jsx("h1", { children: s("no_styling_block_selected") })
2001
2025
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
2002
- /* @__PURE__ */ e.jsx(ks, {}),
2026
+ /* @__PURE__ */ e.jsx(Rs, {}),
2003
2027
  /* @__PURE__ */ e.jsx("div", { className: "flex h-12 flex-col space-x-4 px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
2004
- /* @__PURE__ */ e.jsx(nt, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2005
- /* @__PURE__ */ e.jsxs(Tr, { defaultValue: r, onValueChange: (o) => s(o), children: [
2006
- /* @__PURE__ */ e.jsx(Sr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Rr, { placeholder: "State" }) }),
2007
- /* @__PURE__ */ e.jsxs(Vr, { children: [
2008
- /* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
2009
- /* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
2010
- /* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
2011
- /* @__PURE__ */ e.jsx(H, { value: "focus", children: "Focus" }),
2012
- /* @__PURE__ */ e.jsx(H, { value: "before", children: "Before" }),
2013
- /* @__PURE__ */ e.jsx(H, { value: "after", children: "After" }),
2014
- /* @__PURE__ */ e.jsx(H, { value: "only", children: "Only" }),
2015
- /* @__PURE__ */ e.jsx(H, { value: "first", children: "First" }),
2016
- /* @__PURE__ */ e.jsx(H, { value: "last", children: "Last" }),
2017
- /* @__PURE__ */ e.jsx(H, { value: "first-letter", children: "First Letter" }),
2018
- /* @__PURE__ */ e.jsx(H, { value: "first-line", children: "First Line" }),
2019
- /* @__PURE__ */ e.jsx(H, { value: "disabled", children: "Disabled" })
2028
+ /* @__PURE__ */ e.jsx(it, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2029
+ /* @__PURE__ */ e.jsxs(Rr, { defaultValue: r, onValueChange: (d) => l(d), children: [
2030
+ /* @__PURE__ */ e.jsx(Vr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Hr, { placeholder: s("State") }) }),
2031
+ /* @__PURE__ */ e.jsxs(Dr, { children: [
2032
+ k(n, (d, o) => /* @__PURE__ */ e.jsx(V, { value: o, children: s(d) }, o)),
2033
+ /* @__PURE__ */ e.jsx("hr", {}),
2034
+ /* @__PURE__ */ e.jsx(V, { value: "", children: s("Normal") }),
2035
+ /* @__PURE__ */ e.jsx(V, { value: "hover", children: s("Hover") }),
2036
+ /* @__PURE__ */ e.jsx(V, { value: "active", children: s("Active") }),
2037
+ /* @__PURE__ */ e.jsx(V, { value: "focus", children: s("Focus") }),
2038
+ /* @__PURE__ */ e.jsx(V, { value: "before", children: s("Before") }),
2039
+ /* @__PURE__ */ e.jsx(V, { value: "after", children: s("After") }),
2040
+ /* @__PURE__ */ e.jsx(V, { value: "only", children: s("Only") }),
2041
+ /* @__PURE__ */ e.jsx(V, { value: "first", children: s("First") }),
2042
+ /* @__PURE__ */ e.jsx(V, { value: "last", children: s("Last") }),
2043
+ /* @__PURE__ */ e.jsx(V, { value: "first-letter", children: s("First Letter") }),
2044
+ /* @__PURE__ */ e.jsx(V, { value: "first-line", children: s("First Line") }),
2045
+ /* @__PURE__ */ e.jsx(V, { value: "disabled", children: s("Disabled") })
2020
2046
  ] })
2021
2047
  ] })
2022
2048
  ] }) }),
2023
2049
  r !== "" ? /* @__PURE__ */ e.jsxs("div", { className: "m-1 flex items-center space-x-1 rounded border border-orange-500 bg-orange-200 p-px px-2 text-xs text-orange-900", children: [
2024
- /* @__PURE__ */ e.jsx(Ar, { className: "w-3" }),
2025
- /* @__PURE__ */ e.jsx("span", { children: l(`Styles will be applied for (:${r}) state`) })
2050
+ /* @__PURE__ */ e.jsx(Lr, { className: "w-3" }),
2051
+ /* @__PURE__ */ e.jsx("span", { children: s(`Styles will be applied for (:${r}) state`) })
2026
2052
  ] }) : null,
2027
- /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border", children: /* @__PURE__ */ e.jsxs(lt, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
2028
- t && /* @__PURE__ */ e.jsx(be, { section: ls }),
2029
- d ? /* @__PURE__ */ e.jsx(be, { section: os }) : null,
2030
- as.map((o) => /* @__PURE__ */ e.jsx(be, { section: o }, o.heading))
2053
+ /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border", children: /* @__PURE__ */ e.jsxs(at, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
2054
+ t && /* @__PURE__ */ e.jsx(be, { section: ds }),
2055
+ i ? /* @__PURE__ */ e.jsx(be, { section: cs }) : null,
2056
+ ps.map((d) => /* @__PURE__ */ e.jsx(be, { section: d }, d.heading))
2031
2057
  ] }) })
2032
2058
  ] });
2033
2059
  }
2034
- const _s = ({ onAdd: r }) => {
2035
- const { t: s } = z(), [t, d] = w({ key: "", value: "" }), l = () => {
2036
- b(t.key) || (r({ ...t, key: Vt(t.key) }), d({ key: "", value: "" }));
2060
+ const Hs = ({ onAdd: r }) => {
2061
+ const { t: l } = z(), [t, i] = w({ key: "", value: "" }), s = () => {
2062
+ b(t.key) || (r({ ...t, key: Vt(t.key) }), i({ key: "", value: "" }));
2037
2063
  };
2038
2064
  return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200 px-1", children: [
2039
2065
  /* @__PURE__ */ e.jsx(
2040
2066
  _e,
2041
2067
  {
2042
2068
  name: "key",
2043
- onChange: (n) => d({ ...t, key: n.target.value }),
2069
+ onChange: (n) => i({ ...t, key: n.target.value }),
2044
2070
  value: t.key,
2045
- placeholder: s("Name"),
2071
+ placeholder: l("Name"),
2046
2072
  autoComplete: "off",
2047
2073
  autoCapitalize: "off",
2048
2074
  onKeyDown: (n) => {
2049
- n.key === "Enter" && (n.preventDefault(), b(t.key) || l());
2075
+ n.key === "Enter" && (n.preventDefault(), b(t.key) || s());
2050
2076
  }
2051
2077
  }
2052
2078
  ),
@@ -2054,71 +2080,80 @@ const _s = ({ onAdd: r }) => {
2054
2080
  _e,
2055
2081
  {
2056
2082
  name: "value",
2057
- onChange: (n) => d({ ...t, value: n.target.value }),
2083
+ onChange: (n) => i({ ...t, value: n.target.value }),
2058
2084
  value: t.value,
2059
- placeholder: s("Value"),
2085
+ placeholder: l("Value"),
2060
2086
  autoComplete: "off",
2061
2087
  autoCapitalize: "off",
2062
2088
  onKeyDown: (n) => {
2063
- n.key === "Enter" && (n.preventDefault(), b(t.key) || l());
2089
+ n.key === "Enter" && (n.preventDefault(), b(t.key) || s());
2064
2090
  }
2065
2091
  }
2066
2092
  ) }),
2067
2093
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
2068
- /* @__PURE__ */ e.jsxs(U, { disabled: b(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
2094
+ /* @__PURE__ */ e.jsxs(K, { disabled: b(t.key), onClick: s, size: "sm", className: "flex items-center", children: [
2069
2095
  /* @__PURE__ */ e.jsxs("span", { children: [
2070
- s("Add"),
2096
+ l("Add"),
2071
2097
  " "
2072
2098
  ] }),
2073
2099
  /* @__PURE__ */ e.jsx(Ve, {})
2074
2100
  ] }),
2075
- b(t.key) ? null : /* @__PURE__ */ e.jsx(U, { variant: "ghost", onClick: () => d({ key: "", value: "" }), children: s("Cancel") })
2101
+ b(t.key) ? null : /* @__PURE__ */ e.jsx(K, { variant: "ghost", onClick: () => i({ key: "", value: "" }), children: l("Cancel") })
2076
2102
  ] })
2077
2103
  ] });
2078
- }, Ts = () => {
2079
- const r = K(), [s, t] = w([]), [d] = ue(), l = rt(), n = st(), { t: o } = z(), p = `${x(d, "0.prop")}_attrs`;
2104
+ }, Ds = () => {
2105
+ const r = G(), [l, t] = w([]), [i] = xe(), s = st(), n = lt(), { t: a } = z(), { toast: d } = Br(), o = `${g(i, "0.prop")}_attrs`;
2080
2106
  de.useEffect(() => {
2081
- const a = k(x(r, p), (g, y) => ({ key: y, value: g }));
2082
- b(a) ? t([]) : t(a);
2083
- }, [x(r, p)]);
2084
- const i = (a) => {
2085
- const g = ve(s, (y, u) => a !== u);
2086
- h(g);
2087
- }, c = (a) => {
2088
- const g = [...s, a];
2089
- h(g);
2090
- }, h = de.useCallback(
2091
- (a = []) => {
2092
- const g = {};
2093
- Re(a, (y) => {
2094
- b(y.key) || Ge(g, y.key, y.value);
2095
- }), n([x(r, "_id")], { [p]: g });
2107
+ const x = k(g(r, o), (y, u) => ({ key: u, value: y }));
2108
+ b(x) ? t([]) : t(x);
2109
+ }, [g(r, o)]);
2110
+ const c = (x) => {
2111
+ const y = ve(l, (u, f) => x !== f);
2112
+ p(y);
2113
+ }, h = (x) => {
2114
+ const y = Ge(l, { key: x.key });
2115
+ if (y && (y.value.startsWith("dnd-") || y.value.startsWith("#dnd-"))) {
2116
+ d({
2117
+ title: a("Cannot add predefined attribute"),
2118
+ variant: "destructive",
2119
+ description: a(`"(${x.key})" cannot be added as it is a predefined attribute for this block`)
2120
+ });
2121
+ return;
2122
+ }
2123
+ const u = [...l, x];
2124
+ p(u);
2125
+ }, p = de.useCallback(
2126
+ (x = []) => {
2127
+ const y = {};
2128
+ Re(x, (u) => {
2129
+ b(u.key) || qe(y, u.key, u.value);
2130
+ }), n([g(r, "_id")], { [o]: y });
2096
2131
  },
2097
- [r, l, p]
2132
+ [r, s, o]
2098
2133
  );
2099
2134
  return /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2100
2135
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 p-2 text-xs text-gray-700", children: [
2101
- b(s) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-16 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: o("No custom attributes added yet") }) }) : /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: o("Custom attributes") }) }),
2136
+ b(l) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-16 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: a("No custom attributes added yet") }) }) : /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: a("Attributes") }) }),
2102
2137
  de.Children.toArray(
2103
- k(s, (a) => /* @__PURE__ */ e.jsxs("li", { className: "group flex max-w-full items-center justify-between", children: [
2138
+ k(l, (x) => /* @__PURE__ */ e.jsxs("li", { className: "group flex max-w-full items-center justify-between", children: [
2104
2139
  /* @__PURE__ */ e.jsxs(O, { delayDuration: 1e3, children: [
2105
2140
  /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "w-[90%] cursor-default truncate px-1 hover:bg-gray-200", children: [
2106
- a.key,
2141
+ x.key,
2107
2142
  " ",
2108
2143
  /* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
2109
2144
  " ",
2110
- a.value
2145
+ x.value
2111
2146
  ] }) }),
2112
2147
  /* @__PURE__ */ e.jsxs(Y, { className: "max-w-[200px]", children: [
2113
2148
  /* @__PURE__ */ e.jsxs("div", { children: [
2114
- o("Name"),
2149
+ a("Name"),
2115
2150
  ": ",
2116
- a.key
2151
+ x.key
2117
2152
  ] }),
2118
2153
  /* @__PURE__ */ e.jsxs("div", { children: [
2119
- o("Value"),
2154
+ a("Value"),
2120
2155
  ": ",
2121
- a.value
2156
+ x.value
2122
2157
  ] })
2123
2158
  ] })
2124
2159
  ] }),
@@ -2126,20 +2161,21 @@ const _s = ({ onAdd: r }) => {
2126
2161
  /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2127
2162
  "button",
2128
2163
  {
2164
+ disabled: W(x.value, "dnd-"),
2129
2165
  className: "invisible group-hover:visible",
2130
- onClick: () => i(s.indexOf(a)),
2131
- children: /* @__PURE__ */ e.jsx(Mr, { className: "w-4 text-gray-500" })
2166
+ onClick: () => c(l.indexOf(x)),
2167
+ children: /* @__PURE__ */ e.jsx(Or, { className: "w-4 text-gray-500" })
2132
2168
  }
2133
2169
  ) }),
2134
- /* @__PURE__ */ e.jsx(Y, { className: "max-w-[200px]", children: o("Remove attribute") })
2170
+ /* @__PURE__ */ e.jsx(Y, { className: "max-w-[200px]", children: W(x.value, "dnd-") ? a("Predefined attribute. Cannot be deleted") : a("Remove attribute") })
2135
2171
  ] })
2136
2172
  ] }))
2137
2173
  )
2138
2174
  ] }) }),
2139
2175
  /* @__PURE__ */ e.jsx("div", { className: "py-2" }),
2140
- /* @__PURE__ */ e.jsx(_s, { onAdd: (a) => c(a) })
2176
+ /* @__PURE__ */ e.jsx(Hs, { onAdd: (x) => h(x) })
2141
2177
  ] }) }) });
2142
- }, Ss = {
2178
+ }, Bs = {
2143
2179
  px: 1,
2144
2180
  "%": 1,
2145
2181
  em: 100,
@@ -2150,32 +2186,32 @@ const _s = ({ onAdd: r }) => {
2150
2186
  "-": 1,
2151
2187
  deg: 1,
2152
2188
  ms: 0.1
2153
- }, _l = () => {
2154
- const r = K(), { t: s } = z(), [t, d] = $.useState(""), [l, n] = $.useState({
2155
- onDrag: (i) => i,
2156
- onDragEnd: (i) => i,
2189
+ }, Dl = () => {
2190
+ const r = G(), { t: l } = z(), [t, i] = $.useState(""), [s, n] = $.useState({
2191
+ onDrag: (o) => o,
2192
+ onDragEnd: (o) => o,
2157
2193
  dragStartY: 0,
2158
2194
  dragging: !1,
2159
2195
  dragStartValue: 0,
2160
2196
  dragUnit: "",
2161
2197
  negative: !1,
2162
2198
  cssProperty: ""
2163
- }), o = fe(
2164
- (i) => {
2165
- const c = !x(l, "negative", !1), h = x(l, "cssProperty", "");
2166
- let a = parseFloat(l.dragStartValue);
2167
- a = qe(a) ? 0 : a;
2168
- let g = Ss[l.dragUnit];
2169
- (G(h, "scale") || h === "opacity") && (g = 10);
2170
- let u = (l.dragStartY - i.pageY) / g + a;
2171
- c && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), d(`${u}`);
2199
+ }), a = fe(
2200
+ (o) => {
2201
+ const c = !g(s, "negative", !1), h = g(s, "cssProperty", "");
2202
+ let p = parseFloat(s.dragStartValue);
2203
+ p = Je(p) ? 0 : p;
2204
+ let x = Bs[s.dragUnit];
2205
+ (W(h, "scale") || h === "opacity") && (x = 10);
2206
+ let u = (s.dragStartY - o.pageY) / x + p;
2207
+ c && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), s.onDrag(`${u}`), i(`${u}`);
2172
2208
  },
2173
- [l],
2209
+ [s],
2174
2210
  50
2175
- ), p = V(() => {
2176
- setTimeout(() => l.onDragEnd(`${t}`), 100), n({
2177
- onDrag: (i) => i,
2178
- onDragEnd: (i) => i,
2211
+ ), d = H(() => {
2212
+ setTimeout(() => s.onDragEnd(`${t}`), 100), n({
2213
+ onDrag: (o) => o,
2214
+ onDragEnd: (o) => o,
2179
2215
  dragStartY: 0,
2180
2216
  dragging: !1,
2181
2217
  dragStartValue: 0,
@@ -2183,31 +2219,31 @@ const _s = ({ onAdd: r }) => {
2183
2219
  negative: !1,
2184
2220
  cssProperty: ""
2185
2221
  });
2186
- }, [l, t, n]);
2222
+ }, [s, t, n]);
2187
2223
  return Ht(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2188
- /* @__PURE__ */ e.jsx(tt, { className: "mx-auto text-3xl" }),
2189
- /* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
2190
- ] }) }) : /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsxs(gt.Provider, { value: { setDragData: n }, children: [
2191
- l.dragging ? /* @__PURE__ */ e.jsx(
2224
+ /* @__PURE__ */ e.jsx(rt, { className: "mx-auto text-3xl" }),
2225
+ /* @__PURE__ */ e.jsx("h1", { children: l("no_block_selected_for_styling") })
2226
+ ] }) }) : /* @__PURE__ */ e.jsx(ct, { children: /* @__PURE__ */ e.jsxs(ht.Provider, { value: { setDragData: n }, children: [
2227
+ s.dragging ? /* @__PURE__ */ e.jsx(
2192
2228
  "div",
2193
2229
  {
2194
- onMouseMove: o,
2195
- onMouseUp: () => p(),
2230
+ onMouseMove: a,
2231
+ onMouseUp: () => d(),
2196
2232
  className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
2197
2233
  }
2198
2234
  ) : null,
2199
- /* @__PURE__ */ e.jsxs(Hr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1 text-xs", children: [
2200
- /* @__PURE__ */ e.jsxs(Dr, { className: "mx-1 grid grid-cols-3", children: [
2201
- /* @__PURE__ */ e.jsx(he, { value: "settings", children: s("settings") }),
2202
- /* @__PURE__ */ e.jsx(he, { value: "styling", children: s("styling") }),
2203
- /* @__PURE__ */ e.jsx(he, { value: "attrs", children: s("Attributes") })
2235
+ /* @__PURE__ */ e.jsxs(Pr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1 text-xs", children: [
2236
+ /* @__PURE__ */ e.jsxs(Ir, { className: "mx-1 grid grid-cols-3", children: [
2237
+ /* @__PURE__ */ e.jsx(ye, { value: "settings", children: l("settings") }),
2238
+ /* @__PURE__ */ e.jsx(ye, { value: "styling", children: l("styling") }),
2239
+ /* @__PURE__ */ e.jsx(ye, { value: "attrs", children: l("Attributes") })
2204
2240
  ] }),
2205
- /* @__PURE__ */ e.jsx(ye, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(rs, {}) }) }),
2206
- /* @__PURE__ */ e.jsx(ye, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ns, {}) }),
2207
- /* @__PURE__ */ e.jsx(ye, { value: "attrs", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ts, {}) })
2241
+ /* @__PURE__ */ e.jsx(me, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(ns, {}) }) }),
2242
+ /* @__PURE__ */ e.jsx(me, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Vs, {}) }),
2243
+ /* @__PURE__ */ e.jsx(me, { value: "attrs", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ds, {}) })
2208
2244
  ] })
2209
2245
  ] }) });
2210
2246
  };
2211
2247
  export {
2212
- _l as default
2248
+ Dl as default
2213
2249
  };