@chaibuilder/sdk 1.2.64 → 1.2.66
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.
- package/dist/AddBlocks-Mm5byzEC.js +124 -0
- package/dist/AddBlocks-jaxiAG4L.cjs +1 -0
- package/dist/CanvasArea-8NXGRRYC.js +137 -0
- package/dist/CanvasArea-SkeoJz9W.cjs +1 -0
- package/dist/{CodeEditor-37od44Ou.js → CodeEditor-3l-mFvg4.js} +61 -46
- package/dist/CodeEditor-o-CkvDnY.cjs +1 -0
- package/dist/STRINGS--j49GZJP.js +7 -0
- package/dist/STRINGS-gPz7CUOk.cjs +1 -0
- package/dist/SettingsPanel-2uYGx-MQ.cjs +1 -0
- package/dist/SettingsPanel-Q3xQQm81.js +82 -0
- package/dist/{SidePanels-UQj0XTnb.js → SidePanels-JyziIpDA.js} +125 -116
- package/dist/SidePanels-d04PONzN.cjs +1 -0
- package/dist/{Topbar-1O05wogM.js → Topbar-Xgd6YI66.js} +68 -57
- package/dist/Topbar-eIenyfZu.cjs +1 -0
- package/dist/UILibrariesPanel-ADjJse3_.cjs +1 -0
- package/dist/{UILibrariesPanel-vshiYI6G.js → UILibrariesPanel-a7TrMuAU.js} +98 -86
- package/dist/{UnsplashImages-Eq7hprBO.js → UnsplashImages-6Bj8nQ8n.js} +65 -49
- package/dist/UnsplashImages-hLdMtY12.cjs +1 -0
- package/dist/{UploadImages-lco2Tea3.js → UploadImages-4PxhlZMB.js} +58 -44
- package/dist/UploadImages-uL2R7fju.cjs +1 -0
- package/dist/badge-7BVT3zxN.cjs +1 -0
- package/dist/badge-pJqQSA13.js +23 -0
- package/dist/context-menu-_8TFbFEJ.cjs +1 -0
- package/dist/context-menu-sks9vdzC.js +906 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +45 -21
- package/dist/core.js +93 -79
- package/dist/iconBase-vJD0OXxU.cjs +1 -0
- package/dist/iconBase-zweRWSz0.js +323 -0
- package/dist/index-Dgo2PNEV.js +33210 -0
- package/dist/index-jhNzBWrV.cjs +223 -0
- package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
- package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
- package/dist/plugin-P0tpo_XZ.cjs +1 -0
- package/dist/plugin-_F-KZp1i.cjs +1 -0
- package/dist/plugin-f5uJtdXY.js +43 -0
- package/dist/plugin-sJ3Hzvpv.js +57 -0
- package/dist/render.cjs +3 -1
- package/dist/render.d.ts +19 -52
- package/dist/render.js +136 -183
- package/dist/select-JW3OMYm-.js +75 -0
- package/dist/select-fXj5tdMX.cjs +1 -0
- package/dist/separator-hT24N-xp.cjs +1 -0
- package/dist/separator-sgwOa1FE.js +18 -0
- package/dist/style.css +2 -2
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +41 -1
- package/dist/tailwind.js +16 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +0 -10
- package/dist/ui.js +345 -163
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.d.ts +1 -1
- package/dist/web-blocks.js +489 -724
- package/package.json +15 -45
- package/dist/AddBlocks-6dJmFSgk.js +0 -142
- package/dist/AddBlocks-doCNVVbk.cjs +0 -1
- package/dist/CanvasArea-kB6ky_uL.js +0 -164
- package/dist/CanvasArea-kdnkFfKR.cjs +0 -1
- package/dist/CodeEditor-ypUx3RAV.cjs +0 -1
- package/dist/CurrentPage-Ekl5Cwbv.cjs +0 -1
- package/dist/CurrentPage-bHq9Uusr.js +0 -108
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/MODIFIERS-fd5XOmum.js +0 -60
- package/dist/MODIFIERS-mVmfEGgo.cjs +0 -1
- package/dist/PagesPanel-SMHrEmCb.cjs +0 -1
- package/dist/PagesPanel-wIPAyjJK.js +0 -66
- package/dist/ProjectPanel-L-SlDizV.js +0 -87
- package/dist/ProjectPanel-YruLal65.cjs +0 -1
- package/dist/Settings-WXkCyhAv.js +0 -2380
- package/dist/Settings-_5VHcgFC.cjs +0 -1
- package/dist/SidePanels-UeIZB3e1.cjs +0 -1
- package/dist/StaticCanvas-7C52tXAv.js +0 -749
- package/dist/StaticCanvas-ll9VTXI5.cjs +0 -60
- package/dist/ThemeConfigPanel-_86vVxLz.cjs +0 -1
- package/dist/ThemeConfigPanel-gw8B2zvx.js +0 -194
- package/dist/Topbar-gb17oHdJ.cjs +0 -1
- package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
- package/dist/UnsplashImages-6UjgojvF.cjs +0 -1
- package/dist/UploadImages-3h0cRsvr.cjs +0 -1
- package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
- package/dist/add-page-modal-qr7rvJzN.js +0 -106
- package/dist/add-page-modal-rOKavDFX.cjs +0 -1
- package/dist/atoms-KQpaDRnF.cjs +0 -1
- package/dist/atoms-Oomqut88.js +0 -6
- package/dist/confirm-alert-P6TAevaP.js +0 -60
- package/dist/confirm-alert-v1lG8ex4.cjs +0 -1
- package/dist/controls-rRZhz0vu.cjs +0 -1
- package/dist/controls-yjgoZzB6.js +0 -199
- package/dist/delete-page-modal-55oioI9i.js +0 -85
- package/dist/delete-page-modal-wdAiMVnL.cjs +0 -1
- package/dist/email-blocks.cjs +0 -1
- package/dist/email-blocks.d.ts +0 -3
- package/dist/email-blocks.js +0 -294
- package/dist/email.cjs +0 -1
- package/dist/email.d.ts +0 -171
- package/dist/email.js +0 -75
- package/dist/empty-slot-Lsxjts7Q.js +0 -6
- package/dist/empty-slot-Sy930lX6.cjs +0 -1
- package/dist/form-4jTocVbZ.cjs +0 -1
- package/dist/form-5ke_lZv8.js +0 -125
- package/dist/functions--tdNWQDW.js +0 -30
- package/dist/functions-EVUeSwX1.cjs +0 -1
- package/dist/html-to-json-_01DXd-a.js +0 -192
- package/dist/html-to-json-ndxaXRT8.cjs +0 -1
- package/dist/index--mLLy7QQ.cjs +0 -1
- package/dist/index-6w-6HYBd.cjs +0 -1
- package/dist/index-VBXQixVm.js +0 -117
- package/dist/index-aeDphKpP.cjs +0 -1
- package/dist/index-audsIPBC.cjs +0 -231
- package/dist/index-b33n_-zO.js +0 -3141
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-fnkMn4Pk.js +0 -2201
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/index-wRAIA8zZ.js +0 -80248
- package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
- package/dist/lib.cjs +0 -3
- package/dist/lib.d.ts +0 -80
- package/dist/lib.js +0 -1350
- package/dist/page-viewer-t44DP65U.js +0 -112
- package/dist/page-viewer-wU7T0f48.cjs +0 -1
- package/dist/plugin-2hf9pCRy.cjs +0 -1
- package/dist/plugin-wDnsBVPp.js +0 -54
- package/dist/project-general-setting-87cX9vvO.cjs +0 -1
- package/dist/project-general-setting-NEkNjf7V.js +0 -81
- package/dist/project-seo-setting-YmspOYsF.js +0 -83
- package/dist/project-seo-setting-o0V9acCV.cjs +0 -1
- package/dist/server.cjs +0 -1
- package/dist/server.d.ts +0 -299
- package/dist/server.js +0 -216
- package/dist/single-page-detail-27UjWK8L.cjs +0 -1
- package/dist/single-page-detail-jHzoDP7B.js +0 -220
- package/dist/studio.cjs +0 -1
- package/dist/studio.d.ts +0 -176
- package/dist/studio.js +0 -55
- package/dist/utils-D_vtk3zK.cjs +0 -1
- package/dist/utils-VpVqnC9m.js +0 -1075
|
@@ -1,58 +1,74 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import { useState as p, useEffect as D } from "react";
|
|
3
3
|
import { isEmpty as d, startCase as E } from "lodash-es";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
5
|
import { createApi as B } from "unsplash-js";
|
|
6
|
-
import {
|
|
6
|
+
import { Q as F, P as K, s as Q, t as U, X as V, B as O } from "./context-menu-sks9vdzC.js";
|
|
7
|
+
import { S as P, c as S, b as C, d as I, f as h } from "./select-JW3OMYm-.js";
|
|
8
|
+
import "react-i18next";
|
|
9
|
+
import { c as H } from "./index-Dgo2PNEV.js";
|
|
7
10
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
8
|
-
import { Loader as
|
|
9
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
10
|
-
import "@radix-ui/react-toggle";
|
|
11
|
-
import "class-variance-authority";
|
|
12
|
-
import "./utils-VpVqnC9m.js";
|
|
13
|
-
import "./MODIFIERS-fd5XOmum.js";
|
|
14
|
-
import "clsx";
|
|
15
|
-
import "tailwind-merge";
|
|
11
|
+
import { Loader as X } from "lucide-react";
|
|
16
12
|
import "@radix-ui/react-switch";
|
|
17
|
-
import "@radix-ui/react-slot";
|
|
18
13
|
import "@radix-ui/react-accordion";
|
|
14
|
+
import "class-variance-authority";
|
|
19
15
|
import "@radix-ui/react-alert-dialog";
|
|
20
|
-
import "@radix-ui/react-
|
|
16
|
+
import "@radix-ui/react-slot";
|
|
21
17
|
import "@radix-ui/react-label";
|
|
22
18
|
import "@radix-ui/react-scroll-area";
|
|
23
19
|
import "@radix-ui/react-tabs";
|
|
24
20
|
import "@radix-ui/react-tooltip";
|
|
25
21
|
import "@radix-ui/react-popover";
|
|
26
|
-
import "@radix-ui/react-menubar";
|
|
27
22
|
import "@radix-ui/react-hover-card";
|
|
28
|
-
import "@radix-ui/react-select";
|
|
29
23
|
import "@radix-ui/react-dropdown-menu";
|
|
30
|
-
import "@radix-ui/react-separator";
|
|
31
24
|
import "@radix-ui/react-toast";
|
|
32
25
|
import "cmdk";
|
|
26
|
+
import "@radix-ui/react-dialog";
|
|
33
27
|
import "@radix-ui/react-context-menu";
|
|
34
|
-
import "
|
|
35
|
-
import "
|
|
36
|
-
import "react-
|
|
37
|
-
import "./Functions-7jnEwJyw.js";
|
|
38
|
-
import "@chaibuilder/runtime";
|
|
28
|
+
import "clsx";
|
|
29
|
+
import "tailwind-merge";
|
|
30
|
+
import "@radix-ui/react-select";
|
|
39
31
|
import "jotai";
|
|
32
|
+
import "./iconBase-zweRWSz0.js";
|
|
33
|
+
import "@chaibuilder/runtime";
|
|
34
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
40
35
|
import "tree-model";
|
|
41
|
-
import "react-
|
|
42
|
-
|
|
36
|
+
import "react-quill";
|
|
37
|
+
import "./STRINGS--j49GZJP.js";
|
|
38
|
+
import "react-hotkeys-hook";
|
|
39
|
+
import "@floating-ui/dom";
|
|
40
|
+
import "@floating-ui/react-dom";
|
|
41
|
+
import "flagged";
|
|
42
|
+
import "@tailwindcss/typography";
|
|
43
|
+
import "@tailwindcss/forms";
|
|
44
|
+
import "@tailwindcss/aspect-ratio";
|
|
45
|
+
import "tailwindcss-palette-generator";
|
|
46
|
+
import "lodash";
|
|
47
|
+
import "react-wrap-balancer";
|
|
48
|
+
import "react-dom";
|
|
49
|
+
import "prop-types";
|
|
50
|
+
import "@rjsf/validator-ajv8";
|
|
51
|
+
import "@rjsf/core";
|
|
52
|
+
import "react-arborist";
|
|
53
|
+
import "himalaya";
|
|
54
|
+
import "react-icons-picker";
|
|
55
|
+
import "react-autosuggest";
|
|
56
|
+
import "fuse.js";
|
|
57
|
+
import "i18next";
|
|
58
|
+
const k = async (x, g) => new Promise((o, a) => {
|
|
43
59
|
B({ accessKey: g }).search.getPhotos(x).then((i) => {
|
|
44
60
|
o(i);
|
|
45
|
-
}).catch((i) =>
|
|
46
|
-
}),
|
|
47
|
-
const o =
|
|
61
|
+
}).catch((i) => a(i));
|
|
62
|
+
}), Me = ({ isModalView: x, onSelect: g }) => {
|
|
63
|
+
const o = H("unsplashAccessKey", ""), [a, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
|
|
48
64
|
if (d(u))
|
|
49
65
|
return;
|
|
50
|
-
let
|
|
51
|
-
s && (s.preventDefault(),
|
|
52
|
-
const m = { query: u, page:
|
|
53
|
-
l && (m.orientation = l), n && (m.color = n), k(m, o).then((
|
|
54
|
-
var
|
|
55
|
-
j(
|
|
66
|
+
let r = i + 1;
|
|
67
|
+
s && (s.preventDefault(), r = 1), c(!0), v(r);
|
|
68
|
+
const m = { query: u, page: r };
|
|
69
|
+
l && (m.orientation = l), n && (m.color = n), k(m, o).then((t) => {
|
|
70
|
+
var N, b, w;
|
|
71
|
+
j(r === 1 ? ((N = t == null ? void 0 : t.response) == null ? void 0 : N.results) || [] : [...a, ...((b = t == null ? void 0 : t.response) == null ? void 0 : b.results) || []]), y((w = t == null ? void 0 : t.response) == null ? void 0 : w.total_pages), c(!1);
|
|
56
72
|
}).catch(() => {
|
|
57
73
|
c(!1);
|
|
58
74
|
});
|
|
@@ -61,9 +77,9 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
61
77
|
if (!d(u) && o) {
|
|
62
78
|
c(!0);
|
|
63
79
|
const s = { query: u, page: 1 };
|
|
64
|
-
l && (s.orientation = l), n && (s.color = n), v(1), k(s, o).then((
|
|
65
|
-
var m,
|
|
66
|
-
j(((m =
|
|
80
|
+
l && (s.orientation = l), n && (s.color = n), v(1), k(s, o).then((r) => {
|
|
81
|
+
var m, t;
|
|
82
|
+
j(((m = r == null ? void 0 : r.response) == null ? void 0 : m.results) || []), y((t = r == null ? void 0 : r.response) == null ? void 0 : t.total_pages), c(!1);
|
|
67
83
|
}).catch(() => {
|
|
68
84
|
c(!1);
|
|
69
85
|
});
|
|
@@ -83,7 +99,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
83
99
|
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
84
100
|
/* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
|
|
85
101
|
/* @__PURE__ */ e.jsx(
|
|
86
|
-
|
|
102
|
+
F,
|
|
87
103
|
{
|
|
88
104
|
type: "text",
|
|
89
105
|
name: "query",
|
|
@@ -92,17 +108,17 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
92
108
|
onChange: (s) => T(s.target.value)
|
|
93
109
|
}
|
|
94
110
|
),
|
|
95
|
-
/* @__PURE__ */ e.jsxs(
|
|
96
|
-
/* @__PURE__ */ e.jsx(
|
|
111
|
+
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
112
|
+
/* @__PURE__ */ e.jsx(Q, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
|
|
97
113
|
/* @__PURE__ */ e.jsx(
|
|
98
|
-
|
|
114
|
+
U,
|
|
99
115
|
{
|
|
100
116
|
side: x ? "bottom" : "right",
|
|
101
117
|
className: "z-[9999] flex w-max items-center justify-center",
|
|
102
118
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
103
119
|
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
104
120
|
/* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
|
|
105
|
-
/* @__PURE__ */ e.jsx(
|
|
121
|
+
/* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
|
|
106
122
|
/* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
|
|
107
123
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
108
124
|
/* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
|
|
@@ -112,7 +128,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
112
128
|
] }),
|
|
113
129
|
/* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
|
|
114
130
|
/* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
|
|
115
|
-
/* @__PURE__ */ e.jsx(
|
|
131
|
+
/* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
|
|
116
132
|
/* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
|
|
117
133
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
118
134
|
[
|
|
@@ -136,15 +152,15 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
136
152
|
] })
|
|
137
153
|
] }),
|
|
138
154
|
/* @__PURE__ */ e.jsxs(
|
|
139
|
-
|
|
155
|
+
V,
|
|
140
156
|
{
|
|
141
|
-
className: `h-full ${x && !d(
|
|
157
|
+
className: `h-full ${x && !d(a) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
|
|
142
158
|
children: [
|
|
143
|
-
d(
|
|
159
|
+
d(a) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
|
144
160
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
|
|
145
161
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
|
|
146
162
|
] }),
|
|
147
|
-
x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children:
|
|
163
|
+
x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: a.map((s) => /* @__PURE__ */ e.jsx(
|
|
148
164
|
"div",
|
|
149
165
|
{
|
|
150
166
|
role: "button",
|
|
@@ -161,7 +177,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
161
177
|
) })
|
|
162
178
|
},
|
|
163
179
|
s.id
|
|
164
|
-
)) }) :
|
|
180
|
+
)) }) : a.map((s) => (
|
|
165
181
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.urls.[small, regular, full]` for image quality
|
|
166
182
|
/* @__PURE__ */ e.jsx("div", { className: "w-full px-2 py-1", children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
167
183
|
"img",
|
|
@@ -173,11 +189,11 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
173
189
|
) }) }, s.id)
|
|
174
190
|
)),
|
|
175
191
|
f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
|
|
176
|
-
/* @__PURE__ */ e.jsx(
|
|
192
|
+
/* @__PURE__ */ e.jsx(X, { className: "animate-spin w-6 h-6" }),
|
|
177
193
|
" Loading..."
|
|
178
194
|
] }),
|
|
179
|
-
!d(
|
|
180
|
-
|
|
195
|
+
!d(a) && i < z && !f && /* @__PURE__ */ e.jsx(
|
|
196
|
+
O,
|
|
181
197
|
{
|
|
182
198
|
size: "sm",
|
|
183
199
|
variant: "link",
|
|
@@ -193,6 +209,6 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
193
209
|
] });
|
|
194
210
|
};
|
|
195
211
|
export {
|
|
196
|
-
|
|
212
|
+
Me as default,
|
|
197
213
|
k as fetchImage
|
|
198
214
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),o=require("react"),l=require("lodash-es"),k=require("@radix-ui/react-icons"),A=require("unsplash-js"),d=require("./context-menu-_8TFbFEJ.cjs"),r=require("./select-fXj5tdMX.cjs");require("react-i18next");const T=require("./index-jhNzBWrV.cjs"),z=require("@react-hookz/web"),_=require("lucide-react");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("@radix-ui/react-select");require("jotai");require("./iconBase-vJD0OXxU.cjs");require("@chaibuilder/runtime");require("./plugin-_F-KZp1i.cjs");require("tree-model");require("react-quill");require("./STRINGS-gPz7CUOk.cjs");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");const g=async(j,E)=>new Promise((a,n)=>{A.createApi({accessKey:E}).search.getPhotos(j).then(u=>{a(u)}).catch(u=>n(u))}),D=({isModalView:j,onSelect:E})=>{const a=T.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[u,R]=o.useState(0),[c,b]=o.useState(),[x,I]=o.useState(),[w,y]=o.useState(0),[h,P]=z.useDebouncedState("",1e3),[q,m]=o.useState(!1),C=async s=>{if(l.isEmpty(h))return;let i=u+1;s&&(s.preventDefault(),i=1),m(!0),R(i);const p={query:h,page:i};c&&(p.orientation=c),x&&(p.color=x),g(p,a).then(t=>{var v,N,S;f(i===1?((v=t==null?void 0:t.response)==null?void 0:v.results)||[]:[...n,...((N=t==null?void 0:t.response)==null?void 0:N.results)||[]]),y((S=t==null?void 0:t.response)==null?void 0:S.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(h)&&a){m(!0);const s={query:h,page:1};c&&(s.orientation=c),x&&(s.color=x),R(1),g(s,a).then(i=>{var p,t;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),y((t=i==null?void 0:i.response)==null?void 0:t.total_pages),m(!1)}).catch(()=>{m(!1)})}},[c,x,h,a]),l.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(d.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>P(s.target.value)}),e.jsxRuntimeExports.jsxs(d.Popover,{children:[e.jsxRuntimeExports.jsx(d.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(k.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(d.PopoverContent,{side:j?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(r.Select,{defaultValue:c,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(r.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(r.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(r.Select,{defaultValue:x,onValueChange:s=>I(s),children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(r.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(r.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(r.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(d.ScrollArea,{className:`h-full ${j&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!q&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),j?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),q&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(_.Loader,{className:"animate-spin w-6 h-6"})," Loading..."]}),!l.isEmpty(n)&&u<w&&!q&&e.jsxRuntimeExports.jsx(d.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>C(void 0),disabled:q,children:q?"":"Load More"})]})]})};exports.default=D;exports.fetchImage=g;
|
|
@@ -1,76 +1,90 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { useState as
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { useState as l, useEffect as k } from "react";
|
|
3
3
|
import { isEmpty as j, map as b } from "lodash-es";
|
|
4
4
|
import { atom as F, useAtom as U } from "jotai";
|
|
5
|
-
import {
|
|
5
|
+
import { X as C } from "./context-menu-sks9vdzC.js";
|
|
6
6
|
import { useTranslation as E } from "react-i18next";
|
|
7
|
+
import { c as y } from "./index-Dgo2PNEV.js";
|
|
7
8
|
import { Upload as G, Loader as P } from "lucide-react";
|
|
8
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
|
-
import "@radix-ui/react-toggle";
|
|
10
|
-
import "class-variance-authority";
|
|
11
|
-
import "./utils-VpVqnC9m.js";
|
|
12
|
-
import "./MODIFIERS-fd5XOmum.js";
|
|
13
|
-
import "clsx";
|
|
14
|
-
import "tailwind-merge";
|
|
15
9
|
import "@radix-ui/react-switch";
|
|
16
|
-
import "@radix-ui/react-slot";
|
|
17
10
|
import "@radix-ui/react-accordion";
|
|
18
11
|
import "@radix-ui/react-icons";
|
|
12
|
+
import "class-variance-authority";
|
|
19
13
|
import "@radix-ui/react-alert-dialog";
|
|
20
|
-
import "@radix-ui/react-
|
|
14
|
+
import "@radix-ui/react-slot";
|
|
21
15
|
import "@radix-ui/react-label";
|
|
22
16
|
import "@radix-ui/react-scroll-area";
|
|
23
17
|
import "@radix-ui/react-tabs";
|
|
24
18
|
import "@radix-ui/react-tooltip";
|
|
25
19
|
import "@radix-ui/react-popover";
|
|
26
|
-
import "@radix-ui/react-menubar";
|
|
27
20
|
import "@radix-ui/react-hover-card";
|
|
28
|
-
import "@radix-ui/react-select";
|
|
29
21
|
import "@radix-ui/react-dropdown-menu";
|
|
30
|
-
import "@radix-ui/react-separator";
|
|
31
22
|
import "@radix-ui/react-toast";
|
|
32
23
|
import "cmdk";
|
|
24
|
+
import "@radix-ui/react-dialog";
|
|
33
25
|
import "@radix-ui/react-context-menu";
|
|
34
|
-
import "
|
|
35
|
-
import "
|
|
36
|
-
import "
|
|
37
|
-
import "./Functions-7jnEwJyw.js";
|
|
26
|
+
import "clsx";
|
|
27
|
+
import "tailwind-merge";
|
|
28
|
+
import "./iconBase-zweRWSz0.js";
|
|
38
29
|
import "@chaibuilder/runtime";
|
|
30
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
39
31
|
import "@react-hookz/web";
|
|
40
32
|
import "tree-model";
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
import "react-quill";
|
|
34
|
+
import "./STRINGS--j49GZJP.js";
|
|
35
|
+
import "react-hotkeys-hook";
|
|
36
|
+
import "@floating-ui/dom";
|
|
37
|
+
import "@floating-ui/react-dom";
|
|
38
|
+
import "flagged";
|
|
39
|
+
import "@tailwindcss/typography";
|
|
40
|
+
import "@tailwindcss/forms";
|
|
41
|
+
import "@tailwindcss/aspect-ratio";
|
|
42
|
+
import "tailwindcss-palette-generator";
|
|
43
|
+
import "lodash";
|
|
44
|
+
import "react-wrap-balancer";
|
|
45
|
+
import "react-dom";
|
|
46
|
+
import "prop-types";
|
|
47
|
+
import "@rjsf/validator-ajv8";
|
|
48
|
+
import "@rjsf/core";
|
|
49
|
+
import "react-arborist";
|
|
50
|
+
import "himalaya";
|
|
51
|
+
import "react-icons-picker";
|
|
52
|
+
import "react-autosuggest";
|
|
53
|
+
import "fuse.js";
|
|
54
|
+
import "i18next";
|
|
55
|
+
const S = F([]), Ae = ({ isModalView: o, onSelect: m }) => {
|
|
56
|
+
const { t: r } = E(), p = y("uploadMediaCallback"), n = y("fetchMediaCallback"), [a, c] = U(S), [N, u] = l(!1), [x, f] = l(!1), [, v] = l(), [h, d] = l("");
|
|
43
57
|
k(() => {
|
|
44
58
|
(async () => {
|
|
45
59
|
if (!n)
|
|
46
60
|
return;
|
|
47
61
|
f(!0);
|
|
48
62
|
const t = await n();
|
|
49
|
-
|
|
63
|
+
c(t || []), f(!1);
|
|
50
64
|
})();
|
|
51
65
|
}, []);
|
|
52
66
|
const w = (t) => {
|
|
53
|
-
var
|
|
54
|
-
if (
|
|
67
|
+
var s, i;
|
|
68
|
+
if (d(""), t && ((i = (s = t == null ? void 0 : t.target) == null ? void 0 : s.files) == null ? void 0 : i.length) > 0) {
|
|
55
69
|
const g = t.target.files[0];
|
|
56
|
-
g.type.startsWith("image") ? I(g) :
|
|
70
|
+
g.type.startsWith("image") ? I(g) : d(r("Please select an image"));
|
|
57
71
|
}
|
|
58
72
|
}, I = async (t) => {
|
|
59
73
|
if (p) {
|
|
60
74
|
u(!0);
|
|
61
75
|
try {
|
|
62
|
-
const { url:
|
|
63
|
-
m(
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
} catch (
|
|
67
|
-
|
|
76
|
+
const { url: s } = await p(t);
|
|
77
|
+
m(s), v(void 0);
|
|
78
|
+
const i = await n();
|
|
79
|
+
c(i);
|
|
80
|
+
} catch (s) {
|
|
81
|
+
c([]), d((s == null ? void 0 : s.message) || "Something went wrong.");
|
|
68
82
|
}
|
|
69
83
|
u(!1);
|
|
70
84
|
}
|
|
71
85
|
};
|
|
72
86
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
73
|
-
/* @__PURE__ */ e.jsxs("label", { htmlFor:
|
|
87
|
+
/* @__PURE__ */ e.jsxs("label", { htmlFor: o ? "upload-in-modal" : "upload-in-panel", children: [
|
|
74
88
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center rounded-lg", children: /* @__PURE__ */ e.jsxs(
|
|
75
89
|
"label",
|
|
76
90
|
{
|
|
@@ -79,14 +93,14 @@ const S = F([]), be = ({ isModalView: a, onSelect: m }) => {
|
|
|
79
93
|
children: [
|
|
80
94
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center pb-6 pt-5", children: [
|
|
81
95
|
/* @__PURE__ */ e.jsx(G, { className: "mb-3 h-10 w-10 text-gray-400" }),
|
|
82
|
-
/* @__PURE__ */ e.jsx("p", { className: "mb-2 text-sm text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children:
|
|
83
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children:
|
|
96
|
+
/* @__PURE__ */ e.jsx("p", { className: "mb-2 text-sm text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: r("Click to upload") }) }),
|
|
97
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: r("SVG, PNG, JPG or GIF (Max. 2mb)") })
|
|
84
98
|
] }),
|
|
85
99
|
N ? /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-full items-center justify-center", children: [
|
|
86
100
|
/* @__PURE__ */ e.jsx(P, { className: "h-6 w-6 animate-spin" }),
|
|
87
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-2 text-sm text-gray-500", children:
|
|
101
|
+
/* @__PURE__ */ e.jsx("span", { className: "ml-2 text-sm text-gray-500", children: r("Uploading...") })
|
|
88
102
|
] }) : null,
|
|
89
|
-
h && /* @__PURE__ */ e.jsx("p", { className: "pb-2 text-xs text-red-500", children: h ||
|
|
103
|
+
h && /* @__PURE__ */ e.jsx("p", { className: "pb-2 text-xs text-red-500", children: h || r("Something went wrong") })
|
|
90
104
|
]
|
|
91
105
|
}
|
|
92
106
|
) }),
|
|
@@ -101,21 +115,21 @@ const S = F([]), be = ({ isModalView: a, onSelect: m }) => {
|
|
|
101
115
|
}
|
|
102
116
|
)
|
|
103
117
|
] }),
|
|
104
|
-
/* @__PURE__ */ e.jsxs(C, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${
|
|
105
|
-
j(
|
|
106
|
-
j(
|
|
118
|
+
/* @__PURE__ */ e.jsxs(C, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${o ? "px-2" : ""} pt-2`, children: [
|
|
119
|
+
j(a) && x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: r("Fetching...") }) }),
|
|
120
|
+
j(a) && !x && /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center text-center", children: [
|
|
107
121
|
/* @__PURE__ */ e.jsx("div", { className: "mb-4 h-12 rounded-full p-6" }),
|
|
108
|
-
/* @__PURE__ */ e.jsx("h3", { className: "mb-2 text-sm font-semibold", children:
|
|
109
|
-
/* @__PURE__ */ e.jsx("p", { className: "mb-4 max-w-sm text-muted-foreground", children:
|
|
122
|
+
/* @__PURE__ */ e.jsx("h3", { className: "mb-2 text-sm font-semibold", children: r("No images found") }),
|
|
123
|
+
/* @__PURE__ */ e.jsx("p", { className: "mb-4 max-w-sm text-muted-foreground", children: r("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.") })
|
|
110
124
|
] }),
|
|
111
|
-
|
|
125
|
+
o ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(a, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => m(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
112
126
|
"img",
|
|
113
127
|
{
|
|
114
128
|
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
115
129
|
alt: t.name,
|
|
116
130
|
src: t.thumbUrl
|
|
117
131
|
}
|
|
118
|
-
) }) }, t.id)) }) : b(
|
|
132
|
+
) }) }, t.id)) }) : b(a, (t) => (
|
|
119
133
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
120
134
|
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => m(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
121
135
|
"img",
|
|
@@ -130,5 +144,5 @@ const S = F([]), be = ({ isModalView: a, onSelect: m }) => {
|
|
|
130
144
|
] });
|
|
131
145
|
};
|
|
132
146
|
export {
|
|
133
|
-
|
|
147
|
+
Ae as default
|
|
134
148
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),u=require("lodash-es"),E=require("jotai"),I=require("./context-menu-_8TFbFEJ.cjs"),w=require("react-i18next"),g=require("./index-jhNzBWrV.cjs"),b=require("lucide-react");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("./iconBase-vJD0OXxU.cjs");require("@chaibuilder/runtime");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("./STRINGS-gPz7CUOk.cjs");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");const k=E.atom([]),S=({isModalView:a,onSelect:o})=>{const{t:s}=w.useTranslation(),d=g.useBuilderProp("uploadMediaCallback"),x=g.useBuilderProp("fetchMediaCallback"),[l,c]=E.useAtom(k),[y,p]=i.useState(!1),[j,h]=i.useState(!1),[,R]=i.useState(),[q,m]=i.useState("");i.useEffect(()=>{(async()=>{if(!x)return;h(!0);const r=await x();c(r||[]),h(!1)})()},[]);const N=r=>{var t,n;if(m(""),r&&((n=(t=r==null?void 0:r.target)==null?void 0:t.files)==null?void 0:n.length)>0){const f=r.target.files[0];f.type.startsWith("image")?v(f):m(s("Please select an image"))}},v=async r=>{if(d){p(!0);try{const{url:t}=await d(r);o(t),R(void 0);const n=await x();c(n)}catch(t){c([]),m((t==null?void 0:t.message)||"Something went wrong.")}p(!1)}};return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("label",{htmlFor:a?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center rounded-lg",children:e.jsxRuntimeExports.jsxs("label",{htmlFor:"image-upload",className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-50 hover:bg-gray-100",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:[e.jsxRuntimeExports.jsx(b.Upload,{className:"mb-3 h-10 w-10 text-gray-400"}),e.jsxRuntimeExports.jsx("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:e.jsxRuntimeExports.jsx("span",{className:"font-semibold",children:s("Click to upload")})}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:s("SVG, PNG, JPG or GIF (Max. 2mb)")})]}),y?e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[e.jsxRuntimeExports.jsx(b.Loader,{className:"h-6 w-6 animate-spin"}),e.jsxRuntimeExports.jsx("span",{className:"ml-2 text-sm text-gray-500",children:s("Uploading...")})]}):null,q&&e.jsxRuntimeExports.jsx("p",{className:"pb-2 text-xs text-red-500",children:q||s("Something went wrong")})]})}),e.jsxRuntimeExports.jsx("input",{type:"file",id:"image-upload",accept:"image/*",hidden:!0,onChange:N})]}),e.jsxRuntimeExports.jsxs(I.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${a?"px-2":""} pt-2`,children:[u.isEmpty(l)&&j&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:s("Fetching...")})}),u.isEmpty(l)&&!j&&e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-4 h-12 rounded-full p-6"}),e.jsxRuntimeExports.jsx("h3",{className:"mb-2 text-sm font-semibold",children:s("No images found")}),e.jsxRuntimeExports.jsx("p",{className:"mb-4 max-w-sm text-muted-foreground",children:s("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.")})]}),a?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:u.map(l,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>o(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.thumbUrl})})},r.id))}):u.map(l,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>o(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.url})})},r.id))]})]})};exports.default=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./jsx-runtime-JYMCiFoE.cjs"),s=require("class-variance-authority"),a=require("./context-menu-_8TFbFEJ.cjs"),r=s.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),i=({className:e,variant:t,...n})=>o.jsxRuntimeExports.jsx("div",{className:a.cn(r({variant:t}),e),...n});exports.Badge=i;exports.badgeVariants=r;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { cva as a } from "class-variance-authority";
|
|
3
|
+
import { ag as n } from "./context-menu-sks9vdzC.js";
|
|
4
|
+
const s = a(
|
|
5
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
10
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
11
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
12
|
+
outline: "text-foreground"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: "default"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
), u = ({ className: r, variant: e, ...t }) => /* @__PURE__ */ o.jsx("div", { className: n(s({ variant: e }), r), ...t });
|
|
20
|
+
export {
|
|
21
|
+
u as B,
|
|
22
|
+
s as b
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./jsx-runtime-JYMCiFoE.cjs"),ot=require("@radix-ui/react-switch"),at=require("react"),st=require("@radix-ui/react-accordion"),f=require("@radix-ui/react-icons"),w=require("class-variance-authority"),rt=require("@radix-ui/react-alert-dialog"),nt=require("@radix-ui/react-slot"),it=require("@radix-ui/react-label"),dt=require("@radix-ui/react-scroll-area"),lt=require("@radix-ui/react-tabs"),mt=require("@radix-ui/react-tooltip"),ct=require("@radix-ui/react-popover"),pt=require("@radix-ui/react-hover-card"),ut=require("@radix-ui/react-dropdown-menu"),xt=require("@radix-ui/react-toast"),c=require("cmdk"),ft=require("@radix-ui/react-dialog"),gt=require("@radix-ui/react-context-menu"),bt=require("clsx"),jt=require("tailwind-merge");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const M=p(ot),r=p(at),b=p(st),m=p(rt),P=p(it),g=p(dt),j=p(lt),v=p(mt),N=p(ct),C=p(pt),i=p(ut),x=p(xt),u=p(ft),d=p(gt),s=(...e)=>jt.twMerge(bt.clsx(e)),z=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(M.Root,{className:s("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:o,children:a.jsxRuntimeExports.jsx(M.Thumb,{className:s("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));z.displayName=M.Root.displayName;const E=w.cva("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),O=r.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,...l},T)=>{const tt=n?nt.Slot:"button";return a.jsxRuntimeExports.jsx(tt,{className:s(E({variant:t,size:o,className:e})),ref:T,...l})});O.displayName="Button";const vt=b.Root,L=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(b.Item,{ref:o,className:s("border-b",e),...t}));L.displayName="AccordionItem";const q=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsx(b.Header,{className:"flex",children:a.jsxRuntimeExports.jsxs(b.Trigger,{ref:n,className:s("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...o,children:[t,o.hideArrow?null:a.jsxRuntimeExports.jsx(f.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));q.displayName=b.Trigger.displayName;const H=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsx(b.Content,{ref:n,className:s("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...o,children:a.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));H.displayName=b.Content.displayName;const yt=w.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),G=r.forwardRef(({className:e,variant:t,...o},n)=>a.jsxRuntimeExports.jsx("div",{ref:n,role:"alert",className:s(yt({variant:t}),e),...o}));G.displayName="Alert";const V=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("h5",{ref:o,className:s("mb-1 font-medium leading-none tracking-tight",e),...t}));V.displayName="AlertTitle";const F=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s("text-sm [&_p]:leading-relaxed",e),...t}));F.displayName="AlertDescription";const Nt=m.Root,Rt=m.Trigger,B=({className:e,...t})=>a.jsxRuntimeExports.jsx(m.Portal,{className:s(e),...t});B.displayName=m.Portal.displayName;const U=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Overlay,{className:s("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));U.displayName=m.Overlay.displayName;const Q=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsxs(B,{children:[a.jsxRuntimeExports.jsx(U,{}),a.jsxRuntimeExports.jsx(m.Content,{ref:o,className:s("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...t})]}));Q.displayName=m.Content.displayName;const X=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("flex flex-col space-y-2 text-center sm:text-left",e),...t});X.displayName="AlertDialogHeader";const Y=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Y.displayName="AlertDialogFooter";const J=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Title,{ref:o,className:s("text-lg font-semibold",e),...t}));J.displayName=m.Title.displayName;const K=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Description,{ref:o,className:s("text-sm text-muted-foreground",e),...t}));K.displayName=m.Description.displayName;const W=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Action,{ref:o,className:s(E(),e),...t}));W.displayName=m.Action.displayName;const Z=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Cancel,{ref:o,className:s(E({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Z.displayName=m.Cancel.displayName;const $=u.Root,ht=u.Trigger,ee=({className:e,...t})=>a.jsxRuntimeExports.jsx(u.Portal,{className:s(e),...t});ee.displayName=u.Portal.displayName;const te=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(u.Overlay,{ref:o,className:s("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));te.displayName=u.Overlay.displayName;const A=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(ee,{children:[a.jsxRuntimeExports.jsx(te,{}),a.jsxRuntimeExports.jsxs(u.Content,{ref:n,className:s("fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...o,children:[t,a.jsxRuntimeExports.jsxs(u.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsxRuntimeExports.jsx(f.Cross2Icon,{className:"h-4 w-4"}),a.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));A.displayName=u.Content.displayName;const oe=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});oe.displayName="DialogHeader";const ae=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ae.displayName="DialogFooter";const se=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(u.Title,{ref:o,className:s("text-lg font-semibold leading-none tracking-tight",e),...t}));se.displayName=u.Title.displayName;const re=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(u.Description,{ref:o,className:s("text-sm text-muted-foreground",e),...t}));re.displayName=u.Description.displayName;const ne=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ne.displayName="Card";const ie=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s("flex flex-col space-y-1.5 p-6",e),...t}));ie.displayName="CardHeader";const de=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("h3",{ref:o,className:s("font-semibold leading-none tracking-tight",e),...t}));de.displayName="CardTitle";const le=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("p",{ref:o,className:s("text-sm text-muted-foreground",e),...t}));le.displayName="CardDescription";const me=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s("p-6 pt-0",e),...t}));me.displayName="CardContent";const ce=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("div",{ref:o,className:s(" flex items-center p-6 pt-0",e),...t}));ce.displayName="CardFooter";const pe=r.forwardRef(({className:e,type:t,...o},n)=>a.jsxRuntimeExports.jsx("input",{type:t,className:s("flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...o,autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}));pe.displayName="Input";const wt=w.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ue=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(P.Root,{ref:o,className:s(wt(),e),...t}));ue.displayName=P.Root.displayName;const xe=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx("textarea",{className:s("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t,autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}));xe.displayName="Textarea";const fe=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(g.Root,{ref:n,className:s("relative overflow-hidden",e),...o,children:[a.jsxRuntimeExports.jsx(g.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsxRuntimeExports.jsx(k,{}),a.jsxRuntimeExports.jsx(g.Corner,{})]}));fe.displayName=g.Root.displayName;const k=r.forwardRef(({className:e,orientation:t="vertical",...o},n)=>a.jsxRuntimeExports.jsx(g.ScrollAreaScrollbar,{ref:n,orientation:t,className:s("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...o,children:a.jsxRuntimeExports.jsx(g.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));k.displayName=g.ScrollAreaScrollbar.displayName;const Ct=j.Root,ge=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(j.List,{ref:o,className:s("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ge.displayName=j.List.displayName;const be=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(j.Trigger,{ref:o,className:s("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));be.displayName=j.Trigger.displayName;const je=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(j.Content,{ref:o,className:s("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));je.displayName=j.Content.displayName;const Et=v.Portal,Tt=v.Provider,Dt=v.Root,St=v.Trigger,ve=r.forwardRef(({className:e,sideOffset:t=4,...o},n)=>a.jsxRuntimeExports.jsx(v.Content,{ref:n,sideOffset:t,className:s("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));ve.displayName=v.Content.displayName;const Mt=N.Root,At=N.Trigger,ye=r.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},l)=>a.jsxRuntimeExports.jsx(N.Portal,{children:a.jsxRuntimeExports.jsx(N.Content,{ref:l,align:t,sideOffset:o,className:s("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ye.displayName=N.Content.displayName;const kt=C.Root,It=C.Trigger,Ne=r.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},l)=>a.jsxRuntimeExports.jsx(C.Content,{ref:l,align:t,sideOffset:o,className:s("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Ne.displayName=C.Content.displayName;const _t=i.Root,Pt=i.Trigger,zt=i.Group,Ot=i.Portal,Lt=i.Sub,qt=i.RadioGroup,Re=r.forwardRef(({className:e,inset:t,children:o,...n},l)=>a.jsxRuntimeExports.jsxs(i.SubTrigger,{ref:l,className:s("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[o,a.jsxRuntimeExports.jsx(f.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Re.displayName=i.SubTrigger.displayName;const he=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(i.SubContent,{ref:o,className:s("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));he.displayName=i.SubContent.displayName;const we=r.forwardRef(({className:e,sideOffset:t=4,...o},n)=>a.jsxRuntimeExports.jsx(i.Portal,{children:a.jsxRuntimeExports.jsx(i.Content,{ref:n,sideOffset:t,className:s("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));we.displayName=i.Content.displayName;const Ce=r.forwardRef(({className:e,inset:t,...o},n)=>a.jsxRuntimeExports.jsx(i.Item,{ref:n,className:s("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...o}));Ce.displayName=i.Item.displayName;const Ee=r.forwardRef(({className:e,children:t,checked:o,...n},l)=>a.jsxRuntimeExports.jsxs(i.CheckboxItem,{ref:l,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...n,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(i.ItemIndicator,{children:a.jsxRuntimeExports.jsx(f.CheckIcon,{className:"h-4 w-4"})})}),t]}));Ee.displayName=i.CheckboxItem.displayName;const Te=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(i.RadioItem,{ref:n,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(i.ItemIndicator,{children:a.jsxRuntimeExports.jsx(f.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Te.displayName=i.RadioItem.displayName;const De=r.forwardRef(({className:e,inset:t,...o},n)=>a.jsxRuntimeExports.jsx(i.Label,{ref:n,className:s("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));De.displayName=i.Label.displayName;const Se=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(i.Separator,{ref:o,className:s("-mx-1 my-1 h-px bg-muted",e),...t}));Se.displayName=i.Separator.displayName;const Me=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:s("ml-auto text-xs tracking-widest opacity-60",e),...t});Me.displayName="DropdownMenuShortcut";const Ht=1,Gt=1e6;let D=0;function Vt(){return D=(D+1)%Number.MAX_VALUE,D.toString()}const S=new Map,_=e=>{if(S.has(e))return;const t=setTimeout(()=>{S.delete(e),y({type:"REMOVE_TOAST",toastId:e})},Gt);S.set(e,t)},Ae=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Ht)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case"DISMISS_TOAST":{const{toastId:o}=t;return o?_(o):e.toasts.forEach(n=>{_(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===o||o===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)}}},R=[];let h={toasts:[]};function y(e){h=Ae(h,e),R.forEach(t=>{t(h)})}function ke({...e}){const t=Vt(),o=l=>y({type:"UPDATE_TOAST",toast:{...l,id:t}}),n=()=>y({type:"DISMISS_TOAST",toastId:t});return y({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:l=>{l||n()}}}),{id:t,dismiss:n,update:o}}function Ie(){const[e,t]=r.useState(h);return r.useEffect(()=>(R.push(t),()=>{const o=R.indexOf(t);o>-1&&R.splice(o,1)}),[e]),{...e,toast:ke,dismiss:o=>y({type:"DISMISS_TOAST",toastId:o})}}const Ft=x.Provider,_e=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(x.Viewport,{ref:o,className:s("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));_e.displayName=x.Viewport.displayName;const Bt=w.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Pe=r.forwardRef(({className:e,variant:t,...o},n)=>a.jsxRuntimeExports.jsx(x.Root,{ref:n,className:s(Bt({variant:t}),e),...o}));Pe.displayName=x.Root.displayName;const Ut=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(x.Action,{ref:o,className:s("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Ut.displayName=x.Action.displayName;const ze=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(x.Close,{ref:o,className:s("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsxRuntimeExports.jsx(f.Cross2Icon,{className:"h-4 w-4"})}));ze.displayName=x.Close.displayName;const Oe=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(x.Title,{ref:o,className:s("text-sm font-semibold [&+div]:text-xs",e),...t}));Oe.displayName=x.Title.displayName;const Le=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(x.Description,{ref:o,className:s("text-sm opacity-90",e),...t}));Le.displayName=x.Description.displayName;function Qt(){const{toasts:e}=Ie();return a.jsxRuntimeExports.jsxs(Ft,{children:[e.map(({id:t,title:o,description:n,action:l,...T})=>a.jsxRuntimeExports.jsxs(Pe,{...T,children:[a.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[o&&a.jsxRuntimeExports.jsx(Oe,{children:o}),n&&a.jsxRuntimeExports.jsx(Le,{children:n})]}),l,a.jsxRuntimeExports.jsx(ze,{})]},t)),a.jsxRuntimeExports.jsx(_e,{})]})}const Xt=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:s("animate-pulse rounded-md bg-primary/10",e),...t}),I=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(c.Command,{ref:o,className:s("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));I.displayName=c.Command.displayName;const Yt=({children:e,...t})=>a.jsxRuntimeExports.jsx($,{...t,children:a.jsxRuntimeExports.jsx(A,{className:"overflow-hidden p-0",children:a.jsxRuntimeExports.jsx(I,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),qe=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsxRuntimeExports.jsx(f.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsxRuntimeExports.jsx(c.Command.Input,{ref:o,className:s("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));qe.displayName=c.Command.Input.displayName;const He=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(c.Command.List,{ref:o,className:s("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));He.displayName=c.Command.List.displayName;const Ge=r.forwardRef((e,t)=>a.jsxRuntimeExports.jsx(c.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ge.displayName=c.Command.Empty.displayName;const Ve=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(c.Command.Group,{ref:o,className:s("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ve.displayName=c.Command.Group.displayName;const Fe=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(c.Command.Separator,{ref:o,className:s("-mx-1 h-px bg-border",e),...t}));Fe.displayName=c.Command.Separator.displayName;const Be=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(c.Command.Item,{ref:o,className:s("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Be.displayName=c.Command.Item.displayName;const Ue=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:s("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Ue.displayName="CommandShortcut";const Jt=d.Root,Kt=d.Trigger,Wt=d.Group,Zt=d.Portal,$t=d.Sub,eo=d.RadioGroup,Qe=r.forwardRef(({className:e,inset:t,children:o,...n},l)=>a.jsxRuntimeExports.jsxs(d.SubTrigger,{ref:l,className:s("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[o,a.jsxRuntimeExports.jsx(f.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Qe.displayName=d.SubTrigger.displayName;const Xe=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.SubContent,{ref:o,className:s("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Xe.displayName=d.SubContent.displayName;const Ye=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Portal,{children:a.jsxRuntimeExports.jsx(d.Content,{ref:o,className:s("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));Ye.displayName=d.Content.displayName;const Je=r.forwardRef(({className:e,inset:t,...o},n)=>a.jsxRuntimeExports.jsx(d.Item,{ref:n,className:s("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...o}));Je.displayName=d.Item.displayName;const Ke=r.forwardRef(({className:e,children:t,checked:o,...n},l)=>a.jsxRuntimeExports.jsxs(d.CheckboxItem,{ref:l,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...n,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(d.ItemIndicator,{children:a.jsxRuntimeExports.jsx(f.CheckIcon,{className:"h-4 w-4"})})}),t]}));Ke.displayName=d.CheckboxItem.displayName;const We=r.forwardRef(({className:e,children:t,...o},n)=>a.jsxRuntimeExports.jsxs(d.RadioItem,{ref:n,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(d.ItemIndicator,{children:a.jsxRuntimeExports.jsx(f.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));We.displayName=d.RadioItem.displayName;const Ze=r.forwardRef(({className:e,inset:t,...o},n)=>a.jsxRuntimeExports.jsx(d.Label,{ref:n,className:s("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...o}));Ze.displayName=d.Label.displayName;const $e=r.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Separator,{ref:o,className:s("-mx-1 my-1 h-px bg-border",e),...t}));$e.displayName=d.Separator.displayName;const et=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:s("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});et.displayName="ContextMenuShortcut";exports.Accordion=vt;exports.AccordionContent=H;exports.AccordionItem=L;exports.AccordionTrigger=q;exports.Alert=G;exports.AlertDescription=F;exports.AlertDialog=Nt;exports.AlertDialogAction=W;exports.AlertDialogCancel=Z;exports.AlertDialogContent=Q;exports.AlertDialogDescription=K;exports.AlertDialogFooter=Y;exports.AlertDialogHeader=X;exports.AlertDialogTitle=J;exports.AlertDialogTrigger=Rt;exports.AlertTitle=V;exports.Button=O;exports.Card=ne;exports.CardContent=me;exports.CardDescription=le;exports.CardFooter=ce;exports.CardHeader=ie;exports.CardTitle=de;exports.Command=I;exports.CommandDialog=Yt;exports.CommandEmpty=Ge;exports.CommandGroup=Ve;exports.CommandInput=qe;exports.CommandItem=Be;exports.CommandList=He;exports.CommandSeparator=Fe;exports.CommandShortcut=Ue;exports.ContextMenu=Jt;exports.ContextMenuCheckboxItem=Ke;exports.ContextMenuContent=Ye;exports.ContextMenuGroup=Wt;exports.ContextMenuItem=Je;exports.ContextMenuLabel=Ze;exports.ContextMenuPortal=Zt;exports.ContextMenuRadioGroup=eo;exports.ContextMenuRadioItem=We;exports.ContextMenuSeparator=$e;exports.ContextMenuShortcut=et;exports.ContextMenuSub=$t;exports.ContextMenuSubContent=Xe;exports.ContextMenuSubTrigger=Qe;exports.ContextMenuTrigger=Kt;exports.Dialog=$;exports.DialogContent=A;exports.DialogDescription=re;exports.DialogFooter=ae;exports.DialogHeader=oe;exports.DialogTitle=se;exports.DialogTrigger=ht;exports.DropdownMenu=_t;exports.DropdownMenuCheckboxItem=Ee;exports.DropdownMenuContent=we;exports.DropdownMenuGroup=zt;exports.DropdownMenuItem=Ce;exports.DropdownMenuLabel=De;exports.DropdownMenuPortal=Ot;exports.DropdownMenuRadioGroup=qt;exports.DropdownMenuRadioItem=Te;exports.DropdownMenuSeparator=Se;exports.DropdownMenuShortcut=Me;exports.DropdownMenuSub=Lt;exports.DropdownMenuSubContent=he;exports.DropdownMenuSubTrigger=Re;exports.DropdownMenuTrigger=Pt;exports.HoverCard=kt;exports.HoverCardContent=Ne;exports.HoverCardTrigger=It;exports.Input=pe;exports.Label=ue;exports.Popover=Mt;exports.PopoverContent=ye;exports.PopoverTrigger=At;exports.ScrollArea=fe;exports.ScrollBar=k;exports.Skeleton=Xt;exports.Switch=z;exports.Tabs=Ct;exports.TabsContent=je;exports.TabsList=ge;exports.TabsTrigger=be;exports.Textarea=xe;exports.Toaster=Qt;exports.Tooltip=Dt;exports.TooltipContent=ve;exports.TooltipPortal=Et;exports.TooltipProvider=Tt;exports.TooltipTrigger=St;exports.buttonVariants=E;exports.cn=s;exports.reducer=Ae;exports.toast=ke;exports.useToast=Ie;
|