@fluid-app/fluid-cli-theme-dev 0.1.740 → 0.1.741
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/dist-cli-preview/.vite/manifest.json +50 -50
- package/dist/dist-cli-preview/account-screens.js +1 -1
- package/dist/dist-cli-preview/chunks/{MediaScreen-B6W5_Zyk.js → MediaScreen-DkRkZU8X.js} +1 -1
- package/dist/dist-cli-preview/chunks/{MemberShareablesScreen-DJfUS4f1.js → MemberShareablesScreen-BJNzKKqw.js} +862 -843
- package/dist/dist-cli-preview/chunks/{PlaylistsScreen-D960PmAf.js → PlaylistsScreen-Dq6BYMc4.js} +1 -1
- package/dist/dist-cli-preview/chunks/{ar-D6LJV1_E.js → ar-ClhIoz6a.js} +260 -256
- package/dist/dist-cli-preview/chunks/{bg-C5Ldmily.js → bg-BksVMhMy.js} +278 -274
- package/dist/dist-cli-preview/chunks/{bn-kfMPWNR6.js → bn-Jn0udx5-.js} +267 -263
- package/dist/dist-cli-preview/chunks/{cli-preview-CtzIoQ37.js → cli-preview-CEzgackT.js} +3 -3
- package/dist/dist-cli-preview/chunks/{cs-DqEgtV8D.js → cs-CMdINoT1.js} +262 -258
- package/dist/dist-cli-preview/chunks/{da-BbuvL7Gx.js → da-D25F0yGh.js} +277 -273
- package/dist/dist-cli-preview/chunks/{de-BfJ7rQig.js → de-CZiafs2R.js} +280 -276
- package/dist/dist-cli-preview/chunks/{el-BO0rLq6D.js → el-BWLIj7n7.js} +280 -276
- package/dist/dist-cli-preview/chunks/{es-BEVtEUXk.js → es-pIE-fFV2.js} +280 -276
- package/dist/dist-cli-preview/chunks/{fi-DjISV3UN.js → fi-BEqBi0iR.js} +278 -274
- package/dist/dist-cli-preview/chunks/{fr-1fFd-aKy.js → fr-BsEpyTmn.js} +278 -274
- package/dist/dist-cli-preview/chunks/{he-CaT9bwVp.js → he-CVyG1N7p.js} +265 -261
- package/dist/dist-cli-preview/chunks/{hi-DkzEm57l.js → hi-CA89BVKL.js} +266 -262
- package/dist/dist-cli-preview/chunks/{hr-DqM5N_bj.js → hr-Dbk-j9u8.js} +296 -292
- package/dist/dist-cli-preview/chunks/{hu-DiLqjo5c.js → hu-D6LKkyaV.js} +268 -264
- package/dist/dist-cli-preview/chunks/{id-DA1KmwgX.js → id-BGR9VsQZ.js} +264 -260
- package/dist/dist-cli-preview/chunks/{it-CTEVWCRz.js → it-B1r6jnOe.js} +267 -263
- package/dist/dist-cli-preview/chunks/{ja-fxqg1hhg.js → ja-BpANsj6V.js} +292 -288
- package/dist/dist-cli-preview/chunks/{ko-Btp1_5YS.js → ko-DX3tlkQ_.js} +293 -289
- package/dist/dist-cli-preview/chunks/{mount-account-screen-BLTZLqGE.js → mount-account-screen-B6laJ7pD.js} +2 -2
- package/dist/dist-cli-preview/chunks/{ms-DqRbmHx8.js → ms--yFb9SFW.js} +264 -260
- package/dist/dist-cli-preview/chunks/{navigate-account-screen-DdulEDHD.js → navigate-account-screen-Be2AAR35.js} +1 -1
- package/dist/dist-cli-preview/chunks/{nl-CkPNddxO.js → nl-H9XiHH5i.js} +297 -293
- package/dist/dist-cli-preview/chunks/{no-ftcy0RcQ.js → no-BEW-_XcJ.js} +277 -273
- package/dist/dist-cli-preview/chunks/{pl-wyJLqfip.js → pl-CrFhIzj-.js} +309 -305
- package/dist/dist-cli-preview/chunks/{pt-7uHLacuI.js → pt-DlaqLtk5.js} +263 -259
- package/dist/dist-cli-preview/chunks/{ro-Dh12ghww.js → ro-gd_dWaXs.js} +279 -275
- package/dist/dist-cli-preview/chunks/ru-DlyR-9Mq.js +683 -0
- package/dist/dist-cli-preview/chunks/{sk-CsuNYa1k.js → sk-BhsGydo4.js} +279 -275
- package/dist/dist-cli-preview/chunks/{sv-DVrPaJbh.js → sv-B0ht7qZg.js} +265 -261
- package/dist/dist-cli-preview/chunks/{th-BEkMpcVW.js → th-ccJQMGOp.js} +281 -277
- package/dist/dist-cli-preview/chunks/{tl-CqwwplQC.js → tl-Bq05C1ac.js} +278 -274
- package/dist/dist-cli-preview/chunks/{tr-XEp4ekrM.js → tr-CRzzw4Hc.js} +262 -258
- package/dist/dist-cli-preview/chunks/{uk-DWdZFWBl.js → uk-Dn_JPwF7.js} +263 -259
- package/dist/dist-cli-preview/chunks/{vi-H__PaPsC.js → vi-LxWc0tDK.js} +286 -282
- package/dist/dist-cli-preview/chunks/zh_CN-795k0aqz.js +683 -0
- package/dist/dist-cli-preview/chunks/zh_TW-pxcxIx6W.js +683 -0
- package/package.json +2 -2
- package/dist/dist-cli-preview/chunks/ru-DFM7xWFz.js +0 -679
- package/dist/dist-cli-preview/chunks/zh_CN-B62j_w_1.js +0 -679
- package/dist/dist-cli-preview/chunks/zh_TW-CYUIGBvP.js +0 -679
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as be, l as o, j as e, G as kl, H as zn, J as Cl, K as os, M as Sl, N as Pl, O as On, R as Tl, U as Al, V as El, W as Ml, X as ve, Y as Ve, Z as
|
|
2
|
-
import { u as
|
|
1
|
+
import { c as be, l as o, j as e, G as kl, H as zn, J as Cl, K as os, M as Sl, N as Pl, O as On, R as Tl, U as Al, V as El, W as Ml, X as ve, Y as Ve, Z as ue, _ as Ge, $ as H, a0 as Vt, a1 as _t, a2 as $n, a3 as Un, a4 as pr, a5 as ba, a6 as qr, a7 as nt, a8 as rs, a9 as Fl, aa as Il, ab as Dl, ac as Rl, ad as Ll, ae as zl, a as Os, af as Hn, ag as qn, ah as Hs, ai as Ol, B as hr, aj as $l, D as Ul, E as Hl, ak as ql, z as Bl, x as Kl } from "./account-screen-runtime-gWamEEiQ.js";
|
|
2
|
+
import { u as Lt } from "./useInfiniteQuery-BoOiol5L.js";
|
|
3
3
|
import { u as ze, o as ke, r as Is, s as te, n as Nt, a as Ds, l as Vl, b as ts, c as Cs, d as Gt, e as fr, _ as Gl, C as as, f as Wl } from "./schemas-BGhVnzPl.js";
|
|
4
4
|
import { u as Bn, P as Ql } from "./PortalTenantClientProvider-B3BFo8T5.js";
|
|
5
5
|
import { p as Yl, d as Xl, e as Zl, f as Jl, g as eo, h as to, i as so, j as ao, c as ro } from "./hey-api-client-BtWnXt6Y.js";
|
|
@@ -10,7 +10,7 @@ import { S as ja } from "./search-DAHGESai.js";
|
|
|
10
10
|
import { u as dt } from "./use-mobile-CzhxjMYC.js";
|
|
11
11
|
import { c as Co, a as So, b as Po, u as To } from "./translation-api-context-factory-DDptTXAu.js";
|
|
12
12
|
import { B as zt, P as gr, M as Gn, a as qs, b as Ao, T as Wn, C as Qn } from "./Textarea-BX1sqax1.js";
|
|
13
|
-
import { L as _r, S as it, T as Eo, a as Mo, b as Ua, c as Ct, d as Fo, U as Io, e as Do, f as
|
|
13
|
+
import { L as _r, S as it, T as Eo, a as Mo, b as Ua, c as Ct, d as Fo, U as Io, e as Do, f as Ro, g as Lo, h as zo, i as Oo, M as $o, P as Uo } from "./index-B23yRHYj.js";
|
|
14
14
|
import { D as bs, a as wa, b as xr, c as Ho, d as qo, R as St, T as ns, P as Wt, e as Bs, f as Na, g as yr, h as br, M as Yn } from "./ResponsiveDialog-Cuv5gFUx.js";
|
|
15
15
|
import { C as Bo } from "./copy-DO_MJg1G.js";
|
|
16
16
|
import { u as Ko, S as Vo, P as Go, E as Wo } from "./index-DSMhrA7P.js";
|
|
@@ -19,7 +19,7 @@ import { u as ec } from "./index-dtGU2026.js";
|
|
|
19
19
|
import { d as tc } from "./member-permissions-ndhNmlOk.js";
|
|
20
20
|
import { u as sc } from "./use-store-B2hbh2xH.js";
|
|
21
21
|
import { c as ac, a as rc } from "./client.gen-Bn09emPC.js";
|
|
22
|
-
import { i as nc } from "./navigate-account-screen-
|
|
22
|
+
import { i as nc } from "./navigate-account-screen-Be2AAR35.js";
|
|
23
23
|
/**
|
|
24
24
|
* @license lucide-react v0.575.0 - ISC
|
|
25
25
|
*
|
|
@@ -134,7 +134,7 @@ const yc = [
|
|
|
134
134
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
135
135
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
136
136
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
137
|
-
],
|
|
137
|
+
], Rs = be("download", yc);
|
|
138
138
|
/**
|
|
139
139
|
* @license lucide-react v0.575.0 - ISC
|
|
140
140
|
*
|
|
@@ -316,14 +316,14 @@ const Dc = [
|
|
|
316
316
|
}
|
|
317
317
|
],
|
|
318
318
|
["path", { d: "M20.054 15.987H3.946", key: "14rxg9" }]
|
|
319
|
-
],
|
|
319
|
+
], Rc = be("laptop", Dc);
|
|
320
320
|
/**
|
|
321
321
|
* @license lucide-react v0.575.0 - ISC
|
|
322
322
|
*
|
|
323
323
|
* This source code is licensed under the ISC license.
|
|
324
324
|
* See the LICENSE file in the root directory of this source tree.
|
|
325
325
|
*/
|
|
326
|
-
const
|
|
326
|
+
const Lc = [
|
|
327
327
|
[
|
|
328
328
|
"path",
|
|
329
329
|
{
|
|
@@ -345,7 +345,7 @@ const Rc = [
|
|
|
345
345
|
key: "kqbvx6"
|
|
346
346
|
}
|
|
347
347
|
]
|
|
348
|
-
], zc = be("layers",
|
|
348
|
+
], zc = be("layers", Lc);
|
|
349
349
|
/**
|
|
350
350
|
* @license lucide-react v0.575.0 - ISC
|
|
351
351
|
*
|
|
@@ -567,22 +567,22 @@ var $s = "Tooltip", [od, Ks] = ka($s), di = (t) => {
|
|
|
567
567
|
onOpenChange: i,
|
|
568
568
|
disableHoverableContent: l,
|
|
569
569
|
delayDuration: u
|
|
570
|
-
} = t, c = vr($s, t.__scopeTooltip), d = Ca(s), [m, h] = o.useState(null), p = Sl(), f = o.useRef(0), g = l ?? c.disableHoverableContent,
|
|
570
|
+
} = t, c = vr($s, t.__scopeTooltip), d = Ca(s), [m, h] = o.useState(null), p = Sl(), f = o.useRef(0), g = l ?? c.disableHoverableContent, x = u ?? c.delayDuration, _ = o.useRef(!1), [w, b] = Pl({
|
|
571
571
|
prop: r,
|
|
572
572
|
defaultProp: n ?? !1,
|
|
573
573
|
onChange: (z) => {
|
|
574
574
|
z ? (c.onOpen(), document.dispatchEvent(new CustomEvent(nr))) : c.onClose(), i?.(z);
|
|
575
575
|
},
|
|
576
576
|
caller: $s
|
|
577
|
-
}), j = o.useMemo(() => w ?
|
|
578
|
-
window.clearTimeout(f.current), f.current = 0,
|
|
577
|
+
}), j = o.useMemo(() => w ? _.current ? "delayed-open" : "instant-open" : "closed", [w]), v = o.useCallback(() => {
|
|
578
|
+
window.clearTimeout(f.current), f.current = 0, _.current = !1, b(!0);
|
|
579
579
|
}, [b]), C = o.useCallback(() => {
|
|
580
580
|
window.clearTimeout(f.current), f.current = 0, b(!1);
|
|
581
581
|
}, [b]), N = o.useCallback(() => {
|
|
582
582
|
window.clearTimeout(f.current), f.current = window.setTimeout(() => {
|
|
583
|
-
|
|
584
|
-
},
|
|
585
|
-
}, [
|
|
583
|
+
_.current = !0, b(!0), f.current = 0;
|
|
584
|
+
}, x);
|
|
585
|
+
}, [x, b]);
|
|
586
586
|
return o.useEffect(() => () => {
|
|
587
587
|
f.current && (window.clearTimeout(f.current), f.current = 0);
|
|
588
588
|
}, []), /* @__PURE__ */ e.jsx(Yo, { ...d, children: /* @__PURE__ */ e.jsx(
|
|
@@ -653,23 +653,23 @@ var ys = "TooltipContent", pi = o.forwardRef(
|
|
|
653
653
|
const a = Ks(ys, t.__scopeTooltip), r = vr(ys, t.__scopeTooltip), n = o.useRef(null), i = zn(s, n), [l, u] = o.useState(null), { trigger: c, onClose: d } = a, m = n.current, { onPointerInTransitChange: h } = r, p = o.useCallback(() => {
|
|
654
654
|
u(null), h(!1);
|
|
655
655
|
}, [h]), f = o.useCallback(
|
|
656
|
-
(g,
|
|
657
|
-
const
|
|
656
|
+
(g, x) => {
|
|
657
|
+
const _ = g.currentTarget, w = { x: g.clientX, y: g.clientY }, b = gd(w, _.getBoundingClientRect()), j = _d(w, b), v = xd(x.getBoundingClientRect()), C = bd([...j, ...v]);
|
|
658
658
|
u(C), h(!0);
|
|
659
659
|
},
|
|
660
660
|
[h]
|
|
661
661
|
);
|
|
662
662
|
return o.useEffect(() => () => p(), [p]), o.useEffect(() => {
|
|
663
663
|
if (c && m) {
|
|
664
|
-
const g = (
|
|
665
|
-
return c.addEventListener("pointerleave", g), m.addEventListener("pointerleave",
|
|
666
|
-
c.removeEventListener("pointerleave", g), m.removeEventListener("pointerleave",
|
|
664
|
+
const g = (_) => f(_, m), x = (_) => f(_, c);
|
|
665
|
+
return c.addEventListener("pointerleave", g), m.addEventListener("pointerleave", x), () => {
|
|
666
|
+
c.removeEventListener("pointerleave", g), m.removeEventListener("pointerleave", x);
|
|
667
667
|
};
|
|
668
668
|
}
|
|
669
669
|
}, [c, m, f, p]), o.useEffect(() => {
|
|
670
670
|
if (l) {
|
|
671
|
-
const g = (
|
|
672
|
-
const
|
|
671
|
+
const g = (x) => {
|
|
672
|
+
const _ = x.target, w = { x: x.clientX, y: x.clientY }, b = c?.contains(_) || m?.contains(_), j = !yd(w, l);
|
|
673
673
|
b ? p() : j && (p(), d());
|
|
674
674
|
};
|
|
675
675
|
return document.addEventListener("pointermove", g), () => document.removeEventListener("pointermove", g);
|
|
@@ -835,7 +835,7 @@ function It(t) {
|
|
|
835
835
|
return /* @__PURE__ */ e.jsx(wd, { ...t });
|
|
836
836
|
}
|
|
837
837
|
const Dt = Nd;
|
|
838
|
-
function
|
|
838
|
+
function Rt({
|
|
839
839
|
className: t,
|
|
840
840
|
sideOffset: s = 4,
|
|
841
841
|
...a
|
|
@@ -969,7 +969,7 @@ const Td = (t) => t.client.get(
|
|
|
969
969
|
"Content-Type": "application/json",
|
|
970
970
|
...t.headers
|
|
971
971
|
}
|
|
972
|
-
}),
|
|
972
|
+
}), Rd = (t) => t.client.delete({
|
|
973
973
|
responseStyle: "data",
|
|
974
974
|
security: [
|
|
975
975
|
{
|
|
@@ -980,7 +980,7 @@ const Td = (t) => t.client.get(
|
|
|
980
980
|
],
|
|
981
981
|
url: "/api/content/media/{medium_id}/products/{id}",
|
|
982
982
|
...t
|
|
983
|
-
}),
|
|
983
|
+
}), Ld = (t) => t.client.get({
|
|
984
984
|
responseStyle: "data",
|
|
985
985
|
security: [
|
|
986
986
|
{
|
|
@@ -1348,7 +1348,7 @@ const Td = (t) => t.client.get(
|
|
|
1348
1348
|
path: { medium_id: s },
|
|
1349
1349
|
...qe(a)
|
|
1350
1350
|
}),
|
|
1351
|
-
media_products_remove: (t, s, a) =>
|
|
1351
|
+
media_products_remove: (t, s, a) => Rd({
|
|
1352
1352
|
client: t,
|
|
1353
1353
|
path: { medium_id: s, id: a }
|
|
1354
1354
|
}),
|
|
@@ -1377,7 +1377,7 @@ const Td = (t) => t.client.get(
|
|
|
1377
1377
|
path: { playlist_id: s },
|
|
1378
1378
|
body: a
|
|
1379
1379
|
}),
|
|
1380
|
-
playlists_list: (t, s) =>
|
|
1380
|
+
playlists_list: (t, s) => Ld({ client: t, ...qe(s) }),
|
|
1381
1381
|
playlists_show: (t, s) => $d({ client: t, path: { id: s } }),
|
|
1382
1382
|
playlists_update: (t, s, a) => Ud({ client: t, path: { id: s }, body: a }),
|
|
1383
1383
|
shares_create: (t, s) => Qd({ client: t, body: s }),
|
|
@@ -1405,17 +1405,17 @@ function wi() {
|
|
|
1405
1405
|
);
|
|
1406
1406
|
return t.api;
|
|
1407
1407
|
}
|
|
1408
|
-
const
|
|
1408
|
+
const Ls = {
|
|
1409
1409
|
all: ["portal-products"],
|
|
1410
|
-
list: (t) => [...
|
|
1411
|
-
detail: (t) => [...
|
|
1412
|
-
search: (t, s) => [...
|
|
1413
|
-
media: (t) => [...
|
|
1410
|
+
list: (t) => [...Ls.all, "list", t],
|
|
1411
|
+
detail: (t) => [...Ls.all, "detail", String(t)],
|
|
1412
|
+
search: (t, s) => [...Ls.all, "search", t, s],
|
|
1413
|
+
media: (t) => [...Ls.all, "media", String(t)]
|
|
1414
1414
|
};
|
|
1415
1415
|
function ou(t, s) {
|
|
1416
1416
|
const a = wi();
|
|
1417
1417
|
return Ve({
|
|
1418
|
-
queryKey:
|
|
1418
|
+
queryKey: Ls.detail(t),
|
|
1419
1419
|
queryFn: () => a.getProduct(t),
|
|
1420
1420
|
enabled: s?.enabled ?? !0
|
|
1421
1421
|
});
|
|
@@ -1432,12 +1432,12 @@ const Qr = (t) => {
|
|
|
1432
1432
|
return u;
|
|
1433
1433
|
}, cu = ((t) => t ? Qr(t) : Qr), du = (t) => t;
|
|
1434
1434
|
function uu(t, s = du) {
|
|
1435
|
-
const a =
|
|
1435
|
+
const a = ue.useSyncExternalStore(
|
|
1436
1436
|
t.subscribe,
|
|
1437
|
-
|
|
1438
|
-
|
|
1437
|
+
ue.useCallback(() => s(t.getState()), [t, s]),
|
|
1438
|
+
ue.useCallback(() => s(t.getInitialState()), [t, s])
|
|
1439
1439
|
);
|
|
1440
|
-
return
|
|
1440
|
+
return ue.useDebugValue(a), a;
|
|
1441
1441
|
}
|
|
1442
1442
|
const mu = (t) => {
|
|
1443
1443
|
const s = cu(t), a = (r) => uu(s, r);
|
|
@@ -2170,25 +2170,25 @@ function Pa(t, s, a, r = "en") {
|
|
|
2170
2170
|
throw new Error("Something went wrong, please try again.");
|
|
2171
2171
|
if (l && !u)
|
|
2172
2172
|
throw new Error("Share links are not available for this item.");
|
|
2173
|
-
const
|
|
2173
|
+
const _ = {
|
|
2174
2174
|
locale: r,
|
|
2175
2175
|
relateableType: s,
|
|
2176
2176
|
...l && t?.id && { relateableId: t.id },
|
|
2177
2177
|
...a
|
|
2178
2178
|
};
|
|
2179
|
-
return await n.share.createShareLink(
|
|
2179
|
+
return await n.share.createShareLink(_);
|
|
2180
2180
|
},
|
|
2181
2181
|
enabled: l ? !!(c && t?.id) : !0,
|
|
2182
2182
|
staleTime: 300 * 1e3,
|
|
2183
2183
|
gcTime: 600 * 1e3
|
|
2184
|
-
}), g = o.useCallback(async () => m || (await f()).data, [m, f]),
|
|
2184
|
+
}), g = o.useCallback(async () => m || (await f()).data, [m, f]), x = o.useCallback(() => {
|
|
2185
2185
|
i.removeQueries({ queryKey: d });
|
|
2186
2186
|
}, [i, d]);
|
|
2187
2187
|
return {
|
|
2188
2188
|
loading: h,
|
|
2189
2189
|
shareLink: m,
|
|
2190
2190
|
getShareLink: g,
|
|
2191
|
-
resetShareLink:
|
|
2191
|
+
resetShareLink: x,
|
|
2192
2192
|
error: p
|
|
2193
2193
|
};
|
|
2194
2194
|
}
|
|
@@ -2549,7 +2549,7 @@ function Du(t, s, a) {
|
|
|
2549
2549
|
return !1;
|
|
2550
2550
|
});
|
|
2551
2551
|
}
|
|
2552
|
-
function
|
|
2552
|
+
function Ru(t) {
|
|
2553
2553
|
if (!t || t.length === 0)
|
|
2554
2554
|
return "Any file type";
|
|
2555
2555
|
const s = [], a = /* @__PURE__ */ new Set();
|
|
@@ -2557,7 +2557,7 @@ function Lu(t) {
|
|
|
2557
2557
|
a.has(r) || (a.add(r), r === "image/*" ? s.push("Images") : r === "video/*" ? s.push("Videos") : r === "audio/*" ? s.push("Audio") : r === "application/pdf" ? s.push("PDF files") : r.startsWith(".") ? s.push(`${r.toUpperCase()} files`) : r.includes("/") && s.push(r));
|
|
2558
2558
|
}), s.length === 0 ? t.join(", ") : s.length === 1 ? s[0] : s.length === 2 ? `${s[0]} and ${s[1]}` : `${s.slice(0, -1).join(", ")}, and ${s[s.length - 1]}`;
|
|
2559
2559
|
}
|
|
2560
|
-
var
|
|
2560
|
+
var Lu = Object.defineProperty, zu = (t, s, a) => s in t ? Lu(t, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[s] = a, Pe = (t, s, a) => zu(t, typeof s != "symbol" ? s + "" : s, a);
|
|
2561
2561
|
const _a = {
|
|
2562
2562
|
x: 0,
|
|
2563
2563
|
y: 0,
|
|
@@ -2597,13 +2597,13 @@ function en(t, s, a, r, n, i = 0, l = 0, u = r, c = n) {
|
|
|
2597
2597
|
s && (s > 1 ? (m = l ? l * s : m, h = m / s, p = u * s) : (h = i ? i / s : h, m = h * s, f = c / s)), d.y < 0 && (d.height = Math.max(d.height + d.y, h), d.y = 0), d.x < 0 && (d.width = Math.max(d.width + d.x, m), d.x = 0);
|
|
2598
2598
|
const g = r - (d.x + d.width);
|
|
2599
2599
|
g < 0 && (d.x = Math.min(d.x, r - m), d.width += g);
|
|
2600
|
-
const
|
|
2601
|
-
if (
|
|
2602
|
-
const
|
|
2603
|
-
if (
|
|
2600
|
+
const x = n - (d.y + d.height);
|
|
2601
|
+
if (x < 0 && (d.y = Math.min(d.y, n - h), d.height += x), d.width < m && ((a === "sw" || a == "nw") && (d.x -= m - d.width), d.width = m), d.height < h && ((a === "nw" || a == "ne") && (d.y -= h - d.height), d.height = h), d.width > p && ((a === "sw" || a == "nw") && (d.x -= p - d.width), d.width = p), d.height > f && ((a === "nw" || a == "ne") && (d.y -= f - d.height), d.height = f), s) {
|
|
2602
|
+
const _ = d.width / d.height;
|
|
2603
|
+
if (_ < s) {
|
|
2604
2604
|
const w = Math.max(d.width / s, h);
|
|
2605
2605
|
(a === "nw" || a == "ne") && (d.y -= w - d.height), d.height = w;
|
|
2606
|
-
} else if (
|
|
2606
|
+
} else if (_ > s) {
|
|
2607
2607
|
const w = Math.max(d.height * s, m);
|
|
2608
2608
|
(a === "sw" || a == "nw") && (d.x -= w - d.width), d.width = w;
|
|
2609
2609
|
}
|
|
@@ -2641,8 +2641,8 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2641
2641
|
let c = s.clientX, d = s.clientY, m = i.x, h = i.y;
|
|
2642
2642
|
if (l) {
|
|
2643
2643
|
const p = s.clientX - n.x, f = s.clientY - n.y;
|
|
2644
|
-
let g = 0,
|
|
2645
|
-
l === "ne" || l == "e" ? (g = p - (i.x + i.width),
|
|
2644
|
+
let g = 0, x = 0;
|
|
2645
|
+
l === "ne" || l == "e" ? (g = p - (i.x + i.width), x = f - i.y, m = i.x, h = i.y + i.height) : l === "se" || l === "s" ? (g = p - (i.x + i.width), x = f - (i.y + i.height), m = i.x, h = i.y) : l === "sw" || l == "w" ? (g = p - i.x, x = f - (i.y + i.height), m = i.x + i.width, h = i.y) : (l === "nw" || l == "n") && (g = p - i.x, x = f - i.y, m = i.x + i.width, h = i.y + i.height), c = m + n.x + g, d = h + n.y + x;
|
|
2646
2646
|
}
|
|
2647
2647
|
this.evData = {
|
|
2648
2648
|
startClientX: c,
|
|
@@ -2719,8 +2719,8 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2719
2719
|
s.stopPropagation(), s.preventDefault();
|
|
2720
2720
|
else
|
|
2721
2721
|
return;
|
|
2722
|
-
const f = (navigator.platform.match("Mac") ? s.metaKey : s.ctrlKey) ? bt.nudgeStepLarge : s.shiftKey ? bt.nudgeStepMedium : bt.nudgeStep, g = wt(n, p.width, p.height),
|
|
2723
|
-
|
|
2722
|
+
const f = (navigator.platform.match("Mac") ? s.metaKey : s.ctrlKey) ? bt.nudgeStepLarge : s.shiftKey ? bt.nudgeStepMedium : bt.nudgeStep, g = wt(n, p.width, p.height), x = Hu(g, s.key, f, a), _ = en(
|
|
2723
|
+
x,
|
|
2724
2724
|
r,
|
|
2725
2725
|
a,
|
|
2726
2726
|
p.width,
|
|
@@ -2730,9 +2730,9 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2730
2730
|
c,
|
|
2731
2731
|
d
|
|
2732
2732
|
);
|
|
2733
|
-
if (!Jr(n,
|
|
2734
|
-
const w = Kt(
|
|
2735
|
-
m(
|
|
2733
|
+
if (!Jr(n, _)) {
|
|
2734
|
+
const w = Kt(_, p.width, p.height);
|
|
2735
|
+
m(_, w), h && h(_, w);
|
|
2736
2736
|
}
|
|
2737
2737
|
}), Pe(this, "onDocPointerDone", (s) => {
|
|
2738
2738
|
const { crop: a, disabled: r, onComplete: n, onDragEnd: i } = this.props, l = this.getBox();
|
|
@@ -2832,7 +2832,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2832
2832
|
crop: l
|
|
2833
2833
|
} = this.props, u = this.getCropStyle();
|
|
2834
2834
|
if (l)
|
|
2835
|
-
return /* @__PURE__ */
|
|
2835
|
+
return /* @__PURE__ */ ue.createElement(
|
|
2836
2836
|
"div",
|
|
2837
2837
|
{
|
|
2838
2838
|
style: u,
|
|
@@ -2843,7 +2843,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2843
2843
|
onKeyDown: this.onComponentKeyDown,
|
|
2844
2844
|
role: "group"
|
|
2845
2845
|
},
|
|
2846
|
-
!a && !r && /* @__PURE__ */
|
|
2846
|
+
!a && !r && /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-elements", onFocus: this.onDragFocus }, /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-bar ord-n", "data-ord": "n" }), /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-bar ord-e", "data-ord": "e" }), /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-bar ord-s", "data-ord": "s" }), /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__drag-bar ord-w", "data-ord": "w" }), /* @__PURE__ */ ue.createElement(
|
|
2847
2847
|
"div",
|
|
2848
2848
|
{
|
|
2849
2849
|
className: "ReactCrop__drag-handle ord-nw",
|
|
@@ -2853,7 +2853,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2853
2853
|
onKeyDown: (c) => this.onHandlerKeyDown(c, "nw"),
|
|
2854
2854
|
role: "button"
|
|
2855
2855
|
}
|
|
2856
|
-
), /* @__PURE__ */
|
|
2856
|
+
), /* @__PURE__ */ ue.createElement(
|
|
2857
2857
|
"div",
|
|
2858
2858
|
{
|
|
2859
2859
|
className: "ReactCrop__drag-handle ord-n",
|
|
@@ -2863,7 +2863,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2863
2863
|
onKeyDown: (c) => this.onHandlerKeyDown(c, "n"),
|
|
2864
2864
|
role: "button"
|
|
2865
2865
|
}
|
|
2866
|
-
), /* @__PURE__ */
|
|
2866
|
+
), /* @__PURE__ */ ue.createElement(
|
|
2867
2867
|
"div",
|
|
2868
2868
|
{
|
|
2869
2869
|
className: "ReactCrop__drag-handle ord-ne",
|
|
@@ -2873,7 +2873,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2873
2873
|
onKeyDown: (c) => this.onHandlerKeyDown(c, "ne"),
|
|
2874
2874
|
role: "button"
|
|
2875
2875
|
}
|
|
2876
|
-
), /* @__PURE__ */
|
|
2876
|
+
), /* @__PURE__ */ ue.createElement(
|
|
2877
2877
|
"div",
|
|
2878
2878
|
{
|
|
2879
2879
|
className: "ReactCrop__drag-handle ord-e",
|
|
@@ -2883,7 +2883,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2883
2883
|
onKeyDown: (c) => this.onHandlerKeyDown(c, "e"),
|
|
2884
2884
|
role: "button"
|
|
2885
2885
|
}
|
|
2886
|
-
), /* @__PURE__ */
|
|
2886
|
+
), /* @__PURE__ */ ue.createElement(
|
|
2887
2887
|
"div",
|
|
2888
2888
|
{
|
|
2889
2889
|
className: "ReactCrop__drag-handle ord-se",
|
|
@@ -2893,7 +2893,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2893
2893
|
onKeyDown: (c) => this.onHandlerKeyDown(c, "se"),
|
|
2894
2894
|
role: "button"
|
|
2895
2895
|
}
|
|
2896
|
-
), /* @__PURE__ */
|
|
2896
|
+
), /* @__PURE__ */ ue.createElement(
|
|
2897
2897
|
"div",
|
|
2898
2898
|
{
|
|
2899
2899
|
className: "ReactCrop__drag-handle ord-s",
|
|
@@ -2903,7 +2903,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2903
2903
|
onKeyDown: (c) => this.onHandlerKeyDown(c, "s"),
|
|
2904
2904
|
role: "button"
|
|
2905
2905
|
}
|
|
2906
|
-
), /* @__PURE__ */
|
|
2906
|
+
), /* @__PURE__ */ ue.createElement(
|
|
2907
2907
|
"div",
|
|
2908
2908
|
{
|
|
2909
2909
|
className: "ReactCrop__drag-handle ord-sw",
|
|
@@ -2913,7 +2913,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2913
2913
|
onKeyDown: (c) => this.onHandlerKeyDown(c, "sw"),
|
|
2914
2914
|
role: "button"
|
|
2915
2915
|
}
|
|
2916
|
-
), /* @__PURE__ */
|
|
2916
|
+
), /* @__PURE__ */ ue.createElement(
|
|
2917
2917
|
"div",
|
|
2918
2918
|
{
|
|
2919
2919
|
className: "ReactCrop__drag-handle ord-w",
|
|
@@ -2924,8 +2924,8 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2924
2924
|
role: "button"
|
|
2925
2925
|
}
|
|
2926
2926
|
)),
|
|
2927
|
-
n && /* @__PURE__ */
|
|
2928
|
-
i && /* @__PURE__ */
|
|
2927
|
+
n && /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__selection-addon", onPointerDown: (c) => c.stopPropagation() }, n(this.state)),
|
|
2928
|
+
i && /* @__PURE__ */ ue.createElement(ue.Fragment, null, /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__rule-of-thirds-hz" }), /* @__PURE__ */ ue.createElement("div", { className: "ReactCrop__rule-of-thirds-vt" }))
|
|
2929
2929
|
);
|
|
2930
2930
|
}
|
|
2931
2931
|
makePixelCrop(s) {
|
|
@@ -2946,7 +2946,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2946
2946
|
!this.dragStarted && i && !i.width && !i.height && "ReactCrop--invisible-crop",
|
|
2947
2947
|
r && "ReactCrop--no-animate"
|
|
2948
2948
|
);
|
|
2949
|
-
return /* @__PURE__ */
|
|
2949
|
+
return /* @__PURE__ */ ue.createElement("div", { ref: this.componentRef, className: f, style: c }, /* @__PURE__ */ ue.createElement("div", { ref: this.mediaRef, className: "ReactCrop__child-wrapper", onPointerDown: this.onComponentPointerDown }, a), i ? /* @__PURE__ */ ue.createElement("svg", { className: "ReactCrop__crop-mask", width: "100%", height: "100%" }, /* @__PURE__ */ ue.createElement("defs", null, /* @__PURE__ */ ue.createElement("mask", { id: `hole-${this.instanceId}` }, /* @__PURE__ */ ue.createElement("rect", { width: "100%", height: "100%", fill: "white" }), r ? /* @__PURE__ */ ue.createElement(
|
|
2950
2950
|
"ellipse",
|
|
2951
2951
|
{
|
|
2952
2952
|
cx: `${i.x + i.width / 2}${i.unit}`,
|
|
@@ -2955,7 +2955,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2955
2955
|
ry: `${i.height / 2}${i.unit}`,
|
|
2956
2956
|
fill: "black"
|
|
2957
2957
|
}
|
|
2958
|
-
) : /* @__PURE__ */
|
|
2958
|
+
) : /* @__PURE__ */ ue.createElement(
|
|
2959
2959
|
"rect",
|
|
2960
2960
|
{
|
|
2961
2961
|
x: `${i.x}${i.unit}`,
|
|
@@ -2964,7 +2964,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2964
2964
|
height: `${i.height}${i.unit}`,
|
|
2965
2965
|
fill: "black"
|
|
2966
2966
|
}
|
|
2967
|
-
))), /* @__PURE__ */
|
|
2967
|
+
))), /* @__PURE__ */ ue.createElement("rect", { fill: "black", fillOpacity: 0.5, width: "100%", height: "100%", mask: `url(#hole-${this.instanceId})` })) : void 0, p);
|
|
2968
2968
|
}
|
|
2969
2969
|
};
|
|
2970
2970
|
Pe(Bt, "xOrds", ["e", "w"]), Pe(Bt, "yOrds", ["n", "s"]), Pe(Bt, "xyOrds", ["nw", "ne", "se", "sw"]), Pe(Bt, "nudgeStep", 1), Pe(Bt, "nudgeStepMedium", 10), Pe(Bt, "nudgeStepLarge", 100), Pe(Bt, "defaultProps", {
|
|
@@ -3011,7 +3011,7 @@ function Gu(t, s, a) {
|
|
|
3011
3011
|
} };
|
|
3012
3012
|
}
|
|
3013
3013
|
async function Wu(t, s, a, r, n, i, l, u, c = "image/jpeg", d = 0.9, m) {
|
|
3014
|
-
const h = m ? await createImageBitmap(m) : await createImageBitmap(t), p = h.width, f = h.height, g = 4096,
|
|
3014
|
+
const h = m ? await createImageBitmap(m) : await createImageBitmap(t), p = h.width, f = h.height, g = 4096, x = Math.max(p / s, f / a), _ = Math.round(s * x), w = Math.round(a * x), b = Math.min(1, g / _, g / w), j = x * b, v = Math.round(_ * b), C = Math.round(w * b), z = Math.min(v / p, C / f) * n, O = document.createElement("canvas");
|
|
3015
3015
|
O.width = v, O.height = C;
|
|
3016
3016
|
const U = O.getContext("2d");
|
|
3017
3017
|
if (!U) throw new Error("No 2d context");
|
|
@@ -3022,12 +3022,12 @@ async function Wu(t, s, a, r, n, i, l, u, c = "image/jpeg", d = 0.9, m) {
|
|
|
3022
3022
|
if (!K) throw new Error("No 2d context");
|
|
3023
3023
|
return K.imageSmoothingQuality = "high", K.imageSmoothingEnabled = !0, K.drawImage(O, E, P, A, M, 0, 0, A, M), new Promise((W, D) => {
|
|
3024
3024
|
S.toBlob(
|
|
3025
|
-
(
|
|
3026
|
-
if (!
|
|
3025
|
+
(R) => {
|
|
3026
|
+
if (!R) {
|
|
3027
3027
|
D(new Error("Canvas is empty"));
|
|
3028
3028
|
return;
|
|
3029
3029
|
}
|
|
3030
|
-
const T = new File([
|
|
3030
|
+
const T = new File([R], u, { type: c });
|
|
3031
3031
|
W(T);
|
|
3032
3032
|
},
|
|
3033
3033
|
c,
|
|
@@ -3494,15 +3494,15 @@ function fm(t) {
|
|
|
3494
3494
|
language_iso: n?.language_iso
|
|
3495
3495
|
}), f = p.meta.pagination?.next_cursor;
|
|
3496
3496
|
f && a.set(i + 1, f);
|
|
3497
|
-
const g = p.media.map(Ss),
|
|
3497
|
+
const g = p.media.map(Ss), x = n?.per_page ?? 24, _ = f ? i * x + 1 : (i - 1) * x + g.length;
|
|
3498
3498
|
return {
|
|
3499
3499
|
data: g,
|
|
3500
3500
|
status: "success",
|
|
3501
3501
|
media: g,
|
|
3502
3502
|
meta: {
|
|
3503
|
-
total_count:
|
|
3503
|
+
total_count: _,
|
|
3504
3504
|
current: i,
|
|
3505
|
-
per_page:
|
|
3505
|
+
per_page: x,
|
|
3506
3506
|
pages: f ? i + 1 : i,
|
|
3507
3507
|
next: f ? i + 1 : null,
|
|
3508
3508
|
previous: i > 1 ? i - 1 : null
|
|
@@ -3991,7 +3991,7 @@ function ln(t) {
|
|
|
3991
3991
|
} : void 0
|
|
3992
3992
|
};
|
|
3993
3993
|
}
|
|
3994
|
-
function
|
|
3994
|
+
function Ri(t) {
|
|
3995
3995
|
return {
|
|
3996
3996
|
listShares: async (s) => {
|
|
3997
3997
|
const a = await je.shares_list(t, {
|
|
@@ -4014,7 +4014,7 @@ function Li(t) {
|
|
|
4014
4014
|
}
|
|
4015
4015
|
};
|
|
4016
4016
|
}
|
|
4017
|
-
const
|
|
4017
|
+
const Li = {
|
|
4018
4018
|
Medium: "media",
|
|
4019
4019
|
media: "media",
|
|
4020
4020
|
Product: "product",
|
|
@@ -4026,15 +4026,15 @@ const Ri = {
|
|
|
4026
4026
|
Page: "page",
|
|
4027
4027
|
page: "page"
|
|
4028
4028
|
}, vm = [
|
|
4029
|
-
...new Set(Object.values(
|
|
4029
|
+
...new Set(Object.values(Li))
|
|
4030
4030
|
].join(", ");
|
|
4031
4031
|
function jm(t) {
|
|
4032
|
-
const s =
|
|
4032
|
+
const s = Ri(t);
|
|
4033
4033
|
return {
|
|
4034
4034
|
createShareLink: async (a) => {
|
|
4035
4035
|
if (!a.relateableId)
|
|
4036
4036
|
throw new Error("Cannot create share link without a relateableId");
|
|
4037
|
-
const r =
|
|
4037
|
+
const r = Li[a.relateableType];
|
|
4038
4038
|
if (!r)
|
|
4039
4039
|
throw new Error(
|
|
4040
4040
|
`Cannot share a "${a.relateableType}" — shareable links support only ${vm}.`
|
|
@@ -4468,7 +4468,7 @@ function Em(t) {
|
|
|
4468
4468
|
return Ii(t);
|
|
4469
4469
|
}
|
|
4470
4470
|
function Mm(t) {
|
|
4471
|
-
return
|
|
4471
|
+
return Ri(t);
|
|
4472
4472
|
}
|
|
4473
4473
|
function Fm(t) {
|
|
4474
4474
|
return Oi(t);
|
|
@@ -4479,7 +4479,7 @@ function Im(t) {
|
|
|
4479
4479
|
function Dm(t) {
|
|
4480
4480
|
return zi(t);
|
|
4481
4481
|
}
|
|
4482
|
-
function
|
|
4482
|
+
function Rm(t) {
|
|
4483
4483
|
return wm(t);
|
|
4484
4484
|
}
|
|
4485
4485
|
async function pn(t, s, a) {
|
|
@@ -4492,7 +4492,7 @@ async function pn(t, s, a) {
|
|
|
4492
4492
|
})).is_favorited };
|
|
4493
4493
|
}
|
|
4494
4494
|
const Ui = o.createContext(null);
|
|
4495
|
-
function
|
|
4495
|
+
function Lm() {
|
|
4496
4496
|
const t = o.use(Ui);
|
|
4497
4497
|
if (!t)
|
|
4498
4498
|
throw new Error(
|
|
@@ -4516,7 +4516,7 @@ function Hi({
|
|
|
4516
4516
|
() => Dm(a),
|
|
4517
4517
|
[a]
|
|
4518
4518
|
), c = o.useMemo(
|
|
4519
|
-
() =>
|
|
4519
|
+
() => Rm(s),
|
|
4520
4520
|
[s]
|
|
4521
4521
|
), d = o.useMemo(
|
|
4522
4522
|
() => pm(a),
|
|
@@ -4727,7 +4727,7 @@ function Vi() {
|
|
|
4727
4727
|
HTMLFormElement: h,
|
|
4728
4728
|
DOMParser: p,
|
|
4729
4729
|
trustedTypes: f
|
|
4730
|
-
} = t, g = c.prototype,
|
|
4730
|
+
} = t, g = c.prototype, x = Es(g, "cloneNode"), _ = Es(g, "remove"), w = Es(g, "nextSibling"), b = Es(g, "childNodes"), j = Es(g, "parentNode");
|
|
4731
4731
|
if (typeof l == "function") {
|
|
4732
4732
|
const ie = a.createElement("template");
|
|
4733
4733
|
ie.content && ie.content.ownerDocument && (a = ie.content.ownerDocument);
|
|
@@ -4750,7 +4750,7 @@ function Vi() {
|
|
|
4750
4750
|
DATA_ATTR: K,
|
|
4751
4751
|
ARIA_ATTR: W,
|
|
4752
4752
|
IS_SCRIPT_OR_DATA: D,
|
|
4753
|
-
ATTR_WHITESPACE:
|
|
4753
|
+
ATTR_WHITESPACE: R,
|
|
4754
4754
|
CUSTOM_ELEMENT: T
|
|
4755
4755
|
} = bn;
|
|
4756
4756
|
let {
|
|
@@ -4793,20 +4793,20 @@ function Vi() {
|
|
|
4793
4793
|
value: null
|
|
4794
4794
|
}
|
|
4795
4795
|
}));
|
|
4796
|
-
let F = !0,
|
|
4796
|
+
let F = !0, L = !0, Y = !1, Z = !0, J = !1, me = !0, k = !1, oe = !1, ye = !1, fe = !1, X = !1, le = !1, We = !0, Be = !1;
|
|
4797
4797
|
const tt = "user-content-";
|
|
4798
4798
|
let Qe = !0, Pt = !1, V = {}, ae = null;
|
|
4799
4799
|
const pe = xe({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
4800
4800
|
let ge = null;
|
|
4801
|
-
const
|
|
4801
|
+
const Le = xe({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
4802
4802
|
let Ue = null;
|
|
4803
4803
|
const Qt = xe({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), vt = "http://www.w3.org/1998/Math/MathML", Tt = "http://www.w3.org/2000/svg", st = "http://www.w3.org/1999/xhtml";
|
|
4804
4804
|
let at = st, Yt = !1, $t = null;
|
|
4805
|
-
const
|
|
4805
|
+
const Ra = xe({}, [vt, Tt, st], Va);
|
|
4806
4806
|
let Ut = xe({}, ["mi", "mo", "mn", "ms", "mtext"]), Xt = xe({}, ["annotation-xml"]);
|
|
4807
4807
|
const ws = xe({}, ["title", "style", "font", "a", "script"]);
|
|
4808
4808
|
let Ht = null;
|
|
4809
|
-
const
|
|
4809
|
+
const La = ["application/xhtml+xml", "text/html"], za = "text/html";
|
|
4810
4810
|
let Me = null, qt = null;
|
|
4811
4811
|
const Oa = a.createElement("form"), Xs = function(y) {
|
|
4812
4812
|
return y instanceof RegExp || y instanceof Function;
|
|
@@ -4814,7 +4814,7 @@ function Vi() {
|
|
|
4814
4814
|
let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
4815
4815
|
if (!(qt && qt === y)) {
|
|
4816
4816
|
if ((!y || typeof y != "object") && (y = {}), y = jt(y), Ht = // eslint-disable-next-line unicorn/prefer-includes
|
|
4817
|
-
|
|
4817
|
+
La.indexOf(y.PARSER_MEDIA_TYPE) === -1 ? za : y.PARSER_MEDIA_TYPE, Me = Ht === "application/xhtml+xml" ? Va : ma, $ = pt(y, "ALLOWED_TAGS") ? xe({}, y.ALLOWED_TAGS, Me) : se, G = pt(y, "ALLOWED_ATTR") ? xe({}, y.ALLOWED_ATTR, Me) : q, $t = pt(y, "ALLOWED_NAMESPACES") ? xe({}, y.ALLOWED_NAMESPACES, Va) : Ra, Ue = pt(y, "ADD_URI_SAFE_ATTR") ? xe(jt(Qt), y.ADD_URI_SAFE_ATTR, Me) : Qt, ge = pt(y, "ADD_DATA_URI_TAGS") ? xe(jt(Le), y.ADD_DATA_URI_TAGS, Me) : Le, ae = pt(y, "FORBID_CONTENTS") ? xe({}, y.FORBID_CONTENTS, Me) : pe, he = pt(y, "FORBID_TAGS") ? xe({}, y.FORBID_TAGS, Me) : jt({}), we = pt(y, "FORBID_ATTR") ? xe({}, y.FORBID_ATTR, Me) : jt({}), V = pt(y, "USE_PROFILES") ? y.USE_PROFILES : !1, F = y.ALLOW_ARIA_ATTR !== !1, L = y.ALLOW_DATA_ATTR !== !1, Y = y.ALLOW_UNKNOWN_PROTOCOLS || !1, Z = y.ALLOW_SELF_CLOSE_IN_ATTR !== !1, J = y.SAFE_FOR_TEMPLATES || !1, me = y.SAFE_FOR_XML !== !1, k = y.WHOLE_DOCUMENT || !1, fe = y.RETURN_DOM || !1, X = y.RETURN_DOM_FRAGMENT || !1, le = y.RETURN_TRUSTED_TYPE || !1, ye = y.FORCE_BODY || !1, We = y.SANITIZE_DOM !== !1, Be = y.SANITIZE_NAMED_PROPS || !1, Qe = y.KEEP_CONTENT !== !1, Pt = y.IN_PLACE || !1, I = y.ALLOWED_URI_REGEXP || Bi, at = y.NAMESPACE || st, Ut = y.MATHML_TEXT_INTEGRATION_POINTS || Ut, Xt = y.HTML_INTEGRATION_POINTS || Xt, B = y.CUSTOM_ELEMENT_HANDLING || {}, y.CUSTOM_ELEMENT_HANDLING && Xs(y.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (B.tagNameCheck = y.CUSTOM_ELEMENT_HANDLING.tagNameCheck), y.CUSTOM_ELEMENT_HANDLING && Xs(y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (B.attributeNameCheck = y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), y.CUSTOM_ELEMENT_HANDLING && typeof y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), J && (L = !1), X && (fe = !0), V && ($ = xe({}, _n), G = ua(null), V.html === !0 && (xe($, gn), xe(G, xn)), V.svg === !0 && (xe($, Wa), xe(G, Xa), xe(G, la)), V.svgFilters === !0 && (xe($, Qa), xe(G, Xa), xe(G, la)), V.mathMl === !0 && (xe($, Ya), xe(G, yn), xe(G, la))), pt(y, "ADD_TAGS") || (_e.tagCheck = null), pt(y, "ADD_ATTR") || (_e.attributeCheck = null), y.ADD_TAGS && (typeof y.ADD_TAGS == "function" ? _e.tagCheck = y.ADD_TAGS : ($ === se && ($ = jt($)), xe($, y.ADD_TAGS, Me))), y.ADD_ATTR && (typeof y.ADD_ATTR == "function" ? _e.attributeCheck = y.ADD_ATTR : (G === q && (G = jt(G)), xe(G, y.ADD_ATTR, Me))), y.ADD_URI_SAFE_ATTR && xe(Ue, y.ADD_URI_SAFE_ATTR, Me), y.FORBID_CONTENTS && (ae === pe && (ae = jt(ae)), xe(ae, y.FORBID_CONTENTS, Me)), y.ADD_FORBID_CONTENTS && (ae === pe && (ae = jt(ae)), xe(ae, y.ADD_FORBID_CONTENTS, Me)), Qe && ($["#text"] = !0), k && xe($, ["html", "head", "body"]), $.table && (xe($, ["tbody"]), delete he.tbody), y.TRUSTED_TYPES_POLICY) {
|
|
4818
4818
|
if (typeof y.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
4819
4819
|
throw As('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
4820
4820
|
if (typeof y.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -4839,7 +4839,7 @@ function Vi() {
|
|
|
4839
4839
|
try {
|
|
4840
4840
|
j(y).removeChild(y);
|
|
4841
4841
|
} catch {
|
|
4842
|
-
|
|
4842
|
+
_(y);
|
|
4843
4843
|
}
|
|
4844
4844
|
}, At = function(y, Q) {
|
|
4845
4845
|
try {
|
|
@@ -4901,17 +4901,17 @@ function Vi() {
|
|
|
4901
4901
|
}, ee = function(y) {
|
|
4902
4902
|
return typeof u == "function" && y instanceof u;
|
|
4903
4903
|
};
|
|
4904
|
-
function
|
|
4904
|
+
function ce(ie, y, Q) {
|
|
4905
4905
|
ia(ie, (re) => {
|
|
4906
4906
|
re.call(s, y, Q, qt);
|
|
4907
4907
|
});
|
|
4908
4908
|
}
|
|
4909
|
-
const
|
|
4909
|
+
const de = function(y) {
|
|
4910
4910
|
let Q = null;
|
|
4911
|
-
if (
|
|
4911
|
+
if (ce(P.beforeSanitizeElements, y, null), is(y))
|
|
4912
4912
|
return mt(y), !0;
|
|
4913
4913
|
const re = Me(y.nodeName);
|
|
4914
|
-
if (
|
|
4914
|
+
if (ce(P.uponSanitizeElement, y, {
|
|
4915
4915
|
tagName: re,
|
|
4916
4916
|
allowedTags: $
|
|
4917
4917
|
}), me && y.hasChildNodes() && !ee(y.firstElementChild) && Ye(/<[/\w!]/g, y.innerHTML) && Ye(/<[/\w!]/g, y.textContent) || y.nodeType === Ms.progressingInstruction || me && y.nodeType === Ms.comment && Ye(/<[/\w]/g, y.data))
|
|
@@ -4924,7 +4924,7 @@ function Vi() {
|
|
|
4924
4924
|
if (Ke && Se) {
|
|
4925
4925
|
const Ie = Ke.length;
|
|
4926
4926
|
for (let rt = Ie - 1; rt >= 0; --rt) {
|
|
4927
|
-
const Et =
|
|
4927
|
+
const Et = x(Ke[rt], !0);
|
|
4928
4928
|
Et.__removalCount = (y.__removalCount || 0) + 1, Se.insertBefore(Et, w(y));
|
|
4929
4929
|
}
|
|
4930
4930
|
}
|
|
@@ -4935,11 +4935,11 @@ function Vi() {
|
|
|
4935
4935
|
Q = Ts(Q, Se, " ");
|
|
4936
4936
|
}), y.textContent !== Q && (Ps(s.removed, {
|
|
4937
4937
|
element: y.cloneNode()
|
|
4938
|
-
}), y.textContent = Q)),
|
|
4938
|
+
}), y.textContent = Q)), ce(P.afterSanitizeElements, y, null), !1);
|
|
4939
4939
|
}, Te = function(y, Q, re) {
|
|
4940
4940
|
if (we[Q] || We && (Q === "id" || Q === "name") && (re in a || re in Oa))
|
|
4941
4941
|
return !1;
|
|
4942
|
-
if (!(
|
|
4942
|
+
if (!(L && !we[Q] && Ye(K, Q))) {
|
|
4943
4943
|
if (!(F && Ye(W, Q))) {
|
|
4944
4944
|
if (!(_e.attributeCheck instanceof Function && _e.attributeCheck(Q, y))) {
|
|
4945
4945
|
if (!G[Q] || we[Q]) {
|
|
@@ -4952,9 +4952,9 @@ function Vi() {
|
|
|
4952
4952
|
Q === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Ye(B.tagNameCheck, re) || B.tagNameCheck instanceof Function && B.tagNameCheck(re)))
|
|
4953
4953
|
) return !1;
|
|
4954
4954
|
} else if (!Ue[Q]) {
|
|
4955
|
-
if (!Ye(I, Ts(re,
|
|
4955
|
+
if (!Ye(I, Ts(re, R, ""))) {
|
|
4956
4956
|
if (!((Q === "src" || Q === "xlink:href" || Q === "href") && y !== "script" && qm(re, "data:") === 0 && ge[y])) {
|
|
4957
|
-
if (!(Y && !Ye(D, Ts(re,
|
|
4957
|
+
if (!(Y && !Ye(D, Ts(re, R, "")))) {
|
|
4958
4958
|
if (re)
|
|
4959
4959
|
return !1;
|
|
4960
4960
|
}
|
|
@@ -4968,7 +4968,7 @@ function Vi() {
|
|
|
4968
4968
|
}, ea = function(y) {
|
|
4969
4969
|
return y !== "annotation-xml" && Ga(y, T);
|
|
4970
4970
|
}, $r = function(y) {
|
|
4971
|
-
|
|
4971
|
+
ce(P.beforeSanitizeAttributes, y, null);
|
|
4972
4972
|
const {
|
|
4973
4973
|
attributes: Q
|
|
4974
4974
|
} = y;
|
|
@@ -4989,7 +4989,7 @@ function Vi() {
|
|
|
4989
4989
|
value: Et
|
|
4990
4990
|
} = Ke, ls = Me(Ie), $a = Et;
|
|
4991
4991
|
let He = Ie === "value" ? $a : Bm($a);
|
|
4992
|
-
if (re.attrName = ls, re.attrValue = He, re.keepAttr = !0, re.forceKeepAttr = void 0,
|
|
4992
|
+
if (re.attrName = ls, re.attrValue = He, re.keepAttr = !0, re.forceKeepAttr = void 0, ce(P.uponSanitizeAttribute, y, re), He = re.attrValue, Be && (ls === "id" || ls === "name") && (At(Ie, y), He = tt + He), me && Ye(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, He)) {
|
|
4993
4993
|
At(Ie, y);
|
|
4994
4994
|
continue;
|
|
4995
4995
|
}
|
|
@@ -5033,13 +5033,13 @@ function Vi() {
|
|
|
5033
5033
|
At(Ie, y);
|
|
5034
5034
|
}
|
|
5035
5035
|
}
|
|
5036
|
-
|
|
5036
|
+
ce(P.afterSanitizeAttributes, y, null);
|
|
5037
5037
|
}, Nl = function ie(y) {
|
|
5038
5038
|
let Q = null;
|
|
5039
5039
|
const re = Js(y);
|
|
5040
|
-
for (
|
|
5041
|
-
|
|
5042
|
-
|
|
5040
|
+
for (ce(P.beforeSanitizeShadowDOM, y, null); Q = re.nextNode(); )
|
|
5041
|
+
ce(P.uponSanitizeShadowNode, Q, null), de(Q), $r(Q), Q.content instanceof i && ie(Q.content);
|
|
5042
|
+
ce(P.afterSanitizeShadowDOM, y, null);
|
|
5043
5043
|
};
|
|
5044
5044
|
return s.sanitize = function(ie) {
|
|
5045
5045
|
let y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Q = null, re = null, Se = null, Ke = null;
|
|
@@ -5051,7 +5051,7 @@ function Vi() {
|
|
|
5051
5051
|
throw As("toString is not a function");
|
|
5052
5052
|
if (!s.isSupported)
|
|
5053
5053
|
return ie;
|
|
5054
|
-
if (
|
|
5054
|
+
if (oe || Ns(y), s.removed = [], typeof ie == "string" && (Pt = !1), Pt) {
|
|
5055
5055
|
if (ie.nodeName) {
|
|
5056
5056
|
const Et = Me(ie.nodeName);
|
|
5057
5057
|
if (!$[Et] || he[Et])
|
|
@@ -5069,7 +5069,7 @@ function Vi() {
|
|
|
5069
5069
|
Q && ye && mt(Q.firstChild);
|
|
5070
5070
|
const Ie = Js(Pt ? ie : Q);
|
|
5071
5071
|
for (; Se = Ie.nextNode(); )
|
|
5072
|
-
|
|
5072
|
+
de(Se), $r(Se), Se.content instanceof i && Nl(Se.content);
|
|
5073
5073
|
if (Pt)
|
|
5074
5074
|
return ie;
|
|
5075
5075
|
if (fe) {
|
|
@@ -5087,9 +5087,9 @@ function Vi() {
|
|
|
5087
5087
|
}), v && le ? v.createHTML(rt) : rt;
|
|
5088
5088
|
}, s.setConfig = function() {
|
|
5089
5089
|
let ie = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
5090
|
-
Ns(ie),
|
|
5090
|
+
Ns(ie), oe = !0;
|
|
5091
5091
|
}, s.clearConfig = function() {
|
|
5092
|
-
qt = null,
|
|
5092
|
+
qt = null, oe = !1;
|
|
5093
5093
|
}, s.isValidAttribute = function(ie, y, Q) {
|
|
5094
5094
|
qt || Ns({});
|
|
5095
5095
|
const re = Me(ie), Se = Me(y);
|
|
@@ -5108,7 +5108,7 @@ function Vi() {
|
|
|
5108
5108
|
P = vn();
|
|
5109
5109
|
}, s;
|
|
5110
5110
|
}
|
|
5111
|
-
var
|
|
5111
|
+
var Re = Vi();
|
|
5112
5112
|
function Gs({
|
|
5113
5113
|
searchValue: t,
|
|
5114
5114
|
onSearchChange: s,
|
|
@@ -5409,6 +5409,8 @@ const np = {
|
|
|
5409
5409
|
playlist_item_already_exists: "This item is already in the playlist",
|
|
5410
5410
|
playlist_item_already_exists_named: "{{title}} already has this item",
|
|
5411
5411
|
playlist_delete_item: "Delete Item",
|
|
5412
|
+
playlist_drag_to_reorder_aria: "Drag to reorder {{title}}",
|
|
5413
|
+
playlist_item_actions_aria: "Actions for {{title}}",
|
|
5412
5414
|
playlist_table_order: "Order",
|
|
5413
5415
|
playlist_table_item: "Item",
|
|
5414
5416
|
playlist_table_type: "Type",
|
|
@@ -5573,106 +5575,106 @@ const np = {
|
|
|
5573
5575
|
}, ip = Co({
|
|
5574
5576
|
fallback: np,
|
|
5575
5577
|
loaders: {
|
|
5576
|
-
ar: () => import("./ar-
|
|
5578
|
+
ar: () => import("./ar-ClhIoz6a.js").then(
|
|
5577
5579
|
(t) => t.default
|
|
5578
5580
|
),
|
|
5579
|
-
bg: () => import("./bg-
|
|
5581
|
+
bg: () => import("./bg-BksVMhMy.js").then(
|
|
5580
5582
|
(t) => t.default
|
|
5581
5583
|
),
|
|
5582
|
-
bn: () => import("./bn-
|
|
5584
|
+
bn: () => import("./bn-Jn0udx5-.js").then(
|
|
5583
5585
|
(t) => t.default
|
|
5584
5586
|
),
|
|
5585
|
-
cs: () => import("./cs-
|
|
5587
|
+
cs: () => import("./cs-CMdINoT1.js").then(
|
|
5586
5588
|
(t) => t.default
|
|
5587
5589
|
),
|
|
5588
|
-
da: () => import("./da-
|
|
5590
|
+
da: () => import("./da-D25F0yGh.js").then(
|
|
5589
5591
|
(t) => t.default
|
|
5590
5592
|
),
|
|
5591
|
-
de: () => import("./de-
|
|
5593
|
+
de: () => import("./de-CZiafs2R.js").then(
|
|
5592
5594
|
(t) => t.default
|
|
5593
5595
|
),
|
|
5594
|
-
el: () => import("./el-
|
|
5596
|
+
el: () => import("./el-BWLIj7n7.js").then(
|
|
5595
5597
|
(t) => t.default
|
|
5596
5598
|
),
|
|
5597
|
-
es: () => import("./es-
|
|
5599
|
+
es: () => import("./es-pIE-fFV2.js").then(
|
|
5598
5600
|
(t) => t.default
|
|
5599
5601
|
),
|
|
5600
|
-
fi: () => import("./fi-
|
|
5602
|
+
fi: () => import("./fi-BEqBi0iR.js").then(
|
|
5601
5603
|
(t) => t.default
|
|
5602
5604
|
),
|
|
5603
|
-
fr: () => import("./fr-
|
|
5605
|
+
fr: () => import("./fr-BsEpyTmn.js").then(
|
|
5604
5606
|
(t) => t.default
|
|
5605
5607
|
),
|
|
5606
|
-
he: () => import("./he-
|
|
5608
|
+
he: () => import("./he-CVyG1N7p.js").then(
|
|
5607
5609
|
(t) => t.default
|
|
5608
5610
|
),
|
|
5609
|
-
hi: () => import("./hi-
|
|
5611
|
+
hi: () => import("./hi-CA89BVKL.js").then(
|
|
5610
5612
|
(t) => t.default
|
|
5611
5613
|
),
|
|
5612
|
-
hr: () => import("./hr-
|
|
5614
|
+
hr: () => import("./hr-Dbk-j9u8.js").then(
|
|
5613
5615
|
(t) => t.default
|
|
5614
5616
|
),
|
|
5615
|
-
hu: () => import("./hu-
|
|
5617
|
+
hu: () => import("./hu-D6LKkyaV.js").then(
|
|
5616
5618
|
(t) => t.default
|
|
5617
5619
|
),
|
|
5618
|
-
id: () => import("./id-
|
|
5620
|
+
id: () => import("./id-BGR9VsQZ.js").then(
|
|
5619
5621
|
(t) => t.default
|
|
5620
5622
|
),
|
|
5621
|
-
it: () => import("./it-
|
|
5623
|
+
it: () => import("./it-B1r6jnOe.js").then(
|
|
5622
5624
|
(t) => t.default
|
|
5623
5625
|
),
|
|
5624
|
-
ja: () => import("./ja-
|
|
5626
|
+
ja: () => import("./ja-BpANsj6V.js").then(
|
|
5625
5627
|
(t) => t.default
|
|
5626
5628
|
),
|
|
5627
|
-
ko: () => import("./ko-
|
|
5629
|
+
ko: () => import("./ko-DX3tlkQ_.js").then(
|
|
5628
5630
|
(t) => t.default
|
|
5629
5631
|
),
|
|
5630
|
-
ms: () => import("./ms
|
|
5632
|
+
ms: () => import("./ms--yFb9SFW.js").then(
|
|
5631
5633
|
(t) => t.default
|
|
5632
5634
|
),
|
|
5633
|
-
nl: () => import("./nl-
|
|
5635
|
+
nl: () => import("./nl-H9XiHH5i.js").then(
|
|
5634
5636
|
(t) => t.default
|
|
5635
5637
|
),
|
|
5636
|
-
no: () => import("./no-
|
|
5638
|
+
no: () => import("./no-BEW-_XcJ.js").then(
|
|
5637
5639
|
(t) => t.default
|
|
5638
5640
|
),
|
|
5639
|
-
pl: () => import("./pl-
|
|
5641
|
+
pl: () => import("./pl-CrFhIzj-.js").then(
|
|
5640
5642
|
(t) => t.default
|
|
5641
5643
|
),
|
|
5642
|
-
pt: () => import("./pt-
|
|
5644
|
+
pt: () => import("./pt-DlaqLtk5.js").then(
|
|
5643
5645
|
(t) => t.default
|
|
5644
5646
|
),
|
|
5645
|
-
ro: () => import("./ro-
|
|
5647
|
+
ro: () => import("./ro-gd_dWaXs.js").then(
|
|
5646
5648
|
(t) => t.default
|
|
5647
5649
|
),
|
|
5648
|
-
ru: () => import("./ru-
|
|
5650
|
+
ru: () => import("./ru-DlyR-9Mq.js").then(
|
|
5649
5651
|
(t) => t.default
|
|
5650
5652
|
),
|
|
5651
|
-
sk: () => import("./sk-
|
|
5653
|
+
sk: () => import("./sk-BhsGydo4.js").then(
|
|
5652
5654
|
(t) => t.default
|
|
5653
5655
|
),
|
|
5654
|
-
sv: () => import("./sv-
|
|
5656
|
+
sv: () => import("./sv-B0ht7qZg.js").then(
|
|
5655
5657
|
(t) => t.default
|
|
5656
5658
|
),
|
|
5657
|
-
th: () => import("./th-
|
|
5659
|
+
th: () => import("./th-ccJQMGOp.js").then(
|
|
5658
5660
|
(t) => t.default
|
|
5659
5661
|
),
|
|
5660
|
-
tl: () => import("./tl-
|
|
5662
|
+
tl: () => import("./tl-Bq05C1ac.js").then(
|
|
5661
5663
|
(t) => t.default
|
|
5662
5664
|
),
|
|
5663
|
-
tr: () => import("./tr-
|
|
5665
|
+
tr: () => import("./tr-CRzzw4Hc.js").then(
|
|
5664
5666
|
(t) => t.default
|
|
5665
5667
|
),
|
|
5666
|
-
uk: () => import("./uk-
|
|
5668
|
+
uk: () => import("./uk-Dn_JPwF7.js").then(
|
|
5667
5669
|
(t) => t.default
|
|
5668
5670
|
),
|
|
5669
|
-
vi: () => import("./vi-
|
|
5671
|
+
vi: () => import("./vi-LxWc0tDK.js").then(
|
|
5670
5672
|
(t) => t.default
|
|
5671
5673
|
),
|
|
5672
|
-
zh_CN: () => import("./zh_CN-
|
|
5674
|
+
zh_CN: () => import("./zh_CN-795k0aqz.js").then(
|
|
5673
5675
|
(t) => t.default
|
|
5674
5676
|
),
|
|
5675
|
-
zh_TW: () => import("./zh_TW-
|
|
5677
|
+
zh_TW: () => import("./zh_TW-pxcxIx6W.js").then(
|
|
5676
5678
|
(t) => t.default
|
|
5677
5679
|
)
|
|
5678
5680
|
}
|
|
@@ -5725,18 +5727,18 @@ function Ee() {
|
|
|
5725
5727
|
function Ws() {
|
|
5726
5728
|
return Ee().canCuratePlaylists !== !1;
|
|
5727
5729
|
}
|
|
5728
|
-
var Gi =
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5730
|
+
var Gi = Re;
|
|
5731
|
+
Re.sanitize.bind(Re);
|
|
5732
|
+
Re.isSupported;
|
|
5733
|
+
Re.addHook.bind(Re);
|
|
5734
|
+
Re.removeHook.bind(Re);
|
|
5735
|
+
Re.removeHooks.bind(Re);
|
|
5736
|
+
Re.removeAllHooks.bind(Re);
|
|
5737
|
+
Re.setConfig.bind(Re);
|
|
5738
|
+
Re.clearConfig.bind(Re);
|
|
5739
|
+
Re.isValidAttribute.bind(Re);
|
|
5740
|
+
Re.version;
|
|
5741
|
+
Re.removed;
|
|
5740
5742
|
const up = {
|
|
5741
5743
|
amp: "&",
|
|
5742
5744
|
apos: "'",
|
|
@@ -6127,30 +6129,30 @@ function Mp({
|
|
|
6127
6129
|
{ label: i("sort_price_desc"), value: "price_desc" }
|
|
6128
6130
|
],
|
|
6129
6131
|
[i]
|
|
6130
|
-
), [c, d] = o.useState(""), [m, h] = o.useState(""), [p, f] = o.useState("created_at_desc"), [g,
|
|
6132
|
+
), [c, d] = o.useState(""), [m, h] = o.useState(""), [p, f] = o.useState("created_at_desc"), [g, x] = o.useState("grid");
|
|
6131
6133
|
o.useEffect(() => {
|
|
6132
6134
|
const S = setTimeout(() => {
|
|
6133
6135
|
h(c);
|
|
6134
6136
|
}, 300);
|
|
6135
6137
|
return () => clearTimeout(S);
|
|
6136
6138
|
}, [c]);
|
|
6137
|
-
const
|
|
6139
|
+
const _ = m ? void 0 : p, w = Lt({
|
|
6138
6140
|
queryKey: [
|
|
6139
6141
|
"portal-product-catalog",
|
|
6140
6142
|
m || "",
|
|
6141
6143
|
oa,
|
|
6142
|
-
|
|
6144
|
+
_
|
|
6143
6145
|
],
|
|
6144
6146
|
queryFn: async ({ pageParam: S }) => s(
|
|
6145
6147
|
m,
|
|
6146
6148
|
S,
|
|
6147
6149
|
oa,
|
|
6148
|
-
|
|
6150
|
+
_
|
|
6149
6151
|
),
|
|
6150
6152
|
getNextPageParam: (S) => S.meta?.pagination?.next_cursor ?? void 0,
|
|
6151
6153
|
initialPageParam: void 0,
|
|
6152
6154
|
enabled: !!s
|
|
6153
|
-
}), b =
|
|
6155
|
+
}), b = Lt({
|
|
6154
6156
|
queryKey: ["shareables-products", m, t],
|
|
6155
6157
|
queryFn: async ({ pageParam: S = 1 }) => {
|
|
6156
6158
|
if (!r) throw new Error("Unreachable: client is null");
|
|
@@ -6216,7 +6218,7 @@ function Mp({
|
|
|
6216
6218
|
onSortChange: f
|
|
6217
6219
|
}
|
|
6218
6220
|
) }),
|
|
6219
|
-
/* @__PURE__ */ e.jsx(Mr, { value: g, onChange:
|
|
6221
|
+
/* @__PURE__ */ e.jsx(Mr, { value: g, onChange: x })
|
|
6220
6222
|
] }),
|
|
6221
6223
|
loadingFilterShape: "search-view",
|
|
6222
6224
|
footer: M,
|
|
@@ -6269,12 +6271,12 @@ function Aa({
|
|
|
6269
6271
|
pdfNextAriaLabel: d,
|
|
6270
6272
|
pdfDocumentTitle: m
|
|
6271
6273
|
}) {
|
|
6272
|
-
const [h, p] = o.useState(!1), [f, g] = o.useState(1), [
|
|
6274
|
+
const [h, p] = o.useState(!1), [f, g] = o.useState(1), [x, _] = o.useState(!1), w = o.useRef(null), b = Ot(), { t: j } = ne(), v = s || i, C = !!t && !x, N = v ? j("open_image_viewer_for", { title: v }) : j("open_image_viewer"), z = h && !n && !r && C, O = c ?? j("pdf_previous_page_aria"), U = d ?? j("pdf_next_page_aria"), E = m || j("pdf_document_title");
|
|
6273
6275
|
o.useEffect(() => {
|
|
6274
|
-
|
|
6276
|
+
_(!1);
|
|
6275
6277
|
}, [t]);
|
|
6276
6278
|
const P = () => {
|
|
6277
|
-
|
|
6279
|
+
_(!0), p(!1);
|
|
6278
6280
|
}, A = () => {
|
|
6279
6281
|
g((S) => S > 1 ? S - 1 : S);
|
|
6280
6282
|
}, M = () => {
|
|
@@ -6575,7 +6577,7 @@ function Dp(t) {
|
|
|
6575
6577
|
}
|
|
6576
6578
|
);
|
|
6577
6579
|
}
|
|
6578
|
-
function
|
|
6580
|
+
function Rp(t) {
|
|
6579
6581
|
return /* @__PURE__ */ e.jsx(
|
|
6580
6582
|
"svg",
|
|
6581
6583
|
{
|
|
@@ -6587,7 +6589,7 @@ function Lp(t) {
|
|
|
6587
6589
|
}
|
|
6588
6590
|
);
|
|
6589
6591
|
}
|
|
6590
|
-
function
|
|
6592
|
+
function Lp(t) {
|
|
6591
6593
|
return /* @__PURE__ */ e.jsx(
|
|
6592
6594
|
"svg",
|
|
6593
6595
|
{
|
|
@@ -6614,14 +6616,14 @@ function zp({
|
|
|
6614
6616
|
title: c("share_link_copied"),
|
|
6615
6617
|
type: "success"
|
|
6616
6618
|
});
|
|
6617
|
-
} catch (
|
|
6619
|
+
} catch (x) {
|
|
6618
6620
|
l({
|
|
6619
6621
|
title: c("share_link_copy_error"),
|
|
6620
6622
|
type: "error",
|
|
6621
|
-
error:
|
|
6623
|
+
error: x
|
|
6622
6624
|
});
|
|
6623
6625
|
}
|
|
6624
|
-
}, p = async (
|
|
6626
|
+
}, p = async (x) => {
|
|
6625
6627
|
if (!t) {
|
|
6626
6628
|
l({
|
|
6627
6629
|
title: c("share_link_not_available"),
|
|
@@ -6630,7 +6632,7 @@ function zp({
|
|
|
6630
6632
|
return;
|
|
6631
6633
|
}
|
|
6632
6634
|
await vp(
|
|
6633
|
-
|
|
6635
|
+
x.toLowerCase(),
|
|
6634
6636
|
{
|
|
6635
6637
|
url: t,
|
|
6636
6638
|
title: a,
|
|
@@ -6639,8 +6641,8 @@ function zp({
|
|
|
6639
6641
|
title: a
|
|
6640
6642
|
})
|
|
6641
6643
|
},
|
|
6642
|
-
(
|
|
6643
|
-
(
|
|
6644
|
+
(_) => l({ title: _, type: "success" }),
|
|
6645
|
+
(_) => l({ title: _, type: "error" }),
|
|
6644
6646
|
bp(c)
|
|
6645
6647
|
);
|
|
6646
6648
|
}, f = async () => {
|
|
@@ -6661,18 +6663,18 @@ function zp({
|
|
|
6661
6663
|
title: c("share_mysite_success"),
|
|
6662
6664
|
type: "success"
|
|
6663
6665
|
});
|
|
6664
|
-
} catch (
|
|
6666
|
+
} catch (x) {
|
|
6665
6667
|
l({
|
|
6666
6668
|
title: c("share_mysite_error"),
|
|
6667
6669
|
type: "error",
|
|
6668
|
-
error:
|
|
6670
|
+
error: x
|
|
6669
6671
|
});
|
|
6670
6672
|
}
|
|
6671
6673
|
}, g = [
|
|
6672
6674
|
{ name: "Facebook", Icon: Ip },
|
|
6673
6675
|
{ name: "Instagram", Icon: Dp },
|
|
6674
|
-
{ name: "TikTok", Icon:
|
|
6675
|
-
{ name: "X", Icon:
|
|
6676
|
+
{ name: "TikTok", Icon: Rp },
|
|
6677
|
+
{ name: "X", Icon: Lp }
|
|
6676
6678
|
];
|
|
6677
6679
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
6678
6680
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -6721,26 +6723,26 @@ function zp({
|
|
|
6721
6723
|
open: d,
|
|
6722
6724
|
onOpenChange: m,
|
|
6723
6725
|
title: c("share_button"),
|
|
6724
|
-
actions: g.map((
|
|
6725
|
-
id:
|
|
6726
|
-
label:
|
|
6727
|
-
onSelect: () => p(
|
|
6726
|
+
actions: g.map((x) => ({
|
|
6727
|
+
id: x.name,
|
|
6728
|
+
label: x.name,
|
|
6729
|
+
onSelect: () => p(x.name)
|
|
6728
6730
|
}))
|
|
6729
6731
|
}
|
|
6730
6732
|
)
|
|
6731
|
-
] }) : g.map((
|
|
6733
|
+
] }) : g.map((x) => /* @__PURE__ */ e.jsxs(
|
|
6732
6734
|
H,
|
|
6733
6735
|
{
|
|
6734
|
-
onClick: () => p(
|
|
6736
|
+
onClick: () => p(x.name),
|
|
6735
6737
|
variant: "secondary",
|
|
6736
6738
|
size: "sm",
|
|
6737
6739
|
className: "border-foreground bg-background text-foreground hover:bg-muted h-8 rounded-md border px-3 text-xs font-semibold transition-colors",
|
|
6738
6740
|
children: [
|
|
6739
|
-
/* @__PURE__ */ e.jsx(
|
|
6740
|
-
|
|
6741
|
+
/* @__PURE__ */ e.jsx(x.Icon, { className: "mr-1.5 size-3" }),
|
|
6742
|
+
x.name
|
|
6741
6743
|
]
|
|
6742
6744
|
},
|
|
6743
|
-
|
|
6745
|
+
x.name
|
|
6744
6746
|
))
|
|
6745
6747
|
] }),
|
|
6746
6748
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -6811,7 +6813,7 @@ function Ea({
|
|
|
6811
6813
|
className: u ? "border-foreground bg-background text-foreground hover:bg-muted flex h-10 items-center justify-center gap-2 rounded-lg border px-4 transition-all" : "bg-foreground text-background hover:bg-foreground/70 flex h-10 w-full items-center justify-between rounded-lg px-4 transition-all",
|
|
6812
6814
|
children: [
|
|
6813
6815
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: m("share_download_asset") }),
|
|
6814
|
-
/* @__PURE__ */ e.jsx(
|
|
6816
|
+
/* @__PURE__ */ e.jsx(Rs, { className: "size-4" })
|
|
6815
6817
|
]
|
|
6816
6818
|
}
|
|
6817
6819
|
);
|
|
@@ -6843,7 +6845,7 @@ function Ea({
|
|
|
6843
6845
|
)
|
|
6844
6846
|
] });
|
|
6845
6847
|
}
|
|
6846
|
-
const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up =
|
|
6848
|
+
const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = ue.memo(function({
|
|
6847
6849
|
tabs: s,
|
|
6848
6850
|
activeTab: a,
|
|
6849
6851
|
onTabChange: r
|
|
@@ -6859,7 +6861,7 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = o
|
|
|
6859
6861
|
},
|
|
6860
6862
|
n.id
|
|
6861
6863
|
)) });
|
|
6862
|
-
}), Hp =
|
|
6864
|
+
}), Hp = ue.memo(function({
|
|
6863
6865
|
mediaItem: s,
|
|
6864
6866
|
onClick: a
|
|
6865
6867
|
}) {
|
|
@@ -6883,7 +6885,7 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = o
|
|
|
6883
6885
|
]
|
|
6884
6886
|
}
|
|
6885
6887
|
);
|
|
6886
|
-
}), qp =
|
|
6888
|
+
}), qp = ue.memo(function({
|
|
6887
6889
|
message: s
|
|
6888
6890
|
}) {
|
|
6889
6891
|
const { t: a } = ne(), r = s ?? a("share_loading_media");
|
|
@@ -6891,12 +6893,12 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = o
|
|
|
6891
6893
|
/* @__PURE__ */ e.jsx(it, { className: "size-8" }),
|
|
6892
6894
|
/* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-sm", children: r })
|
|
6893
6895
|
] });
|
|
6894
|
-
}), Bp =
|
|
6896
|
+
}), Bp = ue.memo(function({
|
|
6895
6897
|
message: s
|
|
6896
6898
|
}) {
|
|
6897
6899
|
const { t: a } = ne(), r = s ?? a("share_media_load_error");
|
|
6898
6900
|
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "text-sm text-red-500", children: r }) });
|
|
6899
|
-
}), Kp =
|
|
6901
|
+
}), Kp = ue.memo(function({
|
|
6900
6902
|
message: s,
|
|
6901
6903
|
icon: a,
|
|
6902
6904
|
description: r
|
|
@@ -6908,13 +6910,13 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = o
|
|
|
6908
6910
|
r && /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: r })
|
|
6909
6911
|
] })
|
|
6910
6912
|
] });
|
|
6911
|
-
}), Vp =
|
|
6913
|
+
}), Vp = ue.memo(function() {
|
|
6912
6914
|
const { t: s } = ne();
|
|
6913
6915
|
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
6914
6916
|
/* @__PURE__ */ e.jsx("div", { className: "mb-1 text-sm text-gray-500", children: s("share_analytics_coming_soon") }),
|
|
6915
6917
|
/* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: s("share_analytics_description") })
|
|
6916
6918
|
] }) });
|
|
6917
|
-
}), Gp =
|
|
6919
|
+
}), Gp = ue.memo(function({
|
|
6918
6920
|
relateable_type: s
|
|
6919
6921
|
}) {
|
|
6920
6922
|
const { t: a } = ne(), n = o.useMemo(
|
|
@@ -6998,7 +7000,7 @@ function Wp({
|
|
|
6998
7000
|
}
|
|
6999
7001
|
);
|
|
7000
7002
|
}
|
|
7001
|
-
const Qp =
|
|
7003
|
+
const Qp = ue.memo(Wp), Yp = [
|
|
7002
7004
|
"a",
|
|
7003
7005
|
"b",
|
|
7004
7006
|
"blockquote",
|
|
@@ -7285,14 +7287,14 @@ function xh({
|
|
|
7285
7287
|
queryKey: ["portal-products", "detail", t],
|
|
7286
7288
|
queryFn: () => a(t),
|
|
7287
7289
|
enabled: !!a
|
|
7288
|
-
}), { data:
|
|
7290
|
+
}), { data: x, isLoading: _ } = Ve({
|
|
7289
7291
|
queryKey: ["product", t],
|
|
7290
7292
|
queryFn: () => {
|
|
7291
7293
|
if (!u) throw new Error("Unreachable: client is null");
|
|
7292
7294
|
return kp(u, t, { country_code: s });
|
|
7293
7295
|
},
|
|
7294
7296
|
enabled: !a && !!u
|
|
7295
|
-
}), w = a ? g :
|
|
7297
|
+
}), w = a ? g : _, {
|
|
7296
7298
|
data: b,
|
|
7297
7299
|
isLoading: j,
|
|
7298
7300
|
error: v
|
|
@@ -7303,23 +7305,23 @@ function xh({
|
|
|
7303
7305
|
shareLink: C,
|
|
7304
7306
|
loading: N,
|
|
7305
7307
|
error: z
|
|
7306
|
-
} = Pa({ id: Number(t) }, "Product", void 0, m), O = f?.product, U =
|
|
7308
|
+
} = Pa({ id: Number(t) }, "Product", void 0, m), O = f?.product, U = x?.product, E = O || U, P = O?.name || U?.title || "", A = O?.images?.[0]?.url || U?.image_url || "", M = O?.description || U?.description || U?.stripped || "", S = _h({
|
|
7307
7309
|
portalMode: !!a,
|
|
7308
7310
|
portalProduct: O,
|
|
7309
7311
|
legacyProduct: U,
|
|
7310
7312
|
locale: m
|
|
7311
|
-
}), K = (b?.media ?? []).filter((
|
|
7312
|
-
(
|
|
7313
|
-
id:
|
|
7314
|
-
title:
|
|
7315
|
-
image_url:
|
|
7316
|
-
kind:
|
|
7317
|
-
video_url:
|
|
7318
|
-
media_format:
|
|
7313
|
+
}), K = (b?.media ?? []).filter((R) => h === "all" ? !0 : h === "images" ? R.kind === "image" : h === "videos" ? R.kind === "video" : !0).map(
|
|
7314
|
+
(R) => ({
|
|
7315
|
+
id: R.id,
|
|
7316
|
+
title: R.title,
|
|
7317
|
+
image_url: R.image_url,
|
|
7318
|
+
kind: R.kind || "",
|
|
7319
|
+
video_url: R.video_url,
|
|
7320
|
+
media_format: R.media_format
|
|
7319
7321
|
})
|
|
7320
7322
|
), W = (b?.media?.length || 0) > 0, D = o.useCallback(
|
|
7321
|
-
(
|
|
7322
|
-
r?.("media", String(
|
|
7323
|
+
(R) => {
|
|
7324
|
+
r?.("media", String(R.id));
|
|
7323
7325
|
},
|
|
7324
7326
|
[r]
|
|
7325
7327
|
);
|
|
@@ -7329,8 +7331,8 @@ function xh({
|
|
|
7329
7331
|
kt,
|
|
7330
7332
|
{
|
|
7331
7333
|
href: "#",
|
|
7332
|
-
onClick: (
|
|
7333
|
-
|
|
7334
|
+
onClick: (R) => {
|
|
7335
|
+
R.preventDefault(), (i?.onClick ?? n ?? (() => c("products")))();
|
|
7334
7336
|
},
|
|
7335
7337
|
children: d("products_breadcrumb")
|
|
7336
7338
|
}
|
|
@@ -7410,10 +7412,10 @@ function kn(t) {
|
|
|
7410
7412
|
function vh({
|
|
7411
7413
|
maxProducts: t = 6
|
|
7412
7414
|
}) {
|
|
7413
|
-
const { t: s, locale: a } = ne(), { navigate: r, searchProducts: n } = Ee(), i = Ot(), l = o.useRef(null), u = o.useCallback((
|
|
7414
|
-
const
|
|
7415
|
-
|
|
7416
|
-
left:
|
|
7415
|
+
const { t: s, locale: a } = ne(), { navigate: r, searchProducts: n } = Ee(), i = Ot(), l = o.useRef(null), u = o.useCallback((x) => {
|
|
7416
|
+
const _ = l.current;
|
|
7417
|
+
_ && _.scrollBy({
|
|
7418
|
+
left: x * Math.min(_.clientWidth * 0.85, 720),
|
|
7417
7419
|
behavior: "smooth"
|
|
7418
7420
|
});
|
|
7419
7421
|
}, []), { data: c, isLoading: d } = Ve({
|
|
@@ -7422,37 +7424,37 @@ function vh({
|
|
|
7422
7424
|
enabled: !!n,
|
|
7423
7425
|
staleTime: 300 * 1e3
|
|
7424
7426
|
}), m = o.useMemo(
|
|
7425
|
-
() => c?.filter((
|
|
7426
|
-
id:
|
|
7427
|
-
title:
|
|
7428
|
-
image_url:
|
|
7427
|
+
() => c?.filter((x) => x.id != null).map((x) => ({
|
|
7428
|
+
id: x.id,
|
|
7429
|
+
title: x.name ?? s("common_untitled"),
|
|
7430
|
+
image_url: x.image_url ?? null
|
|
7429
7431
|
})) ?? [],
|
|
7430
7432
|
[c, s]
|
|
7431
7433
|
), h = o.useMemo(
|
|
7432
|
-
() => m.slice(0, t).map((
|
|
7434
|
+
() => m.slice(0, t).map((x) => x.id),
|
|
7433
7435
|
[t, m]
|
|
7434
7436
|
), { data: p } = vu(h), f = o.useMemo(
|
|
7435
7437
|
() => m.toSorted(
|
|
7436
|
-
(
|
|
7438
|
+
(x, _) => kn(p?.[_.id]) - kn(p?.[x.id])
|
|
7437
7439
|
).slice(0, t),
|
|
7438
7440
|
[t, p, m]
|
|
7439
|
-
), g = (
|
|
7440
|
-
src:
|
|
7441
|
-
alt:
|
|
7441
|
+
), g = (x, _ = "object-cover transition-transform duration-500 group-hover:scale-105") => i({
|
|
7442
|
+
src: x?.image_url || yh,
|
|
7443
|
+
alt: x?.title ?? s("common_untitled"),
|
|
7442
7444
|
fill: !0,
|
|
7443
|
-
className:
|
|
7445
|
+
className: _
|
|
7444
7446
|
});
|
|
7445
7447
|
return d ? /* @__PURE__ */ e.jsxs("section", { className: "space-y-4", children: [
|
|
7446
7448
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
7447
7449
|
/* @__PURE__ */ e.jsx(Oe, { className: "h-8 w-64" }),
|
|
7448
7450
|
/* @__PURE__ */ e.jsx(Oe, { className: "h-4 w-full max-w-96" })
|
|
7449
7451
|
] }),
|
|
7450
|
-
/* @__PURE__ */ e.jsx("div", { className: "-my-2 flex gap-4 overflow-x-auto py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: Array.from({ length: 3 }, (
|
|
7452
|
+
/* @__PURE__ */ e.jsx("div", { className: "-my-2 flex gap-4 overflow-x-auto py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: Array.from({ length: 3 }, (x, _) => /* @__PURE__ */ e.jsx(
|
|
7451
7453
|
Oe,
|
|
7452
7454
|
{
|
|
7453
7455
|
className: "h-[25rem] min-w-[min(78vw,20rem)] rounded-[2rem] md:min-w-[22rem] lg:min-w-[23rem]"
|
|
7454
7456
|
},
|
|
7455
|
-
|
|
7457
|
+
_
|
|
7456
7458
|
)) })
|
|
7457
7459
|
] }) : f.length === 0 ? null : /* @__PURE__ */ e.jsxs("section", { className: "space-y-4", children: [
|
|
7458
7460
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end justify-between gap-4", children: [
|
|
@@ -7492,25 +7494,25 @@ function vh({
|
|
|
7492
7494
|
{
|
|
7493
7495
|
ref: l,
|
|
7494
7496
|
className: "-my-2 flex snap-x gap-4 overflow-x-auto py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
7495
|
-
children: f.map((
|
|
7496
|
-
const
|
|
7497
|
-
|
|
7497
|
+
children: f.map((x) => {
|
|
7498
|
+
const _ = bh(
|
|
7499
|
+
x.title,
|
|
7498
7500
|
s("common_untitled")
|
|
7499
|
-
), w = p?.[
|
|
7501
|
+
), w = p?.[x.id]?.toSorted((j, v) => v.id - j.id).slice(0, 3) ?? [], b = p?.[x.id]?.length ?? w.length;
|
|
7500
7502
|
return /* @__PURE__ */ e.jsxs(
|
|
7501
7503
|
"button",
|
|
7502
7504
|
{
|
|
7503
7505
|
type: "button",
|
|
7504
|
-
onClick: () => r(`product/${
|
|
7506
|
+
onClick: () => r(`product/${x.id}`),
|
|
7505
7507
|
className: "group focus-visible:ring-ring relative h-[25rem] min-w-[min(78vw,20rem)] snap-start overflow-hidden rounded-[2rem] text-left shadow-sm transition-transform hover:-translate-y-1 focus-visible:ring-2 focus-visible:outline-none md:min-w-[22rem] lg:min-w-[23rem]",
|
|
7506
7508
|
children: [
|
|
7507
|
-
g(
|
|
7509
|
+
g(x),
|
|
7508
7510
|
/* @__PURE__ */ e.jsx("span", { className: "bg-foreground/25 absolute inset-0" }),
|
|
7509
7511
|
/* @__PURE__ */ e.jsx("span", { className: "from-foreground/85 via-foreground/20 absolute inset-0 bg-gradient-to-t to-transparent" }),
|
|
7510
7512
|
/* @__PURE__ */ e.jsx("span", { className: "to-foreground/20 absolute inset-0 bg-gradient-to-b from-transparent" }),
|
|
7511
7513
|
/* @__PURE__ */ e.jsxs("span", { className: "absolute inset-0 flex flex-col justify-between p-4", children: [
|
|
7512
7514
|
/* @__PURE__ */ e.jsxs("span", { className: "text-background flex flex-col items-start gap-1 drop-shadow-sm", children: [
|
|
7513
|
-
/* @__PURE__ */ e.jsx("span", { className: "max-w-[80%] text-base leading-tight font-bold", children:
|
|
7515
|
+
/* @__PURE__ */ e.jsx("span", { className: "max-w-[80%] text-base leading-tight font-bold", children: _ }),
|
|
7514
7516
|
/* @__PURE__ */ e.jsxs("span", { className: "text-background/90 flex items-center gap-2 text-sm font-semibold", children: [
|
|
7515
7517
|
/* @__PURE__ */ e.jsx(ed, { className: "size-3.5 fill-current" }),
|
|
7516
7518
|
s("media_product_carousel_count", {
|
|
@@ -7519,7 +7521,7 @@ function vh({
|
|
|
7519
7521
|
] })
|
|
7520
7522
|
] }),
|
|
7521
7523
|
/* @__PURE__ */ e.jsx("span", { className: "text-background mx-auto max-w-[14rem] text-center text-3xl leading-none font-bold tracking-normal drop-shadow-md", children: s("media_product_carousel_kit_title", {
|
|
7522
|
-
title:
|
|
7524
|
+
title: _
|
|
7523
7525
|
}) }),
|
|
7524
7526
|
/* @__PURE__ */ e.jsx("span", { className: "mx-auto flex max-w-[13rem] justify-center gap-2", children: w.map((j) => /* @__PURE__ */ e.jsx(
|
|
7525
7527
|
"span",
|
|
@@ -7532,7 +7534,7 @@ function vh({
|
|
|
7532
7534
|
] })
|
|
7533
7535
|
]
|
|
7534
7536
|
},
|
|
7535
|
-
|
|
7537
|
+
x.id
|
|
7536
7538
|
);
|
|
7537
7539
|
})
|
|
7538
7540
|
}
|
|
@@ -7570,7 +7572,7 @@ function Zi({
|
|
|
7570
7572
|
onAdded: u,
|
|
7571
7573
|
restoreFocusTo: c
|
|
7572
7574
|
}) {
|
|
7573
|
-
const d = Ae(), m = dt(), { t: h } = ne(), { showToast: p } = Ee(), f = Ge(), [g,
|
|
7575
|
+
const d = Ae(), m = dt(), { t: h } = ne(), { showToast: p } = Ee(), f = Ge(), [g, x] = o.useState(""), [_, w] = o.useState(""), [b, j] = o.useState(""), [v, C] = o.useState(
|
|
7574
7576
|
/* @__PURE__ */ new Set()
|
|
7575
7577
|
), [N, z] = o.useState(null), [O, U] = o.useState(
|
|
7576
7578
|
i
|
|
@@ -7589,12 +7591,12 @@ function Zi({
|
|
|
7589
7591
|
hasNextPage: K,
|
|
7590
7592
|
isFetchingNextPage: W,
|
|
7591
7593
|
fetchNextPage: D,
|
|
7592
|
-
error:
|
|
7594
|
+
error: R,
|
|
7593
7595
|
isPending: T,
|
|
7594
7596
|
isFetching: I,
|
|
7595
7597
|
refetch: $
|
|
7596
|
-
} =
|
|
7597
|
-
...Xi(d,
|
|
7598
|
+
} = Lt({
|
|
7599
|
+
...Xi(d, _),
|
|
7598
7600
|
enabled: t && M === "pick",
|
|
7599
7601
|
// Hold the previous page while a new search is in flight, so the list
|
|
7600
7602
|
// doesn't blank — and read as "no playlists" — on every keystroke.
|
|
@@ -7603,7 +7605,7 @@ function Zi({
|
|
|
7603
7605
|
hasNextPage: K,
|
|
7604
7606
|
isFetchingNextPage: W,
|
|
7605
7607
|
fetchNextPage: D,
|
|
7606
|
-
error:
|
|
7608
|
+
error: R
|
|
7607
7609
|
}), B = (F) => d.playlists.addItemToPlaylist(F, {
|
|
7608
7610
|
items: [{ relateable_type: r, relateable_id: a }]
|
|
7609
7611
|
}), he = () => {
|
|
@@ -7615,19 +7617,19 @@ function Zi({
|
|
|
7615
7617
|
onSuccess: () => {
|
|
7616
7618
|
u?.(), p({ type: "success", title: h("playlist_add_item_success") }), he(), s(!1);
|
|
7617
7619
|
},
|
|
7618
|
-
onError: (F, { id:
|
|
7620
|
+
onError: (F, { id: L, title: Y }) => {
|
|
7619
7621
|
if (qr(F) && F.status === 409) {
|
|
7620
|
-
C((Z) => new Set(Z).add(
|
|
7622
|
+
C((Z) => new Set(Z).add(L)), z({ id: L, title: Y }), L === O && (U(null), P("pick"), u?.());
|
|
7621
7623
|
return;
|
|
7622
7624
|
}
|
|
7623
7625
|
p({ type: "error", title: h("playlist_add_item_error"), error: F });
|
|
7624
7626
|
}
|
|
7625
7627
|
}), _e = ze({
|
|
7626
7628
|
mutationFn: async (F) => {
|
|
7627
|
-
const
|
|
7629
|
+
const L = await d.playlists.createPlaylist({
|
|
7628
7630
|
playlist: { title: F }
|
|
7629
7631
|
});
|
|
7630
|
-
U(
|
|
7632
|
+
U(L.playlist.id), x(""), w(""), l?.(L.playlist.id), await B(L.playlist.id);
|
|
7631
7633
|
},
|
|
7632
7634
|
onSuccess: () => {
|
|
7633
7635
|
U(null), u?.(), p({ type: "success", title: h("playlist_add_item_success") }), s(!1);
|
|
@@ -7688,7 +7690,7 @@ function Zi({
|
|
|
7688
7690
|
value: g,
|
|
7689
7691
|
placeholder: h("playlist_picker_search"),
|
|
7690
7692
|
"aria-label": h("playlist_picker_search"),
|
|
7691
|
-
onChange: (F) =>
|
|
7693
|
+
onChange: (F) => x(F.target.value)
|
|
7692
7694
|
}
|
|
7693
7695
|
),
|
|
7694
7696
|
/* @__PURE__ */ e.jsx(
|
|
@@ -7701,7 +7703,7 @@ function Zi({
|
|
|
7701
7703
|
children: G
|
|
7702
7704
|
}
|
|
7703
7705
|
),
|
|
7704
|
-
T || I && se.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-6", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) :
|
|
7706
|
+
T || I && se.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-6", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) : R ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-2 py-2", children: [
|
|
7705
7707
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: h("common_load_error_default") }),
|
|
7706
7708
|
/* @__PURE__ */ e.jsx(H, { variant: "outline", size: "sm", onClick: () => $(), children: h("common_retry") })
|
|
7707
7709
|
] }) : se.length === 0 ? (
|
|
@@ -7710,7 +7712,7 @@ function Zi({
|
|
|
7710
7712
|
the menu *behind* this dialog, so the way forward is to close
|
|
7711
7713
|
what you just opened. */
|
|
7712
7714
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-3 py-2", children: [
|
|
7713
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: h(
|
|
7715
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: h(_ ? "playlist_picker_no_matches" : "playlist_picker_empty") }),
|
|
7714
7716
|
O === null && /* @__PURE__ */ e.jsx(
|
|
7715
7717
|
H,
|
|
7716
7718
|
{
|
|
@@ -7722,7 +7724,7 @@ function Zi({
|
|
|
7722
7724
|
)
|
|
7723
7725
|
] })
|
|
7724
7726
|
) : se.map((F) => {
|
|
7725
|
-
const
|
|
7727
|
+
const L = v.has(F.id), Y = we.isPending || L;
|
|
7726
7728
|
return /* @__PURE__ */ e.jsxs(
|
|
7727
7729
|
"button",
|
|
7728
7730
|
{
|
|
@@ -7763,7 +7765,7 @@ function Zi({
|
|
|
7763
7765
|
),
|
|
7764
7766
|
/* @__PURE__ */ e.jsxs("span", { className: "flex min-w-0 flex-col", children: [
|
|
7765
7767
|
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: F.title }),
|
|
7766
|
-
|
|
7768
|
+
L && /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: h("playlist_item_already_exists") })
|
|
7767
7769
|
] })
|
|
7768
7770
|
]
|
|
7769
7771
|
},
|
|
@@ -7972,9 +7974,9 @@ function Ah({
|
|
|
7972
7974
|
}) {
|
|
7973
7975
|
const { t: s, locale: a } = ne(), r = dt(), n = Ae(), i = wr(), l = Ge(), { navigate: u, readOnly: c, showToast: d } = Ee(), m = Ws(), [h, p] = o.useState(
|
|
7974
7976
|
{}
|
|
7975
|
-
), [f, g] = o.useState(null), [
|
|
7976
|
-
(k,
|
|
7977
|
-
w.current = ye,
|
|
7977
|
+
), [f, g] = o.useState(null), [x, _] = o.useState(null), w = o.useRef(null), b = o.useCallback(
|
|
7978
|
+
(k, oe) => (ye) => {
|
|
7979
|
+
w.current = ye, _({ mediaId: k, mode: oe });
|
|
7978
7980
|
},
|
|
7979
7981
|
[]
|
|
7980
7982
|
), [j, v] = o.useState(""), [C, N] = o.useState(""), [z, O] = o.useState("newest"), [U, E] = o.useState("grid"), [P, A] = o.useState("all"), [M, S] = o.useState("all"), [K, W] = o.useState(!1);
|
|
@@ -7984,7 +7986,7 @@ function Ah({
|
|
|
7984
7986
|
}, 300);
|
|
7985
7987
|
return () => clearTimeout(k);
|
|
7986
7988
|
}, [j]);
|
|
7987
|
-
const { mutate: D, isPending:
|
|
7989
|
+
const { mutate: D, isPending: R } = ze({
|
|
7988
7990
|
mutationFn: (k) => n.media.deleteMedia(k),
|
|
7989
7991
|
onSuccess: () => {
|
|
7990
7992
|
d({ title: s("media_delete_success"), type: "success" }), l.invalidateQueries({
|
|
@@ -8007,7 +8009,7 @@ function Ah({
|
|
|
8007
8009
|
hasNextPage: B,
|
|
8008
8010
|
fetchNextPage: he,
|
|
8009
8011
|
error: we
|
|
8010
|
-
} =
|
|
8012
|
+
} = Lt({
|
|
8011
8013
|
queryKey: [
|
|
8012
8014
|
...Ne.media.list(
|
|
8013
8015
|
C,
|
|
@@ -8039,13 +8041,13 @@ function Ah({
|
|
|
8039
8041
|
isFetchingNextPage: q,
|
|
8040
8042
|
fetchNextPage: he,
|
|
8041
8043
|
error: we
|
|
8042
|
-
}),
|
|
8044
|
+
}), L = o.useMemo(
|
|
8043
8045
|
() => Th.map((k) => ({
|
|
8044
8046
|
value: k.value,
|
|
8045
8047
|
label: s(k.labelKey)
|
|
8046
8048
|
})),
|
|
8047
8049
|
[s]
|
|
8048
|
-
), Y =
|
|
8050
|
+
), Y = L.find((k) => k.value === M)?.label ?? s("media_filter_all_types"), Z = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
8049
8051
|
/* @__PURE__ */ e.jsx(Sc, { className: "size-4" }),
|
|
8050
8052
|
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: Y })
|
|
8051
8053
|
] }), J = /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
@@ -8097,7 +8099,7 @@ function Ah({
|
|
|
8097
8099
|
open: K,
|
|
8098
8100
|
onOpenChange: W,
|
|
8099
8101
|
title: s("media_filter_all_types"),
|
|
8100
|
-
actions:
|
|
8102
|
+
actions: L.map((k) => ({
|
|
8101
8103
|
id: k.value,
|
|
8102
8104
|
label: k.label,
|
|
8103
8105
|
selected: M === k.value,
|
|
@@ -8116,7 +8118,7 @@ function Ah({
|
|
|
8116
8118
|
children: Z
|
|
8117
8119
|
}
|
|
8118
8120
|
) }),
|
|
8119
|
-
/* @__PURE__ */ e.jsx(gt, { align: "end", children:
|
|
8121
|
+
/* @__PURE__ */ e.jsx(gt, { align: "end", children: L.map((k) => /* @__PURE__ */ e.jsxs(
|
|
8120
8122
|
Fe,
|
|
8121
8123
|
{
|
|
8122
8124
|
onClick: () => S(k.value),
|
|
@@ -8270,7 +8272,7 @@ function Ah({
|
|
|
8270
8272
|
{
|
|
8271
8273
|
variant: "secondary",
|
|
8272
8274
|
onClick: () => g(null),
|
|
8273
|
-
disabled:
|
|
8275
|
+
disabled: R,
|
|
8274
8276
|
children: s("common_cancel")
|
|
8275
8277
|
}
|
|
8276
8278
|
),
|
|
@@ -8279,31 +8281,31 @@ function Ah({
|
|
|
8279
8281
|
{
|
|
8280
8282
|
variant: "destructive",
|
|
8281
8283
|
onClick: T,
|
|
8282
|
-
disabled:
|
|
8283
|
-
children:
|
|
8284
|
+
disabled: R,
|
|
8285
|
+
children: R ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : s("common_delete")
|
|
8284
8286
|
}
|
|
8285
8287
|
)
|
|
8286
8288
|
] })
|
|
8287
8289
|
}
|
|
8288
8290
|
),
|
|
8289
|
-
|
|
8291
|
+
x && /* @__PURE__ */ e.jsx(
|
|
8290
8292
|
Zi,
|
|
8291
8293
|
{
|
|
8292
8294
|
open: !0,
|
|
8293
8295
|
onOpenChange: (k) => {
|
|
8294
|
-
k ||
|
|
8296
|
+
k || _(null);
|
|
8295
8297
|
},
|
|
8296
|
-
contentId:
|
|
8298
|
+
contentId: x.mediaId,
|
|
8297
8299
|
contentType: "Medium",
|
|
8298
|
-
mode:
|
|
8299
|
-
resumePlaylistId: h[
|
|
8300
|
+
mode: x.mode,
|
|
8301
|
+
resumePlaylistId: h[x.mediaId] ?? null,
|
|
8300
8302
|
restoreFocusTo: w,
|
|
8301
|
-
onPlaylistCreated: (k) => p((
|
|
8302
|
-
...
|
|
8303
|
-
[
|
|
8303
|
+
onPlaylistCreated: (k) => p((oe) => ({
|
|
8304
|
+
...oe,
|
|
8305
|
+
[x.mediaId]: k
|
|
8304
8306
|
})),
|
|
8305
8307
|
onAdded: () => p(
|
|
8306
|
-
({ [
|
|
8308
|
+
({ [x.mediaId]: k, ...oe }) => oe
|
|
8307
8309
|
)
|
|
8308
8310
|
}
|
|
8309
8311
|
)
|
|
@@ -8445,13 +8447,13 @@ function Dh(t, s) {
|
|
|
8445
8447
|
return s.default;
|
|
8446
8448
|
}
|
|
8447
8449
|
}
|
|
8448
|
-
function
|
|
8450
|
+
function Rh({
|
|
8449
8451
|
mediaId: t,
|
|
8450
8452
|
onNavigate: s,
|
|
8451
8453
|
onBack: a,
|
|
8452
8454
|
parentBreadcrumb: r
|
|
8453
8455
|
}) {
|
|
8454
|
-
const { t: n, locale: i } = ne(), l = Ae(), u = wr(), { navigate: c, readOnly: d, mediaProductsApi: m } = Ee(), h = Ws(), [p, f] = o.useState(null), [g,
|
|
8456
|
+
const { t: n, locale: i } = ne(), l = Ae(), u = wr(), { navigate: c, readOnly: d, mediaProductsApi: m } = Ee(), h = Ws(), [p, f] = o.useState(null), [g, x] = o.useState(!1), [_, w] = o.useState(null), b = o.useRef(null), { data: j, isLoading: v } = Ve({
|
|
8455
8457
|
queryKey: Ne.media.detail(Number(t), u, i),
|
|
8456
8458
|
queryFn: () => l.media.getMediaById(Number(t), i)
|
|
8457
8459
|
}), {
|
|
@@ -8479,7 +8481,7 @@ function Lh({
|
|
|
8479
8481
|
image: n("media_type_image"),
|
|
8480
8482
|
pdf: n("media_type_pdf"),
|
|
8481
8483
|
default: n("media_type_default")
|
|
8482
|
-
}),
|
|
8484
|
+
}), R = E?.description?.body || E?.stripped || "", T = K ? M : E?.pdf_url || A;
|
|
8483
8485
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
8484
8486
|
/* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsxs(ct, { className: "text-lg", children: [
|
|
8485
8487
|
/* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(
|
|
@@ -8515,7 +8517,7 @@ function Lh({
|
|
|
8515
8517
|
notFound: !E,
|
|
8516
8518
|
notFoundMessage: n("media_not_found"),
|
|
8517
8519
|
title: P,
|
|
8518
|
-
description:
|
|
8520
|
+
description: R,
|
|
8519
8521
|
containerHeightClass: "md:h-[calc(95vh-140px)]",
|
|
8520
8522
|
image: /* @__PURE__ */ e.jsxs("div", { className: "relative h-full overflow-hidden", children: [
|
|
8521
8523
|
/* @__PURE__ */ e.jsx(
|
|
@@ -8550,7 +8552,7 @@ function Lh({
|
|
|
8550
8552
|
Fh,
|
|
8551
8553
|
{
|
|
8552
8554
|
open: g,
|
|
8553
|
-
onToggle: () =>
|
|
8555
|
+
onToggle: () => x((I) => !I),
|
|
8554
8556
|
triggerRef: b
|
|
8555
8557
|
}
|
|
8556
8558
|
) : void 0,
|
|
@@ -8563,13 +8565,13 @@ function Lh({
|
|
|
8563
8565
|
f({
|
|
8564
8566
|
mediaId: Number(t),
|
|
8565
8567
|
mode: "pick"
|
|
8566
|
-
}),
|
|
8568
|
+
}), x(!1);
|
|
8567
8569
|
},
|
|
8568
8570
|
onNewPlaylist: () => {
|
|
8569
8571
|
f({
|
|
8570
8572
|
mediaId: Number(t),
|
|
8571
8573
|
mode: "create"
|
|
8572
|
-
}),
|
|
8574
|
+
}), x(!1);
|
|
8573
8575
|
}
|
|
8574
8576
|
}
|
|
8575
8577
|
) : void 0
|
|
@@ -8597,7 +8599,7 @@ function Lh({
|
|
|
8597
8599
|
contentId: p.mediaId,
|
|
8598
8600
|
contentType: "Medium",
|
|
8599
8601
|
mode: p.mode,
|
|
8600
|
-
resumePlaylistId:
|
|
8602
|
+
resumePlaylistId: _?.mediaId === p.mediaId ? _.playlistId : null,
|
|
8601
8603
|
restoreFocusTo: b,
|
|
8602
8604
|
onPlaylistCreated: (I) => w({ mediaId: p.mediaId, playlistId: I }),
|
|
8603
8605
|
onAdded: () => (
|
|
@@ -8621,7 +8623,7 @@ function ya({
|
|
|
8621
8623
|
children: t,
|
|
8622
8624
|
value: s
|
|
8623
8625
|
}) {
|
|
8624
|
-
return /* @__PURE__ */ e.jsx(rl.Provider, { value: s, children: /* @__PURE__ */ e.jsx(
|
|
8626
|
+
return /* @__PURE__ */ e.jsx(rl.Provider, { value: s, children: /* @__PURE__ */ e.jsx(Lh, { children: t }) });
|
|
8625
8627
|
}
|
|
8626
8628
|
function ut() {
|
|
8627
8629
|
const t = o.useContext(rl);
|
|
@@ -8632,7 +8634,7 @@ function ut() {
|
|
|
8632
8634
|
return t;
|
|
8633
8635
|
}
|
|
8634
8636
|
const Fr = o.createContext(null), Ir = o.createContext(null);
|
|
8635
|
-
function
|
|
8637
|
+
function Lh({
|
|
8636
8638
|
children: t
|
|
8637
8639
|
}) {
|
|
8638
8640
|
return /* @__PURE__ */ e.jsx(Fr.Provider, { value: null, children: /* @__PURE__ */ e.jsx(Ir.Provider, { value: null, children: t }) });
|
|
@@ -8736,15 +8738,15 @@ const $h = (t = 300) => {
|
|
|
8736
8738
|
const T = setTimeout(() => h(c), 300);
|
|
8737
8739
|
return () => clearTimeout(T);
|
|
8738
8740
|
}, [u, c]);
|
|
8739
|
-
const p = u ? m : l.debouncedSearchQuery, [f, g] = o.useState(/* @__PURE__ */ new Map()),
|
|
8741
|
+
const p = u ? m : l.debouncedSearchQuery, [f, g] = o.useState(/* @__PURE__ */ new Map()), x = o.useMemo(() => !t || !r ? t : t.map(
|
|
8740
8742
|
(T) => T.includes(".") ? T : `${r}.${T}.*`
|
|
8741
|
-
), [t, r]),
|
|
8742
|
-
if (!
|
|
8743
|
-
if (
|
|
8743
|
+
), [t, r]), _ = o.useMemo(() => {
|
|
8744
|
+
if (!x?.length) return n;
|
|
8745
|
+
if (x?.length === 1) return x[0];
|
|
8744
8746
|
if (!r) return n;
|
|
8745
|
-
const T =
|
|
8747
|
+
const T = x.map((I) => I.split(".")[1]).filter(Boolean);
|
|
8746
8748
|
return T?.length ? `${r}.${T.join("|")}.*` : n;
|
|
8747
|
-
}, [
|
|
8749
|
+
}, [x, n, r]), {
|
|
8748
8750
|
data: w,
|
|
8749
8751
|
isLoading: b,
|
|
8750
8752
|
error: j,
|
|
@@ -8752,14 +8754,14 @@ const $h = (t = 300) => {
|
|
|
8752
8754
|
fetchNextPage: C,
|
|
8753
8755
|
hasNextPage: N,
|
|
8754
8756
|
isFetchingNextPage: z
|
|
8755
|
-
} =
|
|
8757
|
+
} = Lt({
|
|
8756
8758
|
queryKey: ss.query({
|
|
8757
|
-
path:
|
|
8759
|
+
path: _,
|
|
8758
8760
|
search: p,
|
|
8759
|
-
filters:
|
|
8761
|
+
filters: x
|
|
8760
8762
|
}),
|
|
8761
8763
|
queryFn: ({ pageParam: T }) => a.queryDamAssets({
|
|
8762
|
-
path:
|
|
8764
|
+
path: _ || "*",
|
|
8763
8765
|
search: p,
|
|
8764
8766
|
tags_string: "*",
|
|
8765
8767
|
exclude_tags: "file_resource",
|
|
@@ -8838,7 +8840,7 @@ const $h = (t = 300) => {
|
|
|
8838
8840
|
return I && T[I] ? { [I]: T[I] } : T;
|
|
8839
8841
|
},
|
|
8840
8842
|
[r]
|
|
8841
|
-
), { folders: D, allAssets:
|
|
8843
|
+
), { folders: D, allAssets: R } = o.useMemo(() => {
|
|
8842
8844
|
if (!w?.pages?.length)
|
|
8843
8845
|
return { folders: [], allAssets: [] };
|
|
8844
8846
|
const T = r?.toString(), I = T ? [T] : [];
|
|
@@ -8873,7 +8875,7 @@ const $h = (t = 300) => {
|
|
|
8873
8875
|
selectedAssets: K,
|
|
8874
8876
|
selectedAssetsMap: f,
|
|
8875
8877
|
folders: D ?? [],
|
|
8876
|
-
assets:
|
|
8878
|
+
assets: R ?? [],
|
|
8877
8879
|
isLoading: b,
|
|
8878
8880
|
error: j,
|
|
8879
8881
|
isSearching: c !== p,
|
|
@@ -8927,8 +8929,8 @@ function Vh({
|
|
|
8927
8929
|
control: r.control,
|
|
8928
8930
|
name: "folderName",
|
|
8929
8931
|
render: ({ field: u }) => /* @__PURE__ */ e.jsxs(Dl, { children: [
|
|
8930
|
-
/* @__PURE__ */ e.jsx(
|
|
8931
|
-
/* @__PURE__ */ e.jsx(
|
|
8932
|
+
/* @__PURE__ */ e.jsx(Rl, { children: "Folder Name" }),
|
|
8933
|
+
/* @__PURE__ */ e.jsx(Ll, { children: /* @__PURE__ */ e.jsx(
|
|
8932
8934
|
$e,
|
|
8933
8935
|
{
|
|
8934
8936
|
placeholder: "Enter folder name",
|
|
@@ -9239,9 +9241,9 @@ function Dr({
|
|
|
9239
9241
|
const m = Xh(s, a), h = (p, f) => {
|
|
9240
9242
|
const g = (w) => {
|
|
9241
9243
|
w.preventDefault(), i(w, p.id, f);
|
|
9242
|
-
},
|
|
9244
|
+
}, x = l ? (w) => {
|
|
9243
9245
|
w.preventDefault(), w.stopPropagation(), l(w, p.id, f);
|
|
9244
|
-
} : void 0,
|
|
9246
|
+
} : void 0, _ = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
9245
9247
|
c?.(p),
|
|
9246
9248
|
s === "list" ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-4", children: [
|
|
9247
9249
|
/* @__PURE__ */ e.jsx("div", { className: "h-12 w-12 shrink-0 overflow-hidden rounded bg-gray-100", children: n(p.raw, "list") }),
|
|
@@ -9270,17 +9272,17 @@ function Dr({
|
|
|
9270
9272
|
s === "list" && "flex items-start gap-4 p-3"
|
|
9271
9273
|
),
|
|
9272
9274
|
onClick: g,
|
|
9273
|
-
onDoubleClick:
|
|
9275
|
+
onDoubleClick: x,
|
|
9274
9276
|
onKeyDown: (w) => {
|
|
9275
9277
|
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), i(w, p.id, f));
|
|
9276
9278
|
},
|
|
9277
|
-
children:
|
|
9279
|
+
children: _
|
|
9278
9280
|
}
|
|
9279
9281
|
);
|
|
9280
9282
|
};
|
|
9281
9283
|
return /* @__PURE__ */ e.jsx("div", { className: ve("grid gap-4", m), children: t.map((p, f) => {
|
|
9282
|
-
const g = h(p, f),
|
|
9283
|
-
return /* @__PURE__ */ e.jsx(
|
|
9284
|
+
const g = h(p, f), x = d ? d(p, g) : g;
|
|
9285
|
+
return /* @__PURE__ */ e.jsx(ue.Fragment, { children: x }, p.id);
|
|
9284
9286
|
}) });
|
|
9285
9287
|
}
|
|
9286
9288
|
function Zh(t) {
|
|
@@ -9320,8 +9322,8 @@ const hl = o.forwardRef(
|
|
|
9320
9322
|
onFoldersChange: p,
|
|
9321
9323
|
previewContainer: f,
|
|
9322
9324
|
previewAsset: g,
|
|
9323
|
-
onPreviewAssetChange:
|
|
9324
|
-
},
|
|
9325
|
+
onPreviewAssetChange: x
|
|
9326
|
+
}, _) => {
|
|
9325
9327
|
"use no memo";
|
|
9326
9328
|
const w = vs(), { companyId: b, toast: j } = ut(), v = Ge(), C = l !== void 0 && u ? {
|
|
9327
9329
|
searchQuery: l,
|
|
@@ -9339,7 +9341,7 @@ const hl = o.forwardRef(
|
|
|
9339
9341
|
selectedAssetsMap: K,
|
|
9340
9342
|
folders: W,
|
|
9341
9343
|
assets: D,
|
|
9342
|
-
isLoading:
|
|
9344
|
+
isLoading: R,
|
|
9343
9345
|
isSearching: T,
|
|
9344
9346
|
hasNextPage: I,
|
|
9345
9347
|
loadMore: $,
|
|
@@ -9358,7 +9360,7 @@ const hl = o.forwardRef(
|
|
|
9358
9360
|
return V.sortDirection === "asc" ? ge : -ge;
|
|
9359
9361
|
}
|
|
9360
9362
|
if (V.sortBy === "created_at") {
|
|
9361
|
-
const ge = ae.id ?? 0,
|
|
9363
|
+
const ge = ae.id ?? 0, Le = pe.id ?? 0, Ue = ge - Le;
|
|
9362
9364
|
return V.sortDirection === "asc" ? Ue : -Ue;
|
|
9363
9365
|
}
|
|
9364
9366
|
return 0;
|
|
@@ -9386,7 +9388,7 @@ const hl = o.forwardRef(
|
|
|
9386
9388
|
onError: () => {
|
|
9387
9389
|
j.error("Failed to move assets to folder.");
|
|
9388
9390
|
}
|
|
9389
|
-
}), [
|
|
9391
|
+
}), [L, Y] = o.useState(null), Z = o.useRef(-1), J = o.useRef(
|
|
9390
9392
|
null
|
|
9391
9393
|
), { mutate: me, isPending: k } = ze({
|
|
9392
9394
|
mutationFn: (V) => w.deleteDamAsset(V),
|
|
@@ -9396,7 +9398,7 @@ const hl = o.forwardRef(
|
|
|
9396
9398
|
onError: () => {
|
|
9397
9399
|
j.error("Failed to delete asset.");
|
|
9398
9400
|
}
|
|
9399
|
-
}), { mutate:
|
|
9401
|
+
}), { mutate: oe, isPending: ye } = ze(
|
|
9400
9402
|
{
|
|
9401
9403
|
mutationFn: (V) => w.discardDamAsset(V),
|
|
9402
9404
|
onSuccess: () => {
|
|
@@ -9416,10 +9418,10 @@ const hl = o.forwardRef(
|
|
|
9416
9418
|
return;
|
|
9417
9419
|
}
|
|
9418
9420
|
const ae = A().map((pe) => {
|
|
9419
|
-
const ge = b.toString() + ".",
|
|
9421
|
+
const ge = b.toString() + ".", Le = fe(pe.metadata.file_name);
|
|
9420
9422
|
return {
|
|
9421
9423
|
code: pe.asset_code,
|
|
9422
|
-
asset_paths: [`${ge}${V.folderName}.${
|
|
9424
|
+
asset_paths: [`${ge}${V.folderName}.${Le}`]
|
|
9423
9425
|
};
|
|
9424
9426
|
});
|
|
9425
9427
|
_e(ae);
|
|
@@ -9439,7 +9441,7 @@ const hl = o.forwardRef(
|
|
|
9439
9441
|
[A, _e]
|
|
9440
9442
|
);
|
|
9441
9443
|
o.useImperativeHandle(
|
|
9442
|
-
|
|
9444
|
+
_,
|
|
9443
9445
|
() => ({
|
|
9444
9446
|
clearSelection: () => {
|
|
9445
9447
|
E();
|
|
@@ -9495,15 +9497,15 @@ const hl = o.forwardRef(
|
|
|
9495
9497
|
const We = o.useRef(a);
|
|
9496
9498
|
We.current = a, o.useEffect(() => {
|
|
9497
9499
|
const V = (S ?? []).length, ae = A(), pe = {};
|
|
9498
|
-
K.forEach((ge,
|
|
9500
|
+
K.forEach((ge, Le) => {
|
|
9499
9501
|
const Ue = ge?.asset?.variants?.length ?? 0;
|
|
9500
|
-
Ue > 0 && (pe[
|
|
9502
|
+
Ue > 0 && (pe[Le] = Ue);
|
|
9501
9503
|
}), We.current?.(V, ae, pe);
|
|
9502
9504
|
}, [S, A, K]);
|
|
9503
9505
|
const Be = (V, ae, pe) => {
|
|
9504
|
-
const ge = ae.variants.find((
|
|
9506
|
+
const ge = ae.variants.find((Le) => Le.ready) || ae.variants[0];
|
|
9505
9507
|
if (V.shiftKey && t.maxFiles !== 1) {
|
|
9506
|
-
const
|
|
9508
|
+
const Le = Z.current, Ue = Le >= 0 ? Math.min(Le, pe) : pe, Qt = Le >= 0 ? Math.max(Le, pe) : pe, vt = q?.slice(Ue, Qt + 1) ?? [], Tt = t.maxFiles ? Math.max(0, t.maxFiles - S.length) : vt.length;
|
|
9507
9509
|
let st = 0;
|
|
9508
9510
|
vt.forEach((at) => {
|
|
9509
9511
|
if (S.includes(at.asset_code) || st >= Tt) return;
|
|
@@ -9542,10 +9544,10 @@ const hl = o.forwardRef(
|
|
|
9542
9544
|
/* @__PURE__ */ e.jsx(
|
|
9543
9545
|
Pn,
|
|
9544
9546
|
{
|
|
9545
|
-
open:
|
|
9546
|
-
description: `This asset **${
|
|
9547
|
+
open: L?.type === "Delete",
|
|
9548
|
+
description: `This asset **${L?.item.name}** will be permanently deleted.`,
|
|
9547
9549
|
onCancel: tt,
|
|
9548
|
-
onAction: () => me(
|
|
9550
|
+
onAction: () => me(L?.item.asset_code ?? "", {
|
|
9549
9551
|
onSuccess: tt
|
|
9550
9552
|
}),
|
|
9551
9553
|
title: "Are you sure?",
|
|
@@ -9556,9 +9558,9 @@ const hl = o.forwardRef(
|
|
|
9556
9558
|
Pn,
|
|
9557
9559
|
{
|
|
9558
9560
|
actionLabel: "Discard",
|
|
9559
|
-
open:
|
|
9560
|
-
description: `This asset **${
|
|
9561
|
-
onAction: () =>
|
|
9561
|
+
open: L?.type === "Discard",
|
|
9562
|
+
description: `This asset **${L?.item.name}** will be discarded from your library and will be permanently deleted after a month!`,
|
|
9563
|
+
onAction: () => oe(L?.item.asset_code ?? "", {
|
|
9562
9564
|
onSuccess: tt
|
|
9563
9565
|
}),
|
|
9564
9566
|
title: "Are you sure?",
|
|
@@ -9571,7 +9573,7 @@ const hl = o.forwardRef(
|
|
|
9571
9573
|
bs,
|
|
9572
9574
|
{
|
|
9573
9575
|
open: g !== null,
|
|
9574
|
-
onOpenChange: (V) => !V &&
|
|
9576
|
+
onOpenChange: (V) => !V && x?.(null),
|
|
9575
9577
|
children: /* @__PURE__ */ e.jsxs(yr, { container: f ?? void 0, children: [
|
|
9576
9578
|
/* @__PURE__ */ e.jsx(br, { className: "z-9999 bg-black/70 backdrop-blur-none" }),
|
|
9577
9579
|
/* @__PURE__ */ e.jsx(
|
|
@@ -9594,7 +9596,7 @@ const hl = o.forwardRef(
|
|
|
9594
9596
|
}
|
|
9595
9597
|
),
|
|
9596
9598
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
9597
|
-
/* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsx(ct, { className: "min-w-0 flex-wrap", children: G.map((V, ae) => /* @__PURE__ */ e.jsxs(
|
|
9599
|
+
/* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsx(ct, { className: "min-w-0 flex-wrap", children: G.map((V, ae) => /* @__PURE__ */ e.jsxs(ue.Fragment, { children: [
|
|
9598
9600
|
/* @__PURE__ */ e.jsx(Ce, { className: "inline-flex min-w-0", children: V.isCurrent ? /* @__PURE__ */ e.jsx(Ze, { className: "max-w-48 truncate sm:max-w-xs", children: V.label }) : /* @__PURE__ */ e.jsx(
|
|
9599
9601
|
H,
|
|
9600
9602
|
{
|
|
@@ -9609,7 +9611,7 @@ const hl = o.forwardRef(
|
|
|
9609
9611
|
) }),
|
|
9610
9612
|
ae < G.length - 1 && /* @__PURE__ */ e.jsx(xt, {})
|
|
9611
9613
|
] }, V.path)) }) }),
|
|
9612
|
-
|
|
9614
|
+
R || T ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
9613
9615
|
/* @__PURE__ */ e.jsx("div", { className: "mx-auto mb-2 h-8 w-8 animate-spin rounded-full border-2 border-blue-600 border-t-transparent" }),
|
|
9614
9616
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500", children: T ? "Searching..." : "Loading assets..." })
|
|
9615
9617
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
@@ -9656,7 +9658,7 @@ const hl = o.forwardRef(
|
|
|
9656
9658
|
tn(
|
|
9657
9659
|
J,
|
|
9658
9660
|
Be,
|
|
9659
|
-
(Ue) =>
|
|
9661
|
+
(Ue) => x?.(Ue),
|
|
9660
9662
|
ge,
|
|
9661
9663
|
pe
|
|
9662
9664
|
).onClick(V);
|
|
@@ -9667,7 +9669,7 @@ const hl = o.forwardRef(
|
|
|
9667
9669
|
tn(
|
|
9668
9670
|
J,
|
|
9669
9671
|
Be,
|
|
9670
|
-
(Ue) =>
|
|
9672
|
+
(Ue) => x?.(Ue),
|
|
9671
9673
|
ge,
|
|
9672
9674
|
pe
|
|
9673
9675
|
).onDoubleClick(V);
|
|
@@ -9683,7 +9685,7 @@ const hl = o.forwardRef(
|
|
|
9683
9685
|
),
|
|
9684
9686
|
wrapItem: (V, ae) => /* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9685
9687
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: ae }),
|
|
9686
|
-
/* @__PURE__ */ e.jsx(
|
|
9688
|
+
/* @__PURE__ */ e.jsx(Rt, { children: V.name })
|
|
9687
9689
|
] }) }, V.id)
|
|
9688
9690
|
}
|
|
9689
9691
|
),
|
|
@@ -9706,7 +9708,7 @@ const hl = o.forwardRef(
|
|
|
9706
9708
|
}
|
|
9707
9709
|
) })
|
|
9708
9710
|
] }),
|
|
9709
|
-
W?.length === 0 && q?.length === 0 && !
|
|
9711
|
+
W?.length === 0 && q?.length === 0 && !R && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
9710
9712
|
/* @__PURE__ */ e.jsx("div", { className: "mb-4 rounded-full bg-gray-100 p-3", children: /* @__PURE__ */ e.jsx(ar, { className: "h-6 w-6 text-gray-400" }) }),
|
|
9711
9713
|
/* @__PURE__ */ e.jsx("h3", { className: "mb-1 text-sm font-medium text-gray-900", children: "No assets found" }),
|
|
9712
9714
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500", children: "Try searching for something else or navigate to a different folder" })
|
|
@@ -9731,7 +9733,7 @@ const Jh = ({
|
|
|
9731
9733
|
onClick: () => a(n.id),
|
|
9732
9734
|
className: `flex h-8 w-full cursor-pointer items-center justify-start gap-2 rounded-md p-2 text-left text-sm transition-colors hover:bg-gray-100 ${s === n.id ? "bg-gray-100 font-medium text-gray-900" : "text-gray-700"}`,
|
|
9733
9735
|
children: [
|
|
9734
|
-
|
|
9736
|
+
ue.createElement(n.icon, {
|
|
9735
9737
|
className: "h-4 w-4 text-gray-500"
|
|
9736
9738
|
}),
|
|
9737
9739
|
/* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: n.label })
|
|
@@ -9801,8 +9803,8 @@ const ef = ({
|
|
|
9801
9803
|
showNamesOnMedia: p = !0,
|
|
9802
9804
|
onShowNamesOnMediaChange: f,
|
|
9803
9805
|
hasSelectedFiles: g = !1,
|
|
9804
|
-
damFolders:
|
|
9805
|
-
onAddToNewFolder:
|
|
9806
|
+
damFolders: x = [],
|
|
9807
|
+
onAddToNewFolder: _,
|
|
9806
9808
|
onAddToExistingFolder: w,
|
|
9807
9809
|
filters: b,
|
|
9808
9810
|
onFiltersChange: j,
|
|
@@ -9814,7 +9816,7 @@ const ef = ({
|
|
|
9814
9816
|
unsplashSearching: U = !1,
|
|
9815
9817
|
isUnsplashUploading: E = !1
|
|
9816
9818
|
}) => {
|
|
9817
|
-
const [P, A] = o.useState(!1), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D,
|
|
9819
|
+
const [P, A] = o.useState(!1), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D, R] = o.useState(!1), T = js(), I = t === "select" && (s === "dam" || s === "media"), $ = t === "select" && s === "unsplash", se = t === "select" ? a.find((B) => B.id === s)?.label || "Select Files" : "Media Details", G = a.filter(
|
|
9818
9820
|
(B) => Mi.includes(B.id)
|
|
9819
9821
|
), q = T && t === "select" && n !== void 0 && G.length > 1;
|
|
9820
9822
|
return /* @__PURE__ */ e.jsxs("div", { className: "sticky top-0 z-20 flex w-full flex-wrap items-center justify-between gap-3 border-b border-gray-100 bg-white px-6 py-3", children: [
|
|
@@ -9828,7 +9830,7 @@ const ef = ({
|
|
|
9828
9830
|
"data-testid": "file-picker-method-switcher",
|
|
9829
9831
|
"aria-haspopup": "dialog",
|
|
9830
9832
|
"aria-expanded": D,
|
|
9831
|
-
onClick: () =>
|
|
9833
|
+
onClick: () => R(!0),
|
|
9832
9834
|
className: "h-8 shrink-0 gap-1 px-2 text-lg font-semibold text-gray-900 hover:bg-gray-100",
|
|
9833
9835
|
children: [
|
|
9834
9836
|
se,
|
|
@@ -9840,7 +9842,7 @@ const ef = ({
|
|
|
9840
9842
|
Xe,
|
|
9841
9843
|
{
|
|
9842
9844
|
open: D,
|
|
9843
|
-
onOpenChange:
|
|
9845
|
+
onOpenChange: R,
|
|
9844
9846
|
title: "Choose source",
|
|
9845
9847
|
actions: G.map((B) => ({
|
|
9846
9848
|
id: B.id,
|
|
@@ -9901,7 +9903,7 @@ const ef = ({
|
|
|
9901
9903
|
children: /* @__PURE__ */ e.jsx(Gn, { className: "h-3 w-3" })
|
|
9902
9904
|
}
|
|
9903
9905
|
) }),
|
|
9904
|
-
/* @__PURE__ */ e.jsx(
|
|
9906
|
+
/* @__PURE__ */ e.jsx(Rt, { children: "Zoom out" })
|
|
9905
9907
|
] }) }),
|
|
9906
9908
|
/* @__PURE__ */ e.jsx(
|
|
9907
9909
|
qn,
|
|
@@ -9933,7 +9935,7 @@ const ef = ({
|
|
|
9933
9935
|
children: /* @__PURE__ */ e.jsx(Wt, { className: "h-3 w-3" })
|
|
9934
9936
|
}
|
|
9935
9937
|
) }),
|
|
9936
|
-
/* @__PURE__ */ e.jsx(
|
|
9938
|
+
/* @__PURE__ */ e.jsx(Rt, { children: "Zoom in" })
|
|
9937
9939
|
] }) })
|
|
9938
9940
|
]
|
|
9939
9941
|
}
|
|
@@ -9951,7 +9953,7 @@ const ef = ({
|
|
|
9951
9953
|
children: /* @__PURE__ */ e.jsx(sd, { className: "h-4 w-4" })
|
|
9952
9954
|
}
|
|
9953
9955
|
) }),
|
|
9954
|
-
/* @__PURE__ */ e.jsx(
|
|
9956
|
+
/* @__PURE__ */ e.jsx(Rt, { children: m === "list" ? "Not available in list view" : p ? "Hide names on media" : "Show names on media" })
|
|
9955
9957
|
] }) }),
|
|
9956
9958
|
/* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
|
|
9957
9959
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 rounded-md border border-gray-200 bg-gray-50 p-0.5", children: [
|
|
@@ -9966,7 +9968,7 @@ const ef = ({
|
|
|
9966
9968
|
children: /* @__PURE__ */ e.jsx(Kn, { className: "h-3.5 w-3.5" })
|
|
9967
9969
|
}
|
|
9968
9970
|
) }),
|
|
9969
|
-
/* @__PURE__ */ e.jsx(
|
|
9971
|
+
/* @__PURE__ */ e.jsx(Rt, { children: "Grid View" })
|
|
9970
9972
|
] }) }),
|
|
9971
9973
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9972
9974
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
@@ -9979,7 +9981,7 @@ const ef = ({
|
|
|
9979
9981
|
children: /* @__PURE__ */ e.jsx(_r, { className: "h-3.5 w-3.5" })
|
|
9980
9982
|
}
|
|
9981
9983
|
) }),
|
|
9982
|
-
/* @__PURE__ */ e.jsx(
|
|
9984
|
+
/* @__PURE__ */ e.jsx(Rt, { children: "List View" })
|
|
9983
9985
|
] }) })
|
|
9984
9986
|
] }),
|
|
9985
9987
|
/* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
|
|
@@ -10006,9 +10008,9 @@ const ef = ({
|
|
|
10006
10008
|
{
|
|
10007
10009
|
id: "new",
|
|
10008
10010
|
label: "Add to New Folder",
|
|
10009
|
-
onSelect: () =>
|
|
10011
|
+
onSelect: () => _?.()
|
|
10010
10012
|
},
|
|
10011
|
-
...
|
|
10013
|
+
...x.map((B) => ({
|
|
10012
10014
|
id: B,
|
|
10013
10015
|
label: B.split(".").pop() || B,
|
|
10014
10016
|
onSelect: () => w?.(B)
|
|
@@ -10031,7 +10033,7 @@ const ef = ({
|
|
|
10031
10033
|
/* @__PURE__ */ e.jsxs(
|
|
10032
10034
|
Fe,
|
|
10033
10035
|
{
|
|
10034
|
-
onClick: () =>
|
|
10036
|
+
onClick: () => _?.(),
|
|
10035
10037
|
className: "cursor-pointer",
|
|
10036
10038
|
children: [
|
|
10037
10039
|
/* @__PURE__ */ e.jsx(sa, { className: "mr-2 h-4 w-4" }),
|
|
@@ -10039,12 +10041,12 @@ const ef = ({
|
|
|
10039
10041
|
]
|
|
10040
10042
|
}
|
|
10041
10043
|
),
|
|
10042
|
-
|
|
10044
|
+
x.length > 0 && /* @__PURE__ */ e.jsxs(bo, { children: [
|
|
10043
10045
|
/* @__PURE__ */ e.jsxs(vo, { className: "cursor-pointer", children: [
|
|
10044
10046
|
/* @__PURE__ */ e.jsx(sa, { className: "mr-2 h-4 w-4" }),
|
|
10045
10047
|
"Add to Existing Folder"
|
|
10046
10048
|
] }),
|
|
10047
|
-
/* @__PURE__ */ e.jsx(jo, { className: "z-350 max-h-64 overflow-y-auto", children:
|
|
10049
|
+
/* @__PURE__ */ e.jsx(jo, { className: "z-350 max-h-64 overflow-y-auto", children: x.map((B) => /* @__PURE__ */ e.jsxs(
|
|
10048
10050
|
Fe,
|
|
10049
10051
|
{
|
|
10050
10052
|
onClick: () => w?.(B),
|
|
@@ -10059,7 +10061,7 @@ const ef = ({
|
|
|
10059
10061
|
] })
|
|
10060
10062
|
] })
|
|
10061
10063
|
] }) }) }),
|
|
10062
|
-
/* @__PURE__ */ e.jsx(
|
|
10064
|
+
/* @__PURE__ */ e.jsx(Rt, { children: g ? "Add selected files to a folder" : "Select files to add to a folder" })
|
|
10063
10065
|
] }) }),
|
|
10064
10066
|
s === "dam" && /* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
|
|
10065
10067
|
T ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -10106,7 +10108,7 @@ const ef = ({
|
|
|
10106
10108
|
children: /* @__PURE__ */ e.jsx(Wr, { className: "h-4 w-4" })
|
|
10107
10109
|
}
|
|
10108
10110
|
) }) }),
|
|
10109
|
-
/* @__PURE__ */ e.jsx(
|
|
10111
|
+
/* @__PURE__ */ e.jsx(Rt, { children: "Filters" })
|
|
10110
10112
|
] }) }),
|
|
10111
10113
|
/* @__PURE__ */ e.jsx(ko, { align: "end", className: "w-auto p-0", children: /* @__PURE__ */ e.jsx(
|
|
10112
10114
|
mr,
|
|
@@ -10174,7 +10176,7 @@ const ef = ({
|
|
|
10174
10176
|
B.id
|
|
10175
10177
|
)) })
|
|
10176
10178
|
] }) }) }),
|
|
10177
|
-
/* @__PURE__ */ e.jsx(
|
|
10179
|
+
/* @__PURE__ */ e.jsx(Rt, { children: "Sort" })
|
|
10178
10180
|
] }) })
|
|
10179
10181
|
] }),
|
|
10180
10182
|
/* @__PURE__ */ e.jsx(H, { variant: "ghost", size: "sm", onClick: r, className: "ml-2", children: /* @__PURE__ */ e.jsx(Vt, { className: "h-4 w-4" }) })
|
|
@@ -10204,24 +10206,24 @@ const ef = ({
|
|
|
10204
10206
|
previewMedia: f,
|
|
10205
10207
|
onPreviewMediaChange: g
|
|
10206
10208
|
}) => {
|
|
10207
|
-
const { shareablesClient:
|
|
10209
|
+
const { shareablesClient: x } = ut(), _ = x?.media.cacheKey ?? "default", [w, b] = o.useState(""), j = i !== void 0 && l != null, v = j ? i : w, C = j ? l : b, [N, z] = o.useState([]), [O, U] = o.useState(1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), S = o.useMemo(() => {
|
|
10208
10210
|
if (m && ca[m])
|
|
10209
10211
|
return ca[m];
|
|
10210
10212
|
if (!(!t.fileTypeFilter || t.fileTypeFilter.length === 0)) {
|
|
10211
|
-
for (const
|
|
10212
|
-
if (ca[
|
|
10213
|
-
return ca[
|
|
10213
|
+
for (const L of t.fileTypeFilter)
|
|
10214
|
+
if (ca[L])
|
|
10215
|
+
return ca[L];
|
|
10214
10216
|
}
|
|
10215
10217
|
}, [m, t.fileTypeFilter]), {
|
|
10216
10218
|
data: K,
|
|
10217
10219
|
isLoading: W,
|
|
10218
10220
|
error: D
|
|
10219
10221
|
} = Ve({
|
|
10220
|
-
queryKey: ["media-tab", v, S,
|
|
10222
|
+
queryKey: ["media-tab", v, S, _],
|
|
10221
10223
|
queryFn: () => {
|
|
10222
|
-
if (!
|
|
10224
|
+
if (!x)
|
|
10223
10225
|
throw new Error("Shareables client is not configured");
|
|
10224
|
-
return
|
|
10226
|
+
return x.media.list({
|
|
10225
10227
|
search_query: v,
|
|
10226
10228
|
page: 1,
|
|
10227
10229
|
per_page: 30,
|
|
@@ -10229,47 +10231,47 @@ const ef = ({
|
|
|
10229
10231
|
with_type: S
|
|
10230
10232
|
});
|
|
10231
10233
|
},
|
|
10232
|
-
enabled: !!
|
|
10234
|
+
enabled: !!x,
|
|
10233
10235
|
staleTime: 300 * 1e3
|
|
10234
10236
|
// 5 minutes
|
|
10235
10237
|
});
|
|
10236
10238
|
o.useEffect(() => {
|
|
10237
10239
|
z([]), U(1), M(!1);
|
|
10238
|
-
}, [
|
|
10239
|
-
const
|
|
10240
|
-
`${
|
|
10240
|
+
}, [_, v, S]);
|
|
10241
|
+
const R = ue.useRef(
|
|
10242
|
+
`${_}|${v}|${S ?? ""}`
|
|
10241
10243
|
);
|
|
10242
10244
|
o.useEffect(() => {
|
|
10243
|
-
|
|
10244
|
-
}, [
|
|
10245
|
+
R.current = `${_}|${v}|${S ?? ""}`;
|
|
10246
|
+
}, [_, v, S]), o.useEffect(() => {
|
|
10245
10247
|
if (!K) return;
|
|
10246
10248
|
M(K.meta?.next != null);
|
|
10247
|
-
const
|
|
10248
|
-
|
|
10249
|
+
const L = K.media || [];
|
|
10250
|
+
L.length > 0 && z((Y) => {
|
|
10249
10251
|
const Z = new Map(Y.map((J) => [J.id, J]));
|
|
10250
|
-
for (const J of
|
|
10252
|
+
for (const J of L)
|
|
10251
10253
|
Z.set(J.id, J);
|
|
10252
10254
|
return Array.from(Z.values());
|
|
10253
10255
|
});
|
|
10254
10256
|
}, [K]);
|
|
10255
10257
|
const T = o.useCallback(async () => {
|
|
10256
|
-
if (!(!A || !
|
|
10258
|
+
if (!(!A || !x))
|
|
10257
10259
|
try {
|
|
10258
10260
|
P(!0);
|
|
10259
|
-
const
|
|
10261
|
+
const L = O + 1, Y = `${_}|${v}|${S ?? ""}`, Z = await x.media.list({
|
|
10260
10262
|
search_query: v,
|
|
10261
|
-
page:
|
|
10263
|
+
page: L,
|
|
10262
10264
|
per_page: 30,
|
|
10263
10265
|
active: !0,
|
|
10264
10266
|
with_type: S
|
|
10265
10267
|
});
|
|
10266
|
-
if (Y !==
|
|
10267
|
-
M(Z.meta?.next != null), U(
|
|
10268
|
+
if (Y !== R.current) return;
|
|
10269
|
+
M(Z.meta?.next != null), U(L);
|
|
10268
10270
|
const J = Z.media || [];
|
|
10269
10271
|
J.length > 0 && z((me) => {
|
|
10270
|
-
const k = new Map(me.map((
|
|
10271
|
-
for (const
|
|
10272
|
-
k.set(
|
|
10272
|
+
const k = new Map(me.map((oe) => [oe.id, oe]));
|
|
10273
|
+
for (const oe of J)
|
|
10274
|
+
k.set(oe.id, oe);
|
|
10273
10275
|
return Array.from(k.values());
|
|
10274
10276
|
});
|
|
10275
10277
|
} finally {
|
|
@@ -10280,14 +10282,14 @@ const ef = ({
|
|
|
10280
10282
|
O,
|
|
10281
10283
|
v,
|
|
10282
10284
|
S,
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
+
x,
|
|
10286
|
+
_
|
|
10285
10287
|
]), I = o.useCallback(
|
|
10286
|
-
(
|
|
10287
|
-
let Y = "", Z = "", J =
|
|
10288
|
-
return
|
|
10289
|
-
asset_id:
|
|
10290
|
-
asset_code: `media_${
|
|
10288
|
+
(L) => {
|
|
10289
|
+
let Y = "", Z = "", J = L.title, me = "", k = "";
|
|
10290
|
+
return L.video_url ? (Y = L.video_url, Z = "video/mp4", J = `${L.title}.mp4`, me = L.image_url || "", k = L.description?.body || "") : L.pdf_url ? (Y = L.pdf_url, Z = "application/pdf", J = `${L.title}.pdf`) : L.image_url && (Y = L.image_url, Z = "image/jpeg", J = `${L.title}.jpg`), {
|
|
10291
|
+
asset_id: L.id,
|
|
10292
|
+
asset_code: `media_${L.id}`,
|
|
10291
10293
|
file_path: Y,
|
|
10292
10294
|
file_url: Y,
|
|
10293
10295
|
...me ? { thumbnail_url: me } : {},
|
|
@@ -10301,7 +10303,7 @@ const ef = ({
|
|
|
10301
10303
|
},
|
|
10302
10304
|
[]
|
|
10303
10305
|
), { state: $, api: se } = nl(), G = $ !== null && se !== null, q = o.useCallback(
|
|
10304
|
-
(
|
|
10306
|
+
(L, Y, Z) => {
|
|
10305
10307
|
const J = parseInt(Y.replace(/^media_/, ""), 10);
|
|
10306
10308
|
if (Number.isNaN(J)) return;
|
|
10307
10309
|
if (G) {
|
|
@@ -10323,7 +10325,7 @@ const ef = ({
|
|
|
10323
10325
|
k = [...r, J];
|
|
10324
10326
|
}
|
|
10325
10327
|
n(k);
|
|
10326
|
-
const
|
|
10328
|
+
const oe = new Map(N.map((X) => [X.id, X])), fe = k.map((X) => oe.get(X)).filter((X) => X != null).map(I);
|
|
10327
10329
|
a?.(fe);
|
|
10328
10330
|
},
|
|
10329
10331
|
[
|
|
@@ -10337,62 +10339,62 @@ const ef = ({
|
|
|
10337
10339
|
a
|
|
10338
10340
|
]
|
|
10339
10341
|
);
|
|
10340
|
-
|
|
10342
|
+
ue.useEffect(() => {
|
|
10341
10343
|
G || s?.(r.length);
|
|
10342
10344
|
}, [G, r.length, s]);
|
|
10343
10345
|
const B = o.useMemo(() => {
|
|
10344
10346
|
if (!h || !N.length) return N;
|
|
10345
|
-
const
|
|
10346
|
-
return
|
|
10347
|
-
if (
|
|
10347
|
+
const L = fa.find((Y) => Y.id === h);
|
|
10348
|
+
return L ? [...N].sort((Y, Z) => {
|
|
10349
|
+
if (L.sortBy === "name") {
|
|
10348
10350
|
const J = (Y.title ?? "").localeCompare(Z.title ?? "", void 0, {
|
|
10349
10351
|
sensitivity: "base"
|
|
10350
10352
|
});
|
|
10351
|
-
return
|
|
10353
|
+
return L.sortDirection === "asc" ? J : -J;
|
|
10352
10354
|
}
|
|
10353
|
-
if (
|
|
10355
|
+
if (L.sortBy === "created_at") {
|
|
10354
10356
|
const J = Y.id ?? 0, me = Z.id ?? 0, k = J - me;
|
|
10355
|
-
return
|
|
10357
|
+
return L.sortDirection === "asc" ? k : -k;
|
|
10356
10358
|
}
|
|
10357
10359
|
return 0;
|
|
10358
10360
|
}) : N;
|
|
10359
|
-
}, [N, h]), he = (
|
|
10360
|
-
(
|
|
10361
|
-
if (
|
|
10361
|
+
}, [N, h]), he = (L) => L.image_url ? De : L.video_url ? xs : (L.pdf_url, _s), we = o.useCallback(
|
|
10362
|
+
(L, Y) => {
|
|
10363
|
+
if (L.image_url)
|
|
10362
10364
|
return /* @__PURE__ */ e.jsx(
|
|
10363
10365
|
"img",
|
|
10364
10366
|
{
|
|
10365
|
-
src:
|
|
10366
|
-
alt:
|
|
10367
|
+
src: L.image_url,
|
|
10368
|
+
alt: L.title,
|
|
10367
10369
|
width: 200,
|
|
10368
10370
|
height: 150,
|
|
10369
10371
|
className: "h-full w-full object-cover"
|
|
10370
10372
|
}
|
|
10371
10373
|
);
|
|
10372
|
-
const Z = he(
|
|
10374
|
+
const Z = he(L);
|
|
10373
10375
|
return /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center bg-gray-100", children: /* @__PURE__ */ e.jsx(Z, { className: "h-8 w-8 text-gray-400" }) });
|
|
10374
10376
|
},
|
|
10375
10377
|
[]
|
|
10376
|
-
), _e = o.useMemo(() => B.map((
|
|
10377
|
-
const Y = `media_${
|
|
10378
|
+
), _e = o.useMemo(() => B.map((L) => {
|
|
10379
|
+
const Y = `media_${L.id}`;
|
|
10378
10380
|
let Z, J;
|
|
10379
10381
|
if (G) {
|
|
10380
10382
|
const me = $.items.findIndex((k) => k.asset_code === Y);
|
|
10381
10383
|
Z = me >= 0, J = Z ? me + 1 : 0;
|
|
10382
10384
|
} else {
|
|
10383
|
-
const me = r.indexOf(
|
|
10385
|
+
const me = r.indexOf(L.id);
|
|
10384
10386
|
Z = me >= 0, J = Z ? me + 1 : 0;
|
|
10385
10387
|
}
|
|
10386
10388
|
return {
|
|
10387
10389
|
id: Y,
|
|
10388
|
-
name:
|
|
10389
|
-
subtitle:
|
|
10390
|
+
name: L.title ?? "",
|
|
10391
|
+
subtitle: L.kind ?? "Media",
|
|
10390
10392
|
isSelected: Z,
|
|
10391
10393
|
selectionIndex: J,
|
|
10392
|
-
raw:
|
|
10394
|
+
raw: L
|
|
10393
10395
|
};
|
|
10394
10396
|
}), [B, r, G, $]), F = o.useCallback(
|
|
10395
|
-
(
|
|
10397
|
+
(L, Y, Z) => {
|
|
10396
10398
|
const J = B[Z];
|
|
10397
10399
|
J && g?.(J);
|
|
10398
10400
|
},
|
|
@@ -10406,7 +10408,7 @@ const ef = ({
|
|
|
10406
10408
|
bs,
|
|
10407
10409
|
{
|
|
10408
10410
|
open: !!f,
|
|
10409
|
-
onOpenChange: (
|
|
10411
|
+
onOpenChange: (L) => !L && g?.(null),
|
|
10410
10412
|
children: /* @__PURE__ */ e.jsxs(yr, { container: p ?? void 0, children: [
|
|
10411
10413
|
/* @__PURE__ */ e.jsx(br, { className: "z-9999 bg-black/70 backdrop-blur-none" }),
|
|
10412
10414
|
/* @__PURE__ */ e.jsx(
|
|
@@ -10432,8 +10434,8 @@ const ef = ({
|
|
|
10432
10434
|
}
|
|
10433
10435
|
) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex aspect-video min-h-[200px] items-center justify-center bg-gray-100 p-8", children: [
|
|
10434
10436
|
(() => {
|
|
10435
|
-
const
|
|
10436
|
-
return /* @__PURE__ */ e.jsx(
|
|
10437
|
+
const L = he(f);
|
|
10438
|
+
return /* @__PURE__ */ e.jsx(L, { className: "h-16 w-16 text-gray-400" });
|
|
10437
10439
|
})(),
|
|
10438
10440
|
/* @__PURE__ */ e.jsx("p", { className: "ml-4 text-sm text-gray-600", children: f.title })
|
|
10439
10441
|
] }) })
|
|
@@ -10449,8 +10451,8 @@ const ef = ({
|
|
|
10449
10451
|
type: "text",
|
|
10450
10452
|
placeholder: "Search media...",
|
|
10451
10453
|
value: v,
|
|
10452
|
-
onChange: (
|
|
10453
|
-
C(
|
|
10454
|
+
onChange: (L) => {
|
|
10455
|
+
C(L.target.value);
|
|
10454
10456
|
},
|
|
10455
10457
|
className: "h-9"
|
|
10456
10458
|
}
|
|
@@ -10496,7 +10498,7 @@ const ef = ({
|
|
|
10496
10498
|
] })
|
|
10497
10499
|
] });
|
|
10498
10500
|
}, An = 30;
|
|
10499
|
-
function
|
|
10501
|
+
function Rr({
|
|
10500
10502
|
contentKind: t,
|
|
10501
10503
|
assetCodePrefix: s,
|
|
10502
10504
|
labelPlural: a,
|
|
@@ -10512,8 +10514,8 @@ function Lr({
|
|
|
10512
10514
|
onSelectedDataChange: p,
|
|
10513
10515
|
onSelectionCountChange: f,
|
|
10514
10516
|
thumbnailSize: g = 100,
|
|
10515
|
-
viewMode:
|
|
10516
|
-
showNamesOnMedia:
|
|
10517
|
+
viewMode: x = "grid",
|
|
10518
|
+
showNamesOnMedia: _ = !0
|
|
10517
10519
|
}) {
|
|
10518
10520
|
const w = r.supportsSearch !== !1, b = r.cacheKey ?? "default", [j, v] = o.useState(""), [C, N] = o.useState(""), [z, O] = o.useState([]), [U, E] = o.useState(null), [P, A] = o.useState(!1);
|
|
10519
10521
|
o.useEffect(() => {
|
|
@@ -10541,9 +10543,9 @@ function Lr({
|
|
|
10541
10543
|
o.useEffect(() => {
|
|
10542
10544
|
D.current = `${b}|${C}`;
|
|
10543
10545
|
}, [b, C]);
|
|
10544
|
-
const { toast:
|
|
10546
|
+
const { toast: R } = ut(), T = o.useCallback(async () => {
|
|
10545
10547
|
if (!U) return;
|
|
10546
|
-
const F = C,
|
|
10548
|
+
const F = C, L = `${b}|${F}`;
|
|
10547
10549
|
try {
|
|
10548
10550
|
A(!0);
|
|
10549
10551
|
const Y = await r.list({
|
|
@@ -10551,7 +10553,7 @@ function Lr({
|
|
|
10551
10553
|
cursor: U,
|
|
10552
10554
|
limit: An
|
|
10553
10555
|
});
|
|
10554
|
-
if (
|
|
10556
|
+
if (L !== D.current) return;
|
|
10555
10557
|
O((Z) => {
|
|
10556
10558
|
const J = new Set(Z.map(n)), me = [...Z];
|
|
10557
10559
|
for (const k of Y.items)
|
|
@@ -10559,7 +10561,7 @@ function Lr({
|
|
|
10559
10561
|
return me;
|
|
10560
10562
|
}), E(Y.nextCursor);
|
|
10561
10563
|
} catch (Y) {
|
|
10562
|
-
|
|
10564
|
+
R.error(`Failed to load more ${a}`, Y);
|
|
10563
10565
|
} finally {
|
|
10564
10566
|
A(!1);
|
|
10565
10567
|
}
|
|
@@ -10570,13 +10572,13 @@ function Lr({
|
|
|
10570
10572
|
r,
|
|
10571
10573
|
n,
|
|
10572
10574
|
a,
|
|
10573
|
-
|
|
10575
|
+
R
|
|
10574
10576
|
]), { state: I, api: $ } = nl(), se = I !== null && $ !== null, G = o.useCallback(
|
|
10575
10577
|
(F) => {
|
|
10576
|
-
const
|
|
10578
|
+
const L = n(F), Y = i(F), Z = l(F) ?? "";
|
|
10577
10579
|
return {
|
|
10578
|
-
asset_id:
|
|
10579
|
-
asset_code: `${s}${
|
|
10580
|
+
asset_id: L,
|
|
10581
|
+
asset_code: `${s}${L}`,
|
|
10580
10582
|
file_path: Z,
|
|
10581
10583
|
file_url: Z,
|
|
10582
10584
|
...Z ? { thumbnail_url: Z } : {},
|
|
@@ -10590,22 +10592,22 @@ function Lr({
|
|
|
10590
10592
|
[s, n, i, l]
|
|
10591
10593
|
), q = o.useCallback(
|
|
10592
10594
|
(F) => se ? I.items.some(
|
|
10593
|
-
(
|
|
10595
|
+
(L) => L.asset_code === `${s}${F}`
|
|
10594
10596
|
) : m.includes(F),
|
|
10595
10597
|
[se, I, s, m]
|
|
10596
10598
|
), B = o.useCallback(
|
|
10597
10599
|
(F) => {
|
|
10598
10600
|
if (se) {
|
|
10599
|
-
const
|
|
10600
|
-
return I.items.findIndex((Y) => Y.asset_code ===
|
|
10601
|
+
const L = `${s}${F}`;
|
|
10602
|
+
return I.items.findIndex((Y) => Y.asset_code === L) + 1;
|
|
10601
10603
|
}
|
|
10602
10604
|
return m.indexOf(F) + 1;
|
|
10603
10605
|
},
|
|
10604
10606
|
[se, I, s, m]
|
|
10605
10607
|
), he = o.useCallback(
|
|
10606
|
-
(F,
|
|
10608
|
+
(F, L) => {
|
|
10607
10609
|
const Y = Number.parseInt(
|
|
10608
|
-
|
|
10610
|
+
L.startsWith(s) ? L.slice(s.length) : L,
|
|
10609
10611
|
10
|
|
10610
10612
|
);
|
|
10611
10613
|
if (Number.isNaN(Y)) return;
|
|
@@ -10628,7 +10630,7 @@ function Lr({
|
|
|
10628
10630
|
k = [...m, Y];
|
|
10629
10631
|
}
|
|
10630
10632
|
h(k);
|
|
10631
|
-
const
|
|
10633
|
+
const oe = new Map(z.map((fe) => [n(fe), fe])), ye = k.map((fe) => oe.get(fe)).filter((fe) => fe != null).map(G);
|
|
10632
10634
|
p(ye);
|
|
10633
10635
|
},
|
|
10634
10636
|
[
|
|
@@ -10649,11 +10651,11 @@ function Lr({
|
|
|
10649
10651
|
}, [se, m.length, f]);
|
|
10650
10652
|
const we = o.useCallback(
|
|
10651
10653
|
(F) => {
|
|
10652
|
-
const
|
|
10653
|
-
return
|
|
10654
|
+
const L = l(F);
|
|
10655
|
+
return L ? /* @__PURE__ */ e.jsx(
|
|
10654
10656
|
"img",
|
|
10655
10657
|
{
|
|
10656
|
-
src:
|
|
10658
|
+
src: L,
|
|
10657
10659
|
alt: i(F),
|
|
10658
10660
|
width: 200,
|
|
10659
10661
|
height: 150,
|
|
@@ -10664,12 +10666,12 @@ function Lr({
|
|
|
10664
10666
|
[c, l, i]
|
|
10665
10667
|
), _e = o.useMemo(
|
|
10666
10668
|
() => z.map((F) => {
|
|
10667
|
-
const
|
|
10669
|
+
const L = n(F), Y = B(L);
|
|
10668
10670
|
return {
|
|
10669
|
-
id: `${s}${
|
|
10671
|
+
id: `${s}${L}`,
|
|
10670
10672
|
name: i(F),
|
|
10671
10673
|
subtitle: u?.(F) ?? void 0,
|
|
10672
|
-
isSelected: q(
|
|
10674
|
+
isSelected: q(L),
|
|
10673
10675
|
selectionIndex: Y,
|
|
10674
10676
|
raw: F
|
|
10675
10677
|
};
|
|
@@ -10724,9 +10726,9 @@ function Lr({
|
|
|
10724
10726
|
Dr,
|
|
10725
10727
|
{
|
|
10726
10728
|
items: _e,
|
|
10727
|
-
viewMode:
|
|
10729
|
+
viewMode: x,
|
|
10728
10730
|
thumbnailSize: g,
|
|
10729
|
-
showNamesOnMedia:
|
|
10731
|
+
showNamesOnMedia: _,
|
|
10730
10732
|
renderThumbnail: we,
|
|
10731
10733
|
onClick: he
|
|
10732
10734
|
}
|
|
@@ -10753,7 +10755,7 @@ function Lr({
|
|
|
10753
10755
|
const sf = (t) => {
|
|
10754
10756
|
const { shareablesClient: s } = ut(), a = s?.pages;
|
|
10755
10757
|
return a ? /* @__PURE__ */ e.jsx(
|
|
10756
|
-
|
|
10758
|
+
Rr,
|
|
10757
10759
|
{
|
|
10758
10760
|
contentKind: "pages",
|
|
10759
10761
|
assetCodePrefix: "page_",
|
|
@@ -10769,7 +10771,7 @@ const sf = (t) => {
|
|
|
10769
10771
|
}, af = (t) => {
|
|
10770
10772
|
const { shareablesClient: s } = ut(), a = s?.products;
|
|
10771
10773
|
return a ? /* @__PURE__ */ e.jsx(
|
|
10772
|
-
|
|
10774
|
+
Rr,
|
|
10773
10775
|
{
|
|
10774
10776
|
contentKind: "products",
|
|
10775
10777
|
assetCodePrefix: "product_",
|
|
@@ -10786,7 +10788,7 @@ const sf = (t) => {
|
|
|
10786
10788
|
}, rf = (t) => {
|
|
10787
10789
|
const { shareablesClient: s } = ut(), a = s?.enrollment_packs;
|
|
10788
10790
|
return a ? /* @__PURE__ */ e.jsx(
|
|
10789
|
-
|
|
10791
|
+
Rr,
|
|
10790
10792
|
{
|
|
10791
10793
|
contentKind: "enrollment_packs",
|
|
10792
10794
|
assetCodePrefix: "enrollment_pack_",
|
|
@@ -10800,7 +10802,7 @@ const sf = (t) => {
|
|
|
10800
10802
|
}
|
|
10801
10803
|
) : null;
|
|
10802
10804
|
}, nf = (t) => {
|
|
10803
|
-
const { controlledSearchQuery: s, onControlledSearchQueryChange: a } = t ?? {}, [r, n] = o.useState(""), i = s ?? r, l = a ?? n, [u, c] = o.useState([]), [d, m] = o.useState(!1), [h, p] = o.useState(!1), [f, g] = o.useState(1), [
|
|
10805
|
+
const { controlledSearchQuery: s, onControlledSearchQueryChange: a } = t ?? {}, [r, n] = o.useState(""), i = s ?? r, l = a ?? n, [u, c] = o.useState([]), [d, m] = o.useState(!1), [h, p] = o.useState(!1), [f, g] = o.useState(1), [x, _] = o.useState(!0), [w, b] = o.useState(/* @__PURE__ */ new Map()), j = Ge(), v = vs(), { apiBaseUrl: C, toast: N } = ut(), z = ze({
|
|
10804
10806
|
mutationFn: (A) => v.createDamAsset(A),
|
|
10805
10807
|
onSuccess: () => {
|
|
10806
10808
|
j.invalidateQueries({ queryKey: ss.all });
|
|
@@ -10808,7 +10810,7 @@ const sf = (t) => {
|
|
|
10808
10810
|
}), O = o.useCallback(
|
|
10809
10811
|
async (A, M = 1) => {
|
|
10810
10812
|
if (!A.trim()) {
|
|
10811
|
-
c([]), g(1),
|
|
10813
|
+
c([]), g(1), _(!0);
|
|
10812
10814
|
return;
|
|
10813
10815
|
}
|
|
10814
10816
|
M === 1 ? (m(!0), g(1)) : p(!0);
|
|
@@ -10816,7 +10818,7 @@ const sf = (t) => {
|
|
|
10816
10818
|
const S = await v.searchUnsplash(A, M);
|
|
10817
10819
|
c(
|
|
10818
10820
|
(K) => M === 1 ? S.results : [...K, ...S.results]
|
|
10819
|
-
), g(M),
|
|
10821
|
+
), g(M), _(M < S.total_pages);
|
|
10820
10822
|
} catch (S) {
|
|
10821
10823
|
M === 1 && c([]), N.error(
|
|
10822
10824
|
S instanceof Error ? S.message : "Unsplash search failed"
|
|
@@ -10859,7 +10861,7 @@ const sf = (t) => {
|
|
|
10859
10861
|
status: "uploading"
|
|
10860
10862
|
}), q;
|
|
10861
10863
|
});
|
|
10862
|
-
const
|
|
10864
|
+
const R = await D.blob(), T = new File([R], S, { type: "image/jpeg" });
|
|
10863
10865
|
b((G) => {
|
|
10864
10866
|
const q = new Map(G);
|
|
10865
10867
|
return q.set(M, {
|
|
@@ -10908,13 +10910,13 @@ const sf = (t) => {
|
|
|
10908
10910
|
} catch (K) {
|
|
10909
10911
|
const W = K instanceof Error ? K.message : "Upload failed";
|
|
10910
10912
|
return N.error(W), b((D) => {
|
|
10911
|
-
const
|
|
10912
|
-
return
|
|
10913
|
+
const R = new Map(D);
|
|
10914
|
+
return R.set(M, {
|
|
10913
10915
|
file_name: S,
|
|
10914
10916
|
progress: 0,
|
|
10915
10917
|
status: "error",
|
|
10916
10918
|
error: W
|
|
10917
|
-
}),
|
|
10919
|
+
}), R;
|
|
10918
10920
|
}), {
|
|
10919
10921
|
asset_id: 0,
|
|
10920
10922
|
asset_code: "",
|
|
@@ -10936,8 +10938,8 @@ const sf = (t) => {
|
|
|
10936
10938
|
), E = o.useCallback(() => {
|
|
10937
10939
|
b(/* @__PURE__ */ new Map());
|
|
10938
10940
|
}, []), P = o.useCallback(() => {
|
|
10939
|
-
i.trim() &&
|
|
10940
|
-
}, [i,
|
|
10941
|
+
i.trim() && x && !h && O(i, f + 1);
|
|
10942
|
+
}, [i, x, h, f, O]);
|
|
10941
10943
|
return {
|
|
10942
10944
|
searchQuery: i,
|
|
10943
10945
|
setSearchQuery: l,
|
|
@@ -10948,7 +10950,7 @@ const sf = (t) => {
|
|
|
10948
10950
|
uploadProgress: Array.from(w.values()),
|
|
10949
10951
|
isUploading: z.isPending,
|
|
10950
10952
|
clearProgress: E,
|
|
10951
|
-
hasMoreResults:
|
|
10953
|
+
hasMoreResults: x,
|
|
10952
10954
|
loadMore: P,
|
|
10953
10955
|
isLoadingMore: h
|
|
10954
10956
|
};
|
|
@@ -10970,8 +10972,8 @@ const sf = (t) => {
|
|
|
10970
10972
|
isUploading: p,
|
|
10971
10973
|
clearProgress: f,
|
|
10972
10974
|
hasMoreResults: g,
|
|
10973
|
-
loadMore:
|
|
10974
|
-
isLoadingMore:
|
|
10975
|
+
loadMore: x,
|
|
10976
|
+
isLoadingMore: _
|
|
10975
10977
|
} = nf(
|
|
10976
10978
|
a !== void 0 && r ? {
|
|
10977
10979
|
controlledSearchQuery: a,
|
|
@@ -11022,7 +11024,7 @@ const sf = (t) => {
|
|
|
11022
11024
|
style: {
|
|
11023
11025
|
backgroundColor: "rgba(0, 0, 0, 0)"
|
|
11024
11026
|
},
|
|
11025
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ e.jsx(
|
|
11027
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ e.jsx(Rs, { className: "h-6 w-6 text-white" }) })
|
|
11026
11028
|
}
|
|
11027
11029
|
),
|
|
11028
11030
|
/* @__PURE__ */ e.jsx("div", { className: "absolute right-0 bottom-0 left-0 bg-linear-to-t from-black to-transparent p-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-1 text-xs text-white", children: [
|
|
@@ -11058,7 +11060,7 @@ const sf = (t) => {
|
|
|
11058
11060
|
] })
|
|
11059
11061
|
] }) }),
|
|
11060
11062
|
w === v.id && p && /* @__PURE__ */ e.jsx("div", { className: "bg-opacity-75 absolute inset-0 flex items-center justify-center bg-blue-500", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center text-white", children: [
|
|
11061
|
-
/* @__PURE__ */ e.jsx(
|
|
11063
|
+
/* @__PURE__ */ e.jsx(Rs, { className: "mb-1 h-6 w-6 animate-pulse" }),
|
|
11062
11064
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Uploading..." })
|
|
11063
11065
|
] }) })
|
|
11064
11066
|
]
|
|
@@ -11070,11 +11072,11 @@ const sf = (t) => {
|
|
|
11070
11072
|
l,
|
|
11071
11073
|
'"'
|
|
11072
11074
|
] }) }),
|
|
11073
|
-
g && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ e.jsx(H, { onClick:
|
|
11075
|
+
g && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ e.jsx(H, { onClick: x, disabled: _, variant: "outline", children: _ ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
11074
11076
|
/* @__PURE__ */ e.jsx(Ct, { className: "mr-2 animate-spin" }),
|
|
11075
11077
|
"Loading..."
|
|
11076
11078
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
11077
|
-
/* @__PURE__ */ e.jsx(
|
|
11079
|
+
/* @__PURE__ */ e.jsx(Rs, { className: "mr-2" }),
|
|
11078
11080
|
"Load More"
|
|
11079
11081
|
] }) }) }),
|
|
11080
11082
|
t.showProgress && h.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -11087,7 +11089,7 @@ const sf = (t) => {
|
|
|
11087
11089
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
11088
11090
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
11089
11091
|
(() => {
|
|
11090
|
-
const C = v.status === "ready" ? as : v.status === "error" ? Os :
|
|
11092
|
+
const C = v.status === "ready" ? as : v.status === "error" ? Os : Rs;
|
|
11091
11093
|
return /* @__PURE__ */ e.jsx(
|
|
11092
11094
|
C,
|
|
11093
11095
|
{
|
|
@@ -11137,12 +11139,12 @@ const sf = (t) => {
|
|
|
11137
11139
|
async (m, h) => {
|
|
11138
11140
|
const p = `url-${Date.now()}`, f = h || m.split("/").pop()?.split("?")[0]?.split("#")[0] || "url-upload";
|
|
11139
11141
|
s((g) => {
|
|
11140
|
-
const
|
|
11141
|
-
return
|
|
11142
|
+
const x = new Map(g);
|
|
11143
|
+
return x.set(p, {
|
|
11142
11144
|
file_name: f,
|
|
11143
11145
|
progress: 0,
|
|
11144
11146
|
status: "uploading"
|
|
11145
|
-
}),
|
|
11147
|
+
}), x;
|
|
11146
11148
|
});
|
|
11147
11149
|
try {
|
|
11148
11150
|
s((N) => {
|
|
@@ -11153,7 +11155,7 @@ const sf = (t) => {
|
|
|
11153
11155
|
status: "uploading"
|
|
11154
11156
|
}), z;
|
|
11155
11157
|
});
|
|
11156
|
-
let g,
|
|
11158
|
+
let g, x;
|
|
11157
11159
|
try {
|
|
11158
11160
|
const N = await fetch(m, {
|
|
11159
11161
|
mode: "cors",
|
|
@@ -11161,7 +11163,7 @@ const sf = (t) => {
|
|
|
11161
11163
|
});
|
|
11162
11164
|
if (!N.ok)
|
|
11163
11165
|
throw new Error(`Failed to fetch file: ${N.statusText}`);
|
|
11164
|
-
g = await N.blob(),
|
|
11166
|
+
g = await N.blob(), x = N.headers.get("content-type") || "application/octet-stream";
|
|
11165
11167
|
} catch (N) {
|
|
11166
11168
|
if (N instanceof TypeError && (N.message.includes("CORS") || N.message.includes("Failed to fetch") || N.message.includes("NetworkError"))) {
|
|
11167
11169
|
s((O) => {
|
|
@@ -11176,7 +11178,7 @@ const sf = (t) => {
|
|
|
11176
11178
|
const O = await r.proxyUrlFetch(m), U = atob(O.data), E = new Uint8Array(U.length);
|
|
11177
11179
|
for (let P = 0; P < U.length; P++)
|
|
11178
11180
|
E[P] = U.charCodeAt(P);
|
|
11179
|
-
g = new Blob([E], { type: O.contentType }),
|
|
11181
|
+
g = new Blob([E], { type: O.contentType }), x = O.contentType;
|
|
11180
11182
|
} catch (O) {
|
|
11181
11183
|
let U = m;
|
|
11182
11184
|
try {
|
|
@@ -11198,7 +11200,7 @@ const sf = (t) => {
|
|
|
11198
11200
|
status: "uploading"
|
|
11199
11201
|
}), z;
|
|
11200
11202
|
});
|
|
11201
|
-
const w = Yu(f), b = new File([g], w, { type:
|
|
11203
|
+
const w = Yu(f), b = new File([g], w, { type: x });
|
|
11202
11204
|
s((N) => {
|
|
11203
11205
|
const z = new Map(N);
|
|
11204
11206
|
return z.set(p, {
|
|
@@ -11229,21 +11231,21 @@ const sf = (t) => {
|
|
|
11229
11231
|
file_url: C,
|
|
11230
11232
|
metadata: {
|
|
11231
11233
|
file_name: w,
|
|
11232
|
-
mime_type:
|
|
11234
|
+
mime_type: x,
|
|
11233
11235
|
file_size: g.size
|
|
11234
11236
|
},
|
|
11235
11237
|
upload_status: "ready",
|
|
11236
11238
|
variant_id: v.default_variant_id ? v.default_variant_id.toString() : void 0
|
|
11237
11239
|
};
|
|
11238
11240
|
} catch (g) {
|
|
11239
|
-
const
|
|
11240
|
-
return l.error(
|
|
11241
|
-
const w = new Map(
|
|
11241
|
+
const x = g instanceof Error ? g.message : "Upload failed";
|
|
11242
|
+
return l.error(x), s((_) => {
|
|
11243
|
+
const w = new Map(_);
|
|
11242
11244
|
return w.set(p, {
|
|
11243
11245
|
file_name: f,
|
|
11244
11246
|
progress: 0,
|
|
11245
11247
|
status: "error",
|
|
11246
|
-
error:
|
|
11248
|
+
error: x
|
|
11247
11249
|
}), w;
|
|
11248
11250
|
}), {
|
|
11249
11251
|
asset_id: 0,
|
|
@@ -11276,7 +11278,7 @@ const sf = (t) => {
|
|
|
11276
11278
|
onShareableChange: n,
|
|
11277
11279
|
selectedFilesCount: i
|
|
11278
11280
|
}) => {
|
|
11279
|
-
const { toast: l } = ut(), [u, c] = o.useState(""), [d, m] = o.useState(""), { uploadFromUrl: h, uploadProgress: p, isUploading: f, clearProgress: g } = of(),
|
|
11281
|
+
const { toast: l } = ut(), [u, c] = o.useState(""), [d, m] = o.useState(""), { uploadFromUrl: h, uploadProgress: p, isUploading: f, clearProgress: g } = of(), x = async (j) => {
|
|
11280
11282
|
if (j.preventDefault(), !!u.trim()) {
|
|
11281
11283
|
g();
|
|
11282
11284
|
try {
|
|
@@ -11288,7 +11290,7 @@ const sf = (t) => {
|
|
|
11288
11290
|
credentials: "omit"
|
|
11289
11291
|
})).headers.get("content-type") || "", z = d.trim() || w(u.trim());
|
|
11290
11292
|
if (!Du(N, z, t.accept)) {
|
|
11291
|
-
const O =
|
|
11293
|
+
const O = Ru(
|
|
11292
11294
|
t.accept
|
|
11293
11295
|
);
|
|
11294
11296
|
l.error(
|
|
@@ -11311,7 +11313,7 @@ const sf = (t) => {
|
|
|
11311
11313
|
l.error(v instanceof Error ? v.message : "Unknown error");
|
|
11312
11314
|
}
|
|
11313
11315
|
}
|
|
11314
|
-
},
|
|
11316
|
+
}, _ = (j) => {
|
|
11315
11317
|
try {
|
|
11316
11318
|
return new URL(j), !0;
|
|
11317
11319
|
} catch {
|
|
@@ -11324,7 +11326,7 @@ const sf = (t) => {
|
|
|
11324
11326
|
return "";
|
|
11325
11327
|
}
|
|
11326
11328
|
}, b = (j) => {
|
|
11327
|
-
if (c(j), j &&
|
|
11329
|
+
if (c(j), j && _(j) && !d) {
|
|
11328
11330
|
const v = w(j);
|
|
11329
11331
|
v && m(v);
|
|
11330
11332
|
}
|
|
@@ -11337,7 +11339,7 @@ const sf = (t) => {
|
|
|
11337
11339
|
/* @__PURE__ */ e.jsxs(
|
|
11338
11340
|
"form",
|
|
11339
11341
|
{
|
|
11340
|
-
onSubmit:
|
|
11342
|
+
onSubmit: x,
|
|
11341
11343
|
className: "mx-auto w-full space-y-5 md:w-1/2",
|
|
11342
11344
|
children: [
|
|
11343
11345
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -11352,15 +11354,15 @@ const sf = (t) => {
|
|
|
11352
11354
|
onChange: (j) => b(j.target.value),
|
|
11353
11355
|
disabled: f,
|
|
11354
11356
|
required: !0,
|
|
11355
|
-
className: `w-full pr-10 transition-all duration-200 ${u && !
|
|
11357
|
+
className: `w-full pr-10 transition-all duration-200 ${u && !_(u) ? "border-red-300 bg-red-50/30 focus:border-red-500 focus:ring-red-500/20" : "focus:border-blue-500 focus:ring-blue-500/20"}`
|
|
11356
11358
|
}
|
|
11357
11359
|
),
|
|
11358
|
-
u && /* @__PURE__ */ e.jsx("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children:
|
|
11360
|
+
u && /* @__PURE__ */ e.jsx("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children: _(u) ? /* @__PURE__ */ e.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-green-100", children: /* @__PURE__ */ e.jsx(as, { className: "h-3 w-3 text-green-600" }) }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-red-100", children: /* @__PURE__ */ e.jsx(Os, { className: "h-3 w-3 text-red-600" }) }) })
|
|
11359
11361
|
] }),
|
|
11360
|
-
u.trim() &&
|
|
11362
|
+
u.trim() && _(u) && /* @__PURE__ */ e.jsx(H, { variant: "default", type: "submit", disabled: f, children: f ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(Ct, { className: "h-3 w-3 animate-spin" }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(lc, { className: "h-3 w-3" }) }) })
|
|
11361
11363
|
] }),
|
|
11362
|
-
u && !
|
|
11363
|
-
u &&
|
|
11364
|
+
u && !_(u) && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-600", children: "Please enter a valid URL" }),
|
|
11365
|
+
u && _(u) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
11364
11366
|
/* @__PURE__ */ e.jsxs(
|
|
11365
11367
|
"label",
|
|
11366
11368
|
{
|
|
@@ -11469,12 +11471,12 @@ const sf = (t) => {
|
|
|
11469
11471
|
for (const p of m) {
|
|
11470
11472
|
const f = `${p.name}-${Date.now()}`;
|
|
11471
11473
|
s((g) => {
|
|
11472
|
-
const
|
|
11473
|
-
return
|
|
11474
|
+
const x = new Map(g);
|
|
11475
|
+
return x.set(f, {
|
|
11474
11476
|
file_name: p.name,
|
|
11475
11477
|
progress: 0,
|
|
11476
11478
|
status: "uploading"
|
|
11477
|
-
}),
|
|
11479
|
+
}), x;
|
|
11478
11480
|
});
|
|
11479
11481
|
try {
|
|
11480
11482
|
s((w) => {
|
|
@@ -11499,31 +11501,31 @@ const sf = (t) => {
|
|
|
11499
11501
|
status: "ready"
|
|
11500
11502
|
}), b;
|
|
11501
11503
|
});
|
|
11502
|
-
const
|
|
11504
|
+
const x = g.asset, _ = kr(x, l);
|
|
11503
11505
|
h.push({
|
|
11504
|
-
asset_id:
|
|
11505
|
-
asset_code:
|
|
11506
|
-
file_path:
|
|
11507
|
-
file_url:
|
|
11506
|
+
asset_id: x.id,
|
|
11507
|
+
asset_code: x.code,
|
|
11508
|
+
file_path: _,
|
|
11509
|
+
file_url: _,
|
|
11508
11510
|
metadata: {
|
|
11509
11511
|
file_name: p.name,
|
|
11510
11512
|
mime_type: ga(p),
|
|
11511
11513
|
file_size: p.size
|
|
11512
11514
|
},
|
|
11513
11515
|
upload_status: "ready",
|
|
11514
|
-
variant_id:
|
|
11516
|
+
variant_id: x.default_variant_id ? x.default_variant_id.toString() : void 0
|
|
11515
11517
|
});
|
|
11516
11518
|
} catch (g) {
|
|
11517
|
-
const
|
|
11518
|
-
|
|
11519
|
+
const x = g instanceof Error ? g.message : "Upload failed", _ = g instanceof Error && "status" in g ? g.status : void 0;
|
|
11520
|
+
_ === 413 || _ === 400 && x.toLowerCase().includes("file size") ? i.error(
|
|
11519
11521
|
"File size too large: Please compress or choose another file"
|
|
11520
|
-
) : i.error(
|
|
11522
|
+
) : i.error(x), s((b) => {
|
|
11521
11523
|
const j = new Map(b);
|
|
11522
11524
|
return j.set(f, {
|
|
11523
11525
|
file_name: p.name,
|
|
11524
11526
|
progress: 0,
|
|
11525
11527
|
status: "error",
|
|
11526
|
-
error:
|
|
11528
|
+
error: x
|
|
11527
11529
|
}), j;
|
|
11528
11530
|
}), h.push({
|
|
11529
11531
|
asset_id: 0,
|
|
@@ -11562,21 +11564,21 @@ const sf = (t) => {
|
|
|
11562
11564
|
maxWidth: u = 2e3,
|
|
11563
11565
|
maxHeight: c = 2e3
|
|
11564
11566
|
}) => {
|
|
11565
|
-
const { toast: d } = ut(), m = js(), [h, p] = o.useState(!1), [f, g] = o.useState(), [
|
|
11567
|
+
const { toast: d } = ut(), m = js(), [h, p] = o.useState(!1), [f, g] = o.useState(), [x, _] = o.useState(), [w, b] = o.useState(""), [j, v] = o.useState(!1), [C, N] = o.useState(
|
|
11566
11568
|
n ?? "free"
|
|
11567
11569
|
), [z, O] = o.useState(0), [U, E] = o.useState(!1), [P, A] = o.useState(1), [M, S] = o.useState(!1), [K, W] = o.useState(
|
|
11568
11570
|
null
|
|
11569
|
-
), D = o.useRef(null),
|
|
11571
|
+
), D = o.useRef(null), R = o.useRef(null), T = o.useRef(null), I = C === "free" ? void 0 : C, $ = o.useMemo(() => {
|
|
11570
11572
|
const F = D.current;
|
|
11571
|
-
if (!
|
|
11572
|
-
const
|
|
11573
|
+
if (!x || !F) return null;
|
|
11574
|
+
const L = F.naturalWidth, Y = F.naturalHeight, Z = F.clientWidth, J = F.clientHeight;
|
|
11573
11575
|
if (!Z || !J) return null;
|
|
11574
|
-
const me = Math.max(
|
|
11576
|
+
const me = Math.max(L / Z, Y / J);
|
|
11575
11577
|
return {
|
|
11576
|
-
width: Math.floor(
|
|
11577
|
-
height: Math.floor(
|
|
11578
|
+
width: Math.floor(x.width * me),
|
|
11579
|
+
height: Math.floor(x.height * me)
|
|
11578
11580
|
};
|
|
11579
|
-
}, [
|
|
11581
|
+
}, [x]), G = z !== 0 || U !== !1 || P !== 1 || C !== (n ?? "free") || M;
|
|
11580
11582
|
o.useEffect(() => {
|
|
11581
11583
|
if (t && r) {
|
|
11582
11584
|
const F = new FileReader();
|
|
@@ -11587,27 +11589,27 @@ const sf = (t) => {
|
|
|
11587
11589
|
t || (O(0), E(!1), A(1), S(!1), W(null), N(n ?? "free"));
|
|
11588
11590
|
}, [t, r, n]);
|
|
11589
11591
|
const q = o.useCallback((F) => {
|
|
11590
|
-
const
|
|
11591
|
-
if (!
|
|
11592
|
+
const L = D.current;
|
|
11593
|
+
if (!L) return;
|
|
11592
11594
|
const { crop: Y, completedCrop: Z } = Gu(
|
|
11593
|
-
|
|
11594
|
-
|
|
11595
|
+
L.clientWidth,
|
|
11596
|
+
L.clientHeight,
|
|
11595
11597
|
F
|
|
11596
11598
|
);
|
|
11597
|
-
g(Y), setTimeout(() =>
|
|
11599
|
+
g(Y), setTimeout(() => _(Z), 0);
|
|
11598
11600
|
}, []), B = o.useCallback(() => {
|
|
11599
11601
|
D.current && q(I);
|
|
11600
11602
|
}, [I, q]), he = async () => {
|
|
11601
11603
|
if (D.current) {
|
|
11602
11604
|
v(!0);
|
|
11603
11605
|
try {
|
|
11604
|
-
const F = D.current.clientWidth,
|
|
11606
|
+
const F = D.current.clientWidth, L = D.current.clientHeight;
|
|
11605
11607
|
let Y, Z, J, me;
|
|
11606
|
-
|
|
11608
|
+
x ? (Y = x.x, Z = x.y, J = x.width, me = x.height) : f ? f.unit === "%" ? (Y = f.x / 100 * F, Z = f.y / 100 * L, J = f.width / 100 * F, me = f.height / 100 * L) : (Y = f.x, Z = f.y, J = f.width, me = f.height) : (Y = 0, Z = 0, J = F, me = L);
|
|
11607
11609
|
const k = await Wu(
|
|
11608
11610
|
D.current,
|
|
11609
11611
|
F,
|
|
11610
|
-
|
|
11612
|
+
L,
|
|
11611
11613
|
{ x: Y, y: Z, width: J, height: me },
|
|
11612
11614
|
P,
|
|
11613
11615
|
z,
|
|
@@ -11712,8 +11714,8 @@ const sf = (t) => {
|
|
|
11712
11714
|
type: "button",
|
|
11713
11715
|
onClick: () => {
|
|
11714
11716
|
O((F) => {
|
|
11715
|
-
const
|
|
11716
|
-
return
|
|
11717
|
+
const L = F + 90;
|
|
11718
|
+
return L > Vu ? L - 360 : L < Ku ? L + 360 : L;
|
|
11717
11719
|
});
|
|
11718
11720
|
},
|
|
11719
11721
|
"aria-label": "Rotate 90deg",
|
|
@@ -11787,16 +11789,16 @@ const sf = (t) => {
|
|
|
11787
11789
|
children: /* @__PURE__ */ e.jsx(
|
|
11788
11790
|
"div",
|
|
11789
11791
|
{
|
|
11790
|
-
ref:
|
|
11792
|
+
ref: R,
|
|
11791
11793
|
className: "image-crop-modal-crop [&_.ReactCrop__crop-selection]:border-contrast [&_.ReactCrop__rule]:border-border flex w-full items-center justify-center [&_.ReactCrop__crop-selection]:border-2 [&_.ReactCrop__crop-selection]:border-dashed [&_.ReactCrop__crop-selection]:shadow-[0_0_0_9999px_rgba(0,0,0,0.4)]",
|
|
11792
11794
|
children: /* @__PURE__ */ e.jsx(
|
|
11793
11795
|
Bu,
|
|
11794
11796
|
{
|
|
11795
11797
|
crop: f,
|
|
11796
|
-
onChange: (F,
|
|
11797
|
-
g(
|
|
11798
|
+
onChange: (F, L) => {
|
|
11799
|
+
g(L), _(F), S(!0);
|
|
11798
11800
|
},
|
|
11799
|
-
onComplete: (F) =>
|
|
11801
|
+
onComplete: (F) => _(F),
|
|
11800
11802
|
aspect: I,
|
|
11801
11803
|
minWidth: i,
|
|
11802
11804
|
minHeight: l,
|
|
@@ -11882,7 +11884,7 @@ const mf = ({
|
|
|
11882
11884
|
skipCropper: i = !1,
|
|
11883
11885
|
selectedFilesCount: l
|
|
11884
11886
|
}) => {
|
|
11885
|
-
const { toast: u } = ut(), { uploadFiles: c, uploadProgress: d, isUploading: m, clearProgress: h } = df(), [p, f] = o.useState(!1), [g,
|
|
11887
|
+
const { toast: u } = ut(), { uploadFiles: c, uploadProgress: d, isUploading: m, clearProgress: h } = df(), [p, f] = o.useState(!1), [g, x] = o.useState(!1), [_, w] = o.useState(null), [b, j] = o.useState([]), v = o.useCallback(
|
|
11886
11888
|
async (P) => {
|
|
11887
11889
|
f(!1), h();
|
|
11888
11890
|
const A = t.maxFiles ? P.slice(0, t.maxFiles) : P, M = [
|
|
@@ -11891,11 +11893,11 @@ const mf = ({
|
|
|
11891
11893
|
"image/heif",
|
|
11892
11894
|
"image/svg+xml"
|
|
11893
11895
|
], S = (D) => {
|
|
11894
|
-
const
|
|
11895
|
-
return
|
|
11896
|
+
const R = ga(D);
|
|
11897
|
+
return R.startsWith("image/") && !M.includes(R);
|
|
11896
11898
|
}, K = A.filter(S), W = A.filter((D) => !S(D));
|
|
11897
11899
|
if (K.length === 1 && !i)
|
|
11898
|
-
j(W), w(K[0] || null),
|
|
11900
|
+
j(W), w(K[0] || null), x(!0);
|
|
11899
11901
|
else {
|
|
11900
11902
|
const D = await c(A);
|
|
11901
11903
|
s(D);
|
|
@@ -11904,13 +11906,13 @@ const mf = ({
|
|
|
11904
11906
|
[c, s, t.maxFiles, h, i]
|
|
11905
11907
|
), C = o.useCallback(
|
|
11906
11908
|
async (P) => {
|
|
11907
|
-
|
|
11909
|
+
x(!1);
|
|
11908
11910
|
const A = [P, ...b], M = await c(A);
|
|
11909
11911
|
s(M), w(null), j([]);
|
|
11910
11912
|
},
|
|
11911
11913
|
[c, s, b]
|
|
11912
11914
|
), N = o.useCallback(() => {
|
|
11913
|
-
|
|
11915
|
+
x(!1), w(null), b.length > 0 && c(b).then(s), j([]);
|
|
11914
11916
|
}, [c, s, b]), z = o.useCallback(
|
|
11915
11917
|
(P) => {
|
|
11916
11918
|
P.forEach(({ file: A, errors: M }) => {
|
|
@@ -12027,13 +12029,13 @@ const mf = ({
|
|
|
12027
12029
|
}
|
|
12028
12030
|
)
|
|
12029
12031
|
] }) }),
|
|
12030
|
-
|
|
12032
|
+
_ && /* @__PURE__ */ e.jsx(
|
|
12031
12033
|
fl,
|
|
12032
12034
|
{
|
|
12033
12035
|
isOpen: g,
|
|
12034
12036
|
onClose: N,
|
|
12035
12037
|
onCrop: C,
|
|
12036
|
-
imageFile:
|
|
12038
|
+
imageFile: _,
|
|
12037
12039
|
minWidth: 50,
|
|
12038
12040
|
minHeight: 50,
|
|
12039
12041
|
maxWidth: 2e3,
|
|
@@ -12057,8 +12059,8 @@ const mf = ({
|
|
|
12057
12059
|
onMediaIdsChange: p,
|
|
12058
12060
|
onMediaSelectionChange: f,
|
|
12059
12061
|
onMediaDataChange: g,
|
|
12060
|
-
selectedPageIds:
|
|
12061
|
-
onPageIdsChange:
|
|
12062
|
+
selectedPageIds: x,
|
|
12063
|
+
onPageIdsChange: _,
|
|
12062
12064
|
onPageSelectionChange: w,
|
|
12063
12065
|
onPageDataChange: b,
|
|
12064
12066
|
selectedProductIds: j,
|
|
@@ -12076,7 +12078,7 @@ const mf = ({
|
|
|
12076
12078
|
onDamSearchChange: K,
|
|
12077
12079
|
mediaSearchQuery: W,
|
|
12078
12080
|
onMediaSearchChange: D,
|
|
12079
|
-
unsplashSearchQuery:
|
|
12081
|
+
unsplashSearchQuery: R,
|
|
12080
12082
|
onUnsplashSearchChange: T,
|
|
12081
12083
|
onUnsplashSearchingChange: I,
|
|
12082
12084
|
onUnsplashUploadingChange: $,
|
|
@@ -12088,10 +12090,10 @@ const mf = ({
|
|
|
12088
12090
|
previewMedia: we,
|
|
12089
12091
|
onPreviewMediaChange: _e,
|
|
12090
12092
|
previewAsset: F,
|
|
12091
|
-
onPreviewAssetChange:
|
|
12093
|
+
onPreviewAssetChange: L,
|
|
12092
12094
|
uploadSelectionCount: Y
|
|
12093
12095
|
}) => {
|
|
12094
|
-
const Z =
|
|
12096
|
+
const Z = ue.useMemo(
|
|
12095
12097
|
() => ({
|
|
12096
12098
|
...s,
|
|
12097
12099
|
fileTypeFilter: a ? [a] : s.fileTypeFilter
|
|
@@ -12143,7 +12145,7 @@ const mf = ({
|
|
|
12143
12145
|
showNamesOnMedia: q,
|
|
12144
12146
|
previewContainer: he,
|
|
12145
12147
|
previewAsset: F,
|
|
12146
|
-
onPreviewAssetChange:
|
|
12148
|
+
onPreviewAssetChange: L
|
|
12147
12149
|
}
|
|
12148
12150
|
),
|
|
12149
12151
|
t === "media" && /* @__PURE__ */ e.jsx(
|
|
@@ -12172,8 +12174,8 @@ const mf = ({
|
|
|
12172
12174
|
sf,
|
|
12173
12175
|
{
|
|
12174
12176
|
config: s,
|
|
12175
|
-
selectedIds:
|
|
12176
|
-
onSelectedIdsChange:
|
|
12177
|
+
selectedIds: x ?? [],
|
|
12178
|
+
onSelectedIdsChange: _ ?? (() => {
|
|
12177
12179
|
}),
|
|
12178
12180
|
onSelectedDataChange: b ?? (() => {
|
|
12179
12181
|
}),
|
|
@@ -12218,7 +12220,7 @@ const mf = ({
|
|
|
12218
12220
|
{
|
|
12219
12221
|
config: s,
|
|
12220
12222
|
onFileSelected: i,
|
|
12221
|
-
searchQuery:
|
|
12223
|
+
searchQuery: R,
|
|
12222
12224
|
onSearchQueryChange: T,
|
|
12223
12225
|
onSearchingChange: I,
|
|
12224
12226
|
onUploadingChange: $
|
|
@@ -12278,7 +12280,7 @@ const mf = ({
|
|
|
12278
12280
|
onOpenVariantModal: d,
|
|
12279
12281
|
onCropImage: m
|
|
12280
12282
|
}) => {
|
|
12281
|
-
const h = js(), [p, f] = o.useState(null), [g,
|
|
12283
|
+
const h = js(), [p, f] = o.useState(null), [g, x] = o.useState(null), [_, w] = o.useState(null), [b, j] = o.useState(!1), [v, C] = o.useState(null), N = o.useCallback(
|
|
12282
12284
|
(E) => {
|
|
12283
12285
|
if (u && c) {
|
|
12284
12286
|
const P = u(E);
|
|
@@ -12306,7 +12308,7 @@ const mf = ({
|
|
|
12306
12308
|
const K = new File([S], A, { type: M });
|
|
12307
12309
|
w(K), j(!0);
|
|
12308
12310
|
}).catch(() => {
|
|
12309
|
-
E ||
|
|
12311
|
+
E || x(null);
|
|
12310
12312
|
}), () => {
|
|
12311
12313
|
E = !0;
|
|
12312
12314
|
};
|
|
@@ -12317,11 +12319,11 @@ const mf = ({
|
|
|
12317
12319
|
const P = m?.(g.assetCode, E);
|
|
12318
12320
|
P != null && typeof P?.then == "function" && await P;
|
|
12319
12321
|
}
|
|
12320
|
-
|
|
12322
|
+
x(null), w(null), j(!1);
|
|
12321
12323
|
},
|
|
12322
12324
|
[g, m]
|
|
12323
12325
|
), U = o.useCallback(() => {
|
|
12324
|
-
|
|
12326
|
+
x(null), w(null), j(!1);
|
|
12325
12327
|
}, []);
|
|
12326
12328
|
return !i || t.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex max-h-[45%] w-full shrink-0 flex-col border-t border-gray-200 bg-white md:h-full md:max-h-none md:w-72 md:border-t-0 md:border-l", children: [
|
|
12327
12329
|
/* @__PURE__ */ e.jsx("div", { className: "border-b border-gray-200 px-4 py-3", children: /* @__PURE__ */ e.jsx("h3", { className: "text-sm font-semibold text-gray-900", children: "Selection" }) }),
|
|
@@ -12350,7 +12352,7 @@ const mf = ({
|
|
|
12350
12352
|
height: 40,
|
|
12351
12353
|
className: "h-full w-full object-cover"
|
|
12352
12354
|
}
|
|
12353
|
-
) : /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center", children:
|
|
12355
|
+
) : /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center", children: ue.createElement(
|
|
12354
12356
|
hf(E.metadata.mime_type),
|
|
12355
12357
|
{
|
|
12356
12358
|
className: "h-4 w-4 text-gray-400"
|
|
@@ -12388,7 +12390,7 @@ const mf = ({
|
|
|
12388
12390
|
{
|
|
12389
12391
|
disabled: !P,
|
|
12390
12392
|
onClick: (M) => {
|
|
12391
|
-
M.stopPropagation(), P && Fs(E) &&
|
|
12393
|
+
M.stopPropagation(), P && Fs(E) && x({
|
|
12392
12394
|
assetCode: E.asset_code,
|
|
12393
12395
|
file: E
|
|
12394
12396
|
});
|
|
@@ -12455,7 +12457,7 @@ const mf = ({
|
|
|
12455
12457
|
label: "Crop image",
|
|
12456
12458
|
disabled: !p || !Fs(p) || !m,
|
|
12457
12459
|
onSelect: () => {
|
|
12458
|
-
p && Fs(p) && m &&
|
|
12460
|
+
p && Fs(p) && m && x({
|
|
12459
12461
|
assetCode: p.asset_code,
|
|
12460
12462
|
file: p
|
|
12461
12463
|
});
|
|
@@ -12476,13 +12478,13 @@ const mf = ({
|
|
|
12476
12478
|
/* @__PURE__ */ e.jsx(H, { variant: "secondary", size: "sm", onClick: a, children: "Clear" }),
|
|
12477
12479
|
/* @__PURE__ */ e.jsx(H, { variant: "default", size: "sm", onClick: r, children: n ? "Next" : `Use ${t.length} File${t.length !== 1 ? "s" : ""}` })
|
|
12478
12480
|
] }),
|
|
12479
|
-
|
|
12481
|
+
_ && /* @__PURE__ */ e.jsx(
|
|
12480
12482
|
fl,
|
|
12481
12483
|
{
|
|
12482
12484
|
isOpen: b,
|
|
12483
12485
|
onClose: U,
|
|
12484
12486
|
onCrop: O,
|
|
12485
|
-
imageFile:
|
|
12487
|
+
imageFile: _
|
|
12486
12488
|
}
|
|
12487
12489
|
),
|
|
12488
12490
|
v && h ? /* @__PURE__ */ e.jsxs(
|
|
@@ -12558,7 +12560,7 @@ const mf = ({
|
|
|
12558
12560
|
height: 64,
|
|
12559
12561
|
className: "h-16 w-16 rounded-md object-cover"
|
|
12560
12562
|
}
|
|
12561
|
-
) }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-md bg-gray-50", children:
|
|
12563
|
+
) }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-md bg-gray-50", children: ue.createElement(
|
|
12562
12564
|
pl(
|
|
12563
12565
|
v.asset?.category || "unknown"
|
|
12564
12566
|
),
|
|
@@ -12619,54 +12621,54 @@ const mf = ({
|
|
|
12619
12621
|
}, [c.allowedMethods, h]);
|
|
12620
12622
|
const [f, g] = o.useState(
|
|
12621
12623
|
[]
|
|
12622
|
-
), [
|
|
12624
|
+
), [x, _] = o.useState(0), [w, b] = o.useState(
|
|
12623
12625
|
[]
|
|
12624
|
-
), [j, v] = o.useState({}), [C, N] = o.useState(""), [z, O] = o.useState(!1), [U, E] = o.useState(""), [P, A] = o.useState(""), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D,
|
|
12626
|
+
), [j, v] = o.useState({}), [C, N] = o.useState(""), [z, O] = o.useState(!1), [U, E] = o.useState(""), [P, A] = o.useState(""), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D, R] = o.useState(0), [T, I] = o.useState(zs), [$, se] = o.useState(
|
|
12625
12627
|
void 0
|
|
12626
|
-
), [G, q] = o.useState([]), [B, he] = o.useState([]), [we, _e] = o.useState([]), [F,
|
|
12628
|
+
), [G, q] = o.useState([]), [B, he] = o.useState([]), [we, _e] = o.useState([]), [F, L] = o.useState([]), [Y, Z] = o.useState(
|
|
12627
12629
|
[]
|
|
12628
|
-
), [J, me] = o.useState(0), [k,
|
|
12629
|
-
p(m), g([]),
|
|
12630
|
+
), [J, me] = o.useState(0), [k, oe] = o.useState([]), [ye, fe] = o.useState([]), [X, le] = o.useState(0), [We, Be] = o.useState([]), [tt, Qe] = o.useState([]), [Pt, V] = o.useState(0), [ae, pe] = o.useState([]), ge = o.useRef(null), [Le, Ue] = o.useState(null), [Qt, vt] = o.useState(null), [Tt, st] = o.useState(100), [at, Yt] = o.useState("grid"), [$t, Ra] = o.useState(!0), Ut = o.useCallback(() => {
|
|
12631
|
+
p(m), g([]), _(0), b([]), v({}), N(""), E(""), A(""), S(!1), W(!1), R(0), he([]), _e([]), L([]), Z([]), me(0), oe([]), fe([]), le(0), Be([]), Qe([]), V(0), pe([]), I(zs), se(void 0), ge.current?.clearSelection?.(), vt(null);
|
|
12630
12632
|
}, [m]), Xt = o.useCallback(
|
|
12631
12633
|
(ee) => {
|
|
12632
|
-
c.unifiedSelection || (g([]),
|
|
12634
|
+
c.unifiedSelection || (g([]), _(0), b([]), v({}), N(""), A(""), S(!1), W(!1), R(0), he([]), _e([]), L([]), Z([]), me(0), oe([]), fe([]), le(0), Be([]), Qe([]), V(0), ge.current?.clearSelection?.()), p(ee);
|
|
12633
12635
|
},
|
|
12634
12636
|
[c.unifiedSelection]
|
|
12635
12637
|
), ws = o.useCallback(
|
|
12636
12638
|
(ee) => {
|
|
12637
|
-
const
|
|
12638
|
-
(
|
|
12639
|
+
const ce = ee.filter(
|
|
12640
|
+
(de) => de.upload_status !== "error"
|
|
12639
12641
|
);
|
|
12640
|
-
c.maxFiles === 1 ? g(
|
|
12641
|
-
const Te =
|
|
12642
|
+
c.maxFiles === 1 ? g(ce.slice(0, 1)) : g((de) => {
|
|
12643
|
+
const Te = de.length + ce.length;
|
|
12642
12644
|
if (c.maxFiles && Te > c.maxFiles) {
|
|
12643
|
-
const ea = c.maxFiles -
|
|
12644
|
-
return [...
|
|
12645
|
+
const ea = c.maxFiles - de.length;
|
|
12646
|
+
return [...de, ...ce.slice(0, ea)];
|
|
12645
12647
|
}
|
|
12646
|
-
return [...
|
|
12648
|
+
return [...de, ...ce];
|
|
12647
12649
|
});
|
|
12648
12650
|
},
|
|
12649
12651
|
[c.maxFiles]
|
|
12650
12652
|
), Ht = o.useCallback(
|
|
12651
12653
|
(ee) => {
|
|
12652
|
-
const
|
|
12653
|
-
(
|
|
12654
|
+
const ce = ee.filter(
|
|
12655
|
+
(de) => de.upload_status !== "error"
|
|
12654
12656
|
);
|
|
12655
|
-
|
|
12657
|
+
ce.length !== 0 && (s(ce), a?.());
|
|
12656
12658
|
},
|
|
12657
12659
|
[s, a]
|
|
12658
|
-
),
|
|
12660
|
+
), La = o.useCallback(
|
|
12659
12661
|
(ee) => {
|
|
12660
12662
|
ws([ee]);
|
|
12661
12663
|
},
|
|
12662
12664
|
[ws]
|
|
12663
12665
|
), za = o.useCallback(
|
|
12664
|
-
(ee,
|
|
12665
|
-
|
|
12666
|
+
(ee, ce, de) => {
|
|
12667
|
+
_(ee), b(ce ?? []), v(de ?? {});
|
|
12666
12668
|
},
|
|
12667
12669
|
[]
|
|
12668
12670
|
), Me = o.useCallback((ee) => {
|
|
12669
|
-
|
|
12671
|
+
R(ee);
|
|
12670
12672
|
}, []), qt = o.useCallback((ee) => {
|
|
12671
12673
|
_e(ee);
|
|
12672
12674
|
}, []), Oa = o.useCallback((ee) => {
|
|
@@ -12679,7 +12681,7 @@ const mf = ({
|
|
|
12679
12681
|
},
|
|
12680
12682
|
[s, a]
|
|
12681
12683
|
), { shareablesClient: Zt, toast: ks } = ut(), Zs = o.useMemo(() => {
|
|
12682
|
-
const
|
|
12684
|
+
const ce = [
|
|
12683
12685
|
{
|
|
12684
12686
|
id: "dam",
|
|
12685
12687
|
label: "Library",
|
|
@@ -12715,7 +12717,7 @@ const mf = ({
|
|
|
12715
12717
|
{
|
|
12716
12718
|
id: "upload",
|
|
12717
12719
|
label: "Local Files",
|
|
12718
|
-
icon:
|
|
12720
|
+
icon: Rc,
|
|
12719
12721
|
description: "Upload files from computer or URL"
|
|
12720
12722
|
},
|
|
12721
12723
|
{
|
|
@@ -12760,10 +12762,10 @@ const mf = ({
|
|
|
12760
12762
|
icon: dl,
|
|
12761
12763
|
description: "Import from Dropbox"
|
|
12762
12764
|
}
|
|
12763
|
-
].filter((
|
|
12764
|
-
return c.allowedMethods && c.allowedMethods.length > 0 ?
|
|
12765
|
-
(
|
|
12766
|
-
) :
|
|
12765
|
+
].filter((de) => de.id === "pages" ? Zt?.pages != null : de.id === "products" ? Zt?.products != null : de.id === "enrollment_packs" ? Zt?.enrollment_packs != null : !0);
|
|
12766
|
+
return c.allowedMethods && c.allowedMethods.length > 0 ? ce.filter(
|
|
12767
|
+
(de) => c.allowedMethods.includes(de.id)
|
|
12768
|
+
) : ce;
|
|
12767
12769
|
}, [n, c.allowedMethods, Zt]), mt = Qt !== null, At = o.useMemo(
|
|
12768
12770
|
() => ({ items: ae }),
|
|
12769
12771
|
[ae]
|
|
@@ -12774,25 +12776,25 @@ const mf = ({
|
|
|
12774
12776
|
const Js = o.useMemo(
|
|
12775
12777
|
() => ({
|
|
12776
12778
|
add: (ee) => {
|
|
12777
|
-
const
|
|
12778
|
-
if (!
|
|
12779
|
-
if (c.maxFiles &&
|
|
12779
|
+
const ce = Jt.current;
|
|
12780
|
+
if (!ce.some((de) => de.asset_code === ee.asset_code)) {
|
|
12781
|
+
if (c.maxFiles && ce.length >= c.maxFiles) {
|
|
12780
12782
|
ks.error(
|
|
12781
12783
|
`You can select up to ${c.maxFiles} items at a time.`
|
|
12782
12784
|
);
|
|
12783
12785
|
return;
|
|
12784
12786
|
}
|
|
12785
|
-
pe((
|
|
12787
|
+
pe((de) => de.some((Te) => Te.asset_code === ee.asset_code) || c.maxFiles && de.length >= c.maxFiles ? de : [...de, ee]);
|
|
12786
12788
|
}
|
|
12787
12789
|
},
|
|
12788
12790
|
remove: (ee) => {
|
|
12789
12791
|
pe(
|
|
12790
|
-
(
|
|
12792
|
+
(ce) => ce.filter((de) => de.asset_code !== ee)
|
|
12791
12793
|
);
|
|
12792
12794
|
},
|
|
12793
12795
|
clear: () => pe([]),
|
|
12794
|
-
isSelected: (ee) => Jt.current.some((
|
|
12795
|
-
selectionIndex: (ee) => Jt.current.findIndex((
|
|
12796
|
+
isSelected: (ee) => Jt.current.some((ce) => ce.asset_code === ee),
|
|
12797
|
+
selectionIndex: (ee) => Jt.current.findIndex((ce) => ce.asset_code === ee) + 1
|
|
12796
12798
|
}),
|
|
12797
12799
|
[c.maxFiles, ks]
|
|
12798
12800
|
), is = /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-y-auto", children: [
|
|
@@ -12824,8 +12826,8 @@ const mf = ({
|
|
|
12824
12826
|
viewMode: at,
|
|
12825
12827
|
onViewModeChange: Xs,
|
|
12826
12828
|
showNamesOnMedia: $t,
|
|
12827
|
-
onShowNamesOnMediaChange:
|
|
12828
|
-
hasSelectedFiles:
|
|
12829
|
+
onShowNamesOnMediaChange: Ra,
|
|
12830
|
+
hasSelectedFiles: x > 0,
|
|
12829
12831
|
damFolders: G,
|
|
12830
12832
|
onAddToNewFolder: () => ge.current?.openAddFolderModal(),
|
|
12831
12833
|
onAddToExistingFolder: (ee) => ge.current?.addToExistingFolder?.(ee),
|
|
@@ -12850,7 +12852,7 @@ const mf = ({
|
|
|
12850
12852
|
sortOption: $,
|
|
12851
12853
|
onFilesSelected: ws,
|
|
12852
12854
|
onUploadConfirmAndMaybeCreate: Ht,
|
|
12853
|
-
onSingleFileSelected:
|
|
12855
|
+
onSingleFileSelected: La,
|
|
12854
12856
|
damLibraryRef: ge,
|
|
12855
12857
|
onDamConfirmAndMaybeCreate: Ns,
|
|
12856
12858
|
selectedMediaIds: B,
|
|
@@ -12858,11 +12860,11 @@ const mf = ({
|
|
|
12858
12860
|
onMediaSelectionChange: Me,
|
|
12859
12861
|
onMediaDataChange: qt,
|
|
12860
12862
|
selectedPageIds: F,
|
|
12861
|
-
onPageIdsChange:
|
|
12863
|
+
onPageIdsChange: L,
|
|
12862
12864
|
onPageSelectionChange: me,
|
|
12863
12865
|
onPageDataChange: Z,
|
|
12864
12866
|
selectedProductIds: k,
|
|
12865
|
-
onProductIdsChange:
|
|
12867
|
+
onProductIdsChange: oe,
|
|
12866
12868
|
onProductSelectionChange: le,
|
|
12867
12869
|
onProductDataChange: fe,
|
|
12868
12870
|
selectedEnrollmentPackIds: We,
|
|
@@ -12884,7 +12886,7 @@ const mf = ({
|
|
|
12884
12886
|
viewMode: at,
|
|
12885
12887
|
showNamesOnMedia: $t,
|
|
12886
12888
|
onDamFoldersChange: q,
|
|
12887
|
-
previewContainer:
|
|
12889
|
+
previewContainer: Le,
|
|
12888
12890
|
previewAsset: Qt,
|
|
12889
12891
|
onPreviewAssetChange: vt,
|
|
12890
12892
|
uploadSelectionCount: h === "upload" || h === "url" || h === "unsplash" ? f.length : void 0
|
|
@@ -12898,18 +12900,18 @@ const mf = ({
|
|
|
12898
12900
|
ge.current?.deselectAssetByCode?.(ee);
|
|
12899
12901
|
},
|
|
12900
12902
|
onClear: () => {
|
|
12901
|
-
ge.current?.clearSelection(),
|
|
12903
|
+
ge.current?.clearSelection(), _(0), b([]), v({});
|
|
12902
12904
|
},
|
|
12903
12905
|
onConfirm: () => {
|
|
12904
12906
|
ge.current?.confirmAndClose();
|
|
12905
12907
|
},
|
|
12906
|
-
isVisible:
|
|
12908
|
+
isVisible: x > 0,
|
|
12907
12909
|
hasVariants: (ee) => (j[ee] ?? 0) > 1,
|
|
12908
12910
|
getAssetWithVariants: (ee) => ge.current?.getAssetWithVariants?.(ee) ?? null,
|
|
12909
|
-
onVariantChange: (ee,
|
|
12911
|
+
onVariantChange: (ee, ce) => {
|
|
12910
12912
|
ge.current?.setVariantForAsset?.(
|
|
12911
12913
|
ee,
|
|
12912
|
-
|
|
12914
|
+
ce
|
|
12913
12915
|
);
|
|
12914
12916
|
}
|
|
12915
12917
|
}
|
|
@@ -12919,15 +12921,15 @@ const mf = ({
|
|
|
12919
12921
|
{
|
|
12920
12922
|
selectedFiles: we,
|
|
12921
12923
|
onRemoveFile: (ee) => {
|
|
12922
|
-
const
|
|
12923
|
-
Number.isNaN(
|
|
12924
|
-
(
|
|
12924
|
+
const ce = parseInt(ee.replace(/^media_/, ""), 10);
|
|
12925
|
+
Number.isNaN(ce) || (he(
|
|
12926
|
+
(de) => de.filter((Te) => Te !== ce)
|
|
12925
12927
|
), _e(
|
|
12926
|
-
(
|
|
12928
|
+
(de) => de.filter((Te) => Te.asset_code !== ee)
|
|
12927
12929
|
));
|
|
12928
12930
|
},
|
|
12929
12931
|
onClear: () => {
|
|
12930
|
-
he([]), _e([]),
|
|
12932
|
+
he([]), _e([]), R(0);
|
|
12931
12933
|
},
|
|
12932
12934
|
onConfirm: () => {
|
|
12933
12935
|
s(we), a?.();
|
|
@@ -12941,15 +12943,15 @@ const mf = ({
|
|
|
12941
12943
|
{
|
|
12942
12944
|
selectedFiles: Y,
|
|
12943
12945
|
onRemoveFile: (ee) => {
|
|
12944
|
-
const
|
|
12945
|
-
Number.isNaN(
|
|
12946
|
-
(
|
|
12946
|
+
const ce = parseInt(ee.replace(/^page_/, ""), 10);
|
|
12947
|
+
Number.isNaN(ce) || (L(
|
|
12948
|
+
(de) => de.filter((Te) => Te !== ce)
|
|
12947
12949
|
), Z(
|
|
12948
|
-
(
|
|
12950
|
+
(de) => de.filter((Te) => Te.asset_code !== ee)
|
|
12949
12951
|
));
|
|
12950
12952
|
},
|
|
12951
12953
|
onClear: () => {
|
|
12952
|
-
|
|
12954
|
+
L([]), Z([]), me(0);
|
|
12953
12955
|
},
|
|
12954
12956
|
onConfirm: () => {
|
|
12955
12957
|
s(Y), a?.();
|
|
@@ -12963,15 +12965,15 @@ const mf = ({
|
|
|
12963
12965
|
{
|
|
12964
12966
|
selectedFiles: ye,
|
|
12965
12967
|
onRemoveFile: (ee) => {
|
|
12966
|
-
const
|
|
12967
|
-
Number.isNaN(
|
|
12968
|
-
(
|
|
12968
|
+
const ce = parseInt(ee.replace(/^product_/, ""), 10);
|
|
12969
|
+
Number.isNaN(ce) || (oe(
|
|
12970
|
+
(de) => de.filter((Te) => Te !== ce)
|
|
12969
12971
|
), fe(
|
|
12970
|
-
(
|
|
12972
|
+
(de) => de.filter((Te) => Te.asset_code !== ee)
|
|
12971
12973
|
));
|
|
12972
12974
|
},
|
|
12973
12975
|
onClear: () => {
|
|
12974
|
-
|
|
12976
|
+
oe([]), fe([]), le(0);
|
|
12975
12977
|
},
|
|
12976
12978
|
onConfirm: () => {
|
|
12977
12979
|
s(ye), a?.();
|
|
@@ -12985,14 +12987,14 @@ const mf = ({
|
|
|
12985
12987
|
{
|
|
12986
12988
|
selectedFiles: tt,
|
|
12987
12989
|
onRemoveFile: (ee) => {
|
|
12988
|
-
const
|
|
12990
|
+
const ce = parseInt(
|
|
12989
12991
|
ee.replace(/^enrollment_pack_/, ""),
|
|
12990
12992
|
10
|
|
12991
12993
|
);
|
|
12992
|
-
Number.isNaN(
|
|
12993
|
-
(
|
|
12994
|
+
Number.isNaN(ce) || (Be(
|
|
12995
|
+
(de) => de.filter((Te) => Te !== ce)
|
|
12994
12996
|
), Qe(
|
|
12995
|
-
(
|
|
12997
|
+
(de) => de.filter((Te) => Te.asset_code !== ee)
|
|
12996
12998
|
));
|
|
12997
12999
|
},
|
|
12998
13000
|
onClear: () => {
|
|
@@ -13011,7 +13013,7 @@ const mf = ({
|
|
|
13011
13013
|
selectedFiles: f,
|
|
13012
13014
|
onRemoveFile: (ee) => {
|
|
13013
13015
|
g(
|
|
13014
|
-
(
|
|
13016
|
+
(ce) => ce.filter((de) => de.asset_code !== ee)
|
|
13015
13017
|
);
|
|
13016
13018
|
},
|
|
13017
13019
|
onClear: () => {
|
|
@@ -13030,7 +13032,7 @@ const mf = ({
|
|
|
13030
13032
|
selectedFiles: ae,
|
|
13031
13033
|
onRemoveFile: (ee) => {
|
|
13032
13034
|
pe(
|
|
13033
|
-
(
|
|
13035
|
+
(ce) => ce.filter((de) => de.asset_code !== ee)
|
|
13034
13036
|
);
|
|
13035
13037
|
},
|
|
13036
13038
|
onClear: () => {
|
|
@@ -13132,7 +13134,7 @@ function gl(t) {
|
|
|
13132
13134
|
n(!1);
|
|
13133
13135
|
}, [t]), { meta: s, fileName: i, handleLoad: l, handleError: u, loadError: r };
|
|
13134
13136
|
}
|
|
13135
|
-
function
|
|
13137
|
+
function Lr({
|
|
13136
13138
|
value: t,
|
|
13137
13139
|
onChange: s,
|
|
13138
13140
|
placeholder: a,
|
|
@@ -13241,7 +13243,7 @@ function Rr({
|
|
|
13241
13243
|
l?.isActive({ textAlign: "center" }) ? c : d
|
|
13242
13244
|
),
|
|
13243
13245
|
title: i("editor_align_center"),
|
|
13244
|
-
children: /* @__PURE__ */ e.jsx(
|
|
13246
|
+
children: /* @__PURE__ */ e.jsx(Ro, { className: "size-3.5" })
|
|
13245
13247
|
}
|
|
13246
13248
|
),
|
|
13247
13249
|
/* @__PURE__ */ e.jsx(
|
|
@@ -13254,7 +13256,7 @@ function Rr({
|
|
|
13254
13256
|
l?.isActive({ textAlign: "right" }) ? c : d
|
|
13255
13257
|
),
|
|
13256
13258
|
title: i("editor_align_right"),
|
|
13257
|
-
children: /* @__PURE__ */ e.jsx(
|
|
13259
|
+
children: /* @__PURE__ */ e.jsx(Lo, { className: "size-3.5" })
|
|
13258
13260
|
}
|
|
13259
13261
|
),
|
|
13260
13262
|
/* @__PURE__ */ e.jsx(
|
|
@@ -13364,12 +13366,12 @@ function ff({
|
|
|
13364
13366
|
disabled: n = !1,
|
|
13365
13367
|
maxProducts: i = 100
|
|
13366
13368
|
}) {
|
|
13367
|
-
const { t: l } = ne(), u = dt(), { showToast: c } = Ee(), [d, m] = o.useState(!1), [h, p] = o.useState(""), [f, g] = o.useState([]), [
|
|
13369
|
+
const { t: l } = ne(), u = dt(), { showToast: c } = Ee(), [d, m] = o.useState(!1), [h, p] = o.useState(""), [f, g] = o.useState([]), [x, _] = o.useState(!1), [w, b] = o.useState(!1), [j, v] = o.useState(null), [C, N] = o.useState(null), [z, O] = o.useState(null), U = o.useRef(null), E = o.useRef(null), P = o.useRef(null), A = o.useMemo(
|
|
13368
13370
|
() => new Set(t.map((T) => T.id)),
|
|
13369
13371
|
[t]
|
|
13370
13372
|
), M = t.length >= i, S = o.useCallback(
|
|
13371
13373
|
async (T) => {
|
|
13372
|
-
|
|
13374
|
+
_(!0);
|
|
13373
13375
|
try {
|
|
13374
13376
|
const { products: I, nextCursor: $ } = await r(T, { limit: En });
|
|
13375
13377
|
g(I), v($ ?? null);
|
|
@@ -13380,12 +13382,12 @@ function ff({
|
|
|
13380
13382
|
error: I
|
|
13381
13383
|
});
|
|
13382
13384
|
} finally {
|
|
13383
|
-
|
|
13385
|
+
_(!1);
|
|
13384
13386
|
}
|
|
13385
13387
|
},
|
|
13386
13388
|
[r, c]
|
|
13387
13389
|
), K = o.useCallback(async () => {
|
|
13388
|
-
if (!(!j || w ||
|
|
13390
|
+
if (!(!j || w || x)) {
|
|
13389
13391
|
b(!0);
|
|
13390
13392
|
try {
|
|
13391
13393
|
const { products: T, nextCursor: I } = await r(
|
|
@@ -13403,7 +13405,7 @@ function ff({
|
|
|
13403
13405
|
b(!1);
|
|
13404
13406
|
}
|
|
13405
13407
|
}
|
|
13406
|
-
}, [j, w,
|
|
13408
|
+
}, [j, w, x, r, h, c]);
|
|
13407
13409
|
o.useEffect(() => {
|
|
13408
13410
|
if (d)
|
|
13409
13411
|
return U.current && clearTimeout(U.current), U.current = setTimeout(() => {
|
|
@@ -13440,7 +13442,7 @@ function ff({
|
|
|
13440
13442
|
O(null);
|
|
13441
13443
|
}
|
|
13442
13444
|
}
|
|
13443
|
-
async function
|
|
13445
|
+
async function R(T) {
|
|
13444
13446
|
N(T);
|
|
13445
13447
|
try {
|
|
13446
13448
|
await a(T);
|
|
@@ -13522,7 +13524,7 @@ function ff({
|
|
|
13522
13524
|
type: "button",
|
|
13523
13525
|
variant: "outline",
|
|
13524
13526
|
size: "sm",
|
|
13525
|
-
onClick: () => void
|
|
13527
|
+
onClick: () => void R(T.id),
|
|
13526
13528
|
disabled: C === T.id,
|
|
13527
13529
|
className: "text-xs text-red-600 hover:bg-red-50 hover:text-red-700",
|
|
13528
13530
|
children: C === T.id ? l("common_removing") : l("common_remove")
|
|
@@ -13549,7 +13551,7 @@ function ff({
|
|
|
13549
13551
|
}) }),
|
|
13550
13552
|
M && /* @__PURE__ */ e.jsx("div", { className: "rounded-md border border-yellow-200 bg-yellow-50 p-3", children: /* @__PURE__ */ e.jsx("p", { className: "text-sm text-yellow-800", children: l("media_max_products_warning", { max: String(i) }) }) }),
|
|
13551
13553
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
13552
|
-
|
|
13554
|
+
x ? /* @__PURE__ */ e.jsx(it, { className: "absolute top-1/2 left-3 size-4 -translate-y-1/2" }) : /* @__PURE__ */ e.jsx(ja, { className: "absolute top-1/2 left-3 size-4 -translate-y-1/2 text-gray-400" }),
|
|
13553
13555
|
/* @__PURE__ */ e.jsx(
|
|
13554
13556
|
$e,
|
|
13555
13557
|
{
|
|
@@ -13560,7 +13562,7 @@ function ff({
|
|
|
13560
13562
|
}
|
|
13561
13563
|
)
|
|
13562
13564
|
] }),
|
|
13563
|
-
/* @__PURE__ */ e.jsx("div", { ref: P, className: "max-h-96 overflow-y-auto", children:
|
|
13565
|
+
/* @__PURE__ */ e.jsx("div", { ref: P, className: "max-h-96 overflow-y-auto", children: x && f.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) : f.length === 0 ? /* @__PURE__ */ e.jsx("p", { className: "py-8 text-center text-sm text-gray-500", children: h.length > 0 ? l("products_search_no_results") : l("products_search_start_typing") }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 px-1", children: [
|
|
13564
13566
|
f.map((T) => {
|
|
13565
13567
|
const I = A.has(T.id), $ = !I && !M;
|
|
13566
13568
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -13667,16 +13669,16 @@ function _l({
|
|
|
13667
13669
|
}
|
|
13668
13670
|
],
|
|
13669
13671
|
[u]
|
|
13670
|
-
), [m, h] = o.useState(a), [p, f] = o.useState(r || "link"), [g,
|
|
13672
|
+
), [m, h] = o.useState(a), [p, f] = o.useState(r || "link"), [g, x] = o.useState(n), [_, w] = o.useState(i);
|
|
13671
13673
|
o.useEffect(() => {
|
|
13672
|
-
t && (h(a), f(r || "link"),
|
|
13674
|
+
t && (h(a), f(r || "link"), x(n || u("cta_default_button_text")), w(i));
|
|
13673
13675
|
}, [t, a, r, n, i]);
|
|
13674
13676
|
const b = (N) => {
|
|
13675
|
-
h(N), N && !g &&
|
|
13677
|
+
h(N), N && !g && x(u("cta_default_button_text"));
|
|
13676
13678
|
}, j = () => {
|
|
13677
13679
|
s(!1);
|
|
13678
13680
|
}, v = () => {
|
|
13679
|
-
l({ enabled: m, type: p, buttonText: g, url:
|
|
13681
|
+
l({ enabled: m, type: p, buttonText: g, url: _ }), s(!1);
|
|
13680
13682
|
}, C = !m;
|
|
13681
13683
|
return /* @__PURE__ */ e.jsxs(
|
|
13682
13684
|
St,
|
|
@@ -13738,7 +13740,7 @@ function _l({
|
|
|
13738
13740
|
$e,
|
|
13739
13741
|
{
|
|
13740
13742
|
value: g,
|
|
13741
|
-
onChange: (N) =>
|
|
13743
|
+
onChange: (N) => x(N.target.value),
|
|
13742
13744
|
placeholder: u("cta_default_button_text"),
|
|
13743
13745
|
disabled: C,
|
|
13744
13746
|
className: C ? "opacity-50" : ""
|
|
@@ -13760,7 +13762,7 @@ function _l({
|
|
|
13760
13762
|
/* @__PURE__ */ e.jsx(
|
|
13761
13763
|
$e,
|
|
13762
13764
|
{
|
|
13763
|
-
value:
|
|
13765
|
+
value: _,
|
|
13764
13766
|
onChange: (N) => w(N.target.value),
|
|
13765
13767
|
placeholder: u("cta_url_placeholder"),
|
|
13766
13768
|
type: "url",
|
|
@@ -13789,9 +13791,9 @@ function gf({
|
|
|
13789
13791
|
onThumbnailSelected: r,
|
|
13790
13792
|
disabled: n = !1
|
|
13791
13793
|
}) {
|
|
13792
|
-
const { t: i } = ne(), l = dt(), { showToast: u } = Ee(), [c, d] = o.useState(!1), [m, h] = o.useState(!1), [p, f] = o.useState(0), [g,
|
|
13794
|
+
const { t: i } = ne(), l = dt(), { showToast: u } = Ee(), [c, d] = o.useState(!1), [m, h] = o.useState(!1), [p, f] = o.useState(0), [g, x] = o.useState(0), [_, w] = o.useState(!1), b = o.useRef(null), j = o.useRef(null), v = o.useCallback(() => {
|
|
13793
13795
|
const W = b.current;
|
|
13794
|
-
W && (
|
|
13796
|
+
W && (x(W.duration), W.currentTime = Math.min(1, W.duration * 0.1));
|
|
13795
13797
|
}, []), C = o.useCallback(() => {
|
|
13796
13798
|
b.current && f(b.current.currentTime);
|
|
13797
13799
|
}, []), N = o.useCallback(() => {
|
|
@@ -13800,20 +13802,20 @@ function gf({
|
|
|
13800
13802
|
}, []), z = o.useCallback((W) => {
|
|
13801
13803
|
const D = b.current;
|
|
13802
13804
|
if (!D) return;
|
|
13803
|
-
const
|
|
13804
|
-
D.currentTime =
|
|
13805
|
+
const R = Number(W.target.value);
|
|
13806
|
+
D.currentTime = R, f(R), D.paused || (D.pause(), h(!1));
|
|
13805
13807
|
}, []), O = o.useCallback(() => {
|
|
13806
13808
|
const W = b.current, D = j.current;
|
|
13807
13809
|
if (!(!W || !D)) {
|
|
13808
13810
|
w(!0);
|
|
13809
13811
|
try {
|
|
13810
13812
|
D.width = W.videoWidth, D.height = W.videoHeight;
|
|
13811
|
-
const
|
|
13812
|
-
if (!
|
|
13813
|
+
const R = D.getContext("2d");
|
|
13814
|
+
if (!R) {
|
|
13813
13815
|
w(!1);
|
|
13814
13816
|
return;
|
|
13815
13817
|
}
|
|
13816
|
-
|
|
13818
|
+
R.drawImage(W, 0, 0, D.width, D.height), D.toBlob(
|
|
13817
13819
|
(T) => {
|
|
13818
13820
|
T ? (a(T), d(!1)) : u({
|
|
13819
13821
|
title: i("media_frame_capture_error"),
|
|
@@ -13823,16 +13825,16 @@ function gf({
|
|
|
13823
13825
|
"image/jpeg",
|
|
13824
13826
|
0.92
|
|
13825
13827
|
);
|
|
13826
|
-
} catch (
|
|
13828
|
+
} catch (R) {
|
|
13827
13829
|
u({
|
|
13828
13830
|
title: i("media_frame_capture_error"),
|
|
13829
13831
|
type: "error",
|
|
13830
|
-
error:
|
|
13832
|
+
error: R
|
|
13831
13833
|
}), w(!1);
|
|
13832
13834
|
}
|
|
13833
13835
|
}
|
|
13834
13836
|
}, [a, u, i]), U = o.useCallback(() => {
|
|
13835
|
-
h(!1), f(0),
|
|
13837
|
+
h(!1), f(0), x(0), d(!0);
|
|
13836
13838
|
}, []), E = g > 0, {
|
|
13837
13839
|
meta: P,
|
|
13838
13840
|
fileName: A,
|
|
@@ -13970,10 +13972,10 @@ function gf({
|
|
|
13970
13972
|
H,
|
|
13971
13973
|
{
|
|
13972
13974
|
onClick: O,
|
|
13973
|
-
disabled: !E ||
|
|
13975
|
+
disabled: !E || _,
|
|
13974
13976
|
className: "w-full gap-2",
|
|
13975
13977
|
children: [
|
|
13976
|
-
|
|
13978
|
+
_ ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : /* @__PURE__ */ e.jsx(ta, { className: "size-4" }),
|
|
13977
13979
|
i("media_capture_frame")
|
|
13978
13980
|
]
|
|
13979
13981
|
}
|
|
@@ -14097,8 +14099,8 @@ function bf({
|
|
|
14097
14099
|
readOnly: p,
|
|
14098
14100
|
mediaProductsApi: f,
|
|
14099
14101
|
searchProducts: g,
|
|
14100
|
-
uploadThumbnail:
|
|
14101
|
-
} = Ee(), [
|
|
14102
|
+
uploadThumbnail: x
|
|
14103
|
+
} = Ee(), [_, w] = o.useState({
|
|
14102
14104
|
title: "",
|
|
14103
14105
|
description: "",
|
|
14104
14106
|
active: !0,
|
|
@@ -14109,7 +14111,7 @@ function bf({
|
|
|
14109
14111
|
seoTitle: "",
|
|
14110
14112
|
seoDescription: "",
|
|
14111
14113
|
blockCrawler: !1
|
|
14112
|
-
}), [b, j] = o.useState(null), [v, C] = o.useState(null), [N, z] = o.useState(!1), [O, U] = o.useState(!1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), [S, K] = o.useState(!1), [W, D] = o.useState(!1), [
|
|
14114
|
+
}), [b, j] = o.useState(null), [v, C] = o.useState(null), [N, z] = o.useState(!1), [O, U] = o.useState(!1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), [S, K] = o.useState(!1), [W, D] = o.useState(!1), [R, T] = o.useState(null), [I, $] = o.useState(null), { data: se, isLoading: G } = Ve({
|
|
14113
14115
|
queryKey: Ne.media.detail(Number(t), u, n),
|
|
14114
14116
|
queryFn: () => l.media.getMediaById(Number(t), n)
|
|
14115
14117
|
}), q = se?.media, { data: B, refetch: he } = Ve({
|
|
@@ -14118,32 +14120,32 @@ function bf({
|
|
|
14118
14120
|
language_iso: n
|
|
14119
14121
|
}),
|
|
14120
14122
|
enabled: !!f
|
|
14121
|
-
}), we = B?.media_products ?? [], _e = o.useMemo(() =>
|
|
14123
|
+
}), we = B?.media_products ?? [], _e = o.useMemo(() => R || I ? !0 : b ? _.title !== b.title || _.description !== b.description || _.active !== b.active || _.ctaEnabled !== b.ctaEnabled || _.ctaType !== b.ctaType || _.ctaButtonText !== b.ctaButtonText || _.ctaUrl !== b.ctaUrl || _.seoTitle !== b.seoTitle || _.seoDescription !== b.seoDescription || _.blockCrawler !== b.blockCrawler : !1, [_, b, R, I]), F = o.useRef(!1);
|
|
14122
14124
|
F.current = _e, o.useEffect(() => {
|
|
14123
14125
|
if (!q || F.current) return;
|
|
14124
14126
|
const X = _f(q);
|
|
14125
14127
|
w(X), j(X), C(n);
|
|
14126
14128
|
}, [q, n]);
|
|
14127
|
-
const { mutate:
|
|
14129
|
+
const { mutate: L, isPending: Y } = ze({
|
|
14128
14130
|
mutationFn: () => l.media.updateMedia(
|
|
14129
14131
|
Number(t),
|
|
14130
14132
|
{
|
|
14131
|
-
title:
|
|
14132
|
-
description:
|
|
14133
|
-
active:
|
|
14134
|
-
...
|
|
14133
|
+
title: _.title,
|
|
14134
|
+
description: _.description,
|
|
14135
|
+
active: _.active,
|
|
14136
|
+
...R ? da(R) : {},
|
|
14135
14137
|
...I ? { thumbnail_url: I } : {},
|
|
14136
14138
|
settings: {
|
|
14137
14139
|
cta: {
|
|
14138
|
-
enabled:
|
|
14139
|
-
type:
|
|
14140
|
-
button_text:
|
|
14141
|
-
url:
|
|
14140
|
+
enabled: _.ctaEnabled,
|
|
14141
|
+
type: _.ctaType,
|
|
14142
|
+
button_text: _.ctaButtonText || void 0,
|
|
14143
|
+
url: _.ctaType === "link" && _.ctaUrl || void 0
|
|
14142
14144
|
},
|
|
14143
14145
|
seo: {
|
|
14144
|
-
title:
|
|
14145
|
-
description:
|
|
14146
|
-
block_crawler:
|
|
14146
|
+
title: _.seoTitle || null,
|
|
14147
|
+
description: _.seoDescription || null,
|
|
14148
|
+
block_crawler: _.blockCrawler
|
|
14147
14149
|
}
|
|
14148
14150
|
}
|
|
14149
14151
|
},
|
|
@@ -14152,7 +14154,7 @@ function bf({
|
|
|
14152
14154
|
onSuccess: () => {
|
|
14153
14155
|
c.invalidateQueries({
|
|
14154
14156
|
queryKey: Ne.media.all
|
|
14155
|
-
}), j(
|
|
14157
|
+
}), j(_), T(null), $(null), m({ title: r("media_save_success"), type: "success" });
|
|
14156
14158
|
},
|
|
14157
14159
|
onError: (X) => {
|
|
14158
14160
|
m({
|
|
@@ -14174,10 +14176,10 @@ function bf({
|
|
|
14174
14176
|
}), z(!1);
|
|
14175
14177
|
}
|
|
14176
14178
|
}), me = o.useCallback(() => {
|
|
14177
|
-
|
|
14178
|
-
}, [
|
|
14179
|
+
L();
|
|
14180
|
+
}, [L]), k = o.useCallback(() => {
|
|
14179
14181
|
Z();
|
|
14180
|
-
}, [Z]),
|
|
14182
|
+
}, [Z]), oe = o.useCallback((X) => {
|
|
14181
14183
|
const le = X[0];
|
|
14182
14184
|
le && (P(!1), T(le));
|
|
14183
14185
|
}, []), ye = o.useMemo(() => h ? {
|
|
@@ -14273,7 +14275,7 @@ function bf({
|
|
|
14273
14275
|
)
|
|
14274
14276
|
] }) }),
|
|
14275
14277
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 px-4 pt-4 pb-24 md:px-10 md:py-6", children: [
|
|
14276
|
-
/* @__PURE__ */ e.jsx("div", { className: "mx-auto flex w-full max-w-5xl items-center gap-3", children: /* @__PURE__ */ e.jsx("h1", { className: "text-foreground text-xl font-semibold break-words", children:
|
|
14278
|
+
/* @__PURE__ */ e.jsx("div", { className: "mx-auto flex w-full max-w-5xl items-center gap-3", children: /* @__PURE__ */ e.jsx("h1", { className: "text-foreground text-xl font-semibold break-words", children: _.title || fe || r("media_heading") }) }),
|
|
14277
14279
|
/* @__PURE__ */ e.jsxs("div", { className: "mx-auto grid w-full max-w-5xl grid-cols-1 gap-6 md:grid-cols-[3fr_1fr]", children: [
|
|
14278
14280
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
14279
14281
|
/* @__PURE__ */ e.jsxs("div", { className: "border-border bg-card rounded-lg border p-4 md:p-5", children: [
|
|
@@ -14295,10 +14297,10 @@ function bf({
|
|
|
14295
14297
|
variant: "outline",
|
|
14296
14298
|
size: "sm",
|
|
14297
14299
|
onClick: () => K(!0),
|
|
14298
|
-
className:
|
|
14300
|
+
className: _.ctaEnabled ? "border-primary text-primary" : "",
|
|
14299
14301
|
children: [
|
|
14300
14302
|
r("media_cta_button_label"),
|
|
14301
|
-
|
|
14303
|
+
_.ctaEnabled ? r("common_on") : r("common_off")
|
|
14302
14304
|
]
|
|
14303
14305
|
}
|
|
14304
14306
|
)
|
|
@@ -14308,12 +14310,12 @@ function bf({
|
|
|
14308
14310
|
yf,
|
|
14309
14311
|
{
|
|
14310
14312
|
mediaItem: q,
|
|
14311
|
-
pendingFileUrl:
|
|
14312
|
-
pendingKind:
|
|
14313
|
+
pendingFileUrl: R ? R.file_url : null,
|
|
14314
|
+
pendingKind: R ? da(R).kind : null
|
|
14313
14315
|
}
|
|
14314
14316
|
),
|
|
14315
14317
|
(() => {
|
|
14316
|
-
const X =
|
|
14318
|
+
const X = R ? da(R).kind : null, le = q.content_format, We = X ?? le ?? q.kind, Be = X === "video" ? R?.file_url : q.video_url;
|
|
14317
14319
|
if (p) return null;
|
|
14318
14320
|
if (We === "video" && Be)
|
|
14319
14321
|
return /* @__PURE__ */ e.jsxs("div", { className: "border-border mt-4 border-t pt-4", children: [
|
|
@@ -14323,7 +14325,7 @@ function bf({
|
|
|
14323
14325
|
videoUrl: Be,
|
|
14324
14326
|
thumbnailUrl: I ?? q.image_url,
|
|
14325
14327
|
onThumbnailCaptured: async (tt) => {
|
|
14326
|
-
if (!
|
|
14328
|
+
if (!x) {
|
|
14327
14329
|
m({
|
|
14328
14330
|
title: r("media_thumbnail_capture_unavailable"),
|
|
14329
14331
|
type: "error"
|
|
@@ -14331,7 +14333,7 @@ function bf({
|
|
|
14331
14333
|
return;
|
|
14332
14334
|
}
|
|
14333
14335
|
try {
|
|
14334
|
-
const Qe = await
|
|
14336
|
+
const Qe = await x(
|
|
14335
14337
|
tt,
|
|
14336
14338
|
`thumbnail-${t}.jpg`
|
|
14337
14339
|
);
|
|
@@ -14399,7 +14401,7 @@ function bf({
|
|
|
14399
14401
|
$e,
|
|
14400
14402
|
{
|
|
14401
14403
|
id: "media-title",
|
|
14402
|
-
value:
|
|
14404
|
+
value: _.title,
|
|
14403
14405
|
onChange: (X) => w((le) => ({ ...le, title: X.target.value })),
|
|
14404
14406
|
placeholder: r("media_title_placeholder")
|
|
14405
14407
|
}
|
|
@@ -14411,11 +14413,11 @@ function bf({
|
|
|
14411
14413
|
// Description is stored as HTML from RichTextEditor, so
|
|
14412
14414
|
// strip tags before rendering as plain text — otherwise
|
|
14413
14415
|
// raw <p>/<strong>/etc. would show as visible characters.
|
|
14414
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-foreground/70 text-sm leading-relaxed", children: Tr(
|
|
14416
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-foreground/70 text-sm leading-relaxed", children: Tr(_.description) })
|
|
14415
14417
|
) : /* @__PURE__ */ e.jsx(
|
|
14416
|
-
|
|
14418
|
+
Lr,
|
|
14417
14419
|
{
|
|
14418
|
-
value:
|
|
14420
|
+
value: _.description,
|
|
14419
14421
|
onChange: (X) => w((le) => ({ ...le, description: X })),
|
|
14420
14422
|
placeholder: r("common_start_writing_placeholder")
|
|
14421
14423
|
}
|
|
@@ -14479,7 +14481,7 @@ function bf({
|
|
|
14479
14481
|
)
|
|
14480
14482
|
] }),
|
|
14481
14483
|
(() => {
|
|
14482
|
-
const le = (
|
|
14484
|
+
const le = (R ? da(R) : null)?.image_url ?? I ?? q?.image_url;
|
|
14483
14485
|
return /* @__PURE__ */ e.jsxs("div", { className: "bg-muted/40 border-border mb-4 rounded-md border p-3", children: [
|
|
14484
14486
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
14485
14487
|
le ? /* @__PURE__ */ e.jsx(
|
|
@@ -14491,11 +14493,11 @@ function bf({
|
|
|
14491
14493
|
}
|
|
14492
14494
|
) : /* @__PURE__ */ e.jsx("div", { className: "bg-muted flex size-8 items-center justify-center rounded", children: /* @__PURE__ */ e.jsx(De, { className: "text-muted-foreground size-4" }) }),
|
|
14493
14495
|
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
14494
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-foreground truncate text-xs font-medium", children:
|
|
14496
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-foreground truncate text-xs font-medium", children: _.seoTitle || fe || r("seo_preview_title_fallback") }),
|
|
14495
14497
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground truncate text-xs", children: q?.preview_link ?? q?.canonical_url ?? r("seo_preview_url_fallback") })
|
|
14496
14498
|
] })
|
|
14497
14499
|
] }),
|
|
14498
|
-
|
|
14500
|
+
_.seoDescription && /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground line-clamp-2 text-xs", children: _.seoDescription })
|
|
14499
14501
|
] });
|
|
14500
14502
|
})(),
|
|
14501
14503
|
W && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
@@ -14505,7 +14507,7 @@ function bf({
|
|
|
14505
14507
|
$e,
|
|
14506
14508
|
{
|
|
14507
14509
|
id: "seo-title",
|
|
14508
|
-
value:
|
|
14510
|
+
value: _.seoTitle,
|
|
14509
14511
|
onChange: (X) => w((le) => ({
|
|
14510
14512
|
...le,
|
|
14511
14513
|
seoTitle: X.target.value
|
|
@@ -14520,7 +14522,7 @@ function bf({
|
|
|
14520
14522
|
Wn,
|
|
14521
14523
|
{
|
|
14522
14524
|
id: "seo-description",
|
|
14523
|
-
value:
|
|
14525
|
+
value: _.seoDescription,
|
|
14524
14526
|
onChange: (X) => w((le) => ({
|
|
14525
14527
|
...le,
|
|
14526
14528
|
seoDescription: X.target.value
|
|
@@ -14538,7 +14540,7 @@ function bf({
|
|
|
14538
14540
|
/* @__PURE__ */ e.jsx(
|
|
14539
14541
|
Hs,
|
|
14540
14542
|
{
|
|
14541
|
-
checked:
|
|
14543
|
+
checked: _.blockCrawler,
|
|
14542
14544
|
onCheckedChange: (X) => w((le) => ({ ...le, blockCrawler: X })),
|
|
14543
14545
|
"aria-label": r("seo_block_crawlers_aria")
|
|
14544
14546
|
}
|
|
@@ -14586,10 +14588,10 @@ function bf({
|
|
|
14586
14588
|
{
|
|
14587
14589
|
open: S,
|
|
14588
14590
|
onOpenChange: K,
|
|
14589
|
-
ctaEnabled:
|
|
14590
|
-
ctaType:
|
|
14591
|
-
ctaButtonText:
|
|
14592
|
-
ctaUrl:
|
|
14591
|
+
ctaEnabled: _.ctaEnabled,
|
|
14592
|
+
ctaType: _.ctaType,
|
|
14593
|
+
ctaButtonText: _.ctaButtonText,
|
|
14594
|
+
ctaUrl: _.ctaUrl,
|
|
14593
14595
|
onDone: (X) => {
|
|
14594
14596
|
w((le) => ({
|
|
14595
14597
|
...le,
|
|
@@ -14605,7 +14607,7 @@ function bf({
|
|
|
14605
14607
|
Us,
|
|
14606
14608
|
{
|
|
14607
14609
|
open: E,
|
|
14608
|
-
onFilesSelected:
|
|
14610
|
+
onFilesSelected: oe,
|
|
14609
14611
|
onClose: () => P(!1),
|
|
14610
14612
|
config: {
|
|
14611
14613
|
maxFiles: 1,
|
|
@@ -14671,7 +14673,7 @@ function jf({
|
|
|
14671
14673
|
}) {
|
|
14672
14674
|
const { t: a } = ne(), { navigate: r, showToast: n, filePickerApi: i } = Ee(), l = _u(), [u, c] = o.useState(""), [d, m] = o.useState(""), [h] = o.useState(!0), [p, f] = o.useState(
|
|
14673
14675
|
null
|
|
14674
|
-
), [g,
|
|
14676
|
+
), [g, x] = o.useState(!1), [_, w] = o.useState(!1), [b, j] = o.useState(!1), [v, C] = o.useState("link"), [N, z] = o.useState(""), [O, U] = o.useState(""), [E, P] = o.useState(!1), [A, M] = o.useState(""), [S, K] = o.useState(""), [W, D] = o.useState(!1), R = p ? In(p.metadata.mime_type) : null, { mutate: T, isPending: I } = ju(
|
|
14675
14677
|
{
|
|
14676
14678
|
onSuccess: (q) => {
|
|
14677
14679
|
n({ title: a("media_create_success"), type: "success" }), t?.("media", String(q.id));
|
|
@@ -14736,7 +14738,7 @@ function jf({
|
|
|
14736
14738
|
]), se = o.useCallback(
|
|
14737
14739
|
(q) => {
|
|
14738
14740
|
const B = q[0];
|
|
14739
|
-
B && (f(B),
|
|
14741
|
+
B && (f(B), x(!1), u.trim() || c(B.metadata.file_name.replace(/\.[^/.]+$/, "")));
|
|
14740
14742
|
},
|
|
14741
14743
|
[u]
|
|
14742
14744
|
), G = o.useMemo(() => i ? {
|
|
@@ -14778,7 +14780,7 @@ function jf({
|
|
|
14778
14780
|
/* @__PURE__ */ e.jsx(
|
|
14779
14781
|
H,
|
|
14780
14782
|
{
|
|
14781
|
-
onClick: () =>
|
|
14783
|
+
onClick: () => x(!0),
|
|
14782
14784
|
variant: "outline",
|
|
14783
14785
|
size: "sm",
|
|
14784
14786
|
disabled: !i,
|
|
@@ -14800,12 +14802,12 @@ function jf({
|
|
|
14800
14802
|
)
|
|
14801
14803
|
] })
|
|
14802
14804
|
] }),
|
|
14803
|
-
p &&
|
|
14804
|
-
/* @__PURE__ */ e.jsx(vf, { result: p, mediaType:
|
|
14805
|
+
p && R ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
14806
|
+
/* @__PURE__ */ e.jsx(vf, { result: p, mediaType: R }),
|
|
14805
14807
|
/* @__PURE__ */ e.jsx(
|
|
14806
14808
|
H,
|
|
14807
14809
|
{
|
|
14808
|
-
onClick: () =>
|
|
14810
|
+
onClick: () => x(!0),
|
|
14809
14811
|
variant: "outline",
|
|
14810
14812
|
size: "sm",
|
|
14811
14813
|
className: "w-fit",
|
|
@@ -14816,7 +14818,7 @@ function jf({
|
|
|
14816
14818
|
"button",
|
|
14817
14819
|
{
|
|
14818
14820
|
type: "button",
|
|
14819
|
-
onClick: () =>
|
|
14821
|
+
onClick: () => x(!0),
|
|
14820
14822
|
disabled: !i,
|
|
14821
14823
|
className: "border-border text-muted-foreground hover:bg-muted/30 flex h-40 w-full flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
14822
14824
|
children: [
|
|
@@ -14849,7 +14851,7 @@ function jf({
|
|
|
14849
14851
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
14850
14852
|
/* @__PURE__ */ e.jsx(nt, { children: a("common_description_label") }),
|
|
14851
14853
|
/* @__PURE__ */ e.jsx(
|
|
14852
|
-
|
|
14854
|
+
Lr,
|
|
14853
14855
|
{
|
|
14854
14856
|
value: d,
|
|
14855
14857
|
onChange: m,
|
|
@@ -14929,7 +14931,7 @@ function jf({
|
|
|
14929
14931
|
/* @__PURE__ */ e.jsx(
|
|
14930
14932
|
_l,
|
|
14931
14933
|
{
|
|
14932
|
-
open:
|
|
14934
|
+
open: _,
|
|
14933
14935
|
onOpenChange: w,
|
|
14934
14936
|
ctaEnabled: b,
|
|
14935
14937
|
ctaType: v,
|
|
@@ -14945,7 +14947,7 @@ function jf({
|
|
|
14945
14947
|
{
|
|
14946
14948
|
open: g,
|
|
14947
14949
|
onFilesSelected: se,
|
|
14948
|
-
onClose: () =>
|
|
14950
|
+
onClose: () => x(!1),
|
|
14949
14951
|
config: {
|
|
14950
14952
|
maxFiles: 1,
|
|
14951
14953
|
allowedMethods: ["dam", "upload", "url"]
|
|
@@ -14970,7 +14972,7 @@ function wf({
|
|
|
14970
14972
|
onEdit: m,
|
|
14971
14973
|
onDelete: h
|
|
14972
14974
|
}) {
|
|
14973
|
-
const { navigate: p } = Ee(), { t: f } = ne(), g = Ot(), [
|
|
14975
|
+
const { navigate: p } = Ee(), { t: f } = ne(), g = Ot(), [x, _] = o.useState(!1), [w, b] = o.useState(!1), j = dt(), v = r > 1, C = r === 1 ? f("playlist_item_count_one", { count: "1" }) : f("playlist_item_count_other", { count: String(r) });
|
|
14974
14976
|
return /* @__PURE__ */ e.jsx(
|
|
14975
14977
|
"button",
|
|
14976
14978
|
{
|
|
@@ -15001,11 +15003,11 @@ function wf({
|
|
|
15001
15003
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-background relative z-10 rounded-lg p-1 shadow-md", children: [
|
|
15002
15004
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-muted relative aspect-square overflow-hidden rounded-lg", children: [
|
|
15003
15005
|
g({
|
|
15004
|
-
src:
|
|
15006
|
+
src: x ? Dn : s || Dn,
|
|
15005
15007
|
alt: t,
|
|
15006
15008
|
fill: !0,
|
|
15007
15009
|
className: "object-cover transition-transform group-hover:scale-105",
|
|
15008
|
-
onError: () =>
|
|
15010
|
+
onError: () => _(!0)
|
|
15009
15011
|
}),
|
|
15010
15012
|
i && /* @__PURE__ */ e.jsx(
|
|
15011
15013
|
"div",
|
|
@@ -15215,7 +15217,7 @@ function Nf({
|
|
|
15215
15217
|
}
|
|
15216
15218
|
const kf = 12, Cf = "grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4";
|
|
15217
15219
|
function Sf(t) {
|
|
15218
|
-
const s = Ae(), { t: a } = ne(), r = dt(), { navigate: n, showToast: i, user: l, onToggleFavorite: u, onDeletePlaylist: c } = Ee(), d = Ws(), m = Ge(), [h, p] = o.useState(""), [f, g] = o.useState(""), [
|
|
15220
|
+
const s = Ae(), { t: a } = ne(), r = dt(), { navigate: n, showToast: i, user: l, onToggleFavorite: u, onDeletePlaylist: c } = Ee(), d = Ws(), m = Ge(), [h, p] = o.useState(""), [f, g] = o.useState(""), [x, _] = o.useState("title"), [w, b] = o.useState("all"), [j, v] = o.useState("grid"), [C, N] = o.useState(/* @__PURE__ */ new Set()), [z, O] = o.useState(null), [U, E] = o.useState(null);
|
|
15219
15221
|
o.useEffect(() => {
|
|
15220
15222
|
N(/* @__PURE__ */ new Set());
|
|
15221
15223
|
}, [w]), o.useEffect(() => {
|
|
@@ -15223,27 +15225,27 @@ function Sf(t) {
|
|
|
15223
15225
|
return () => clearTimeout(k);
|
|
15224
15226
|
}, [h]);
|
|
15225
15227
|
const P = o.useRef(null), A = [
|
|
15226
|
-
...Ne.playlists.list(f,
|
|
15228
|
+
...Ne.playlists.list(f, x, w)
|
|
15227
15229
|
], {
|
|
15228
15230
|
data: M,
|
|
15229
15231
|
isLoading: S,
|
|
15230
15232
|
isFetchingNextPage: K,
|
|
15231
15233
|
hasNextPage: W,
|
|
15232
15234
|
fetchNextPage: D,
|
|
15233
|
-
error:
|
|
15234
|
-
} =
|
|
15235
|
+
error: R
|
|
15236
|
+
} = Lt({
|
|
15235
15237
|
queryKey: A,
|
|
15236
15238
|
queryFn: async ({ pageParam: k }) => {
|
|
15237
|
-
const
|
|
15239
|
+
const oe = await s.playlists.getPlaylists({
|
|
15238
15240
|
"filter[title]": f || void 0,
|
|
15239
15241
|
"filter[ownership]": w !== "all" ? w : void 0,
|
|
15240
15242
|
"page[cursor]": k,
|
|
15241
15243
|
"page[limit]": kf,
|
|
15242
|
-
sort:
|
|
15244
|
+
sort: x
|
|
15243
15245
|
});
|
|
15244
15246
|
return {
|
|
15245
|
-
playlists:
|
|
15246
|
-
nextCursor:
|
|
15247
|
+
playlists: oe.playlists,
|
|
15248
|
+
nextCursor: oe.meta.pagination.next_cursor
|
|
15247
15249
|
};
|
|
15248
15250
|
},
|
|
15249
15251
|
getNextPageParam: (k) => k.nextCursor ?? void 0,
|
|
@@ -15256,18 +15258,18 @@ function Sf(t) {
|
|
|
15256
15258
|
o.useEffect(() => {
|
|
15257
15259
|
const k = P.current;
|
|
15258
15260
|
if (!k) return;
|
|
15259
|
-
const
|
|
15261
|
+
const oe = new IntersectionObserver(
|
|
15260
15262
|
(ye) => {
|
|
15261
15263
|
ye[0]?.isIntersecting && W && !K && D();
|
|
15262
15264
|
},
|
|
15263
15265
|
{ threshold: 0, rootMargin: "200px" }
|
|
15264
15266
|
);
|
|
15265
|
-
return
|
|
15267
|
+
return oe.observe(k), () => oe.disconnect();
|
|
15266
15268
|
}, [D, W, K]);
|
|
15267
|
-
const I = C.size > 0, $ = o.useCallback((k,
|
|
15269
|
+
const I = C.size > 0, $ = o.useCallback((k, oe) => {
|
|
15268
15270
|
N((ye) => {
|
|
15269
15271
|
const fe = new Set(ye);
|
|
15270
|
-
return
|
|
15272
|
+
return oe ? fe.add(k) : fe.delete(k), fe;
|
|
15271
15273
|
});
|
|
15272
15274
|
}, []), se = o.useCallback(() => {
|
|
15273
15275
|
C.size === T.length ? N(/* @__PURE__ */ new Set()) : N(new Set(T.map((k) => k.id)));
|
|
@@ -15280,7 +15282,7 @@ function Sf(t) {
|
|
|
15280
15282
|
}) : Promise.reject(new Error("Favorite not available")),
|
|
15281
15283
|
onMutate: async (k) => {
|
|
15282
15284
|
await m.cancelQueries({ queryKey: A });
|
|
15283
|
-
const
|
|
15285
|
+
const oe = m.getQueryData(A);
|
|
15284
15286
|
return m.setQueryData(A, (ye) => ye && {
|
|
15285
15287
|
...ye,
|
|
15286
15288
|
pages: ye.pages.map((fe) => ({
|
|
@@ -15289,9 +15291,9 @@ function Sf(t) {
|
|
|
15289
15291
|
(X) => X.id === k ? { ...X, is_favorited: !X.is_favorited } : X
|
|
15290
15292
|
)
|
|
15291
15293
|
}))
|
|
15292
|
-
}), { previousData:
|
|
15294
|
+
}), { previousData: oe, capturedKey: A };
|
|
15293
15295
|
},
|
|
15294
|
-
onError: (k,
|
|
15296
|
+
onError: (k, oe, ye) => {
|
|
15295
15297
|
ye?.previousData && m.setQueryData(ye.capturedKey, ye.previousData), i({ title: a("playlist_favorite_error"), type: "error" });
|
|
15296
15298
|
},
|
|
15297
15299
|
onSuccess: (k) => {
|
|
@@ -15329,7 +15331,7 @@ function Sf(t) {
|
|
|
15329
15331
|
error: k
|
|
15330
15332
|
}), O(null);
|
|
15331
15333
|
}
|
|
15332
|
-
}),
|
|
15334
|
+
}), L = o.useCallback(() => {
|
|
15333
15335
|
z != null && _e(z);
|
|
15334
15336
|
}, [z, _e]), Y = o.useMemo(
|
|
15335
15337
|
() => [
|
|
@@ -15369,8 +15371,8 @@ function Sf(t) {
|
|
|
15369
15371
|
onSearchChange: p,
|
|
15370
15372
|
placeholder: a("playlist_search_placeholder"),
|
|
15371
15373
|
sortOptions: Y,
|
|
15372
|
-
sortValue:
|
|
15373
|
-
onSortChange:
|
|
15374
|
+
sortValue: x,
|
|
15375
|
+
onSortChange: _
|
|
15374
15376
|
}
|
|
15375
15377
|
) }),
|
|
15376
15378
|
/* @__PURE__ */ e.jsx(Mr, { value: j, onChange: v })
|
|
@@ -15378,9 +15380,9 @@ function Sf(t) {
|
|
|
15378
15380
|
}
|
|
15379
15381
|
), J = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
15380
15382
|
K && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx("div", { className: "border-primary size-6 animate-spin rounded-full border-2 border-t-transparent" }) }),
|
|
15381
|
-
|
|
15383
|
+
R && /* @__PURE__ */ e.jsxs("p", { className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2", children: [
|
|
15382
15384
|
"Error: ",
|
|
15383
|
-
|
|
15385
|
+
R.message
|
|
15384
15386
|
] })
|
|
15385
15387
|
] }), me = T.length === 0 && !K && !W;
|
|
15386
15388
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -15419,7 +15421,7 @@ function Sf(t) {
|
|
|
15419
15421
|
sentinelRef: P,
|
|
15420
15422
|
loadingFilterShape: "search-view",
|
|
15421
15423
|
children: j === "grid" ? /* @__PURE__ */ e.jsx("div", { className: Cf, children: T.map((k) => {
|
|
15422
|
-
const
|
|
15424
|
+
const oe = k.items?.[0], ye = k.image_url ?? oe?.image_url ?? oe?.relateable?.image_url ?? oe?.relateable?.compressed_image_url, fe = k.items_count ?? k.items?.length ?? 0, X = d && k.user_id === l?.id;
|
|
15423
15425
|
return /* @__PURE__ */ e.jsx(
|
|
15424
15426
|
wf,
|
|
15425
15427
|
{
|
|
@@ -15439,7 +15441,7 @@ function Sf(t) {
|
|
|
15439
15441
|
k.id
|
|
15440
15442
|
);
|
|
15441
15443
|
}) }) : /* @__PURE__ */ e.jsx("div", { className: Ar, children: T.map((k) => {
|
|
15442
|
-
const
|
|
15444
|
+
const oe = k.items?.[0], ye = k.image_url ?? oe?.image_url ?? oe?.relateable?.image_url ?? oe?.relateable?.compressed_image_url, fe = k.items_count ?? k.items?.length ?? 0, X = d && k.user_id === l?.id, le = C.has(k.id), We = k.title || a("playlist_untitled");
|
|
15443
15445
|
return /* @__PURE__ */ e.jsx(
|
|
15444
15446
|
Er,
|
|
15445
15447
|
{
|
|
@@ -15591,7 +15593,7 @@ function Sf(t) {
|
|
|
15591
15593
|
H,
|
|
15592
15594
|
{
|
|
15593
15595
|
variant: "destructive",
|
|
15594
|
-
onClick:
|
|
15596
|
+
onClick: L,
|
|
15595
15597
|
disabled: F,
|
|
15596
15598
|
children: F ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : a("common_delete")
|
|
15597
15599
|
}
|
|
@@ -15639,14 +15641,14 @@ function Mf({
|
|
|
15639
15641
|
/* @__PURE__ */ e.jsx("div", { className: "mb-1 text-sm text-gray-500", children: n("playlist_no_items") }),
|
|
15640
15642
|
/* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: n("playlist_no_items_description") })
|
|
15641
15643
|
] }) }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: t.map((d, m) => {
|
|
15642
|
-
const h = d.relateable, p = d.image_url ?? h?.image_url ?? h?.compressed_image_url ?? Pf, f = d.title ?? h?.title ?? n("common_untitled"), g = h?.display_price || h?.price,
|
|
15644
|
+
const h = d.relateable, p = d.image_url ?? h?.image_url ?? h?.compressed_image_url ?? Pf, f = d.title ?? h?.title ?? n("common_untitled"), g = h?.display_price || h?.price, x = g && parseFloat(g.replace(/[^0-9.-]/g, "")) > 0 ? g : null, _ = d.kind ?? h?.kind, w = Tf(d.relateable_type, _, {
|
|
15643
15645
|
product: n("common_product"),
|
|
15644
15646
|
enrollment: n("common_enrollment"),
|
|
15645
15647
|
page: n("common_page"),
|
|
15646
15648
|
video: n("media_type_video"),
|
|
15647
15649
|
image: n("media_type_image"),
|
|
15648
15650
|
media: n("media_type_default")
|
|
15649
|
-
}), b =
|
|
15651
|
+
}), b = _ === "video", j = _ === "image", v = d.relateable_type === "Product", C = xl.has(
|
|
15650
15652
|
d.relateable_type ?? ""
|
|
15651
15653
|
), N = Af(
|
|
15652
15654
|
d.duration ?? h?.duration
|
|
@@ -15685,7 +15687,7 @@ function Mf({
|
|
|
15685
15687
|
]
|
|
15686
15688
|
}
|
|
15687
15689
|
) : /* @__PURE__ */ e.jsx("div", { className: "text-foreground text-[15px] leading-[1.4] font-semibold", children: /* @__PURE__ */ e.jsx("span", { className: "line-clamp-2", children: f }) }),
|
|
15688
|
-
v &&
|
|
15690
|
+
v && x && /* @__PURE__ */ e.jsx("div", { className: "text-foreground text-[15px] leading-[1.4] font-normal", children: x }),
|
|
15689
15691
|
b && /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-[13px] leading-[1.4] font-normal", children: N || n("media_type_video") }),
|
|
15690
15692
|
j && /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-[13px] leading-[1.4] font-normal", children: z || n("file_type_image_fallback") }),
|
|
15691
15693
|
/* @__PURE__ */ e.jsx("div", { className: "mt-1", children: /* @__PURE__ */ e.jsx("span", { className: "bg-background text-foreground inline-flex items-center rounded-md px-2.5 py-1 text-[13px] leading-[1.4] font-medium", children: w }) })
|
|
@@ -15714,8 +15716,8 @@ function If({
|
|
|
15714
15716
|
queryFn: () => n.playlists.getPlaylistById(Number(t), l)
|
|
15715
15717
|
}), {
|
|
15716
15718
|
shareLink: g,
|
|
15717
|
-
loading:
|
|
15718
|
-
error:
|
|
15719
|
+
loading: x,
|
|
15720
|
+
error: _
|
|
15719
15721
|
} = Pa({ id: Number(t) }, "Library", void 0, l), w = p?.playlist, b = d && w?.user_id === c?.id, j = w?.title || "", v = w?.items?.filter(
|
|
15720
15722
|
(A) => A.relateable_type === "Product" || A.relateable_type === "EnrollmentPack"
|
|
15721
15723
|
).map((A) => A.relateable).filter((A) => !!A) || [], C = w?.items?.filter(
|
|
@@ -15774,8 +15776,8 @@ function If({
|
|
|
15774
15776
|
{
|
|
15775
15777
|
downloadUrl: null,
|
|
15776
15778
|
displayTitle: j,
|
|
15777
|
-
shareLink:
|
|
15778
|
-
shareLinkLoading:
|
|
15779
|
+
shareLink: _ ? null : g || null,
|
|
15780
|
+
shareLinkLoading: x,
|
|
15779
15781
|
isVideo: P,
|
|
15780
15782
|
relateableId: Number(t),
|
|
15781
15783
|
relateableType: "Library"
|
|
@@ -15831,7 +15833,7 @@ const yl = o.createContext(
|
|
|
15831
15833
|
countries: t?.countries?.map((s) => s.iso) ?? [],
|
|
15832
15834
|
search_engine_optimizer: t?.search_engine_optimizer ?? null
|
|
15833
15835
|
});
|
|
15834
|
-
function
|
|
15836
|
+
function Rf({
|
|
15835
15837
|
children: t,
|
|
15836
15838
|
playlist: s
|
|
15837
15839
|
}) {
|
|
@@ -15839,23 +15841,23 @@ function Lf({
|
|
|
15839
15841
|
{}
|
|
15840
15842
|
), c = o.useMemo(() => JSON.stringify(n) !== JSON.stringify(r), [n, r]), d = o.useRef(JSON.stringify(s));
|
|
15841
15843
|
o.useEffect(() => {
|
|
15842
|
-
const
|
|
15843
|
-
|
|
15844
|
+
const _ = JSON.stringify(s);
|
|
15845
|
+
_ !== d.current && (d.current = _, i(sr(s)));
|
|
15844
15846
|
}, [s]);
|
|
15845
15847
|
const m = o.useCallback(
|
|
15846
|
-
(
|
|
15847
|
-
i((b) => ({ ...b, [
|
|
15848
|
+
(_, w) => {
|
|
15849
|
+
i((b) => ({ ...b, [_]: w })), l[_] && u((b) => {
|
|
15848
15850
|
const j = { ...b };
|
|
15849
|
-
return delete j[
|
|
15851
|
+
return delete j[_], j;
|
|
15850
15852
|
});
|
|
15851
15853
|
},
|
|
15852
15854
|
[l]
|
|
15853
15855
|
), h = o.useCallback(
|
|
15854
|
-
(
|
|
15856
|
+
(_) => {
|
|
15855
15857
|
i((w) => {
|
|
15856
15858
|
const j = { ...w.search_engine_optimizer ?? Df(w.title) };
|
|
15857
|
-
|
|
15858
|
-
const v =
|
|
15859
|
+
_.title !== void 0 && (j.title = _.title ?? ""), _.description !== void 0 && (j.description = _.description ?? ""), _.image_url !== void 0 && (j.image_url = _.image_url ?? ""), _.image_path !== void 0 && (j.image_path = _.image_path ?? ""), _.block_crawler !== void 0 && (j.block_crawler = _.block_crawler ?? !1);
|
|
15860
|
+
const v = _.slug !== void 0 ? _.slug ?? null : w.slug;
|
|
15859
15861
|
return {
|
|
15860
15862
|
...w,
|
|
15861
15863
|
slug: v,
|
|
@@ -15865,19 +15867,19 @@ function Lf({
|
|
|
15865
15867
|
},
|
|
15866
15868
|
[]
|
|
15867
15869
|
), p = o.useCallback(() => {
|
|
15868
|
-
const
|
|
15869
|
-
return (!n.title || !n.title.trim()) && (
|
|
15870
|
-
}, [n.title, a]), f = o.useCallback((
|
|
15870
|
+
const _ = {};
|
|
15871
|
+
return (!n.title || !n.title.trim()) && (_.title = a("playlist_title_required")), u(_), Object.keys(_).length === 0;
|
|
15872
|
+
}, [n.title, a]), f = o.useCallback((_) => {
|
|
15871
15873
|
u((w) => {
|
|
15872
15874
|
const b = { ...w };
|
|
15873
|
-
return delete b[
|
|
15875
|
+
return delete b[_], b;
|
|
15874
15876
|
});
|
|
15875
15877
|
}, []), g = o.useCallback(
|
|
15876
|
-
(
|
|
15877
|
-
i(sr(
|
|
15878
|
+
(_) => {
|
|
15879
|
+
i(sr(_ ?? s)), u({});
|
|
15878
15880
|
},
|
|
15879
15881
|
[s]
|
|
15880
|
-
),
|
|
15882
|
+
), x = o.useMemo(
|
|
15881
15883
|
() => ({
|
|
15882
15884
|
form: n,
|
|
15883
15885
|
validationErrors: l,
|
|
@@ -15899,7 +15901,7 @@ function Lf({
|
|
|
15899
15901
|
g
|
|
15900
15902
|
]
|
|
15901
15903
|
);
|
|
15902
|
-
return /* @__PURE__ */ e.jsx(yl.Provider, { value:
|
|
15904
|
+
return /* @__PURE__ */ e.jsx(yl.Provider, { value: x, children: t });
|
|
15903
15905
|
}
|
|
15904
15906
|
function Fa() {
|
|
15905
15907
|
const t = o.use(yl);
|
|
@@ -15916,7 +15918,7 @@ function Ia() {
|
|
|
15916
15918
|
);
|
|
15917
15919
|
return t;
|
|
15918
15920
|
}
|
|
15919
|
-
function
|
|
15921
|
+
function Lf({
|
|
15920
15922
|
children: t,
|
|
15921
15923
|
initialItems: s = []
|
|
15922
15924
|
}) {
|
|
@@ -15958,7 +15960,7 @@ function zf({
|
|
|
15958
15960
|
onSubmit: a,
|
|
15959
15961
|
isSaving: r
|
|
15960
15962
|
}) {
|
|
15961
|
-
const { t: n } = ne(), { form: i, isDirty: l } = Fa(), { isDirty: u } = Ia(), { onDeletePlaylist: c, showToast: d, navigate: m } = Ee(), h = dt(), [p, f] = o.useState(!1), [g,
|
|
15963
|
+
const { t: n } = ne(), { form: i, isDirty: l } = Fa(), { isDirty: u } = Ia(), { onDeletePlaylist: c, showToast: d, navigate: m } = Ee(), h = dt(), [p, f] = o.useState(!1), [g, x] = o.useState(!1), [_, w] = o.useState(!1), b = o.useMemo(() => !!(i.title && i.title.trim()), [i.title]), j = l || u, v = _ || r, C = async () => {
|
|
15962
15964
|
if (!(!t || !c)) {
|
|
15963
15965
|
w(!0);
|
|
15964
15966
|
try {
|
|
@@ -15985,7 +15987,7 @@ function zf({
|
|
|
15985
15987
|
className: "size-8 p-0",
|
|
15986
15988
|
"aria-label": n("playlist_actions_aria"),
|
|
15987
15989
|
disabled: v,
|
|
15988
|
-
onClick: () =>
|
|
15990
|
+
onClick: () => x(!0),
|
|
15989
15991
|
children: /* @__PURE__ */ e.jsx(lt, { className: "size-4" })
|
|
15990
15992
|
}
|
|
15991
15993
|
),
|
|
@@ -15993,7 +15995,7 @@ function zf({
|
|
|
15993
15995
|
Xe,
|
|
15994
15996
|
{
|
|
15995
15997
|
open: g,
|
|
15996
|
-
onOpenChange:
|
|
15998
|
+
onOpenChange: x,
|
|
15997
15999
|
title: n("playlist_actions_aria"),
|
|
15998
16000
|
actions: [
|
|
15999
16001
|
{
|
|
@@ -16061,7 +16063,7 @@ function zf({
|
|
|
16061
16063
|
{
|
|
16062
16064
|
open: p,
|
|
16063
16065
|
onOpenChange: (N) => {
|
|
16064
|
-
!N && !
|
|
16066
|
+
!N && !_ && f(!1);
|
|
16065
16067
|
},
|
|
16066
16068
|
title: n("playlist_delete_confirm_title"),
|
|
16067
16069
|
description: n("playlist_delete_confirm_description"),
|
|
@@ -16073,7 +16075,7 @@ function zf({
|
|
|
16073
16075
|
H,
|
|
16074
16076
|
{
|
|
16075
16077
|
variant: "secondary",
|
|
16076
|
-
disabled:
|
|
16078
|
+
disabled: _,
|
|
16077
16079
|
onClick: () => f(!1),
|
|
16078
16080
|
children: n("common_cancel")
|
|
16079
16081
|
}
|
|
@@ -16085,8 +16087,8 @@ function zf({
|
|
|
16085
16087
|
onClick: (N) => {
|
|
16086
16088
|
N.preventDefault(), C();
|
|
16087
16089
|
},
|
|
16088
|
-
disabled:
|
|
16089
|
-
children:
|
|
16090
|
+
disabled: _,
|
|
16091
|
+
children: _ ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : n("common_delete")
|
|
16090
16092
|
}
|
|
16091
16093
|
)
|
|
16092
16094
|
] })
|
|
@@ -16122,7 +16124,7 @@ function Of() {
|
|
|
16122
16124
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
16123
16125
|
/* @__PURE__ */ e.jsx(nt, { className: "text-foreground font-medium", children: t("common_description_label") }),
|
|
16124
16126
|
/* @__PURE__ */ e.jsx("div", { className: "border-border rounded-[6px] border shadow-xs", children: /* @__PURE__ */ e.jsx(
|
|
16125
|
-
|
|
16127
|
+
Lr,
|
|
16126
16128
|
{
|
|
16127
16129
|
value: s.description || "",
|
|
16128
16130
|
onChange: (n) => a("description", n),
|
|
@@ -16140,21 +16142,19 @@ function $f({
|
|
|
16140
16142
|
id: s,
|
|
16141
16143
|
enableReordering: a = !0
|
|
16142
16144
|
}) {
|
|
16143
|
-
const {
|
|
16144
|
-
attributes:
|
|
16145
|
-
listeners:
|
|
16146
|
-
setNodeRef:
|
|
16147
|
-
transform:
|
|
16148
|
-
transition:
|
|
16149
|
-
isDragging:
|
|
16150
|
-
} = lo({ id: s, disabled:
|
|
16151
|
-
transform: oo.Transform.toString(
|
|
16152
|
-
transition:
|
|
16153
|
-
opacity:
|
|
16145
|
+
const r = !a, {
|
|
16146
|
+
attributes: n,
|
|
16147
|
+
listeners: i,
|
|
16148
|
+
setNodeRef: l,
|
|
16149
|
+
transform: u,
|
|
16150
|
+
transition: c,
|
|
16151
|
+
isDragging: d
|
|
16152
|
+
} = lo({ id: s, disabled: r }), m = {
|
|
16153
|
+
transform: oo.Transform.toString(u),
|
|
16154
|
+
transition: c,
|
|
16155
|
+
opacity: d ? 0.5 : 1
|
|
16154
16156
|
};
|
|
16155
|
-
return /* @__PURE__ */ e.jsx("tr", { ref:
|
|
16156
|
-
...n
|
|
16157
|
-
}) : m) });
|
|
16157
|
+
return /* @__PURE__ */ e.jsx("tr", { ref: l, style: m, children: t({ ...n, ...i, disabled: r }) });
|
|
16158
16158
|
}
|
|
16159
16159
|
function Uf(t, s) {
|
|
16160
16160
|
const a = s?.toLowerCase() ?? "";
|
|
@@ -16203,21 +16203,21 @@ function Bf({
|
|
|
16203
16203
|
coordinateGetter: uo
|
|
16204
16204
|
})
|
|
16205
16205
|
), m = (g) => {
|
|
16206
|
-
const { active:
|
|
16207
|
-
if (
|
|
16206
|
+
const { active: x, over: _ } = g;
|
|
16207
|
+
if (x.id !== _?.id && s) {
|
|
16208
16208
|
const w = t.findIndex(
|
|
16209
|
-
(j) => j.id?.toString() ===
|
|
16209
|
+
(j) => j.id?.toString() === x.id
|
|
16210
16210
|
), b = t.findIndex(
|
|
16211
|
-
(j) => j.id?.toString() ===
|
|
16211
|
+
(j) => j.id?.toString() === _?.id
|
|
16212
16212
|
);
|
|
16213
16213
|
s(yo(t, w, b));
|
|
16214
16214
|
}
|
|
16215
|
-
}, h = t.map((g,
|
|
16216
|
-
id: g.id || `item-${
|
|
16215
|
+
}, h = t.map((g, x) => ({
|
|
16216
|
+
id: g.id || `item-${x}`,
|
|
16217
16217
|
relateable_type: g.relateable_type,
|
|
16218
16218
|
relateable_id: g.relateable?.id,
|
|
16219
16219
|
relateable: g.relateable,
|
|
16220
|
-
order:
|
|
16220
|
+
order: x + 1,
|
|
16221
16221
|
title: g.title ?? g.relateable?.title ?? `${g.relateable_type} #${g.relateable?.id}`,
|
|
16222
16222
|
image_url: g.image_url ?? g.relateable?.image_url ?? null,
|
|
16223
16223
|
kind: g.kind ?? g.relateable?.kind ?? null
|
|
@@ -16228,19 +16228,30 @@ function Bf({
|
|
|
16228
16228
|
/* @__PURE__ */ e.jsx("th", { className: "text-muted-foreground px-6 py-3 text-left text-xs font-medium tracking-wider uppercase", children: i("playlist_table_type") }),
|
|
16229
16229
|
/* @__PURE__ */ e.jsx("th", { className: "text-muted-foreground px-6 py-3 text-left text-xs font-medium tracking-wider uppercase", children: i("playlist_table_actions") })
|
|
16230
16230
|
] }) }),
|
|
16231
|
-
/* @__PURE__ */ e.jsx("tbody", { className: "divide-border bg-card divide-y", children: h.map((g) => /* @__PURE__ */ e.
|
|
16231
|
+
/* @__PURE__ */ e.jsx("tbody", { className: "divide-border bg-card divide-y", children: h.map((g) => /* @__PURE__ */ e.jsx(
|
|
16232
16232
|
$f,
|
|
16233
16233
|
{
|
|
16234
16234
|
id: g.id.toString(),
|
|
16235
16235
|
enableReordering: n,
|
|
16236
|
-
children: [
|
|
16236
|
+
children: (x) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
16237
16237
|
/* @__PURE__ */ e.jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
16238
|
-
/* @__PURE__ */ e.jsx(
|
|
16239
|
-
|
|
16238
|
+
/* @__PURE__ */ e.jsx(
|
|
16239
|
+
"button",
|
|
16240
16240
|
{
|
|
16241
|
-
|
|
16241
|
+
type: "button",
|
|
16242
|
+
...x,
|
|
16243
|
+
"aria-label": i("playlist_drag_to_reorder_aria", {
|
|
16244
|
+
title: g.title
|
|
16245
|
+
}),
|
|
16246
|
+
className: n ? "cursor-move" : "",
|
|
16247
|
+
children: /* @__PURE__ */ e.jsx(
|
|
16248
|
+
ho,
|
|
16249
|
+
{
|
|
16250
|
+
className: `h-4 w-4 ${n ? "text-muted-foreground" : "text-muted-foreground/50"}`
|
|
16251
|
+
}
|
|
16252
|
+
)
|
|
16242
16253
|
}
|
|
16243
|
-
)
|
|
16254
|
+
),
|
|
16244
16255
|
/* @__PURE__ */ e.jsx("div", { className: "text-foreground text-sm font-medium", children: g.order })
|
|
16245
16256
|
] }) }),
|
|
16246
16257
|
/* @__PURE__ */ e.jsx("td", { className: "max-w-xs px-6 py-4 lg:max-w-md", children: /* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
@@ -16275,6 +16286,9 @@ function Bf({
|
|
|
16275
16286
|
size: "sm",
|
|
16276
16287
|
className: "flex size-8 items-center justify-center p-0",
|
|
16277
16288
|
disabled: r,
|
|
16289
|
+
"aria-label": i("playlist_item_actions_aria", {
|
|
16290
|
+
title: g.title
|
|
16291
|
+
}),
|
|
16278
16292
|
onClick: () => {
|
|
16279
16293
|
const _ = typeof g.id == "number" ? g.id : parseInt(String(g.id).replace("item-", ""));
|
|
16280
16294
|
c(_);
|
|
@@ -16289,6 +16303,9 @@ function Bf({
|
|
|
16289
16303
|
size: "sm",
|
|
16290
16304
|
className: "flex size-8 items-center justify-center p-0",
|
|
16291
16305
|
disabled: r,
|
|
16306
|
+
"aria-label": i("playlist_item_actions_aria", {
|
|
16307
|
+
title: g.title
|
|
16308
|
+
}),
|
|
16292
16309
|
children: /* @__PURE__ */ e.jsx(Vr, { className: "size-4" })
|
|
16293
16310
|
}
|
|
16294
16311
|
) }),
|
|
@@ -16296,7 +16313,9 @@ function Bf({
|
|
|
16296
16313
|
Fe,
|
|
16297
16314
|
{
|
|
16298
16315
|
onClick: () => {
|
|
16299
|
-
const _ = typeof g.id == "number" ? g.id : parseInt(
|
|
16316
|
+
const _ = typeof g.id == "number" ? g.id : parseInt(
|
|
16317
|
+
String(g.id).replace("item-", "")
|
|
16318
|
+
);
|
|
16300
16319
|
a(_);
|
|
16301
16320
|
},
|
|
16302
16321
|
variant: "destructive",
|
|
@@ -16307,7 +16326,7 @@ function Bf({
|
|
|
16307
16326
|
}
|
|
16308
16327
|
) })
|
|
16309
16328
|
] }) })
|
|
16310
|
-
]
|
|
16329
|
+
] })
|
|
16311
16330
|
},
|
|
16312
16331
|
g.id
|
|
16313
16332
|
)) })
|
|
@@ -16423,7 +16442,7 @@ function Qf({
|
|
|
16423
16442
|
updateItems: h,
|
|
16424
16443
|
addItem: p,
|
|
16425
16444
|
removeItem: f
|
|
16426
|
-
} = Ia(), g = m, { primaryItems:
|
|
16445
|
+
} = Ia(), g = m, { primaryItems: x, taggedItems: _ } = o.useMemo(() => {
|
|
16427
16446
|
const M = [], S = [];
|
|
16428
16447
|
return g.forEach((K) => {
|
|
16429
16448
|
K.relateable_type && zr.has(K.relateable_type) ? M.push(K) : K.relateable_type && Or.has(K.relateable_type) && S.push(K);
|
|
@@ -16459,7 +16478,7 @@ function Qf({
|
|
|
16459
16478
|
);
|
|
16460
16479
|
const N = !!l.playlists.reorderPlaylistItems, z = o.useCallback(
|
|
16461
16480
|
(M, S) => {
|
|
16462
|
-
const K = S === "primary" ? [...M, ...
|
|
16481
|
+
const K = S === "primary" ? [...M, ..._] : [...x, ...M], W = Gf(K);
|
|
16463
16482
|
t && N && v.current === null && C.current === null && (C.current = g), h(W), !(!t || !N) && (v.current && clearTimeout(v.current), v.current = setTimeout(() => {
|
|
16464
16483
|
v.current = null;
|
|
16465
16484
|
const D = C.current;
|
|
@@ -16468,19 +16487,19 @@ function Qf({
|
|
|
16468
16487
|
playlistId: t,
|
|
16469
16488
|
data: {
|
|
16470
16489
|
items: W.filter(
|
|
16471
|
-
(
|
|
16472
|
-
).map((
|
|
16490
|
+
(R) => Number.isInteger(R.id) && typeof R.order == "number"
|
|
16491
|
+
).map((R) => ({ id: R.id, order: R.order }))
|
|
16473
16492
|
}
|
|
16474
16493
|
},
|
|
16475
16494
|
{
|
|
16476
16495
|
onSuccess: () => {
|
|
16477
16496
|
v.current === null ? C.current = null : C.current = W;
|
|
16478
16497
|
},
|
|
16479
|
-
onError: (
|
|
16498
|
+
onError: (R) => {
|
|
16480
16499
|
D && h(D), C.current = null, r({
|
|
16481
16500
|
title: s("playlist_reorder_error"),
|
|
16482
16501
|
type: "error",
|
|
16483
|
-
error:
|
|
16502
|
+
error: R
|
|
16484
16503
|
});
|
|
16485
16504
|
}
|
|
16486
16505
|
}
|
|
@@ -16488,8 +16507,8 @@ function Qf({
|
|
|
16488
16507
|
}, Kf));
|
|
16489
16508
|
},
|
|
16490
16509
|
[
|
|
16491
|
-
_,
|
|
16492
16510
|
x,
|
|
16511
|
+
_,
|
|
16493
16512
|
g,
|
|
16494
16513
|
h,
|
|
16495
16514
|
t,
|
|
@@ -16516,9 +16535,9 @@ function Qf({
|
|
|
16516
16535
|
for (const W of S) {
|
|
16517
16536
|
const D = Vf(W.asset_code);
|
|
16518
16537
|
if (!D || !M.allowedRelateableTypes.has(D)) continue;
|
|
16519
|
-
const
|
|
16538
|
+
const R = W.asset_id, T = W.metadata?.file_name || `${D} #${R}`;
|
|
16520
16539
|
if (g.some(
|
|
16521
|
-
(G) => G.relateable_type === D && G.relateable?.id ===
|
|
16540
|
+
(G) => G.relateable_type === D && G.relateable?.id === R
|
|
16522
16541
|
)) {
|
|
16523
16542
|
r({
|
|
16524
16543
|
title: s("playlist_item_already_exists"),
|
|
@@ -16531,7 +16550,7 @@ function Qf({
|
|
|
16531
16550
|
order: $,
|
|
16532
16551
|
relateable_type: D,
|
|
16533
16552
|
relateable: {
|
|
16534
|
-
id:
|
|
16553
|
+
id: R,
|
|
16535
16554
|
title: T,
|
|
16536
16555
|
image_url: W.thumbnail_url ?? W.file_url ?? null
|
|
16537
16556
|
}
|
|
@@ -16543,7 +16562,7 @@ function Qf({
|
|
|
16543
16562
|
newItem: se,
|
|
16544
16563
|
data: {
|
|
16545
16564
|
relateable_type: D,
|
|
16546
|
-
relateable_id:
|
|
16565
|
+
relateable_id: R,
|
|
16547
16566
|
order: $
|
|
16548
16567
|
}
|
|
16549
16568
|
}), r({
|
|
@@ -16602,10 +16621,10 @@ function Qf({
|
|
|
16602
16621
|
);
|
|
16603
16622
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-8", children: [
|
|
16604
16623
|
/* @__PURE__ */ e.jsx(
|
|
16605
|
-
|
|
16624
|
+
Rn,
|
|
16606
16625
|
{
|
|
16607
16626
|
section: u.primary,
|
|
16608
|
-
items:
|
|
16627
|
+
items: x,
|
|
16609
16628
|
onAdd: () => d("primary"),
|
|
16610
16629
|
onReorder: (M) => z(M, "primary"),
|
|
16611
16630
|
onDeleteItem: O,
|
|
@@ -16614,11 +16633,11 @@ function Qf({
|
|
|
16614
16633
|
disableAdd: !P
|
|
16615
16634
|
}
|
|
16616
16635
|
),
|
|
16617
|
-
(!P || A ||
|
|
16618
|
-
|
|
16636
|
+
(!P || A || _.length > 0) && /* @__PURE__ */ e.jsx(
|
|
16637
|
+
Rn,
|
|
16619
16638
|
{
|
|
16620
16639
|
section: u.tagged,
|
|
16621
|
-
items:
|
|
16640
|
+
items: _,
|
|
16622
16641
|
onAdd: () => d("tagged"),
|
|
16623
16642
|
onReorder: (M) => z(M, "tagged"),
|
|
16624
16643
|
onDeleteItem: O,
|
|
@@ -16657,7 +16676,7 @@ function Qf({
|
|
|
16657
16676
|
] }) })
|
|
16658
16677
|
] });
|
|
16659
16678
|
}
|
|
16660
|
-
function
|
|
16679
|
+
function Rn({
|
|
16661
16680
|
section: t,
|
|
16662
16681
|
items: s,
|
|
16663
16682
|
onAdd: a,
|
|
@@ -16791,18 +16810,18 @@ function ag({
|
|
|
16791
16810
|
hideHeader: n,
|
|
16792
16811
|
renderHeaderSlot: i
|
|
16793
16812
|
}) {
|
|
16794
|
-
const l = Ae(), { t: u } = ne(), { showToast: c, navigate: d, user: m } = Ee(), { items: h } = Ia(), { form: p, updateField: f, validateForm: g } = Fa(),
|
|
16813
|
+
const l = Ae(), { t: u } = ne(), { showToast: c, navigate: d, user: m } = Ee(), { items: h } = Ia(), { form: p, updateField: f, validateForm: g } = Fa(), x = p.title || "", _ = p.slug ?? "";
|
|
16795
16814
|
o.useEffect(() => {
|
|
16796
16815
|
const z = p.custom_slug || s?.custom_slug || !1;
|
|
16797
|
-
if (
|
|
16798
|
-
const O =
|
|
16799
|
-
O !==
|
|
16816
|
+
if (x && !z) {
|
|
16817
|
+
const O = x.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
16818
|
+
O !== _ && f("slug", O);
|
|
16800
16819
|
}
|
|
16801
16820
|
}, [
|
|
16802
|
-
|
|
16821
|
+
x,
|
|
16803
16822
|
p.custom_slug,
|
|
16804
16823
|
s?.custom_slug,
|
|
16805
|
-
|
|
16824
|
+
_,
|
|
16806
16825
|
f
|
|
16807
16826
|
]);
|
|
16808
16827
|
const w = ku({
|
|
@@ -16933,7 +16952,7 @@ function ag({
|
|
|
16933
16952
|
z.preventDefault(), d(`playlists/${t}`);
|
|
16934
16953
|
},
|
|
16935
16954
|
className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
|
|
16936
|
-
children:
|
|
16955
|
+
children: x || u("playlist_breadcrumb_fallback")
|
|
16937
16956
|
}
|
|
16938
16957
|
) }),
|
|
16939
16958
|
/* @__PURE__ */ e.jsx(xt, {}),
|
|
@@ -16973,7 +16992,7 @@ function ag({
|
|
|
16973
16992
|
] }) })
|
|
16974
16993
|
] });
|
|
16975
16994
|
}
|
|
16976
|
-
function
|
|
16995
|
+
function Ln({
|
|
16977
16996
|
playlistId: t,
|
|
16978
16997
|
onBack: s,
|
|
16979
16998
|
hideHeader: a,
|
|
@@ -16987,7 +17006,7 @@ function Rn({
|
|
|
16987
17006
|
return l && c ? /* @__PURE__ */ e.jsxs("div", { className: "mx-auto max-w-7xl space-y-6 px-6 pt-6 pb-8 md:px-10 md:py-8", children: [
|
|
16988
17007
|
/* @__PURE__ */ e.jsx(Oe, { className: "h-8 w-48" }),
|
|
16989
17008
|
/* @__PURE__ */ e.jsx(Oe, { className: "h-64 w-full" })
|
|
16990
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
17009
|
+
] }) : /* @__PURE__ */ e.jsx(Rf, { playlist: d, children: /* @__PURE__ */ e.jsx(Lf, { initialItems: m, children: /* @__PURE__ */ e.jsx(
|
|
16991
17010
|
ag,
|
|
16992
17011
|
{
|
|
16993
17012
|
playlistId: t,
|
|
@@ -17021,7 +17040,7 @@ function lg({
|
|
|
17021
17040
|
hasNextPage: p,
|
|
17022
17041
|
fetchNextPage: f,
|
|
17023
17042
|
error: g
|
|
17024
|
-
} =
|
|
17043
|
+
} = Lt({
|
|
17025
17044
|
queryKey: ["shareables-files", u],
|
|
17026
17045
|
queryFn: async ({ pageParam: b = 1 }) => await s.fileResources.getFileResources({
|
|
17027
17046
|
search_query: u || void 0,
|
|
@@ -17033,10 +17052,10 @@ function lg({
|
|
|
17033
17052
|
return j < v ? j + 1 : void 0;
|
|
17034
17053
|
},
|
|
17035
17054
|
initialPageParam: 1
|
|
17036
|
-
}),
|
|
17055
|
+
}), x = o.useMemo(
|
|
17037
17056
|
() => d?.pages.flatMap((b) => b.file_resources) ?? [],
|
|
17038
17057
|
[d?.pages]
|
|
17039
|
-
),
|
|
17058
|
+
), _ = Ta({
|
|
17040
17059
|
hasNextPage: p,
|
|
17041
17060
|
isFetchingNextPage: h,
|
|
17042
17061
|
fetchNextPage: f,
|
|
@@ -17051,7 +17070,7 @@ function lg({
|
|
|
17051
17070
|
Ys,
|
|
17052
17071
|
{
|
|
17053
17072
|
isLoading: m,
|
|
17054
|
-
isEmpty: !g &&
|
|
17073
|
+
isEmpty: !g && x.length === 0 && !h && !p,
|
|
17055
17074
|
emptyMessage: u ? r("files_search_no_results", { search: u }) : r("files_empty_default"),
|
|
17056
17075
|
filters: /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx("div", { className: "w-full max-w-sm", children: /* @__PURE__ */ e.jsx(
|
|
17057
17076
|
Gs,
|
|
@@ -17063,8 +17082,8 @@ function lg({
|
|
|
17063
17082
|
}
|
|
17064
17083
|
) }) }),
|
|
17065
17084
|
footer: w,
|
|
17066
|
-
sentinelRef:
|
|
17067
|
-
children: /* @__PURE__ */ e.jsx("div", { className: Qs, children:
|
|
17085
|
+
sentinelRef: _,
|
|
17086
|
+
children: /* @__PURE__ */ e.jsx("div", { className: Qs, children: x.map((b) => {
|
|
17068
17087
|
const j = b.content_type?.startsWith("video/"), v = b.url || "#";
|
|
17069
17088
|
return /* @__PURE__ */ e.jsxs(
|
|
17070
17089
|
va,
|
|
@@ -17130,12 +17149,12 @@ function ug({
|
|
|
17130
17149
|
n
|
|
17131
17150
|
), {
|
|
17132
17151
|
data: g,
|
|
17133
|
-
isLoading:
|
|
17134
|
-
isFetchingNextPage:
|
|
17152
|
+
isLoading: x,
|
|
17153
|
+
isFetchingNextPage: _,
|
|
17135
17154
|
hasNextPage: w,
|
|
17136
17155
|
fetchNextPage: b,
|
|
17137
17156
|
error: j
|
|
17138
|
-
} =
|
|
17157
|
+
} = Lt({
|
|
17139
17158
|
queryKey: f,
|
|
17140
17159
|
queryFn: async ({ pageParam: N }) => {
|
|
17141
17160
|
const z = await s.pages.listPages({
|
|
@@ -17169,20 +17188,20 @@ function ug({
|
|
|
17169
17188
|
if (!N) return;
|
|
17170
17189
|
const z = new IntersectionObserver(
|
|
17171
17190
|
(O) => {
|
|
17172
|
-
O[0]?.isIntersecting && w && !
|
|
17191
|
+
O[0]?.isIntersecting && w && !_ && b();
|
|
17173
17192
|
},
|
|
17174
17193
|
{ threshold: 0, rootMargin: "200px" }
|
|
17175
17194
|
);
|
|
17176
17195
|
return z.observe(N), () => z.disconnect();
|
|
17177
|
-
}, [b, w,
|
|
17196
|
+
}, [b, w, _]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
17178
17197
|
/* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsx(ct, { className: "text-lg", children: /* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(Ze, { className: "font-semibold", children: r("pages_breadcrumb") }) }) }) }) }),
|
|
17179
17198
|
/* @__PURE__ */ e.jsx(
|
|
17180
17199
|
Ys,
|
|
17181
17200
|
{
|
|
17182
|
-
isLoading:
|
|
17201
|
+
isLoading: x,
|
|
17183
17202
|
error: j,
|
|
17184
17203
|
errorMessage: r("pages_load_error"),
|
|
17185
|
-
isEmpty: C.length === 0 && !
|
|
17204
|
+
isEmpty: C.length === 0 && !_,
|
|
17186
17205
|
emptyMessage: c ? r("pages_search_no_results", { search: c }) : r("pages_empty_default"),
|
|
17187
17206
|
filters: /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx("div", { className: "w-full max-w-sm", children: /* @__PURE__ */ e.jsx(
|
|
17188
17207
|
Gs,
|
|
@@ -17196,7 +17215,7 @@ function ug({
|
|
|
17196
17215
|
onSortChange: (N) => h(N)
|
|
17197
17216
|
}
|
|
17198
17217
|
) }) }),
|
|
17199
|
-
footer:
|
|
17218
|
+
footer: _ && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx("div", { className: "border-primary size-6 animate-spin rounded-full border-2 border-t-transparent" }) }),
|
|
17200
17219
|
sentinelRef: p,
|
|
17201
17220
|
children: /* @__PURE__ */ e.jsx("div", { className: Qs, children: C.map((N) => {
|
|
17202
17221
|
const z = N.title || r("pages_untitled"), O = () => t?.("pages", String(N.id));
|
|
@@ -17251,7 +17270,7 @@ function mg({
|
|
|
17251
17270
|
}), d = u?.page, m = d?.title || "", h = d?.image_url || "", p = d?.description ?? "", {
|
|
17252
17271
|
shareLink: f,
|
|
17253
17272
|
loading: g,
|
|
17254
|
-
error:
|
|
17273
|
+
error: x
|
|
17255
17274
|
} = Pa(
|
|
17256
17275
|
{
|
|
17257
17276
|
id: d?.id,
|
|
@@ -17267,8 +17286,8 @@ function mg({
|
|
|
17267
17286
|
kt,
|
|
17268
17287
|
{
|
|
17269
17288
|
href: "#",
|
|
17270
|
-
onClick: (
|
|
17271
|
-
|
|
17289
|
+
onClick: (_) => {
|
|
17290
|
+
_.preventDefault(), (a?.onClick ?? s ?? (() => n("pages")))();
|
|
17272
17291
|
},
|
|
17273
17292
|
children: i("pages_breadcrumb")
|
|
17274
17293
|
}
|
|
@@ -17314,7 +17333,7 @@ function mg({
|
|
|
17314
17333
|
{
|
|
17315
17334
|
downloadUrl: null,
|
|
17316
17335
|
displayTitle: m,
|
|
17317
|
-
shareLink:
|
|
17336
|
+
shareLink: x ? null : f || null,
|
|
17318
17337
|
shareLinkLoading: g,
|
|
17319
17338
|
isVideo: !1,
|
|
17320
17339
|
relateableId: d.id,
|
|
@@ -17349,7 +17368,7 @@ function pg({
|
|
|
17349
17368
|
onBack: n
|
|
17350
17369
|
}
|
|
17351
17370
|
) : s && s !== "new" ? p = /* @__PURE__ */ e.jsx(
|
|
17352
|
-
|
|
17371
|
+
Rh,
|
|
17353
17372
|
{
|
|
17354
17373
|
mediaId: s,
|
|
17355
17374
|
onNavigate: r,
|
|
@@ -17366,7 +17385,7 @@ function pg({
|
|
|
17366
17385
|
break;
|
|
17367
17386
|
case "playlists":
|
|
17368
17387
|
case "playlist":
|
|
17369
|
-
s === "new" && h ? p = /* @__PURE__ */ e.jsx(
|
|
17388
|
+
s === "new" && h ? p = /* @__PURE__ */ e.jsx(Ln, { onBack: n }) : s && a === "edit" && h ? p = /* @__PURE__ */ e.jsx(Ln, { playlistId: s, onBack: n }) : s && s !== "new" ? p = /* @__PURE__ */ e.jsx(
|
|
17370
17389
|
If,
|
|
17371
17390
|
{
|
|
17372
17391
|
playlistId: s,
|
|
@@ -17523,23 +17542,23 @@ function vg({
|
|
|
17523
17542
|
l.current = n;
|
|
17524
17543
|
const u = o.useRef(i);
|
|
17525
17544
|
u.current = i;
|
|
17526
|
-
const c =
|
|
17527
|
-
async (D,
|
|
17545
|
+
const c = Lm(), { productsApi: d } = c, m = vs(), { data: h } = Ul(), { data: p } = sc(), { currentSlug: f, navigate: g } = hr(), x = _g(), _ = s ?? tc(h), w = vi(), b = Ge(), j = o.useCallback(
|
|
17546
|
+
async (D, R, T, I) => D ? d.searchProducts(D, { cursor: R, limit: T }) : d.listProducts({ cursor: R, limit: T, sort: I }),
|
|
17528
17547
|
[d]
|
|
17529
17548
|
), v = o.useCallback(
|
|
17530
17549
|
async (D) => d.getProduct(D),
|
|
17531
17550
|
[d]
|
|
17532
17551
|
), { screen: C, detailId: N, action: z } = vl(f), O = yg(
|
|
17533
17552
|
{ screen: C, detailId: N, action: z },
|
|
17534
|
-
|
|
17553
|
+
x?.slug
|
|
17535
17554
|
), { data: U } = ou(
|
|
17536
17555
|
O ?? "",
|
|
17537
17556
|
{
|
|
17538
17557
|
enabled: !!O
|
|
17539
17558
|
}
|
|
17540
|
-
), E = U?.product.name, P = o.useMemo(() =>
|
|
17541
|
-
(D,
|
|
17542
|
-
const T =
|
|
17559
|
+
), E = U?.product.name, P = o.useMemo(() => x ? E ? { ...x, label: E } : x : null, [x, E]), A = o.useCallback(
|
|
17560
|
+
(D, R) => {
|
|
17561
|
+
const T = R ? `share/${D}/${R}` : `share/${D}`;
|
|
17543
17562
|
g(T);
|
|
17544
17563
|
},
|
|
17545
17564
|
[g]
|
|
@@ -17561,7 +17580,7 @@ function vg({
|
|
|
17561
17580
|
affiliateId: null,
|
|
17562
17581
|
basePath: "",
|
|
17563
17582
|
navigate: (D) => {
|
|
17564
|
-
const
|
|
17583
|
+
const R = D.replace(/^\//, ""), T = R.startsWith("share/") ? R : `share/${R}`;
|
|
17565
17584
|
g(T);
|
|
17566
17585
|
},
|
|
17567
17586
|
showToast: (D) => {
|
|
@@ -17569,14 +17588,14 @@ function vg({
|
|
|
17569
17588
|
},
|
|
17570
17589
|
filePickerApi: m,
|
|
17571
17590
|
onToggleFavorite: async (D) => {
|
|
17572
|
-
const
|
|
17591
|
+
const R = await pn(
|
|
17573
17592
|
w,
|
|
17574
17593
|
D.favoriteableId,
|
|
17575
17594
|
D.favoriteableType
|
|
17576
17595
|
);
|
|
17577
17596
|
return b.invalidateQueries({
|
|
17578
17597
|
queryKey: Kr.favorites()
|
|
17579
|
-
}),
|
|
17598
|
+
}), R;
|
|
17580
17599
|
},
|
|
17581
17600
|
onMySiteShare: async (D) => {
|
|
17582
17601
|
await pn(
|
|
@@ -17594,15 +17613,15 @@ function vg({
|
|
|
17594
17613
|
onDeletePlaylist: async (D) => {
|
|
17595
17614
|
await c.playlistsAdapter.deletePlaylist(D);
|
|
17596
17615
|
},
|
|
17597
|
-
mediaProductsApi:
|
|
17616
|
+
mediaProductsApi: _ ? void 0 : {
|
|
17598
17617
|
...c.mediaProductsAdapter,
|
|
17599
|
-
listMediaProducts: (D,
|
|
17600
|
-
...
|
|
17601
|
-
language_iso:
|
|
17618
|
+
listMediaProducts: (D, R) => c.mediaProductsAdapter.listMediaProducts(D, {
|
|
17619
|
+
...R,
|
|
17620
|
+
language_iso: R?.language_iso ?? u.current
|
|
17602
17621
|
})
|
|
17603
17622
|
},
|
|
17604
|
-
searchProducts:
|
|
17605
|
-
const T =
|
|
17623
|
+
searchProducts: _ ? void 0 : async (D, R) => {
|
|
17624
|
+
const T = R?.limit ?? 25, I = R?.cursor ?? void 0, $ = D.trim().length > 0 ? await d.searchProducts(D, {
|
|
17606
17625
|
cursor: I,
|
|
17607
17626
|
limit: T
|
|
17608
17627
|
}) : await d.listProducts({ cursor: I, limit: T });
|
|
@@ -17621,7 +17640,7 @@ function vg({
|
|
|
17621
17640
|
// `readOnly` covers content authoring only: creating and editing media,
|
|
17622
17641
|
// tagging products, uploading thumbnails. Playlist curation is answered
|
|
17623
17642
|
// by `canCuratePlaylists`, which stays open to everyone.
|
|
17624
|
-
readOnly:
|
|
17643
|
+
readOnly: _,
|
|
17625
17644
|
canCuratePlaylists: a ?? !0,
|
|
17626
17645
|
// pickerSources powers the playlist editor's content browser tabs.
|
|
17627
17646
|
// All four content types are wired here: Media via the existing media
|
|
@@ -17632,9 +17651,9 @@ function vg({
|
|
|
17632
17651
|
pickerSources: {
|
|
17633
17652
|
pages: {
|
|
17634
17653
|
cacheKey: `locale:${i}`,
|
|
17635
|
-
list: async ({ search: D, cursor:
|
|
17654
|
+
list: async ({ search: D, cursor: R, limit: T }) => {
|
|
17636
17655
|
const I = await c.pagesAdapter.listPages({
|
|
17637
|
-
cursor:
|
|
17656
|
+
cursor: R ?? void 0,
|
|
17638
17657
|
limit: T,
|
|
17639
17658
|
"filter[title]": D && D.trim().length > 0 ? D : void 0,
|
|
17640
17659
|
language_iso: u.current
|
|
@@ -17651,12 +17670,12 @@ function vg({
|
|
|
17651
17670
|
},
|
|
17652
17671
|
products: {
|
|
17653
17672
|
cacheKey: `locale:${i}`,
|
|
17654
|
-
list: async ({ search: D, cursor:
|
|
17673
|
+
list: async ({ search: D, cursor: R, limit: T }) => {
|
|
17655
17674
|
const I = D?.trim() ?? "", $ = I.length > 0 ? await d.searchProducts(I, {
|
|
17656
|
-
cursor:
|
|
17675
|
+
cursor: R ?? void 0,
|
|
17657
17676
|
limit: T
|
|
17658
17677
|
}) : await d.listProducts({
|
|
17659
|
-
cursor:
|
|
17678
|
+
cursor: R ?? void 0,
|
|
17660
17679
|
limit: T
|
|
17661
17680
|
});
|
|
17662
17681
|
return {
|
|
@@ -17679,10 +17698,10 @@ function vg({
|
|
|
17679
17698
|
// surface a non-functional one. Flip to true once the
|
|
17680
17699
|
// backend ships filter[title] support.
|
|
17681
17700
|
supportsSearch: !1,
|
|
17682
|
-
list: async ({ cursor: D, limit:
|
|
17701
|
+
list: async ({ cursor: D, limit: R }) => {
|
|
17683
17702
|
const T = await c.enrollmentPacksAdapter.listEnrollmentPacks({
|
|
17684
17703
|
cursor: D ?? void 0,
|
|
17685
|
-
limit:
|
|
17704
|
+
limit: R
|
|
17686
17705
|
});
|
|
17687
17706
|
return {
|
|
17688
17707
|
items: T.enrollment_packs.map(($) => ({
|
|
@@ -17697,10 +17716,10 @@ function vg({
|
|
|
17697
17716
|
}
|
|
17698
17717
|
}
|
|
17699
17718
|
},
|
|
17700
|
-
uploadThumbnail:
|
|
17719
|
+
uploadThumbnail: _ ? void 0 : async (D, R) => {
|
|
17701
17720
|
const I = (await m.createDamAsset({
|
|
17702
|
-
file: new File([D],
|
|
17703
|
-
name:
|
|
17721
|
+
file: new File([D], R, { type: D.type }),
|
|
17722
|
+
name: R
|
|
17704
17723
|
})).asset?.default_variant_url;
|
|
17705
17724
|
if (!I)
|
|
17706
17725
|
throw new Error("Thumbnail upload succeeded but no URL returned");
|
|
@@ -17713,7 +17732,7 @@ function vg({
|
|
|
17713
17732
|
i,
|
|
17714
17733
|
g,
|
|
17715
17734
|
m,
|
|
17716
|
-
|
|
17735
|
+
_,
|
|
17717
17736
|
a,
|
|
17718
17737
|
c.playlistsAdapter,
|
|
17719
17738
|
c.pagesAdapter,
|
|
@@ -17803,7 +17822,7 @@ function kg({
|
|
|
17803
17822
|
}
|
|
17804
17823
|
const wl = [];
|
|
17805
17824
|
function Cg() {
|
|
17806
|
-
const t = Ae(), { isSuccess: s } =
|
|
17825
|
+
const t = Ae(), { isSuccess: s } = Lt({
|
|
17807
17826
|
...Xi(t, ""),
|
|
17808
17827
|
retry: !1
|
|
17809
17828
|
});
|