@oneplatformdev/ui 0.1.99-beta.297 → 0.1.99-beta.299

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.
@@ -1,73 +1,74 @@
1
- import { jsxs as r, jsx as e, Fragment as U } from "react/jsx-runtime";
2
- import { X as M, Plus as Me, UploadIcon as ke, FileTextIcon as V, InfoIcon as ee } from "lucide-react";
3
- import { forwardRef as Ae, useState as te, useEffect as Re, useImperativeHandle as We } from "react";
4
- import { useDropzone as _e } from "react-dropzone";
1
+ import { jsxs as l, jsx as t, Fragment as V } from "react/jsx-runtime";
2
+ import { X as M, Plus as ke, UploadIcon as We, FileTextIcon as ee, InfoIcon as te } from "lucide-react";
3
+ import { forwardRef as _e, useState as le, useEffect as $e, useImperativeHandle as Le } from "react";
4
+ import { useDropzone as Ge } from "react-dropzone";
5
5
  import { cn as x } from "@oneplatformdev/utils";
6
- import { Card as $e } from "../Card/Card.js";
7
- import { DEFAULT_FILE_TYPES as Ge } from "./Dropzone.types.js";
6
+ import { Card as Xe } from "../Card/Card.js";
7
+ import { DEFAULT_FILE_TYPES as Ke } from "./Dropzone.types.js";
8
8
  import { DropzoneCoverPreview as re } from "./DropzoneCoverPreview.js";
9
- import { FilePreview as Xe } from "./DropzoneFilePreview.js";
10
- import { DropzoneSinglePickPreview as Ke } from "./DropzoneSinglePickPreview.js";
11
- import { isFile as I, isVideoUrl as Le, extractName as Oe } from "./DropzoneUtils.js";
12
- import Pe from "./icons/file-csv.svg.js";
13
- import Te from "./icons/file-doc.svg.js";
14
- import qe from "./icons/file-docx.svg.js";
15
- import le from "./icons/file-jpg.svg.js";
16
- import He from "./icons/file-pdf.svg.js";
17
- import Je from "./icons/file-png.svg.js";
18
- import Ye from "./icons/file-ppt.svg.js";
19
- import Ze from "./icons/file-pptx.svg.js";
20
- import Qe from "./icons/file-rar.svg.js";
21
- import Ue from "./icons/file-svg.svg.js";
22
- import Ve from "./icons/file-webp.svg.js";
23
- import et from "./icons/file-xls.svg.js";
24
- import tt from "./icons/file-xlsx.svg.js";
25
- import rt from "./icons/file-zip.svg.js";
26
- import { Button as lt } from "../Button/Button.js";
27
- const z = (l = 0) => {
28
- if (!l || l < 0) return "0 KB";
29
- const s = 1024, m = s * 1024, a = m * 1024;
30
- if (l >= a) return `${(l / a).toFixed(2)} GB`;
31
- if (l >= m) {
32
- const c = l / m;
33
- return `${c >= 100 ? c.toFixed(0) : c.toFixed(2)} MB`;
9
+ import { DropzoneFileCard as Oe } from "./DropzoneFileCard.js";
10
+ import { FilePreview as Te } from "./DropzoneFilePreview.js";
11
+ import { DropzoneSinglePickPreview as qe } from "./DropzoneSinglePickPreview.js";
12
+ import { isFile as F, isVideoUrl as He, extractName as oe } from "./DropzoneUtils.js";
13
+ import Je from "./icons/file-csv.svg.js";
14
+ import Pe from "./icons/file-doc.svg.js";
15
+ import Ye from "./icons/file-docx.svg.js";
16
+ import ie from "./icons/file-jpg.svg.js";
17
+ import Ze from "./icons/file-pdf.svg.js";
18
+ import Qe from "./icons/file-png.svg.js";
19
+ import Ue from "./icons/file-ppt.svg.js";
20
+ import Ve from "./icons/file-pptx.svg.js";
21
+ import et from "./icons/file-rar.svg.js";
22
+ import tt from "./icons/file-svg.svg.js";
23
+ import lt from "./icons/file-webp.svg.js";
24
+ import rt from "./icons/file-xls.svg.js";
25
+ import ot from "./icons/file-xlsx.svg.js";
26
+ import it from "./icons/file-zip.svg.js";
27
+ import { Button as nt } from "../Button/Button.js";
28
+ const z = (r = 0) => {
29
+ if (!r || r < 0) return "0 KB";
30
+ const s = 1024, d = s * 1024, m = d * 1024;
31
+ if (r >= m) return `${(r / m).toFixed(2)} GB`;
32
+ if (r >= d) {
33
+ const a = r / d;
34
+ return `${a >= 100 ? a.toFixed(0) : a.toFixed(2)} MB`;
34
35
  }
35
- return l >= s ? `${(l / s).toFixed(l / s >= 100 ? 0 : 1)} KB` : `${l} B`;
36
- }, ot = {
37
- csv: Pe,
38
- doc: Te,
39
- docx: qe,
40
- jpg: le,
41
- jpeg: le,
42
- pdf: He,
43
- png: Je,
44
- ppt: Ye,
45
- pptx: Ze,
46
- rar: Qe,
47
- svg: Ue,
48
- webp: Ve,
49
- xls: et,
50
- xlsx: tt,
51
- zip: rt
52
- }, it = (l) => {
53
- if (!l) return "";
54
- const s = l.toLowerCase().split(".");
36
+ return r >= s ? `${(r / s).toFixed(r / s >= 100 ? 0 : 1)} KB` : `${r} B`;
37
+ }, st = {
38
+ csv: Je,
39
+ doc: Pe,
40
+ docx: Ye,
41
+ jpg: ie,
42
+ jpeg: ie,
43
+ pdf: Ze,
44
+ png: Qe,
45
+ ppt: Ue,
46
+ pptx: Ve,
47
+ rar: et,
48
+ svg: tt,
49
+ webp: lt,
50
+ xls: rt,
51
+ xlsx: ot,
52
+ zip: it
53
+ }, ct = (r) => {
54
+ if (!r) return "";
55
+ const s = r.toLowerCase().split(".");
55
56
  return s.length > 1 ? s[s.length - 1] : "";
56
- }, nt = (l) => {
57
- const s = it(l);
58
- return ot[s] ?? null;
59
- }, st = (l, s) => {
60
- if (l === s) return !0;
61
- if (l.length !== s.length) return !1;
62
- for (let m = 0; m < l.length; m++) {
63
- const a = l[m], c = s[m];
64
- if (a !== c) {
65
- if (typeof a == "string" && typeof c == "string") {
66
- if (a !== c) return !1;
57
+ }, ne = (r) => {
58
+ const s = ct(r);
59
+ return st[s] ?? null;
60
+ }, at = (r, s) => {
61
+ if (r === s) return !0;
62
+ if (r.length !== s.length) return !1;
63
+ for (let d = 0; d < r.length; d++) {
64
+ const m = r[d], a = s[d];
65
+ if (m !== a) {
66
+ if (typeof m == "string" && typeof a == "string") {
67
+ if (m !== a) return !1;
67
68
  continue;
68
69
  }
69
- if (I(a) && I(c)) {
70
- if (a.name !== c.name || a.size !== c.size || a.type !== c.type || a.lastModified !== c.lastModified)
70
+ if (F(m) && F(a)) {
71
+ if (m.name !== a.name || m.size !== a.size || m.type !== a.type || m.lastModified !== a.lastModified)
71
72
  return !1;
72
73
  continue;
73
74
  }
@@ -75,76 +76,89 @@ const z = (l = 0) => {
75
76
  }
76
77
  }
77
78
  return !0;
78
- }, ct = Ae(
79
+ }, dt = _e(
79
80
  ({
80
- acceptTypes: l = Ge,
81
+ acceptTypes: r = Ke,
81
82
  maxSizeMB: s,
82
- maxFiles: m = 1,
83
- onErrors: a,
84
- hideErrors: c = !1,
83
+ maxFiles: d = 1,
84
+ onErrors: m,
85
+ hideErrors: a = !1,
85
86
  disabled: f = !1,
86
- classNames: F,
87
- value: v,
88
- onChangeValue: L,
89
- className: oe,
90
- labelDropzonePrompt: k = "Drop files here or click to select",
91
- labelDropzoneSubPrompt: ie = "",
92
- labelOrClickToSelect: ne = "Upload file",
93
- labelSelectedFiles: se = "Selected Files",
94
- labelUploadErrors: ce = "Upload Errors",
95
- labelFileTooLarge: A = "File is too large",
96
- labelInvalidFileType: b = "Invalid file type",
97
- labelVideoUploaded: ae = "Uploaded",
98
- labelVideoReplace: de = "Replace",
99
- singlePick: i = !1,
100
- labelDropzoneClassname: me,
101
- labelDropzoneSubClassname: fe,
87
+ classNames: b,
88
+ value: I,
89
+ onChangeValue: q,
90
+ className: se,
91
+ labelDropzonePrompt: R = "Drop files here or click to select",
92
+ labelDropzoneSubPrompt: ce = "",
93
+ labelOrClickToSelect: ae = "Upload file",
94
+ labelSelectedFiles: de = "Selected Files",
95
+ labelUploadErrors: me = "Upload Errors",
96
+ labelFileTooLarge: k = "File is too large",
97
+ labelInvalidFileType: y = "Invalid file type",
98
+ labelVideoUploaded: fe = "Uploaded",
99
+ labelVideoReplace: pe = "Replace",
100
+ singlePick: n = !1,
101
+ labelDropzoneClassname: xe,
102
+ labelDropzoneSubClassname: he,
102
103
  isUploading: p = !1,
103
- uploadProgress: O = 0,
104
- uploadLoadedBytes: pe = 0,
105
- uploadTotalBytes: xe = 0,
106
- onCancelUpload: P,
107
- labelUploadingTitle: he = "Uploading video...",
108
- labelUploadingHint: ue = "Please do not close this page",
109
- labelUploadingActionCancel: ge = "Cancel",
110
- labelUploadingOf: Ne = "of",
111
- playerTranslations: we,
112
- singlePickFileInfo: R,
113
- persistentDropzone: W = !1,
104
+ uploadProgress: H = 0,
105
+ uploadLoadedBytes: ue = 0,
106
+ uploadTotalBytes: ge = 0,
107
+ onCancelUpload: J,
108
+ labelUploadingTitle: Ne = "Uploading video...",
109
+ labelUploadingHint: Fe = "Please do not close this page",
110
+ labelUploadingActionCancel: we = "Cancel",
111
+ labelUploadingOf: ve = "of",
112
+ playerTranslations: Ce,
113
+ singlePickFileInfo: W,
114
+ persistentDropzone: _ = !1,
114
115
  previewVariant: h = "default",
115
- coverFirstItem: Fe = !1,
116
- ..._
117
- }, ve) => {
118
- const [o, D] = te(v ?? []), [u, T] = te([]), g = o[0], $ = u[0]?.file, Ce = !!$?.type?.includes("image"), G = i && o.length > 0 && I(g), ze = G && g.type.includes("image"), q = G && g.type.includes("video") || i && o.length > 0 && typeof g == "string" && Le(g), X = G && !ze && !q, H = i && !o.length && !!$ && !Ce, N = X ? g : $, E = nt(N?.name), y = i && q, Ie = y, j = i && o.length > 0, be = j && !X && !y, De = (t, d) => {
119
- T(d), a?.(d);
120
- const n = i ? t.slice(0, 1) : [...o, ...t].slice(0, m);
121
- D(n), L?.(n);
116
+ coverFirstItem: ze = !1,
117
+ ...$
118
+ }, be) => {
119
+ const [o, A] = le(I ?? []), [u, P] = le([]), w = o[0], L = u[0]?.file, Ie = !!L?.type?.includes("image"), G = n && o.length > 0 && F(w), Ee = G && w.type.includes("image"), Y = G && w.type.includes("video") || n && o.length > 0 && typeof w == "string" && He(w), X = G && !Ee && !Y, Z = n && !o.length && !!L && !Ie, v = X ? w : L, S = ne(v?.name), j = n && Y, De = j, B = n && o.length > 0, ye = B && !X && !j, N = h === "file-list" && !n && o.length >= d, Ae = (e, c) => {
120
+ P(c), m?.(c);
121
+ const i = n ? e.slice(0, 1) : [...o, ...e].slice(0, d);
122
+ A(i), q?.(i);
122
123
  };
123
- Re(() => {
124
- v && !st(o, v) && D(v);
125
- }, [o, v]);
126
- const B = (t, d) => {
124
+ $e(() => {
125
+ I && !at(o, I) && A(I);
126
+ }, [o, I]);
127
+ const E = (e, c) => {
127
128
  if (f) return;
128
- t.stopPropagation();
129
- const n = o.filter((w, S) => S !== d);
130
- D(n), L?.(n);
131
- }, { getRootProps: Ee, getInputProps: ye, isDragActive: je, open: K } = _e({
132
- onDrop: De,
133
- accept: l.reduce((t, d) => (t[d] = [], t), {}),
129
+ e.stopPropagation();
130
+ const i = o.filter((g, C) => C !== c);
131
+ A(i), q?.(i);
132
+ }, { getRootProps: Se, getInputProps: je, isDragActive: Be, open: K } = Ge({
133
+ onDrop: Ae,
134
+ accept: r.reduce((e, c) => (e[c] = [], e), {}),
134
135
  maxSize: s * 1024 * 1024,
135
- maxFiles: i ? 1 : m,
136
- disabled: f || p,
136
+ maxFiles: n ? 1 : d,
137
+ disabled: f || p || N,
137
138
  noClick: !0
138
139
  });
139
- We(ve, () => ({
140
- setItems: D
140
+ Le(be, () => ({
141
+ setItems: A
141
142
  }), []);
142
- const C = Fe && h === "image-grid" && !i && o.length > 0, J = !p && !i && W && o.length > 0, Y = C ? o.slice(1) : o, Z = !f && !i && h === "image-grid" && o.length > 0 && o.length < m, Be = !i && h === "image-grid" && (W || o.length === 0), Q = !p && !i && (Y.length > 0 || Z) && /* @__PURE__ */ r("div", { className: x("w-full mt-2", F?.previewWrapper), children: [
143
- h === "default" && /* @__PURE__ */ r("pre", { className: "font-semibold text-gray-600", children: [
144
- se,
143
+ const D = ze && h === "image-grid" && !n && o.length > 0, O = !p && !n && _ && o.length > 0, T = D ? o.slice(1) : o, Q = !f && !n && h === "image-grid" && o.length > 0 && o.length < d, Me = !n && h === "image-grid" && (_ || o.length === 0), U = !p && !n && (T.length > 0 || Q) && /* @__PURE__ */ l("div", { className: x("w-full mt-2", b?.previewWrapper), children: [
144
+ h === "default" && /* @__PURE__ */ l("pre", { className: "font-semibold text-gray-600", children: [
145
+ de,
145
146
  ":"
146
147
  ] }),
147
- /* @__PURE__ */ r(
148
+ h === "file-list" ? /* @__PURE__ */ t("div", { className: "mt-2 flex flex-col gap-2", children: T.map((e, c) => {
149
+ const i = F(e) ? e.name : oe(e), g = F(e) ? z(e.size) : "";
150
+ return /* @__PURE__ */ t(
151
+ Oe,
152
+ {
153
+ name: i,
154
+ sizeLabel: g,
155
+ iconSrc: ne(i),
156
+ disabled: f,
157
+ onRemove: (C) => E(C, c)
158
+ },
159
+ c
160
+ );
161
+ }) }) : /* @__PURE__ */ l(
148
162
  "ul",
149
163
  {
150
164
  className: x(
@@ -152,9 +166,9 @@ const z = (l = 0) => {
152
166
  h === "image-grid" ? "gap-2 justify-start" : "gap-4 justify-center"
153
167
  ),
154
168
  children: [
155
- Y.map((t, d) => {
156
- const n = C ? d + 1 : d, w = I(t) ? t.name : Oe(t), S = I(t) ? z(t.size) : "";
157
- return /* @__PURE__ */ r(
169
+ T.map((e, c) => {
170
+ const i = D ? c + 1 : c, g = F(e) ? e.name : oe(e), C = F(e) ? z(e.size) : "";
171
+ return /* @__PURE__ */ l(
158
172
  "li",
159
173
  {
160
174
  className: x(
@@ -162,41 +176,41 @@ const z = (l = 0) => {
162
176
  h === "image-grid" ? "w-[75px] h-[75px]" : "flex flex-col items-center gap-2"
163
177
  ),
164
178
  children: [
165
- /* @__PURE__ */ r("div", { className: "relative w-full h-full", children: [
166
- h === "image-grid" ? /* @__PURE__ */ e(re, { item: t, className: "rounded-[8px]" }) : /* @__PURE__ */ e(Xe, { item: t, styles: F }),
167
- /* @__PURE__ */ e(
179
+ /* @__PURE__ */ l("div", { className: "relative w-full h-full", children: [
180
+ h === "image-grid" ? /* @__PURE__ */ t(re, { item: e, className: "rounded-[8px]" }) : /* @__PURE__ */ t(Te, { item: e, styles: b }),
181
+ /* @__PURE__ */ t(
168
182
  "div",
169
183
  {
170
184
  className: x(
171
185
  "absolute top-0 right-0 z-20 cursor-pointer bg-gray-300 rounded-sm",
172
186
  h === "image-grid" && "top-1 right-1 bg-white/90 rounded-full p-0.5"
173
187
  ),
174
- onClick: (Se) => B(Se, n),
175
- children: /* @__PURE__ */ e(M, { size: 16, strokeWidth: 1, color: "black" })
188
+ onClick: (Re) => E(Re, i),
189
+ children: /* @__PURE__ */ t(M, { size: 16, strokeWidth: 1, color: "black" })
176
190
  }
177
191
  )
178
192
  ] }),
179
- h === "default" && /* @__PURE__ */ r("span", { className: "inline-flex flex-col items-center", children: [
180
- /* @__PURE__ */ e("span", { className: "max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap", children: w }),
181
- S && /* @__PURE__ */ r("span", { children: [
193
+ h === "default" && /* @__PURE__ */ l("span", { className: "inline-flex flex-col items-center", children: [
194
+ /* @__PURE__ */ t("span", { className: "max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap", children: g }),
195
+ C && /* @__PURE__ */ l("span", { children: [
182
196
  "(",
183
- S,
197
+ C,
184
198
  ")"
185
199
  ] })
186
200
  ] })
187
201
  ]
188
202
  },
189
- n
203
+ i
190
204
  );
191
205
  }),
192
- Z && /* @__PURE__ */ e(
206
+ Q && /* @__PURE__ */ t(
193
207
  "li",
194
208
  {
195
209
  className: "relative w-[75px] h-[75px] flex items-center justify-center rounded-[8px] border border-dashed border-[#9368FF80] bg-[#FCFCFC] cursor-pointer hover:bg-[#9368FF0F]",
196
- onClick: (t) => {
197
- t.stopPropagation(), !(f || p) && K();
210
+ onClick: (e) => {
211
+ e.stopPropagation(), !(f || p) && K();
198
212
  },
199
- children: /* @__PURE__ */ e("div", { className: "flex size-6 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(Me, { size: 16, className: "text-[#9368FF]" }) })
213
+ children: /* @__PURE__ */ t("div", { className: "flex size-6 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ t(ke, { size: 16, className: "text-[#9368FF]" }) })
200
214
  },
201
215
  "add-more"
202
216
  )
@@ -204,271 +218,291 @@ const z = (l = 0) => {
204
218
  }
205
219
  )
206
220
  ] });
207
- return /* @__PURE__ */ r("div", { className: "w-full select-none", children: [
208
- /* @__PURE__ */ r(
209
- $e,
221
+ return /* @__PURE__ */ l("div", { className: "w-full select-none", children: [
222
+ /* @__PURE__ */ l(
223
+ Xe,
210
224
  {
211
- ..._,
212
- ...Ee({
213
- onClick: (t) => {
214
- if (!(f || p)) {
215
- if (Ie) {
216
- _.onClick?.(t);
225
+ ...$,
226
+ ...Se({
227
+ onClick: (e) => {
228
+ if (!(f || p || N)) {
229
+ if (De) {
230
+ $.onClick?.(e);
217
231
  return;
218
232
  }
219
- K(), _.onClick?.(t);
233
+ K(), $.onClick?.(e);
220
234
  }
221
235
  }
222
236
  }),
223
237
  className: x(
224
238
  "w-full text-center flex flex-col items-center justify-center gap-6 cursor-pointer",
225
- !j && "border border-dashed border-[#9368FF80] rounded-[8px] bg-[#FCFCFC] p-4",
226
- j && "min-h-0 border-0 bg-transparent p-0",
227
- Be && "aspect-video h-auto",
228
- C && "relative",
239
+ !B && "border border-dashed border-[#9368FF80] rounded-[8px] bg-[#FCFCFC] p-4",
240
+ B && "min-h-0 border-0 bg-transparent p-0",
241
+ Me && "aspect-video h-auto",
242
+ D && "relative",
229
243
  f && "border-[#E4E4E7] pointer-events-none",
230
- u.length > 0 && !j && "border-red-500",
231
- je && "bg-gray-100",
232
- i && "shadow-none!",
233
- i && o.length > 0 && !y && "p-0! shadow-none!",
234
- y && "h-auto! max-h-none! min-h-0! p-2!",
235
- be && "h-64",
236
- oe
244
+ u.length > 0 && !B && "border-red-500",
245
+ Be && "bg-gray-100",
246
+ n && "shadow-none!",
247
+ n && o.length > 0 && !j && "p-0! shadow-none!",
248
+ j && "h-auto! max-h-none! min-h-0! p-2!",
249
+ ye && "h-64",
250
+ N && O && "border-[#E4E4E7] bg-[#F5F5F5] cursor-default pointer-events-none",
251
+ se
237
252
  ),
238
253
  children: [
239
- /* @__PURE__ */ e("input", { ...ye() }),
240
- p && /* @__PURE__ */ r(
254
+ /* @__PURE__ */ t("input", { ...je() }),
255
+ p && /* @__PURE__ */ l(
241
256
  "div",
242
257
  {
243
258
  className: "w-full h-full min-h-46 rounded-lg border border-[#E4E4E7] bg-[#FCFCFC] flex flex-col items-center justify-center gap-4 p-4",
244
- onClick: (t) => t.stopPropagation(),
259
+ onClick: (e) => e.stopPropagation(),
245
260
  children: [
246
- /* @__PURE__ */ r("div", { className: "relative h-24 w-24", children: [
247
- /* @__PURE__ */ e("svg", { className: "h-24 w-24", viewBox: "0 0 100 100", children: /* @__PURE__ */ e("circle", { cx: "50", cy: "50", r: "42", stroke: "#E6E1F5", strokeWidth: "8", fill: "none" }) }),
248
- /* @__PURE__ */ r("span", { className: "absolute inset-0 flex items-center justify-center text-lg font-semibold text-foreground", children: [
249
- Math.max(0, Math.min(100, Math.round(O))),
261
+ /* @__PURE__ */ l("div", { className: "relative h-24 w-24", children: [
262
+ /* @__PURE__ */ t("svg", { className: "h-24 w-24", viewBox: "0 0 100 100", children: /* @__PURE__ */ t("circle", { cx: "50", cy: "50", r: "42", stroke: "#E6E1F5", strokeWidth: "8", fill: "none" }) }),
263
+ /* @__PURE__ */ l("span", { className: "absolute inset-0 flex items-center justify-center text-lg font-semibold text-foreground", children: [
264
+ Math.max(0, Math.min(100, Math.round(H))),
250
265
  "%"
251
266
  ] })
252
267
  ] }),
253
- /* @__PURE__ */ r("div", { className: "text-center", children: [
254
- /* @__PURE__ */ e("p", { className: "text-xl font-semibold text-foreground", children: he }),
255
- /* @__PURE__ */ r("p", { className: "text-sm text-[#666A78]", children: [
256
- z(pe),
268
+ /* @__PURE__ */ l("div", { className: "text-center", children: [
269
+ /* @__PURE__ */ t("p", { className: "text-xl font-semibold text-foreground", children: Ne }),
270
+ /* @__PURE__ */ l("p", { className: "text-sm text-[#666A78]", children: [
271
+ z(ue),
257
272
  " ",
258
- Ne,
273
+ ve,
259
274
  " ",
260
- z(xe)
275
+ z(ge)
261
276
  ] }),
262
- /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-[#666A78]", children: ue })
277
+ /* @__PURE__ */ t("p", { className: "mt-2 text-sm text-[#666A78]", children: Fe })
263
278
  ] }),
264
- /* @__PURE__ */ e("div", { className: "w-full max-w-[520px] h-2 rounded-full bg-[#E6E1F5] overflow-hidden", children: /* @__PURE__ */ e(
279
+ /* @__PURE__ */ t("div", { className: "w-full max-w-[520px] h-2 rounded-full bg-[#E6E1F5] overflow-hidden", children: /* @__PURE__ */ t(
265
280
  "div",
266
281
  {
267
282
  className: "h-full bg-[#9368FF] transition-[width] duration-150 ease-linear",
268
- style: { width: `${Math.max(0, Math.min(100, O))}%` }
283
+ style: { width: `${Math.max(0, Math.min(100, H))}%` }
269
284
  }
270
285
  ) }),
271
- P && /* @__PURE__ */ e(
286
+ J && /* @__PURE__ */ t(
272
287
  "button",
273
288
  {
274
289
  type: "button",
275
290
  className: "mt-1 h-10 min-w-36 rounded-md border border-[#E4E4E7] bg-white px-6 text-base font-medium text-foreground cursor-pointer",
276
- onClick: (t) => {
277
- t.stopPropagation(), P();
291
+ onClick: (e) => {
292
+ e.stopPropagation(), J();
278
293
  },
279
- children: ge
294
+ children: we
280
295
  }
281
296
  )
282
297
  ]
283
298
  }
284
299
  ),
285
- !p && C && /* @__PURE__ */ r(
300
+ !p && D && /* @__PURE__ */ l(
286
301
  "div",
287
302
  {
288
303
  className: "absolute inset-0 rounded-[8px] overflow-hidden",
289
- onClick: (t) => t.stopPropagation(),
304
+ onClick: (e) => e.stopPropagation(),
290
305
  children: [
291
- /* @__PURE__ */ e(re, { item: o[0], className: "rounded-[8px]" }),
292
- /* @__PURE__ */ e(
306
+ /* @__PURE__ */ t(re, { item: o[0], className: "rounded-[8px]" }),
307
+ /* @__PURE__ */ t(
293
308
  "div",
294
309
  {
295
310
  className: "absolute top-2 right-2 z-20 cursor-pointer bg-white/90 rounded-full p-1",
296
- onClick: (t) => B(t, 0),
297
- children: /* @__PURE__ */ e(M, { size: 16, strokeWidth: 1, color: "black" })
311
+ onClick: (e) => E(e, 0),
312
+ children: /* @__PURE__ */ t(M, { size: 16, strokeWidth: 1, color: "black" })
298
313
  }
299
314
  )
300
315
  ]
301
316
  }
302
317
  ),
303
- !p && (o.length === 0 || !i && W) && (u.length === 0 || !i) && /* @__PURE__ */ r(
318
+ !p && (o.length === 0 || !n && _) && (u.length === 0 || !n) && /* @__PURE__ */ l(
304
319
  "div",
305
320
  {
306
321
  className: x(
307
322
  "flex flex-col items-center gap-2 w-full",
308
- F?.idleWrapper,
309
- C && "invisible"
323
+ b?.idleWrapper,
324
+ D && "invisible"
310
325
  ),
311
326
  children: [
312
- /* @__PURE__ */ e("div", { className: "flex size-12 items-center justify-center rounded-full bg-[#9368FF1F]", children: /* @__PURE__ */ e(ke, { className: "size-6 text-[#9368FF]" }) }),
313
- /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-1 w-full", children: !f && /* @__PURE__ */ r(U, { children: [
314
- /* @__PURE__ */ e(
327
+ /* @__PURE__ */ t(
328
+ "div",
329
+ {
330
+ className: x(
331
+ "flex size-12 items-center justify-center rounded-full bg-[#9368FF1F]",
332
+ N && "bg-[#EDEDF0]"
333
+ ),
334
+ children: /* @__PURE__ */ t(
335
+ We,
336
+ {
337
+ className: x(
338
+ "size-6 text-[#9368FF]",
339
+ N && "text-[#A1A1AA]"
340
+ )
341
+ }
342
+ )
343
+ }
344
+ ),
345
+ /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-1 w-full", children: !f && /* @__PURE__ */ l(V, { children: [
346
+ /* @__PURE__ */ t(
315
347
  "span",
316
348
  {
317
349
  className: x(
318
350
  "font-semibold text-[14px] leading-[125%] text-[#06080D] text-center w-full whitespace-pre-line",
319
- me
351
+ N && "text-[#A1A1AA]",
352
+ xe
320
353
  ),
321
- children: k
354
+ children: R
322
355
  }
323
356
  ),
324
- /* @__PURE__ */ e(
357
+ /* @__PURE__ */ t(
325
358
  "span",
326
359
  {
327
360
  className: x(
328
361
  "font-medium text-[12px] leading-[120%] text-[#666A78] text-center w-full whitespace-pre-line",
329
- fe
362
+ he
330
363
  ),
331
- children: ie
364
+ children: ce
332
365
  }
333
366
  )
334
367
  ] }) }),
335
- !f && /* @__PURE__ */ e(
336
- lt,
368
+ !f && /* @__PURE__ */ t(
369
+ nt,
337
370
  {
338
371
  type: "button",
339
372
  size: "md",
340
- children: ne
373
+ disabled: N,
374
+ children: ae
341
375
  }
342
376
  )
343
377
  ]
344
378
  }
345
379
  ),
346
- !p && i && u.length > 0 && !H && /* @__PURE__ */ r("div", { className: x("w-full mt-4", F?.errorWrapper), children: [
347
- /* @__PURE__ */ r("span", { className: "font-semibold text-red-500", children: [
348
- ce,
380
+ !p && n && u.length > 0 && !Z && /* @__PURE__ */ l("div", { className: x("w-full mt-4", b?.errorWrapper), children: [
381
+ /* @__PURE__ */ l("span", { className: "font-semibold text-red-500", children: [
382
+ me,
349
383
  ":"
350
384
  ] }),
351
- /* @__PURE__ */ e("ul", { className: "mt-2 text-sm text-red-500 list-disc list-inside", children: u.map((t, d) => /* @__PURE__ */ r("li", { children: [
352
- t.file.name,
385
+ /* @__PURE__ */ t("ul", { className: "mt-2 text-sm text-red-500 list-disc list-inside", children: u.map((e, c) => /* @__PURE__ */ l("li", { children: [
386
+ e.file.name,
353
387
  " (",
354
- z(t.file.size),
388
+ z(e.file.size),
355
389
  ")",
356
- !c && /* @__PURE__ */ e("ul", { className: "ml-4 list-disc list-inside", children: t.errors.map((n, w) => /* @__PURE__ */ r("li", { children: [
357
- n.code === "file-too-large" && A,
358
- n.code === "file-invalid-type" && b,
359
- n.code !== "file-too-large" && n.code !== "file-invalid-type" && n.message
360
- ] }, w)) })
361
- ] }, d)) })
390
+ !a && /* @__PURE__ */ t("ul", { className: "ml-4 list-disc list-inside", children: e.errors.map((i, g) => /* @__PURE__ */ l("li", { children: [
391
+ i.code === "file-too-large" && k,
392
+ i.code === "file-invalid-type" && y,
393
+ i.code !== "file-too-large" && i.code !== "file-invalid-type" && i.message
394
+ ] }, g)) })
395
+ ] }, c)) })
362
396
  ] }),
363
- !p && !!(i && o.length) && /* @__PURE__ */ e(U, { children: X ? /* @__PURE__ */ r(
397
+ !p && !!(n && o.length) && /* @__PURE__ */ t(V, { children: X ? /* @__PURE__ */ l(
364
398
  "div",
365
399
  {
366
400
  className: "w-full max-w-[502px] flex flex-col items-center gap-4",
367
- onClick: (t) => t.stopPropagation(),
401
+ onClick: (e) => e.stopPropagation(),
368
402
  children: [
369
- /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: k }),
370
- /* @__PURE__ */ r("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
371
- E ? /* @__PURE__ */ e(
403
+ /* @__PURE__ */ t("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: R }),
404
+ /* @__PURE__ */ l("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
405
+ S ? /* @__PURE__ */ t(
372
406
  "img",
373
407
  {
374
- src: E,
408
+ src: S,
375
409
  alt: "",
376
410
  className: "size-10 shrink-0"
377
411
  }
378
- ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(V, { size: 20 }) }),
379
- /* @__PURE__ */ r("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
380
- /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: R?.name || N?.name }),
381
- /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: z(R?.size || N?.size) })
412
+ ) : /* @__PURE__ */ t("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(ee, { size: 20 }) }),
413
+ /* @__PURE__ */ l("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
414
+ /* @__PURE__ */ t("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: W?.name || v?.name }),
415
+ /* @__PURE__ */ t("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: z(W?.size || v?.size) })
382
416
  ] }),
383
- !f && /* @__PURE__ */ e(
417
+ !f && /* @__PURE__ */ t(
384
418
  "div",
385
419
  {
386
420
  className: "size-6 flex items-center justify-center cursor-pointer",
387
- onClick: (t) => B(t, 0),
388
- children: /* @__PURE__ */ e(M, { size: 24, color: "#06080D" })
421
+ onClick: (e) => E(e, 0),
422
+ children: /* @__PURE__ */ t(M, { size: 24, color: "#06080D" })
389
423
  }
390
424
  )
391
425
  ] })
392
426
  ]
393
427
  }
394
- ) : /* @__PURE__ */ e(
395
- Ke,
428
+ ) : /* @__PURE__ */ t(
429
+ qe,
396
430
  {
397
431
  item: o[0],
398
- onRemoveClick: (t) => B(t, 0),
399
- onReplaceClick: (t) => {
400
- t.stopPropagation(), !f && K();
432
+ onRemoveClick: (e) => E(e, 0),
433
+ onReplaceClick: (e) => {
434
+ e.stopPropagation(), !f && K();
401
435
  },
402
- labelUploaded: ae,
403
- labelReplace: de,
404
- fileInfo: R,
436
+ labelUploaded: fe,
437
+ labelReplace: pe,
438
+ fileInfo: W,
405
439
  disabled: f,
406
- playerTranslations: we
440
+ playerTranslations: Ce
407
441
  }
408
442
  ) }),
409
- !p && H && /* @__PURE__ */ r(
443
+ !p && Z && /* @__PURE__ */ l(
410
444
  "div",
411
445
  {
412
446
  className: "w-full max-w-[502px] flex flex-col items-center gap-4",
413
- onClick: (t) => t.stopPropagation(),
447
+ onClick: (e) => e.stopPropagation(),
414
448
  children: [
415
- /* @__PURE__ */ e("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: k }),
416
- /* @__PURE__ */ r("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
417
- E ? /* @__PURE__ */ e(
449
+ /* @__PURE__ */ t("p", { className: "w-full text-center text-[16px] leading-[130%] font-semibold text-[#06080D]", children: R }),
450
+ /* @__PURE__ */ l("div", { className: "w-full min-h-[72px] rounded-[8px] bg-[#F5F5F5] p-4 flex items-center gap-4", children: [
451
+ S ? /* @__PURE__ */ t(
418
452
  "img",
419
453
  {
420
- src: E,
454
+ src: S,
421
455
  alt: "",
422
456
  className: "size-10 shrink-0"
423
457
  }
424
- ) : /* @__PURE__ */ e("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(V, { size: 20 }) }),
425
- /* @__PURE__ */ r("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
426
- /* @__PURE__ */ e("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: N?.name }),
427
- /* @__PURE__ */ e("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: N ? `${(N.size / (1024 * 1024)).toFixed(0)} MB` : "" })
458
+ ) : /* @__PURE__ */ t("div", { className: "size-10 rounded-[8px] bg-[#DC2626] text-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(ee, { size: 20 }) }),
459
+ /* @__PURE__ */ l("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1", children: [
460
+ /* @__PURE__ */ t("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate", children: v?.name }),
461
+ /* @__PURE__ */ t("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#666A78]", children: v ? `${(v.size / (1024 * 1024)).toFixed(0)} MB` : "" })
428
462
  ] }),
429
- !f && /* @__PURE__ */ e(
463
+ !f && /* @__PURE__ */ t(
430
464
  "div",
431
465
  {
432
466
  className: "size-6 flex items-center justify-center cursor-pointer",
433
- onClick: (t) => {
434
- t.stopPropagation(), T([]);
467
+ onClick: (e) => {
468
+ e.stopPropagation(), P([]);
435
469
  },
436
- children: /* @__PURE__ */ e(M, { size: 24, color: "#06080D" })
470
+ children: /* @__PURE__ */ t(M, { size: 24, color: "#06080D" })
437
471
  }
438
472
  )
439
473
  ] }),
440
- /* @__PURE__ */ r("div", { className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4", children: [
441
- /* @__PURE__ */ e(ee, { size: 20, color: "#DC2626" }),
442
- /* @__PURE__ */ e("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: u[0]?.errors?.[0]?.code === "file-too-large" ? A : u[0]?.errors?.[0]?.message || b })
474
+ /* @__PURE__ */ l("div", { className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4", children: [
475
+ /* @__PURE__ */ t(te, { size: 20, color: "#DC2626" }),
476
+ /* @__PURE__ */ t("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: u[0]?.errors?.[0]?.code === "file-too-large" ? k : u[0]?.errors?.[0]?.message || y })
443
477
  ] })
444
478
  ]
445
479
  }
446
480
  ),
447
- !J && Q
481
+ !O && U
448
482
  ]
449
483
  }
450
484
  ),
451
- J && /* @__PURE__ */ e("div", { className: "w-full", children: Q }),
452
- !p && !i && u.length > 0 && /* @__PURE__ */ e(
485
+ O && /* @__PURE__ */ t("div", { className: "w-full", children: U }),
486
+ !p && !n && u.length > 0 && /* @__PURE__ */ t(
453
487
  "div",
454
488
  {
455
- className: x("w-full mt-4 flex flex-col gap-2", F?.errorWrapper),
456
- children: u.map((t, d) => {
457
- const n = t.errors[0], w = n?.code === "file-too-large" ? A : n?.code === "file-invalid-type" ? b : n?.message || b;
458
- return /* @__PURE__ */ r(
489
+ className: x("w-full mt-4 flex flex-col gap-2", b?.errorWrapper),
490
+ children: u.map((e, c) => {
491
+ const i = e.errors[0], g = i?.code === "file-too-large" ? k : i?.code === "file-invalid-type" ? y : i?.message || y;
492
+ return /* @__PURE__ */ l(
459
493
  "div",
460
494
  {
461
495
  className: "w-full bg-[#DC26260F] p-4 flex items-start gap-4 rounded-[8px]",
462
496
  children: [
463
- /* @__PURE__ */ e(ee, { size: 20, color: "#DC2626", className: "shrink-0" }),
464
- /* @__PURE__ */ r("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: [
465
- /* @__PURE__ */ e("span", { className: "font-semibold", children: t.file.name }),
497
+ /* @__PURE__ */ t(te, { size: 20, color: "#DC2626", className: "shrink-0" }),
498
+ /* @__PURE__ */ l("p", { className: "text-[12px] leading-[120%] font-medium text-[#DC2626] text-left", children: [
499
+ /* @__PURE__ */ t("span", { className: "font-semibold", children: e.file.name }),
466
500
  " — ",
467
- w
501
+ g
468
502
  ] })
469
503
  ]
470
504
  },
471
- d
505
+ c
472
506
  );
473
507
  })
474
508
  }
@@ -476,8 +510,8 @@ const z = (l = 0) => {
476
510
  ] });
477
511
  }
478
512
  );
479
- ct.displayName = "Dropzone";
513
+ dt.displayName = "Dropzone";
480
514
  export {
481
- ct as Dropzone
515
+ dt as Dropzone
482
516
  };
483
517
  //# sourceMappingURL=Dropzone.js.map