@chaibuilder/sdk 1.2.8 → 1.2.10

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