@cgi-learning-hub/ui 0.0.1-dev.1708941839 → 0.0.1-dev.1708959157

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/{Button-X7eWZQfX.js → Button-C5ROgtyW.js} +12 -12
  2. package/dist/{Button-Tkz5NkF_.cjs → Button-wMPAZpnO.cjs} +1 -1
  3. package/dist/ButtonBase-C5_-KI-D.js +831 -0
  4. package/dist/ButtonBase-XPViWbp_.cjs +75 -0
  5. package/dist/DefaultButton-BD9W4fvr.cjs +28 -0
  6. package/dist/DefaultButton-BlGFPRC7.js +439 -0
  7. package/dist/{Input-CbYjsRHK.js → Input-CGU1Xw4s.js} +10 -10
  8. package/dist/Input-DHic6dYE.cjs +1 -0
  9. package/dist/{InputBase-B13Nzzhk.js → InputBase-D8YZOKOt.js} +138 -157
  10. package/dist/InputBase-WBNJQn8V.cjs +4 -0
  11. package/dist/Tab-C2Tmr8Sv.cjs +1 -0
  12. package/dist/Tab-Dgd9jYEq.js +237 -0
  13. package/dist/TransitionGroupContext-C7wWJ6l7.js +14 -0
  14. package/dist/TransitionGroupContext-g4tmk10h.cjs +1 -0
  15. package/dist/Typography-CO64FVmw.cjs +1 -0
  16. package/dist/Typography-Di0hlj32.js +177 -0
  17. package/dist/assets/index.css +1 -1
  18. package/dist/components/AnotherComponent/AnotherComponent.cjs.js +1 -1
  19. package/dist/components/AnotherComponent/AnotherComponent.es.js +3 -3
  20. package/dist/components/BasicButtons/BasicButtons.cjs.js +1 -1
  21. package/dist/components/BasicButtons/BasicButtons.es.js +10 -10
  22. package/dist/components/BasicButtons/BasicButtons.stories.cjs.js +1 -1
  23. package/dist/components/Dropzone/Dropzone.cjs.js +5 -0
  24. package/dist/components/Dropzone/Dropzone.d.ts +9 -0
  25. package/dist/components/Dropzone/Dropzone.es.js +1209 -0
  26. package/dist/components/Dropzone/index.cjs.js +1 -0
  27. package/dist/components/Dropzone/index.d.ts +2 -0
  28. package/dist/components/Dropzone/index.es.js +4 -0
  29. package/dist/components/buttons/DefaultButton/DefaultButton.cjs.js +1 -28
  30. package/dist/components/buttons/DefaultButton/DefaultButton.es.js +7 -436
  31. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.cjs.js +1 -1
  32. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.es.js +8 -8
  33. package/dist/components/buttons/DefaultButton/index.cjs.js +1 -1
  34. package/dist/components/buttons/DefaultButton/index.es.js +2 -2
  35. package/dist/components/buttons/IconButton/IconButton.cjs.js +2 -0
  36. package/dist/components/buttons/IconButton/IconButton.d.ts +5 -0
  37. package/dist/components/buttons/IconButton/IconButton.es.js +187 -0
  38. package/dist/components/buttons/IconButton/index.cjs.js +1 -0
  39. package/dist/components/buttons/IconButton/index.d.ts +2 -0
  40. package/dist/components/buttons/IconButton/index.es.js +4 -0
  41. package/dist/components/buttons/PrimaryButton/PrimaryButton.cjs.js +1 -1
  42. package/dist/components/buttons/PrimaryButton/PrimaryButton.es.js +4 -4
  43. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.cjs.js +1 -1
  44. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.es.js +1 -1
  45. package/dist/components/buttons/SecondaryButton/SecondaryButton.cjs.js +1 -1
  46. package/dist/components/buttons/SecondaryButton/SecondaryButton.es.js +2 -2
  47. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.cjs.js +1 -1
  48. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.es.js +1 -1
  49. package/dist/components/buttons/index.cjs.js +1 -1
  50. package/dist/components/buttons/index.d.ts +1 -0
  51. package/dist/components/buttons/index.es.js +8 -6
  52. package/dist/components/index.cjs.js +1 -1
  53. package/dist/components/index.d.ts +4 -0
  54. package/dist/components/index.es.js +22 -12
  55. package/dist/components/inputs/SearchInput/SearchInput.cjs.js +1 -1
  56. package/dist/components/inputs/SearchInput/SearchInput.es.js +77 -247
  57. package/dist/components/inputs/TextInput/TextInput.cjs.js +11 -13
  58. package/dist/components/inputs/TextInput/TextInput.es.js +367 -404
  59. package/dist/components/lists/FileList/FileList.cjs.js +1 -0
  60. package/dist/components/lists/FileList/FileList.d.ts +7 -0
  61. package/dist/components/lists/FileList/FileList.es.js +19 -0
  62. package/dist/components/lists/FileList/FileListItem.cjs.js +1 -0
  63. package/dist/components/lists/FileList/FileListItem.d.ts +13 -0
  64. package/dist/components/lists/FileList/FileListItem.es.js +40 -0
  65. package/dist/components/lists/FileList/index.cjs.js +1 -0
  66. package/dist/components/lists/FileList/index.d.ts +4 -0
  67. package/dist/components/lists/FileList/index.es.js +6 -0
  68. package/dist/components/lists/index.cjs.js +1 -0
  69. package/dist/components/lists/index.d.ts +1 -0
  70. package/dist/components/lists/index.es.js +6 -0
  71. package/dist/createSvgIcon-B7HVs3ZC.cjs +2 -0
  72. package/dist/{createSvgIcon-jvI3LIfI.cjs → createSvgIcon-BivvPRyr.cjs} +1 -1
  73. package/dist/createSvgIcon-D3HDfwCm.js +143 -0
  74. package/dist/{createSvgIcon-qXNZi4k1.js → createSvgIcon-D4Mxh_r9.js} +14 -14
  75. package/dist/{extendSxProp-CvhhU9Vb.cjs → extendSxProp-D5gpnasP.cjs} +1 -1
  76. package/dist/{extendSxProp-BRHiEwyk.js → extendSxProp-DCdWqtQk.js} +1 -1
  77. package/dist/index.cjs.js +1 -1
  78. package/dist/index.es.js +20 -10
  79. package/dist/ownerWindow-BoRkeomM.js +23 -0
  80. package/dist/ownerWindow-Dk_4aaak.cjs +1 -0
  81. package/dist/refType-dllUCpD8.cjs +1 -0
  82. package/dist/refType-hKctx4k0.js +29 -0
  83. package/dist/useControlled-BsLcOmhe.js +48 -0
  84. package/dist/useControlled-jN3fqFfv.cjs +3 -0
  85. package/dist/useForkRef-CGd3Nhyb.cjs +1 -0
  86. package/dist/useForkRef-DwN_Iz9R.js +17 -0
  87. package/dist/useIsFocusVisible-BF0lT08B.cjs +1 -0
  88. package/dist/useIsFocusVisible-D8ksiuhS.js +69 -0
  89. package/dist/useTheme-BZek68TX.js +9 -0
  90. package/dist/useTheme-C-LTLVMt.cjs +1 -0
  91. package/dist/{useThemeProps-CDriK9TK.cjs → useThemeProps-C6ClLEqN.cjs} +14 -14
  92. package/dist/{useThemeProps-B6yTTpAe.js → useThemeProps-CHytz5pp.js} +741 -714
  93. package/dist/useTimeout-KN97abZR.js +47 -0
  94. package/dist/useTimeout-qjxkiZZn.cjs +1 -0
  95. package/package.json +2 -1
  96. package/dist/ButtonBase-CKfcGhaU.js +0 -892
  97. package/dist/ButtonBase-Cg8cBMzO.cjs +0 -75
  98. package/dist/Input-CAb0EFzc.cjs +0 -1
  99. package/dist/InputBase-CKlCw9fj.cjs +0 -4
  100. package/dist/useForkRef-82uiK71d.cjs +0 -1
  101. package/dist/useForkRef-CLcOhrzI.js +0 -44
  102. package/dist/useTheme-BWRyHzdn.js +0 -65
  103. package/dist/useTheme-BpLcDNG1.cjs +0 -1
@@ -0,0 +1,1209 @@
1
+ import nr, { jsxs as ve, jsx as T, Fragment as Ue } from "react/jsx-runtime";
2
+ import { r as or, i as ir, B as xr } from "../../createSvgIcon-D3HDfwCm.js";
3
+ import Fr, { useMemo as I, useRef as Q, useReducer as _r, useEffect as ye, useCallback as A, forwardRef as jr, useImperativeHandle as Sr, Fragment as Pr } from "react";
4
+ import { P as f, s as Tr } from "../../useThemeProps-CHytz5pp.js";
5
+ import { T as be } from "../../Typography-Di0hlj32.js";
6
+ var xe = {}, Ir = ir;
7
+ Object.defineProperty(xe, "__esModule", {
8
+ value: !0
9
+ });
10
+ var ar = xe.default = void 0, Cr = Ir(or()), Rr = nr;
11
+ ar = xe.default = (0, Cr.default)(/* @__PURE__ */ (0, Rr.jsx)("path", {
12
+ d: "M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"
13
+ }), "FileUpload");
14
+ var Fe = {}, zr = ir;
15
+ Object.defineProperty(Fe, "__esModule", {
16
+ value: !0
17
+ });
18
+ var ur = Fe.default = void 0, kr = zr(or()), Lr = nr;
19
+ ur = Fe.default = (0, kr.default)(/* @__PURE__ */ (0, Lr.jsx)("path", {
20
+ d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"
21
+ }), "UploadFile");
22
+ function C(e, r, t, n) {
23
+ function i(o) {
24
+ return o instanceof t ? o : new t(function(c) {
25
+ c(o);
26
+ });
27
+ }
28
+ return new (t || (t = Promise))(function(o, c) {
29
+ function s(m) {
30
+ try {
31
+ l(n.next(m));
32
+ } catch (y) {
33
+ c(y);
34
+ }
35
+ }
36
+ function d(m) {
37
+ try {
38
+ l(n.throw(m));
39
+ } catch (y) {
40
+ c(y);
41
+ }
42
+ }
43
+ function l(m) {
44
+ m.done ? o(m.value) : i(m.value).then(s, d);
45
+ }
46
+ l((n = n.apply(e, r || [])).next());
47
+ });
48
+ }
49
+ function R(e, r) {
50
+ var t = { label: 0, sent: function() {
51
+ if (o[0] & 1)
52
+ throw o[1];
53
+ return o[1];
54
+ }, trys: [], ops: [] }, n, i, o, c;
55
+ return c = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (c[Symbol.iterator] = function() {
56
+ return this;
57
+ }), c;
58
+ function s(l) {
59
+ return function(m) {
60
+ return d([l, m]);
61
+ };
62
+ }
63
+ function d(l) {
64
+ if (n)
65
+ throw new TypeError("Generator is already executing.");
66
+ for (; c && (c = 0, l[0] && (t = 0)), t; )
67
+ try {
68
+ if (n = 1, i && (o = l[0] & 2 ? i.return : l[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, l[1])).done)
69
+ return o;
70
+ switch (i = 0, o && (l = [l[0] & 2, o.value]), l[0]) {
71
+ case 0:
72
+ case 1:
73
+ o = l;
74
+ break;
75
+ case 4:
76
+ return t.label++, { value: l[1], done: !1 };
77
+ case 5:
78
+ t.label++, i = l[1], l = [0];
79
+ continue;
80
+ case 7:
81
+ l = t.ops.pop(), t.trys.pop();
82
+ continue;
83
+ default:
84
+ if (o = t.trys, !(o = o.length > 0 && o[o.length - 1]) && (l[0] === 6 || l[0] === 2)) {
85
+ t = 0;
86
+ continue;
87
+ }
88
+ if (l[0] === 3 && (!o || l[1] > o[0] && l[1] < o[3])) {
89
+ t.label = l[1];
90
+ break;
91
+ }
92
+ if (l[0] === 6 && t.label < o[1]) {
93
+ t.label = o[1], o = l;
94
+ break;
95
+ }
96
+ if (o && t.label < o[2]) {
97
+ t.label = o[2], t.ops.push(l);
98
+ break;
99
+ }
100
+ o[2] && t.ops.pop(), t.trys.pop();
101
+ continue;
102
+ }
103
+ l = r.call(e, t);
104
+ } catch (m) {
105
+ l = [6, m], i = 0;
106
+ } finally {
107
+ n = o = 0;
108
+ }
109
+ if (l[0] & 5)
110
+ throw l[1];
111
+ return { value: l[0] ? l[1] : void 0, done: !0 };
112
+ }
113
+ }
114
+ function qe(e, r) {
115
+ var t = typeof Symbol == "function" && e[Symbol.iterator];
116
+ if (!t)
117
+ return e;
118
+ var n = t.call(e), i, o = [], c;
119
+ try {
120
+ for (; (r === void 0 || r-- > 0) && !(i = n.next()).done; )
121
+ o.push(i.value);
122
+ } catch (s) {
123
+ c = { error: s };
124
+ } finally {
125
+ try {
126
+ i && !i.done && (t = n.return) && t.call(n);
127
+ } finally {
128
+ if (c)
129
+ throw c.error;
130
+ }
131
+ }
132
+ return o;
133
+ }
134
+ function Ne(e, r, t) {
135
+ if (t || arguments.length === 2)
136
+ for (var n = 0, i = r.length, o; n < i; n++)
137
+ (o || !(n in r)) && (o || (o = Array.prototype.slice.call(r, 0, n)), o[n] = r[n]);
138
+ return e.concat(o || Array.prototype.slice.call(r));
139
+ }
140
+ var Mr = /* @__PURE__ */ new Map([
141
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
142
+ ["aac", "audio/aac"],
143
+ ["abw", "application/x-abiword"],
144
+ ["arc", "application/x-freearc"],
145
+ ["avif", "image/avif"],
146
+ ["avi", "video/x-msvideo"],
147
+ ["azw", "application/vnd.amazon.ebook"],
148
+ ["bin", "application/octet-stream"],
149
+ ["bmp", "image/bmp"],
150
+ ["bz", "application/x-bzip"],
151
+ ["bz2", "application/x-bzip2"],
152
+ ["cda", "application/x-cdf"],
153
+ ["csh", "application/x-csh"],
154
+ ["css", "text/css"],
155
+ ["csv", "text/csv"],
156
+ ["doc", "application/msword"],
157
+ ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
158
+ ["eot", "application/vnd.ms-fontobject"],
159
+ ["epub", "application/epub+zip"],
160
+ ["gz", "application/gzip"],
161
+ ["gif", "image/gif"],
162
+ ["heic", "image/heic"],
163
+ ["heif", "image/heif"],
164
+ ["htm", "text/html"],
165
+ ["html", "text/html"],
166
+ ["ico", "image/vnd.microsoft.icon"],
167
+ ["ics", "text/calendar"],
168
+ ["jar", "application/java-archive"],
169
+ ["jpeg", "image/jpeg"],
170
+ ["jpg", "image/jpeg"],
171
+ ["js", "text/javascript"],
172
+ ["json", "application/json"],
173
+ ["jsonld", "application/ld+json"],
174
+ ["mid", "audio/midi"],
175
+ ["midi", "audio/midi"],
176
+ ["mjs", "text/javascript"],
177
+ ["mp3", "audio/mpeg"],
178
+ ["mp4", "video/mp4"],
179
+ ["mpeg", "video/mpeg"],
180
+ ["mpkg", "application/vnd.apple.installer+xml"],
181
+ ["odp", "application/vnd.oasis.opendocument.presentation"],
182
+ ["ods", "application/vnd.oasis.opendocument.spreadsheet"],
183
+ ["odt", "application/vnd.oasis.opendocument.text"],
184
+ ["oga", "audio/ogg"],
185
+ ["ogv", "video/ogg"],
186
+ ["ogx", "application/ogg"],
187
+ ["opus", "audio/opus"],
188
+ ["otf", "font/otf"],
189
+ ["png", "image/png"],
190
+ ["pdf", "application/pdf"],
191
+ ["php", "application/x-httpd-php"],
192
+ ["ppt", "application/vnd.ms-powerpoint"],
193
+ ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"],
194
+ ["rar", "application/vnd.rar"],
195
+ ["rtf", "application/rtf"],
196
+ ["sh", "application/x-sh"],
197
+ ["svg", "image/svg+xml"],
198
+ ["swf", "application/x-shockwave-flash"],
199
+ ["tar", "application/x-tar"],
200
+ ["tif", "image/tiff"],
201
+ ["tiff", "image/tiff"],
202
+ ["ts", "video/mp2t"],
203
+ ["ttf", "font/ttf"],
204
+ ["txt", "text/plain"],
205
+ ["vsd", "application/vnd.visio"],
206
+ ["wav", "audio/wav"],
207
+ ["weba", "audio/webm"],
208
+ ["webm", "video/webm"],
209
+ ["webp", "image/webp"],
210
+ ["woff", "font/woff"],
211
+ ["woff2", "font/woff2"],
212
+ ["xhtml", "application/xhtml+xml"],
213
+ ["xls", "application/vnd.ms-excel"],
214
+ ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
215
+ ["xml", "application/xml"],
216
+ ["xul", "application/vnd.mozilla.xul+xml"],
217
+ ["zip", "application/zip"],
218
+ ["7z", "application/x-7z-compressed"],
219
+ // Others
220
+ ["mkv", "video/x-matroska"],
221
+ ["mov", "video/quicktime"],
222
+ ["msg", "application/vnd.ms-outlook"]
223
+ ]);
224
+ function W(e, r) {
225
+ var t = $r(e);
226
+ if (typeof t.path != "string") {
227
+ var n = e.webkitRelativePath;
228
+ Object.defineProperty(t, "path", {
229
+ value: typeof r == "string" ? r : typeof n == "string" && n.length > 0 ? n : e.name,
230
+ writable: !1,
231
+ configurable: !1,
232
+ enumerable: !0
233
+ });
234
+ }
235
+ return t;
236
+ }
237
+ function $r(e) {
238
+ var r = e.name, t = r && r.lastIndexOf(".") !== -1;
239
+ if (t && !e.type) {
240
+ var n = r.split(".").pop().toLowerCase(), i = Mr.get(n);
241
+ i && Object.defineProperty(e, "type", {
242
+ value: i,
243
+ writable: !1,
244
+ configurable: !1,
245
+ enumerable: !0
246
+ });
247
+ }
248
+ return e;
249
+ }
250
+ var Kr = [
251
+ // Thumbnail cache files for macOS and Windows
252
+ ".DS_Store",
253
+ "Thumbs.db"
254
+ // Windows
255
+ ];
256
+ function Hr(e) {
257
+ return C(this, void 0, void 0, function() {
258
+ return R(this, function(r) {
259
+ return Z(e) && Br(e.dataTransfer) ? [2, Nr(e.dataTransfer, e.type)] : Wr(e) ? [2, Ur(e)] : Array.isArray(e) && e.every(function(t) {
260
+ return "getFile" in t && typeof t.getFile == "function";
261
+ }) ? [2, qr(e)] : [2, []];
262
+ });
263
+ });
264
+ }
265
+ function Br(e) {
266
+ return Z(e);
267
+ }
268
+ function Wr(e) {
269
+ return Z(e) && Z(e.target);
270
+ }
271
+ function Z(e) {
272
+ return typeof e == "object" && e !== null;
273
+ }
274
+ function Ur(e) {
275
+ return De(e.target.files).map(function(r) {
276
+ return W(r);
277
+ });
278
+ }
279
+ function qr(e) {
280
+ return C(this, void 0, void 0, function() {
281
+ var r;
282
+ return R(this, function(t) {
283
+ switch (t.label) {
284
+ case 0:
285
+ return [4, Promise.all(e.map(function(n) {
286
+ return n.getFile();
287
+ }))];
288
+ case 1:
289
+ return r = t.sent(), [2, r.map(function(n) {
290
+ return W(n);
291
+ })];
292
+ }
293
+ });
294
+ });
295
+ }
296
+ function Nr(e, r) {
297
+ return C(this, void 0, void 0, function() {
298
+ var t, n;
299
+ return R(this, function(i) {
300
+ switch (i.label) {
301
+ case 0:
302
+ return e.items ? (t = De(e.items).filter(function(o) {
303
+ return o.kind === "file";
304
+ }), r !== "drop" ? [2, t] : [4, Promise.all(t.map(Gr))]) : [3, 2];
305
+ case 1:
306
+ return n = i.sent(), [2, Ge(cr(n))];
307
+ case 2:
308
+ return [2, Ge(De(e.files).map(function(o) {
309
+ return W(o);
310
+ }))];
311
+ }
312
+ });
313
+ });
314
+ }
315
+ function Ge(e) {
316
+ return e.filter(function(r) {
317
+ return Kr.indexOf(r.name) === -1;
318
+ });
319
+ }
320
+ function De(e) {
321
+ if (e === null)
322
+ return [];
323
+ for (var r = [], t = 0; t < e.length; t++) {
324
+ var n = e[t];
325
+ r.push(n);
326
+ }
327
+ return r;
328
+ }
329
+ function Gr(e) {
330
+ if (typeof e.webkitGetAsEntry != "function")
331
+ return Ye(e);
332
+ var r = e.webkitGetAsEntry();
333
+ return r && r.isDirectory ? lr(r) : Ye(e);
334
+ }
335
+ function cr(e) {
336
+ return e.reduce(function(r, t) {
337
+ return Ne(Ne([], qe(r), !1), qe(Array.isArray(t) ? cr(t) : [t]), !1);
338
+ }, []);
339
+ }
340
+ function Ye(e) {
341
+ var r = e.getAsFile();
342
+ if (!r)
343
+ return Promise.reject("".concat(e, " is not a File"));
344
+ var t = W(r);
345
+ return Promise.resolve(t);
346
+ }
347
+ function Yr(e) {
348
+ return C(this, void 0, void 0, function() {
349
+ return R(this, function(r) {
350
+ return [2, e.isDirectory ? lr(e) : Vr(e)];
351
+ });
352
+ });
353
+ }
354
+ function lr(e) {
355
+ var r = e.createReader();
356
+ return new Promise(function(t, n) {
357
+ var i = [];
358
+ function o() {
359
+ var c = this;
360
+ r.readEntries(function(s) {
361
+ return C(c, void 0, void 0, function() {
362
+ var d, l, m;
363
+ return R(this, function(y) {
364
+ switch (y.label) {
365
+ case 0:
366
+ if (s.length)
367
+ return [3, 5];
368
+ y.label = 1;
369
+ case 1:
370
+ return y.trys.push([1, 3, , 4]), [4, Promise.all(i)];
371
+ case 2:
372
+ return d = y.sent(), t(d), [3, 4];
373
+ case 3:
374
+ return l = y.sent(), n(l), [3, 4];
375
+ case 4:
376
+ return [3, 6];
377
+ case 5:
378
+ m = Promise.all(s.map(Yr)), i.push(m), o(), y.label = 6;
379
+ case 6:
380
+ return [
381
+ 2
382
+ /*return*/
383
+ ];
384
+ }
385
+ });
386
+ });
387
+ }, function(s) {
388
+ n(s);
389
+ });
390
+ }
391
+ o();
392
+ });
393
+ }
394
+ function Vr(e) {
395
+ return C(this, void 0, void 0, function() {
396
+ return R(this, function(r) {
397
+ return [2, new Promise(function(t, n) {
398
+ e.file(function(i) {
399
+ var o = W(i, e.fullPath);
400
+ t(o);
401
+ }, function(i) {
402
+ n(i);
403
+ });
404
+ })];
405
+ });
406
+ });
407
+ }
408
+ var Jr = function(e, r) {
409
+ if (e && r) {
410
+ var t = Array.isArray(r) ? r : r.split(","), n = e.name || "", i = (e.type || "").toLowerCase(), o = i.replace(/\/.*$/, "");
411
+ return t.some(function(c) {
412
+ var s = c.trim().toLowerCase();
413
+ return s.charAt(0) === "." ? n.toLowerCase().endsWith(s) : s.endsWith("/*") ? o === s.replace(/\/.*$/, "") : i === s;
414
+ });
415
+ }
416
+ return !0;
417
+ };
418
+ function Ve(e) {
419
+ return Zr(e) || Xr(e) || fr(e) || Qr();
420
+ }
421
+ function Qr() {
422
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
423
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
424
+ }
425
+ function Xr(e) {
426
+ if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null)
427
+ return Array.from(e);
428
+ }
429
+ function Zr(e) {
430
+ if (Array.isArray(e))
431
+ return we(e);
432
+ }
433
+ function Je(e, r) {
434
+ var t = Object.keys(e);
435
+ if (Object.getOwnPropertySymbols) {
436
+ var n = Object.getOwnPropertySymbols(e);
437
+ r && (n = n.filter(function(i) {
438
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
439
+ })), t.push.apply(t, n);
440
+ }
441
+ return t;
442
+ }
443
+ function Qe(e) {
444
+ for (var r = 1; r < arguments.length; r++) {
445
+ var t = arguments[r] != null ? arguments[r] : {};
446
+ r % 2 ? Je(Object(t), !0).forEach(function(n) {
447
+ sr(e, n, t[n]);
448
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Je(Object(t)).forEach(function(n) {
449
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
450
+ });
451
+ }
452
+ return e;
453
+ }
454
+ function sr(e, r, t) {
455
+ return r in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;
456
+ }
457
+ function B(e, r) {
458
+ return tt(e) || rt(e, r) || fr(e, r) || et();
459
+ }
460
+ function et() {
461
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
462
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
463
+ }
464
+ function fr(e, r) {
465
+ if (e) {
466
+ if (typeof e == "string")
467
+ return we(e, r);
468
+ var t = Object.prototype.toString.call(e).slice(8, -1);
469
+ if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
470
+ return Array.from(e);
471
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
472
+ return we(e, r);
473
+ }
474
+ }
475
+ function we(e, r) {
476
+ (r == null || r > e.length) && (r = e.length);
477
+ for (var t = 0, n = new Array(r); t < r; t++)
478
+ n[t] = e[t];
479
+ return n;
480
+ }
481
+ function rt(e, r) {
482
+ var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
483
+ if (t != null) {
484
+ var n = [], i = !0, o = !1, c, s;
485
+ try {
486
+ for (t = t.call(e); !(i = (c = t.next()).done) && (n.push(c.value), !(r && n.length === r)); i = !0)
487
+ ;
488
+ } catch (d) {
489
+ o = !0, s = d;
490
+ } finally {
491
+ try {
492
+ !i && t.return != null && t.return();
493
+ } finally {
494
+ if (o)
495
+ throw s;
496
+ }
497
+ }
498
+ return n;
499
+ }
500
+ }
501
+ function tt(e) {
502
+ if (Array.isArray(e))
503
+ return e;
504
+ }
505
+ var nt = "file-invalid-type", ot = "file-too-large", it = "file-too-small", at = "too-many-files", ut = function(r) {
506
+ r = Array.isArray(r) && r.length === 1 ? r[0] : r;
507
+ var t = Array.isArray(r) ? "one of ".concat(r.join(", ")) : r;
508
+ return {
509
+ code: nt,
510
+ message: "File type must be ".concat(t)
511
+ };
512
+ }, Xe = function(r) {
513
+ return {
514
+ code: ot,
515
+ message: "File is larger than ".concat(r, " ").concat(r === 1 ? "byte" : "bytes")
516
+ };
517
+ }, Ze = function(r) {
518
+ return {
519
+ code: it,
520
+ message: "File is smaller than ".concat(r, " ").concat(r === 1 ? "byte" : "bytes")
521
+ };
522
+ }, ct = {
523
+ code: at,
524
+ message: "Too many files"
525
+ };
526
+ function pr(e, r) {
527
+ var t = e.type === "application/x-moz-file" || Jr(e, r);
528
+ return [t, t ? null : ut(r)];
529
+ }
530
+ function dr(e, r, t) {
531
+ if (F(e.size))
532
+ if (F(r) && F(t)) {
533
+ if (e.size > t)
534
+ return [!1, Xe(t)];
535
+ if (e.size < r)
536
+ return [!1, Ze(r)];
537
+ } else {
538
+ if (F(r) && e.size < r)
539
+ return [!1, Ze(r)];
540
+ if (F(t) && e.size > t)
541
+ return [!1, Xe(t)];
542
+ }
543
+ return [!0, null];
544
+ }
545
+ function F(e) {
546
+ return e != null;
547
+ }
548
+ function lt(e) {
549
+ var r = e.files, t = e.accept, n = e.minSize, i = e.maxSize, o = e.multiple, c = e.maxFiles, s = e.validator;
550
+ return !o && r.length > 1 || o && c >= 1 && r.length > c ? !1 : r.every(function(d) {
551
+ var l = pr(d, t), m = B(l, 1), y = m[0], z = dr(d, n, i), k = B(z, 1), L = k[0], M = s ? s(d) : null;
552
+ return y && L && !M;
553
+ });
554
+ }
555
+ function ee(e) {
556
+ return typeof e.isPropagationStopped == "function" ? e.isPropagationStopped() : typeof e.cancelBubble < "u" ? e.cancelBubble : !1;
557
+ }
558
+ function X(e) {
559
+ return e.dataTransfer ? Array.prototype.some.call(e.dataTransfer.types, function(r) {
560
+ return r === "Files" || r === "application/x-moz-file";
561
+ }) : !!e.target && !!e.target.files;
562
+ }
563
+ function er(e) {
564
+ e.preventDefault();
565
+ }
566
+ function st(e) {
567
+ return e.indexOf("MSIE") !== -1 || e.indexOf("Trident/") !== -1;
568
+ }
569
+ function ft(e) {
570
+ return e.indexOf("Edge/") !== -1;
571
+ }
572
+ function pt() {
573
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
574
+ return st(e) || ft(e);
575
+ }
576
+ function E() {
577
+ for (var e = arguments.length, r = new Array(e), t = 0; t < e; t++)
578
+ r[t] = arguments[t];
579
+ return function(n) {
580
+ for (var i = arguments.length, o = new Array(i > 1 ? i - 1 : 0), c = 1; c < i; c++)
581
+ o[c - 1] = arguments[c];
582
+ return r.some(function(s) {
583
+ return !ee(n) && s && s.apply(void 0, [n].concat(o)), ee(n);
584
+ });
585
+ };
586
+ }
587
+ function dt() {
588
+ return "showOpenFilePicker" in window;
589
+ }
590
+ function mt(e) {
591
+ if (F(e)) {
592
+ var r = Object.entries(e).filter(function(t) {
593
+ var n = B(t, 2), i = n[0], o = n[1], c = !0;
594
+ return mr(i) || (console.warn('Skipped "'.concat(i, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')), c = !1), (!Array.isArray(o) || !o.every(gr)) && (console.warn('Skipped "'.concat(i, '" because an invalid file extension was provided.')), c = !1), c;
595
+ }).reduce(function(t, n) {
596
+ var i = B(n, 2), o = i[0], c = i[1];
597
+ return Qe(Qe({}, t), {}, sr({}, o, c));
598
+ }, {});
599
+ return [{
600
+ // description is required due to https://crbug.com/1264708
601
+ description: "Files",
602
+ accept: r
603
+ }];
604
+ }
605
+ return e;
606
+ }
607
+ function gt(e) {
608
+ if (F(e))
609
+ return Object.entries(e).reduce(function(r, t) {
610
+ var n = B(t, 2), i = n[0], o = n[1];
611
+ return [].concat(Ve(r), [i], Ve(o));
612
+ }, []).filter(function(r) {
613
+ return mr(r) || gr(r);
614
+ }).join(",");
615
+ }
616
+ function vt(e) {
617
+ return e instanceof DOMException && (e.name === "AbortError" || e.code === e.ABORT_ERR);
618
+ }
619
+ function yt(e) {
620
+ return e instanceof DOMException && (e.name === "SecurityError" || e.code === e.SECURITY_ERR);
621
+ }
622
+ function mr(e) {
623
+ return e === "audio/*" || e === "video/*" || e === "image/*" || e === "text/*" || /\w+\/[-+.\w]+/g.test(e);
624
+ }
625
+ function gr(e) {
626
+ return /^.*\.[\w]+$/.test(e);
627
+ }
628
+ var bt = ["children"], ht = ["open"], Dt = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], wt = ["refKey", "onChange", "onClick"];
629
+ function At(e) {
630
+ return xt(e) || Ot(e) || vr(e) || Et();
631
+ }
632
+ function Et() {
633
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
634
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
635
+ }
636
+ function Ot(e) {
637
+ if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null)
638
+ return Array.from(e);
639
+ }
640
+ function xt(e) {
641
+ if (Array.isArray(e))
642
+ return Ae(e);
643
+ }
644
+ function he(e, r) {
645
+ return jt(e) || _t(e, r) || vr(e, r) || Ft();
646
+ }
647
+ function Ft() {
648
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
649
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
650
+ }
651
+ function vr(e, r) {
652
+ if (e) {
653
+ if (typeof e == "string")
654
+ return Ae(e, r);
655
+ var t = Object.prototype.toString.call(e).slice(8, -1);
656
+ if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
657
+ return Array.from(e);
658
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
659
+ return Ae(e, r);
660
+ }
661
+ }
662
+ function Ae(e, r) {
663
+ (r == null || r > e.length) && (r = e.length);
664
+ for (var t = 0, n = new Array(r); t < r; t++)
665
+ n[t] = e[t];
666
+ return n;
667
+ }
668
+ function _t(e, r) {
669
+ var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
670
+ if (t != null) {
671
+ var n = [], i = !0, o = !1, c, s;
672
+ try {
673
+ for (t = t.call(e); !(i = (c = t.next()).done) && (n.push(c.value), !(r && n.length === r)); i = !0)
674
+ ;
675
+ } catch (d) {
676
+ o = !0, s = d;
677
+ } finally {
678
+ try {
679
+ !i && t.return != null && t.return();
680
+ } finally {
681
+ if (o)
682
+ throw s;
683
+ }
684
+ }
685
+ return n;
686
+ }
687
+ }
688
+ function jt(e) {
689
+ if (Array.isArray(e))
690
+ return e;
691
+ }
692
+ function rr(e, r) {
693
+ var t = Object.keys(e);
694
+ if (Object.getOwnPropertySymbols) {
695
+ var n = Object.getOwnPropertySymbols(e);
696
+ r && (n = n.filter(function(i) {
697
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
698
+ })), t.push.apply(t, n);
699
+ }
700
+ return t;
701
+ }
702
+ function p(e) {
703
+ for (var r = 1; r < arguments.length; r++) {
704
+ var t = arguments[r] != null ? arguments[r] : {};
705
+ r % 2 ? rr(Object(t), !0).forEach(function(n) {
706
+ Ee(e, n, t[n]);
707
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : rr(Object(t)).forEach(function(n) {
708
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
709
+ });
710
+ }
711
+ return e;
712
+ }
713
+ function Ee(e, r, t) {
714
+ return r in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;
715
+ }
716
+ function re(e, r) {
717
+ if (e == null)
718
+ return {};
719
+ var t = St(e, r), n, i;
720
+ if (Object.getOwnPropertySymbols) {
721
+ var o = Object.getOwnPropertySymbols(e);
722
+ for (i = 0; i < o.length; i++)
723
+ n = o[i], !(r.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (t[n] = e[n]);
724
+ }
725
+ return t;
726
+ }
727
+ function St(e, r) {
728
+ if (e == null)
729
+ return {};
730
+ var t = {}, n = Object.keys(e), i, o;
731
+ for (o = 0; o < n.length; o++)
732
+ i = n[o], !(r.indexOf(i) >= 0) && (t[i] = e[i]);
733
+ return t;
734
+ }
735
+ var _e = /* @__PURE__ */ jr(function(e, r) {
736
+ var t = e.children, n = re(e, bt), i = br(n), o = i.open, c = re(i, ht);
737
+ return Sr(r, function() {
738
+ return {
739
+ open: o
740
+ };
741
+ }, [o]), /* @__PURE__ */ Fr.createElement(Pr, null, t(p(p({}, c), {}, {
742
+ open: o
743
+ })));
744
+ });
745
+ _e.displayName = "Dropzone";
746
+ var yr = {
747
+ disabled: !1,
748
+ getFilesFromEvent: Hr,
749
+ maxSize: 1 / 0,
750
+ minSize: 0,
751
+ multiple: !0,
752
+ maxFiles: 0,
753
+ preventDropOnDocument: !0,
754
+ noClick: !1,
755
+ noKeyboard: !1,
756
+ noDrag: !1,
757
+ noDragEventsBubbling: !1,
758
+ validator: null,
759
+ useFsAccessApi: !0,
760
+ autoFocus: !1
761
+ };
762
+ _e.defaultProps = yr;
763
+ _e.propTypes = {
764
+ /**
765
+ * Render function that exposes the dropzone state and prop getter fns
766
+ *
767
+ * @param {object} params
768
+ * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render
769
+ * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render
770
+ * @param {Function} params.open Open the native file selection dialog
771
+ * @param {boolean} params.isFocused Dropzone area is in focus
772
+ * @param {boolean} params.isFileDialogActive File dialog is opened
773
+ * @param {boolean} params.isDragActive Active drag is in progress
774
+ * @param {boolean} params.isDragAccept Dragged files are accepted
775
+ * @param {boolean} params.isDragReject Some dragged files are rejected
776
+ * @param {File[]} params.acceptedFiles Accepted files
777
+ * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
778
+ */
779
+ children: f.func,
780
+ /**
781
+ * Set accepted file types.
782
+ * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
783
+ * Keep in mind that mime type determination is not reliable across platforms. CSV files,
784
+ * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
785
+ * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
786
+ */
787
+ accept: f.objectOf(f.arrayOf(f.string)),
788
+ /**
789
+ * Allow drag 'n' drop (or selection from the file dialog) of multiple files
790
+ */
791
+ multiple: f.bool,
792
+ /**
793
+ * If false, allow dropped items to take over the current browser window
794
+ */
795
+ preventDropOnDocument: f.bool,
796
+ /**
797
+ * If true, disables click to open the native file selection dialog
798
+ */
799
+ noClick: f.bool,
800
+ /**
801
+ * If true, disables SPACE/ENTER to open the native file selection dialog.
802
+ * Note that it also stops tracking the focus state.
803
+ */
804
+ noKeyboard: f.bool,
805
+ /**
806
+ * If true, disables drag 'n' drop
807
+ */
808
+ noDrag: f.bool,
809
+ /**
810
+ * If true, stops drag event propagation to parents
811
+ */
812
+ noDragEventsBubbling: f.bool,
813
+ /**
814
+ * Minimum file size (in bytes)
815
+ */
816
+ minSize: f.number,
817
+ /**
818
+ * Maximum file size (in bytes)
819
+ */
820
+ maxSize: f.number,
821
+ /**
822
+ * Maximum accepted number of files
823
+ * The default value is 0 which means there is no limitation to how many files are accepted.
824
+ */
825
+ maxFiles: f.number,
826
+ /**
827
+ * Enable/disable the dropzone
828
+ */
829
+ disabled: f.bool,
830
+ /**
831
+ * Use this to provide a custom file aggregator
832
+ *
833
+ * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
834
+ */
835
+ getFilesFromEvent: f.func,
836
+ /**
837
+ * Cb for when closing the file dialog with no selection
838
+ */
839
+ onFileDialogCancel: f.func,
840
+ /**
841
+ * Cb for when opening the file dialog
842
+ */
843
+ onFileDialogOpen: f.func,
844
+ /**
845
+ * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
846
+ * to open the file picker instead of using an `<input type="file">` click event.
847
+ */
848
+ useFsAccessApi: f.bool,
849
+ /**
850
+ * Set to true to focus the root element on render
851
+ */
852
+ autoFocus: f.bool,
853
+ /**
854
+ * Cb for when the `dragenter` event occurs.
855
+ *
856
+ * @param {DragEvent} event
857
+ */
858
+ onDragEnter: f.func,
859
+ /**
860
+ * Cb for when the `dragleave` event occurs
861
+ *
862
+ * @param {DragEvent} event
863
+ */
864
+ onDragLeave: f.func,
865
+ /**
866
+ * Cb for when the `dragover` event occurs
867
+ *
868
+ * @param {DragEvent} event
869
+ */
870
+ onDragOver: f.func,
871
+ /**
872
+ * Cb for when the `drop` event occurs.
873
+ * Note that this callback is invoked after the `getFilesFromEvent` callback is done.
874
+ *
875
+ * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
876
+ * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
877
+ * If `multiple` is set to false and additional files are dropped,
878
+ * all files besides the first will be rejected.
879
+ * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
880
+ *
881
+ * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
882
+ * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
883
+ *
884
+ * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
885
+ * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
886
+ *
887
+ * ```js
888
+ * function onDrop(acceptedFiles) {
889
+ * const req = request.post('/upload')
890
+ * acceptedFiles.forEach(file => {
891
+ * req.attach(file.name, file)
892
+ * })
893
+ * req.end(callback)
894
+ * }
895
+ * ```
896
+ *
897
+ * @param {File[]} acceptedFiles
898
+ * @param {FileRejection[]} fileRejections
899
+ * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
900
+ */
901
+ onDrop: f.func,
902
+ /**
903
+ * Cb for when the `drop` event occurs.
904
+ * Note that if no files are accepted, this callback is not invoked.
905
+ *
906
+ * @param {File[]} files
907
+ * @param {(DragEvent|Event)} event
908
+ */
909
+ onDropAccepted: f.func,
910
+ /**
911
+ * Cb for when the `drop` event occurs.
912
+ * Note that if no files are rejected, this callback is not invoked.
913
+ *
914
+ * @param {FileRejection[]} fileRejections
915
+ * @param {(DragEvent|Event)} event
916
+ */
917
+ onDropRejected: f.func,
918
+ /**
919
+ * Cb for when there's some error from any of the promises.
920
+ *
921
+ * @param {Error} error
922
+ */
923
+ onError: f.func,
924
+ /**
925
+ * Custom validation function. It must return null if there's no errors.
926
+ * @param {File} file
927
+ * @returns {FileError|FileError[]|null}
928
+ */
929
+ validator: f.func
930
+ };
931
+ var Oe = {
932
+ isFocused: !1,
933
+ isFileDialogActive: !1,
934
+ isDragActive: !1,
935
+ isDragAccept: !1,
936
+ isDragReject: !1,
937
+ acceptedFiles: [],
938
+ fileRejections: []
939
+ };
940
+ function br() {
941
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = p(p({}, yr), e), t = r.accept, n = r.disabled, i = r.getFilesFromEvent, o = r.maxSize, c = r.minSize, s = r.multiple, d = r.maxFiles, l = r.onDragEnter, m = r.onDragLeave, y = r.onDragOver, z = r.onDrop, k = r.onDropAccepted, L = r.onDropRejected, M = r.onFileDialogCancel, te = r.onFileDialogOpen, je = r.useFsAccessApi, Se = r.autoFocus, ne = r.preventDropOnDocument, Pe = r.noClick, oe = r.noKeyboard, Te = r.noDrag, O = r.noDragEventsBubbling, ie = r.onError, $ = r.validator, K = I(function() {
942
+ return gt(t);
943
+ }, [t]), Ie = I(function() {
944
+ return mt(t);
945
+ }, [t]), ae = I(function() {
946
+ return typeof te == "function" ? te : tr;
947
+ }, [te]), U = I(function() {
948
+ return typeof M == "function" ? M : tr;
949
+ }, [M]), b = Q(null), w = Q(null), hr = _r(Pt, Oe), Ce = he(hr, 2), ue = Ce[0], h = Ce[1], Dr = ue.isFocused, Re = ue.isFileDialogActive, q = Q(typeof window < "u" && window.isSecureContext && je && dt()), ze = function() {
950
+ !q.current && Re && setTimeout(function() {
951
+ if (w.current) {
952
+ var u = w.current.files;
953
+ u.length || (h({
954
+ type: "closeDialog"
955
+ }), U());
956
+ }
957
+ }, 300);
958
+ };
959
+ ye(function() {
960
+ return window.addEventListener("focus", ze, !1), function() {
961
+ window.removeEventListener("focus", ze, !1);
962
+ };
963
+ }, [w, Re, U, q]);
964
+ var _ = Q([]), ke = function(u) {
965
+ b.current && b.current.contains(u.target) || (u.preventDefault(), _.current = []);
966
+ };
967
+ ye(function() {
968
+ return ne && (document.addEventListener("dragover", er, !1), document.addEventListener("drop", ke, !1)), function() {
969
+ ne && (document.removeEventListener("dragover", er), document.removeEventListener("drop", ke));
970
+ };
971
+ }, [b, ne]), ye(function() {
972
+ return !n && Se && b.current && b.current.focus(), function() {
973
+ };
974
+ }, [b, Se, n]);
975
+ var x = A(function(a) {
976
+ ie ? ie(a) : console.error(a);
977
+ }, [ie]), Le = A(function(a) {
978
+ a.preventDefault(), a.persist(), V(a), _.current = [].concat(At(_.current), [a.target]), X(a) && Promise.resolve(i(a)).then(function(u) {
979
+ if (!(ee(a) && !O)) {
980
+ var g = u.length, v = g > 0 && lt({
981
+ files: u,
982
+ accept: K,
983
+ minSize: c,
984
+ maxSize: o,
985
+ multiple: s,
986
+ maxFiles: d,
987
+ validator: $
988
+ }), D = g > 0 && !v;
989
+ h({
990
+ isDragAccept: v,
991
+ isDragReject: D,
992
+ isDragActive: !0,
993
+ type: "setDraggedFiles"
994
+ }), l && l(a);
995
+ }
996
+ }).catch(function(u) {
997
+ return x(u);
998
+ });
999
+ }, [i, l, x, O, K, c, o, s, d, $]), Me = A(function(a) {
1000
+ a.preventDefault(), a.persist(), V(a);
1001
+ var u = X(a);
1002
+ if (u && a.dataTransfer)
1003
+ try {
1004
+ a.dataTransfer.dropEffect = "copy";
1005
+ } catch {
1006
+ }
1007
+ return u && y && y(a), !1;
1008
+ }, [y, O]), $e = A(function(a) {
1009
+ a.preventDefault(), a.persist(), V(a);
1010
+ var u = _.current.filter(function(v) {
1011
+ return b.current && b.current.contains(v);
1012
+ }), g = u.indexOf(a.target);
1013
+ g !== -1 && u.splice(g, 1), _.current = u, !(u.length > 0) && (h({
1014
+ type: "setDraggedFiles",
1015
+ isDragActive: !1,
1016
+ isDragAccept: !1,
1017
+ isDragReject: !1
1018
+ }), X(a) && m && m(a));
1019
+ }, [b, m, O]), N = A(function(a, u) {
1020
+ var g = [], v = [];
1021
+ a.forEach(function(D) {
1022
+ var H = pr(D, K), P = he(H, 2), le = P[0], se = P[1], fe = dr(D, c, o), J = he(fe, 2), pe = J[0], de = J[1], me = $ ? $(D) : null;
1023
+ if (le && pe && !me)
1024
+ g.push(D);
1025
+ else {
1026
+ var ge = [se, de];
1027
+ me && (ge = ge.concat(me)), v.push({
1028
+ file: D,
1029
+ errors: ge.filter(function(Or) {
1030
+ return Or;
1031
+ })
1032
+ });
1033
+ }
1034
+ }), (!s && g.length > 1 || s && d >= 1 && g.length > d) && (g.forEach(function(D) {
1035
+ v.push({
1036
+ file: D,
1037
+ errors: [ct]
1038
+ });
1039
+ }), g.splice(0)), h({
1040
+ acceptedFiles: g,
1041
+ fileRejections: v,
1042
+ type: "setFiles"
1043
+ }), z && z(g, v, u), v.length > 0 && L && L(v, u), g.length > 0 && k && k(g, u);
1044
+ }, [h, s, K, c, o, d, z, k, L, $]), G = A(function(a) {
1045
+ a.preventDefault(), a.persist(), V(a), _.current = [], X(a) && Promise.resolve(i(a)).then(function(u) {
1046
+ ee(a) && !O || N(u, a);
1047
+ }).catch(function(u) {
1048
+ return x(u);
1049
+ }), h({
1050
+ type: "reset"
1051
+ });
1052
+ }, [i, N, x, O]), j = A(function() {
1053
+ if (q.current) {
1054
+ h({
1055
+ type: "openDialog"
1056
+ }), ae();
1057
+ var a = {
1058
+ multiple: s,
1059
+ types: Ie
1060
+ };
1061
+ window.showOpenFilePicker(a).then(function(u) {
1062
+ return i(u);
1063
+ }).then(function(u) {
1064
+ N(u, null), h({
1065
+ type: "closeDialog"
1066
+ });
1067
+ }).catch(function(u) {
1068
+ vt(u) ? (U(u), h({
1069
+ type: "closeDialog"
1070
+ })) : yt(u) ? (q.current = !1, w.current ? (w.current.value = null, w.current.click()) : x(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : x(u);
1071
+ });
1072
+ return;
1073
+ }
1074
+ w.current && (h({
1075
+ type: "openDialog"
1076
+ }), ae(), w.current.value = null, w.current.click());
1077
+ }, [h, ae, U, je, N, x, Ie, s]), Ke = A(function(a) {
1078
+ !b.current || !b.current.isEqualNode(a.target) || (a.key === " " || a.key === "Enter" || a.keyCode === 32 || a.keyCode === 13) && (a.preventDefault(), j());
1079
+ }, [b, j]), He = A(function() {
1080
+ h({
1081
+ type: "focus"
1082
+ });
1083
+ }, []), Be = A(function() {
1084
+ h({
1085
+ type: "blur"
1086
+ });
1087
+ }, []), We = A(function() {
1088
+ Pe || (pt() ? setTimeout(j, 0) : j());
1089
+ }, [Pe, j]), S = function(u) {
1090
+ return n ? null : u;
1091
+ }, ce = function(u) {
1092
+ return oe ? null : S(u);
1093
+ }, Y = function(u) {
1094
+ return Te ? null : S(u);
1095
+ }, V = function(u) {
1096
+ O && u.stopPropagation();
1097
+ }, wr = I(function() {
1098
+ return function() {
1099
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, u = a.refKey, g = u === void 0 ? "ref" : u, v = a.role, D = a.onKeyDown, H = a.onFocus, P = a.onBlur, le = a.onClick, se = a.onDragEnter, fe = a.onDragOver, J = a.onDragLeave, pe = a.onDrop, de = re(a, Dt);
1100
+ return p(p(Ee({
1101
+ onKeyDown: ce(E(D, Ke)),
1102
+ onFocus: ce(E(H, He)),
1103
+ onBlur: ce(E(P, Be)),
1104
+ onClick: S(E(le, We)),
1105
+ onDragEnter: Y(E(se, Le)),
1106
+ onDragOver: Y(E(fe, Me)),
1107
+ onDragLeave: Y(E(J, $e)),
1108
+ onDrop: Y(E(pe, G)),
1109
+ role: typeof v == "string" && v !== "" ? v : "presentation"
1110
+ }, g, b), !n && !oe ? {
1111
+ tabIndex: 0
1112
+ } : {}), de);
1113
+ };
1114
+ }, [b, Ke, He, Be, We, Le, Me, $e, G, oe, Te, n]), Ar = A(function(a) {
1115
+ a.stopPropagation();
1116
+ }, []), Er = I(function() {
1117
+ return function() {
1118
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, u = a.refKey, g = u === void 0 ? "ref" : u, v = a.onChange, D = a.onClick, H = re(a, wt), P = Ee({
1119
+ accept: K,
1120
+ multiple: s,
1121
+ type: "file",
1122
+ style: {
1123
+ display: "none"
1124
+ },
1125
+ onChange: S(E(v, G)),
1126
+ onClick: S(E(D, Ar)),
1127
+ tabIndex: -1
1128
+ }, g, w);
1129
+ return p(p({}, P), H);
1130
+ };
1131
+ }, [w, t, s, G, n]);
1132
+ return p(p({}, ue), {}, {
1133
+ isFocused: Dr && !n,
1134
+ getRootProps: wr,
1135
+ getInputProps: Er,
1136
+ rootRef: b,
1137
+ inputRef: w,
1138
+ open: S(j)
1139
+ });
1140
+ }
1141
+ function Pt(e, r) {
1142
+ switch (r.type) {
1143
+ case "focus":
1144
+ return p(p({}, e), {}, {
1145
+ isFocused: !0
1146
+ });
1147
+ case "blur":
1148
+ return p(p({}, e), {}, {
1149
+ isFocused: !1
1150
+ });
1151
+ case "openDialog":
1152
+ return p(p({}, Oe), {}, {
1153
+ isFileDialogActive: !0
1154
+ });
1155
+ case "closeDialog":
1156
+ return p(p({}, e), {}, {
1157
+ isFileDialogActive: !1
1158
+ });
1159
+ case "setDraggedFiles":
1160
+ return p(p({}, e), {}, {
1161
+ isDragActive: r.isDragActive,
1162
+ isDragAccept: r.isDragAccept,
1163
+ isDragReject: r.isDragReject
1164
+ });
1165
+ case "setFiles":
1166
+ return p(p({}, e), {}, {
1167
+ acceptedFiles: r.acceptedFiles,
1168
+ fileRejections: r.fileRejections
1169
+ });
1170
+ case "reset":
1171
+ return p({}, Oe);
1172
+ default:
1173
+ return e;
1174
+ }
1175
+ }
1176
+ function tr() {
1177
+ }
1178
+ const Tt = Tr(xr)(({ theme: e }) => ({
1179
+ display: "flex",
1180
+ flexDirection: "column",
1181
+ justifyContent: "center",
1182
+ alignItems: "center",
1183
+ gap: "0.5rem",
1184
+ padding: "0.5rem",
1185
+ width: "20rem",
1186
+ height: "10rem",
1187
+ border: "1px dashed",
1188
+ borderColor: e.palette.grey[500],
1189
+ borderRadius: 4,
1190
+ cursor: "pointer"
1191
+ })), Lt = (e) => {
1192
+ const { getRootProps: r, getInputProps: t, isDragActive: n } = br({
1193
+ onDrop: e.onDrop
1194
+ }), { information: i } = e;
1195
+ return /* @__PURE__ */ ve(Tt, { ...r(), children: [
1196
+ /* @__PURE__ */ T("input", { ...t() }),
1197
+ n ? /* @__PURE__ */ ve(Ue, { children: [
1198
+ /* @__PURE__ */ T(ar, { color: "primary" }),
1199
+ /* @__PURE__ */ T(be, { children: "Déposer les fichiers ici" })
1200
+ ] }) : /* @__PURE__ */ ve(Ue, { children: [
1201
+ /* @__PURE__ */ T(ur, { color: "primary" }),
1202
+ /* @__PURE__ */ T(be, { children: "Glisser et déposer des fichiers ici, ou cliquer pour sélectionner des fichiers" }),
1203
+ i ? /* @__PURE__ */ T(be, { fontSize: "0.875rem", color: "grey", children: i }) : null
1204
+ ] })
1205
+ ] });
1206
+ };
1207
+ export {
1208
+ Lt as default
1209
+ };