@chaibuilder/sdk 1.2.9 → 1.2.11

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 (102) hide show
  1. package/README.md +10 -12
  2. package/dist/AddBlocks-TSt8uJY4.js +218 -0
  3. package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
  4. package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
  5. package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
  6. package/dist/CanvasArea-5erOZYLy.cjs +60 -0
  7. package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
  8. package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
  9. package/dist/Class-5ARpH_Tu.cjs +1 -0
  10. package/dist/CurrentPage-NzmJloN7.cjs +1 -0
  11. package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
  12. package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
  13. package/dist/Layers-xDG7oltg.cjs +1 -0
  14. package/dist/PagesPanel-72nzYB1k.cjs +1 -0
  15. package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
  16. package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
  17. package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
  18. package/dist/Settings-5EuwaVb3.cjs +1 -0
  19. package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
  20. package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
  21. package/dist/SidePanels-uNCxnGte.cjs +1 -0
  22. package/dist/Topbar-JqW89xI5.cjs +1 -0
  23. package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
  24. package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
  25. package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
  26. package/dist/UploadImages-PzHdEKHT.cjs +1 -0
  27. package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
  28. package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
  29. package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
  30. package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
  31. package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
  32. package/dist/core.cjs +1 -1
  33. package/dist/core.d.ts +13 -58
  34. package/dist/core.js +47 -58
  35. package/dist/defaultTheme-IH19g4fv.cjs +1 -0
  36. package/dist/defaultTheme-YY8mlQS3.js +1055 -0
  37. package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
  38. package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
  39. package/dist/email-blocks.cjs +1 -1
  40. package/dist/email-blocks.js +100 -81
  41. package/dist/email.cjs +1 -0
  42. package/dist/email.d.ts +116 -0
  43. package/dist/email.js +79 -0
  44. package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
  45. package/dist/empty-slot-TF2kd-0X.cjs +1 -0
  46. package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
  47. package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
  48. package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
  49. package/dist/index-aiHDvS5v.cjs +1 -0
  50. package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
  51. package/dist/index-pNYv0oAF.js +2994 -0
  52. package/dist/lib.cjs +3 -3
  53. package/dist/lib.js +95 -1125
  54. package/dist/page-viewer-Sh99FGYk.cjs +1 -0
  55. package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
  56. package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
  57. package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
  58. package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
  59. package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
  60. package/dist/render.cjs +1 -1
  61. package/dist/render.d.ts +2 -0
  62. package/dist/render.js +111 -70
  63. package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
  64. package/dist/single-page-detail-6L38HJC4.cjs +1 -0
  65. package/dist/studio.cjs +1 -1
  66. package/dist/studio.js +13 -15
  67. package/dist/ui.cjs +1 -1
  68. package/dist/ui.d.ts +4 -4
  69. package/dist/ui.js +149 -151
  70. package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
  71. package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
  72. package/dist/web-blocks.cjs +1 -9
  73. package/dist/web-blocks.js +431 -442
  74. package/package.json +8 -2
  75. package/dist/AddBlocks-tMxKPoen.js +0 -225
  76. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  77. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  78. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  79. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  80. package/dist/Layers-eaHy5PK9.cjs +0 -1
  81. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  82. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  83. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  84. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  85. package/dist/Settings-7wlLcvoh.cjs +0 -1
  86. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  87. package/dist/Topbar-V8xCetWF.cjs +0 -1
  88. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  89. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  90. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  91. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  92. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  93. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  94. package/dist/functions-Ox_svtKm.cjs +0 -1
  95. package/dist/functions-xIebp8Aw.js +0 -23
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-niHREMmR.js +0 -2938
  98. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  99. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  100. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  101. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  102. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -1,24 +1,28 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import * as ne from "react";
3
- import I, { useState as j, useMemo as _, useEffect as O, useCallback as B, memo as ct, createContext as Me, useContext as se } from "react";
3
+ import P, { useState as C, useMemo as _, useEffect as O, useCallback as V, memo as dt, createContext as Me, useContext as se } from "react";
4
4
  import { useThrottledCallback as fe } from "@react-hookz/web";
5
- import { forEach as ke, isArray as ie, omit as pt, truncate as ut, includes as P, get as x, first as ue, split as xt, startCase as Y, toLower as le, isEmpty as m, map as C, find as gt, last as ve, filter as we, set as Oe, keys as ht, cloneDeep as yt, each as bt, capitalize as mt, reject as ft, nth as Ve, startsWith as W, isNumber as vt, parseInt as wt, isNaN as Xe, findLast as jt, flatten as U, intersection as Ye, has as ye, isNull as Ct } from "lodash-es";
5
+ import { forEach as ke, isArray as ie, omit as ct, truncate as pt, includes as E, get as x, first as ue, split as ut, startCase as F, toLower as le, isEmpty as f, map as k, find as xt, last as ve, filter as we, set as Oe, debounce as gt, keys as ht, cloneDeep as yt, each as mt, capitalize as bt, reject as ft, nth as Ve, startsWith as W, isNumber as vt, parseInt as wt, isNaN as Ye, findLast as jt, flatten as U, intersection as Fe, has as ye, isNull as Ct } from "lodash-es";
6
6
  import { useTranslation as K } from "react-i18next";
7
- import { PlusIcon as Ne, Cross2Icon as Fe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, WidthIcon as T, HeightIcon as R, ArrowUpIcon as Q, ArrowRightIcon as ee, ArrowDownIcon as te, ArrowLeftIcon as re, ArrowTopLeftIcon as Nt, ArrowTopRightIcon as _t, ArrowBottomRightIcon as St, ArrowBottomLeftIcon as Tt, AlignLeftIcon as Rt, AlignCenterHorizontallyIcon as Vt, AlignRightIcon as Ht, StretchHorizontallyIcon as Bt, FontItalicIcon as Dt, UnderlineIcon as $t, OverlineIcon as It, LetterCaseUppercaseIcon as At, Cross1Icon as Pt, InfoCircledIcon as _e, MinusIcon as Et, BoxIcon as ze, RowSpacingIcon as Lt, TriangleDownIcon as Mt, CrossCircledIcon as Ot, TrashIcon as Xt, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
8
- import { a$ as Yt, b0 as Ft, B as xe, b1 as zt, b2 as Zt, b3 as Wt, b4 as Ut, b5 as Kt, b6 as qt, b7 as Gt, a7 as q, an as Jt, ao as Qt, ap as er, b8 as tr, al as rr, b9 as lr, am as sr, aD as F, aE as z, aG as Z, ba as or, bb as ar, bc as nr, bd as ir, be as dr, bf as cr, p as We, ad as Ue, i as pr, bg as Ke, bh as de, bi as ce, bj as pe, ak as Se, Q as qe, a4 as Ge, j as Je, aI as Te, bk as ur, bl as xr, a5 as ge, X as gr, aa as Qe, U as Be, ah as hr, ae as yr, bm as br, ar as mr, as as fr, at as vr, au as wr, av as V, bn as et, ax as jr, ay as Cr, az as De, aA as $e } from "./index-niHREMmR.js";
9
- import { u as kr } from "./controls-XPXGHKht.js";
10
- import { Check as Nr, EditIcon as _r, TrashIcon as Sr } from "lucide-react";
11
- import { getBlockComponent as tt, getChaiDataProviders as Tr } from "@chaibuilder/runtime";
12
- import { E as rt, u as lt } from "./index-pZhGT8uT.js";
13
- import { J as Rr, a as Vr, d as Hr } from "./index-e0c8PmRQ.js";
14
- import Br from "@rjsf/core";
15
- import Dr from "@rjsf/validator-ajv8";
16
- import { useAtom as $r } from "jotai";
17
- import Ir from "react-autosuggest";
18
- import Ar from "fuse.js";
19
- import { A as Pr, C as he, g as Er } from "./utils-AvyFzbPC.js";
20
- import { a as Lr } from "./MODIFIERS-RiXS5Mn1.js";
7
+ import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, WidthIcon as T, HeightIcon as R, ArrowUpIcon as Q, ArrowRightIcon as ee, ArrowDownIcon as te, ArrowLeftIcon as re, ArrowTopLeftIcon as Nt, ArrowTopRightIcon as _t, ArrowBottomRightIcon as St, ArrowBottomLeftIcon as Tt, AlignLeftIcon as Rt, AlignCenterHorizontallyIcon as Vt, AlignRightIcon as Ht, StretchHorizontallyIcon as Bt, FontItalicIcon as Dt, UnderlineIcon as $t, OverlineIcon as It, LetterCaseUppercaseIcon as Pt, Cross1Icon as At, InfoCircledIcon as _e, MinusIcon as Et, BoxIcon as ze, RowSpacingIcon as Lt, TriangleDownIcon as Mt, CrossCircledIcon as Ot, TrashIcon as Yt, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
8
+ import { aS as Ft, aT as Xt, B as xe, aU as zt, aV as Zt, aW as Wt, aX as Ut, aY as Kt, aZ as qt, a_ as Gt, $ as q, ae as Jt, af as Qt, ag as er, a$ as tr, ac as rr, b0 as lr, ad as sr, au as X, av as z, aw as Z, b1 as or, b2 as ar, b3 as nr, b4 as ir, b5 as dr, b6 as cr, a4 as We, a3 as pr, i as ur, b7 as Ue, b8 as de, b9 as ce, ba as pe, ab as Se, L as Ke, Y as qe, j as Ge, ay as Te, bb as xr, m as gr, bc as hr, Z as ge, R as yr, a2 as Je, M as Be, a8 as mr, a5 as br, bd as fr, ai as vr, aj as wr, ak as jr, al as Cr, am as H, be as Qe, ao as kr, ap as Nr, aq as De, ar as $e } from "./index-pNYv0oAF.js";
9
+ import { u as _r } from "./empty-slot-MWycClTb.js";
10
+ import { Check as Sr, EditIcon as Tr, TrashIcon as Rr } from "lucide-react";
11
+ import { getBlockComponent as et, getChaiDataProviders as Vr } from "@chaibuilder/runtime";
12
+ import { E as tt, u as rt } from "./index-Fj3ead-J.js";
13
+ import { J as Hr, a as Br, d as Dr } from "./index-e0c8PmRQ.js";
14
+ import $r from "@rjsf/core";
15
+ import Ir from "@rjsf/validator-ajv8";
16
+ import { useAtom as Pr } from "jotai";
17
+ import Ar from "react-autosuggest";
18
+ import Er from "fuse.js";
19
+ import { A as Lr, C as he, g as Mr } from "./Class-17XFhL48.js";
20
+ import { a as Or } from "./MODIFIERS-RiXS5Mn1.js";
21
21
  import "./_commonjsHelpers-UyOWmZb0.js";
22
+ import "./Functions-7jnEwJyw.js";
23
+ import "clsx";
24
+ import "tailwind-merge";
25
+ import "flat-to-nested";
22
26
  import "@radix-ui/react-toggle";
23
27
  import "class-variance-authority";
24
28
  import "@radix-ui/react-switch";
@@ -42,12 +46,6 @@ import "@radix-ui/react-context-menu";
42
46
  import "react-icons-picker";
43
47
  import "react-dom";
44
48
  import "react-quill";
45
- import "flat-to-nested";
46
- import "./Functions-7jnEwJyw.js";
47
- import "clsx";
48
- import "tailwind-merge";
49
- import "redux-undo";
50
- import "lodash";
51
49
  import "i18next";
52
50
  import "@floating-ui/react-dom";
53
51
  import "react-textarea-autosize";
@@ -59,29 +57,29 @@ import "sonner";
59
57
  import "./html-to-json-57841sEK.js";
60
58
  import "himalaya";
61
59
  import "./web-blocks.js";
62
- function Mr(r) {
63
- const s = [], t = {};
64
- function o(l, d) {
60
+ function Yr(r) {
61
+ const o = [], t = {};
62
+ function s(l, d) {
65
63
  ke(d, (a, c) => {
66
- const i = l ? `${l}.${c}` : c, p = ie(a) ? "list" : typeof a;
67
- s.push(i), t[i] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ie(a) && o(i, a);
64
+ const n = l ? `${l}.${c}` : c, u = ie(a) ? "list" : typeof a;
65
+ o.push(n), t[n] = u === "string" ? "text" : u === "object" ? "model" : u, u === "object" && !ie(a) && s(n, a);
68
66
  });
69
67
  }
70
- return o("", pt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
68
+ return s("", ct(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: o, pathsType: t };
71
69
  }
72
- const je = ({ data: r, fullView: s }) => {
70
+ const je = ({ data: r, fullView: o }) => {
73
71
  if (!r)
74
72
  return null;
75
73
  const t = typeof r;
76
- return s ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
74
+ return o ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
77
75
  /* @__PURE__ */ e.jsx("div", { className: "h-3" }),
78
- /* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsx(
79
- Rr,
76
+ /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsx(
77
+ Hr,
80
78
  {
81
79
  data: r,
82
- shouldExpandNode: Vr,
80
+ shouldExpandNode: Br,
83
81
  style: {
84
- ...Hr,
82
+ ...Dr,
85
83
  container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
86
84
  stringValue: "text-orange-600",
87
85
  label: "text-green-900 font-semibold pr-1 tracking-wider"
@@ -91,40 +89,40 @@ const je = ({ data: r, fullView: s }) => {
91
89
  ] }) : /* @__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: [
92
90
  /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
93
91
  r
94
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: ut(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
92
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: pt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
95
93
  }, Ie = ({
96
94
  type: r,
97
- value: s = "",
95
+ value: o = "",
98
96
  setValue: t,
99
- data: o,
97
+ data: s,
100
98
  onChange: l,
101
99
  dataType: d,
102
100
  appliedBindings: a
103
101
  }) => {
104
- const { paths: c, pathsType: i } = Mr(o), p = r === "PROP" ? tt(o == null ? void 0 : o._type) : {}, y = r === "PROP", [n, h] = j(!1), g = _(() => r === "PROP" ? c.filter(
105
- (u) => !P(a, u) && x(p, `props.${ue(xt(u, "."))}.binding`)
106
- ) : c.filter((u) => d === x(i, u, "")), [r, c, a, d, p]);
102
+ const { paths: c, pathsType: n } = Yr(s), u = r === "PROP" ? et(s == null ? void 0 : s._type) : {}, y = r === "PROP", [i, h] = C(!1), g = _(() => r === "PROP" ? c.filter(
103
+ (p) => !E(a, p) && x(u, `props.${ue(ut(p, "."))}.binding`)
104
+ ) : c.filter((p) => d === x(n, p, "")), [r, c, a, d, u]);
107
105
  return O(() => {
108
- s && l(s);
109
- }, [s, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
106
+ o && l(o);
107
+ }, [o, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
110
108
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
111
- /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(le(r)) }),
112
- /* @__PURE__ */ e.jsxs(Yt, { open: n, onOpenChange: h, children: [
113
- /* @__PURE__ */ e.jsx(Ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
109
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: F(le(r)) }),
110
+ /* @__PURE__ */ e.jsxs(Ft, { open: i, onOpenChange: h, children: [
111
+ /* @__PURE__ */ e.jsx(Xt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
114
112
  xe,
115
113
  {
116
114
  variant: "outline",
117
115
  size: "sm",
118
- className: ` ${m(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"}`,
119
- children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
116
+ className: ` ${f(o) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
117
+ children: o ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
120
118
  /* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
121
- y && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(d) }),
122
- s
119
+ y && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(d) }),
120
+ o
123
121
  ] }),
124
122
  /* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
125
123
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
126
124
  "+ Set ",
127
- Y(le(r))
125
+ F(le(r))
128
126
  ] })
129
127
  }
130
128
  ) }),
@@ -132,50 +130,50 @@ const je = ({ data: r, fullView: s }) => {
132
130
  /* @__PURE__ */ e.jsx(Wt, { placeholder: `Choose ${le(r)}...` }),
133
131
  /* @__PURE__ */ e.jsxs(Ut, { children: [
134
132
  /* @__PURE__ */ e.jsx(Kt, { children: "No results found." }),
135
- /* @__PURE__ */ e.jsx(qt, { children: C(g, (u) => /* @__PURE__ */ e.jsxs(
133
+ /* @__PURE__ */ e.jsx(qt, { children: k(g, (p) => /* @__PURE__ */ e.jsxs(
136
134
  Gt,
137
135
  {
138
- value: u,
136
+ value: p,
139
137
  className: `cursor-pointer ${y ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
140
- onSelect: (f) => {
141
- t(gt(g, (k) => k === f) || null), h(!1);
138
+ onSelect: (b) => {
139
+ t(xt(g, (w) => w === b) || null), h(!1);
142
140
  },
143
141
  children: [
144
142
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
145
- /* @__PURE__ */ e.jsx(Nr, { className: `h-4 w-4 text-green-500 ${s === u ? "" : "opacity-0"}` }),
146
- u
143
+ /* @__PURE__ */ e.jsx(Sr, { className: `h-4 w-4 text-green-500 ${o === p ? "" : "opacity-0"}` }),
144
+ p
147
145
  ] }),
148
- y ? /* @__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: Y(x(i, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: x(o, u) }) })
146
+ y ? /* @__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: F(x(n, p, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: x(s, p) }) })
149
147
  ]
150
148
  },
151
- u
149
+ p
152
150
  )) })
153
151
  ] })
154
152
  ] }) })
155
153
  ] })
156
154
  ] }),
157
- !y && !m(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: x(o, s, ""), fullView: !0 }) })
155
+ !y && !f(o) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: x(s, o, ""), fullView: !0 }) })
158
156
  ] });
159
- }, Or = ({
157
+ }, Fr = ({
160
158
  appliedBindings: r = [],
161
- onAddBinding: s,
159
+ onAddBinding: o,
162
160
  editMode: t,
163
- item: o
161
+ item: s
164
162
  }) => {
165
- const [l, d] = j(t ? o.key : ""), [a, c] = j(t ? o.value : ""), i = q(), [p] = lt(), y = B(
166
- (g, u) => {
167
- if (m(g))
163
+ const [l, d] = C(t ? s.key : ""), [a, c] = C(t ? s.value : ""), n = q(), [u] = rt(), y = V(
164
+ (g, p) => {
165
+ if (f(g))
168
166
  return "";
169
167
  {
170
- const f = x(u === "PROP" ? i : p, g, "");
171
- if (ie(f))
168
+ const b = x(p === "PROP" ? n : u, g, "");
169
+ if (ie(b))
172
170
  return "list";
173
- const k = typeof f;
174
- return k === "string" ? "text" : k === "object" ? "model" : k;
171
+ const w = typeof b;
172
+ return w === "string" ? "text" : w === "object" ? "model" : w;
175
173
  }
176
174
  },
177
- [i, p]
178
- ), [n, h] = j(t ? y(o.key, "PROP") : "");
175
+ [n, u]
176
+ ), [i, h] = C(t ? y(s.key, "PROP") : "");
179
177
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
180
178
  /* @__PURE__ */ e.jsxs(Jt, { children: [
181
179
  /* @__PURE__ */ e.jsx(Qt, { children: "Add Data Binding" }),
@@ -191,11 +189,11 @@ const je = ({ data: r, fullView: s }) => {
191
189
  value: l,
192
190
  setValue: d,
193
191
  onChange: (g) => {
194
- const u = y(g, "PROP");
195
- d(g), n !== u && c(""), h(u);
192
+ const p = y(g, "PROP");
193
+ d(g), i !== p && c(""), h(p);
196
194
  },
197
- data: i,
198
- dataType: n,
195
+ data: n,
196
+ dataType: i,
199
197
  appliedBindings: r
200
198
  }
201
199
  ),
@@ -204,16 +202,16 @@ const je = ({ data: r, fullView: s }) => {
204
202
  Ie,
205
203
  {
206
204
  type: "PATH",
207
- isDisabled: m(l),
205
+ isDisabled: f(l),
208
206
  placeholder: "Enter data path",
209
207
  value: a,
210
208
  setValue: c,
211
209
  onChange: (g) => {
212
- const u = y(g, "PATH");
213
- c(n === u ? g : "");
210
+ const p = y(g, "PATH");
211
+ c(i === p ? g : "");
214
212
  },
215
- data: p,
216
- dataType: n,
213
+ data: u,
214
+ dataType: i,
217
215
  appliedBindings: r
218
216
  }
219
217
  )
@@ -223,145 +221,145 @@ const je = ({ data: r, fullView: s }) => {
223
221
  {
224
222
  type: "submit",
225
223
  className: "mt-4",
226
- disabled: m(l) && m(a),
227
- onClick: () => s({ key: l, value: a }),
224
+ disabled: f(l) && f(a),
225
+ onClick: () => o({ key: l, value: a }),
228
226
  children: "Save"
229
227
  }
230
228
  ) })
231
229
  ] });
232
- }, st = ({ disabled: r, children: s, onAddBinding: t, appliedBindings: o, editMode: l = !0, item: d = {} }) => {
233
- const [a, c] = j(!1);
230
+ }, lt = ({ disabled: r, children: o, onAddBinding: t, appliedBindings: s, editMode: l = !0, item: d = {} }) => {
231
+ const [a, c] = C(!1);
234
232
  return /* @__PURE__ */ e.jsxs(rr, { children: [
235
- /* @__PURE__ */ e.jsx(lr, { disabled: r, asChild: !0, onClick: () => c(!0), children: s }),
233
+ /* @__PURE__ */ e.jsx(lr, { disabled: r, asChild: !0, onClick: () => c(!0), children: o }),
236
234
  a && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
237
- Or,
235
+ Fr,
238
236
  {
239
237
  item: d,
240
238
  editMode: l,
241
- appliedBindings: o,
242
- onAddBinding: (i) => {
243
- t(i), c(!1);
239
+ appliedBindings: s,
240
+ onAddBinding: (n) => {
241
+ t(n), c(!1);
244
242
  }
245
243
  }
246
244
  ) })
247
245
  ] });
248
246
  }, Xr = ({
249
247
  item: r,
250
- onAddBinding: s,
248
+ onAddBinding: o,
251
249
  onRemove: t,
252
- selectedBlock: o,
250
+ selectedBlock: s,
253
251
  dataProvider: l,
254
252
  appliedBindings: d
255
253
  }) => {
256
- const [a, c] = j("string"), i = (p, y) => {
257
- if (m(p))
254
+ const [a, c] = C("string"), n = (u, y) => {
255
+ if (f(u))
258
256
  return "";
259
257
  {
260
- const n = x(y === "PROP" ? o : l, p, "");
261
- if (ie(n))
258
+ const i = x(y === "PROP" ? s : l, u, "");
259
+ if (ie(i))
262
260
  return "list";
263
- const h = typeof n;
261
+ const h = typeof i;
264
262
  return h === "string" ? "text" : h === "object" ? "model" : h;
265
263
  }
266
264
  };
267
- return O(() => c(() => i(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
265
+ return O(() => c(() => n(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
268
266
  /* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
269
267
  /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
270
268
  /* @__PURE__ */ e.jsx(je, { data: x(l, r.value, "") }),
271
269
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
272
- /* @__PURE__ */ e.jsx(st, { editMode: !0, onAddBinding: s, appliedBindings: d, item: r, children: /* @__PURE__ */ e.jsx(_r, { 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" }) }),
270
+ /* @__PURE__ */ e.jsx(lt, { editMode: !0, onAddBinding: o, appliedBindings: d, item: r, children: /* @__PURE__ */ e.jsx(Tr, { 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" }) }),
273
271
  /* @__PURE__ */ e.jsx(
274
- Sr,
272
+ Rr,
275
273
  {
276
274
  onClick: () => t(),
277
275
  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"
278
276
  }
279
277
  )
280
278
  ] }),
281
- !m(a) && !m(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: Y(a) })
279
+ !f(a) && !f(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: F(a) })
282
280
  ] });
283
- }, Yr = ({ bindingData: r, onChange: s }) => {
284
- const t = q(), [o] = lt(), l = Tr(), [d, a] = j(
285
- C(r, (n, h) => ({ key: h, value: n }))
281
+ }, zr = ({ bindingData: r, onChange: o }) => {
282
+ const t = q(), [s] = rt(), l = Vr(), [d, a] = C(
283
+ k(r, (i, h) => ({ key: h, value: i }))
286
284
  );
287
285
  O(() => {
288
- a(C(r, (n, h) => ({ key: h, value: n })));
289
- }, [t == null ? void 0 : t._id]);
286
+ a(k(r, (i, h) => ({ key: h, value: i })));
287
+ }, [t == null ? void 0 : t._id, r]);
290
288
  const c = _(() => {
291
- if (m(o))
289
+ if (f(s))
292
290
  return !0;
293
- if (m(d))
291
+ if (f(d))
294
292
  return !1;
295
- const n = ve(d);
296
- return m(n == null ? void 0 : n.key) || m(n == null ? void 0 : n.value);
297
- }, [o, d]), i = (n) => {
298
- const h = we(d, (g) => g.key !== n.key);
299
- a([...h, n]), y([...h, n]);
300
- }, p = (n) => {
301
- const h = we(d, (g, u) => n !== u);
293
+ const i = ve(d);
294
+ return f(i == null ? void 0 : i.key) || f(i == null ? void 0 : i.value);
295
+ }, [s, d]), n = (i) => {
296
+ const h = we(d, (g) => g.key !== i.key);
297
+ a([...h, i]), y([...h, i]);
298
+ }, u = (i) => {
299
+ const h = we(d, (g, p) => i !== p);
302
300
  y([...h]);
303
- }, y = B(
304
- (n = []) => {
305
- if (a(n), m(n)) {
306
- s({});
301
+ }, y = V(
302
+ (i = []) => {
303
+ if (a(i), f(i)) {
304
+ o({});
307
305
  return;
308
306
  }
309
307
  const h = {};
310
- ke(n, (g) => {
311
- !m(g == null ? void 0 : g.key) && !m(g == null ? void 0 : g.value) && Oe(h, g.key, g.value);
312
- }), s(h);
308
+ ke(i, (g) => {
309
+ !f(g == null ? void 0 : g.key) && !f(g == null ? void 0 : g.value) && Oe(h, g.key, g.value);
310
+ }), o(h);
313
311
  },
314
- [s]
312
+ [o]
315
313
  );
316
- return m(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: [
314
+ return f(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: [
317
315
  "You have no data providers registered. Please add a data provider to your project. ",
318
316
  /* @__PURE__ */ e.jsx("br", {}),
319
317
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
320
318
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
321
- C(d, (n, h) => /* @__PURE__ */ e.jsx(
319
+ k(d, (i, h) => /* @__PURE__ */ e.jsx(
322
320
  Xr,
323
321
  {
324
- item: n,
325
- onAddBinding: i,
326
- onRemove: () => p(h),
322
+ item: i,
323
+ onAddBinding: n,
324
+ onRemove: () => u(h),
327
325
  selectedBlock: t,
328
- dataProvider: o,
329
- appliedBindings: C(d, "key")
326
+ dataProvider: s,
327
+ appliedBindings: k(d, "key")
330
328
  },
331
- n.key
329
+ i.key
332
330
  )),
333
- /* @__PURE__ */ e.jsxs(F, { delayDuration: 200, children: [
334
- /* @__PURE__ */ e.jsx(z, { className: "w-full", children: /* @__PURE__ */ e.jsx(
335
- st,
331
+ /* @__PURE__ */ e.jsxs(X, { delayDuration: 200, children: [
332
+ /* @__PURE__ */ e.jsx(z, { disabled: f(s), className: "w-full", children: /* @__PURE__ */ e.jsx(
333
+ lt,
336
334
  {
337
335
  disabled: c,
338
- appliedBindings: C(d, "key"),
339
- onAddBinding: i,
336
+ appliedBindings: k(d, "key"),
337
+ onAddBinding: n,
340
338
  children: /* @__PURE__ */ e.jsx(
341
339
  "span",
342
340
  {
343
341
  className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${c ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
344
- children: m(o) ? /* @__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"
342
+ children: f(s) ? /* @__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"
345
343
  }
346
344
  )
347
345
  }
348
346
  ) }),
349
- c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: m(o) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
347
+ c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: f(s) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
350
348
  ] })
351
349
  ] });
352
- }, Fr = () => /* @__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" }), be = ct(({ createHistorySnapshot: r, properties: s, formData: t, onChange: o }) => {
353
- const l = { type: "object", properties: {} }, d = {};
354
- return Object.keys(s).forEach((a) => {
355
- const c = s[a];
356
- if (P(["slot", "styles"], c.type))
350
+ }, Zr = () => /* @__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 = dt(({ properties: r, formData: o, onChange: t }) => {
351
+ const s = { type: "object", properties: {} }, l = {};
352
+ return Object.keys(r).forEach((d) => {
353
+ const a = r[d];
354
+ if (E(["slot", "styles"], a.type))
357
355
  return;
358
- const i = a;
359
- l.properties[i] = or(c), d[i] = ar(c);
356
+ const c = d;
357
+ s.properties[c] = or(a), l[c] = ar(a);
360
358
  }), /* @__PURE__ */ e.jsx(
361
- Br,
359
+ $r,
362
360
  {
363
361
  widgets: {
364
- binding: Fr,
362
+ binding: Zr,
365
363
  richtext: nr,
366
364
  icon: ir,
367
365
  image: dr
@@ -372,58 +370,59 @@ const je = ({ data: r, fullView: s }) => {
372
370
  omitExtraData: !1,
373
371
  liveOmit: !1,
374
372
  liveValidate: !1,
375
- validator: Dr,
376
- uiSchema: d,
377
- onBlur: r,
378
- schema: l,
379
- formData: t,
380
- onChange: o
373
+ validator: Ir,
374
+ uiSchema: l,
375
+ schema: s,
376
+ formData: o,
377
+ onChange: t
381
378
  }
382
379
  );
383
380
  });
384
- function zr() {
385
- const r = q(), { createSnapshot: s } = We(), t = Ue(), o = tt(r._type), l = { ...r }, d = pr("dataBindingSupport", !1), a = () => s(), c = ({ formData: n }, h) => {
386
- if (h) {
387
- const g = h.replace("root.", "");
388
- t([r._id], { [g]: x(n, g) });
381
+ function Wr() {
382
+ const r = q(), o = We(), t = pr(), s = et(r._type), l = { ...r }, [d, a] = C(l), c = ur("dataBindingSupport", !1), n = ({ formData: p }, b, w) => {
383
+ if (b) {
384
+ const D = b.replace("root.", "");
385
+ t([r._id], { [D]: x(p, D) }, w);
386
+ }
387
+ }, u = V(
388
+ gt(({ formData: p }, b, w) => {
389
+ n({ formData: p }, b, w), a(p);
390
+ }, 1500),
391
+ []
392
+ ), y = ({ formData: p }, b) => {
393
+ if (b) {
394
+ const w = b.replace("root.", "");
395
+ o([r._id], { [w]: x(p, w) }), u({ formData: p }, b, { [w]: x(d, w) });
389
396
  }
390
397
  }, i = {
391
- _name: kr({
398
+ _name: _r({
392
399
  title: "Name",
393
400
  default: x(r, "_name", r._type)
394
401
  })
395
- }, p = ht(x(l, "_bindings", {})), y = _(() => {
396
- const n = yt(x(o, "props", {}));
397
- return d && bt(p, (h) => delete n[h]), n;
398
- }, [o, p, d]);
402
+ }, h = ht(x(l, "_bindings", {})), g = _(() => {
403
+ const p = yt(x(s, "props", {}));
404
+ return c && mt(h, (b) => delete p[b]), p;
405
+ }, [s, h, c]);
399
406
  return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
400
- /* @__PURE__ */ e.jsx(
401
- be,
402
- {
403
- onChange: c,
404
- createHistorySnapshot: a,
405
- formData: l,
406
- properties: i
407
- }
408
- ),
407
+ /* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: i }),
409
408
  /* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
410
- d ? /* @__PURE__ */ e.jsxs(Ke, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
409
+ c ? /* @__PURE__ */ e.jsxs(Ue, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
411
410
  /* @__PURE__ */ e.jsxs(de, { value: "BINDING", children: [
412
411
  /* @__PURE__ */ e.jsx(ce, { 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: [
413
412
  /* @__PURE__ */ e.jsx(
414
413
  "div",
415
414
  {
416
- className: `h-[8px] w-[8px] rounded-full ${m(x(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
415
+ className: `h-[8px] w-[8px] rounded-full ${f(x(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
417
416
  }
418
417
  ),
419
418
  "Data Binding"
420
419
  ] }) }),
421
420
  /* @__PURE__ */ e.jsx(pe, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
422
- Yr,
421
+ zr,
423
422
  {
424
- bindingData: x(l, "_bindings", {}),
425
- onChange: (n) => {
426
- c({ formData: { ...l, _bindings: n } }, "root._bindings");
423
+ bindingData: x(r, "_bindings", {}),
424
+ onChange: (p) => {
425
+ n({ formData: { _bindings: p } }, "root._bindings");
427
426
  }
428
427
  }
429
428
  ) })
@@ -434,72 +433,56 @@ function zr() {
434
433
  "Static Content"
435
434
  ] }) }),
436
435
  /* @__PURE__ */ e.jsxs(pe, { className: "pt-4", children: [
437
- m(p) ? 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: [
436
+ f(h) ? 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: [
438
437
  "Data binding is set for ",
439
- /* @__PURE__ */ e.jsx("b", { children: C(p, mt).join(", ") }),
438
+ /* @__PURE__ */ e.jsx("b", { children: k(h, bt).join(", ") }),
440
439
  " ",
441
- p.length === 1 ? "property" : "properties",
440
+ h.length === 1 ? "property" : "properties",
442
441
  ". Remove data binding to edit static content."
443
442
  ] }),
444
- /* @__PURE__ */ e.jsx(
445
- be,
446
- {
447
- onChange: c,
448
- createHistorySnapshot: a,
449
- formData: l,
450
- properties: y
451
- }
452
- )
443
+ /* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: g })
453
444
  ] })
454
445
  ] })
455
- ] }) : /* @__PURE__ */ e.jsx(
456
- be,
457
- {
458
- onChange: c,
459
- createHistorySnapshot: a,
460
- formData: l,
461
- properties: y
462
- }
463
- ),
446
+ ] }) : /* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: g }),
464
447
  /* @__PURE__ */ e.jsx("div", { className: "pb-60" })
465
448
  ] });
466
449
  }
467
- const Ae = new Ar(Pr, {
450
+ const Pe = new Er(Lr, {
468
451
  isCaseSensitive: !1,
469
452
  threshold: 0.2,
470
453
  minMatchCharLength: 2,
471
454
  keys: ["name"]
472
455
  });
473
- function Zr() {
474
- var E;
475
- const [r] = Se(), s = q(), t = qe(), o = Ge(), [l] = Je(), [d, a] = j(""), c = (E = ue(r)) == null ? void 0 : E.prop, i = ft((x(s, c, "").replace(Lr, "").split(",").pop() || "").split(" "), m), p = () => {
476
- const w = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
477
- t(l, w, !0), a("");
478
- }, [y, n] = j([]), h = ({ value: w }) => {
479
- const $ = w.trim().toLowerCase(), L = $.match(/.+:/g);
456
+ function Ur() {
457
+ var D;
458
+ const [r] = Se(), o = q(), t = Ke(), s = qe(), [l] = Ge(), [d, a] = C(""), c = (D = ue(r)) == null ? void 0 : D.prop, n = ft((x(o, c, "").replace(Or, "").split(",").pop() || "").split(" "), f), u = () => {
459
+ const j = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
460
+ t(l, j, !0), a("");
461
+ }, [y, i] = C([]), h = ({ value: j }) => {
462
+ const I = j.trim().toLowerCase(), L = I.match(/.+:/g);
480
463
  let N = [];
481
464
  if (L && L.length > 0) {
482
- const [D] = L, X = $.replace(D, "");
483
- N = Ae.search(X).map((b) => ({
484
- ...b,
485
- item: { ...b.item, name: D + b.item.name }
465
+ const [$] = L, Y = I.replace($, "");
466
+ N = Pe.search(Y).map((m) => ({
467
+ ...m,
468
+ item: { ...m.item, name: $ + m.item.name }
486
469
  }));
487
470
  } else
488
- N = Ae.search($);
489
- n(C(N, "item"));
471
+ N = Pe.search(I);
472
+ i(k(N, "item"));
490
473
  }, g = () => {
491
- n([]);
492
- }, u = (w) => w.name, f = (w) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: w.name }), k = {
474
+ i([]);
475
+ }, p = (j) => j.name, b = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), w = {
493
476
  autoComplete: "off",
494
477
  autoCorrect: "off",
495
478
  autoCapitalize: "off",
496
479
  spellCheck: !1,
497
480
  placeholder: "Enter class name",
498
481
  value: d,
499
- onKeyDown: (w) => {
500
- w.key === "Enter" && d.trim() !== "" && p();
482
+ onKeyDown: (j) => {
483
+ j.key === "Enter" && d.trim() !== "" && u();
501
484
  },
502
- onChange: (w, { newValue: $ }) => a($),
485
+ onChange: (j, { newValue: I }) => a(I),
503
486
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
504
487
  };
505
488
  return /* @__PURE__ */ e.jsxs(
@@ -510,14 +493,14 @@ function Zr() {
510
493
  /* @__PURE__ */ e.jsx(Te, { className: "mt-2", children: "Add Tailwind classes" }),
511
494
  /* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
512
495
  /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
513
- Ir,
496
+ Ar,
514
497
  {
515
498
  suggestions: y,
516
499
  onSuggestionsFetchRequested: h,
517
500
  onSuggestionsClearRequested: g,
518
- getSuggestionValue: u,
519
- renderSuggestion: f,
520
- inputProps: k,
501
+ getSuggestionValue: p,
502
+ renderSuggestion: b,
503
+ inputProps: w,
521
504
  containerProps: {
522
505
  className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
523
506
  },
@@ -533,7 +516,7 @@ function Zr() {
533
516
  {
534
517
  variant: "outline",
535
518
  className: "h-6 border-gray-700",
536
- onClick: p,
519
+ onClick: u,
537
520
  disabled: d.trim() === "",
538
521
  size: "sm",
539
522
  children: /* @__PURE__ */ e.jsx(Ne, {})
@@ -541,24 +524,24 @@ function Zr() {
541
524
  )
542
525
  ] }),
543
526
  /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
544
- m(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" }),
527
+ f(n) && /* @__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" }),
545
528
  ne.Children.toArray(
546
- i.map((w) => /* @__PURE__ */ e.jsxs(
529
+ n.map((j) => /* @__PURE__ */ e.jsxs(
547
530
  "div",
548
531
  {
549
532
  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",
550
533
  children: [
551
- w,
534
+ j,
552
535
  /* @__PURE__ */ e.jsx(
553
- Fe,
536
+ Xe,
554
537
  {
555
- onClick: () => o(l, [w]),
538
+ onClick: () => s(l, [j]),
556
539
  className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
557
540
  }
558
541
  )
559
542
  ]
560
543
  },
561
- w
544
+ j
562
545
  ))
563
546
  )
564
547
  ] })
@@ -566,16 +549,16 @@ function Zr() {
566
549
  }
567
550
  );
568
551
  }
569
- const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
552
+ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
570
553
  heading: "flex.heading",
571
554
  items: [
572
- { type: "arbitrary", label: "flex.basis", units: H, property: "flexBasis" },
555
+ { type: "arbitrary", label: "flex.basis", units: B, property: "flexBasis" },
573
556
  { type: "range", label: "flex.order", property: "order" },
574
557
  { type: "dropdown", label: "flex.flex", property: "flexGrowShrink" },
575
558
  { type: "dropdown", label: "flex.grow", property: "flexGrow" },
576
559
  { type: "dropdown", label: "flex.shrink", property: "flexShrink" }
577
560
  ]
578
- }, Ur = {
561
+ }, qr = {
579
562
  heading: "grid.heading",
580
563
  items: [
581
564
  { type: "range", label: "grid.col_span", property: "gridColSpan" },
@@ -586,17 +569,17 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
586
569
  { type: "range", label: "grid.row_end", property: "gridRowEnd" },
587
570
  { type: "range", label: "grid.order", property: "order" }
588
571
  ]
589
- }, Kr = [
572
+ }, Gr = [
590
573
  {
591
574
  heading: "layout.heading",
592
575
  items: [
593
- { type: "arbitrary", label: "layout.width", units: H.concat("auto"), property: "width" },
594
- { type: "arbitrary", label: "layout.height", units: H.concat("auto"), property: "height" },
576
+ { type: "arbitrary", label: "layout.width", units: B.concat("auto"), property: "width" },
577
+ { type: "arbitrary", label: "layout.height", units: B.concat("auto"), property: "height" },
595
578
  {
596
579
  styleType: "multiple",
597
580
  label: "layout.margin",
598
581
  negative: !0,
599
- units: [...H, "auto"],
582
+ units: [...B, "auto"],
600
583
  options: [
601
584
  { key: "margin", label: "layout.margin_all" },
602
585
  { key: "marginX", label: "layout.margin_lr" },
@@ -637,16 +620,16 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
637
620
  styleType: "accordion",
638
621
  heading: "size.min_width_height",
639
622
  items: [
640
- { type: "arbitrary", label: "size.min_width", units: H.concat("auto"), property: "minWidth" },
641
- { type: "arbitrary", label: "size.min_height", units: H.concat("auto"), property: "minHeight" }
623
+ { type: "arbitrary", label: "size.min_width", units: B.concat("auto"), property: "minWidth" },
624
+ { type: "arbitrary", label: "size.min_height", units: B.concat("auto"), property: "minHeight" }
642
625
  ]
643
626
  },
644
627
  {
645
628
  styleType: "accordion",
646
629
  heading: "size.max_width_height",
647
630
  items: [
648
- { type: "arbitrary", label: "size.max_width", units: H.concat("auto"), property: "maxWidth" },
649
- { type: "arbitrary", label: "size.max_height", units: H.concat("auto"), property: "maxHeight" }
631
+ { type: "arbitrary", label: "size.max_width", units: B.concat("auto"), property: "maxWidth" },
632
+ { type: "arbitrary", label: "size.max_height", units: B.concat("auto"), property: "maxHeight" }
650
633
  ]
651
634
  },
652
635
  {
@@ -663,7 +646,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
663
646
  {
664
647
  heading: "display.heading",
665
648
  items: [
666
- { type: "dropdown", label: "display.display", property: "display", units: H },
649
+ { type: "dropdown", label: "display.display", property: "display", units: B },
667
650
  {
668
651
  styleType: "accordion",
669
652
  heading: "display.flex_options",
@@ -714,7 +697,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
714
697
  styleType: "accordion",
715
698
  heading: "display.visibility_opacity",
716
699
  items: [
717
- { type: "dropdown", label: "display.visibility", property: "visibility", units: H },
700
+ { type: "dropdown", label: "display.visibility", property: "visibility", units: B },
718
701
  { type: "arbitrary", label: "display.opacity", property: "opacity", units: ["-"] }
719
702
  ]
720
703
  }
@@ -790,8 +773,8 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
790
773
  heading: "typography.heading",
791
774
  items: [
792
775
  { type: "dropdown", property: "fontFamily", label: "typography.font" },
793
- { type: "arbitrary", property: "fontSize", label: "typography.size", units: H },
794
- { type: "arbitrary", property: "lineHeight", label: "typography.height", units: H.concat("-") },
776
+ { type: "arbitrary", property: "fontSize", label: "typography.size", units: B },
777
+ { type: "arbitrary", property: "lineHeight", label: "typography.height", units: B.concat("-") },
795
778
  { type: "range", property: "fontWeight", label: "typography.weight" },
796
779
  { type: "color", property: "textColor", label: "typography.color" },
797
780
  {
@@ -988,9 +971,9 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
988
971
  },
989
972
  {
990
973
  heading: "classes.heading",
991
- items: [{ component: Zr }]
974
+ items: [{ component: Ur }]
992
975
  }
993
- ], ot = {
976
+ ], st = {
994
977
  "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" }) }),
995
978
  // visibility
996
979
  visible: kt,
@@ -1070,7 +1053,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
1070
1053
  underline: $t,
1071
1054
  overline: It,
1072
1055
  // transform
1073
- uppercase: At,
1056
+ uppercase: Pt,
1074
1057
  block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1075
1058
  /* @__PURE__ */ e.jsx(
1076
1059
  "path",
@@ -1111,7 +1094,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
1111
1094
  }
1112
1095
  )
1113
1096
  ] }),
1114
- "float-none": Fe,
1097
+ "float-none": Xe,
1115
1098
  // position
1116
1099
  fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1117
1100
  /* @__PURE__ */ e.jsx(
@@ -1183,15 +1166,15 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
1183
1166
  }
1184
1167
  )
1185
1168
  ] }),
1186
- static: Pt
1187
- }, oe = Me({ canReset: !1, canChange: !0 }), qr = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
1169
+ static: At
1170
+ }, oe = Me({ canReset: !1, canChange: !0 }), Jr = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
1188
1171
  // eslint-disable-next-line react/jsx-no-constructed-context-values
1189
- /* @__PURE__ */ e.jsx(oe.Provider, { value: { canReset: s, canChange: t }, children: r })
1190
- ), at = ({ label: r, property: s, onChange: t }) => {
1191
- const o = _(() => x(he, `${s}.classes`, [""]), [s]), l = ae(s), d = _(() => x(l, "cls", ""), [l]), { canChange: a } = se(oe), c = /\[.*\]/g.test(d);
1192
- return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1193
- /* @__PURE__ */ e.jsx(ur, { className: "w-[70%] rounded py-1", readOnly: !0, value: d }),
1194
- /* @__PURE__ */ e.jsxs(F, { delayDuration: 100, children: [
1172
+ /* @__PURE__ */ e.jsx(oe.Provider, { value: { canReset: o, canChange: t }, children: r })
1173
+ ), ot = ({ label: r, property: o, onChange: t }) => {
1174
+ const s = _(() => x(he, `${o}.classes`, [""]), [o]), l = ae(o), d = _(() => x(l, "cls", ""), [l]), { canChange: a } = se(oe), c = /\[.*\]/g.test(d);
1175
+ return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1176
+ /* @__PURE__ */ e.jsx(xr, { className: "w-[70%] rounded py-1", readOnly: !0, value: d }),
1177
+ /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1195
1178
  /* @__PURE__ */ e.jsx(z, { 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(_e, {}) }) }),
1196
1179
  /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
1197
1180
  ] })
@@ -1199,85 +1182,85 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
1199
1182
  Ce,
1200
1183
  {
1201
1184
  rounded: r,
1202
- onChange: (i) => t(i, s),
1185
+ onChange: (n) => t(n, o),
1203
1186
  selected: d,
1204
- options: o,
1187
+ options: s,
1205
1188
  disabled: !a
1206
1189
  }
1207
1190
  ) });
1208
1191
  };
1209
- function Ce({ selected: r, onChange: s, rounded: t = !1, options: o, disabled: l = !1 }) {
1210
- const d = r.replace(/.*:/g, "").trim(), { undo: a, redo: c } = We();
1192
+ function Ce({ selected: r, onChange: o, rounded: t = !1, options: s, disabled: l = !1 }) {
1193
+ const d = r.replace(/.*:/g, "").trim(), { undo: a, redo: c } = gr();
1211
1194
  return /* @__PURE__ */ e.jsxs(
1212
1195
  "select",
1213
1196
  {
1214
- disabled: !o.length || l,
1215
- className: `${t ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
1216
- onChange: (i) => s(i.target.value),
1217
- onKeyDown: (i) => {
1218
- i.ctrlKey && (i.key === "z" && a(), i.key === "y" && c());
1197
+ disabled: !s.length || l,
1198
+ 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`,
1199
+ onChange: (n) => o(n.target.value),
1200
+ onKeyDown: (n) => {
1201
+ n.ctrlKey && (n.key === "z" && a(), n.key === "y" && c());
1219
1202
  },
1220
1203
  value: d,
1221
1204
  children: [
1222
1205
  /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
1223
- I.Children.toArray(
1224
- o.map((i) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: i, children: i }))
1206
+ P.Children.toArray(
1207
+ s.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
1225
1208
  )
1226
1209
  ]
1227
1210
  }
1228
1211
  );
1229
1212
  }
1230
- const Gr = ({ property: r, onChange: s }) => {
1231
- const { canReset: t, canChange: o } = se(oe), l = ae(r), d = _(() => x(l, "cls", ""), [l]), a = _(() => x(he, `${r}.classes`, [""]), [r]), c = a.indexOf(d) > -1 ? a.indexOf(d) : 0, i = /\[.*\]/g.test(d);
1232
- 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: d }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1213
+ const Qr = ({ property: r, onChange: o }) => {
1214
+ const { canReset: t, canChange: s } = se(oe), l = ae(r), d = _(() => x(l, "cls", ""), [l]), a = _(() => x(he, `${r}.classes`, [""]), [r]), c = a.indexOf(d) > -1 ? a.indexOf(d) : 0, n = /\[.*\]/g.test(d);
1215
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: d }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1233
1216
  /* @__PURE__ */ e.jsx(
1234
1217
  "button",
1235
1218
  {
1236
1219
  type: "button",
1237
1220
  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",
1238
- disabled: !o && (!t || c - 1 < 0),
1239
- onClick: () => s(Ve(a, c - 1), r),
1221
+ disabled: !s && (!t || c - 1 < 0),
1222
+ onClick: () => o(Ve(a, c - 1), r),
1240
1223
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1241
1224
  Et,
1242
1225
  {
1243
- className: !o && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1226
+ className: !s && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1244
1227
  }
1245
1228
  ) })
1246
1229
  }
1247
1230
  ),
1248
- /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(at, { label: !1, property: r, onChange: s }) }),
1231
+ /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(ot, { label: !1, property: r, onChange: o }) }),
1249
1232
  /* @__PURE__ */ e.jsx(
1250
1233
  "button",
1251
1234
  {
1252
1235
  type: "button",
1253
1236
  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",
1254
- disabled: !o && (!t || c + 1 >= a.length),
1255
- onClick: () => s(Ve(a, c + 1), r),
1237
+ disabled: !s && (!t || c + 1 >= a.length),
1238
+ onClick: () => o(Ve(a, c + 1), r),
1256
1239
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1257
1240
  Ne,
1258
1241
  {
1259
- className: !o && (!t || c + 1 >= a.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1242
+ className: !s && (!t || c + 1 >= a.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1260
1243
  }
1261
1244
  ) })
1262
1245
  }
1263
1246
  )
1264
1247
  ] }) });
1265
- }, Jr = ({ property: r, onChange: s }) => {
1266
- const t = _(() => x(he, `${r}.classes`, [""]), [r]), { canChange: o } = se(oe), l = ae(r), d = _(() => x(l, "cls", ""), [l]);
1267
- return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (a) => /* @__PURE__ */ e.jsxs(F, { children: [
1248
+ }, el = ({ property: r, onChange: o }) => {
1249
+ const t = _(() => x(he, `${r}.classes`, [""]), [r]), { canChange: s } = se(oe), l = ae(r), d = _(() => x(l, "cls", ""), [l]);
1250
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (a) => /* @__PURE__ */ e.jsxs(X, { children: [
1268
1251
  /* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1269
1252
  "button",
1270
1253
  {
1271
1254
  type: "button",
1272
- disabled: !o,
1273
- onClick: () => s(a, r),
1255
+ disabled: !s,
1256
+ onClick: () => o(a, r),
1274
1257
  className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${d === a ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1275
- children: I.createElement(x(ot, a, ze))
1258
+ children: P.createElement(x(st, a, ze))
1276
1259
  }
1277
1260
  ) }),
1278
- /* @__PURE__ */ e.jsx(Z, { children: Y(le(a)) })
1261
+ /* @__PURE__ */ e.jsx(Z, { children: F(le(a)) })
1279
1262
  ] })) });
1280
- }, Qr = {
1263
+ }, tl = {
1281
1264
  backgroundColor: "bg",
1282
1265
  textColor: "text",
1283
1266
  borderColor: "border",
@@ -1289,32 +1272,32 @@ const Gr = ({ property: r, onChange: s }) => {
1289
1272
  toColor: "to",
1290
1273
  ringColor: "ring",
1291
1274
  ringOffsetColor: "ring-offset"
1292
- }, el = ({ property: r, onChange: s }) => {
1293
- const t = ae(r), o = _(() => x(t, "cls", ""), [t]), { canChange: l } = se(oe), [d, a] = j([]), [c, i] = j({ color: "", shade: "" }), p = o.split("-"), y = x(p, "1", ""), n = x(p, "2", ""), h = B(
1275
+ }, rl = ({ property: r, onChange: o }) => {
1276
+ const t = ae(r), s = _(() => x(t, "cls", ""), [t]), { canChange: l } = se(oe), [d, a] = C([]), [c, n] = C({ color: "", shade: "" }), u = s.split("-"), y = x(u, "1", ""), i = x(u, "2", ""), h = V(
1294
1277
  // eslint-disable-next-line no-shadow
1295
- (u) => {
1296
- ["current", "inherit", "transparent", "black", "white"].includes(u) ? (a([]), i({ color: u })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), i((f) => ({ ...f, color: u, shade: f.shade ? f.shade : "500" })));
1278
+ (p) => {
1279
+ ["current", "inherit", "transparent", "black", "white"].includes(p) ? (a([]), n({ color: p })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((b) => ({ ...b, color: p, shade: b.shade ? b.shade : "500" })));
1297
1280
  },
1298
- [a, i]
1281
+ [a, n]
1299
1282
  );
1300
1283
  O(() => {
1301
1284
  if (["current", "inherit", "transparent", "black", "white"].includes(y))
1302
1285
  return a([]);
1303
1286
  a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1304
1287
  }, [y]);
1305
- const g = B(
1288
+ const g = V(
1306
1289
  // eslint-disable-next-line no-shadow
1307
- (u) => {
1308
- i({ color: y, shade: u });
1290
+ (p) => {
1291
+ n({ color: y, shade: p });
1309
1292
  },
1310
1293
  [y]
1311
1294
  );
1312
1295
  return O(() => {
1313
- i({ color: "", shade: "" });
1296
+ n({ color: "", shade: "" });
1314
1297
  }, [t]), O(() => {
1315
- const f = `${x(Qr, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
1316
- f.match(new RegExp(x(he, `${r}.regExp`, ""))) && s(f, r);
1317
- }, [c, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1298
+ const b = `${x(tl, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
1299
+ b.match(new RegExp(x(he, `${r}.regExp`, ""))) && o(b, r);
1300
+ }, [c, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1318
1301
  /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
1319
1302
  Ce,
1320
1303
  {
@@ -1354,20 +1337,20 @@ const Gr = ({ property: r, onChange: s }) => {
1354
1337
  ]
1355
1338
  }
1356
1339
  ) }),
1357
- /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected: n, disabled: !y || !l, onChange: g, options: d }) })
1340
+ /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected: i, disabled: !y || !l, onChange: g, options: d }) })
1358
1341
  ] });
1359
- }, Pe = (r, s) => {
1342
+ }, Ae = (r, o) => {
1360
1343
  r = r.toLowerCase();
1361
1344
  let t = r.trim().replace(/ |\+/g, "");
1362
- if ((t === "auto" || t === "none") && s.includes(t))
1345
+ if ((t === "auto" || t === "none") && o.includes(t))
1363
1346
  return { value: "", unit: t };
1364
- const o = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
1365
- t = t.replace(o, "");
1366
- const l = r.match(o), d = l && l.length > 1, a = !m(t) && Number.isNaN(Number(t));
1347
+ const s = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
1348
+ t = t.replace(s, "");
1349
+ const l = r.match(s), d = l && l.length > 1, a = !f(t) && Number.isNaN(Number(t));
1367
1350
  return d || a ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
1368
1351
  };
1369
- const tl = (r) => {
1370
- const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1352
+ const ll = (r) => {
1353
+ const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1371
1354
  if (["auto", "none"].includes(t))
1372
1355
  return { value: "", unit: t };
1373
1356
  if (t === "px")
@@ -1376,22 +1359,22 @@ const tl = (r) => {
1376
1359
  return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
1377
1360
  if (t === "full")
1378
1361
  return { value: "100", unit: "%" };
1379
- if (P(r, "skew-"))
1380
- return { value: `${s}${t}`, unit: "deg" };
1381
- if (P(r, "rotate-"))
1382
- return { value: `${s}${t}`, unit: "deg" };
1383
- if (P(r, "opacity-"))
1362
+ if (E(r, "skew-"))
1363
+ return { value: `${o}${t}`, unit: "deg" };
1364
+ if (E(r, "rotate-"))
1365
+ return { value: `${o}${t}`, unit: "deg" };
1366
+ if (E(r, "opacity-"))
1384
1367
  return { value: `${t / 100}`, unit: "-" };
1385
- if (P(r, "duration-") || P(r, "delay-"))
1368
+ if (E(r, "duration-") || E(r, "delay-"))
1386
1369
  return { value: `${t}`, unit: "ms" };
1387
- if (P(r, "translate-") && !t.includes("/"))
1388
- return { value: `${s}${`${t / 4}`}`, unit: "rem" };
1389
- if (P(r, "scale-"))
1390
- return { value: `${s}${`${t / 100}`}`, unit: "-" };
1370
+ if (E(r, "translate-") && !t.includes("/"))
1371
+ return { value: `${o}${`${t / 4}`}`, unit: "rem" };
1372
+ if (E(r, "scale-"))
1373
+ return { value: `${o}${`${t / 100}`}`, unit: "-" };
1391
1374
  if (W(r, "border")) {
1392
- const o = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1393
- if (o)
1394
- return { value: o[0].split("-").pop(), unit: "px" };
1375
+ const s = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1376
+ if (s)
1377
+ return { value: s[0].split("-").pop(), unit: "px" };
1395
1378
  if (r.match(/border-?(x|y|t|r|b|l)?/g))
1396
1379
  return { value: "1", unit: "px" };
1397
1380
  }
@@ -1490,84 +1473,84 @@ const tl = (r) => {
1490
1473
  if (["max", "min", "fit"].includes(t))
1491
1474
  return { value: r, unit: "class" };
1492
1475
  if (t.includes("/")) {
1493
- const [o, l] = C(t.split("/"), (d) => parseInt(d, 10));
1494
- return { value: s + (o / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1476
+ const [s, l] = k(t.split("/"), (d) => parseInt(d, 10));
1477
+ return { value: o + (s / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1495
1478
  }
1496
- return vt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1479
+ return vt(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1497
1480
  };
1498
- const rl = (r) => {
1499
- if (m(r))
1481
+ const sl = (r) => {
1482
+ if (f(r))
1500
1483
  return { value: "", unit: "" };
1501
- const s = r.match(/\[.*\]/g);
1502
- if (s === null)
1503
- return ll(r);
1504
- const t = x(s, "0", "").replace(/\[|\]/g, ""), o = r.startsWith("-") ? "-" : "", l = ue(t.match(/\d+.\d+|\d+/g));
1505
- return { value: `${o}${l}`, unit: t.replace(l, "") };
1506
- }, ll = (r) => m(r) ? { value: "", unit: "" } : tl(r), nt = I.createContext({
1484
+ const o = r.match(/\[.*\]/g);
1485
+ if (o === null)
1486
+ return ol(r);
1487
+ const t = x(o, "0", "").replace(/\[|\]/g, ""), s = r.startsWith("-") ? "-" : "", l = ue(t.match(/\d+.\d+|\d+/g));
1488
+ return { value: `${s}${l}`, unit: t.replace(l, "") };
1489
+ }, ol = (r) => f(r) ? { value: "", unit: "" } : ll(r), at = P.createContext({
1507
1490
  setDragData: () => {
1508
1491
  }
1509
- }), sl = ({
1492
+ }), al = ({
1510
1493
  unit: r,
1511
- currentValue: s,
1494
+ currentValue: o,
1512
1495
  onDrag: t,
1513
- onDragEnd: o,
1496
+ onDragEnd: s,
1514
1497
  onDragStart: l,
1515
1498
  negative: d,
1516
1499
  cssProperty: a
1517
1500
  }) => {
1518
- const { setDragData: c } = se(nt);
1501
+ const { setDragData: c } = se(at);
1519
1502
  return /* @__PURE__ */ e.jsx(
1520
1503
  "button",
1521
1504
  {
1522
1505
  type: "button",
1523
- onMouseDown: (i) => {
1524
- const p = {
1506
+ onMouseDown: (n) => {
1507
+ const u = {
1525
1508
  onDrag: t,
1526
- onDragEnd: o,
1509
+ onDragEnd: s,
1527
1510
  dragging: !0,
1528
- dragStartY: i.pageY,
1529
- dragStartValue: `${s}`,
1511
+ dragStartY: n.pageY,
1512
+ dragStartValue: `${o}`,
1530
1513
  dragUnit: r,
1531
1514
  negative: d,
1532
1515
  cssProperty: a
1533
1516
  };
1534
- l(p), c(p);
1517
+ l(u), c(u);
1535
1518
  },
1536
1519
  color: void 0,
1537
1520
  className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1538
1521
  children: /* @__PURE__ */ e.jsx(Lt, {})
1539
1522
  }
1540
1523
  );
1541
- }, ol = ({ 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((o) => /* @__PURE__ */ e.jsx(
1524
+ }, nl = ({ onSelect: r, current: o, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((s) => /* @__PURE__ */ e.jsx(
1542
1525
  xe,
1543
1526
  {
1544
1527
  className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1545
- color: s === o ? "primary" : void 0,
1528
+ color: o === s ? "primary" : void 0,
1546
1529
  size: "sm",
1547
1530
  onClick: (l) => {
1548
- l.stopPropagation(), r(o);
1531
+ l.stopPropagation(), r(s);
1549
1532
  },
1550
- children: o
1533
+ children: s
1551
1534
  },
1552
- o
1553
- )) }), Ee = 50, al = (r) => {
1554
- const [s, t] = j(!1), [o, l] = j(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: i, units: p, negative: y } = r, [n, h] = j(i != null && i.toLowerCase().includes("width") ? "%" : p[0]), [g, u] = j(!1), [f, k] = j(""), [E, w] = j(!1), [$, L] = j(!1);
1535
+ s
1536
+ )) }), Ee = 50, il = (r) => {
1537
+ const [o, t] = C(!1), [s, l] = C(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: n, units: u, negative: y } = r, [i, h] = C(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [g, p] = C(!1), [b, w] = C(""), [D, j] = C(!1), [I, L] = C(!1);
1555
1538
  O(() => {
1556
- const { value: b, unit: v } = rl(d);
1539
+ const { value: m, unit: v } = sl(d);
1557
1540
  if (v === "") {
1558
- l(b), h(i != null && i.toLowerCase().includes("width") ? "%" : ue(p));
1541
+ l(m), h(n != null && n.toLowerCase().includes("width") ? "%" : ue(u));
1559
1542
  return;
1560
1543
  }
1561
- h(v), l(v === "class" || m(b) ? "" : b);
1562
- }, [d, i, p]);
1563
- const N = fe((b) => a(b), [a], Ee), D = fe((b) => a(b, !1), [a], Ee), X = B(
1564
- (b = !1) => {
1565
- const v = Pe(`${o}`, p);
1544
+ h(v), l(v === "class" || f(m) ? "" : m);
1545
+ }, [d, n, u]);
1546
+ const N = fe((m) => a(m), [a], Ee), $ = fe((m) => a(m, !1), [a], Ee), Y = V(
1547
+ (m = !1) => {
1548
+ const v = Ae(`${s}`, u);
1566
1549
  if (x(v, "error", !1)) {
1567
- u(!0);
1550
+ p(!0);
1568
1551
  return;
1569
1552
  }
1570
- const S = x(v, "unit") !== "" ? x(v, "unit") : n;
1553
+ const S = x(v, "unit") !== "" ? x(v, "unit") : i;
1571
1554
  if (S === "auto" || S === "none") {
1572
1555
  N(`${c}${S}`);
1573
1556
  return;
@@ -1575,123 +1558,123 @@ const rl = (r) => {
1575
1558
  if (x(v, "value") === "")
1576
1559
  return;
1577
1560
  const J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1578
- b ? D(J) : N(J);
1561
+ m ? $(J) : N(J);
1579
1562
  },
1580
- [N, D, o, n, c, p]
1581
- ), G = B(
1582
- (b) => {
1583
- const v = Pe(`${o}`, p);
1563
+ [N, $, s, i, c, u]
1564
+ ), G = V(
1565
+ (m) => {
1566
+ const v = Ae(`${s}`, u);
1584
1567
  if (x(v, "error", !1)) {
1585
- u(!0);
1568
+ p(!0);
1586
1569
  return;
1587
1570
  }
1588
- if (b === "auto" || b === "none") {
1589
- N(`${c}${b}`);
1571
+ if (m === "auto" || m === "none") {
1572
+ N(`${c}${m}`);
1590
1573
  return;
1591
1574
  }
1592
1575
  if (x(v, "value") === "")
1593
1576
  return;
1594
- const S = x(v, "unit") !== "" ? x(v, "unit") : b, J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1577
+ const S = x(v, "unit") !== "" ? x(v, "unit") : m, J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1595
1578
  N(J);
1596
1579
  },
1597
- [N, o, c, p]
1580
+ [N, s, c, u]
1598
1581
  );
1599
- return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: n === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1582
+ return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: i === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1600
1583
  /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: d }),
1601
- /* @__PURE__ */ e.jsxs(F, { children: [
1584
+ /* @__PURE__ */ e.jsxs(X, { children: [
1602
1585
  /* @__PURE__ */ e.jsx(z, { 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(_e, {}) }) }),
1603
1586
  /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
1604
1587
  ] })
1605
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${E ? "z-auto" : ""}`, children: [
1588
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${D ? "z-auto" : ""}`, children: [
1606
1589
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1607
- ["none", "auto"].indexOf(n) !== -1 ? null : /* @__PURE__ */ e.jsx(
1590
+ ["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
1608
1591
  "input",
1609
1592
  {
1610
- readOnly: n === "class",
1611
- onKeyPress: (b) => {
1612
- b.key === "Enter" && X();
1593
+ readOnly: i === "class",
1594
+ onKeyPress: (m) => {
1595
+ m.key === "Enter" && Y();
1613
1596
  },
1614
- onKeyDown: (b) => {
1615
- if (b.keyCode !== 38 && b.keyCode !== 40)
1597
+ onKeyDown: (m) => {
1598
+ if (m.keyCode !== 38 && m.keyCode !== 40)
1616
1599
  return;
1617
- b.preventDefault(), L(!0);
1618
- const v = wt(b.target.value);
1619
- let S = Xe(v) ? 0 : v;
1620
- b.keyCode === 38 && (S += 1), b.keyCode === 40 && (S -= 1);
1621
- const M = `${S}`, dt = `${M.startsWith("-") ? "-" : ""}${c}[${M.replace("-", "")}${n === "-" ? "" : n}]`;
1622
- D(dt);
1600
+ m.preventDefault(), L(!0);
1601
+ const v = wt(m.target.value);
1602
+ let S = Ye(v) ? 0 : v;
1603
+ m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
1604
+ const M = `${S}`, it = `${M.startsWith("-") ? "-" : ""}${c}[${M.replace("-", "")}${i === "-" ? "" : i}]`;
1605
+ $(it);
1623
1606
  },
1624
- onKeyUp: (b) => {
1625
- $ && (b.preventDefault(), L(!1));
1607
+ onKeyUp: (m) => {
1608
+ I && (m.preventDefault(), L(!1));
1626
1609
  },
1627
- onBlur: () => X(),
1628
- onChange: (b) => {
1629
- u(!1), l(b.target.value);
1610
+ onBlur: () => Y(),
1611
+ onChange: (m) => {
1612
+ p(!1), l(m.target.value);
1630
1613
  },
1631
- onClick: (b) => {
1614
+ onClick: (m) => {
1632
1615
  var v;
1633
- (v = b == null ? void 0 : b.target) == null || v.select(), t(!1);
1616
+ (v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
1634
1617
  },
1635
- value: E ? f : o,
1618
+ value: D ? b : s,
1636
1619
  className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1637
1620
  " ",
1638
1621
  g ? "border-red-500 text-red-500" : "border-foreground/20"
1639
1622
  )
1640
1623
  }
1641
1624
  ),
1642
- /* @__PURE__ */ e.jsxs(F, { open: s, delayDuration: 100, children: [
1625
+ /* @__PURE__ */ e.jsxs(X, { open: o, delayDuration: 100, children: [
1643
1626
  /* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1644
1627
  "button",
1645
1628
  {
1646
1629
  type: "button",
1647
- onClick: () => t(!s),
1630
+ onClick: () => t(!o),
1648
1631
  className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1649
1632
  children: [
1650
- /* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: n }),
1651
- p.length > 1 ? /* @__PURE__ */ e.jsx(Mt, {}) : null
1633
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${u.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
1634
+ u.length > 1 ? /* @__PURE__ */ e.jsx(Mt, {}) : null
1652
1635
  ]
1653
1636
  }
1654
1637
  ) }),
1655
- /* @__PURE__ */ e.jsx(xr, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1656
- ol,
1638
+ /* @__PURE__ */ e.jsx(hr, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1639
+ nl,
1657
1640
  {
1658
- units: p,
1659
- current: n,
1660
- onSelect: (b) => {
1661
- t(!1), h(b), G(b);
1641
+ units: u,
1642
+ current: i,
1643
+ onSelect: (m) => {
1644
+ t(!1), h(m), G(m);
1662
1645
  }
1663
1646
  }
1664
1647
  ) }) })
1665
1648
  ] })
1666
1649
  ] }),
1667
- ["none", "auto"].indexOf(n) !== -1 || E ? null : /* @__PURE__ */ e.jsx(
1668
- sl,
1650
+ ["none", "auto"].indexOf(i) !== -1 || D ? null : /* @__PURE__ */ e.jsx(
1651
+ al,
1669
1652
  {
1670
- onDragStart: () => w(!0),
1671
- onDragEnd: (b) => {
1672
- if (k(() => ""), w(!1), m(b))
1653
+ onDragStart: () => j(!0),
1654
+ onDragEnd: (m) => {
1655
+ if (w(() => ""), j(!1), f(m))
1673
1656
  return;
1674
- const v = `${b}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${n === "-" ? "" : n}]`;
1657
+ const v = `${m}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${i === "-" ? "" : i}]`;
1675
1658
  N(M);
1676
1659
  },
1677
- onDrag: (b) => {
1678
- if (m(b))
1660
+ onDrag: (m) => {
1661
+ if (f(m))
1679
1662
  return;
1680
- k(b);
1681
- const v = `${b}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${n === "-" ? "" : n}]`;
1682
- D(M);
1663
+ w(m);
1664
+ const v = `${m}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${i === "-" ? "" : i}]`;
1665
+ $(M);
1683
1666
  },
1684
- currentValue: o,
1685
- unit: n,
1667
+ currentValue: s,
1668
+ unit: i,
1686
1669
  negative: y,
1687
- cssProperty: i
1670
+ cssProperty: n
1688
1671
  }
1689
1672
  )
1690
1673
  ] }) }) });
1691
1674
  }, ae = (r) => {
1692
- const s = ge();
1693
- return jt(s, { property: r });
1694
- }, nl = (r, s) => {
1675
+ const o = ge();
1676
+ return jt(o, { property: r });
1677
+ }, dl = (r, o) => {
1695
1678
  const t = {
1696
1679
  xs: 0,
1697
1680
  sm: 1,
@@ -1700,8 +1683,8 @@ const rl = (r) => {
1700
1683
  xl: 4,
1701
1684
  "2xl": 5
1702
1685
  };
1703
- return t[x(r, "mq", "xs")] <= t[s];
1704
- }, il = {
1686
+ return t[x(r, "mq", "xs")] <= t[o];
1687
+ }, cl = {
1705
1688
  width: "w-",
1706
1689
  height: "h-",
1707
1690
  minWidth: "min-w-",
@@ -1774,56 +1757,56 @@ const rl = (r) => {
1774
1757
  lg: "1024px",
1775
1758
  xl: "1280px",
1776
1759
  "2xl": "1536px"
1777
- }, dl = (r) => `${r.toUpperCase()} ${Le[r] ? `(${Le[r]} & up)` : ""}`, Re = (r) => {
1778
- const { t: s } = K(), { type: t = "icons", label: o, property: l, onEmitChange: d = () => {
1779
- }, units: a, negative: c = !1 } = r, [i] = gr(), [p] = Qe(), [, y] = Be(), n = ae(l), h = qe(), g = Ge(), [u] = Je(), f = _(() => x(n, "fullCls", ""), [n]), k = B(
1780
- (D, X = !0) => {
1781
- const G = { dark: i, mq: y, mod: p, cls: D, property: l, fullCls: "" };
1782
- (i || p !== "") && (G.mq = "xs");
1783
- const b = Er(G);
1784
- h(u, [b], X);
1760
+ }, pl = (r) => `${r.toUpperCase()} ${Le[r] ? `(${Le[r]} & up)` : ""}`, Re = (r) => {
1761
+ const { t: o } = K(), { type: t = "icons", label: s, property: l, onEmitChange: d = () => {
1762
+ }, units: a, negative: c = !1 } = r, [n] = yr(), [u] = Je(), [, y] = Be(), i = ae(l), h = Ke(), g = qe(), [p] = Ge(), b = _(() => x(i, "fullCls", ""), [i]), w = V(
1763
+ ($, Y = !0) => {
1764
+ const G = { dark: n, mq: y, mod: u, cls: $, property: l, fullCls: "" };
1765
+ (n || u !== "") && (G.mq = "xs");
1766
+ const m = Mr(G);
1767
+ h(p, [m], Y);
1785
1768
  },
1786
- [u, i, y, p, l, h]
1787
- ), E = B(() => {
1788
- g(u, [f]);
1789
- }, [u, f, g]), w = _(() => nl(n, y), [n, y]);
1769
+ [p, n, y, u, l, h]
1770
+ ), D = V(() => {
1771
+ g(p, [b]);
1772
+ }, [p, b, g]), j = _(() => dl(i, y), [i, y]);
1790
1773
  O(() => {
1791
- d(w, n);
1792
- }, [w, d, n]);
1793
- const [, , $] = Be(), L = B(
1794
- (D) => {
1795
- $({
1774
+ d(j, i);
1775
+ }, [j, d, i]);
1776
+ const [, , I] = Be(), L = V(
1777
+ ($) => {
1778
+ I({
1796
1779
  xs: 400,
1797
1780
  sm: 640,
1798
1781
  md: 800,
1799
1782
  lg: 1024,
1800
1783
  xl: 1420,
1801
1784
  "2xl": 1920
1802
- }[D]);
1785
+ }[$]);
1803
1786
  },
1804
- [$]
1805
- ), N = x(n, "dark", null) === i && x(n, "mod", null) === p && x(n, "mq", null) === y;
1806
- return /* @__PURE__ */ e.jsx(qr, { canChange: w, canReset: n && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1807
- /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${n && !N ? "text-foreground" : ""}`, children: s(o) }) }),
1787
+ [I]
1788
+ ), N = x(i, "dark", null) === n && x(i, "mod", null) === u && x(i, "mq", null) === y;
1789
+ return /* @__PURE__ */ e.jsx(Jr, { canChange: j, canReset: i && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1790
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !N ? "text-foreground" : ""}`, children: o(s) }) }),
1808
1791
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
1809
1792
  /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
1810
1793
  t === "arbitrary" ? /* @__PURE__ */ e.jsx(
1811
- al,
1794
+ il,
1812
1795
  {
1813
- currentClass: x(n, "cls", ""),
1814
- classPrefix: x(il, l, ""),
1796
+ currentClass: x(i, "cls", ""),
1797
+ classPrefix: x(cl, l, ""),
1815
1798
  units: a || [],
1816
- onChange: k,
1799
+ onChange: w,
1817
1800
  negative: c,
1818
1801
  cssProperty: l
1819
1802
  }
1820
1803
  ) : null,
1821
- t === "icons" && /* @__PURE__ */ e.jsx(Jr, { property: l, onChange: k }),
1822
- t === "range" && /* @__PURE__ */ e.jsx(Gr, { property: l, onChange: k }),
1823
- t === "color" && /* @__PURE__ */ e.jsx(el, { property: l, onChange: k }),
1824
- t === "dropdown" && /* @__PURE__ */ e.jsx(at, { label: o, property: l, onChange: k })
1804
+ t === "icons" && /* @__PURE__ */ e.jsx(el, { property: l, onChange: w }),
1805
+ t === "range" && /* @__PURE__ */ e.jsx(Qr, { property: l, onChange: w }),
1806
+ t === "color" && /* @__PURE__ */ e.jsx(rl, { property: l, onChange: w }),
1807
+ t === "dropdown" && /* @__PURE__ */ e.jsx(ot, { label: s, property: l, onChange: w })
1825
1808
  ] }),
1826
- /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => E(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ot, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : w && n ? /* @__PURE__ */ e.jsxs(F, { delayDuration: 100, children: [
1809
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => D(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ot, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : j && i ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1827
1810
  /* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1828
1811
  "button",
1829
1812
  {
@@ -1834,20 +1817,20 @@ const rl = (r) => {
1834
1817
  ) }),
1835
1818
  /* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1836
1819
  "Current style is set at  ",
1837
- /* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
1838
- dl(x(n, "mq")),
1839
- i && !n.dark ? "(Light mode)" : ""
1820
+ /* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
1821
+ pl(x(i, "mq")),
1822
+ n && !i.dark ? "(Light mode)" : ""
1840
1823
  ] }),
1841
1824
  /* @__PURE__ */ e.jsx("br", {}),
1842
1825
  /* @__PURE__ */ e.jsxs(
1843
1826
  "button",
1844
1827
  {
1845
1828
  type: "button",
1846
- onClick: () => L(x(n, "mq")),
1829
+ onClick: () => L(x(i, "mq")),
1847
1830
  className: "block w-full cursor-default text-right font-semibold text-blue-500",
1848
1831
  children: [
1849
1832
  "Switch to ",
1850
- x(n, "mq").toUpperCase()
1833
+ x(i, "mq").toUpperCase()
1851
1834
  ]
1852
1835
  }
1853
1836
  )
@@ -1855,40 +1838,40 @@ const rl = (r) => {
1855
1838
  ] }) : null })
1856
1839
  ] })
1857
1840
  ] }) });
1858
- }, cl = ["px", "%", "em", "rem", "ch", "vh", "vw"], it = ({
1841
+ }, ul = ["px", "%", "em", "rem", "ch", "vh", "vw"], nt = ({
1859
1842
  label: r,
1860
- options: s,
1843
+ options: o,
1861
1844
  borderB: t = !1,
1862
- borderT: o = !1,
1845
+ borderT: s = !1,
1863
1846
  type: l = "arbitrary",
1864
- units: d = cl,
1847
+ units: d = ul,
1865
1848
  negative: a = !1
1866
1849
  }) => {
1867
- const { t: c } = K(), [i, p] = j(s[0].key), y = ge(), n = B((h) => C(y, "property").includes(h), [y]);
1850
+ const { t: c } = K(), [n, u] = C(o[0].key), y = ge(), i = V((h) => k(y, "property").includes(h), [y]);
1868
1851
  return /* @__PURE__ */ e.jsxs(
1869
1852
  "div",
1870
1853
  {
1871
- className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${o ? "border-t" : ""}`,
1854
+ className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${s ? "border-t" : ""}`,
1872
1855
  children: [
1873
1856
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
1874
1857
  r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
1875
- /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: I.Children.toArray(
1876
- s.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(F, { children: [
1858
+ /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
1859
+ o.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
1877
1860
  /* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1878
1861
  "button",
1879
1862
  {
1880
1863
  type: "button",
1881
- onClick: () => p(g),
1882
- className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1864
+ onClick: () => u(g),
1865
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1883
1866
  children: [
1884
- I.createElement("div", {
1885
- className: n(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1867
+ P.createElement("div", {
1868
+ className: i(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1886
1869
  }),
1887
- I.createElement(x(ot, g, ze), { className: "text-inherit w-3 h-3" })
1870
+ P.createElement(x(st, g, ze), { className: "text-inherit w-3 h-3" })
1888
1871
  ]
1889
1872
  }
1890
1873
  ) }),
1891
- /* @__PURE__ */ e.jsx(Z, { children: Y(le(h)) })
1874
+ /* @__PURE__ */ e.jsx(Z, { children: F(le(h)) })
1892
1875
  ] }) }))
1893
1876
  ) })
1894
1877
  ] }),
@@ -1898,22 +1881,22 @@ const rl = (r) => {
1898
1881
  type: l,
1899
1882
  units: [...d],
1900
1883
  label: "",
1901
- property: i,
1884
+ property: n,
1902
1885
  negative: a
1903
1886
  }
1904
1887
  ) })
1905
1888
  ]
1906
1889
  }
1907
1890
  );
1908
- }, pl = ({ heading: r, items: s }) => {
1909
- const { t } = K(), o = ge(), l = _(() => {
1910
- const d = (i) => U(
1911
- i.map((p) => p.styleType === "multiple" ? C(p.options, "key") : p.property)
1891
+ }, xl = ({ heading: r, items: o }) => {
1892
+ const { t } = K(), s = ge(), l = _(() => {
1893
+ const d = (n) => U(
1894
+ n.map((u) => u.styleType === "multiple" ? k(u.options, "key") : u.property)
1912
1895
  ), a = U(
1913
- s.map((i) => i.styleType === "accordion" ? d(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
1914
- ), c = C(o, "property");
1915
- return Ye(a, c).length > 0;
1916
- }, [o, s]);
1896
+ o.map((n) => n.styleType === "accordion" ? d(n.items) : n.styleType === "multiple" ? k(n.options, "key") : n.property)
1897
+ ), c = k(s, "property");
1898
+ return Fe(a, c).length > 0;
1899
+ }, [s, o]);
1917
1900
  return /* @__PURE__ */ e.jsxs("details", { children: [
1918
1901
  /* @__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: [
1919
1902
  t(r),
@@ -1924,54 +1907,54 @@ const rl = (r) => {
1924
1907
  }
1925
1908
  ) : null
1926
1909
  ] }) }),
1927
- /* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((d) => d.styleType === "multiple" ? /* @__PURE__ */ e.jsx(it, { ...d }, d.label) : /* @__PURE__ */ e.jsx(Re, { ...d }, d.label)) })
1910
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((d) => d.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...d }, d.label) : /* @__PURE__ */ e.jsx(Re, { ...d }, d.label)) })
1928
1911
  ] });
1929
- }, ul = Me({}), me = ({ section: r }) => {
1930
- const { t: s } = K(), t = ge(), o = B(
1912
+ }, gl = Me({}), be = ({ section: r }) => {
1913
+ const { t: o } = K(), t = ge(), s = V(
1931
1914
  (a = []) => {
1932
1915
  const c = {};
1933
- for (let p = 0; p < t.length; p++)
1934
- c[t[p].property] = t[p].cls;
1935
- let i = !0;
1936
- for (const p in a)
1937
- if (!ye(c, p) || c[p] !== a[p]) {
1938
- i = !1;
1916
+ for (let u = 0; u < t.length; u++)
1917
+ c[t[u].property] = t[u].cls;
1918
+ let n = !0;
1919
+ for (const u in a)
1920
+ if (!ye(c, u) || c[u] !== a[u]) {
1921
+ n = !1;
1939
1922
  break;
1940
1923
  }
1941
- return i;
1924
+ return n;
1942
1925
  },
1943
1926
  [t]
1944
1927
  ), l = _(() => {
1945
1928
  if (t.length > 0 && r.heading === "classes.heading")
1946
1929
  return !0;
1947
- const a = (p) => U(
1948
- p.map((y) => y.styleType === "multiple" ? U(C(y.options, "key")) : y.property)
1930
+ const a = (u) => U(
1931
+ u.map((y) => y.styleType === "multiple" ? U(k(y.options, "key")) : y.property)
1949
1932
  ), c = U(
1950
- r.items.map((p) => p.styleType === "accordion" ? a(p.items) : p.styleType === "multiple" ? U(C(p.options, "key")) : p.property)
1951
- ), i = C(t, "property");
1952
- return Ye(c, i).length > 0;
1933
+ r.items.map((u) => u.styleType === "accordion" ? a(u.items) : u.styleType === "multiple" ? U(k(u.options, "key")) : u.property)
1934
+ ), n = k(t, "property");
1935
+ return Fe(c, n).length > 0;
1953
1936
  }, [t, r.heading, r.items]), d = _(() => ({}), []);
1954
- return /* @__PURE__ */ e.jsx(ul.Provider, { value: d, children: /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
1937
+ return /* @__PURE__ */ e.jsx(gl.Provider, { value: d, children: /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
1955
1938
  /* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1956
1939
  /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
1957
- s(r.heading)
1940
+ o(r.heading)
1958
1941
  ] }) }),
1959
- /* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: I.Children.toArray(
1960
- r.items.map((a) => ye(a, "component") ? I.createElement(a.component, { key: a.label }) : ye(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(it, { ...a }, a.label) : a.styleType === "accordion" && o(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(pl, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Re, { ...a }, a.label))
1942
+ /* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
1943
+ r.items.map((a) => ye(a, "component") ? P.createElement(a.component, { key: a.label }) : ye(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && s(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(xl, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Re, { ...a }, a.label))
1961
1944
  ) })
1962
1945
  ] }) });
1963
- }, xl = ({
1946
+ }, hl = ({
1964
1947
  item: r,
1965
- index: s,
1948
+ index: o,
1966
1949
  canDelete: t,
1967
- onChange: o,
1950
+ onChange: s,
1968
1951
  onRemove: l
1969
1952
  }) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
1970
1953
  /* @__PURE__ */ e.jsx(
1971
1954
  "input",
1972
1955
  {
1973
1956
  name: "key",
1974
- onChange: (d) => o(d, s),
1957
+ onChange: (d) => s(d, o),
1975
1958
  value: r.key,
1976
1959
  placeholder: "Key",
1977
1960
  className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
@@ -1984,7 +1967,7 @@ const rl = (r) => {
1984
1967
  "input",
1985
1968
  {
1986
1969
  name: "value",
1987
- onChange: (d) => m(r.key) ? {} : o(d, s),
1970
+ onChange: (d) => f(r.key) ? {} : s(d, o),
1988
1971
  value: r.value,
1989
1972
  placeholder: "Value",
1990
1973
  className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
@@ -1993,41 +1976,41 @@ const rl = (r) => {
1993
1976
  }
1994
1977
  ),
1995
1978
  /* @__PURE__ */ e.jsx(
1996
- Xt,
1979
+ Yt,
1997
1980
  {
1998
1981
  onClick: l,
1999
1982
  className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
2000
1983
  }
2001
1984
  )
2002
1985
  ] })
2003
- ] }), gl = ({ section: r }) => {
1986
+ ] }), yl = ({ section: r }) => {
2004
1987
  var h;
2005
- const { setSyncState: s } = hr(), t = q(), [o, l] = j([]), [d] = Se(), a = Ue(), c = `${x(d, "0.prop")}_attrs`;
1988
+ const { setSyncState: o } = mr(), t = q(), [s, l] = C([]), [d] = Se(), a = We(), c = `${x(d, "0.prop")}_attrs`;
2006
1989
  ne.useEffect(() => {
2007
- const g = C(x(t, c), (u, f) => ({ key: f, value: u }));
2008
- m(g) ? l([]) : l(g);
1990
+ const g = k(x(t, c), (p, b) => ({ key: b, value: p }));
1991
+ f(g) ? l([]) : l(g);
2009
1992
  }, [x(t, c)]);
2010
- const i = () => l([...o, { key: "", value: "" }]), p = (g) => {
2011
- const u = we(o, (f, k) => g !== k);
2012
- n(u);
2013
- }, y = (g, u) => {
2014
- const f = [...o];
2015
- f[u][g.target.name] = g.target.value, n(f);
2016
- }, n = ne.useCallback(
1993
+ const n = () => l([...s, { key: "", value: "" }]), u = (g) => {
1994
+ const p = we(s, (b, w) => g !== w);
1995
+ i(p);
1996
+ }, y = (g, p) => {
1997
+ const b = [...s];
1998
+ b[p][g.target.name] = g.target.value, i(b);
1999
+ }, i = ne.useCallback(
2017
2000
  (g = []) => {
2018
- const u = {};
2019
- ke(g, (f) => {
2020
- m(f.key) || Oe(u, f.key, f.value);
2021
- }), a([x(t, "_id")], { [c]: u }), s("UNSAVED");
2001
+ const p = {};
2002
+ ke(g, (b) => {
2003
+ f(b.key) || Oe(p, b.key, b.value);
2004
+ }), a([x(t, "_id")], { [c]: p }), o("UNSAVED");
2022
2005
  },
2023
- [t, s, a, c]
2006
+ [t, o, a, c]
2024
2007
  );
2025
2008
  return /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
2026
2009
  /* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
2027
2010
  /* @__PURE__ */ e.jsx(
2028
2011
  "div",
2029
2012
  {
2030
- className: `h-[8px] w-[8px] rounded-full ${m(x(t, c)) ? "bg-gray-300" : "bg-blue-500"}`
2013
+ className: `h-[8px] w-[8px] rounded-full ${f(x(t, c)) ? "bg-gray-300" : "bg-blue-500"}`
2031
2014
  }
2032
2015
  ),
2033
2016
  "Attributes"
@@ -2038,10 +2021,10 @@ const rl = (r) => {
2038
2021
  /* @__PURE__ */ e.jsxs(
2039
2022
  "div",
2040
2023
  {
2041
- className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!m(o) && m((h = ve(o)) == null ? void 0 : h.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
2024
+ className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!f(s) && f((h = ve(s)) == null ? void 0 : h.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
2042
2025
  onClick: () => {
2043
2026
  var g;
2044
- !m(o) && m((g = ve(o)) == null ? void 0 : g.key) || i();
2027
+ !f(s) && f((g = ve(s)) == null ? void 0 : g.key) || n();
2045
2028
  },
2046
2029
  children: [
2047
2030
  /* @__PURE__ */ e.jsx(Ne, { width: 12, height: 12 }),
@@ -2051,18 +2034,18 @@ const rl = (r) => {
2051
2034
  )
2052
2035
  ] }),
2053
2036
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2054
- m(o) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
2037
+ f(s) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
2055
2038
  ne.Children.toArray(
2056
- C(o, (g, u) => {
2057
- const f = o.length > 0 && u < o.length - 1;
2039
+ k(s, (g, p) => {
2040
+ const b = s.length > 0 && p < s.length - 1;
2058
2041
  return /* @__PURE__ */ e.jsx(
2059
- xl,
2042
+ hl,
2060
2043
  {
2061
2044
  item: g,
2062
- index: u,
2063
- canDelete: f,
2045
+ index: p,
2046
+ canDelete: b,
2064
2047
  onChange: y,
2065
- onRemove: () => p(u)
2048
+ onRemove: () => u(p)
2066
2049
  }
2067
2050
  );
2068
2051
  })
@@ -2071,50 +2054,44 @@ const rl = (r) => {
2071
2054
  ] }) })
2072
2055
  ] });
2073
2056
  };
2074
- function hl() {
2075
- const [r, s] = Qe(), { flexChild: t, gridChild: o } = yr(), [, l] = $r(br), { t: d } = K(), [a] = Se();
2076
- return m(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2057
+ function ml() {
2058
+ const [r, o] = Je(), { flexChild: t, gridChild: s } = br(), [, l] = Pr(fr), { t: d } = K(), [a] = Se();
2059
+ return f(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2077
2060
  /* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
2078
- /* @__PURE__ */ e.jsx("h1", { children: d("no_styling_block_selected") }),
2079
- /* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
2080
- "Hint: Styling allowed blocks are highlighted with",
2081
- " ",
2082
- /* @__PURE__ */ e.jsx("span", { className: "border border-orange-500 p-px", children: "orange" }),
2083
- " border"
2084
- ] })
2061
+ /* @__PURE__ */ e.jsx("h1", { children: d("no_styling_block_selected") })
2085
2062
  ] }) }) : (
2086
2063
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
2087
2064
  /* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
2088
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b h-12 border-border px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
2065
+ /* @__PURE__ */ e.jsx("div", { className: "flex h-12 flex-col space-x-4 space-y-3 border-b border-border px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
2089
2066
  /* @__PURE__ */ e.jsx(Te, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2090
- /* @__PURE__ */ e.jsxs(mr, { defaultValue: r, onValueChange: (c) => s(c), children: [
2091
- /* @__PURE__ */ e.jsx(fr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(vr, { placeholder: "State" }) }),
2092
- /* @__PURE__ */ e.jsxs(wr, { children: [
2093
- /* @__PURE__ */ e.jsx(V, { value: "", children: "Normal" }),
2094
- /* @__PURE__ */ e.jsx(V, { value: "hover", children: "Hover" }),
2095
- /* @__PURE__ */ e.jsx(V, { value: "active", children: "Active" }),
2096
- /* @__PURE__ */ e.jsx(V, { value: "focus", children: "Focus" }),
2097
- /* @__PURE__ */ e.jsx(V, { value: "before", children: "Before" }),
2098
- /* @__PURE__ */ e.jsx(V, { value: "after", children: "After" }),
2099
- /* @__PURE__ */ e.jsx(V, { value: "only", children: "Only" }),
2100
- /* @__PURE__ */ e.jsx(V, { value: "first", children: "First" }),
2101
- /* @__PURE__ */ e.jsx(V, { value: "last", children: "Last" }),
2102
- /* @__PURE__ */ e.jsx(V, { value: "first-letter", children: "First Letter" }),
2103
- /* @__PURE__ */ e.jsx(V, { value: "first-line", children: "First Line" }),
2104
- /* @__PURE__ */ e.jsx(V, { value: "disabled", children: "Disabled" })
2067
+ /* @__PURE__ */ e.jsxs(vr, { defaultValue: r, onValueChange: (c) => o(c), children: [
2068
+ /* @__PURE__ */ e.jsx(wr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(jr, { placeholder: "State" }) }),
2069
+ /* @__PURE__ */ e.jsxs(Cr, { children: [
2070
+ /* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
2071
+ /* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
2072
+ /* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
2073
+ /* @__PURE__ */ e.jsx(H, { value: "focus", children: "Focus" }),
2074
+ /* @__PURE__ */ e.jsx(H, { value: "before", children: "Before" }),
2075
+ /* @__PURE__ */ e.jsx(H, { value: "after", children: "After" }),
2076
+ /* @__PURE__ */ e.jsx(H, { value: "only", children: "Only" }),
2077
+ /* @__PURE__ */ e.jsx(H, { value: "first", children: "First" }),
2078
+ /* @__PURE__ */ e.jsx(H, { value: "last", children: "Last" }),
2079
+ /* @__PURE__ */ e.jsx(H, { value: "first-letter", children: "First Letter" }),
2080
+ /* @__PURE__ */ e.jsx(H, { value: "first-line", children: "First Line" }),
2081
+ /* @__PURE__ */ e.jsx(H, { value: "disabled", children: "Disabled" })
2105
2082
  ] })
2106
2083
  ] })
2107
2084
  ] }) }),
2108
- /* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsxs(Ke, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
2109
- t && /* @__PURE__ */ e.jsx(me, { section: Wr }),
2110
- o ? /* @__PURE__ */ e.jsx(me, { section: Ur }) : null,
2111
- Kr.map((c) => /* @__PURE__ */ e.jsx(me, { section: c }, c.heading)),
2112
- /* @__PURE__ */ e.jsx(gl, { section: { heading: "Attributes" } })
2085
+ /* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden", children: /* @__PURE__ */ e.jsxs(Ue, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
2086
+ t && /* @__PURE__ */ e.jsx(be, { section: Kr }),
2087
+ s ? /* @__PURE__ */ e.jsx(be, { section: qr }) : null,
2088
+ Gr.map((c) => /* @__PURE__ */ e.jsx(be, { section: c }, c.heading)),
2089
+ /* @__PURE__ */ e.jsx(yl, { section: { heading: "Attributes" } })
2113
2090
  ] }) })
2114
2091
  ] })
2115
2092
  );
2116
2093
  }
2117
- const yl = {
2094
+ const bl = {
2118
2095
  px: 1,
2119
2096
  "%": 1,
2120
2097
  em: 100,
@@ -2126,9 +2103,9 @@ const yl = {
2126
2103
  deg: 1,
2127
2104
  ms: 0.1
2128
2105
  }, Cs = () => {
2129
- const r = q(), { t: s } = K(), [t, o] = I.useState(""), [l, d] = I.useState({
2130
- onDrag: (i) => i,
2131
- onDragEnd: (i) => i,
2106
+ const r = q(), { t: o } = K(), [t, s] = P.useState(""), [l, d] = P.useState({
2107
+ onDrag: (n) => n,
2108
+ onDragEnd: (n) => n,
2132
2109
  dragStartY: 0,
2133
2110
  dragging: !1,
2134
2111
  dragStartValue: 0,
@@ -2136,21 +2113,21 @@ const yl = {
2136
2113
  negative: !1,
2137
2114
  cssProperty: ""
2138
2115
  }), a = fe(
2139
- (i) => {
2140
- const p = !x(l, "negative", !1), y = x(l, "cssProperty", "");
2141
- let n = parseFloat(l.dragStartValue);
2142
- n = Xe(n) ? 0 : n;
2143
- let h = yl[l.dragUnit];
2116
+ (n) => {
2117
+ const u = !x(l, "negative", !1), y = x(l, "cssProperty", "");
2118
+ let i = parseFloat(l.dragStartValue);
2119
+ i = Ye(i) ? 0 : i;
2120
+ let h = bl[l.dragUnit];
2144
2121
  (W(y, "scale") || y === "opacity") && (h = 10);
2145
- let u = (l.dragStartY - i.pageY) / h + n;
2146
- p && u < 0 && (u = 0), y === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), o(`${u}`);
2122
+ let p = (l.dragStartY - n.pageY) / h + i;
2123
+ u && p < 0 && (p = 0), y === "opacity" && p > 1 && (p = 1), l.onDrag(`${p}`), s(`${p}`);
2147
2124
  },
2148
2125
  [l],
2149
2126
  50
2150
- ), c = B(() => {
2127
+ ), c = V(() => {
2151
2128
  setTimeout(() => l.onDragEnd(`${t}`), 100), d({
2152
- onDrag: (i) => i,
2153
- onDragEnd: (i) => i,
2129
+ onDrag: (n) => n,
2130
+ onDragEnd: (n) => n,
2154
2131
  dragStartY: 0,
2155
2132
  dragging: !1,
2156
2133
  dragStartValue: 0,
@@ -2161,8 +2138,8 @@ const yl = {
2161
2138
  }, [l, t, d]);
2162
2139
  return Ct(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2163
2140
  /* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
2164
- /* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
2165
- ] }) }) : /* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsxs(nt.Provider, { value: { setDragData: d }, children: [
2141
+ /* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
2142
+ ] }) }) : /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsxs(at.Provider, { value: { setDragData: d }, children: [
2166
2143
  l.dragging ? /* @__PURE__ */ e.jsx(
2167
2144
  "div",
2168
2145
  {
@@ -2171,13 +2148,13 @@ const yl = {
2171
2148
  className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
2172
2149
  }
2173
2150
  ) : null,
2174
- /* @__PURE__ */ e.jsxs(jr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
2175
- /* @__PURE__ */ e.jsxs(Cr, { className: "mx-1 grid grid-cols-2", children: [
2176
- /* @__PURE__ */ e.jsx(De, { value: "settings", children: s("settings") }),
2177
- /* @__PURE__ */ e.jsx(De, { value: "styling", children: s("styling") })
2151
+ /* @__PURE__ */ e.jsxs(kr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
2152
+ /* @__PURE__ */ e.jsxs(Nr, { className: "mx-1 grid grid-cols-2", children: [
2153
+ /* @__PURE__ */ e.jsx(De, { value: "settings", children: o("settings") }),
2154
+ /* @__PURE__ */ e.jsx(De, { value: "styling", children: o("styling") })
2178
2155
  ] }),
2179
- /* @__PURE__ */ e.jsx($e, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(et, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(zr, {}) }) }),
2180
- /* @__PURE__ */ e.jsx($e, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(hl, {}) })
2156
+ /* @__PURE__ */ e.jsx($e, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(Wr, {}) }) }),
2157
+ /* @__PURE__ */ e.jsx($e, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ml, {}) })
2181
2158
  ] })
2182
2159
  ] }) });
2183
2160
  };