@scaleflex/uploader 0.2.2 → 0.2.3
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/components/file-item.d.ts.map +1 -1
- package/dist/components/file-list.d.ts.map +1 -1
- package/dist/components/success-card.d.ts +4 -0
- package/dist/components/success-card.d.ts.map +1 -1
- package/dist/define.cjs +1 -1
- package/dist/define.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{provider-browser-DJ2LHNd-.js → provider-browser-CMbbN8PZ.js} +1 -1
- package/dist/{provider-browser-DajdSDoL.cjs → provider-browser-DbjyF_Ou.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.d.ts +12 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +95 -60
- package/dist/{search-provider-browser-CIH8w0aj.js → search-provider-browser-9oZjABnB.js} +1 -1
- package/dist/{search-provider-browser-BM-foEWT.cjs → search-provider-browser-KQs6JI8u.cjs} +1 -1
- package/dist/{sfx-uploader-CR48BiYQ.js → sfx-uploader-DTfESjzm.js} +627 -525
- package/dist/{sfx-uploader-CpKFlkgS.cjs → sfx-uploader-DXyLpoIJ.cjs} +193 -103
- package/dist/sfx-uploader.d.ts +19 -0
- package/dist/sfx-uploader.d.ts.map +1 -1
- package/dist/store/store.types.d.ts +1 -0
- package/dist/store/store.types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as b, state as
|
|
3
|
-
import { unsafeSVG as
|
|
4
|
-
import { unsafeHTML as
|
|
5
|
-
class
|
|
1
|
+
import { LitElement as P, css as S, svg as T, html as l, nothing as p, render as ke } from "lit";
|
|
2
|
+
import { property as b, state as x, query as Fe } from "lit/decorators.js";
|
|
3
|
+
import { unsafeSVG as F } from "lit/directives/unsafe-svg.js";
|
|
4
|
+
import { unsafeHTML as M } from "lit/directives/unsafe-html.js";
|
|
5
|
+
class Oe {
|
|
6
6
|
constructor(e) {
|
|
7
7
|
this.listeners = /* @__PURE__ */ new Set(), this._notifying = !1, this._pendingState = null, this.state = e;
|
|
8
8
|
}
|
|
@@ -33,24 +33,24 @@ class Fe {
|
|
|
33
33
|
this.listeners.clear();
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function z(a, e, t) {
|
|
37
37
|
const i = a.getState().files, r = i.get(e);
|
|
38
38
|
if (!r) return;
|
|
39
39
|
const o = new Map(i);
|
|
40
40
|
o.set(e, { ...r, ...t }), a.setState({ files: o });
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function I(a, e) {
|
|
43
43
|
const t = new Map(a.getState().files);
|
|
44
44
|
t.set(e.id, e), a.setState({ files: t });
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Ce(a, e) {
|
|
47
47
|
const t = a.getState().files;
|
|
48
48
|
if (!t.has(e)) return;
|
|
49
49
|
const i = new Map(t);
|
|
50
50
|
i.delete(e), a.setState({ files: i });
|
|
51
51
|
}
|
|
52
52
|
function je() {
|
|
53
|
-
return new
|
|
53
|
+
return new Oe({
|
|
54
54
|
files: /* @__PURE__ */ new Map(),
|
|
55
55
|
queueConfig: {
|
|
56
56
|
concurrency: 3,
|
|
@@ -79,7 +79,7 @@ function je() {
|
|
|
79
79
|
isUploading: !1
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
class
|
|
82
|
+
class Te {
|
|
83
83
|
constructor(e, t) {
|
|
84
84
|
this.host = e, this.store = t, e.addController(this);
|
|
85
85
|
}
|
|
@@ -99,7 +99,7 @@ class Me {
|
|
|
99
99
|
(e = this.unsubscribe) == null || e.call(this);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Me(a, e) {
|
|
103
103
|
const t = new XMLHttpRequest();
|
|
104
104
|
let i = !1;
|
|
105
105
|
const o = `${e.apiBase.replace(/\/+$/, "")}/v4/files?folder=${encodeURIComponent(e.folder)}`;
|
|
@@ -117,7 +117,7 @@ function Oe(a, e) {
|
|
|
117
117
|
e.onError(new Error(`Invalid JSON response (HTTP ${t.status})`));
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
t.status >= 200 && t.status < 300 && n.status === "success" ? e.onComplete(n) : e.onError(new Error(n.msg || `Upload failed (HTTP ${t.status})`));
|
|
120
|
+
t.status >= 200 && t.status < 300 && n.status === "success" ? e.onComplete(n) : e.onError(new Error(n.hint || n.msg || `Upload failed (HTTP ${t.status})`));
|
|
121
121
|
}), t.addEventListener("error", () => {
|
|
122
122
|
i || e.onError(new Error("Network error — check your connection"));
|
|
123
123
|
}), t.addEventListener("timeout", () => {
|
|
@@ -153,7 +153,7 @@ function Be(a, e) {
|
|
|
153
153
|
e.onError(new Error(`Invalid JSON response (HTTP ${t.status})`));
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
t.status >= 200 && t.status < 300 && n.status === "success" ? e.onComplete(n) : e.onError(new Error(n.msg || `Upload failed (HTTP ${t.status})`));
|
|
156
|
+
t.status >= 200 && t.status < 300 && n.status === "success" ? e.onComplete(n) : e.onError(new Error(n.hint || n.msg || `Upload failed (HTTP ${t.status})`));
|
|
157
157
|
}), t.addEventListener("error", () => {
|
|
158
158
|
i || e.onError(new Error("Network error — check your connection"));
|
|
159
159
|
}), t.addEventListener("timeout", () => {
|
|
@@ -171,14 +171,14 @@ function Be(a, e) {
|
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function te(a) {
|
|
175
175
|
return {
|
|
176
176
|
Accept: "application/json",
|
|
177
177
|
"Content-Type": "application/json",
|
|
178
178
|
"uppy-auth-token": a
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function V(a) {
|
|
182
182
|
return a.replace(/\/+$/, "");
|
|
183
183
|
}
|
|
184
184
|
const Re = {
|
|
@@ -193,14 +193,14 @@ const Re = {
|
|
|
193
193
|
function K(a) {
|
|
194
194
|
return Re[a] ?? a;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
const t =
|
|
196
|
+
function mt(a, e) {
|
|
197
|
+
const t = V(a), i = btoa(JSON.stringify({ origin: window.location.origin })), r = K(e);
|
|
198
198
|
return `${t}/${r}/connect?state=${encodeURIComponent(i)}`;
|
|
199
199
|
}
|
|
200
|
-
async function
|
|
201
|
-
const r =
|
|
200
|
+
async function wt(a, e, t, i = "") {
|
|
201
|
+
const r = V(a), o = i ? `/${i}` : "", s = K(e), n = await fetch(`${r}/${s}/list${o}`, {
|
|
202
202
|
method: "GET",
|
|
203
|
-
headers:
|
|
203
|
+
headers: te(t),
|
|
204
204
|
credentials: "same-origin"
|
|
205
205
|
});
|
|
206
206
|
if (n.status === 401)
|
|
@@ -211,10 +211,10 @@ async function mt(a, e, t, i = "") {
|
|
|
211
211
|
}
|
|
212
212
|
return n.json();
|
|
213
213
|
}
|
|
214
|
-
async function
|
|
215
|
-
const i =
|
|
214
|
+
async function yt(a, e, t) {
|
|
215
|
+
const i = V(a), r = await fetch(`${i}/${t}`, {
|
|
216
216
|
method: "GET",
|
|
217
|
-
headers:
|
|
217
|
+
headers: te(e),
|
|
218
218
|
credentials: "same-origin"
|
|
219
219
|
});
|
|
220
220
|
if (r.status === 401)
|
|
@@ -225,8 +225,8 @@ async function wt(a, e, t) {
|
|
|
225
225
|
}
|
|
226
226
|
return r.json();
|
|
227
227
|
}
|
|
228
|
-
async function
|
|
229
|
-
const r =
|
|
228
|
+
async function _t(a, e, t, i) {
|
|
229
|
+
const r = V(a), o = K(e), s = i ? `q=${encodeURIComponent(t)}&${i}` : `q=${encodeURIComponent(t)}`, n = await fetch(`${r}/search/${o}/list?${s}`, {
|
|
230
230
|
method: "GET",
|
|
231
231
|
headers: {
|
|
232
232
|
Accept: "application/json",
|
|
@@ -240,10 +240,10 @@ async function yt(a, e, t, i) {
|
|
|
240
240
|
}
|
|
241
241
|
return n.json();
|
|
242
242
|
}
|
|
243
|
-
async function
|
|
244
|
-
const s =
|
|
243
|
+
async function Le(a, e, t, i, r, o = !1) {
|
|
244
|
+
const s = V(a), n = K(e), d = o ? `${s}/search/${n}/get/${i}` : `${s}/${n}/get/${i}`, c = o ? { Accept: "application/json", "Content-Type": "application/json" } : te(t), u = await fetch(d, {
|
|
245
245
|
method: "POST",
|
|
246
|
-
headers:
|
|
246
|
+
headers: c,
|
|
247
247
|
credentials: "same-origin",
|
|
248
248
|
body: JSON.stringify({
|
|
249
249
|
...r,
|
|
@@ -255,20 +255,20 @@ async function Te(a, e, t, i, r, o = !1) {
|
|
|
255
255
|
if (u.status === 401)
|
|
256
256
|
throw new le();
|
|
257
257
|
if (!u.ok) {
|
|
258
|
-
const
|
|
259
|
-
throw new Error((
|
|
258
|
+
const g = await u.json().catch(() => null);
|
|
259
|
+
throw new Error((g == null ? void 0 : g.message) || `Companion upload failed (HTTP ${u.status})`);
|
|
260
260
|
}
|
|
261
261
|
return u.json();
|
|
262
262
|
}
|
|
263
|
-
async function
|
|
264
|
-
const i =
|
|
263
|
+
async function kt(a, e, t) {
|
|
264
|
+
const i = V(a), r = K(e), o = await fetch(`${i}/${r}/logout`, {
|
|
265
265
|
method: "GET",
|
|
266
|
-
headers:
|
|
266
|
+
headers: te(t),
|
|
267
267
|
credentials: "same-origin"
|
|
268
268
|
});
|
|
269
269
|
return o.ok ? o.json() : { ok: !1, revoked: !1 };
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Ae(a) {
|
|
272
272
|
var r;
|
|
273
273
|
const t = ((r = /^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(a)) == null ? void 0 : r[1]) ?? a;
|
|
274
274
|
return `${location.protocol === "https:" ? "wss" : "ws"}://${t}`;
|
|
@@ -278,7 +278,7 @@ class le extends Error {
|
|
|
278
278
|
super("Authentication expired"), this.name = "AuthExpiredError";
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Ie(a, e) {
|
|
282
282
|
const t = a.remoteInfo;
|
|
283
283
|
if (!t)
|
|
284
284
|
return e.onError(new Error("remoteInfo is required for companion upload")), { abort() {
|
|
@@ -287,42 +287,42 @@ function Ae(a, e) {
|
|
|
287
287
|
const s = `${e.apiBase.replace(/\/+$/, "")}/v4/files?folder=${encodeURIComponent(e.folder)}`, n = {};
|
|
288
288
|
a.meta && Object.keys(a.meta).length > 0 && Object.assign(n, a.meta), a.tags && a.tags.length > 0 && (n.tags = a.tags);
|
|
289
289
|
const d = !t.token;
|
|
290
|
-
return
|
|
290
|
+
return Le(t.companionUrl, t.provider, t.token, t.requestPath, {
|
|
291
291
|
fileId: t.fileId,
|
|
292
292
|
endpoint: s,
|
|
293
293
|
headers: e.authHeaders,
|
|
294
294
|
size: t.size,
|
|
295
295
|
metadata: Object.keys(n).length > 0 ? n : void 0
|
|
296
|
-
}, d).then((
|
|
296
|
+
}, d).then((c) => {
|
|
297
297
|
if (i) return;
|
|
298
|
-
const
|
|
298
|
+
const g = `${Ae(t.companionUrl)}/api/${c.token}`;
|
|
299
299
|
try {
|
|
300
|
-
r = new WebSocket(
|
|
300
|
+
r = new WebSocket(g);
|
|
301
301
|
} catch {
|
|
302
302
|
e.onError(new Error("Failed to connect to upload progress channel"));
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
r.onmessage = (
|
|
306
|
-
var
|
|
305
|
+
r.onmessage = (h) => {
|
|
306
|
+
var f, m, _;
|
|
307
307
|
if (!i)
|
|
308
308
|
try {
|
|
309
|
-
const
|
|
310
|
-
switch (
|
|
309
|
+
const w = JSON.parse(h.data);
|
|
310
|
+
switch (w.action) {
|
|
311
311
|
case "progress": {
|
|
312
|
-
const
|
|
313
|
-
e.onProgress(
|
|
312
|
+
const y = w.payload, k = y.bytesUploaded ?? 0, D = y.bytesTotal ?? (t.size || 1);
|
|
313
|
+
e.onProgress(k, D);
|
|
314
314
|
break;
|
|
315
315
|
}
|
|
316
316
|
case "success": {
|
|
317
|
-
const
|
|
318
|
-
if (r == null || r.close(), (
|
|
317
|
+
const y = w.payload;
|
|
318
|
+
if (r == null || r.close(), (f = y.response) != null && f.responseText)
|
|
319
319
|
try {
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
e.onComplete(
|
|
320
|
+
const k = JSON.parse(y.response.responseText);
|
|
321
|
+
if (k.status === "success") {
|
|
322
|
+
e.onComplete(k);
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
e.onError(new Error(
|
|
325
|
+
e.onError(new Error(k.msg || "Upload failed"));
|
|
326
326
|
return;
|
|
327
327
|
} catch {
|
|
328
328
|
}
|
|
@@ -331,15 +331,15 @@ function Ae(a, e) {
|
|
|
331
331
|
}
|
|
332
332
|
case "error": {
|
|
333
333
|
r == null || r.close();
|
|
334
|
-
const
|
|
335
|
-
let
|
|
336
|
-
if ((
|
|
334
|
+
const y = w.payload;
|
|
335
|
+
let k = ((m = y.error) == null ? void 0 : m.message) || "Upload failed";
|
|
336
|
+
if ((_ = y.response) != null && _.responseText)
|
|
337
337
|
try {
|
|
338
|
-
const
|
|
339
|
-
|
|
338
|
+
const D = JSON.parse(y.response.responseText);
|
|
339
|
+
k = D.hint || D.msg || D.message || k;
|
|
340
340
|
} catch {
|
|
341
341
|
}
|
|
342
|
-
e.onError(new Error(
|
|
342
|
+
e.onError(new Error(k));
|
|
343
343
|
break;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
@@ -350,8 +350,8 @@ function Ae(a, e) {
|
|
|
350
350
|
}, r.onclose = () => {
|
|
351
351
|
r = null;
|
|
352
352
|
};
|
|
353
|
-
}).catch((
|
|
354
|
-
i || e.onError(
|
|
353
|
+
}).catch((c) => {
|
|
354
|
+
i || e.onError(c instanceof Error ? c : new Error(String(c)));
|
|
355
355
|
}), {
|
|
356
356
|
abort() {
|
|
357
357
|
if (i = !0, r) {
|
|
@@ -364,7 +364,7 @@ function Ae(a, e) {
|
|
|
364
364
|
}
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
|
-
class
|
|
367
|
+
class He {
|
|
368
368
|
constructor(e, t) {
|
|
369
369
|
this.activeUploads = /* @__PURE__ */ new Map(), this.retryTimers = /* @__PURE__ */ new Map(), this.unsubscribe = null, this.store = e, this.config = t;
|
|
370
370
|
}
|
|
@@ -382,7 +382,7 @@ class Ie {
|
|
|
382
382
|
const { files: e } = this.store.getState();
|
|
383
383
|
let t = !1;
|
|
384
384
|
for (const i of e.values())
|
|
385
|
-
i.status === "idle" ? (
|
|
385
|
+
i.status === "idle" ? (z(this.store, i.id, { status: "queued" }), t = !0) : i.status === "queued" && (t = !0);
|
|
386
386
|
t && (this.store.setState({ isUploading: !0 }), this.processQueue());
|
|
387
387
|
}
|
|
388
388
|
/**
|
|
@@ -390,7 +390,7 @@ class Ie {
|
|
|
390
390
|
*/
|
|
391
391
|
retryFile(e) {
|
|
392
392
|
const t = this.store.getState().files.get(e);
|
|
393
|
-
!t || t.status !== "error" && t.status !== "failed" || (
|
|
393
|
+
!t || t.status !== "error" && t.status !== "failed" || (z(this.store, e, {
|
|
394
394
|
status: "queued",
|
|
395
395
|
error: null,
|
|
396
396
|
progress: 0,
|
|
@@ -404,7 +404,7 @@ class Ie {
|
|
|
404
404
|
retryAll() {
|
|
405
405
|
const { files: e } = this.store.getState();
|
|
406
406
|
for (const t of e.values())
|
|
407
|
-
(t.status === "error" || t.status === "failed") &&
|
|
407
|
+
(t.status === "error" || t.status === "failed") && z(this.store, t.id, {
|
|
408
408
|
status: "queued",
|
|
409
409
|
error: null,
|
|
410
410
|
progress: 0,
|
|
@@ -418,7 +418,7 @@ class Ie {
|
|
|
418
418
|
*/
|
|
419
419
|
cancelFile(e) {
|
|
420
420
|
const t = this.store.getState().files.get(e);
|
|
421
|
-
!t ||
|
|
421
|
+
!t || !$e(t.status) || (this.abortUpload(e), z(this.store, e, { status: "cancelled" }));
|
|
422
422
|
}
|
|
423
423
|
/**
|
|
424
424
|
* Cancel all active/queued uploads.
|
|
@@ -426,7 +426,7 @@ class Ie {
|
|
|
426
426
|
cancelAll() {
|
|
427
427
|
const { files: e } = this.store.getState();
|
|
428
428
|
for (const t of e.values())
|
|
429
|
-
|
|
429
|
+
$e(t.status) && (this.abortUpload(t.id), z(this.store, t.id, { status: "cancelled" }));
|
|
430
430
|
this.store.setState({ isUploading: !1 });
|
|
431
431
|
}
|
|
432
432
|
/**
|
|
@@ -457,7 +457,7 @@ class Ie {
|
|
|
457
457
|
this.startUpload(n);
|
|
458
458
|
}
|
|
459
459
|
startUpload(e) {
|
|
460
|
-
|
|
460
|
+
z(this.store, e.id, { status: "uploading", error: null });
|
|
461
461
|
let t = 0, i = Date.now(), r = 0;
|
|
462
462
|
const o = {
|
|
463
463
|
apiBase: this.config.apiBase,
|
|
@@ -465,21 +465,21 @@ class Ie {
|
|
|
465
465
|
folder: this.store.getState().targetFolder,
|
|
466
466
|
onComplete: (d) => this.handleComplete(e.id, d),
|
|
467
467
|
onError: (d) => this.handleError(e.id, d)
|
|
468
|
-
}, s = (d,
|
|
469
|
-
const u = Date.now(),
|
|
470
|
-
if (
|
|
471
|
-
const
|
|
472
|
-
r = r === 0 ?
|
|
468
|
+
}, s = (d, c) => {
|
|
469
|
+
const u = Date.now(), g = (u - i) / 1e3;
|
|
470
|
+
if (g > 0) {
|
|
471
|
+
const f = (d - t) / g;
|
|
472
|
+
r = r === 0 ? f : 0.3 * f + 0.7 * r;
|
|
473
473
|
}
|
|
474
474
|
t = d, i = u;
|
|
475
|
-
const
|
|
476
|
-
|
|
475
|
+
const h = c > 0 ? Math.min(d / c * 100, 100) : 0;
|
|
476
|
+
z(this.store, e.id, { progress: h, bytesUploaded: d, speed: r }), this.updateTotalProgress();
|
|
477
477
|
};
|
|
478
478
|
let n;
|
|
479
|
-
e.remoteInfo ? n =
|
|
479
|
+
e.remoteInfo ? n = Ie(e, { ...o, onProgress: s }) : e.remoteUrl ? n = Be(e, o) : n = Me(e, { ...o, onProgress: s }), this.activeUploads.set(e.id, n);
|
|
480
480
|
}
|
|
481
481
|
handleComplete(e, t) {
|
|
482
|
-
this.activeUploads.delete(e),
|
|
482
|
+
this.activeUploads.delete(e), z(this.store, e, {
|
|
483
483
|
status: "complete",
|
|
484
484
|
progress: 100,
|
|
485
485
|
response: t
|
|
@@ -495,17 +495,17 @@ class Ie {
|
|
|
495
495
|
r.baseDelay * Math.pow(r.backoffFactor, i.retryCount),
|
|
496
496
|
r.maxDelay
|
|
497
497
|
);
|
|
498
|
-
|
|
498
|
+
z(this.store, e, {
|
|
499
499
|
status: "retrying",
|
|
500
500
|
error: t.message,
|
|
501
501
|
retryCount: o
|
|
502
502
|
});
|
|
503
503
|
const n = setTimeout(() => {
|
|
504
|
-
this.retryTimers.delete(e),
|
|
504
|
+
this.retryTimers.delete(e), z(this.store, e, { status: "queued" }), this.processQueue();
|
|
505
505
|
}, s);
|
|
506
506
|
this.retryTimers.set(e, n);
|
|
507
507
|
} else
|
|
508
|
-
|
|
508
|
+
z(this.store, e, {
|
|
509
509
|
status: "failed",
|
|
510
510
|
error: t.message
|
|
511
511
|
}), this.checkAllComplete(), this.processQueue();
|
|
@@ -525,7 +525,7 @@ class Ie {
|
|
|
525
525
|
totalBytes: t,
|
|
526
526
|
totalBytesUploaded: i,
|
|
527
527
|
totalSpeed: r,
|
|
528
|
-
totalProgress: t > 0 ? i / t * 100 : 0
|
|
528
|
+
totalProgress: t > 0 ? Math.min(i / t * 100, 100) : 0
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
531
|
checkAllComplete() {
|
|
@@ -535,13 +535,13 @@ class Ie {
|
|
|
535
535
|
) && this.store.getState().isUploading && this.store.setState({ isUploading: !1 });
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function $e(a) {
|
|
539
539
|
return a === "queued" || a === "uploading" || a === "retrying";
|
|
540
540
|
}
|
|
541
541
|
function de(a) {
|
|
542
542
|
return `https://api.filerobot.com/${a}`;
|
|
543
543
|
}
|
|
544
|
-
async function
|
|
544
|
+
async function Ye(a, e) {
|
|
545
545
|
const t = `${de(a)}/key/${encodeURIComponent(e)}`, i = new AbortController(), r = setTimeout(() => i.abort(), 3e4);
|
|
546
546
|
try {
|
|
547
547
|
const o = await fetch(t, { signal: i.signal });
|
|
@@ -571,10 +571,10 @@ function oe(a, e) {
|
|
|
571
571
|
}
|
|
572
572
|
return a.airboxPuid && (t["X-Filerobot-Airbox-Puid"] = a.airboxPuid), t;
|
|
573
573
|
}
|
|
574
|
-
async function
|
|
574
|
+
async function qe(a) {
|
|
575
575
|
const e = de(a.container);
|
|
576
576
|
if (a.mode === "security-template") {
|
|
577
|
-
const t = await
|
|
577
|
+
const t = await Ye(a.container, a.securityTemplateId);
|
|
578
578
|
return { apiBase: e, headers: oe(a, t), sassKey: t };
|
|
579
579
|
}
|
|
580
580
|
return { apiBase: e, headers: oe(a) };
|
|
@@ -598,11 +598,11 @@ const v = {
|
|
|
598
598
|
FILE_PREVIEW: "sfx-file-preview",
|
|
599
599
|
FILL_METADATA: "sfx-fill-metadata"
|
|
600
600
|
};
|
|
601
|
-
let
|
|
602
|
-
function
|
|
603
|
-
return `file-${Date.now()}-${++
|
|
601
|
+
let Ve = 0;
|
|
602
|
+
function H() {
|
|
603
|
+
return `file-${Date.now()}-${++Ve}`;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function Y(a) {
|
|
606
606
|
if (a <= 0) return "0 B";
|
|
607
607
|
const e = ["B", "KB", "MB", "GB"], t = Math.min(Math.floor(Math.log(a) / Math.log(1024)), e.length - 1), i = a / Math.pow(1024, t);
|
|
608
608
|
return `${t === 0 ? i : i.toFixed(1)} ${e[t]}`;
|
|
@@ -619,11 +619,11 @@ function N(a) {
|
|
|
619
619
|
const e = ((t = a.name.split(".").pop()) == null ? void 0 : t.toLowerCase()) ?? "";
|
|
620
620
|
return a.type.startsWith("image/") ? "image" : a.type.startsWith("video/") || ["mp4", "mov", "avi", "webm", "mkv"].includes(e) ? "vid" : a.type === "application/pdf" || e === "pdf" ? "pdf" : ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "rtf", "odt"].includes(e) ? "doc" : ["zip", "rar", "7z", "tar", "gz", "bz2"].includes(e) ? "zip" : "gen";
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function Ne(a) {
|
|
623
623
|
const e = a.lastIndexOf(".");
|
|
624
624
|
return e >= 0 ? a.slice(e + 1).toUpperCase() : "";
|
|
625
625
|
}
|
|
626
|
-
const
|
|
626
|
+
const Xe = {
|
|
627
627
|
jpg: "image/jpeg",
|
|
628
628
|
jpeg: "image/jpeg",
|
|
629
629
|
png: "image/png",
|
|
@@ -641,12 +641,12 @@ const Ne = {
|
|
|
641
641
|
doc: "application/msword",
|
|
642
642
|
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
643
643
|
};
|
|
644
|
-
function
|
|
644
|
+
function We(a) {
|
|
645
645
|
var t;
|
|
646
646
|
const e = ((t = a.split(".").pop()) == null ? void 0 : t.toLowerCase()) ?? "";
|
|
647
|
-
return
|
|
647
|
+
return Xe[e] || "";
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function Ke(a) {
|
|
650
650
|
return new Promise((e) => {
|
|
651
651
|
const t = document.createElement("video");
|
|
652
652
|
t.preload = "metadata", t.muted = !0, t.playsInline = !0;
|
|
@@ -702,13 +702,13 @@ function se(a, e, t) {
|
|
|
702
702
|
}
|
|
703
703
|
return null;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function Ze(a, e, t) {
|
|
706
706
|
return se(a, e, t);
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function Se(a) {
|
|
709
709
|
return a.allowedFileTypes ? a.allowedFileTypes.join(",") : "";
|
|
710
710
|
}
|
|
711
|
-
const
|
|
711
|
+
const Ee = {
|
|
712
712
|
"google-drive": {
|
|
713
713
|
id: "google-drive",
|
|
714
714
|
label: "Google Drive",
|
|
@@ -759,20 +759,20 @@ const Se = {
|
|
|
759
759
|
brandHtml: '<span class="brand-ico" style="background:#111"><svg width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M8.5 11.5v5h7v-5h5.5V21h-18v-9.5h5.5zm7-8v5h-7v-5h7z"/></svg></span>'
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
|
-
function
|
|
763
|
-
return a.filter((e) => e in
|
|
762
|
+
function Je(a) {
|
|
763
|
+
return a.filter((e) => e in Ee).map((e) => Ee[e]);
|
|
764
764
|
}
|
|
765
|
-
var
|
|
765
|
+
var Ge = Object.defineProperty, Qe = (a, e, t, i) => {
|
|
766
766
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
767
767
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
768
|
-
return r &&
|
|
768
|
+
return r && Ge(e, t, r), r;
|
|
769
769
|
};
|
|
770
|
-
const
|
|
771
|
-
{ id: "device", label: "My Device", icon:
|
|
772
|
-
{ id: "url", label: "URL link", icon:
|
|
773
|
-
{ id: "camera", label: "Camera", icon:
|
|
774
|
-
{ id: "screen-cast", label: "Screen capture", icon:
|
|
775
|
-
], fe = class fe extends
|
|
770
|
+
const et = '<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>', tt = '<path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"/>', rt = '<path d="M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"/><circle cx="12" cy="13" r="4"/>', it = '<rect x="2" y="3" width="20" height="14" rx="2"/><circle cx="12" cy="10" r="1"/><path d="M7 21l5-5 5 5"/>', X = [
|
|
771
|
+
{ id: "device", label: "My Device", icon: et, iconColor: "#2563eb" },
|
|
772
|
+
{ id: "url", label: "URL link", icon: tt, iconColor: "#16a34a" },
|
|
773
|
+
{ id: "camera", label: "Camera", icon: rt, iconColor: "#7c3aed" },
|
|
774
|
+
{ id: "screen-cast", label: "Screen capture", icon: it, iconColor: "#ea580c" }
|
|
775
|
+
], fe = class fe extends P {
|
|
776
776
|
constructor() {
|
|
777
777
|
super(...arguments), this.sources = X;
|
|
778
778
|
}
|
|
@@ -790,7 +790,7 @@ const Qe = '<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21
|
|
|
790
790
|
${this.sources.map(
|
|
791
791
|
(e) => l`
|
|
792
792
|
<button @click=${() => this._handleClick(e)}>
|
|
793
|
-
${e.brandHtml ?
|
|
793
|
+
${e.brandHtml ? M(e.brandHtml) : T`<svg viewBox="0 0 24 24" class=${e.fillIcon ? "fill-icon" : ""}>${F(e.icon)}</svg>`}
|
|
794
794
|
${e.label}
|
|
795
795
|
</button>
|
|
796
796
|
`
|
|
@@ -798,7 +798,7 @@ const Qe = '<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21
|
|
|
798
798
|
`;
|
|
799
799
|
}
|
|
800
800
|
};
|
|
801
|
-
fe.styles =
|
|
801
|
+
fe.styles = S`
|
|
802
802
|
:host {
|
|
803
803
|
display: flex;
|
|
804
804
|
flex-wrap: wrap;
|
|
@@ -872,17 +872,17 @@ fe.styles = k`
|
|
|
872
872
|
}
|
|
873
873
|
`;
|
|
874
874
|
let ae = fe;
|
|
875
|
-
|
|
875
|
+
Qe([
|
|
876
876
|
b({ type: Array })
|
|
877
877
|
], ae.prototype, "sources");
|
|
878
|
-
var
|
|
878
|
+
var ot = Object.defineProperty, O = (a, e, t, i) => {
|
|
879
879
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
880
880
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
881
|
-
return r &&
|
|
881
|
+
return r && ot(e, t, r), r;
|
|
882
882
|
};
|
|
883
|
-
const
|
|
883
|
+
const Ue = 3, ue = class ue extends P {
|
|
884
884
|
constructor() {
|
|
885
|
-
super(...arguments), this.compact = !1, this.externalDragOver = !1, this.accept = "", this.sources = [], this.sourcesLayout = "pills", this._dragOver = !1, this._moreOpen = !1, this._visiblePills =
|
|
885
|
+
super(...arguments), this.compact = !1, this.externalDragOver = !1, this.accept = "", this.sources = [], this.sourcesLayout = "pills", this._dragOver = !1, this._moreOpen = !1, this._visiblePills = Ue, this._dragCounter = 0, this._onDragEnter = (e) => {
|
|
886
886
|
e.preventDefault(), this._dragCounter++, this._dragCounter === 1 && (this._dragOver = !0);
|
|
887
887
|
}, this._onDragOver = (e) => {
|
|
888
888
|
e.preventDefault();
|
|
@@ -953,8 +953,8 @@ const Ee = 3, ue = class ue extends z {
|
|
|
953
953
|
}
|
|
954
954
|
/** Position the fixed dropdown, choosing above or below based on available space. */
|
|
955
955
|
_positionDropdown() {
|
|
956
|
-
var
|
|
957
|
-
const e = (
|
|
956
|
+
var g, h;
|
|
957
|
+
const e = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".more-wrap > button"), t = (h = this.shadowRoot) == null ? void 0 : h.querySelector(".more-dropdown");
|
|
958
958
|
if (!e || !t) return;
|
|
959
959
|
const i = e.getBoundingClientRect(), r = 8, o = t.scrollHeight, s = t.offsetWidth, n = i.top, d = window.innerHeight - i.bottom;
|
|
960
960
|
n >= o + r || n > d ? (t.classList.add("above"), t.classList.remove("below"), t.style.top = `${i.top - o - r}px`) : (t.classList.add("below"), t.classList.remove("above"), t.style.top = `${i.bottom + r}px`);
|
|
@@ -966,7 +966,7 @@ const Ee = 3, ue = class ue extends z {
|
|
|
966
966
|
}
|
|
967
967
|
_updateVisiblePills() {
|
|
968
968
|
const e = window.innerWidth;
|
|
969
|
-
this.sourcesLayout === "cards" ? e <= 480 ? this._visiblePills = 2 : e <= 768 ? this._visiblePills = 3 : this._visiblePills = 5 : e <= 480 ? this._visiblePills = 1 : e <= 768 ? this._visiblePills = 2 : this._visiblePills =
|
|
969
|
+
this.sourcesLayout === "cards" ? e <= 480 ? this._visiblePills = 2 : e <= 768 ? this._visiblePills = 3 : this._visiblePills = 5 : e <= 480 ? this._visiblePills = 1 : e <= 768 ? this._visiblePills = 2 : this._visiblePills = Ue;
|
|
970
970
|
}
|
|
971
971
|
connectedCallback() {
|
|
972
972
|
super.connectedCallback(), document.addEventListener("paste", this._onPaste), document.addEventListener("click", this._onDocClick), document.addEventListener("keydown", this._onDocKeyDown), window.addEventListener("scroll", this._onScrollOrResize, !0), window.addEventListener("resize", this._onScrollOrResize), this._updateVisiblePills();
|
|
@@ -985,8 +985,8 @@ const Ee = 3, ue = class ue extends z {
|
|
|
985
985
|
t.stopPropagation(), this._onSourceIconClick(e);
|
|
986
986
|
}}
|
|
987
987
|
>
|
|
988
|
-
${e.brandHtml ?
|
|
989
|
-
${
|
|
988
|
+
${e.brandHtml ? M(e.brandHtml) : l`<span class="pill-ico" style=${e.iconColor ? `color:${e.iconColor}` : ""}>
|
|
989
|
+
${T`<svg viewBox="0 0 24 24" class=${e.fillIcon ? "fill-icon" : ""}>${F(e.icon)}</svg>`}
|
|
990
990
|
</span>`}
|
|
991
991
|
${e.label}
|
|
992
992
|
</button>
|
|
@@ -1001,8 +1001,8 @@ const Ee = 3, ue = class ue extends z {
|
|
|
1001
1001
|
t.stopPropagation(), this._onSourceIconClick(e);
|
|
1002
1002
|
}}
|
|
1003
1003
|
>
|
|
1004
|
-
${e.brandHtml ? l`<span class="card-ico">${
|
|
1005
|
-
${
|
|
1004
|
+
${e.brandHtml ? l`<span class="card-ico">${M(e.brandHtml)}</span>` : l`<span class="card-ico" style=${e.iconColor ? `color:${e.iconColor}` : ""}>
|
|
1005
|
+
${T`<svg viewBox="0 0 24 24" class=${e.fillIcon ? "fill-icon" : ""}>${F(e.icon)}</svg>`}
|
|
1006
1006
|
</span>`}
|
|
1007
1007
|
<span class="card-label">${e.label}</span>
|
|
1008
1008
|
</button>
|
|
@@ -1026,7 +1026,7 @@ const Ee = 3, ue = class ue extends z {
|
|
|
1026
1026
|
(t) => l`
|
|
1027
1027
|
<button class="more-item" @click=${(i) => this._onMoreItemClick(t, i)}>
|
|
1028
1028
|
<div class="more-item-ico">
|
|
1029
|
-
${t.brandHtml ?
|
|
1029
|
+
${t.brandHtml ? M(t.brandHtml) : t.iconColor ? l`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${F(t.icon)}</svg>` : T`<svg viewBox="0 0 24 24">${F(t.icon)}</svg>`}
|
|
1030
1030
|
</div>
|
|
1031
1031
|
${t.label}
|
|
1032
1032
|
</button>
|
|
@@ -1048,7 +1048,7 @@ const Ee = 3, ue = class ue extends z {
|
|
|
1048
1048
|
(t) => l`
|
|
1049
1049
|
<button class="more-item" @click=${(i) => this._onMoreItemClick(t, i)}>
|
|
1050
1050
|
<div class="more-item-ico">
|
|
1051
|
-
${t.brandHtml ?
|
|
1051
|
+
${t.brandHtml ? M(t.brandHtml) : t.iconColor ? l`<svg viewBox="0 0 24 24" style="color:${t.iconColor}">${F(t.icon)}</svg>` : T`<svg viewBox="0 0 24 24">${F(t.icon)}</svg>`}
|
|
1052
1052
|
</div>
|
|
1053
1053
|
${t.label}
|
|
1054
1054
|
</button>
|
|
@@ -1093,22 +1093,22 @@ const Ee = 3, ue = class ue extends z {
|
|
|
1093
1093
|
<div class="title">
|
|
1094
1094
|
Drag & Drop or click to <span>browse</span>
|
|
1095
1095
|
</div>
|
|
1096
|
-
${this.compact ?
|
|
1096
|
+
${this.compact ? p : l`<div class="subtitle">Drop files anywhere on this page</div>`}
|
|
1097
1097
|
|
|
1098
1098
|
${!this.compact && this.sources.length > 0 ? l`
|
|
1099
1099
|
<div class="import-divider"><span>or import from</span></div>
|
|
1100
1100
|
${this.sourcesLayout === "cards" ? l`
|
|
1101
1101
|
<div class="sources-cards">
|
|
1102
1102
|
${t.map((r) => this._renderCard(r))}
|
|
1103
|
-
${i.length > 0 ? this._renderMoreCard(i) :
|
|
1103
|
+
${i.length > 0 ? this._renderMoreCard(i) : p}
|
|
1104
1104
|
</div>
|
|
1105
1105
|
` : l`
|
|
1106
1106
|
<div class="sources-grid">
|
|
1107
1107
|
${t.map((r) => this._renderPill(r))}
|
|
1108
|
-
${i.length > 0 ? this._renderMoreDropdown(i) :
|
|
1108
|
+
${i.length > 0 ? this._renderMoreDropdown(i) : p}
|
|
1109
1109
|
</div>
|
|
1110
1110
|
`}
|
|
1111
|
-
` :
|
|
1111
|
+
` : p}
|
|
1112
1112
|
|
|
1113
1113
|
${this.compact && this.sources.length > 0 ? l`
|
|
1114
1114
|
<div class="sources-row">
|
|
@@ -1123,25 +1123,25 @@ const Ee = 3, ue = class ue extends z {
|
|
|
1123
1123
|
o.stopPropagation(), this._onSourceIconClick(r);
|
|
1124
1124
|
}}
|
|
1125
1125
|
>
|
|
1126
|
-
${r.brandHtml ?
|
|
1126
|
+
${r.brandHtml ? M(r.brandHtml) : T`<svg viewBox="0 0 24 24" class=${r.fillIcon ? "fill-icon" : ""}>${F(r.icon)}</svg>`}
|
|
1127
1127
|
</button>
|
|
1128
1128
|
`
|
|
1129
1129
|
)}
|
|
1130
1130
|
</div>
|
|
1131
|
-
` :
|
|
1131
|
+
` : p}
|
|
1132
1132
|
|
|
1133
1133
|
<div class="ripple"></div>
|
|
1134
1134
|
<input
|
|
1135
1135
|
type="file"
|
|
1136
1136
|
multiple
|
|
1137
|
-
accept=${this.accept ||
|
|
1137
|
+
accept=${this.accept || p}
|
|
1138
1138
|
@change=${this._onFileChange}
|
|
1139
1139
|
/>
|
|
1140
1140
|
</div>
|
|
1141
1141
|
`;
|
|
1142
1142
|
}
|
|
1143
1143
|
};
|
|
1144
|
-
ue.styles =
|
|
1144
|
+
ue.styles = S`
|
|
1145
1145
|
:host {
|
|
1146
1146
|
display: flex;
|
|
1147
1147
|
flex-shrink: 0;
|
|
@@ -1924,38 +1924,38 @@ ue.styles = k`
|
|
|
1924
1924
|
}
|
|
1925
1925
|
}
|
|
1926
1926
|
`;
|
|
1927
|
-
let
|
|
1928
|
-
|
|
1927
|
+
let U = ue;
|
|
1928
|
+
O([
|
|
1929
1929
|
b({ type: Boolean, reflect: !0 })
|
|
1930
|
-
],
|
|
1931
|
-
|
|
1930
|
+
], U.prototype, "compact");
|
|
1931
|
+
O([
|
|
1932
1932
|
b({ type: Boolean, attribute: "external-drag-over" })
|
|
1933
|
-
],
|
|
1934
|
-
|
|
1933
|
+
], U.prototype, "externalDragOver");
|
|
1934
|
+
O([
|
|
1935
1935
|
b({ type: String })
|
|
1936
|
-
],
|
|
1937
|
-
|
|
1936
|
+
], U.prototype, "accept");
|
|
1937
|
+
O([
|
|
1938
1938
|
b({ type: Array })
|
|
1939
|
-
],
|
|
1940
|
-
|
|
1939
|
+
], U.prototype, "sources");
|
|
1940
|
+
O([
|
|
1941
1941
|
b({ type: String, attribute: "sources-layout" })
|
|
1942
|
-
],
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
],
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
],
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
],
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
],
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
],
|
|
1958
|
-
const he = class he extends
|
|
1942
|
+
], U.prototype, "sourcesLayout");
|
|
1943
|
+
O([
|
|
1944
|
+
x()
|
|
1945
|
+
], U.prototype, "_dragOver");
|
|
1946
|
+
O([
|
|
1947
|
+
x()
|
|
1948
|
+
], U.prototype, "_moreOpen");
|
|
1949
|
+
O([
|
|
1950
|
+
x()
|
|
1951
|
+
], U.prototype, "_visiblePills");
|
|
1952
|
+
O([
|
|
1953
|
+
Fe(".ripple")
|
|
1954
|
+
], U.prototype, "_rippleEl");
|
|
1955
|
+
O([
|
|
1956
|
+
Fe('input[type="file"]')
|
|
1957
|
+
], U.prototype, "fileInput");
|
|
1958
|
+
const he = class he extends P {
|
|
1959
1959
|
render() {
|
|
1960
1960
|
return l`
|
|
1961
1961
|
<div class="line"></div>
|
|
@@ -1964,7 +1964,7 @@ const he = class he extends z {
|
|
|
1964
1964
|
`;
|
|
1965
1965
|
}
|
|
1966
1966
|
};
|
|
1967
|
-
he.styles =
|
|
1967
|
+
he.styles = S`
|
|
1968
1968
|
:host {
|
|
1969
1969
|
display: flex;
|
|
1970
1970
|
align-items: center;
|
|
@@ -1987,13 +1987,13 @@ he.styles = k`
|
|
|
1987
1987
|
white-space: nowrap;
|
|
1988
1988
|
}
|
|
1989
1989
|
`;
|
|
1990
|
-
let
|
|
1991
|
-
var
|
|
1990
|
+
let ze = he;
|
|
1991
|
+
var st = Object.defineProperty, Z = (a, e, t, i) => {
|
|
1992
1992
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
1993
1993
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
1994
|
-
return r &&
|
|
1994
|
+
return r && st(e, t, r), r;
|
|
1995
1995
|
};
|
|
1996
|
-
const xe = class xe extends
|
|
1996
|
+
const xe = class xe extends P {
|
|
1997
1997
|
constructor() {
|
|
1998
1998
|
super(...arguments), this.files = [], this.showDropTile = !1, this.sources = [], this.accept = "", this._moreOpen = !1, this._outsideClickHandler = (e) => {
|
|
1999
1999
|
const t = e.composedPath(), i = this.renderRoot.querySelector(".drop-tile-more-wrap");
|
|
@@ -2050,7 +2050,7 @@ const xe = class xe extends z {
|
|
|
2050
2050
|
title=${r.label}
|
|
2051
2051
|
@click=${(o) => this._onSourceClick(o, r)}
|
|
2052
2052
|
>
|
|
2053
|
-
${r.brandHtml ?
|
|
2053
|
+
${r.brandHtml ? M(r.brandHtml) : T`<svg viewBox="0 0 24 24" class=${r.fillIcon ? "fill-icon" : ""}>${F(r.icon)}</svg>`}
|
|
2054
2054
|
</button>
|
|
2055
2055
|
`)}
|
|
2056
2056
|
${i.length > 0 ? l`
|
|
@@ -2064,25 +2064,25 @@ const xe = class xe extends z {
|
|
|
2064
2064
|
@click=${(o) => this._onMoreSourceClick(o, r)}
|
|
2065
2065
|
>
|
|
2066
2066
|
<span class="more-dropdown-ico" style=${r.iconColor && !r.brandHtml ? `color:${r.iconColor}` : ""}>
|
|
2067
|
-
${r.brandHtml ?
|
|
2067
|
+
${r.brandHtml ? M(r.brandHtml) : T`<svg viewBox="0 0 24 24" class=${r.fillIcon ? "fill-icon" : ""}>${F(r.icon)}</svg>`}
|
|
2068
2068
|
</span>
|
|
2069
2069
|
${r.label}
|
|
2070
2070
|
</button>
|
|
2071
2071
|
`)}
|
|
2072
2072
|
</div>
|
|
2073
|
-
` :
|
|
2073
|
+
` : p}
|
|
2074
2074
|
</div>
|
|
2075
|
-
` :
|
|
2075
|
+
` : p}
|
|
2076
2076
|
</div>
|
|
2077
|
-
` :
|
|
2078
|
-
<input type="file" multiple accept=${this.accept ||
|
|
2077
|
+
` : p}
|
|
2078
|
+
<input type="file" multiple accept=${this.accept || p} @change=${this._onFileInput} />
|
|
2079
2079
|
</div>
|
|
2080
2080
|
`;
|
|
2081
2081
|
}
|
|
2082
2082
|
render() {
|
|
2083
2083
|
return l`
|
|
2084
2084
|
<div class="grid">
|
|
2085
|
-
${this.showDropTile ? this._renderDropTile() :
|
|
2085
|
+
${this.showDropTile ? this._renderDropTile() : p}
|
|
2086
2086
|
${this.files.map(
|
|
2087
2087
|
(e, t) => l`<sfx-file-item .file=${e} style="--tile-index:${t}"></sfx-file-item>`
|
|
2088
2088
|
)}
|
|
@@ -2090,7 +2090,7 @@ const xe = class xe extends z {
|
|
|
2090
2090
|
`;
|
|
2091
2091
|
}
|
|
2092
2092
|
};
|
|
2093
|
-
xe.styles =
|
|
2093
|
+
xe.styles = S`
|
|
2094
2094
|
:host {
|
|
2095
2095
|
display: block;
|
|
2096
2096
|
flex: 1;
|
|
@@ -2112,10 +2112,10 @@ xe.styles = k`
|
|
|
2112
2112
|
}
|
|
2113
2113
|
|
|
2114
2114
|
:host::-webkit-scrollbar-thumb {
|
|
2115
|
-
background: rgba(0, 0, 0, 0.15);
|
|
2116
|
-
border-radius:
|
|
2117
|
-
border-left: var(--sfx-scrollbar-inset, 3px) solid transparent;
|
|
2118
|
-
border-right: var(--sfx-scrollbar-inset, 3px) solid transparent;
|
|
2115
|
+
background-color: rgba(0, 0, 0, 0.15);
|
|
2116
|
+
border-radius: 6px;
|
|
2117
|
+
border-left: var(--sfx-scrollbar-inset-left, 3px) solid transparent;
|
|
2118
|
+
border-right: var(--sfx-scrollbar-inset-right, 3px) solid transparent;
|
|
2119
2119
|
background-clip: padding-box;
|
|
2120
2120
|
}
|
|
2121
2121
|
|
|
@@ -2123,7 +2123,7 @@ xe.styles = k`
|
|
|
2123
2123
|
display: grid;
|
|
2124
2124
|
grid-template-columns: repeat(auto-fill, minmax(var(--sfx-up-grid-min, max(24%, 140px)), 1fr));
|
|
2125
2125
|
gap: 12px;
|
|
2126
|
-
padding: 2px
|
|
2126
|
+
padding: 2px 12px 16px 16px;
|
|
2127
2127
|
}
|
|
2128
2128
|
|
|
2129
2129
|
@media (max-width: 480px) {
|
|
@@ -2148,6 +2148,8 @@ xe.styles = k`
|
|
|
2148
2148
|
padding: 16px 12px;
|
|
2149
2149
|
position: relative;
|
|
2150
2150
|
z-index: 1;
|
|
2151
|
+
min-height: 0;
|
|
2152
|
+
overflow: hidden;
|
|
2151
2153
|
}
|
|
2152
2154
|
|
|
2153
2155
|
.drop-tile:hover {
|
|
@@ -2156,8 +2158,8 @@ xe.styles = k`
|
|
|
2156
2158
|
}
|
|
2157
2159
|
|
|
2158
2160
|
.drop-tile-rings {
|
|
2159
|
-
width: 72px;
|
|
2160
|
-
height: 72px;
|
|
2161
|
+
width: clamp(48px, 8vw, 72px);
|
|
2162
|
+
height: clamp(48px, 8vw, 72px);
|
|
2161
2163
|
position: relative;
|
|
2162
2164
|
display: flex;
|
|
2163
2165
|
align-items: center;
|
|
@@ -2186,8 +2188,8 @@ xe.styles = k`
|
|
|
2186
2188
|
}
|
|
2187
2189
|
|
|
2188
2190
|
.drop-tile-core {
|
|
2189
|
-
width: 40px;
|
|
2190
|
-
height: 40px;
|
|
2191
|
+
width: clamp(28px, 5vw, 40px);
|
|
2192
|
+
height: clamp(28px, 5vw, 40px);
|
|
2191
2193
|
border-radius: 50%;
|
|
2192
2194
|
background: var(--sfx-up-primary-bg, #eff6ff);
|
|
2193
2195
|
color: var(--sfx-up-primary, #2563eb);
|
|
@@ -2404,14 +2406,14 @@ Z([
|
|
|
2404
2406
|
b({ type: String })
|
|
2405
2407
|
], B.prototype, "accept");
|
|
2406
2408
|
Z([
|
|
2407
|
-
|
|
2409
|
+
x()
|
|
2408
2410
|
], B.prototype, "_moreOpen");
|
|
2409
|
-
var
|
|
2411
|
+
var at = Object.defineProperty, nt = (a, e, t, i) => {
|
|
2410
2412
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
2411
2413
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
2412
|
-
return r &&
|
|
2414
|
+
return r && at(e, t, r), r;
|
|
2413
2415
|
};
|
|
2414
|
-
const ge = class ge extends
|
|
2416
|
+
const ge = class ge extends P {
|
|
2415
2417
|
_remove() {
|
|
2416
2418
|
this.dispatchEvent(
|
|
2417
2419
|
new CustomEvent("file-remove", {
|
|
@@ -2441,8 +2443,8 @@ const ge = class ge extends z {
|
|
|
2441
2443
|
}
|
|
2442
2444
|
render() {
|
|
2443
2445
|
const e = this.file;
|
|
2444
|
-
if (!e) return
|
|
2445
|
-
const t = N(e), i = e.status === "complete", r = e.status === "uploading", o = e.status === "error" || e.status === "failed", s = e.status === "rejected", n =
|
|
2446
|
+
if (!e) return p;
|
|
2447
|
+
const t = N(e), i = e.status === "complete", r = e.status === "uploading", o = e.status === "error" || e.status === "failed", s = e.status === "rejected", n = Ne(e.name), d = [
|
|
2446
2448
|
"tile",
|
|
2447
2449
|
i ? "done" : "",
|
|
2448
2450
|
r ? "uploading" : "",
|
|
@@ -2457,7 +2459,7 @@ const ge = class ge extends z {
|
|
|
2457
2459
|
<div class="type-icon">
|
|
2458
2460
|
<div class="type-icon-inner ${t}">
|
|
2459
2461
|
${this._renderTypeIcon(t)}
|
|
2460
|
-
${n ? l`<div class="ext-label">${n}</div>` :
|
|
2462
|
+
${n ? l`<div class="ext-label">${n}</div>` : p}
|
|
2461
2463
|
</div>
|
|
2462
2464
|
</div>
|
|
2463
2465
|
`}
|
|
@@ -2471,7 +2473,7 @@ const ge = class ge extends z {
|
|
|
2471
2473
|
</svg>
|
|
2472
2474
|
Preview
|
|
2473
2475
|
</button>
|
|
2474
|
-
` :
|
|
2476
|
+
` : p}
|
|
2475
2477
|
|
|
2476
2478
|
<!-- Spinner overlay -->
|
|
2477
2479
|
<div class="spinner-overlay">
|
|
@@ -2483,20 +2485,20 @@ const ge = class ge extends z {
|
|
|
2483
2485
|
<svg viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round">
|
|
2484
2486
|
<polyline points="20 6 9 17 4 12" />
|
|
2485
2487
|
</svg>
|
|
2486
|
-
</div>` :
|
|
2488
|
+
</div>` : p}
|
|
2487
2489
|
|
|
2488
2490
|
<!-- Progress bar -->
|
|
2489
2491
|
${e.status === "uploading" ? l`
|
|
2490
2492
|
<div class="progress">
|
|
2491
2493
|
<div class="progress-fill" style="transform:scaleX(${Math.min(e.progress, 100) / 100})"></div>
|
|
2492
2494
|
</div>
|
|
2493
|
-
` :
|
|
2495
|
+
` : p}
|
|
2494
2496
|
|
|
2495
2497
|
<!-- Error / rejected badge -->
|
|
2496
|
-
${(o || s) && e.error ? l`<div class="error-badge" title=${e.error}>${e.error}</div>` :
|
|
2498
|
+
${(o || s) && e.error ? l`<div class="error-badge" title=${e.error}>${e.error}</div>` : p}
|
|
2497
2499
|
|
|
2498
|
-
<!-- Video duration badge -->
|
|
2499
|
-
${e.duration != null && e.duration > 0 ? l`<div class="duration-badge">${this._formatDuration(e.duration)}</div>` :
|
|
2500
|
+
<!-- Video duration badge (hidden when error badge is shown to avoid overlap) -->
|
|
2501
|
+
${!(o || s) && e.duration != null && e.duration > 0 ? l`<div class="duration-badge">${this._formatDuration(e.duration)}</div>` : p}
|
|
2500
2502
|
</div>
|
|
2501
2503
|
|
|
2502
2504
|
<!-- Action buttons -->
|
|
@@ -2508,7 +2510,7 @@ const ge = class ge extends z {
|
|
|
2508
2510
|
<path d="M20.49 15a9 9 0 11-2.12-9.36L23 10" />
|
|
2509
2511
|
</svg>
|
|
2510
2512
|
</button>
|
|
2511
|
-
` :
|
|
2513
|
+
` : p}
|
|
2512
2514
|
<button class="act-btn del" @click=${this._remove} title="Remove" aria-label="Remove file">
|
|
2513
2515
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
2514
2516
|
<polyline points="3 6 5 6 21 6" />
|
|
@@ -2523,7 +2525,7 @@ const ge = class ge extends z {
|
|
|
2523
2525
|
<!-- Info bar -->
|
|
2524
2526
|
<div class="info">
|
|
2525
2527
|
<div class="name" title=${e.name}>${e.name}</div>
|
|
2526
|
-
<div class="meta">${n || ""}${e.size ? ` · ${
|
|
2528
|
+
<div class="meta">${n || ""}${e.size ? ` · ${Y(e.size)}` : ""}</div>
|
|
2527
2529
|
</div>
|
|
2528
2530
|
</div>
|
|
2529
2531
|
`;
|
|
@@ -2547,7 +2549,7 @@ const ge = class ge extends z {
|
|
|
2547
2549
|
}
|
|
2548
2550
|
}
|
|
2549
2551
|
};
|
|
2550
|
-
ge.styles =
|
|
2552
|
+
ge.styles = S`
|
|
2551
2553
|
:host {
|
|
2552
2554
|
display: block;
|
|
2553
2555
|
}
|
|
@@ -2854,19 +2856,22 @@ ge.styles = k`
|
|
|
2854
2856
|
/* --- Error / rejected state --- */
|
|
2855
2857
|
.error-badge {
|
|
2856
2858
|
position: absolute;
|
|
2857
|
-
bottom:
|
|
2859
|
+
bottom: 6px;
|
|
2858
2860
|
left: 6px;
|
|
2859
2861
|
right: 6px;
|
|
2860
|
-
font-size:
|
|
2861
|
-
font-weight:
|
|
2862
|
+
font-size: 11px;
|
|
2863
|
+
font-weight: 500;
|
|
2864
|
+
line-height: 1.3;
|
|
2862
2865
|
color: #fff;
|
|
2863
|
-
background: var(--sfx-up-error, #dc2626);
|
|
2864
|
-
border-radius:
|
|
2865
|
-
padding:
|
|
2866
|
+
background: color-mix(in srgb, var(--sfx-up-error, #dc2626) 85%, transparent);
|
|
2867
|
+
border-radius: 6px;
|
|
2868
|
+
padding: 4px 8px;
|
|
2866
2869
|
text-align: center;
|
|
2867
|
-
|
|
2870
|
+
display: -webkit-box;
|
|
2871
|
+
-webkit-line-clamp: 2;
|
|
2872
|
+
line-clamp: 2;
|
|
2873
|
+
-webkit-box-orient: vertical;
|
|
2868
2874
|
overflow: hidden;
|
|
2869
|
-
text-overflow: ellipsis;
|
|
2870
2875
|
}
|
|
2871
2876
|
|
|
2872
2877
|
.tile.rejected {
|
|
@@ -2919,10 +2924,10 @@ ge.styles = k`
|
|
|
2919
2924
|
}
|
|
2920
2925
|
`;
|
|
2921
2926
|
let ne = ge;
|
|
2922
|
-
|
|
2927
|
+
nt([
|
|
2923
2928
|
b({ attribute: !1 })
|
|
2924
2929
|
], ne.prototype, "file");
|
|
2925
|
-
const J =
|
|
2930
|
+
const J = S`
|
|
2926
2931
|
.btn,
|
|
2927
2932
|
.btn-ghost,
|
|
2928
2933
|
.btn-primary,
|
|
@@ -2991,20 +2996,20 @@ const J = k`
|
|
|
2991
2996
|
opacity: 0.55;
|
|
2992
2997
|
cursor: not-allowed;
|
|
2993
2998
|
}
|
|
2994
|
-
`, G =
|
|
2999
|
+
`, G = S`
|
|
2995
3000
|
button:focus-visible {
|
|
2996
3001
|
outline: 2px solid var(--sfx-up-ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
2997
3002
|
outline-offset: 2px;
|
|
2998
3003
|
}
|
|
2999
3004
|
`;
|
|
3000
|
-
var
|
|
3005
|
+
var lt = Object.defineProperty, Q = (a, e, t, i) => {
|
|
3001
3006
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
3002
3007
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
3003
|
-
return r &&
|
|
3008
|
+
return r && lt(e, t, r), r;
|
|
3004
3009
|
};
|
|
3005
|
-
const
|
|
3010
|
+
const Pe = 7, ve = class ve extends P {
|
|
3006
3011
|
constructor() {
|
|
3007
|
-
super(...arguments), this.fileCount = 0, this.totalSize = 0, this.thumbnails = [], this.primaryLabel = "Done";
|
|
3012
|
+
super(...arguments), this.fileCount = 0, this.totalSize = 0, this.thumbnails = [], this.primaryLabel = "Done", this.failedFiles = [];
|
|
3008
3013
|
}
|
|
3009
3014
|
_uploadMore() {
|
|
3010
3015
|
this.dispatchEvent(
|
|
@@ -3017,27 +3022,45 @@ const ze = 7, ve = class ve extends z {
|
|
|
3017
3022
|
);
|
|
3018
3023
|
}
|
|
3019
3024
|
render() {
|
|
3020
|
-
const e = this.thumbnails.slice(0,
|
|
3025
|
+
const e = this.thumbnails.slice(0, Pe), t = this.thumbnails.length - Pe, i = this.fileCount > 0, r = this.failedFiles.length > 0, o = r && !i;
|
|
3021
3026
|
return l`
|
|
3022
3027
|
<div class="card" role="status" aria-live="polite">
|
|
3023
|
-
<div class="icon">
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3028
|
+
<div class="icon ${o ? "error" : r ? "warning" : ""}">
|
|
3029
|
+
${o ? l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
3030
|
+
<circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/>
|
|
3031
|
+
</svg>` : r ? l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
3032
|
+
<path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/>
|
|
3033
|
+
</svg>` : l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
3034
|
+
<polyline points="20 6 9 17 4 12" />
|
|
3035
|
+
</svg>`}
|
|
3027
3036
|
</div>
|
|
3028
|
-
<div class="title"
|
|
3029
|
-
<div class="subtitle"
|
|
3037
|
+
<div class="title">${o ? "Upload failed" : r ? "Partially uploaded" : "Uploaded successfully!"}</div>
|
|
3038
|
+
<div class="subtitle">${o ? `${this.failedFiles.length === 1 ? "File" : "Files"} could not be uploaded` : r ? `${this.fileCount} ${this.fileCount === 1 ? "file" : "files"} uploaded, ${this.failedFiles.length} failed` : "All files are ready for use"}</div>
|
|
3030
3039
|
|
|
3031
3040
|
${e.length > 0 ? l`
|
|
3032
3041
|
<div class="thumbs">
|
|
3033
3042
|
${e.map(
|
|
3034
|
-
(
|
|
3043
|
+
(s) => l`<img class="thumb" src=${s} alt="" />`
|
|
3035
3044
|
)}
|
|
3036
|
-
${t > 0 ? l`<div class="thumb-more">+${t}</div>` :
|
|
3045
|
+
${t > 0 ? l`<div class="thumb-more">+${t}</div>` : p}
|
|
3037
3046
|
</div>
|
|
3038
|
-
` :
|
|
3039
|
-
|
|
3040
|
-
|
|
3047
|
+
` : p}
|
|
3048
|
+
|
|
3049
|
+
${i ? l`<div class="summary">${this.fileCount} ${this.fileCount === 1 ? "file" : "files"} · ${Y(this.totalSize)} uploaded</div>` : p}
|
|
3050
|
+
|
|
3051
|
+
${r ? l`
|
|
3052
|
+
<div class="failed-list">
|
|
3053
|
+
${this.failedFiles.map((s) => l`
|
|
3054
|
+
<div class="failed-item">
|
|
3055
|
+
<svg class="failed-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Error"><title>Error</title><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
|
|
3056
|
+
<div class="failed-info">
|
|
3057
|
+
<div class="failed-name">${s.name}</div>
|
|
3058
|
+
<div class="failed-reason">${s.error}</div>
|
|
3059
|
+
</div>
|
|
3060
|
+
</div>
|
|
3061
|
+
`)}
|
|
3062
|
+
</div>
|
|
3063
|
+
` : p}
|
|
3041
3064
|
|
|
3042
3065
|
<div class="actions">
|
|
3043
3066
|
<button class="btn-ghost" @click=${this._uploadMore}>Upload more</button>
|
|
@@ -3047,7 +3070,7 @@ const ze = 7, ve = class ve extends z {
|
|
|
3047
3070
|
`;
|
|
3048
3071
|
}
|
|
3049
3072
|
};
|
|
3050
|
-
ve.styles = [J, G,
|
|
3073
|
+
ve.styles = [J, G, S`
|
|
3051
3074
|
:host {
|
|
3052
3075
|
display: flex;
|
|
3053
3076
|
flex: 1;
|
|
@@ -3083,6 +3106,16 @@ ve.styles = [J, G, k`
|
|
|
3083
3106
|
height: 30px;
|
|
3084
3107
|
}
|
|
3085
3108
|
|
|
3109
|
+
.icon.error {
|
|
3110
|
+
background: #fef2f2;
|
|
3111
|
+
color: #ef4444;
|
|
3112
|
+
}
|
|
3113
|
+
|
|
3114
|
+
.icon.warning {
|
|
3115
|
+
background: #fffbeb;
|
|
3116
|
+
color: #f59e0b;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3086
3119
|
.title {
|
|
3087
3120
|
font-size: 20px;
|
|
3088
3121
|
font-weight: 700;
|
|
@@ -3155,6 +3188,57 @@ ve.styles = [J, G, k`
|
|
|
3155
3188
|
box-shadow: 0 4px 16px rgba(34, 197, 94, 0.38);
|
|
3156
3189
|
}
|
|
3157
3190
|
|
|
3191
|
+
/* --- Failed files list --- */
|
|
3192
|
+
.failed-list {
|
|
3193
|
+
width: 100%;
|
|
3194
|
+
max-width: 360px;
|
|
3195
|
+
margin-bottom: 20px;
|
|
3196
|
+
border-radius: 8px;
|
|
3197
|
+
border: 1px solid var(--sfx-up-border, #e8eaed);
|
|
3198
|
+
overflow: hidden;
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
.failed-item {
|
|
3202
|
+
display: flex;
|
|
3203
|
+
align-items: flex-start;
|
|
3204
|
+
gap: 8px;
|
|
3205
|
+
padding: 8px 12px;
|
|
3206
|
+
border-bottom: 1px solid var(--sfx-up-border, #f1f5f9);
|
|
3207
|
+
text-align: left;
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3210
|
+
.failed-item:last-child {
|
|
3211
|
+
border-bottom: none;
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
.failed-icon {
|
|
3215
|
+
width: 16px;
|
|
3216
|
+
height: 16px;
|
|
3217
|
+
flex-shrink: 0;
|
|
3218
|
+
color: #ef4444;
|
|
3219
|
+
margin-top: 1px;
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
.failed-info {
|
|
3223
|
+
flex: 1;
|
|
3224
|
+
min-width: 0;
|
|
3225
|
+
}
|
|
3226
|
+
|
|
3227
|
+
.failed-name {
|
|
3228
|
+
font-size: 12px;
|
|
3229
|
+
font-weight: 500;
|
|
3230
|
+
color: var(--sfx-up-text, #1e293b);
|
|
3231
|
+
white-space: nowrap;
|
|
3232
|
+
overflow: hidden;
|
|
3233
|
+
text-overflow: ellipsis;
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
.failed-reason {
|
|
3237
|
+
font-size: 11px;
|
|
3238
|
+
color: var(--sfx-up-text-muted, #94a3b8);
|
|
3239
|
+
line-height: 1.4;
|
|
3240
|
+
}
|
|
3241
|
+
|
|
3158
3242
|
@keyframes fadeUp {
|
|
3159
3243
|
from {
|
|
3160
3244
|
opacity: 0;
|
|
@@ -3185,25 +3269,28 @@ ve.styles = [J, G, k`
|
|
|
3185
3269
|
.icon { animation: none; }
|
|
3186
3270
|
}
|
|
3187
3271
|
`];
|
|
3188
|
-
let
|
|
3189
|
-
|
|
3272
|
+
let R = ve;
|
|
3273
|
+
Q([
|
|
3190
3274
|
b({ type: Number })
|
|
3191
|
-
],
|
|
3192
|
-
|
|
3275
|
+
], R.prototype, "fileCount");
|
|
3276
|
+
Q([
|
|
3193
3277
|
b({ type: Number })
|
|
3194
|
-
],
|
|
3195
|
-
|
|
3278
|
+
], R.prototype, "totalSize");
|
|
3279
|
+
Q([
|
|
3196
3280
|
b({ type: Array })
|
|
3197
|
-
],
|
|
3198
|
-
|
|
3281
|
+
], R.prototype, "thumbnails");
|
|
3282
|
+
Q([
|
|
3199
3283
|
b({ type: String })
|
|
3200
|
-
],
|
|
3201
|
-
|
|
3284
|
+
], R.prototype, "primaryLabel");
|
|
3285
|
+
Q([
|
|
3286
|
+
b({ type: Array })
|
|
3287
|
+
], R.prototype, "failedFiles");
|
|
3288
|
+
var dt = Object.defineProperty, A = (a, e, t, i) => {
|
|
3202
3289
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
3203
3290
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
3204
|
-
return r &&
|
|
3291
|
+
return r && dt(e, t, r), r;
|
|
3205
3292
|
};
|
|
3206
|
-
const be = class be extends
|
|
3293
|
+
const be = class be extends P {
|
|
3207
3294
|
constructor() {
|
|
3208
3295
|
super(...arguments), this.uploadState = "idle", this.fileCount = 0, this.totalSize = 0, this.failedCount = 0, this.showFillMetadata = !1, this.completedCount = 0, this.uploadProgress = 0;
|
|
3209
3296
|
}
|
|
@@ -3232,7 +3319,7 @@ const be = class be extends z {
|
|
|
3232
3319
|
</div>
|
|
3233
3320
|
<span class="progress-label">${this.completedCount}/${this.fileCount} files</span>
|
|
3234
3321
|
</div>
|
|
3235
|
-
` :
|
|
3322
|
+
` : p}
|
|
3236
3323
|
<div class="buttons-row">
|
|
3237
3324
|
<div class="left">
|
|
3238
3325
|
${this.showFillMetadata && this.uploadState === "idle" ? l`
|
|
@@ -3246,7 +3333,7 @@ const be = class be extends z {
|
|
|
3246
3333
|
</svg>
|
|
3247
3334
|
Fill Metadata
|
|
3248
3335
|
</button>
|
|
3249
|
-
` :
|
|
3336
|
+
` : p}
|
|
3250
3337
|
</div>
|
|
3251
3338
|
<div class="right">
|
|
3252
3339
|
<button class="btn-ghost" @click=${this._clear}>
|
|
@@ -3274,7 +3361,7 @@ const be = class be extends z {
|
|
|
3274
3361
|
</svg>
|
|
3275
3362
|
Retry all (${this.failedCount})
|
|
3276
3363
|
</button>
|
|
3277
|
-
` :
|
|
3364
|
+
` : p}
|
|
3278
3365
|
${this._renderUploadButton()}
|
|
3279
3366
|
</div>
|
|
3280
3367
|
</div>
|
|
@@ -3305,7 +3392,7 @@ const be = class be extends z {
|
|
|
3305
3392
|
`;
|
|
3306
3393
|
}
|
|
3307
3394
|
};
|
|
3308
|
-
be.styles = [J, G,
|
|
3395
|
+
be.styles = [J, G, S`
|
|
3309
3396
|
:host {
|
|
3310
3397
|
display: flex;
|
|
3311
3398
|
flex-direction: column;
|
|
@@ -3455,47 +3542,47 @@ be.styles = [J, G, k`
|
|
|
3455
3542
|
}
|
|
3456
3543
|
`];
|
|
3457
3544
|
let j = be;
|
|
3458
|
-
|
|
3545
|
+
A([
|
|
3459
3546
|
b({ type: String })
|
|
3460
3547
|
], j.prototype, "uploadState");
|
|
3461
|
-
|
|
3548
|
+
A([
|
|
3462
3549
|
b({ type: Number })
|
|
3463
3550
|
], j.prototype, "fileCount");
|
|
3464
|
-
|
|
3551
|
+
A([
|
|
3465
3552
|
b({ type: Number })
|
|
3466
3553
|
], j.prototype, "totalSize");
|
|
3467
|
-
|
|
3554
|
+
A([
|
|
3468
3555
|
b({ type: Number })
|
|
3469
3556
|
], j.prototype, "failedCount");
|
|
3470
|
-
|
|
3557
|
+
A([
|
|
3471
3558
|
b({ type: Boolean })
|
|
3472
3559
|
], j.prototype, "showFillMetadata");
|
|
3473
|
-
|
|
3560
|
+
A([
|
|
3474
3561
|
b({ type: Number })
|
|
3475
3562
|
], j.prototype, "completedCount");
|
|
3476
|
-
|
|
3563
|
+
A([
|
|
3477
3564
|
b({ type: Number })
|
|
3478
3565
|
], j.prototype, "uploadProgress");
|
|
3479
|
-
const
|
|
3480
|
-
function
|
|
3566
|
+
const ct = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
3567
|
+
function ce(a, e) {
|
|
3481
3568
|
return (t) => {
|
|
3482
3569
|
if (t.key !== "Tab") return;
|
|
3483
3570
|
const i = a();
|
|
3484
3571
|
if (!i) return;
|
|
3485
3572
|
const r = i.querySelector(e);
|
|
3486
3573
|
if (!r) return;
|
|
3487
|
-
const o = Array.from(r.querySelectorAll(
|
|
3574
|
+
const o = Array.from(r.querySelectorAll(ct));
|
|
3488
3575
|
if (o.length === 0) return;
|
|
3489
3576
|
const s = o[0], n = o[o.length - 1], d = i.activeElement;
|
|
3490
3577
|
t.shiftKey ? (d === s || !r.contains(d)) && (t.preventDefault(), n.focus()) : (d === n || !r.contains(d)) && (t.preventDefault(), s.focus());
|
|
3491
3578
|
};
|
|
3492
3579
|
}
|
|
3493
|
-
var pt = Object.defineProperty,
|
|
3580
|
+
var pt = Object.defineProperty, pe = (a, e, t, i) => {
|
|
3494
3581
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
3495
3582
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
3496
3583
|
return r && pt(e, t, r), r;
|
|
3497
3584
|
};
|
|
3498
|
-
const me = class me extends
|
|
3585
|
+
const me = class me extends P {
|
|
3499
3586
|
constructor() {
|
|
3500
3587
|
super(...arguments), this._url = "", this._name = "", this._error = "", this._onBackdropClick = (e) => {
|
|
3501
3588
|
e.target === e.currentTarget && this._cancel();
|
|
@@ -3503,7 +3590,7 @@ const me = class me extends z {
|
|
|
3503
3590
|
this._url = e.target.value, this._error = "", this._autoName();
|
|
3504
3591
|
}, this._onNameInput = (e) => {
|
|
3505
3592
|
this._name = e.target.value;
|
|
3506
|
-
}, this._focusTrap =
|
|
3593
|
+
}, this._focusTrap = ce(() => this.shadowRoot, ".card"), this._onKeyDown = (e) => {
|
|
3507
3594
|
var t;
|
|
3508
3595
|
e.key === "Escape" && this._cancel(), e.key === "Enter" && ((t = e.target) == null ? void 0 : t.tagName) === "INPUT" && this._submit(), this._focusTrap(e);
|
|
3509
3596
|
};
|
|
@@ -3606,7 +3693,7 @@ const me = class me extends z {
|
|
|
3606
3693
|
`;
|
|
3607
3694
|
}
|
|
3608
3695
|
};
|
|
3609
|
-
me.styles = [J, G,
|
|
3696
|
+
me.styles = [J, G, S`
|
|
3610
3697
|
:host {
|
|
3611
3698
|
display: block;
|
|
3612
3699
|
}
|
|
@@ -3781,25 +3868,25 @@ me.styles = [J, G, k`
|
|
|
3781
3868
|
|
|
3782
3869
|
`];
|
|
3783
3870
|
let W = me;
|
|
3784
|
-
|
|
3785
|
-
|
|
3871
|
+
pe([
|
|
3872
|
+
x()
|
|
3786
3873
|
], W.prototype, "_url");
|
|
3787
|
-
|
|
3788
|
-
|
|
3874
|
+
pe([
|
|
3875
|
+
x()
|
|
3789
3876
|
], W.prototype, "_name");
|
|
3790
|
-
|
|
3791
|
-
|
|
3877
|
+
pe([
|
|
3878
|
+
x()
|
|
3792
3879
|
], W.prototype, "_error");
|
|
3793
|
-
var
|
|
3880
|
+
var ft = Object.defineProperty, re = (a, e, t, i) => {
|
|
3794
3881
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
3795
3882
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
3796
|
-
return r &&
|
|
3883
|
+
return r && ft(e, t, r), r;
|
|
3797
3884
|
};
|
|
3798
|
-
const we = class we extends
|
|
3885
|
+
const we = class we extends P {
|
|
3799
3886
|
constructor() {
|
|
3800
3887
|
super(...arguments), this._stream = null, this._error = "", this._captured = null, this._previewUrl = "", this._onBackdropClick = (e) => {
|
|
3801
3888
|
e.target === e.currentTarget && this._cancel();
|
|
3802
|
-
}, this._focusTrap =
|
|
3889
|
+
}, this._focusTrap = ce(() => this.shadowRoot, ".card"), this._onKeyDown = (e) => {
|
|
3803
3890
|
e.key === "Escape" && this._cancel(), this._focusTrap(e);
|
|
3804
3891
|
}, this._capture = () => {
|
|
3805
3892
|
var r, o;
|
|
@@ -3873,7 +3960,7 @@ const we = class we extends z {
|
|
|
3873
3960
|
`;
|
|
3874
3961
|
}
|
|
3875
3962
|
};
|
|
3876
|
-
we.styles = [J, G,
|
|
3963
|
+
we.styles = [J, G, S`
|
|
3877
3964
|
:host { display: block; }
|
|
3878
3965
|
|
|
3879
3966
|
.backdrop {
|
|
@@ -3954,29 +4041,29 @@ we.styles = [J, G, k`
|
|
|
3954
4041
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
3955
4042
|
@keyframes slideUp { from { transform: translateY(18px) scale(0.97); } to { transform: translateY(0) scale(1); } }
|
|
3956
4043
|
`];
|
|
3957
|
-
let
|
|
4044
|
+
let q = we;
|
|
3958
4045
|
re([
|
|
3959
|
-
|
|
3960
|
-
],
|
|
4046
|
+
x()
|
|
4047
|
+
], q.prototype, "_stream");
|
|
3961
4048
|
re([
|
|
3962
|
-
|
|
3963
|
-
],
|
|
4049
|
+
x()
|
|
4050
|
+
], q.prototype, "_error");
|
|
3964
4051
|
re([
|
|
3965
|
-
|
|
3966
|
-
],
|
|
4052
|
+
x()
|
|
4053
|
+
], q.prototype, "_captured");
|
|
3967
4054
|
re([
|
|
3968
|
-
|
|
3969
|
-
],
|
|
3970
|
-
var
|
|
4055
|
+
x()
|
|
4056
|
+
], q.prototype, "_previewUrl");
|
|
4057
|
+
var ut = Object.defineProperty, ee = (a, e, t, i) => {
|
|
3971
4058
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
3972
4059
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
3973
|
-
return r &&
|
|
4060
|
+
return r && ut(e, t, r), r;
|
|
3974
4061
|
};
|
|
3975
|
-
const ye = class ye extends
|
|
4062
|
+
const ye = class ye extends P {
|
|
3976
4063
|
constructor() {
|
|
3977
4064
|
super(...arguments), this._stream = null, this._recording = !1, this._error = "", this._recordedBlob = null, this._previewUrl = "", this._recorder = null, this._chunks = [], this._onBackdropClick = (e) => {
|
|
3978
4065
|
e.target === e.currentTarget && this._cancel();
|
|
3979
|
-
}, this._focusTrap =
|
|
4066
|
+
}, this._focusTrap = ce(() => this.shadowRoot, ".card"), this._onKeyDown = (e) => {
|
|
3980
4067
|
e.key === "Escape" && this._cancel(), this._focusTrap(e);
|
|
3981
4068
|
}, this._startRecording = async () => {
|
|
3982
4069
|
var e;
|
|
@@ -4071,7 +4158,7 @@ const ye = class ye extends z {
|
|
|
4071
4158
|
`;
|
|
4072
4159
|
}
|
|
4073
4160
|
};
|
|
4074
|
-
ye.styles = [J, G,
|
|
4161
|
+
ye.styles = [J, G, S`
|
|
4075
4162
|
:host { display: block; }
|
|
4076
4163
|
|
|
4077
4164
|
.backdrop {
|
|
@@ -4170,32 +4257,32 @@ ye.styles = [J, G, k`
|
|
|
4170
4257
|
@keyframes slideUp { from { transform: translateY(18px) scale(0.97); } to { transform: translateY(0) scale(1); } }
|
|
4171
4258
|
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
|
|
4172
4259
|
`];
|
|
4173
|
-
let
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
],
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
],
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
],
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
],
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
],
|
|
4189
|
-
var
|
|
4260
|
+
let L = ye;
|
|
4261
|
+
ee([
|
|
4262
|
+
x()
|
|
4263
|
+
], L.prototype, "_stream");
|
|
4264
|
+
ee([
|
|
4265
|
+
x()
|
|
4266
|
+
], L.prototype, "_recording");
|
|
4267
|
+
ee([
|
|
4268
|
+
x()
|
|
4269
|
+
], L.prototype, "_error");
|
|
4270
|
+
ee([
|
|
4271
|
+
x()
|
|
4272
|
+
], L.prototype, "_recordedBlob");
|
|
4273
|
+
ee([
|
|
4274
|
+
x()
|
|
4275
|
+
], L.prototype, "_previewUrl");
|
|
4276
|
+
var ht = Object.defineProperty, $ = (a, e, t, i) => {
|
|
4190
4277
|
for (var r = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
4191
4278
|
(s = a[o]) && (r = s(e, t, r) || r);
|
|
4192
|
-
return r &&
|
|
4279
|
+
return r && ht(e, t, r), r;
|
|
4193
4280
|
};
|
|
4194
|
-
const
|
|
4195
|
-
var
|
|
4196
|
-
const
|
|
4281
|
+
const De = /* @__PURE__ */ new Set(["unsplash"]);
|
|
4282
|
+
var E;
|
|
4283
|
+
const C = (E = class extends P {
|
|
4197
4284
|
constructor() {
|
|
4198
|
-
super(), this.config = null, this._isOpen = !1, this._activeConnector = null, this._showUrlDialog = !1, this._showCameraDialog = !1, this._showScreenCastDialog = !1, this._previewFileId = null, this._previewDims = "—", this._fullscreenPreviewUrl = null, this._fullscreenVideoFile = null, this._fullscreenZoomed = !1, this._fsPanX = 0, this._fsPanY = 0, this._fsDragging = !1, this._fsDragStartX = 0, this._fsDragStartY = 0, this._fsPanStartX = 0, this._fsPanStartY = 0, this._bodyDragOver = !1, this._isMinimized = !1, this._isPillExpanded = !1, this._bodyDragCounter = 0, this._videoBlobUrls = /* @__PURE__ */ new Map(), this._engine = null, this._cachedSources = X, this._cachedSourcesConfig = void 0, this._rejectedTimers = /* @__PURE__ */ new Map(), this._apiBase = null, this._authHeaders = null, this._authResolveId = 0, this._prevStoreState = null, this._unsubStoreEvents = null, this._portalContainer = null, this._onFilesSelected = (e) => {
|
|
4285
|
+
super(), this.config = null, this._isOpen = !1, this._activeConnector = null, this._showUrlDialog = !1, this._showCameraDialog = !1, this._showScreenCastDialog = !1, this._previewFileId = null, this._previewDims = "—", this._fullscreenPreviewUrl = null, this._fullscreenVideoFile = null, this._fullscreenZoomed = !1, this._fsPanX = 0, this._fsPanY = 0, this._fsDragging = !1, this._fsDragStartX = 0, this._fsDragStartY = 0, this._fsPanStartX = 0, this._fsPanStartY = 0, this._bodyDragOver = !1, this._isMinimized = !1, this._isPillExpanded = !1, this._bodyDragCounter = 0, this._videoBlobUrls = /* @__PURE__ */ new Map(), this._engine = null, this._cachedSources = X, this._cachedSourcesConfig = void 0, this._rejectedTimers = /* @__PURE__ */ new Map(), this._closeOnCompleteTimer = null, this._apiBase = null, this._authHeaders = null, this._authResolveId = 0, this._prevStoreState = null, this._unsubStoreEvents = null, this._portalContainer = null, this._onFilesSelected = (e) => {
|
|
4199
4286
|
this._processIncomingFiles(e.detail.files);
|
|
4200
4287
|
}, this._onDropTileSourceClick = (e) => {
|
|
4201
4288
|
this._handleSourceActivation(e.detail.source.id);
|
|
@@ -4230,24 +4317,24 @@ const y = (S = class extends z {
|
|
|
4230
4317
|
return;
|
|
4231
4318
|
}
|
|
4232
4319
|
if ((((o = (r = this.config) == null ? void 0 : r.connectors) == null ? void 0 : o.providers) ?? []).includes(e)) {
|
|
4233
|
-
if (
|
|
4320
|
+
if (De.has(e)) {
|
|
4234
4321
|
if (!customElements.get("sfx-search-provider-browser")) {
|
|
4235
|
-
const { SfxSearchProviderBrowser: n } = await import("./search-provider-browser-
|
|
4322
|
+
const { SfxSearchProviderBrowser: n } = await import("./search-provider-browser-9oZjABnB.js");
|
|
4236
4323
|
customElements.define("sfx-search-provider-browser", n);
|
|
4237
4324
|
}
|
|
4238
4325
|
} else if (!customElements.get("sfx-provider-browser")) {
|
|
4239
|
-
const { SfxProviderBrowser: n } = await import("./provider-browser-
|
|
4326
|
+
const { SfxProviderBrowser: n } = await import("./provider-browser-CMbbN8PZ.js");
|
|
4240
4327
|
customElements.define("sfx-provider-browser", n);
|
|
4241
4328
|
}
|
|
4242
4329
|
this._activeConnector = e;
|
|
4243
4330
|
}
|
|
4244
4331
|
}, this._onUrlSubmit = (e) => {
|
|
4245
|
-
var u,
|
|
4332
|
+
var u, g, h;
|
|
4246
4333
|
this._showUrlDialog = !1;
|
|
4247
|
-
const { url: t, name: i } = e.detail, r = (u = this.config) == null ? void 0 : u.callbacks, o =
|
|
4334
|
+
const { url: t, name: i } = e.detail, r = (u = this.config) == null ? void 0 : u.callbacks, o = We(i), s = o.startsWith("image/"), n = this._store.getState(), d = se({ name: i, size: 0, type: o }, n.restrictions, n.files);
|
|
4248
4335
|
if (d) {
|
|
4249
|
-
const
|
|
4250
|
-
id:
|
|
4336
|
+
const f = {
|
|
4337
|
+
id: H(),
|
|
4251
4338
|
status: "rejected",
|
|
4252
4339
|
file: null,
|
|
4253
4340
|
remoteUrl: t,
|
|
@@ -4267,11 +4354,11 @@ const y = (S = class extends z {
|
|
|
4267
4354
|
tags: [],
|
|
4268
4355
|
remoteInfo: null
|
|
4269
4356
|
};
|
|
4270
|
-
|
|
4357
|
+
I(this._store, f), this._dispatchPublic(v.FILE_REJECTED, { file: f, reason: d }), (g = r == null ? void 0 : r.onFileRejected) == null || g.call(r, f, d);
|
|
4271
4358
|
return;
|
|
4272
4359
|
}
|
|
4273
|
-
const
|
|
4274
|
-
id:
|
|
4360
|
+
const c = {
|
|
4361
|
+
id: H(),
|
|
4275
4362
|
status: "idle",
|
|
4276
4363
|
file: null,
|
|
4277
4364
|
remoteUrl: t,
|
|
@@ -4291,7 +4378,7 @@ const y = (S = class extends z {
|
|
|
4291
4378
|
tags: [],
|
|
4292
4379
|
remoteInfo: null
|
|
4293
4380
|
};
|
|
4294
|
-
|
|
4381
|
+
I(this._store, c), this._dispatchPublic(v.FILE_ADDED, { file: c }), (h = r == null ? void 0 : r.onFileAdded) == null || h.call(r, c), this._store.getState().queueConfig.autoProceed && this.upload();
|
|
4295
4382
|
}, this._onUrlCancel = () => {
|
|
4296
4383
|
this._showUrlDialog = !1;
|
|
4297
4384
|
}, this._onCameraCapture = (e) => {
|
|
@@ -4311,7 +4398,7 @@ const y = (S = class extends z {
|
|
|
4311
4398
|
}, this._onFillMetadata = () => {
|
|
4312
4399
|
var t, i, r;
|
|
4313
4400
|
const e = [...this._store.getState().files.values()].filter(
|
|
4314
|
-
(o) =>
|
|
4401
|
+
(o) => E._MODIFIABLE_STATUSES.has(o.status)
|
|
4315
4402
|
);
|
|
4316
4403
|
this._dispatchPublic(v.FILL_METADATA, { files: e }), (r = (i = (t = this.config) == null ? void 0 : t.callbacks) == null ? void 0 : i.onFillMetadata) == null || r.call(i, e);
|
|
4317
4404
|
}, this._onFileRetry = (e) => {
|
|
@@ -4323,7 +4410,7 @@ const y = (S = class extends z {
|
|
|
4323
4410
|
}, this._onClearAll = () => {
|
|
4324
4411
|
var i, r, o;
|
|
4325
4412
|
const e = (i = this.config) == null ? void 0 : i.callbacks;
|
|
4326
|
-
(r = this._engine) == null || r.cancelAll();
|
|
4413
|
+
this._closeOnCompleteTimer && (clearTimeout(this._closeOnCompleteTimer), this._closeOnCompleteTimer = null), (r = this._engine) == null || r.cancelAll();
|
|
4327
4414
|
const t = [...this._store.getState().files.values()];
|
|
4328
4415
|
for (const s of t)
|
|
4329
4416
|
s.previewUrl && URL.revokeObjectURL(s.previewUrl), this._dispatchPublic(v.FILE_REMOVED, { file: s }), (o = e == null ? void 0 : e.onFileRemoved) == null || o.call(e, s);
|
|
@@ -4366,7 +4453,7 @@ const y = (S = class extends z {
|
|
|
4366
4453
|
);
|
|
4367
4454
|
if (d) {
|
|
4368
4455
|
const u = {
|
|
4369
|
-
id:
|
|
4456
|
+
id: H(),
|
|
4370
4457
|
status: "rejected",
|
|
4371
4458
|
file: null,
|
|
4372
4459
|
remoteUrl: null,
|
|
@@ -4386,11 +4473,11 @@ const y = (S = class extends z {
|
|
|
4386
4473
|
tags: [],
|
|
4387
4474
|
remoteInfo: s
|
|
4388
4475
|
};
|
|
4389
|
-
|
|
4476
|
+
I(this._store, u), this._dispatchPublic(v.FILE_REJECTED, { file: u, reason: d }), (r = t == null ? void 0 : t.onFileRejected) == null || r.call(t, u, d);
|
|
4390
4477
|
continue;
|
|
4391
4478
|
}
|
|
4392
|
-
const
|
|
4393
|
-
id:
|
|
4479
|
+
const c = {
|
|
4480
|
+
id: H(),
|
|
4394
4481
|
status: "idle",
|
|
4395
4482
|
file: null,
|
|
4396
4483
|
remoteUrl: null,
|
|
@@ -4410,7 +4497,7 @@ const y = (S = class extends z {
|
|
|
4410
4497
|
tags: [],
|
|
4411
4498
|
remoteInfo: s
|
|
4412
4499
|
};
|
|
4413
|
-
|
|
4500
|
+
I(this._store, c), this._dispatchPublic(v.FILE_ADDED, { file: c }), (o = t == null ? void 0 : t.onFileAdded) == null || o.call(t, c);
|
|
4414
4501
|
}
|
|
4415
4502
|
this._activeConnector = null, this._store.getState().queueConfig.autoProceed && this.upload();
|
|
4416
4503
|
}, this._onConnectorClose = () => {
|
|
@@ -4418,8 +4505,8 @@ const y = (S = class extends z {
|
|
|
4418
4505
|
}, this._onConnectorBackdropClick = (e) => {
|
|
4419
4506
|
e.target === e.currentTarget && (this._activeConnector = null);
|
|
4420
4507
|
}, this._onPrimaryAction = () => {
|
|
4421
|
-
var e, t;
|
|
4422
|
-
this._dispatchPublic(v.COMPLETE_ACTION, {}), ((e = this.config) == null ? void 0 : e.mode) === "modal" ? this.close() : ((
|
|
4508
|
+
var e, t, i, r, o;
|
|
4509
|
+
this._dispatchPublic(v.COMPLETE_ACTION, {}), (i = (t = (e = this.config) == null ? void 0 : e.callbacks) == null ? void 0 : t.onCompleteAction) == null || i.call(t), ((r = this.config) == null ? void 0 : r.mode) === "modal" ? this.close() : ((o = this.config) == null ? void 0 : o.clearOnComplete) !== !1 && this._onClearAll();
|
|
4423
4510
|
}, this._onInlineDismiss = () => {
|
|
4424
4511
|
var e, t, i;
|
|
4425
4512
|
(i = (t = (e = this.config) == null ? void 0 : e.callbacks) == null ? void 0 : t.onCancel) == null || i.call(t), this._dispatchPublic(v.CANCEL, {});
|
|
@@ -4480,7 +4567,7 @@ const y = (S = class extends z {
|
|
|
4480
4567
|
(Math.abs(i) > 3 || Math.abs(r) > 3) && (this._fsDragDidMove = !0), this._fsPanX = this._fsPanStartX + i, this._fsPanY = this._fsPanStartY + r, this.requestUpdate(), e.preventDefault();
|
|
4481
4568
|
}, this._onFsClose = (e) => {
|
|
4482
4569
|
e == null || e.stopPropagation(), this._fullscreenPreviewUrl = null, this._fullscreenVideoFile = null, this._fullscreenZoomed = !1, this._fsPanX = 0, this._fsPanY = 0;
|
|
4483
|
-
}, this._store = je(), this._storeCtrl = new
|
|
4570
|
+
}, this._store = je(), this._storeCtrl = new Te(this, this._store);
|
|
4484
4571
|
}
|
|
4485
4572
|
// --- Public API ---
|
|
4486
4573
|
/** Open the uploader (modal mode). */
|
|
@@ -4491,7 +4578,7 @@ const y = (S = class extends z {
|
|
|
4491
4578
|
/** Close the uploader (modal mode). Optionally clears all files (controlled by clearOnClose config). */
|
|
4492
4579
|
close() {
|
|
4493
4580
|
var e, t, i, r;
|
|
4494
|
-
this._isOpen && (this._isOpen = !1, ((e = this.config) == null ? void 0 : e.clearOnClose) !== !1 && this._onClearAll(), this._previewFileId = null, (r = (i = (t = this.config) == null ? void 0 : t.callbacks) == null ? void 0 : i.onClose) == null || r.call(i), this._dispatchPublic(v.CLOSE, {}), this.requestUpdate());
|
|
4581
|
+
this._isOpen && (this._isOpen = !1, this._closeOnCompleteTimer && (clearTimeout(this._closeOnCompleteTimer), this._closeOnCompleteTimer = null), ((e = this.config) == null ? void 0 : e.clearOnClose) !== !1 && this._onClearAll(), this._previewFileId = null, (r = (i = (t = this.config) == null ? void 0 : t.callbacks) == null ? void 0 : i.onClose) == null || r.call(i), this._dispatchPublic(v.CLOSE, {}), this.requestUpdate());
|
|
4495
4582
|
}
|
|
4496
4583
|
/** Start uploading all queued files. */
|
|
4497
4584
|
upload() {
|
|
@@ -4501,7 +4588,7 @@ const y = (S = class extends z {
|
|
|
4501
4588
|
return;
|
|
4502
4589
|
}
|
|
4503
4590
|
const e = [...this._store.getState().files.values()].filter(
|
|
4504
|
-
(
|
|
4591
|
+
(c) => c.status === "idle" || c.status === "queued"
|
|
4505
4592
|
);
|
|
4506
4593
|
if ((o = (r = this.config) == null ? void 0 : r.callbacks) != null && o.onBeforeUpload && this.config.callbacks.onBeforeUpload(e) === !1)
|
|
4507
4594
|
return;
|
|
@@ -4547,7 +4634,7 @@ const y = (S = class extends z {
|
|
|
4547
4634
|
/** Update metadata and/or tags for a single file. */
|
|
4548
4635
|
updateFileMeta(e, t, i) {
|
|
4549
4636
|
const r = this._store.getState().files, o = r.get(e);
|
|
4550
|
-
if (!o || !
|
|
4637
|
+
if (!o || !E._MODIFIABLE_STATUSES.has(o.status)) return;
|
|
4551
4638
|
const s = new Map(r);
|
|
4552
4639
|
s.set(e, {
|
|
4553
4640
|
...o,
|
|
@@ -4561,7 +4648,7 @@ const y = (S = class extends z {
|
|
|
4561
4648
|
let r = !1;
|
|
4562
4649
|
for (const { fileId: o, meta: s, tags: n } of e) {
|
|
4563
4650
|
const d = t.get(o);
|
|
4564
|
-
!d || !
|
|
4651
|
+
!d || !E._MODIFIABLE_STATUSES.has(d.status) || (i.set(o, {
|
|
4565
4652
|
...d,
|
|
4566
4653
|
meta: s != null ? { ...d.meta, ...s } : d.meta,
|
|
4567
4654
|
tags: n ?? d.tags
|
|
@@ -4589,6 +4676,7 @@ const y = (S = class extends z {
|
|
|
4589
4676
|
[data-sfx-upload-float] .float-icon { width:28px; height:28px; border-radius:6px; background:#eff6ff; color:#2563eb; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
|
|
4590
4677
|
[data-sfx-upload-float] .float-icon svg { width:14px; height:14px; }
|
|
4591
4678
|
[data-sfx-upload-float] .float-icon.done { background:#f0fdf4; color:#22c55e; }
|
|
4679
|
+
[data-sfx-upload-float] .float-icon.warn { background:#fffbeb; color:#f59e0b; }
|
|
4592
4680
|
[data-sfx-upload-float] .float-title { font-size:13px; font-weight:600; color:#1e293b; }
|
|
4593
4681
|
[data-sfx-upload-float] .float-subtitle { font-size:11px; color:#94a3b8; }
|
|
4594
4682
|
[data-sfx-upload-float] .float-actions { display:flex; gap:4px; }
|
|
@@ -4600,9 +4688,11 @@ const y = (S = class extends z {
|
|
|
4600
4688
|
[data-sfx-upload-float] .float-progress-label { font-size:12px; color:#475569; }
|
|
4601
4689
|
[data-sfx-upload-float] .float-progress-pct { font-size:12px; font-weight:600; color:#2563eb; }
|
|
4602
4690
|
[data-sfx-upload-float] .float-progress-pct.done { color:#22c55e; }
|
|
4691
|
+
[data-sfx-upload-float] .float-progress-pct.warn { color:#f59e0b; }
|
|
4603
4692
|
[data-sfx-upload-float] .float-bar { height:4px; background:#e8edf5; border-radius:2px; overflow:hidden; }
|
|
4604
4693
|
[data-sfx-upload-float] .float-bar-fill { height:100%; background:#2563eb; border-radius:2px; transition:width .3s ease; }
|
|
4605
4694
|
[data-sfx-upload-float] .float-bar-fill.done { background:#22c55e; }
|
|
4695
|
+
[data-sfx-upload-float] .float-bar-fill.warn { background:#f59e0b; }
|
|
4606
4696
|
[data-sfx-upload-float] .float-items { max-height:200px; overflow-y:auto; }
|
|
4607
4697
|
[data-sfx-upload-float] .float-item { display:flex; align-items:center; gap:10px; padding:8px 14px; border-bottom:1px solid #f1f5f9; }
|
|
4608
4698
|
[data-sfx-upload-float] .float-item:last-child { border-bottom:none; }
|
|
@@ -4614,13 +4704,14 @@ const y = (S = class extends z {
|
|
|
4614
4704
|
[data-sfx-upload-float] .float-item-done { width:18px; height:18px; border-radius:50%; background:#f0fdf4; color:#22c55e; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
|
|
4615
4705
|
[data-sfx-upload-float] .float-item-done svg { width:12px; height:12px; }
|
|
4616
4706
|
[data-sfx-upload-float] .float-item-spinner { width:16px; height:16px; border:2px solid #e8edf5; border-top-color:#2563eb; border-radius:50%; animation:sfxSpin .8s linear infinite; flex-shrink:0; }
|
|
4617
|
-
[data-sfx-upload-float] .float-item-error { color:#ef4444; width:16px; height:16px; flex-shrink:0; }
|
|
4707
|
+
[data-sfx-upload-float] .float-item-error { color:#ef4444; width:16px; height:16px; flex-shrink:0; cursor:help; }
|
|
4618
4708
|
[data-sfx-upload-float] .float-collapsed { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; width:320px; border-radius:12px; }
|
|
4619
4709
|
[data-sfx-upload-float] .float-collapsed-left { display:flex; align-items:center; gap:8px; }
|
|
4620
4710
|
[data-sfx-upload-float] .float-collapsed-spinner { width:18px; height:18px; border:2.5px solid #e8edf5; border-top-color:#2563eb; border-radius:50%; animation:sfxSpin .8s linear infinite; flex-shrink:0; }
|
|
4621
4711
|
[data-sfx-upload-float] .float-collapsed-icon { width:18px; height:18px; flex-shrink:0; }
|
|
4622
4712
|
[data-sfx-upload-float] .float-collapsed-icon svg { width:18px; height:18px; }
|
|
4623
4713
|
[data-sfx-upload-float] .float-collapsed-icon.done { color:#22c55e; }
|
|
4714
|
+
[data-sfx-upload-float] .float-collapsed-icon.warn { color:#f59e0b; }
|
|
4624
4715
|
[data-sfx-upload-float] .float-collapsed-text { font-size:13px; font-weight:500; color:#1e293b; white-space:nowrap; }
|
|
4625
4716
|
[data-sfx-upload-float] .float-collapsed-pct { font-size:13px; font-weight:600; color:#2563eb; }
|
|
4626
4717
|
[data-sfx-upload-float] .float-collapsed-actions { display:flex; gap:4px; }
|
|
@@ -4633,7 +4724,7 @@ const y = (S = class extends z {
|
|
|
4633
4724
|
}
|
|
4634
4725
|
_updateFloatingPortal() {
|
|
4635
4726
|
const e = [...this._storeCtrl.state.files.values()];
|
|
4636
|
-
this._isMinimized && e.length > 0 ? (this._injectFloatStyles(), this._portalContainer || (this._portalContainer = document.createElement("div"), this._portalContainer.setAttribute("data-sfx-upload-float", ""), document.body.appendChild(this._portalContainer)),
|
|
4727
|
+
this._isMinimized && e.length > 0 ? (this._injectFloatStyles(), this._portalContainer || (this._portalContainer = document.createElement("div"), this._portalContainer.setAttribute("data-sfx-upload-float", ""), document.body.appendChild(this._portalContainer)), ke(this._renderFloatingPill(e), this._portalContainer)) : this._portalContainer && (ke(p, this._portalContainer), this._portalContainer.remove(), this._portalContainer = null);
|
|
4637
4728
|
}
|
|
4638
4729
|
connectedCallback() {
|
|
4639
4730
|
super.connectedCallback(), document.addEventListener("keydown", this._onKeyDown), this._prevStoreState = this._store.getState(), this._unsubStoreEvents = this._store.subscribe(() => this._onStoreChange());
|
|
@@ -4642,7 +4733,7 @@ const y = (S = class extends z {
|
|
|
4642
4733
|
var e, t, i, r;
|
|
4643
4734
|
super.disconnectedCallback(), document.removeEventListener("keydown", this._onKeyDown), (e = this._unsubStoreEvents) == null || e.call(this), this._unsubStoreEvents = null, this._prevStoreState = null, (t = this._portalContainer) == null || t.remove(), this._portalContainer = null, document.querySelector("[data-sfx-upload-float]") || (i = document.querySelector("style[data-sfx-upload-float-styles]")) == null || i.remove(), this._revokeVideoBlobUrls();
|
|
4644
4735
|
for (const o of this._rejectedTimers.values()) clearTimeout(o);
|
|
4645
|
-
this._rejectedTimers.clear();
|
|
4736
|
+
this._rejectedTimers.clear(), this._closeOnCompleteTimer && (clearTimeout(this._closeOnCompleteTimer), this._closeOnCompleteTimer = null);
|
|
4646
4737
|
for (const o of this._store.getState().files.values())
|
|
4647
4738
|
o.previewUrl && URL.revokeObjectURL(o.previewUrl);
|
|
4648
4739
|
(r = this._engine) == null || r.destroy(), this._engine = null;
|
|
@@ -4675,7 +4766,7 @@ const y = (S = class extends z {
|
|
|
4675
4766
|
}
|
|
4676
4767
|
const i = ++this._authResolveId;
|
|
4677
4768
|
try {
|
|
4678
|
-
const s = await
|
|
4769
|
+
const s = await qe(t);
|
|
4679
4770
|
if (i !== this._authResolveId) return;
|
|
4680
4771
|
this._apiBase = s.apiBase, this._authHeaders = s.headers, this._ensureEngine(), (o = this._engine) == null || o.updateConfig({
|
|
4681
4772
|
apiBase: this._apiBase,
|
|
@@ -4687,7 +4778,7 @@ const y = (S = class extends z {
|
|
|
4687
4778
|
}
|
|
4688
4779
|
}
|
|
4689
4780
|
_ensureEngine() {
|
|
4690
|
-
!this._engine && this._apiBase && this._authHeaders && (this._engine = new
|
|
4781
|
+
!this._engine && this._apiBase && this._authHeaders && (this._engine = new He(this._store, {
|
|
4691
4782
|
apiBase: this._apiBase,
|
|
4692
4783
|
authHeaders: this._authHeaders
|
|
4693
4784
|
}), this._engine.start());
|
|
@@ -4703,31 +4794,31 @@ const y = (S = class extends z {
|
|
|
4703
4794
|
* for file status transitions.
|
|
4704
4795
|
*/
|
|
4705
4796
|
_onStoreChange() {
|
|
4706
|
-
var r, o, s, n, d,
|
|
4797
|
+
var r, o, s, n, d, c, u, g;
|
|
4707
4798
|
const e = this._store.getState(), t = this._prevStoreState;
|
|
4708
4799
|
if (this._prevStoreState = e, !t) return;
|
|
4709
4800
|
const i = (r = this.config) == null ? void 0 : r.callbacks;
|
|
4710
|
-
for (const [h,
|
|
4711
|
-
const
|
|
4712
|
-
if (
|
|
4713
|
-
if (
|
|
4714
|
-
switch (
|
|
4801
|
+
for (const [h, f] of e.files) {
|
|
4802
|
+
const m = t.files.get(h);
|
|
4803
|
+
if (m) {
|
|
4804
|
+
if (m.status !== f.status)
|
|
4805
|
+
switch (f.status) {
|
|
4715
4806
|
case "uploading":
|
|
4716
4807
|
break;
|
|
4717
4808
|
case "complete":
|
|
4718
|
-
|
|
4809
|
+
f.response && (this._dispatchPublic(v.UPLOAD_COMPLETE, { file: f, response: f.response }), (o = i == null ? void 0 : i.onUploadComplete) == null || o.call(i, f, f.response));
|
|
4719
4810
|
break;
|
|
4720
4811
|
case "error":
|
|
4721
4812
|
case "failed": {
|
|
4722
|
-
const
|
|
4723
|
-
this._dispatchPublic(v.UPLOAD_ERROR, { file:
|
|
4813
|
+
const _ = new Error(f.error ?? "Upload failed");
|
|
4814
|
+
this._dispatchPublic(v.UPLOAD_ERROR, { file: f, error: _ }), (s = i == null ? void 0 : i.onUploadError) == null || s.call(i, f, _);
|
|
4724
4815
|
break;
|
|
4725
4816
|
}
|
|
4726
4817
|
case "retrying":
|
|
4727
|
-
this._dispatchPublic(v.UPLOAD_RETRY, { file:
|
|
4818
|
+
this._dispatchPublic(v.UPLOAD_RETRY, { file: f, attempt: f.retryCount }), (n = i == null ? void 0 : i.onUploadRetry) == null || n.call(i, f, f.retryCount);
|
|
4728
4819
|
break;
|
|
4729
4820
|
}
|
|
4730
|
-
|
|
4821
|
+
f.status === "uploading" && m.progress !== f.progress && (this._dispatchPublic(v.UPLOAD_PROGRESS, { file: f, progress: f.progress, speed: f.speed }), (d = i == null ? void 0 : i.onUploadProgress) == null || d.call(i, f, f.progress, f.speed));
|
|
4731
4822
|
}
|
|
4732
4823
|
}
|
|
4733
4824
|
if (e.totalProgress !== t.totalProgress || e.totalSpeed !== t.totalSpeed) {
|
|
@@ -4736,13 +4827,21 @@ const y = (S = class extends z {
|
|
|
4736
4827
|
percentage: e.totalProgress,
|
|
4737
4828
|
speed: e.totalSpeed,
|
|
4738
4829
|
eta: h
|
|
4739
|
-
}), (
|
|
4830
|
+
}), (c = i == null ? void 0 : i.onTotalProgress) == null || c.call(i, e.totalProgress, e.totalSpeed, h);
|
|
4740
4831
|
}
|
|
4741
4832
|
if (t.isUploading && !e.isUploading) {
|
|
4742
4833
|
const h = [...e.files.values()];
|
|
4743
|
-
if (!h.some((
|
|
4744
|
-
const
|
|
4745
|
-
this._dispatchPublic(v.ALL_COMPLETE, { successful:
|
|
4834
|
+
if (!h.some((m) => m.status === "cancelled")) {
|
|
4835
|
+
const m = h.filter((y) => y.status === "complete"), _ = h.filter((y) => y.status === "failed" || y.status === "error");
|
|
4836
|
+
this._dispatchPublic(v.ALL_COMPLETE, { successful: m, failed: _ }), (u = i == null ? void 0 : i.onAllComplete) == null || u.call(i, m, _);
|
|
4837
|
+
const w = (g = this.config) == null ? void 0 : g.closeOnComplete;
|
|
4838
|
+
if (w) {
|
|
4839
|
+
const y = typeof w == "number" ? w : 1500;
|
|
4840
|
+
this._closeOnCompleteTimer = setTimeout(() => {
|
|
4841
|
+
var k, D, _e;
|
|
4842
|
+
this._closeOnCompleteTimer = null, this._phase === "complete" && (this._dispatchPublic(v.COMPLETE_ACTION, {}), (_e = (D = (k = this.config) == null ? void 0 : k.callbacks) == null ? void 0 : D.onCompleteAction) == null || _e.call(D), this.close());
|
|
4843
|
+
}, y);
|
|
4844
|
+
}
|
|
4746
4845
|
}
|
|
4747
4846
|
}
|
|
4748
4847
|
}
|
|
@@ -4752,14 +4851,14 @@ const y = (S = class extends z {
|
|
|
4752
4851
|
if (e === this._cachedSourcesConfig) return this._cachedSources;
|
|
4753
4852
|
if (this._cachedSourcesConfig = e, !e)
|
|
4754
4853
|
return this._cachedSources = X, this._cachedSources;
|
|
4755
|
-
const t = e.providers.length > 0 ?
|
|
4756
|
-
for (const
|
|
4757
|
-
if (!s.has(
|
|
4758
|
-
if (
|
|
4759
|
-
console.warn(`[sfx-uploader] Custom source id "${
|
|
4854
|
+
const t = e.providers.length > 0 ? Je(e.providers) : [], i = e.customSources ?? [], r = X.filter((c) => c.id === "device" || c.id === "url"), o = X.filter((c) => c.id !== "device" && c.id !== "url"), s = /* @__PURE__ */ new Set(), n = [];
|
|
4855
|
+
for (const c of [...r, ...t, ...o, ...i])
|
|
4856
|
+
if (!s.has(c.id)) {
|
|
4857
|
+
if (E._RESERVED_IDS.has(c.id) && c.onActivate) {
|
|
4858
|
+
console.warn(`[sfx-uploader] Custom source id "${c.id}" conflicts with a built-in source and was skipped.`);
|
|
4760
4859
|
continue;
|
|
4761
4860
|
}
|
|
4762
|
-
s.add(
|
|
4861
|
+
s.add(c.id), n.push(c);
|
|
4763
4862
|
}
|
|
4764
4863
|
return this._cachedSources = n, this._cachedSources;
|
|
4765
4864
|
}
|
|
@@ -4769,29 +4868,29 @@ const y = (S = class extends z {
|
|
|
4769
4868
|
if (t.length === 0) return "empty";
|
|
4770
4869
|
if (e.isUploading) return "uploading";
|
|
4771
4870
|
const i = /* @__PURE__ */ new Set(["complete", "rejected", "cancelled", "failed"]);
|
|
4772
|
-
return t.every((r) => i.has(r.status)) && t.some((r) => r.status === "complete") ? "complete" : "ready";
|
|
4871
|
+
return t.every((r) => i.has(r.status)) && t.some((r) => r.status === "complete" || r.status === "failed") ? "complete" : "ready";
|
|
4773
4872
|
}
|
|
4774
4873
|
// --- File handling ---
|
|
4775
4874
|
_processIncomingFiles(e) {
|
|
4776
4875
|
var i, r, o, s;
|
|
4777
4876
|
const t = (i = this.config) == null ? void 0 : i.callbacks;
|
|
4778
4877
|
for (const n of e) {
|
|
4779
|
-
const d = this._store.getState(),
|
|
4780
|
-
if (
|
|
4781
|
-
const
|
|
4782
|
-
id:
|
|
4878
|
+
const d = this._store.getState(), c = Ze(n, d.restrictions, d.files);
|
|
4879
|
+
if (c) {
|
|
4880
|
+
const h = n.type.startsWith("image/") ? URL.createObjectURL(n) : null, f = {
|
|
4881
|
+
id: H(),
|
|
4783
4882
|
status: "rejected",
|
|
4784
4883
|
file: n,
|
|
4785
4884
|
remoteUrl: null,
|
|
4786
4885
|
name: n.name,
|
|
4787
4886
|
size: n.size,
|
|
4788
4887
|
type: n.type,
|
|
4789
|
-
previewUrl:
|
|
4888
|
+
previewUrl: h,
|
|
4790
4889
|
duration: null,
|
|
4791
4890
|
progress: 0,
|
|
4792
4891
|
speed: 0,
|
|
4793
4892
|
bytesUploaded: 0,
|
|
4794
|
-
error:
|
|
4893
|
+
error: c,
|
|
4795
4894
|
retryCount: 0,
|
|
4796
4895
|
response: null,
|
|
4797
4896
|
addedAt: Date.now(),
|
|
@@ -4799,22 +4898,22 @@ const y = (S = class extends z {
|
|
|
4799
4898
|
tags: [],
|
|
4800
4899
|
remoteInfo: null
|
|
4801
4900
|
};
|
|
4802
|
-
|
|
4803
|
-
const
|
|
4804
|
-
if (
|
|
4805
|
-
const
|
|
4806
|
-
this._rejectedTimers.delete(
|
|
4807
|
-
const
|
|
4808
|
-
|
|
4809
|
-
},
|
|
4810
|
-
this._rejectedTimers.set(
|
|
4901
|
+
I(this._store, f), this._dispatchPublic(v.FILE_REJECTED, { file: f, reason: c }), (r = t == null ? void 0 : t.onFileRejected) == null || r.call(t, f, c);
|
|
4902
|
+
const m = (o = this.config) == null ? void 0 : o.rejectedFileAutoRemoveDelay, _ = m === !1 || m === 0 || m === void 0 ? 0 : m;
|
|
4903
|
+
if (_ > 0) {
|
|
4904
|
+
const w = f.id, y = setTimeout(() => {
|
|
4905
|
+
this._rejectedTimers.delete(w);
|
|
4906
|
+
const k = this._store.getState().files.get(w);
|
|
4907
|
+
k && k.status === "rejected" && Ce(this._store, w);
|
|
4908
|
+
}, _);
|
|
4909
|
+
this._rejectedTimers.set(w, y);
|
|
4811
4910
|
}
|
|
4812
4911
|
continue;
|
|
4813
4912
|
}
|
|
4814
4913
|
let u = null;
|
|
4815
4914
|
n.type.startsWith("image/") && (u = URL.createObjectURL(n));
|
|
4816
|
-
const
|
|
4817
|
-
id:
|
|
4915
|
+
const g = {
|
|
4916
|
+
id: H(),
|
|
4818
4917
|
status: "idle",
|
|
4819
4918
|
file: n,
|
|
4820
4919
|
remoteUrl: null,
|
|
@@ -4834,26 +4933,26 @@ const y = (S = class extends z {
|
|
|
4834
4933
|
tags: [],
|
|
4835
4934
|
remoteInfo: null
|
|
4836
4935
|
};
|
|
4837
|
-
if (
|
|
4838
|
-
|
|
4839
|
-
if (!
|
|
4840
|
-
const
|
|
4841
|
-
if (
|
|
4842
|
-
const
|
|
4843
|
-
|
|
4936
|
+
if (I(this._store, g), this._dispatchPublic(v.FILE_ADDED, { file: g }), (s = t == null ? void 0 : t.onFileAdded) == null || s.call(t, g), n.type.startsWith("video/")) {
|
|
4937
|
+
Ke(n).then((f) => {
|
|
4938
|
+
if (!f) return;
|
|
4939
|
+
const m = this._store.getState(), _ = m.files.get(g.id);
|
|
4940
|
+
if (_) {
|
|
4941
|
+
const w = new Map(m.files);
|
|
4942
|
+
w.set(g.id, { ..._, previewUrl: f }), this._store.setState({ files: w });
|
|
4844
4943
|
} else
|
|
4845
|
-
URL.revokeObjectURL(
|
|
4944
|
+
URL.revokeObjectURL(f);
|
|
4846
4945
|
});
|
|
4847
|
-
const
|
|
4848
|
-
|
|
4849
|
-
URL.revokeObjectURL(
|
|
4850
|
-
},
|
|
4851
|
-
const
|
|
4852
|
-
if (URL.revokeObjectURL(
|
|
4853
|
-
const
|
|
4854
|
-
if (
|
|
4855
|
-
const
|
|
4856
|
-
|
|
4946
|
+
const h = document.createElement("video");
|
|
4947
|
+
h.preload = "metadata", h.src = URL.createObjectURL(n), h.onerror = () => {
|
|
4948
|
+
URL.revokeObjectURL(h.src);
|
|
4949
|
+
}, h.onloadedmetadata = () => {
|
|
4950
|
+
const f = h.duration;
|
|
4951
|
+
if (URL.revokeObjectURL(h.src), !isFinite(f)) return;
|
|
4952
|
+
const m = this._store.getState(), _ = m.files.get(g.id);
|
|
4953
|
+
if (_) {
|
|
4954
|
+
const w = new Map(m.files);
|
|
4955
|
+
w.set(g.id, { ..._, duration: f }), this._store.setState({ files: w });
|
|
4857
4956
|
}
|
|
4858
4957
|
};
|
|
4859
4958
|
}
|
|
@@ -4866,14 +4965,14 @@ const y = (S = class extends z {
|
|
|
4866
4965
|
if (!t) return;
|
|
4867
4966
|
const i = { ...t };
|
|
4868
4967
|
if ((this._fullscreenPreviewUrl && this._fullscreenPreviewUrl === t.previewUrl || this._fullscreenVideoFile && this._fullscreenVideoFile === t.file) && (this._fullscreenPreviewUrl = null, this._fullscreenVideoFile = null), t.previewUrl && URL.revokeObjectURL(t.previewUrl), t.file) {
|
|
4869
|
-
const
|
|
4870
|
-
|
|
4968
|
+
const c = this._videoBlobUrls.get(t.file);
|
|
4969
|
+
c && (URL.revokeObjectURL(c), this._videoBlobUrls.delete(t.file));
|
|
4871
4970
|
}
|
|
4872
|
-
(t.status === "uploading" || t.status === "queued" || t.status === "retrying") && ((o = this._engine) == null || o.cancelFile(e)),
|
|
4971
|
+
(t.status === "uploading" || t.status === "queued" || t.status === "retrying") && ((o = this._engine) == null || o.cancelFile(e)), Ce(this._store, e), this._dimCache.delete(e);
|
|
4873
4972
|
const r = this._rejectedTimers.get(e);
|
|
4874
4973
|
if (r && (clearTimeout(r), this._rejectedTimers.delete(e)), this._previewFileId === e) {
|
|
4875
|
-
const
|
|
4876
|
-
this._previewFileId =
|
|
4974
|
+
const c = [...this._store.getState().files.values()];
|
|
4975
|
+
this._previewFileId = c.length > 0 ? c[0].id : null;
|
|
4877
4976
|
}
|
|
4878
4977
|
this._dispatchPublic(v.FILE_REMOVED, { file: i }), (d = (n = (s = this.config) == null ? void 0 : s.callbacks) == null ? void 0 : n.onFileRemoved) == null || d.call(n, i);
|
|
4879
4978
|
}
|
|
@@ -4889,7 +4988,7 @@ const y = (S = class extends z {
|
|
|
4889
4988
|
${this._renderBody()}
|
|
4890
4989
|
</div>
|
|
4891
4990
|
</div>
|
|
4892
|
-
` :
|
|
4991
|
+
` : p}
|
|
4893
4992
|
` : l`
|
|
4894
4993
|
<div class="inline">
|
|
4895
4994
|
${this._renderHeader()}
|
|
@@ -4899,9 +4998,9 @@ const y = (S = class extends z {
|
|
|
4899
4998
|
}
|
|
4900
4999
|
_renderHeader() {
|
|
4901
5000
|
var s, n;
|
|
4902
|
-
if (this._phase === "complete") return
|
|
5001
|
+
if (this._phase === "complete") return p;
|
|
4903
5002
|
if (this._phase === "uploading") {
|
|
4904
|
-
const d = this._storeCtrl.state,
|
|
5003
|
+
const d = this._storeCtrl.state, c = [...d.files.values()], u = c.filter((h) => h.status === "complete").length, g = d.totalSpeed > 0 ? (d.totalBytes - d.totalBytesUploaded) / d.totalSpeed : 0;
|
|
4905
5004
|
return l`
|
|
4906
5005
|
<div class="header upload-header">
|
|
4907
5006
|
<div class="float-header-left">
|
|
@@ -4909,8 +5008,8 @@ const y = (S = class extends z {
|
|
|
4909
5008
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><polyline points="16 16 12 12 8 16"/><line x1="12" y1="12" x2="12" y2="21"/><path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3"/></svg>
|
|
4910
5009
|
</div>
|
|
4911
5010
|
<div>
|
|
4912
|
-
<div class="float-title">Uploading ${
|
|
4913
|
-
<div class="float-subtitle">${u} of ${
|
|
5011
|
+
<div class="float-title">Uploading ${c.length} ${c.length === 1 ? "file" : "files"}</div>
|
|
5012
|
+
<div class="float-subtitle">${u} of ${c.length}${g > 0 ? ` · ~${ie(g)} left` : ""}</div>
|
|
4914
5013
|
</div>
|
|
4915
5014
|
</div>
|
|
4916
5015
|
</div>
|
|
@@ -4920,12 +5019,12 @@ const y = (S = class extends z {
|
|
|
4920
5019
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
4921
5020
|
<polyline points="15 18 9 12 15 6"/>
|
|
4922
5021
|
</svg>
|
|
4923
|
-
</button>` :
|
|
5022
|
+
</button>` : p, o = t === "close" ? l`<button class="header-btn header-btn-close" aria-label="Close" @click=${i}>
|
|
4924
5023
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
4925
5024
|
<line x1="18" y1="6" x2="6" y2="18" />
|
|
4926
5025
|
<line x1="6" y1="6" x2="18" y2="18" />
|
|
4927
5026
|
</svg>
|
|
4928
|
-
</button>` :
|
|
5027
|
+
</button>` : p;
|
|
4929
5028
|
return l`
|
|
4930
5029
|
<div class="header">
|
|
4931
5030
|
${r}
|
|
@@ -4936,7 +5035,7 @@ const y = (S = class extends z {
|
|
|
4936
5035
|
<line x1="12" y1="12" x2="12" y2="21" />
|
|
4937
5036
|
<path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3" />
|
|
4938
5037
|
</svg>
|
|
4939
|
-
</div>` :
|
|
5038
|
+
</div>` : p}
|
|
4940
5039
|
<div class="header-title">Upload Files</div>
|
|
4941
5040
|
${o}
|
|
4942
5041
|
</div>
|
|
@@ -4954,28 +5053,29 @@ const y = (S = class extends z {
|
|
|
4954
5053
|
}) : Promise.resolve(null);
|
|
4955
5054
|
}
|
|
4956
5055
|
_renderUploadOverlay(e) {
|
|
4957
|
-
|
|
5056
|
+
var s;
|
|
5057
|
+
const t = this._storeCtrl.state, i = Math.round(t.totalProgress ?? 0), r = e.filter((n) => n.status === "complete").length, o = t.totalSpeed > 0 ? (t.totalBytes - t.totalBytesUploaded) / t.totalSpeed : 0;
|
|
4958
5058
|
return l`
|
|
4959
5059
|
<div class="upload-overlay">
|
|
4960
5060
|
<div class="upload-overlay-spinner"></div>
|
|
4961
5061
|
<div class="upload-overlay-percent">${i}%</div>
|
|
4962
5062
|
<div class="upload-overlay-title">Uploading ${e.length} ${e.length === 1 ? "file" : "files"}</div>
|
|
4963
|
-
<div class="upload-overlay-subtitle">${r} of ${e.length} complete${o > 0 ? l` · ~${ie(o)} left` :
|
|
5063
|
+
<div class="upload-overlay-subtitle">${r} of ${e.length} complete${o > 0 ? l` · ~${ie(o)} left` : p}</div>
|
|
4964
5064
|
<div class="upload-overlay-bar">
|
|
4965
5065
|
<div class="upload-overlay-bar-fill" style="width:${i}%"></div>
|
|
4966
5066
|
</div>
|
|
4967
|
-
|
|
5067
|
+
${(s = this.config) != null && s.minimizeOnUpload ? l`<button class="upload-overlay-minimize" @click=${this._onMinimize}>Minimize & continue in background</button>` : p}
|
|
4968
5068
|
</div>
|
|
4969
5069
|
`;
|
|
4970
5070
|
}
|
|
4971
5071
|
_renderFloatingPill(e) {
|
|
4972
|
-
const t = this._storeCtrl.state, i = Math.round(t.totalProgress ?? 0), r = this._phase === "complete", o = e.filter((
|
|
5072
|
+
const t = this._storeCtrl.state, i = Math.round(t.totalProgress ?? 0), r = this._phase === "complete", o = e.filter((d) => d.status === "complete").length, s = e.filter((d) => d.status === "failed").length, n = t.totalSpeed > 0 ? (t.totalBytes - t.totalBytesUploaded) / t.totalSpeed : 0;
|
|
4973
5073
|
return this._isPillExpanded === !1 ? l`
|
|
4974
5074
|
<div class="upload-float float-collapsed">
|
|
4975
5075
|
<div class="float-collapsed-left">
|
|
4976
|
-
${r ? l`<div class="float-collapsed-icon done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg></div>` : l`<div class="float-collapsed-spinner"></div>`}
|
|
4977
|
-
<span class="float-collapsed-text">${r ? "Upload complete" : `Uploading ${e.length} ${e.length === 1 ? "file" : "files"}`}</span>
|
|
4978
|
-
${r ?
|
|
5076
|
+
${r ? s > 0 ? l`<div class="float-collapsed-icon warn"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></div>` : l`<div class="float-collapsed-icon done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg></div>` : l`<div class="float-collapsed-spinner"></div>`}
|
|
5077
|
+
<span class="float-collapsed-text">${r ? s > 0 ? `${s} ${s === 1 ? "file" : "files"} not uploaded` : "Upload complete" : `Uploading ${e.length} ${e.length === 1 ? "file" : "files"}`}</span>
|
|
5078
|
+
${r ? p : l`<span class="float-collapsed-pct">${i}%</span>`}
|
|
4979
5079
|
</div>
|
|
4980
5080
|
<div class="float-collapsed-actions">
|
|
4981
5081
|
<button title="Expand" @click=${this._onPillClick}>
|
|
@@ -4990,12 +5090,12 @@ const y = (S = class extends z {
|
|
|
4990
5090
|
<div class="upload-float">
|
|
4991
5091
|
<div class="float-header">
|
|
4992
5092
|
<div class="float-header-left">
|
|
4993
|
-
<div class="float-icon ${r ? "done" : ""}">
|
|
4994
|
-
${r ? l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg>` : l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><polyline points="16 16 12 12 8 16"/><line x1="12" y1="12" x2="12" y2="21"/><path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3"/></svg>`}
|
|
5093
|
+
<div class="float-icon ${r ? s > 0 ? "warn" : "done" : ""}">
|
|
5094
|
+
${r ? s > 0 ? l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>` : l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg>` : l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><polyline points="16 16 12 12 8 16"/><line x1="12" y1="12" x2="12" y2="21"/><path d="M20.39 18.39A5 5 0 0018 9h-1.26A8 8 0 103 16.3"/></svg>`}
|
|
4995
5095
|
</div>
|
|
4996
5096
|
<div>
|
|
4997
|
-
<div class="float-title">${r ? "Upload complete" : `Uploading ${e.length} ${e.length === 1 ? "file" : "files"}`}</div>
|
|
4998
|
-
<div class="float-subtitle">${r ? `${o} ${o === 1 ? "file" : "files"} uploaded` : `${o} of ${e.length}${
|
|
5097
|
+
<div class="float-title">${r ? s > 0 ? `${s} ${s === 1 ? "file" : "files"} not uploaded` : "Upload complete" : `Uploading ${e.length} ${e.length === 1 ? "file" : "files"}`}</div>
|
|
5098
|
+
<div class="float-subtitle">${r ? `${o} ${o === 1 ? "file" : "files"} uploaded${s > 0 ? `, ${s} failed` : ""}` : `${o} of ${e.length}${n > 0 ? ` · ~${ie(n)} left` : ""}`}</div>
|
|
4999
5099
|
</div>
|
|
5000
5100
|
</div>
|
|
5001
5101
|
<div class="float-actions">
|
|
@@ -5010,22 +5110,22 @@ const y = (S = class extends z {
|
|
|
5010
5110
|
<div class="float-progress">
|
|
5011
5111
|
<div class="float-progress-top">
|
|
5012
5112
|
<span class="float-progress-label">Overall progress</span>
|
|
5013
|
-
<span class="float-progress-pct ${r ? "done" : ""}">${r ? "Done" : `${i}%`}</span>
|
|
5113
|
+
<span class="float-progress-pct ${r ? s > 0 ? "warn" : "done" : ""}">${r ? "Done" : `${i}%`}</span>
|
|
5014
5114
|
</div>
|
|
5015
|
-
<div class="float-bar"><div class="float-bar-fill ${r ? "done" : ""}" style="width:${r ? 100 : i}%"></div></div>
|
|
5115
|
+
<div class="float-bar"><div class="float-bar-fill ${r ? s > 0 ? "warn" : "done" : ""}" style="width:${r ? 100 : i}%"></div></div>
|
|
5016
5116
|
</div>
|
|
5017
5117
|
<div class="float-items">
|
|
5018
|
-
${e.map((
|
|
5118
|
+
${e.map((d) => l`
|
|
5019
5119
|
<div class="float-item">
|
|
5020
5120
|
<div class="float-item-thumb">
|
|
5021
5121
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>
|
|
5022
5122
|
</div>
|
|
5023
5123
|
<div class="float-item-info">
|
|
5024
|
-
<div class="float-item-name">${
|
|
5025
|
-
<div class="float-item-size">${
|
|
5124
|
+
<div class="float-item-name">${d.name}</div>
|
|
5125
|
+
<div class="float-item-size">${Y(d.size)}</div>
|
|
5026
5126
|
</div>
|
|
5027
5127
|
<div class="float-item-status">
|
|
5028
|
-
${
|
|
5128
|
+
${d.status === "complete" ? l`<div class="float-item-done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg></div>` : d.status === "failed" || d.status === "error" ? l`<svg class="float-item-error" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>${d.error || "Upload failed"}</title><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>` : l`<div class="float-item-spinner"></div>`}
|
|
5029
5129
|
</div>
|
|
5030
5130
|
</div>
|
|
5031
5131
|
`)}
|
|
@@ -5035,21 +5135,20 @@ const y = (S = class extends z {
|
|
|
5035
5135
|
}
|
|
5036
5136
|
_renderPreviewLayout(e) {
|
|
5037
5137
|
var n;
|
|
5038
|
-
if (e.length === 0) return
|
|
5039
|
-
const t = e.find((d) => d.id === this._previewFileId) ?? e[0], i = ((n = t.name.split(".").pop()) == null ? void 0 : n.toUpperCase()) || "", r = new Date(t.addedAt).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }), o = this._store.getState().targetFolder, s = e.reduce((d,
|
|
5138
|
+
if (e.length === 0) return p;
|
|
5139
|
+
const t = e.find((d) => d.id === this._previewFileId) ?? e[0], i = ((n = t.name.split(".").pop()) == null ? void 0 : n.toUpperCase()) || "", r = new Date(t.addedAt).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }), o = this._store.getState().targetFolder, s = e.reduce((d, c) => d + (c.size || 0), 0);
|
|
5040
5140
|
return l`
|
|
5041
5141
|
<div class="preview-topbar"></div>
|
|
5042
5142
|
<div class="preview-layout">
|
|
5043
5143
|
<div class="file-grid-side">
|
|
5044
5144
|
<div class="file-grid-header">
|
|
5045
|
-
<span class="file-grid-header-text">${e.length} ${e.length === 1 ? "asset" : "assets"} · ${
|
|
5145
|
+
<span class="file-grid-header-text">${e.length} ${e.length === 1 ? "asset" : "assets"} · ${Y(s)}</span>
|
|
5046
5146
|
</div>
|
|
5047
5147
|
<sfx-file-list
|
|
5048
5148
|
.files=${e}
|
|
5049
5149
|
.showDropTile=${!0}
|
|
5050
5150
|
.sources=${this._mergedSources}
|
|
5051
|
-
.accept=${
|
|
5052
|
-
@files-selected=${this._onFilesSelected}
|
|
5151
|
+
.accept=${Se(this._storeCtrl.state.restrictions)}
|
|
5053
5152
|
@source-click=${this._onDropTileSourceClick}
|
|
5054
5153
|
></sfx-file-list>
|
|
5055
5154
|
</div>
|
|
@@ -5069,7 +5168,7 @@ const y = (S = class extends z {
|
|
|
5069
5168
|
<line x1="3" y1="21" x2="10" y2="14" />
|
|
5070
5169
|
</svg>
|
|
5071
5170
|
</button>
|
|
5072
|
-
` :
|
|
5171
|
+
` : p}
|
|
5073
5172
|
<button @click=${() => {
|
|
5074
5173
|
this._previewFileId = null;
|
|
5075
5174
|
}} title="Close">
|
|
@@ -5121,7 +5220,7 @@ const y = (S = class extends z {
|
|
|
5121
5220
|
</div>
|
|
5122
5221
|
<div class="preview-meta-row">
|
|
5123
5222
|
<span class="preview-meta-label">Size</span>
|
|
5124
|
-
<span class="preview-meta-value">${
|
|
5223
|
+
<span class="preview-meta-value">${Y(t.size)}</span>
|
|
5125
5224
|
</div>
|
|
5126
5225
|
<div class="preview-meta-row">
|
|
5127
5226
|
<span class="preview-meta-label">Dimensions</span>
|
|
@@ -5169,7 +5268,7 @@ const y = (S = class extends z {
|
|
|
5169
5268
|
}
|
|
5170
5269
|
_renderBody() {
|
|
5171
5270
|
var s, n, d;
|
|
5172
|
-
const e = this._storeCtrl.state, t = [...e.files.values()], i = this._phase, r =
|
|
5271
|
+
const e = this._storeCtrl.state, t = [...e.files.values()], i = this._phase, r = Se(e.restrictions), o = t.length > 0;
|
|
5173
5272
|
return l`
|
|
5174
5273
|
<div class="content"
|
|
5175
5274
|
@files-selected=${this._onFilesSelected}
|
|
@@ -5195,19 +5294,20 @@ const y = (S = class extends z {
|
|
|
5195
5294
|
>
|
|
5196
5295
|
<div
|
|
5197
5296
|
class="body ${o ? "has-files" : ""} ${this._bodyDragOver ? "body-drag-over" : ""}"
|
|
5198
|
-
@dragenter=${o ? this._onBodyDragEnter :
|
|
5199
|
-
@dragover=${o ? this._onBodyDragOver :
|
|
5200
|
-
@dragleave=${o ? this._onBodyDragLeave :
|
|
5201
|
-
@drop=${o ? this._onBodyDrop :
|
|
5297
|
+
@dragenter=${o ? this._onBodyDragEnter : p}
|
|
5298
|
+
@dragover=${o ? this._onBodyDragOver : p}
|
|
5299
|
+
@dragleave=${o ? this._onBodyDragLeave : p}
|
|
5300
|
+
@drop=${o ? this._onBodyDrop : p}
|
|
5202
5301
|
>
|
|
5203
5302
|
${i === "complete" ? l`
|
|
5204
5303
|
<sfx-success-card
|
|
5205
|
-
.fileCount=${t.filter((
|
|
5206
|
-
.totalSize=${t.filter((
|
|
5207
|
-
.thumbnails=${t.filter((
|
|
5304
|
+
.fileCount=${t.filter((c) => c.status === "complete").length}
|
|
5305
|
+
.totalSize=${t.filter((c) => c.status === "complete").reduce((c, u) => c + (u.size || 0), 0)}
|
|
5306
|
+
.thumbnails=${t.filter((c) => c.status === "complete" && c.previewUrl).map((c) => c.previewUrl)}
|
|
5307
|
+
.failedFiles=${t.filter((c) => c.status === "failed").map((c) => ({ name: c.name, error: c.error || "Upload failed" }))}
|
|
5208
5308
|
></sfx-success-card>
|
|
5209
5309
|
` : i === "uploading" ? this._renderUploadOverlay(t) : l`
|
|
5210
|
-
${o ?
|
|
5310
|
+
${o ? p : l`<sfx-drop-zone
|
|
5211
5311
|
.compact=${o}
|
|
5212
5312
|
.externalDragOver=${this._bodyDragOver}
|
|
5213
5313
|
.accept=${r}
|
|
@@ -5216,16 +5316,15 @@ const y = (S = class extends z {
|
|
|
5216
5316
|
></sfx-drop-zone>`}
|
|
5217
5317
|
|
|
5218
5318
|
${o ? this._previewFileId ? this._renderPreviewLayout(t) : l`
|
|
5219
|
-
<div class="asset-count">${t.length} ${t.length === 1 ? "file" : "files"} · ${
|
|
5319
|
+
<div class="asset-count">${t.length} ${t.length === 1 ? "file" : "files"} · ${Y(t.reduce((c, u) => c + (u.size || 0), 0))}</div>
|
|
5220
5320
|
<sfx-file-list
|
|
5221
5321
|
.files=${t}
|
|
5222
5322
|
.showDropTile=${!0}
|
|
5223
5323
|
.sources=${this._mergedSources}
|
|
5224
5324
|
.accept=${r}
|
|
5225
|
-
@files-selected=${this._onFilesSelected}
|
|
5226
5325
|
@source-click=${this._onDropTileSourceClick}
|
|
5227
5326
|
></sfx-file-list>
|
|
5228
|
-
` :
|
|
5327
|
+
` : p}
|
|
5229
5328
|
`}
|
|
5230
5329
|
</div>
|
|
5231
5330
|
|
|
@@ -5233,21 +5332,21 @@ const y = (S = class extends z {
|
|
|
5233
5332
|
<sfx-actions-bar
|
|
5234
5333
|
.uploadState=${"idle"}
|
|
5235
5334
|
.fileCount=${t.length}
|
|
5236
|
-
.totalSize=${t.reduce((
|
|
5237
|
-
.failedCount=${t.filter((
|
|
5238
|
-
.completedCount=${t.filter((
|
|
5335
|
+
.totalSize=${t.reduce((c, u) => c + (u.size || 0), 0)}
|
|
5336
|
+
.failedCount=${t.filter((c) => c.status === "failed" || c.status === "error").length}
|
|
5337
|
+
.completedCount=${t.filter((c) => c.status === "complete").length}
|
|
5239
5338
|
.uploadProgress=${e.totalProgress ?? 0}
|
|
5240
5339
|
.showFillMetadata=${!!((n = this.config) != null && n.showFillMetadata)}
|
|
5241
5340
|
></sfx-actions-bar>
|
|
5242
|
-
` :
|
|
5341
|
+
` : p}
|
|
5243
5342
|
|
|
5244
|
-
${this._showUrlDialog ? l`<sfx-url-dialog></sfx-url-dialog>` :
|
|
5245
|
-
${this._showCameraDialog ? l`<sfx-camera-dialog></sfx-camera-dialog>` :
|
|
5246
|
-
${this._showScreenCastDialog ? l`<sfx-screen-cast-dialog></sfx-screen-cast-dialog>` :
|
|
5343
|
+
${this._showUrlDialog ? l`<sfx-url-dialog></sfx-url-dialog>` : p}
|
|
5344
|
+
${this._showCameraDialog ? l`<sfx-camera-dialog></sfx-camera-dialog>` : p}
|
|
5345
|
+
${this._showScreenCastDialog ? l`<sfx-screen-cast-dialog></sfx-screen-cast-dialog>` : p}
|
|
5247
5346
|
${this._activeConnector && ((d = this.config) != null && d.connectors) ? l`
|
|
5248
5347
|
<div class="connector-modal-backdrop" @click=${this._onConnectorBackdropClick}>
|
|
5249
5348
|
<div class="connector-modal">
|
|
5250
|
-
${
|
|
5349
|
+
${De.has(this._activeConnector) ? l`
|
|
5251
5350
|
<sfx-search-provider-browser
|
|
5252
5351
|
.provider=${this._activeConnector}
|
|
5253
5352
|
.companionUrl=${this.config.connectors.companionUrl}
|
|
@@ -5260,7 +5359,7 @@ const y = (S = class extends z {
|
|
|
5260
5359
|
`}
|
|
5261
5360
|
</div>
|
|
5262
5361
|
</div>
|
|
5263
|
-
` :
|
|
5362
|
+
` : p}
|
|
5264
5363
|
|
|
5265
5364
|
${this._fullscreenPreviewUrl || this._fullscreenVideoFile ? l`
|
|
5266
5365
|
<div
|
|
@@ -5274,7 +5373,7 @@ const y = (S = class extends z {
|
|
|
5274
5373
|
@touchmove=${this._onFsTouchMove}
|
|
5275
5374
|
@touchend=${this._onFsPanEnd}
|
|
5276
5375
|
>
|
|
5277
|
-
<div class="fs-toolbar" @click=${(
|
|
5376
|
+
<div class="fs-toolbar" @click=${(c) => c.stopPropagation()}>
|
|
5278
5377
|
<button class="fs-btn" @click=${this._onFsToggleZoom} title="${this._fullscreenZoomed ? "Zoom out" : "Zoom in"}">
|
|
5279
5378
|
${this._fullscreenZoomed ? l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></svg>` : l`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>`}
|
|
5280
5379
|
</button>
|
|
@@ -5289,7 +5388,7 @@ const y = (S = class extends z {
|
|
|
5289
5388
|
src=${this._getVideoBlobUrl(this._fullscreenVideoFile)}
|
|
5290
5389
|
controls playsinline
|
|
5291
5390
|
draggable="false"
|
|
5292
|
-
@click=${(
|
|
5391
|
+
@click=${(c) => c.stopPropagation()}
|
|
5293
5392
|
></video>` : l`<img
|
|
5294
5393
|
class="fs-img"
|
|
5295
5394
|
src=${this._fullscreenPreviewUrl}
|
|
@@ -5297,18 +5396,18 @@ const y = (S = class extends z {
|
|
|
5297
5396
|
style=${this._fullscreenZoomed ? `transform: scale(2) translate(${this._fsPanX}px, ${this._fsPanY}px)` : ""}
|
|
5298
5397
|
draggable="false"
|
|
5299
5398
|
/>`}
|
|
5300
|
-
<button class="fs-nav prev" @click=${(
|
|
5301
|
-
|
|
5399
|
+
<button class="fs-nav prev" @click=${(c) => {
|
|
5400
|
+
c.stopPropagation(), this._navigateFs(-1);
|
|
5302
5401
|
}}>
|
|
5303
5402
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="15 18 9 12 15 6"/></svg>
|
|
5304
5403
|
</button>
|
|
5305
|
-
<button class="fs-nav next" @click=${(
|
|
5306
|
-
|
|
5404
|
+
<button class="fs-nav next" @click=${(c) => {
|
|
5405
|
+
c.stopPropagation(), this._navigateFs(1);
|
|
5307
5406
|
}}>
|
|
5308
5407
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><polyline points="9 6 15 12 9 18"/></svg>
|
|
5309
5408
|
</button>
|
|
5310
5409
|
</div>
|
|
5311
|
-
` :
|
|
5410
|
+
` : p}
|
|
5312
5411
|
</div>
|
|
5313
5412
|
`;
|
|
5314
5413
|
}
|
|
@@ -5331,7 +5430,7 @@ const y = (S = class extends z {
|
|
|
5331
5430
|
for (const e of this._videoBlobUrls.values()) URL.revokeObjectURL(e);
|
|
5332
5431
|
this._videoBlobUrls.clear();
|
|
5333
5432
|
}
|
|
5334
|
-
},
|
|
5433
|
+
}, E.styles = S`
|
|
5335
5434
|
:host {
|
|
5336
5435
|
display: block;
|
|
5337
5436
|
font-family: var(--sfx-up-font, 'Inter', system-ui, -apple-system, sans-serif);
|
|
@@ -5355,9 +5454,6 @@ const y = (S = class extends z {
|
|
|
5355
5454
|
--sfx-up-shadow: var(--shadow, rgba(0, 0, 0, 0.1));
|
|
5356
5455
|
--sfx-up-surface: var(--card, #f8fafc);
|
|
5357
5456
|
--sfx-up-backdrop: rgba(0, 0, 0, 0.45);
|
|
5358
|
-
--sfx-up-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
|
|
5359
|
-
--sfx-up-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
|
|
5360
|
-
--sfx-up-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
|
|
5361
5457
|
--sfx-up-ring: var(--ring, oklch(0.578 0.198 268.129 / 0.7));
|
|
5362
5458
|
--sfx-up-max-height: 88vh;
|
|
5363
5459
|
}
|
|
@@ -5556,7 +5652,7 @@ const y = (S = class extends z {
|
|
|
5556
5652
|
align-items: stretch;
|
|
5557
5653
|
overflow: hidden;
|
|
5558
5654
|
gap: 0;
|
|
5559
|
-
padding: 0
|
|
5655
|
+
padding: 0 0 0 8px;
|
|
5560
5656
|
animation: bodyReveal 0.35s ease both;
|
|
5561
5657
|
}
|
|
5562
5658
|
|
|
@@ -5600,6 +5696,7 @@ const y = (S = class extends z {
|
|
|
5600
5696
|
flex-direction: column;
|
|
5601
5697
|
overflow: hidden;
|
|
5602
5698
|
height: 100%;
|
|
5699
|
+
min-height: var(--sfx-up-min-height, 660px);
|
|
5603
5700
|
max-height: var(--sfx-up-max-height, 88vh);
|
|
5604
5701
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
|
|
5605
5702
|
transition: box-shadow 0.25s ease;
|
|
@@ -5644,10 +5741,12 @@ const y = (S = class extends z {
|
|
|
5644
5741
|
.preview-layout sfx-file-list {
|
|
5645
5742
|
padding-right: 16px;
|
|
5646
5743
|
--sfx-scrollbar-w: 14px;
|
|
5647
|
-
--sfx-scrollbar-inset:
|
|
5648
|
-
--sfx-scrollbar-
|
|
5744
|
+
--sfx-scrollbar-inset-left: 2px;
|
|
5745
|
+
--sfx-scrollbar-inset-right: 6px;
|
|
5649
5746
|
}
|
|
5650
5747
|
|
|
5748
|
+
/* NOTE: scrollbar border-radius is hardcoded to 6px in sfx-file-list */
|
|
5749
|
+
|
|
5651
5750
|
.file-grid-header {
|
|
5652
5751
|
display: flex;
|
|
5653
5752
|
align-items: center;
|
|
@@ -6429,14 +6528,13 @@ const y = (S = class extends z {
|
|
|
6429
6528
|
/* --- Responsive: Tablet (≤ 768px) --- */
|
|
6430
6529
|
@media (max-width: 768px) {
|
|
6431
6530
|
.modal-backdrop { padding: 12px; }
|
|
6432
|
-
.modal-card { border-radius: 12px; max-height: 92vh; }
|
|
6531
|
+
.modal-card { border-radius: 12px; max-height: 92vh; min-height: auto; }
|
|
6433
6532
|
.header { padding: 12px 16px; }
|
|
6434
6533
|
.header-icon { width: 28px; height: 28px; margin-right: 10px; }
|
|
6435
6534
|
.header-icon svg { width: 14px; height: 14px; }
|
|
6436
6535
|
.header-title { font-size: 14px; }
|
|
6437
6536
|
.body { padding: 16px; }
|
|
6438
|
-
.body.has-files { padding: 0
|
|
6439
|
-
.asset-count { padding: 16px; }
|
|
6537
|
+
.body.has-files { padding: 0 0 12px 8px; }
|
|
6440
6538
|
|
|
6441
6539
|
.preview-layout { flex-direction: column; }
|
|
6442
6540
|
.preview-layout .file-grid-side {
|
|
@@ -6450,7 +6548,7 @@ const y = (S = class extends z {
|
|
|
6450
6548
|
|
|
6451
6549
|
.preview-topbar { padding: 8px 0; }
|
|
6452
6550
|
|
|
6453
|
-
.inline { border-radius: 12px; }
|
|
6551
|
+
.inline { border-radius: 12px; min-height: auto; }
|
|
6454
6552
|
|
|
6455
6553
|
.connector-modal-backdrop { padding: 8px; }
|
|
6456
6554
|
.connector-modal {
|
|
@@ -6474,8 +6572,7 @@ const y = (S = class extends z {
|
|
|
6474
6572
|
.header-icon { width: 26px; height: 26px; margin-right: 8px; }
|
|
6475
6573
|
.header-title { font-size: 14px; }
|
|
6476
6574
|
.body { padding: 12px; }
|
|
6477
|
-
.body.has-files { padding: 0 8px
|
|
6478
|
-
.asset-count { padding: 16px; }
|
|
6575
|
+
.body.has-files { padding: 0 0 8px 8px; }
|
|
6479
6576
|
|
|
6480
6577
|
.preview-layout .file-grid-side { max-height: 100px; }
|
|
6481
6578
|
.preview-panel { padding: 0 0 12px; }
|
|
@@ -6489,84 +6586,89 @@ const y = (S = class extends z {
|
|
|
6489
6586
|
.connector-modal {
|
|
6490
6587
|
border-radius: 0;
|
|
6491
6588
|
height: 100vh;
|
|
6492
|
-
max-height: none;
|
|
6493
6589
|
min-height: auto;
|
|
6494
6590
|
}
|
|
6495
6591
|
}
|
|
6496
|
-
|
|
6592
|
+
|
|
6593
|
+
/* --- Responsive: Landscape / short viewports --- */
|
|
6594
|
+
@media (max-height: 700px) {
|
|
6595
|
+
.modal-card { min-height: auto; }
|
|
6596
|
+
.inline { min-height: auto; }
|
|
6597
|
+
}
|
|
6598
|
+
`, E._MODIFIABLE_STATUSES = /* @__PURE__ */ new Set([
|
|
6497
6599
|
"idle",
|
|
6498
6600
|
"queued",
|
|
6499
6601
|
"rejected"
|
|
6500
|
-
]),
|
|
6501
|
-
|
|
6602
|
+
]), E._RESERVED_IDS = /* @__PURE__ */ new Set(["device", "camera", "url", "screen-cast"]), E);
|
|
6603
|
+
$([
|
|
6502
6604
|
b({ attribute: !1 })
|
|
6503
|
-
],
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
],
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
],
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
],
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
],
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
],
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
],
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
],
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
],
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
],
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
],
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
],
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
],
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
],
|
|
6543
|
-
let
|
|
6605
|
+
], C.prototype, "config");
|
|
6606
|
+
$([
|
|
6607
|
+
x()
|
|
6608
|
+
], C.prototype, "_isOpen");
|
|
6609
|
+
$([
|
|
6610
|
+
x()
|
|
6611
|
+
], C.prototype, "_activeConnector");
|
|
6612
|
+
$([
|
|
6613
|
+
x()
|
|
6614
|
+
], C.prototype, "_showUrlDialog");
|
|
6615
|
+
$([
|
|
6616
|
+
x()
|
|
6617
|
+
], C.prototype, "_showCameraDialog");
|
|
6618
|
+
$([
|
|
6619
|
+
x()
|
|
6620
|
+
], C.prototype, "_showScreenCastDialog");
|
|
6621
|
+
$([
|
|
6622
|
+
x()
|
|
6623
|
+
], C.prototype, "_previewFileId");
|
|
6624
|
+
$([
|
|
6625
|
+
x()
|
|
6626
|
+
], C.prototype, "_previewDims");
|
|
6627
|
+
$([
|
|
6628
|
+
x()
|
|
6629
|
+
], C.prototype, "_fullscreenPreviewUrl");
|
|
6630
|
+
$([
|
|
6631
|
+
x()
|
|
6632
|
+
], C.prototype, "_fullscreenVideoFile");
|
|
6633
|
+
$([
|
|
6634
|
+
x()
|
|
6635
|
+
], C.prototype, "_fullscreenZoomed");
|
|
6636
|
+
$([
|
|
6637
|
+
x()
|
|
6638
|
+
], C.prototype, "_bodyDragOver");
|
|
6639
|
+
$([
|
|
6640
|
+
x()
|
|
6641
|
+
], C.prototype, "_isMinimized");
|
|
6642
|
+
$([
|
|
6643
|
+
x()
|
|
6644
|
+
], C.prototype, "_isPillExpanded");
|
|
6645
|
+
let Ct = C;
|
|
6544
6646
|
export {
|
|
6545
6647
|
le as A,
|
|
6546
6648
|
X as C,
|
|
6547
6649
|
v as P,
|
|
6548
6650
|
j as S,
|
|
6549
|
-
|
|
6550
|
-
|
|
6651
|
+
He as U,
|
|
6652
|
+
U as a,
|
|
6551
6653
|
ne as b,
|
|
6552
6654
|
B as c,
|
|
6553
|
-
|
|
6655
|
+
ze as d,
|
|
6554
6656
|
ae as e,
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6657
|
+
R as f,
|
|
6658
|
+
Ct as g,
|
|
6659
|
+
Oe as h,
|
|
6558
6660
|
oe as i,
|
|
6559
6661
|
je as j,
|
|
6560
|
-
|
|
6662
|
+
Ye as k,
|
|
6561
6663
|
de as l,
|
|
6562
|
-
|
|
6664
|
+
Je as m,
|
|
6563
6665
|
W as n,
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6666
|
+
q as o,
|
|
6667
|
+
L as p,
|
|
6668
|
+
mt as q,
|
|
6669
|
+
qe as r,
|
|
6670
|
+
_t as s,
|
|
6671
|
+
kt as t,
|
|
6672
|
+
wt as u,
|
|
6673
|
+
yt as v
|
|
6572
6674
|
};
|