@wyxos/vibe 5.14.0 → 5.16.0
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/README.md +22 -0
- package/lib/components/MasonryFeed.vue.d.ts +3 -0
- package/lib/components/MediaCard.vue.d.ts +3 -0
- package/lib/components/ReelFeed.vue.d.ts +3 -0
- package/lib/components/ReelLayout.vue.d.ts +3 -0
- package/lib/components/VibeSurface.vue.d.ts +3 -1
- package/lib/components/useMediaLifecycle.d.ts +4 -1
- package/lib/components/useMediaReadiness.d.ts +2 -2
- package/lib/core/feed.d.ts +1 -1
- package/lib/core/masonryOptions.d.ts +4 -0
- package/lib/core/mediaFailure.d.ts +6 -0
- package/lib/index.cjs +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +399 -348
- package/lib/types.d.ts +3 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -48,7 +48,7 @@ function B(e) {
|
|
|
48
48
|
type: "image"
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function ee(e, t) {
|
|
52
52
|
return I(e.type, e.src) === "audio" ? t === "mobile" && e.mobile && I(e.mobile.type, e.mobile.src) === "audio" ? {
|
|
53
53
|
...e.mobile,
|
|
54
54
|
type: "audio"
|
|
@@ -57,27 +57,27 @@ function V(e, t) {
|
|
|
57
57
|
type: "audio"
|
|
58
58
|
} : z(e, t);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function V(e) {
|
|
61
61
|
return [e, ...e.items];
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function H(e, t) {
|
|
64
64
|
return Math.min(e.items.length, Math.max(0, t));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function U(e, t) {
|
|
67
|
+
return V(e)[H(e, t)] ?? e;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function W(e, t) {
|
|
70
70
|
return `${String(e)}:${t}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/core/runtime.ts
|
|
74
|
-
function
|
|
74
|
+
function G(e) {
|
|
75
75
|
return r(() => Object.freeze([...e.items]));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return n(
|
|
77
|
+
function K(e, t, n) {
|
|
78
|
+
return n(te(e, t.value)), O(() => te(e, t.value), n, { flush: "post" });
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function te(e, t = [...e.items]) {
|
|
81
81
|
return {
|
|
82
82
|
activeReelPostId: e.activeReelPostId,
|
|
83
83
|
autoScroll: { ...e.autoScroll },
|
|
@@ -107,17 +107,17 @@ function J(e, t = [...e.items]) {
|
|
|
107
107
|
}
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/components/GalleryFooter.vue?vue&type=script&setup=true&lang.ts
|
|
110
|
-
var
|
|
110
|
+
var q = {
|
|
111
111
|
key: 0,
|
|
112
112
|
class: "gallery-footer"
|
|
113
|
-
},
|
|
113
|
+
}, J = {
|
|
114
114
|
key: 0,
|
|
115
115
|
class: "load-more-status",
|
|
116
116
|
role: "status"
|
|
117
|
-
},
|
|
117
|
+
}, ne = ["disabled"], re = {
|
|
118
118
|
key: 2,
|
|
119
119
|
class: "end-feed"
|
|
120
|
-
},
|
|
120
|
+
}, ie = ["disabled"], ae = /* @__PURE__ */ d({
|
|
121
121
|
__name: "GalleryFooter",
|
|
122
122
|
props: {
|
|
123
123
|
canRetryEnd: { type: Boolean },
|
|
@@ -133,14 +133,14 @@ var Y = {
|
|
|
133
133
|
function i() {
|
|
134
134
|
n.loadMoreLocked || (n.hasNext ? r("loadMore") : r("retryEnd"));
|
|
135
135
|
}
|
|
136
|
-
return (t, n) => e.isLoading || e.hasError || e.hasNext && e.showLoadMore || !e.hasNext && e.canRetryEnd ? (b(), s("footer",
|
|
136
|
+
return (t, n) => e.isLoading || e.hasError || e.hasNext && e.showLoadMore || !e.hasNext && e.canRetryEnd ? (b(), s("footer", q, [e.isLoading ? (b(), s("p", J, " Loading more… ")) : e.hasError || e.hasNext && e.showLoadMore ? (b(), s("button", {
|
|
137
137
|
key: 1,
|
|
138
138
|
"data-test": "load-more",
|
|
139
139
|
class: "load-more-button",
|
|
140
140
|
type: "button",
|
|
141
141
|
disabled: e.loadMoreLocked,
|
|
142
142
|
onClick: i
|
|
143
|
-
}, T(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9,
|
|
143
|
+
}, T(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9, ne)) : (b(), s("div", re, [n[1] ||= c("p", {
|
|
144
144
|
class: "end-feed-message",
|
|
145
145
|
role: "status"
|
|
146
146
|
}, " You've reached the end. ", -1), c("button", {
|
|
@@ -149,9 +149,9 @@ var Y = {
|
|
|
149
149
|
type: "button",
|
|
150
150
|
disabled: e.loadMoreLocked,
|
|
151
151
|
onClick: n[0] ||= (e) => t.$emit("retryEnd")
|
|
152
|
-
}, " Check for more ", 8,
|
|
152
|
+
}, " Check for more ", 8, ie)]))])) : o("", !0);
|
|
153
153
|
}
|
|
154
|
-
}),
|
|
154
|
+
}), oe = /* @__PURE__ */ d({
|
|
155
155
|
__name: "FeedFooter",
|
|
156
156
|
props: {
|
|
157
157
|
actions: {},
|
|
@@ -188,7 +188,7 @@ var Y = {
|
|
|
188
188
|
"can-retry-end",
|
|
189
189
|
"show-load-more",
|
|
190
190
|
"state"
|
|
191
|
-
])) : (b(), a(
|
|
191
|
+
])) : (b(), a(ae, {
|
|
192
192
|
key: 1,
|
|
193
193
|
"can-retry-end": e.canRetryEnd,
|
|
194
194
|
"has-error": e.hasError,
|
|
@@ -207,7 +207,7 @@ var Y = {
|
|
|
207
207
|
"show-load-more"
|
|
208
208
|
]));
|
|
209
209
|
}
|
|
210
|
-
}),
|
|
210
|
+
}), se = ["role"], ce = { class: "gallery-status" }, le = /* @__PURE__ */ d({
|
|
211
211
|
__name: "FeedStatus",
|
|
212
212
|
props: {
|
|
213
213
|
actions: {},
|
|
@@ -221,7 +221,7 @@ var Y = {
|
|
|
221
221
|
return (n, u) => (b(), s("main", {
|
|
222
222
|
class: "gallery-shell",
|
|
223
223
|
role: r.state.error ? "alert" : r.state.isLoading || r.state.isLoadingMore ? "status" : void 0
|
|
224
|
-
}, [c("p",
|
|
224
|
+
}, [c("p", ce, [r.state.error ? (b(), s(e, { key: 0 }, [l(" Unable to load media. ")], 64)) : r.state.isLoading || r.state.isLoadingMore ? (b(), s(e, { key: 1 }, [l(" Loading media… ")], 64)) : (b(), s(e, { key: 2 }, [l(" No media found. ")], 64))]), t.feedFooter ? (b(), a(oe, {
|
|
225
225
|
key: 0,
|
|
226
226
|
actions: t.actions,
|
|
227
227
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -243,26 +243,26 @@ var Y = {
|
|
|
243
243
|
"is-loading",
|
|
244
244
|
"load-more-locked",
|
|
245
245
|
"state"
|
|
246
|
-
])) : o("", !0)], 8,
|
|
246
|
+
])) : o("", !0)], 8, se));
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
|
-
function
|
|
250
|
-
return e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
249
|
+
function Y(e, t = 240) {
|
|
250
|
+
return e.scrollHeight - e.scrollTop - e.clientHeight <= t;
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region src/core/masonry.ts
|
|
254
|
-
function
|
|
254
|
+
function X(e) {
|
|
255
255
|
let t = e.preview?.width ?? e.width, n = e.preview?.height ?? e.height;
|
|
256
256
|
return !t || !n || t <= 0 || n <= 0 ? 1 : n / t;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function Z(e) {
|
|
259
259
|
return e.reduce((t, n, r) => n < e[t] ? r : t, 0);
|
|
260
260
|
}
|
|
261
261
|
function ue(e) {
|
|
262
262
|
return Math.max(0, e.containerHeight) + Math.max(0, e.gap);
|
|
263
263
|
}
|
|
264
264
|
var de = .8, fe = .5;
|
|
265
|
-
function
|
|
265
|
+
function pe(e, t, n) {
|
|
266
266
|
let r = Math.max(0, n.viewportHeight);
|
|
267
267
|
if (r === 0) return [];
|
|
268
268
|
let i = n.scrollTop, a = i + r;
|
|
@@ -273,7 +273,7 @@ function Q(e, t, n) {
|
|
|
273
273
|
return o + fe >= s;
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Q(e, t) {
|
|
277
277
|
if (e <= 0) return null;
|
|
278
278
|
let n = Math.max(0, t.gap), r = Number.isFinite(t.additionalHeight) ? Math.max(0, t.additionalHeight ?? 0) : 0, i = Math.max(1, t.minColumnWidth), a = Math.max(1, Math.floor((e + n) / (i + n)));
|
|
279
279
|
return {
|
|
@@ -284,7 +284,7 @@ function pe(e, t) {
|
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
function me(e, t, n) {
|
|
287
|
-
let r =
|
|
287
|
+
let r = Z(t), i = n.itemWidth * X(e) + n.additionalHeight, a = {
|
|
288
288
|
x: r * (n.itemWidth + n.gap),
|
|
289
289
|
y: t[r],
|
|
290
290
|
width: n.itemWidth,
|
|
@@ -303,7 +303,7 @@ function ge(e, t) {
|
|
|
303
303
|
return e.length === 0 ? 0 : Math.max(0, Math.max(...e) - t);
|
|
304
304
|
}
|
|
305
305
|
function _e(e, t, n) {
|
|
306
|
-
let r =
|
|
306
|
+
let r = Q(t, n);
|
|
307
307
|
if (!r || e.length === 0) return {
|
|
308
308
|
columns: 0,
|
|
309
309
|
height: 0,
|
|
@@ -317,7 +317,7 @@ function _e(e, t, n) {
|
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
function ve(e, t, n, r, i, a) {
|
|
320
|
-
let o =
|
|
320
|
+
let o = Q(t, n);
|
|
321
321
|
if (!o || e.length === 0) return {
|
|
322
322
|
columns: 0,
|
|
323
323
|
height: 0,
|
|
@@ -333,7 +333,7 @@ function ve(e, t, n, r, i, a) {
|
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
335
|
function ye(e, t, n, r, i, a) {
|
|
336
|
-
let o =
|
|
336
|
+
let o = Q(t, n);
|
|
337
337
|
if (!o || e.length === 0) return {
|
|
338
338
|
columns: 0,
|
|
339
339
|
fromIndex: 0,
|
|
@@ -470,6 +470,10 @@ function Oe(e, t) {
|
|
|
470
470
|
return a === void 0 ? i : Math.min(i, a);
|
|
471
471
|
}
|
|
472
472
|
function ke(e) {
|
|
473
|
+
for (let t of ["bottomSpacePx", "loadMoreThresholdPx"]) {
|
|
474
|
+
let n = e?.[t];
|
|
475
|
+
if (n !== void 0 && (!Number.isFinite(n) || n < 0)) throw TypeError(`Vibe masonry ${t} must be a finite non-negative number.`);
|
|
476
|
+
}
|
|
473
477
|
if (e?.minColumnWidth !== void 0 && (!Number.isFinite(e.minColumnWidth) || e.minColumnWidth <= 0)) throw TypeError("Vibe masonry minColumnWidth must be a positive number.");
|
|
474
478
|
let t = e?.overscan;
|
|
475
479
|
if (t) {
|
|
@@ -779,7 +783,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
779
783
|
total: {}
|
|
780
784
|
},
|
|
781
785
|
setup(e) {
|
|
782
|
-
let t = e, n = r(() =>
|
|
786
|
+
let t = e, n = r(() => H(t.item, t.mediaIndex)), i = r(() => V(t.item)), o = r(() => U(t.item, n.value)), c = r(() => ({
|
|
783
787
|
height: `${t.region.height}px`,
|
|
784
788
|
paddingBlock: t.style?.paddingY === void 0 ? void 0 : `${t.style.paddingY}px`,
|
|
785
789
|
paddingInline: t.style?.paddingX === void 0 ? void 0 : `${t.style.paddingX}px`
|
|
@@ -997,7 +1001,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
997
1001
|
function St(e) {
|
|
998
1002
|
let t = w("next"), n = null, r = 0, i = !1, a = null, o = null;
|
|
999
1003
|
function s(n, r) {
|
|
1000
|
-
let i =
|
|
1004
|
+
let i = V(e.item()).length, a = (n + i) % i;
|
|
1001
1005
|
a !== e.mediaIndex() && (t.value = n < e.mediaIndex() ? "previous" : "next", e.onChange(a), r?.detail && r.detail > 0 && r.currentTarget?.blur());
|
|
1002
1006
|
}
|
|
1003
1007
|
function c() {
|
|
@@ -1010,7 +1014,7 @@ function St(e) {
|
|
|
1010
1014
|
return t === 1 ? e * 16 : t === 2 ? e * n : e;
|
|
1011
1015
|
}
|
|
1012
1016
|
function d(t) {
|
|
1013
|
-
if (
|
|
1017
|
+
if (V(e.item()).length <= 1) return;
|
|
1014
1018
|
let n = t.currentTarget, a = u(t.deltaX, t.deltaMode, n?.clientWidth || 1);
|
|
1015
1019
|
if (a === 0 || (t.preventDefault(), l(), i) || (r += a, Math.abs(r) < xt)) return;
|
|
1016
1020
|
let o = Math.sign(r);
|
|
@@ -1039,9 +1043,9 @@ function Dt(e, t) {
|
|
|
1039
1043
|
return `${t ? "timed" : "image"}:${e}`;
|
|
1040
1044
|
}
|
|
1041
1045
|
function Ot(e, t, n) {
|
|
1042
|
-
let r =
|
|
1046
|
+
let r = V(e);
|
|
1043
1047
|
if (r.length < 2) return [];
|
|
1044
|
-
let i =
|
|
1048
|
+
let i = H(e, t), a = [];
|
|
1045
1049
|
for (let e = 1; e < r.length; e += 1) {
|
|
1046
1050
|
let t = i + e, n = i - e;
|
|
1047
1051
|
t < r.length && a.push(t), n >= 0 && a.push(n);
|
|
@@ -1147,56 +1151,59 @@ function Ft(e) {
|
|
|
1147
1151
|
//#endregion
|
|
1148
1152
|
//#region src/components/useMediaReadiness.ts
|
|
1149
1153
|
function It(e) {
|
|
1150
|
-
let t = w(null), n = w(null), i = w(0), a = w(0), o = w(!0), s = w(!1), c = w(!1), l = null, u = !1, d = r(() => c.value || s.value ? "error" : o.value ? "loading" : e.previewState());
|
|
1151
|
-
function
|
|
1154
|
+
let t = w(null), n = w(null), i = w(0), a = w(0), o = w(!0), s = w(!1), c = w(!1), l = null, u = !1, d = !1, f = !1, p = r(() => c.value || s.value ? "error" : o.value ? "loading" : e.previewState());
|
|
1155
|
+
function h() {
|
|
1152
1156
|
l !== null && clearTimeout(l), l = null;
|
|
1153
1157
|
}
|
|
1154
|
-
function
|
|
1158
|
+
function g(e) {
|
|
1155
1159
|
return Number(e.currentTarget.dataset.sourceGeneration) === i.value;
|
|
1156
1160
|
}
|
|
1157
|
-
function
|
|
1158
|
-
|
|
1161
|
+
function _() {
|
|
1162
|
+
h(), l = setTimeout(() => x(), 15e3);
|
|
1159
1163
|
}
|
|
1160
|
-
function
|
|
1161
|
-
t && !
|
|
1164
|
+
function y(t) {
|
|
1165
|
+
t && !g(t) || (h(), o.value = !1, s.value = !1, c.value = !1, e.onReady(e.mediaIndex()));
|
|
1162
1166
|
}
|
|
1163
|
-
function
|
|
1167
|
+
function b() {
|
|
1168
|
+
if (f) return;
|
|
1164
1169
|
let e = t.value;
|
|
1165
1170
|
if (e?.complete) {
|
|
1166
|
-
e.naturalWidth > 0 ?
|
|
1171
|
+
e.naturalWidth > 0 ? y() : x(void 0, !0);
|
|
1167
1172
|
return;
|
|
1168
1173
|
}
|
|
1169
1174
|
let r = n.value;
|
|
1170
1175
|
if (r && r.readyState >= HTMLMediaElement.HAVE_METADATA) {
|
|
1171
|
-
|
|
1176
|
+
y();
|
|
1172
1177
|
return;
|
|
1173
1178
|
}
|
|
1174
|
-
|
|
1179
|
+
_();
|
|
1175
1180
|
}
|
|
1176
|
-
function
|
|
1177
|
-
if (!(t && !
|
|
1178
|
-
if (
|
|
1179
|
-
a.value = 1, i.value += 1, o.value = !0, m(
|
|
1181
|
+
function x(t, n = !1) {
|
|
1182
|
+
if (!f && !(t && !g(t)) && !(s.value && !c.value && (!t || d))) {
|
|
1183
|
+
if (h(), !t && a.value === 0) {
|
|
1184
|
+
a.value = 1, i.value += 1, o.value = !0, m(b);
|
|
1180
1185
|
return;
|
|
1181
1186
|
}
|
|
1182
|
-
o.value = !1, s.value = !0, c.value = !1, e.onError(e.mediaIndex());
|
|
1187
|
+
o.value = !1, s.value = !0, c.value = !1, d = !!t || n, e.onError(e.mediaIndex(), d);
|
|
1183
1188
|
}
|
|
1184
1189
|
}
|
|
1185
|
-
function
|
|
1186
|
-
c.value ||
|
|
1190
|
+
function S() {
|
|
1191
|
+
c.value || p.value !== "error" || (d = !1, a.value = 0, s.value = !0, o.value = !0, c.value = !0, i.value += 1, m(b));
|
|
1187
1192
|
}
|
|
1188
|
-
function
|
|
1189
|
-
|
|
1193
|
+
function C(e) {
|
|
1194
|
+
g(e) && o.value && _();
|
|
1190
1195
|
}
|
|
1191
1196
|
return O(e.identity, () => {
|
|
1192
|
-
|
|
1193
|
-
}, { immediate: !0 }), v(
|
|
1194
|
-
|
|
1195
|
-
|
|
1197
|
+
h(), i.value += 1, d = !1, a.value = 0, o.value = u || e.previewState() === "loading", s.value = !1, c.value = !1, u = !0, m(b);
|
|
1198
|
+
}, { immediate: !0 }), v(() => {
|
|
1199
|
+
f = !0, h();
|
|
1200
|
+
}), {
|
|
1201
|
+
effectivePreviewState: p,
|
|
1202
|
+
failSourceAttempt: x,
|
|
1196
1203
|
imageElement: t,
|
|
1197
|
-
markSourceReady:
|
|
1198
|
-
noteSourceActivity:
|
|
1199
|
-
retrySource:
|
|
1204
|
+
markSourceReady: y,
|
|
1205
|
+
noteSourceActivity: C,
|
|
1206
|
+
retrySource: S,
|
|
1200
1207
|
retrying: c,
|
|
1201
1208
|
sourceGeneration: i,
|
|
1202
1209
|
mediaElement: n
|
|
@@ -1394,6 +1401,8 @@ var Wt = [
|
|
|
1394
1401
|
"muted",
|
|
1395
1402
|
"preload"
|
|
1396
1403
|
], Xt = ["aria-label", "disabled"], Zt = [
|
|
1404
|
+
"data-cover-identity",
|
|
1405
|
+
"data-source-generation",
|
|
1397
1406
|
"src",
|
|
1398
1407
|
"width",
|
|
1399
1408
|
"height",
|
|
@@ -1449,6 +1458,7 @@ var Wt = [
|
|
|
1449
1458
|
"activate",
|
|
1450
1459
|
"ended",
|
|
1451
1460
|
"error",
|
|
1461
|
+
"mediaError",
|
|
1452
1462
|
"mediaChange",
|
|
1453
1463
|
"ready",
|
|
1454
1464
|
"reelAudioChange"
|
|
@@ -1458,10 +1468,18 @@ var Wt = [
|
|
|
1458
1468
|
function f(e = !1, t = "pointer") {
|
|
1459
1469
|
e && d("activate", t);
|
|
1460
1470
|
}
|
|
1461
|
-
let p = r(() =>
|
|
1471
|
+
let p = r(() => V(l.item)), g = r(() => H(l.item, l.mediaIndex)), v = r(() => U(l.item, g.value)), y = r(() => z(v.value, l.mediaSource ?? "preview")), x = r(() => I(v.value.type, v.value.src)), S = r(() => x.value === "audio"), C = r(() => ee(v.value, l.mediaSource ?? "preview")), T = r(() => S.value ? C.value : y.value), D = r(() => T.value.src), M = r(() => I(T.value.type, T.value.src)), N = r(() => y.value.width), P = r(() => y.value.height), F = r(() => B(v.value)), L = r(() => `${l.item.postId}:${g.value}:${F.value?.src ?? ""}`), R = w(!1), W = r(() => R.value ? null : F.value), { effectivePreviewState: G, failSourceAttempt: K, imageElement: te, markSourceReady: q, noteSourceActivity: J, retrySource: ne, retrying: re, sourceGeneration: ie, mediaElement: ae } = It({
|
|
1462
1472
|
identity: () => `${l.item.postId}:${g.value}:${l.mediaSource ?? "preview"}:${D.value}:${M.value ?? ""}`,
|
|
1463
1473
|
mediaIndex: () => g.value,
|
|
1464
|
-
onError: (e) =>
|
|
1474
|
+
onError: (e, t) => {
|
|
1475
|
+
if (d("error", e), !t) return;
|
|
1476
|
+
let n = l.mediaSource ?? "preview";
|
|
1477
|
+
d("mediaError", {
|
|
1478
|
+
mediaIndex: e,
|
|
1479
|
+
source: n === "preview" && !S.value && v.value.preview ? "preview" : n === "mobile" && D.value === v.value.mobile?.src ? "mobile" : "original",
|
|
1480
|
+
src: D.value
|
|
1481
|
+
});
|
|
1482
|
+
},
|
|
1465
1483
|
onReady: (e) => d("ready", e),
|
|
1466
1484
|
previewState: () => l.previewState
|
|
1467
1485
|
});
|
|
@@ -1474,47 +1492,51 @@ var Wt = [
|
|
|
1474
1492
|
mediaReady: () => G.value === "ready",
|
|
1475
1493
|
mediaSource: () => l.mediaSource ?? "preview"
|
|
1476
1494
|
});
|
|
1477
|
-
let { currentTime:
|
|
1495
|
+
let { currentTime: oe, duration: se, effectiveMuted: ce, isMuted: le, isPlaying: Y, onEnded: X, onLoadedMetadata: Z, onPlaying: ue, playbackAllowed: de, seek: fe, setVolume: pe, sync: Q, toggleMute: me, togglePlayback: he, volume: ge } = Ut({
|
|
1478
1496
|
active: () => l.active,
|
|
1479
1497
|
inViewport: () => l.inViewport === !0,
|
|
1480
1498
|
layout: () => l.layout,
|
|
1481
1499
|
mediaCard: () => l.mediaCard,
|
|
1482
|
-
mediaElement:
|
|
1500
|
+
mediaElement: ae,
|
|
1483
1501
|
onAudioChange: (e) => d("reelAudioChange", e),
|
|
1484
1502
|
onEnded: () => d("ended", g.value),
|
|
1485
|
-
onReady:
|
|
1503
|
+
onReady: q,
|
|
1486
1504
|
reelAudioState: () => l.reelAudioState
|
|
1487
|
-
}),
|
|
1488
|
-
function
|
|
1505
|
+
}), _e = r(() => l.interactive && !!(l.cardHeader || l.cardFooter));
|
|
1506
|
+
function ve(e) {
|
|
1489
1507
|
return e.detail === 0 ? "keyboard" : "pointer";
|
|
1490
1508
|
}
|
|
1491
|
-
let { change:
|
|
1509
|
+
let { change: ye, direction: be, onTouchEnd: xe, onTouchStart: Se, onWheel: Ce } = St({
|
|
1492
1510
|
item: () => l.item,
|
|
1493
1511
|
layout: () => l.layout,
|
|
1494
1512
|
mediaIndex: () => g.value,
|
|
1495
1513
|
onChange: (e) => d("mediaChange", e)
|
|
1496
|
-
}), { imageLoading:
|
|
1514
|
+
}), { imageLoading: we, mediaIsTimed: Te, timedMediaPreload: Ee } = Ft({
|
|
1497
1515
|
active: () => l.active,
|
|
1498
1516
|
fetchPriority: () => l.fetchPriority,
|
|
1499
1517
|
layout: () => l.layout,
|
|
1500
1518
|
mediaSource: () => D.value,
|
|
1501
1519
|
mediaType: () => M.value,
|
|
1502
|
-
mediaElement:
|
|
1503
|
-
}),
|
|
1504
|
-
function
|
|
1505
|
-
l.layout === "reel" && (e.stopPropagation(),
|
|
1520
|
+
mediaElement: ae
|
|
1521
|
+
}), De = r(() => l.layout === "reel" && l.stationaryReelControls === !0), Oe = r(() => Te.value && (!S.value || l.layout === "reel") && G.value === "ready" && (!De.value || !!(l.active && l.reelControlsTarget))), ke = r(() => `${l.item.postId}:${g.value}:${D.value}`);
|
|
1522
|
+
function Ae(e) {
|
|
1523
|
+
l.layout === "reel" && (e.stopPropagation(), he());
|
|
1506
1524
|
}
|
|
1507
|
-
function
|
|
1508
|
-
L.value
|
|
1525
|
+
function je(e) {
|
|
1526
|
+
e.currentTarget.dataset.coverIdentity !== L.value || R.value || (d("mediaError", {
|
|
1527
|
+
mediaIndex: g.value,
|
|
1528
|
+
source: "preview",
|
|
1529
|
+
src: F.value?.src ?? ""
|
|
1530
|
+
}), R.value = !0, l.layout === "masonry" && q());
|
|
1509
1531
|
}
|
|
1510
|
-
return O(
|
|
1511
|
-
|
|
1532
|
+
return O(L, () => {
|
|
1533
|
+
R.value = !1;
|
|
1512
1534
|
}), O([
|
|
1513
1535
|
S,
|
|
1514
1536
|
() => l.layout,
|
|
1515
|
-
|
|
1537
|
+
W
|
|
1516
1538
|
], ([e, t, n]) => {
|
|
1517
|
-
e && t === "masonry" && !n && m(() =>
|
|
1539
|
+
e && t === "masonry" && !n && m(() => q());
|
|
1518
1540
|
}, { immediate: !0 }), (r, i) => (b(), s("article", {
|
|
1519
1541
|
"data-post-id": e.item.postId,
|
|
1520
1542
|
"data-media-index": g.value,
|
|
@@ -1526,12 +1548,12 @@ var Wt = [
|
|
|
1526
1548
|
}]),
|
|
1527
1549
|
style: _(e.itemStyle),
|
|
1528
1550
|
"aria-hidden": e.leaving || void 0,
|
|
1529
|
-
"aria-busy": E(G) === "loading" || E(
|
|
1551
|
+
"aria-busy": E(G) === "loading" || E(re),
|
|
1530
1552
|
inert: e.leaving || void 0,
|
|
1531
|
-
role: e.interactive && !e.leaving && !
|
|
1532
|
-
tabindex: e.interactive && !e.leaving && !
|
|
1533
|
-
onClick: i[34] ||= (t) => f(e.interactive && !
|
|
1534
|
-
onKeydown: [i[35] ||= A((t) => f(e.interactive && !
|
|
1553
|
+
role: e.interactive && !e.leaving && !_e.value ? "button" : void 0,
|
|
1554
|
+
tabindex: e.interactive && !e.leaving && !_e.value ? 0 : void 0,
|
|
1555
|
+
onClick: i[34] ||= (t) => f(e.interactive && !_e.value, ve(t)),
|
|
1556
|
+
onKeydown: [i[35] ||= A((t) => f(e.interactive && !_e.value, "keyboard"), ["enter"]), i[36] ||= A(j((t) => f(e.interactive && !_e.value, "keyboard"), ["prevent"]), ["space"])]
|
|
1535
1557
|
}, [c("div", Gt, [
|
|
1536
1558
|
e.cardHeader ? (b(), a(rt, {
|
|
1537
1559
|
key: 0,
|
|
@@ -1558,17 +1580,17 @@ var Wt = [
|
|
|
1558
1580
|
])) : o("", !0),
|
|
1559
1581
|
c("div", {
|
|
1560
1582
|
class: h(["media-card-media", { "media-card-media--carousel": e.layout === "reel" && p.value.length > 1 }]),
|
|
1561
|
-
"data-media-direction": E(
|
|
1562
|
-
onWheel: i[31] ||= (...e) => E(
|
|
1563
|
-
onTouchstartPassive: i[32] ||= (...e) => E(
|
|
1564
|
-
onTouchendPassive: i[33] ||= (...e) => E(
|
|
1583
|
+
"data-media-direction": E(be),
|
|
1584
|
+
onWheel: i[31] ||= (...e) => E(Ce) && E(Ce)(...e),
|
|
1585
|
+
onTouchstartPassive: i[32] ||= (...e) => E(Se) && E(Se)(...e),
|
|
1586
|
+
onTouchendPassive: i[33] ||= (...e) => E(xe) && E(xe)(...e)
|
|
1565
1587
|
}, [
|
|
1566
1588
|
u(n, {
|
|
1567
|
-
css: !E(
|
|
1568
|
-
name: `media-slide-${E(
|
|
1589
|
+
css: !E(re),
|
|
1590
|
+
name: `media-slide-${E(be)}`
|
|
1569
1591
|
}, {
|
|
1570
1592
|
default: k(() => [(b(), s("div", {
|
|
1571
|
-
key: `${e.item.postId}:${v.value.src}:${e.mediaSource ?? "preview"}:${E(
|
|
1593
|
+
key: `${e.item.postId}:${v.value.src}:${e.mediaSource ?? "preview"}:${E(ie)}`,
|
|
1572
1594
|
class: "media-card-frame",
|
|
1573
1595
|
"data-media-index": g.value
|
|
1574
1596
|
}, [
|
|
@@ -1576,9 +1598,9 @@ var Wt = [
|
|
|
1576
1598
|
key: 1,
|
|
1577
1599
|
component: e.mediaCard?.error?.component,
|
|
1578
1600
|
label: E(nt)(D.value),
|
|
1579
|
-
retrying: E(
|
|
1601
|
+
retrying: E(re),
|
|
1580
1602
|
status: E(tt)(D.value),
|
|
1581
|
-
onRetry: E(
|
|
1603
|
+
onRetry: E(ne)
|
|
1582
1604
|
}, null, 8, [
|
|
1583
1605
|
"component",
|
|
1584
1606
|
"label",
|
|
@@ -1589,53 +1611,55 @@ var Wt = [
|
|
|
1589
1611
|
S.value && e.layout === "reel" ? (b(), s("audio", {
|
|
1590
1612
|
key: 2,
|
|
1591
1613
|
ref_key: "mediaElement",
|
|
1592
|
-
ref:
|
|
1593
|
-
"data-source-generation": E(
|
|
1614
|
+
ref: ae,
|
|
1615
|
+
"data-source-generation": E(ie),
|
|
1594
1616
|
class: "media-audio-element",
|
|
1595
1617
|
src: D.value,
|
|
1596
|
-
autoplay: E(
|
|
1618
|
+
autoplay: E(de),
|
|
1597
1619
|
loop: !e.advanceOnMediaEnd,
|
|
1598
|
-
muted: E(
|
|
1599
|
-
preload: E(
|
|
1620
|
+
muted: E(ce),
|
|
1621
|
+
preload: E(Ee),
|
|
1600
1622
|
onLoadedmetadata: i[0] ||= (...e) => E(Z) && E(Z)(...e),
|
|
1601
|
-
onProgress: i[1] ||= (...e) => E(
|
|
1602
|
-
onLoadeddata: i[2] ||= (...e) => E(
|
|
1603
|
-
onCanplay: i[3] ||= (...e) => E(
|
|
1623
|
+
onProgress: i[1] ||= (...e) => E(J) && E(J)(...e),
|
|
1624
|
+
onLoadeddata: i[2] ||= (...e) => E(J) && E(J)(...e),
|
|
1625
|
+
onCanplay: i[3] ||= (...e) => E(J) && E(J)(...e),
|
|
1604
1626
|
onDurationchange: i[4] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1605
1627
|
onTimeupdate: i[5] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1606
1628
|
onVolumechange: i[6] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1607
|
-
onPlaying: i[7] ||= (...e) => E(
|
|
1608
|
-
onPause: i[8] ||= (e) =>
|
|
1609
|
-
onEnded: i[9] ||= (...e) => E(
|
|
1629
|
+
onPlaying: i[7] ||= (...e) => E(ue) && E(ue)(...e),
|
|
1630
|
+
onPause: i[8] ||= (e) => Y.value = !1,
|
|
1631
|
+
onEnded: i[9] ||= (...e) => E(X) && E(X)(...e),
|
|
1610
1632
|
onError: i[10] ||= (...e) => E(K) && E(K)(...e)
|
|
1611
1633
|
}, null, 40, Yt)) : o("", !0),
|
|
1612
1634
|
S.value ? (b(), s("button", {
|
|
1613
1635
|
key: 3,
|
|
1614
1636
|
type: "button",
|
|
1615
1637
|
class: h(["media-audio-artwork media-preview", { "media-preview--ready": E(G) === "ready" }]),
|
|
1616
|
-
"aria-label": e.layout === "reel" ? E(
|
|
1638
|
+
"aria-label": e.layout === "reel" ? E(Y) ? "Pause audio" : "Play audio" : "Audio",
|
|
1617
1639
|
disabled: e.layout !== "reel",
|
|
1618
|
-
onClick:
|
|
1619
|
-
}, [
|
|
1620
|
-
key:
|
|
1640
|
+
onClick: Ae
|
|
1641
|
+
}, [W.value ? (b(), s("img", {
|
|
1642
|
+
key: L.value,
|
|
1643
|
+
"data-cover-identity": L.value,
|
|
1644
|
+
"data-source-generation": E(ie),
|
|
1621
1645
|
class: "media-audio-cover",
|
|
1622
|
-
src:
|
|
1623
|
-
width:
|
|
1624
|
-
height:
|
|
1646
|
+
src: W.value.src,
|
|
1647
|
+
width: W.value.width ?? void 0,
|
|
1648
|
+
height: W.value.height ?? void 0,
|
|
1625
1649
|
fetchpriority: e.fetchPriority,
|
|
1626
1650
|
alt: "",
|
|
1627
1651
|
decoding: "async",
|
|
1628
|
-
loading: E(
|
|
1629
|
-
onLoad: i[11] ||= (t) => e.layout === "masonry" && E(
|
|
1630
|
-
onError:
|
|
1652
|
+
loading: E(we),
|
|
1653
|
+
onLoad: i[11] ||= (t) => e.layout === "masonry" && E(q)(t),
|
|
1654
|
+
onError: je
|
|
1631
1655
|
}, null, 40, Zt)) : (b(), s("span", Qt, [u(E(Ye), {
|
|
1632
1656
|
size: 64,
|
|
1633
1657
|
"stroke-width": 1.5
|
|
1634
|
-
})]))], 10, Xt)) : E(
|
|
1658
|
+
})]))], 10, Xt)) : E(Te) ? (b(), s("video", {
|
|
1635
1659
|
key: 4,
|
|
1636
1660
|
ref_key: "mediaElement",
|
|
1637
|
-
ref:
|
|
1638
|
-
"data-source-generation": E(
|
|
1661
|
+
ref: ae,
|
|
1662
|
+
"data-source-generation": E(ie),
|
|
1639
1663
|
class: h(["media-preview", {
|
|
1640
1664
|
"media-preview--ready": E(G) === "ready",
|
|
1641
1665
|
"media-preview--reel-video": e.layout === "reel"
|
|
@@ -1643,28 +1667,28 @@ var Wt = [
|
|
|
1643
1667
|
src: D.value,
|
|
1644
1668
|
width: N.value ?? void 0,
|
|
1645
1669
|
height: P.value ?? void 0,
|
|
1646
|
-
autoplay: E(
|
|
1670
|
+
autoplay: E(de),
|
|
1647
1671
|
loop: !e.advanceOnMediaEnd,
|
|
1648
|
-
muted: E(
|
|
1672
|
+
muted: E(ce),
|
|
1649
1673
|
playsinline: "",
|
|
1650
|
-
preload: E(
|
|
1674
|
+
preload: E(Ee),
|
|
1651
1675
|
onLoadedmetadata: i[12] ||= (...e) => E(Z) && E(Z)(...e),
|
|
1652
|
-
onProgress: i[13] ||= (...e) => E(
|
|
1653
|
-
onLoadeddata: i[14] ||= (...e) => E(
|
|
1654
|
-
onCanplay: i[15] ||= (...e) => E(
|
|
1676
|
+
onProgress: i[13] ||= (...e) => E(J) && E(J)(...e),
|
|
1677
|
+
onLoadeddata: i[14] ||= (...e) => E(J) && E(J)(...e),
|
|
1678
|
+
onCanplay: i[15] ||= (...e) => E(J) && E(J)(...e),
|
|
1655
1679
|
onDurationchange: i[16] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1656
1680
|
onTimeupdate: i[17] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1657
1681
|
onVolumechange: i[18] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1658
|
-
onPlaying: i[19] ||= (...e) => E(
|
|
1659
|
-
onPause: i[20] ||= (e) =>
|
|
1660
|
-
onEnded: i[21] ||= (...e) => E(
|
|
1661
|
-
onClick:
|
|
1682
|
+
onPlaying: i[19] ||= (...e) => E(ue) && E(ue)(...e),
|
|
1683
|
+
onPause: i[20] ||= (e) => Y.value = !1,
|
|
1684
|
+
onEnded: i[21] ||= (...e) => E(X) && E(X)(...e),
|
|
1685
|
+
onClick: Ae,
|
|
1662
1686
|
onError: i[22] ||= (...e) => E(K) && E(K)(...e)
|
|
1663
1687
|
}, null, 42, $t)) : S.value ? o("", !0) : (b(), s("img", {
|
|
1664
1688
|
key: 5,
|
|
1665
1689
|
ref_key: "imageElement",
|
|
1666
|
-
ref:
|
|
1667
|
-
"data-source-generation": E(
|
|
1690
|
+
ref: te,
|
|
1691
|
+
"data-source-generation": E(ie),
|
|
1668
1692
|
class: h(["media-preview", { "media-preview--ready": E(G) === "ready" }]),
|
|
1669
1693
|
src: D.value,
|
|
1670
1694
|
width: N.value ?? void 0,
|
|
@@ -1672,8 +1696,8 @@ var Wt = [
|
|
|
1672
1696
|
fetchpriority: e.fetchPriority,
|
|
1673
1697
|
alt: "",
|
|
1674
1698
|
decoding: "async",
|
|
1675
|
-
loading: E(
|
|
1676
|
-
onLoad: i[23] ||= (...e) => E(
|
|
1699
|
+
loading: E(we),
|
|
1700
|
+
onLoad: i[23] ||= (...e) => E(q) && E(q)(...e),
|
|
1677
1701
|
onError: i[24] ||= (...e) => E(K) && E(K)(...e)
|
|
1678
1702
|
}, null, 42, en))
|
|
1679
1703
|
], 8, qt))]),
|
|
@@ -1693,26 +1717,26 @@ var Wt = [
|
|
|
1693
1717
|
"media-source"
|
|
1694
1718
|
]),
|
|
1695
1719
|
(b(), a(t, {
|
|
1696
|
-
disabled: !
|
|
1720
|
+
disabled: !De.value || !e.reelControlsTarget,
|
|
1697
1721
|
to: e.reelControlsTarget ?? "body"
|
|
1698
1722
|
}, [u(n, {
|
|
1699
1723
|
name: "vibe-reel-media-controls",
|
|
1700
|
-
css:
|
|
1724
|
+
css: De.value
|
|
1701
1725
|
}, {
|
|
1702
|
-
default: k(() => [
|
|
1703
|
-
key:
|
|
1704
|
-
"current-time": E(
|
|
1705
|
-
"data-control-post-id":
|
|
1706
|
-
duration: E(
|
|
1726
|
+
default: k(() => [Oe.value ? (b(), a(gt, {
|
|
1727
|
+
key: ke.value,
|
|
1728
|
+
"current-time": E(oe),
|
|
1729
|
+
"data-control-post-id": De.value ? e.item.postId : void 0,
|
|
1730
|
+
duration: E(se),
|
|
1707
1731
|
layout: e.layout,
|
|
1708
1732
|
"media-type": S.value ? "audio" : "video",
|
|
1709
|
-
muted: E(
|
|
1710
|
-
playing: E(
|
|
1711
|
-
volume: E(
|
|
1712
|
-
onSeek: E(
|
|
1713
|
-
onToggleMute: E(
|
|
1714
|
-
onTogglePlayback: E(
|
|
1715
|
-
onVolumeChange: E(
|
|
1733
|
+
muted: E(le),
|
|
1734
|
+
playing: E(Y),
|
|
1735
|
+
volume: E(ge),
|
|
1736
|
+
onSeek: E(fe),
|
|
1737
|
+
onToggleMute: E(me),
|
|
1738
|
+
onTogglePlayback: E(he),
|
|
1739
|
+
onVolumeChange: E(pe)
|
|
1716
1740
|
}, null, 8, [
|
|
1717
1741
|
"current-time",
|
|
1718
1742
|
"data-control-post-id",
|
|
@@ -1737,21 +1761,21 @@ var Wt = [
|
|
|
1737
1761
|
type: "button",
|
|
1738
1762
|
class: "media-carousel-control media-carousel-control--previous",
|
|
1739
1763
|
"aria-label": `Previous media for post ${e.item.postId}`,
|
|
1740
|
-
onClick: i[25] ||= j((e) => E(
|
|
1764
|
+
onClick: i[25] ||= j((e) => E(ye)(g.value - 1, e), ["stop"]),
|
|
1741
1765
|
onKeydown: i[26] ||= j(() => {}, ["stop"])
|
|
1742
1766
|
}, [u(E(qe), { size: 20 })], 40, tn), c("button", {
|
|
1743
1767
|
type: "button",
|
|
1744
1768
|
class: "media-carousel-control media-carousel-control--next",
|
|
1745
1769
|
"aria-label": `Next media for post ${e.item.postId}`,
|
|
1746
|
-
onClick: i[27] ||= j((e) => E(
|
|
1770
|
+
onClick: i[27] ||= j((e) => E(ye)(g.value + 1, e), ["stop"]),
|
|
1747
1771
|
onKeydown: i[28] ||= j(() => {}, ["stop"])
|
|
1748
1772
|
}, [u(E(Je), { size: 20 })], 40, nn)], 2)) : o("", !0),
|
|
1749
|
-
|
|
1773
|
+
_e.value ? (b(), s("button", {
|
|
1750
1774
|
key: 1,
|
|
1751
1775
|
class: "media-card-activator",
|
|
1752
1776
|
type: "button",
|
|
1753
1777
|
"aria-label": `Open post ${e.item.postId}`,
|
|
1754
|
-
onClick: i[29] ||= j((e) => r.$emit("activate",
|
|
1778
|
+
onClick: i[29] ||= j((e) => r.$emit("activate", ve(e)), ["stop"]),
|
|
1755
1779
|
onKeydown: i[30] ||= j(() => {}, ["stop"])
|
|
1756
1780
|
}, null, 40, rn)) : o("", !0)
|
|
1757
1781
|
], 42, Kt),
|
|
@@ -1788,7 +1812,7 @@ function on(e) {
|
|
|
1788
1812
|
return t.flatMap((t) => {
|
|
1789
1813
|
let n = e.items()[t];
|
|
1790
1814
|
if (!n) return [];
|
|
1791
|
-
let r = e.mediaIndices().get(n.postId) ?? 0, i =
|
|
1815
|
+
let r = e.mediaIndices().get(n.postId) ?? 0, i = W(n.postId, r);
|
|
1792
1816
|
return e.previewStates().get(i) === "ready" ? [{
|
|
1793
1817
|
key: i,
|
|
1794
1818
|
mediaIndex: r,
|
|
@@ -1911,6 +1935,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1911
1935
|
emits: [
|
|
1912
1936
|
"activate",
|
|
1913
1937
|
"error",
|
|
1938
|
+
"mediaError",
|
|
1914
1939
|
"fullyVisible",
|
|
1915
1940
|
"loadMore",
|
|
1916
1941
|
"mediaChange",
|
|
@@ -1931,53 +1956,53 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1931
1956
|
}, 0);
|
|
1932
1957
|
return Math.max(e, t);
|
|
1933
1958
|
}
|
|
1934
|
-
function
|
|
1959
|
+
function ee() {
|
|
1935
1960
|
return M.value.reduce((e, t) => Math.max(e, t), -1);
|
|
1936
1961
|
}
|
|
1937
|
-
let
|
|
1962
|
+
let V = cn({
|
|
1938
1963
|
additionalHeight: r(() => R.value.additionalHeight),
|
|
1939
1964
|
gap: x,
|
|
1940
1965
|
items: () => d.items,
|
|
1941
1966
|
minColumnWidth: r(() => R.value.minColumnWidth),
|
|
1942
|
-
packThroughIndex:
|
|
1967
|
+
packThroughIndex: ee,
|
|
1943
1968
|
packUntilBottom: B,
|
|
1944
1969
|
width: y
|
|
1945
|
-
}),
|
|
1946
|
-
throughIndex:
|
|
1970
|
+
}), H = V.layout, U = V.viewportIndex, G = r(() => d.leavingPostIds.size === 0 ? null : ye(d.items, y.value, R.value, H.value, (e) => d.leavingPostIds.has(d.items[e].postId), {
|
|
1971
|
+
throughIndex: ee(),
|
|
1947
1972
|
untilBottom: B()
|
|
1948
|
-
})),
|
|
1949
|
-
let e =
|
|
1973
|
+
})), K = r(() => {
|
|
1974
|
+
let e = G.value;
|
|
1950
1975
|
return e ? {
|
|
1951
1976
|
columns: e.columns,
|
|
1952
1977
|
height: e.height,
|
|
1953
1978
|
items: e.items
|
|
1954
|
-
} :
|
|
1955
|
-
}),
|
|
1956
|
-
let e =
|
|
1957
|
-
return e ? we(e.items, e.retainedIndices,
|
|
1958
|
-
}),
|
|
1959
|
-
let t = d.items[e], n =
|
|
1979
|
+
} : H.value;
|
|
1980
|
+
}), te = r(() => {
|
|
1981
|
+
let e = G.value;
|
|
1982
|
+
return e ? we(e.items, e.retainedIndices, U.value, e.fromIndex) : null;
|
|
1983
|
+
}), q = r(() => (H.value, Math.max(T.value, V.reservedHeight(), d.leavingPostIds.size === 0 ? K.value.height : H.value.height))), J = r(() => ({ height: `${q.value}px` })), ne = r(() => !d.infiniteScroll || C.value > 0 && k.value + K.value.height <= C.value + 1), re = r(() => new Set(j.value)), ie = r(() => M.value.flatMap((e) => {
|
|
1984
|
+
let t = d.items[e], n = K.value.items[e];
|
|
1960
1985
|
return !t || !n || n.width <= 0 || n.height <= 0 ? [] : [{
|
|
1961
|
-
fetchPriority:
|
|
1986
|
+
fetchPriority: re.value.has(e) ? "high" : "low",
|
|
1962
1987
|
index: e,
|
|
1963
1988
|
item: t
|
|
1964
1989
|
}];
|
|
1965
1990
|
}));
|
|
1966
|
-
function
|
|
1991
|
+
function ae(e, t) {
|
|
1967
1992
|
return [...new Set([...e, ...t])].sort((e, t) => e - t);
|
|
1968
1993
|
}
|
|
1969
|
-
function
|
|
1994
|
+
function se(e, t) {
|
|
1970
1995
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
1971
1996
|
}
|
|
1972
|
-
function
|
|
1997
|
+
function ce(e) {
|
|
1973
1998
|
let t = {
|
|
1974
1999
|
scrollTop: N - k.value,
|
|
1975
2000
|
viewportHeight: C.value
|
|
1976
|
-
}, n =
|
|
2001
|
+
}, n = te.value, r = Ee(n ?? U.value, {
|
|
1977
2002
|
...t,
|
|
1978
2003
|
overscan: e
|
|
1979
2004
|
}).indices;
|
|
1980
|
-
return
|
|
2005
|
+
return ae(r, d.leavingPostIds.size === 0 ? [] : Ee(U.value, {
|
|
1981
2006
|
...t,
|
|
1982
2007
|
overscan: e
|
|
1983
2008
|
}).indices.filter((e) => {
|
|
@@ -1985,23 +2010,23 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1985
2010
|
return t !== void 0 && d.leavingPostIds.has(t.postId);
|
|
1986
2011
|
}));
|
|
1987
2012
|
}
|
|
1988
|
-
function
|
|
1989
|
-
let e =
|
|
1990
|
-
|
|
1991
|
-
let n =
|
|
2013
|
+
function le() {
|
|
2014
|
+
let e = ce(0), t = ce(Oe(d.masonry, C.value));
|
|
2015
|
+
se(j.value, e) || (j.value = e);
|
|
2016
|
+
let n = pe(K.value.items, e.filter((e) => {
|
|
1992
2017
|
let t = d.items[e];
|
|
1993
2018
|
return t && !d.leavingPostIds.has(t.postId);
|
|
1994
2019
|
}), {
|
|
1995
2020
|
scrollTop: N - k.value,
|
|
1996
2021
|
viewportHeight: C.value
|
|
1997
2022
|
});
|
|
1998
|
-
|
|
2023
|
+
se(A.value, n) || (A.value = n), se(M.value, t) || (M.value = t);
|
|
1999
2024
|
}
|
|
2000
|
-
function
|
|
2025
|
+
function X() {
|
|
2001
2026
|
if (L !== null) return;
|
|
2002
2027
|
L = -1;
|
|
2003
2028
|
let e = requestAnimationFrame(() => {
|
|
2004
|
-
L = null,
|
|
2029
|
+
L = null, le();
|
|
2005
2030
|
});
|
|
2006
2031
|
L !== null && (L = e);
|
|
2007
2032
|
}
|
|
@@ -2014,11 +2039,11 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2014
2039
|
previewStates: () => d.previewStates,
|
|
2015
2040
|
visibleIndices: () => j.value
|
|
2016
2041
|
});
|
|
2017
|
-
function
|
|
2018
|
-
let t =
|
|
2042
|
+
function Z(e) {
|
|
2043
|
+
let t = K.value.items[e], n = d.items[e]?.postId;
|
|
2019
2044
|
if (!t || t.width <= 0 || t.height <= 0) return {};
|
|
2020
2045
|
let r = n !== void 0 && d.enteringPostIds.has(n), i = n !== void 0 && d.leavingPostIds.has(n), a = r || i ? ue({
|
|
2021
|
-
containerHeight: Math.max(T.value,
|
|
2046
|
+
containerHeight: Math.max(T.value, H.value.height),
|
|
2022
2047
|
gap: x.value
|
|
2023
2048
|
}) : 0, o = n === void 0 ? 0 : i ? d.removalDelays.get(n) ?? 0 : r ? d.entryDelays.get(n) ?? 0 : 0;
|
|
2024
2049
|
return {
|
|
@@ -2035,19 +2060,19 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2035
2060
|
let t = e.ownerDocument.defaultView?.getComputedStyle(e), n = (Number.parseFloat(t?.paddingTop ?? "") || 0) + (Number.parseFloat(t?.paddingBottom ?? "") || 0);
|
|
2036
2061
|
T.value = Math.max(0, e.clientHeight - n);
|
|
2037
2062
|
let r = g.value;
|
|
2038
|
-
r && (k.value = r.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop,
|
|
2063
|
+
r && (k.value = r.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop, le());
|
|
2039
2064
|
}
|
|
2040
2065
|
function fe(e) {
|
|
2041
2066
|
let t = e.ownerDocument.documentElement.clientWidth;
|
|
2042
2067
|
y.value = e.clientWidth, x.value = Math.min(pn, Math.max(fn, t * .0075)), de();
|
|
2043
2068
|
}
|
|
2044
|
-
function
|
|
2069
|
+
function Q(e) {
|
|
2045
2070
|
let t = e.currentTarget;
|
|
2046
|
-
t && (N = t.scrollTop,
|
|
2071
|
+
t && (N = t.scrollTop, V.ensurePackedThrough(B()), X(), Date.now() >= l && !d.loadMoreLocked && d.infiniteScroll && Y(t, d.masonry?.loadMoreThresholdPx) && f("loadMore"));
|
|
2047
2072
|
}
|
|
2048
2073
|
function me() {
|
|
2049
2074
|
let e = p.value;
|
|
2050
|
-
Date.now() >= l && !d.loadMoreLocked && e &&
|
|
2075
|
+
Date.now() >= l && !d.loadMoreLocked && e && Y(e, d.masonry?.loadMoreThresholdPx) && f("loadMore");
|
|
2051
2076
|
}
|
|
2052
2077
|
O(() => d.items.length, (e, t) => {
|
|
2053
2078
|
e > 0 && e < t && (l = Date.now() + mn);
|
|
@@ -2064,13 +2089,13 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2064
2089
|
}), P.observe(e)));
|
|
2065
2090
|
}), O(p, (e) => {
|
|
2066
2091
|
F?.disconnect(), F = null, e && (de(), !(typeof ResizeObserver > "u") && (F = new ResizeObserver(de), F.observe(e)));
|
|
2067
|
-
}), O(
|
|
2092
|
+
}), O(K, (e) => {
|
|
2068
2093
|
z = e.items;
|
|
2069
2094
|
}, { flush: "sync" }), O([
|
|
2070
|
-
|
|
2071
|
-
|
|
2095
|
+
H,
|
|
2096
|
+
K,
|
|
2072
2097
|
() => d.masonry
|
|
2073
|
-
],
|
|
2098
|
+
], le, { flush: "post" }), v(() => {
|
|
2074
2099
|
P?.disconnect(), F?.disconnect(), I !== null && cancelAnimationFrame(I), L !== null && cancelAnimationFrame(L);
|
|
2075
2100
|
}), n({
|
|
2076
2101
|
getScrollElement: he,
|
|
@@ -2084,14 +2109,14 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2084
2109
|
"data-layout-mode": "masonry",
|
|
2085
2110
|
"aria-hidden": t.suspended || void 0,
|
|
2086
2111
|
inert: t.suspended || void 0,
|
|
2087
|
-
onScrollPassive:
|
|
2112
|
+
onScrollPassive: Q
|
|
2088
2113
|
}, [c("section", {
|
|
2089
2114
|
ref_key: "masonryElement",
|
|
2090
2115
|
ref: g,
|
|
2091
2116
|
class: h(["masonry", { "masonry--ready": y.value > 0 }]),
|
|
2092
|
-
style: _(
|
|
2117
|
+
style: _(J.value),
|
|
2093
2118
|
"aria-label": "Media gallery"
|
|
2094
|
-
}, [(b(!0), s(e, null, S(
|
|
2119
|
+
}, [(b(!0), s(e, null, S(ie.value, ({ fetchPriority: e, item: n, index: r }) => (b(), a(an, {
|
|
2095
2120
|
key: n.postId,
|
|
2096
2121
|
class: "masonry-item",
|
|
2097
2122
|
entering: t.enteringPostIds.has(n.postId),
|
|
@@ -2100,20 +2125,21 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2100
2125
|
"card-footer": t.cardFooter,
|
|
2101
2126
|
"card-header": t.cardHeader,
|
|
2102
2127
|
"media-card": t.mediaCard,
|
|
2103
|
-
"in-viewport":
|
|
2128
|
+
"in-viewport": re.value.has(r),
|
|
2104
2129
|
index: r,
|
|
2105
2130
|
item: n,
|
|
2106
|
-
"item-style":
|
|
2131
|
+
"item-style": Z(r),
|
|
2107
2132
|
interactive: "",
|
|
2108
2133
|
layout: "masonry",
|
|
2109
2134
|
"loaded-count": t.items.length,
|
|
2110
2135
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2111
|
-
"preview-state": t.previewStates.get(E(
|
|
2136
|
+
"preview-state": t.previewStates.get(E(W)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2112
2137
|
total: t.total,
|
|
2113
2138
|
onActivate: (e) => f("activate", n.postId, e),
|
|
2114
2139
|
onMediaChange: (e) => f("mediaChange", n.postId, e),
|
|
2115
2140
|
onReady: (e) => f("ready", n.postId, e),
|
|
2116
|
-
onError: (e) => f("error", n.postId, e)
|
|
2141
|
+
onError: (e) => f("error", n.postId, e),
|
|
2142
|
+
onMediaError: (e) => f("mediaError", n.postId, e)
|
|
2117
2143
|
}, null, 8, [
|
|
2118
2144
|
"entering",
|
|
2119
2145
|
"leaving",
|
|
@@ -2132,9 +2158,15 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2132
2158
|
"onActivate",
|
|
2133
2159
|
"onMediaChange",
|
|
2134
2160
|
"onReady",
|
|
2135
|
-
"onError"
|
|
2136
|
-
|
|
2137
|
-
|
|
2161
|
+
"onError",
|
|
2162
|
+
"onMediaError"
|
|
2163
|
+
]))), 128))], 6), t.masonry?.bottomSpacePx ? (b(), s("div", {
|
|
2164
|
+
key: 0,
|
|
2165
|
+
class: "masonry-bottom-space",
|
|
2166
|
+
"aria-hidden": "true",
|
|
2167
|
+
style: _({ flex: `0 0 ${t.masonry.bottomSpacePx}px` })
|
|
2168
|
+
}, null, 4)) : o("", !0)], 42, un),
|
|
2169
|
+
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext && ne.value || !t.hasNext && t.canRetryEnd ? (b(), s("div", dn, [u(oe, {
|
|
2138
2170
|
actions: t.feedFooterActions,
|
|
2139
2171
|
"can-retry-end": t.canRetryEnd,
|
|
2140
2172
|
"feed-footer": t.feedFooter,
|
|
@@ -2142,7 +2174,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2142
2174
|
"has-next": t.hasNext,
|
|
2143
2175
|
"is-loading": t.isLoadingMore,
|
|
2144
2176
|
"load-more-locked": t.loadMoreLocked,
|
|
2145
|
-
"show-load-more":
|
|
2177
|
+
"show-load-more": ne.value,
|
|
2146
2178
|
state: t.state,
|
|
2147
2179
|
onLoadMore: r[0] ||= (e) => f("loadMore"),
|
|
2148
2180
|
onRetryEnd: r[1] ||= (e) => f("retryEnd")
|
|
@@ -2158,7 +2190,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2158
2190
|
"state"
|
|
2159
2191
|
])])) : o("", !0),
|
|
2160
2192
|
u(Le, {
|
|
2161
|
-
"content-size":
|
|
2193
|
+
"content-size": K.value.height,
|
|
2162
2194
|
"controls-id": m,
|
|
2163
2195
|
"scroll-element": p.value,
|
|
2164
2196
|
suspended: t.suspended
|
|
@@ -2241,6 +2273,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2241
2273
|
emits: [
|
|
2242
2274
|
"activeChange",
|
|
2243
2275
|
"error",
|
|
2276
|
+
"mediaError",
|
|
2244
2277
|
"loadMore",
|
|
2245
2278
|
"mediaChange",
|
|
2246
2279
|
"ready",
|
|
@@ -2261,8 +2294,8 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2261
2294
|
return e === void 0 ? 0 : u.mediaIndices.get(e) ?? 0;
|
|
2262
2295
|
}), z = r(() => {
|
|
2263
2296
|
let e = F.value;
|
|
2264
|
-
return e === void 0 ? "loading" : u.previewStates.get(
|
|
2265
|
-
}), B = r(() => I.value ?
|
|
2297
|
+
return e === void 0 ? "loading" : u.previewStates.get(W(e, R.value)) ?? "loading";
|
|
2298
|
+
}), B = r(() => I.value ? U(I.value, R.value) : null), H = r(() => B.value ? ee(B.value, u.mediaSource ?? "preview") : null), G = r(() => z.value === "ready" && !!(H.value && L(H.value.type, H.value.src))), K = r(() => [
|
|
2266
2299
|
F.value,
|
|
2267
2300
|
R.value,
|
|
2268
2301
|
u.items.length,
|
|
@@ -2270,47 +2303,47 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2270
2303
|
u.reelAutoAdvance.enabled,
|
|
2271
2304
|
u.reelAutoAdvance.includePostItems,
|
|
2272
2305
|
u.reelAutoAdvance.intervalMs
|
|
2273
|
-
].join(":")),
|
|
2274
|
-
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && R.value <
|
|
2306
|
+
].join(":")), te = r(() => {
|
|
2307
|
+
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && R.value < V(e).length - 1), n = u.reelAutoAdvance.intervalMs / 1e3;
|
|
2275
2308
|
return `Auto advance to the next ${t ? "post item" : "post"} in ${n}s`;
|
|
2276
|
-
}),
|
|
2277
|
-
function
|
|
2309
|
+
}), q = r(() => u.reelAutoAdvance.enabled && u.reelForward.status === "idle" && I.value !== void 0 && z.value !== "loading" && !G.value), J = r(() => !u.infiniteScroll || u.items.length <= 1), ne = r(() => u.reelForward.status === "end" && u.hasNext && !u.infiniteScroll && !u.loadMoreLocked), re = r(() => u.reelForward.status === "loading" ? "Loading the next media…" : u.reelForward.status === "error" ? "Unable to load the next media." : ne.value ? "Load the next page to continue." : "You reached the end of this feed.");
|
|
2310
|
+
function ie(e) {
|
|
2278
2311
|
return { gridRow: `${e + 1}` };
|
|
2279
2312
|
}
|
|
2280
|
-
function
|
|
2313
|
+
function ae(e) {
|
|
2281
2314
|
let t = k || e.clientHeight;
|
|
2282
2315
|
return t <= 0 || u.items.length === 0 ? 0 : Math.min(u.items.length - 1, Math.max(0, Math.round(e.scrollTop / t)));
|
|
2283
2316
|
}
|
|
2284
|
-
function
|
|
2317
|
+
function se(e) {
|
|
2285
2318
|
let t = e.currentTarget;
|
|
2286
2319
|
if (!t) return;
|
|
2287
2320
|
let n = k || t.clientHeight, r = Math.max(0, u.items.length - 1) * n;
|
|
2288
|
-
C.value = u.items.length > 0 && t.scrollTop > r + 1, D.value || (x.value =
|
|
2321
|
+
C.value = u.items.length > 0 && t.scrollTop > r + 1, D.value || (x.value = ae(t)), Date.now() >= l && !u.loadMoreLocked && u.infiniteScroll && Y(t) && d("loadMore");
|
|
2289
2322
|
}
|
|
2290
|
-
function
|
|
2323
|
+
function ce() {
|
|
2291
2324
|
let e = f.value;
|
|
2292
|
-
e && (C.value = !1,
|
|
2325
|
+
e && (C.value = !1, Z(!0), k = e.clientHeight, e.scrollTop = x.value * k, j !== null && cancelAnimationFrame(j), j = requestAnimationFrame(() => {
|
|
2293
2326
|
e.scrollTop = x.value * e.clientHeight, k = e.clientHeight, j = null;
|
|
2294
|
-
}),
|
|
2327
|
+
}), le());
|
|
2295
2328
|
}
|
|
2296
|
-
function
|
|
2329
|
+
function le() {
|
|
2297
2330
|
M !== null && clearTimeout(M), M = setTimeout(() => {
|
|
2298
2331
|
M = null;
|
|
2299
2332
|
let e = f.value;
|
|
2300
|
-
e && (k = e.clientHeight, e.scrollTop = x.value * k),
|
|
2333
|
+
e && (k = e.clientHeight, e.scrollTop = x.value * k), Z(!1);
|
|
2301
2334
|
}, 120);
|
|
2302
2335
|
}
|
|
2303
|
-
function
|
|
2304
|
-
|
|
2336
|
+
function X() {
|
|
2337
|
+
Z(!0);
|
|
2305
2338
|
let e = f.value;
|
|
2306
|
-
e && (k = e.clientHeight, e.scrollTop = x.value * k),
|
|
2339
|
+
e && (k = e.clientHeight, e.scrollTop = x.value * k), le();
|
|
2307
2340
|
}
|
|
2308
|
-
function
|
|
2341
|
+
function Z(e) {
|
|
2309
2342
|
D.value = e, f.value?.toggleAttribute("data-resizing", e);
|
|
2310
2343
|
}
|
|
2311
2344
|
function ue() {
|
|
2312
2345
|
let e = f.value;
|
|
2313
|
-
Date.now() >= l && !u.loadMoreLocked && e &&
|
|
2346
|
+
Date.now() >= l && !u.loadMoreLocked && e && Y(e) && d("loadMore");
|
|
2314
2347
|
}
|
|
2315
2348
|
O(() => u.items.length, (e, t) => {
|
|
2316
2349
|
e > 0 && e < t && (l = Date.now() + Tn);
|
|
@@ -2318,7 +2351,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2318
2351
|
function de(e) {
|
|
2319
2352
|
let t = I.value;
|
|
2320
2353
|
if (!t) return !1;
|
|
2321
|
-
let n =
|
|
2354
|
+
let n = V(t).length;
|
|
2322
2355
|
if (n <= 1) return !1;
|
|
2323
2356
|
let r = (R.value + e + n) % n;
|
|
2324
2357
|
return d("mediaChange", t.postId, r), !0;
|
|
@@ -2327,18 +2360,18 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2327
2360
|
let t = x.value + e;
|
|
2328
2361
|
return !f.value || t < 0 || t >= u.items.length ? !1 : (he(t), !0);
|
|
2329
2362
|
}
|
|
2330
|
-
function
|
|
2363
|
+
function pe(e, t) {
|
|
2331
2364
|
let n = u.items.findIndex((t) => t.postId === e), r = u.items[n];
|
|
2332
2365
|
return !f.value || !r || t < 0 || t > r.items.length ? !1 : ((u.mediaIndices.get(e) ?? 0) !== t && d("mediaChange", e, t), n !== x.value && he(n), !0);
|
|
2333
2366
|
}
|
|
2334
|
-
function
|
|
2367
|
+
function Q() {
|
|
2335
2368
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2336
2369
|
}
|
|
2337
2370
|
function me(e) {
|
|
2338
2371
|
let t = f.value;
|
|
2339
2372
|
if (!t) return Promise.resolve();
|
|
2340
2373
|
let n = e * (k || t.clientHeight);
|
|
2341
|
-
return x.value = e, _n(t, n,
|
|
2374
|
+
return x.value = e, _n(t, n, Q());
|
|
2342
2375
|
}
|
|
2343
2376
|
function he(e) {
|
|
2344
2377
|
me(e);
|
|
@@ -2348,13 +2381,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2348
2381
|
return t < 0 || t === x.value ? !1 : (await me(t), !0);
|
|
2349
2382
|
}
|
|
2350
2383
|
async function _e(e) {
|
|
2351
|
-
return de(e) ? (
|
|
2384
|
+
return de(e) ? (Q() || await new Promise((e) => setTimeout(e, wn)), !0) : !1;
|
|
2352
2385
|
}
|
|
2353
2386
|
function ve() {
|
|
2354
2387
|
if (!u.reelAutoAdvance.enabled) return;
|
|
2355
2388
|
let e = I.value;
|
|
2356
2389
|
if (!e) return;
|
|
2357
|
-
if (u.reelAutoAdvance.includePostItems && R.value <
|
|
2390
|
+
if (u.reelAutoAdvance.includePostItems && R.value < V(e).length - 1) {
|
|
2358
2391
|
d("mediaChange", e.postId, R.value + 1);
|
|
2359
2392
|
return;
|
|
2360
2393
|
}
|
|
@@ -2366,26 +2399,26 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2366
2399
|
u.reelAutoAdvance.includePostItems && (u.mediaIndices.get(n.postId) ?? 0) !== 0 && d("mediaChange", n.postId, 0), he(t);
|
|
2367
2400
|
}
|
|
2368
2401
|
function ye(e, t) {
|
|
2369
|
-
!u.reelAutoAdvance.enabled || e !== F.value || t !== R.value || !
|
|
2402
|
+
!u.reelAutoAdvance.enabled || e !== F.value || t !== R.value || !G.value || ve();
|
|
2370
2403
|
}
|
|
2371
2404
|
return O(f, (e) => {
|
|
2372
|
-
A?.disconnect(), A = null, e && (k = e.clientHeight, !(typeof ResizeObserver > "u") && (A = new ResizeObserver(
|
|
2405
|
+
A?.disconnect(), A = null, e && (k = e.clientHeight, !(typeof ResizeObserver > "u") && (A = new ResizeObserver(ce), A.observe(e)));
|
|
2373
2406
|
}), O(() => u.items.length, async (e) => {
|
|
2374
2407
|
let t = u.initialPostId, n = t == null ? -1 : u.items.findIndex(({ postId: e }) => e === t);
|
|
2375
|
-
x.value = n >= 0 ? n : Math.min(x.value, Math.max(0, e - 1)), await m(),
|
|
2408
|
+
x.value = n >= 0 ? n : Math.min(x.value, Math.max(0, e - 1)), await m(), ce();
|
|
2376
2409
|
}), O(F, (e) => {
|
|
2377
2410
|
e !== void 0 && d("activeChange", e);
|
|
2378
2411
|
}, { immediate: !0 }), y(() => {
|
|
2379
|
-
window.addEventListener("resize",
|
|
2412
|
+
window.addEventListener("resize", X), window.addEventListener("orientationchange", X), g >= 0 && m(ce);
|
|
2380
2413
|
}), v(() => {
|
|
2381
|
-
window.removeEventListener("resize",
|
|
2414
|
+
window.removeEventListener("resize", X), window.removeEventListener("orientationchange", X), A?.disconnect(), j !== null && cancelAnimationFrame(j), M !== null && clearTimeout(M);
|
|
2382
2415
|
}), n({
|
|
2383
2416
|
activeIndex: x,
|
|
2384
2417
|
activePostId: F,
|
|
2385
2418
|
changeActiveMedia: de,
|
|
2386
2419
|
loadIfNearBottom: ue,
|
|
2387
2420
|
moveActivePost: fe,
|
|
2388
|
-
navigateToItem:
|
|
2421
|
+
navigateToItem: pe,
|
|
2389
2422
|
transitionActiveMedia: _e,
|
|
2390
2423
|
transitionActivePost: ge
|
|
2391
2424
|
}), (n, r) => (b(), s("main", {
|
|
@@ -2423,7 +2456,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2423
2456
|
class: "gallery-shell reel-feed",
|
|
2424
2457
|
"data-active-post-id": F.value,
|
|
2425
2458
|
"data-active-media-index": R.value,
|
|
2426
|
-
onScrollPassive:
|
|
2459
|
+
onScrollPassive: se
|
|
2427
2460
|
}, [t.reelForward.status === "idle" ? (b(), s("section", {
|
|
2428
2461
|
key: 1,
|
|
2429
2462
|
class: "reel-track",
|
|
@@ -2438,13 +2471,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2438
2471
|
"fetch-priority": e,
|
|
2439
2472
|
index: i,
|
|
2440
2473
|
item: n,
|
|
2441
|
-
"item-style":
|
|
2474
|
+
"item-style": ie(i),
|
|
2442
2475
|
"media-card": t.mediaCard,
|
|
2443
2476
|
layout: "reel",
|
|
2444
2477
|
"loaded-count": t.items.length,
|
|
2445
2478
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2446
2479
|
"media-source": t.mediaSource,
|
|
2447
|
-
"preview-state": t.previewStates.get(E(
|
|
2480
|
+
"preview-state": t.previewStates.get(E(W)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2448
2481
|
"reel-controls-target": p.value,
|
|
2449
2482
|
"reel-audio-state": t.reelAudioState,
|
|
2450
2483
|
"stationary-reel-controls": "",
|
|
@@ -2453,7 +2486,8 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2453
2486
|
onEnded: (e) => ye(n.postId, e),
|
|
2454
2487
|
onReady: (e) => d("ready", n.postId, e),
|
|
2455
2488
|
onReelAudioChange: r[1] ||= (e) => d("reelAudioChange", e),
|
|
2456
|
-
onError: (e) => d("error", n.postId, e)
|
|
2489
|
+
onError: (e) => d("error", n.postId, e),
|
|
2490
|
+
onMediaError: (e) => d("mediaError", n.postId, e)
|
|
2457
2491
|
}, null, 8, [
|
|
2458
2492
|
"active",
|
|
2459
2493
|
"advance-on-media-end",
|
|
@@ -2472,19 +2506,20 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2472
2506
|
"onMediaChange",
|
|
2473
2507
|
"onEnded",
|
|
2474
2508
|
"onReady",
|
|
2475
|
-
"onError"
|
|
2509
|
+
"onError",
|
|
2510
|
+
"onMediaError"
|
|
2476
2511
|
]))), 128))], 4)) : (b(), s("div", {
|
|
2477
2512
|
key: 0,
|
|
2478
2513
|
class: "reel-forward-status",
|
|
2479
2514
|
role: t.reelForward.status === "error" ? "alert" : "status",
|
|
2480
2515
|
"data-status": t.reelForward.status
|
|
2481
|
-
}, [c("p", null, T(
|
|
2516
|
+
}, [c("p", null, T(re.value), 1), t.reelForward.status === "error" || t.reelForward.status === "end" ? (b(), s("button", {
|
|
2482
2517
|
key: 0,
|
|
2483
2518
|
class: "reel-forward-retry",
|
|
2484
2519
|
type: "button",
|
|
2485
2520
|
disabled: t.loadMoreLocked,
|
|
2486
2521
|
onClick: r[0] ||= (e) => d("retryForward")
|
|
2487
|
-
}, T(
|
|
2522
|
+
}, T(ne.value ? "Load more" : "Retry"), 9, Cn)) : o("", !0)], 8, Sn)), t.reelForward.status === "idle" ? (b(), a(oe, {
|
|
2488
2523
|
key: 2,
|
|
2489
2524
|
actions: t.feedFooterActions,
|
|
2490
2525
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -2493,7 +2528,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2493
2528
|
"has-next": t.hasNext,
|
|
2494
2529
|
"is-loading": t.isLoadingMore,
|
|
2495
2530
|
"load-more-locked": t.loadMoreLocked,
|
|
2496
|
-
"show-load-more":
|
|
2531
|
+
"show-load-more": J.value,
|
|
2497
2532
|
state: t.state,
|
|
2498
2533
|
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2499
2534
|
onRetryEnd: r[3] ||= (e) => d("retryEnd")
|
|
@@ -2535,10 +2570,10 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2535
2570
|
"style",
|
|
2536
2571
|
"total"
|
|
2537
2572
|
])) : o("", !0),
|
|
2538
|
-
|
|
2539
|
-
key:
|
|
2573
|
+
q.value ? (b(), a(yn, {
|
|
2574
|
+
key: K.value,
|
|
2540
2575
|
"duration-ms": t.reelAutoAdvance.intervalMs,
|
|
2541
|
-
label:
|
|
2576
|
+
label: te.value,
|
|
2542
2577
|
onComplete: ve
|
|
2543
2578
|
}, null, 8, ["duration-ms", "label"])) : o("", !0)
|
|
2544
2579
|
], 2));
|
|
@@ -2590,6 +2625,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2590
2625
|
"activeChange",
|
|
2591
2626
|
"closeInfoSheet",
|
|
2592
2627
|
"error",
|
|
2628
|
+
"mediaError",
|
|
2593
2629
|
"loadMore",
|
|
2594
2630
|
"mediaChange",
|
|
2595
2631
|
"ready",
|
|
@@ -2612,9 +2648,9 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2612
2648
|
item: e,
|
|
2613
2649
|
layout: "reel",
|
|
2614
2650
|
loadedCount: l.items.length,
|
|
2615
|
-
mediaCount:
|
|
2651
|
+
mediaCount: V(e).length,
|
|
2616
2652
|
mediaIndex: D.value,
|
|
2617
|
-
mediaItem:
|
|
2653
|
+
mediaItem: U(e, D.value),
|
|
2618
2654
|
mediaSource: l.mediaSource ?? "preview",
|
|
2619
2655
|
origin: l.origin,
|
|
2620
2656
|
total: l.total
|
|
@@ -2647,7 +2683,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2647
2683
|
function B(e, t) {
|
|
2648
2684
|
d("mediaChange", e, t);
|
|
2649
2685
|
}
|
|
2650
|
-
function
|
|
2686
|
+
function ee(e, t) {
|
|
2651
2687
|
d("ready", e, t);
|
|
2652
2688
|
}
|
|
2653
2689
|
return O(() => ({
|
|
@@ -2705,12 +2741,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2705
2741
|
total: e.total,
|
|
2706
2742
|
onActiveChange: r[0] ||= (e) => d("activeChange", e),
|
|
2707
2743
|
onError: z,
|
|
2708
|
-
|
|
2744
|
+
onMediaError: r[1] ||= (e, t) => d("mediaError", e, t),
|
|
2745
|
+
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2709
2746
|
onMediaChange: B,
|
|
2710
|
-
onReady:
|
|
2711
|
-
onRetryEnd: r[
|
|
2712
|
-
onRetryForward: r[
|
|
2713
|
-
onReelAudioChange: r[
|
|
2747
|
+
onReady: ee,
|
|
2748
|
+
onRetryEnd: r[3] ||= (e) => d("retryEnd"),
|
|
2749
|
+
onRetryForward: r[4] ||= (e) => d("retryForward"),
|
|
2750
|
+
onReelAudioChange: r[5] ||= (e) => d("reelAudioChange", e)
|
|
2714
2751
|
}, null, 8, [
|
|
2715
2752
|
"can-retry-end",
|
|
2716
2753
|
"card-footer",
|
|
@@ -2753,7 +2790,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2753
2790
|
function Mn(e, t, n, r, i) {
|
|
2754
2791
|
let a = e.items.findIndex((e) => e.postId === t), o = e.items[a];
|
|
2755
2792
|
if (!o) return null;
|
|
2756
|
-
let s =
|
|
2793
|
+
let s = H(o, n), c = U(o, s);
|
|
2757
2794
|
return {
|
|
2758
2795
|
item: o,
|
|
2759
2796
|
layout: r,
|
|
@@ -2788,7 +2825,7 @@ function Pn(e, t) {
|
|
|
2788
2825
|
n.clear(), l.clear(), i.value = /* @__PURE__ */ new Map(), a.value = /* @__PURE__ */ new Map(), o.value = /* @__PURE__ */ new Map();
|
|
2789
2826
|
}
|
|
2790
2827
|
function d(e, t, n, r) {
|
|
2791
|
-
let i =
|
|
2828
|
+
let i = W(t, n);
|
|
2792
2829
|
e.value.get(i) !== r && (e.value = new Map(e.value).set(i, r));
|
|
2793
2830
|
}
|
|
2794
2831
|
function f(t, n, r, i) {
|
|
@@ -2798,32 +2835,39 @@ function Pn(e, t) {
|
|
|
2798
2835
|
let a = f(e, n, r, i);
|
|
2799
2836
|
a && t.ready(a);
|
|
2800
2837
|
}
|
|
2801
|
-
function m(
|
|
2802
|
-
|
|
2838
|
+
function m(n, r, i) {
|
|
2839
|
+
let a = f(n, r.mediaIndex, i, i === "reel" ? e.reelOrigin ?? "reel" : null);
|
|
2840
|
+
a && r.src && t.error({
|
|
2841
|
+
...a,
|
|
2842
|
+
...r
|
|
2843
|
+
});
|
|
2803
2844
|
}
|
|
2804
2845
|
function h(e, t) {
|
|
2805
|
-
d(i, e, t, "
|
|
2846
|
+
d(i, e, t, "error");
|
|
2806
2847
|
}
|
|
2807
2848
|
function g(e, t) {
|
|
2849
|
+
d(i, e, t, "ready"), p(e, t, "masonry", null);
|
|
2850
|
+
}
|
|
2851
|
+
function _(e, t) {
|
|
2808
2852
|
d(s(), e, t, "error");
|
|
2809
2853
|
}
|
|
2810
|
-
function
|
|
2854
|
+
function v(t, n) {
|
|
2811
2855
|
d(s(), t, n, "ready"), p(t, n, "reel", e.reelOrigin ?? "reel");
|
|
2812
2856
|
}
|
|
2813
|
-
function
|
|
2814
|
-
let r =
|
|
2857
|
+
function y(e, n) {
|
|
2858
|
+
let r = W(e, n);
|
|
2815
2859
|
if (l.has(r)) return;
|
|
2816
2860
|
let i = f(e, n, "masonry", null);
|
|
2817
2861
|
i && (l.add(r), t.visible(i));
|
|
2818
2862
|
}
|
|
2819
|
-
function
|
|
2820
|
-
let o = [i,
|
|
2863
|
+
function b(e, r, i, a) {
|
|
2864
|
+
let o = [i, W(e, r)].join(":");
|
|
2821
2865
|
if (n.has(o)) return;
|
|
2822
2866
|
let s = f(e, r, i, a);
|
|
2823
2867
|
s && (n.add(o), t.fullyVisible(s));
|
|
2824
2868
|
}
|
|
2825
|
-
function
|
|
2826
|
-
|
|
2869
|
+
function x(e, t) {
|
|
2870
|
+
b(e, t, "masonry", null);
|
|
2827
2871
|
}
|
|
2828
2872
|
return Nn(e, t.reelChange), O(() => {
|
|
2829
2873
|
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null, n = t === null ? 0 : e.mediaIndices.get(t) ?? 0;
|
|
@@ -2831,17 +2875,18 @@ function Pn(e, t) {
|
|
|
2831
2875
|
mediaIndex: n,
|
|
2832
2876
|
origin: e.reelOrigin ?? "reel",
|
|
2833
2877
|
postId: t,
|
|
2834
|
-
ready: t !== null && c.value.get(
|
|
2878
|
+
ready: t !== null && c.value.get(W(t, n)) === "ready"
|
|
2835
2879
|
};
|
|
2836
2880
|
}, (e, t) => {
|
|
2837
|
-
e.postId === null || !e.ready || t?.ready && t.postId === e.postId && t.mediaIndex === e.mediaIndex && t.origin === e.origin ||
|
|
2881
|
+
e.postId === null || !e.ready || t?.ready && t.postId === e.postId && t.mediaIndex === e.mediaIndex && t.origin === e.origin || b(e.postId, e.mediaIndex, "reel", e.origin);
|
|
2838
2882
|
}, { flush: "post" }), {
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2883
|
+
markMediaError: m,
|
|
2884
|
+
markMasonryFullyVisible: x,
|
|
2885
|
+
markMasonryVisible: y,
|
|
2886
|
+
markPreviewError: h,
|
|
2887
|
+
markPreviewReady: g,
|
|
2888
|
+
markReelError: _,
|
|
2889
|
+
markReelReady: v,
|
|
2845
2890
|
originalStates: a,
|
|
2846
2891
|
previewStates: i,
|
|
2847
2892
|
reelStates: c,
|
|
@@ -2928,6 +2973,7 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
2928
2973
|
"closeReel",
|
|
2929
2974
|
"loadMore",
|
|
2930
2975
|
"mediaFullyVisible",
|
|
2976
|
+
"mediaError",
|
|
2931
2977
|
"mediaReady",
|
|
2932
2978
|
"mediaVisible",
|
|
2933
2979
|
"openReel",
|
|
@@ -2938,55 +2984,56 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
2938
2984
|
"retryForward"
|
|
2939
2985
|
],
|
|
2940
2986
|
setup(t, { expose: i, emit: c }) {
|
|
2941
|
-
let l = t, d = c, f = w(null), p = w(null), h = w(null), g = w(null), _ = w(!1), y = w(/* @__PURE__ */ new Set()), x = w(/* @__PURE__ */ new Map()), S = w(/* @__PURE__ */ new Set()), C = w(/* @__PURE__ */ new Map()), T = r(() => Object.freeze([...l.state.items])), D = r(() =>
|
|
2987
|
+
let l = t, d = c, f = w(null), p = w(null), h = w(null), g = w(null), _ = w(!1), y = w(/* @__PURE__ */ new Set()), x = w(/* @__PURE__ */ new Map()), S = w(/* @__PURE__ */ new Set()), C = w(/* @__PURE__ */ new Map()), T = r(() => Object.freeze([...l.state.items])), D = r(() => te(l.state, T.value)), { markMediaError: A, markMasonryFullyVisible: j, markMasonryVisible: M, markPreviewError: N, markPreviewReady: P, markReelError: F, markReelReady: I, originalStates: L, previewStates: R, reelStates: z, resetMediaLifecycle: B } = Pn(l.state, {
|
|
2988
|
+
error: (e) => d("mediaError", e),
|
|
2942
2989
|
fullyVisible: (e) => d("mediaFullyVisible", e),
|
|
2943
2990
|
ready: (e) => d("mediaReady", e),
|
|
2944
2991
|
reelChange: (e) => d("reelMediaChange", e),
|
|
2945
2992
|
visible: (e) => d("mediaVisible", e)
|
|
2946
|
-
}),
|
|
2993
|
+
}), ee = new Set(l.state.items.map((e) => e.postId)), U = null, W = null, G = !1;
|
|
2947
2994
|
function K() {
|
|
2948
2995
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2949
2996
|
}
|
|
2950
2997
|
function q() {
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2998
|
+
U !== null && cancelAnimationFrame(U), U = requestAnimationFrame(() => {
|
|
2999
|
+
U = requestAnimationFrame(() => {
|
|
3000
|
+
U = null, y.value = /* @__PURE__ */ new Set();
|
|
2954
3001
|
});
|
|
2955
3002
|
});
|
|
2956
3003
|
}
|
|
2957
|
-
function
|
|
3004
|
+
function J(e, t) {
|
|
2958
3005
|
let n = l.state.items.find((t) => t.postId === e);
|
|
2959
3006
|
if (!n) return;
|
|
2960
|
-
let r =
|
|
3007
|
+
let r = H(n, t);
|
|
2961
3008
|
(l.state.mediaIndices.get(e) ?? 0) !== r && (l.state.mediaIndices = new Map(l.state.mediaIndices).set(e, r));
|
|
2962
3009
|
}
|
|
2963
|
-
async function
|
|
3010
|
+
async function ne() {
|
|
2964
3011
|
await m(), (l.state.layout === "reel" || l.state.reelOrigin === "masonry" ? p.value : f.value)?.loadIfNearBottom();
|
|
2965
3012
|
}
|
|
2966
|
-
function
|
|
3013
|
+
function re(e) {
|
|
2967
3014
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.changeActiveMedia?.(e) ?? !1;
|
|
2968
3015
|
}
|
|
2969
|
-
function
|
|
3016
|
+
function ie(e) {
|
|
2970
3017
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.moveActivePost?.(e) ?? !1;
|
|
2971
3018
|
}
|
|
2972
|
-
function
|
|
3019
|
+
function ae(e) {
|
|
2973
3020
|
if (!(l.state.layout === "reel" || l.state.reelOrigin === "masonry") || l.state.isLoading) return "reel-inactive";
|
|
2974
3021
|
let t = l.state.items.find((t) => t.postId === e.postId);
|
|
2975
3022
|
if (!t) return "not-found";
|
|
2976
|
-
let n =
|
|
3023
|
+
let n = V(t).findIndex((t) => t.mediaId === e.mediaId);
|
|
2977
3024
|
return n < 0 ? "not-found" : p.value?.navigateToItem?.(e.postId, n) ? "navigated" : "reel-inactive";
|
|
2978
3025
|
}
|
|
2979
|
-
function
|
|
3026
|
+
function oe() {
|
|
2980
3027
|
return l.state.layout !== "masonry" || l.state.reelOrigin === "masonry" ? null : f.value?.getScrollElement?.() ?? null;
|
|
2981
3028
|
}
|
|
2982
|
-
function
|
|
3029
|
+
function se(e, t) {
|
|
2983
3030
|
W = e, G = t === "keyboard", d("openReel", e), m(() => h.value?.focus());
|
|
2984
3031
|
}
|
|
2985
|
-
function
|
|
3032
|
+
function ce(e) {
|
|
2986
3033
|
let t = g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [];
|
|
2987
3034
|
return Array.from(t).find((t) => t.dataset.postId === String(e)) ?? null;
|
|
2988
3035
|
}
|
|
2989
|
-
function
|
|
3036
|
+
function Y(e, t) {
|
|
2990
3037
|
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null || K()) return 0;
|
|
2991
3038
|
let n = [...new Set(e)], r = new Set(Array.from(g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [], (e) => e.dataset.postId)), i = n.filter((e) => r.has(String(e)));
|
|
2992
3039
|
if (i.length === 0) return 0;
|
|
@@ -2995,11 +3042,11 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
2995
3042
|
a.set(e, t * o);
|
|
2996
3043
|
}), y.value = new Set([...y.value].filter((e) => !i.includes(e))), S.value = new Set([...S.value, ...n]), C.value = a, Bn + (i.length - 1) * o;
|
|
2997
3044
|
}
|
|
2998
|
-
function
|
|
3045
|
+
function X() {
|
|
2999
3046
|
S.value = /* @__PURE__ */ new Set(), C.value = /* @__PURE__ */ new Map();
|
|
3000
3047
|
}
|
|
3001
3048
|
async function Z(e, t) {
|
|
3002
|
-
if (t.aborted ||
|
|
3049
|
+
if (t.aborted || Y(e, { staggerMs: 0 }) === 0 || (await m(), t.aborted)) return;
|
|
3003
3050
|
let n = g.value?.querySelectorAll(".masonry-feed .media-card--leaving") ?? [], r = Array.from(n).flatMap((e) => (getComputedStyle(e).opacity, e.getAnimations?.().filter((e) => e.effect?.getTiming().iterations !== Infinity) ?? []));
|
|
3004
3051
|
await new Promise((e) => {
|
|
3005
3052
|
let n = () => {
|
|
@@ -3008,23 +3055,23 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3008
3055
|
t.addEventListener("abort", n, { once: !0 }), t.aborted ? n() : Promise.allSettled(r.map((e) => e.finished)).then(n);
|
|
3009
3056
|
});
|
|
3010
3057
|
}
|
|
3011
|
-
function
|
|
3012
|
-
let n =
|
|
3058
|
+
function ue(e, t) {
|
|
3059
|
+
let n = ce(e), r = n?.querySelector(".media-card-activator") ?? n;
|
|
3013
3060
|
r && (r.classList.toggle("media-card-focus-silent", !t), t || r.addEventListener("blur", () => {
|
|
3014
3061
|
r.classList.remove("media-card-focus-silent");
|
|
3015
3062
|
}, { once: !0 }), r?.focus({ preventScroll: !0 }));
|
|
3016
3063
|
}
|
|
3017
|
-
function
|
|
3064
|
+
function de() {
|
|
3018
3065
|
l.state.reelOrigin === "masonry" && (W ??= l.state.activeReelPostId, _.value = !0, d("closeReel"));
|
|
3019
3066
|
}
|
|
3020
|
-
function
|
|
3067
|
+
function fe() {
|
|
3021
3068
|
let e = W, t = G;
|
|
3022
3069
|
_.value = !1, W = null, G = !1, m(() => {
|
|
3023
|
-
e !== null &&
|
|
3070
|
+
e !== null && ue(e, t);
|
|
3024
3071
|
});
|
|
3025
3072
|
}
|
|
3026
3073
|
return Rn({
|
|
3027
|
-
closeMasonryReel:
|
|
3074
|
+
closeMasonryReel: de,
|
|
3028
3075
|
element: () => g.value,
|
|
3029
3076
|
isReelLeaving: () => _.value,
|
|
3030
3077
|
reelRenderer: () => p.value,
|
|
@@ -3034,8 +3081,8 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3034
3081
|
let e = l.state.items;
|
|
3035
3082
|
return [e, e.length];
|
|
3036
3083
|
}, ([e]) => {
|
|
3037
|
-
let t = e.map((e) => e.postId), n = t.filter((e) => !
|
|
3038
|
-
if (
|
|
3084
|
+
let t = e.map((e) => e.postId), n = t.filter((e) => !ee.has(e)), r = new Set(t);
|
|
3085
|
+
if (ee = new Set(t), S.value = new Set([...S.value].filter((e) => r.has(e))), C.value = new Map([...C.value].filter(([e]) => r.has(e))), n.length === 0 || K()) return;
|
|
3039
3086
|
let i = /* @__PURE__ */ new Map();
|
|
3040
3087
|
t.forEach((e) => {
|
|
3041
3088
|
let t = x.value.get(e);
|
|
@@ -3044,17 +3091,17 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3044
3091
|
i.set(e, t * zn);
|
|
3045
3092
|
}), x.value = i, y.value = new Set([...y.value, ...n]), q();
|
|
3046
3093
|
}, { flush: "sync" }), v(() => {
|
|
3047
|
-
|
|
3094
|
+
U !== null && cancelAnimationFrame(U);
|
|
3048
3095
|
}), i({
|
|
3049
3096
|
animateItemRemoval: Z,
|
|
3050
|
-
cancelItemRemoval:
|
|
3051
|
-
changeActiveReelMedia:
|
|
3052
|
-
getAutoScrollElement:
|
|
3053
|
-
loadIfNearBottom:
|
|
3054
|
-
moveActiveReelPost:
|
|
3055
|
-
navigateToReelItem:
|
|
3056
|
-
resetMediaLifecycle:
|
|
3057
|
-
startItemRemoval:
|
|
3097
|
+
cancelItemRemoval: X,
|
|
3098
|
+
changeActiveReelMedia: re,
|
|
3099
|
+
getAutoScrollElement: oe,
|
|
3100
|
+
loadIfNearBottom: ne,
|
|
3101
|
+
moveActiveReelPost: ie,
|
|
3102
|
+
navigateToReelItem: ae,
|
|
3103
|
+
resetMediaLifecycle: B,
|
|
3104
|
+
startItemRemoval: Y,
|
|
3058
3105
|
transitionActiveReelMedia: (e) => p.value?.transitionActiveMedia?.(e) ?? Promise.resolve(!1),
|
|
3059
3106
|
transitionActiveReelPost: (e) => p.value?.transitionActivePost?.(e) ?? Promise.resolve(!1)
|
|
3060
3107
|
}), (r, i) => (b(), s("div", {
|
|
@@ -3086,7 +3133,7 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3086
3133
|
"info-sheet-overlay": t.state.reelInfoSheetOverlay,
|
|
3087
3134
|
"next-page-error": !!t.state.nextPageError,
|
|
3088
3135
|
origin: "reel",
|
|
3089
|
-
"preview-states": E(
|
|
3136
|
+
"preview-states": E(z),
|
|
3090
3137
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3091
3138
|
"reel-audio-state": t.reelAudioState,
|
|
3092
3139
|
"reel-forward": t.state.reelForward,
|
|
@@ -3094,21 +3141,22 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3094
3141
|
total: t.state.total,
|
|
3095
3142
|
onActiveChange: i[0] ||= (e) => d("activeReelChange", e),
|
|
3096
3143
|
onCloseInfoSheet: i[1] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3097
|
-
onError: E(
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3144
|
+
onError: E(F),
|
|
3145
|
+
onMediaError: i[2] ||= (e, t) => E(A)(e, t, "reel"),
|
|
3146
|
+
onLoadMore: i[3] ||= (e) => d("loadMore"),
|
|
3147
|
+
onMediaChange: J,
|
|
3148
|
+
onReady: E(I),
|
|
3149
|
+
onRetryEnd: i[4] ||= (e) => d("retryEnd"),
|
|
3150
|
+
onRetryForward: i[5] ||= (e) => d("retryForward"),
|
|
3151
|
+
onReelAudioChange: i[6] ||= (e) => d("reelAudioChange", e)
|
|
3152
|
+
}, null, 8, /* @__PURE__ */ "can-retry-end.has-next.card-footer.card-header.feed-footer.feed-footer-actions.forward-index.forward-item.media-card.infinite-scroll.is-loading-more.items.load-more-locked.media-source.media-indices.initial-post-id.info-sheet.info-sheet-enabled.info-sheet-overlay.next-page-error.preview-states.reel-auto-advance.reel-audio-state.reel-forward.state.total.onError.onReady".split("."))) : t.state.error || t.state.isLoading || t.state.items.length === 0 && t.state.reelForward.status === "idle" ? (b(), a(le, {
|
|
3105
3153
|
key: 1,
|
|
3106
3154
|
actions: t.feedFooterActions,
|
|
3107
3155
|
"can-retry-end": t.canRetryEnd,
|
|
3108
3156
|
"feed-footer": t.feedFooter,
|
|
3109
3157
|
state: D.value,
|
|
3110
|
-
onLoadMore: i[
|
|
3111
|
-
onRetryEnd: i[
|
|
3158
|
+
onLoadMore: i[7] ||= (e) => d("loadMore"),
|
|
3159
|
+
onRetryEnd: i[8] ||= (e) => d("retryEnd")
|
|
3112
3160
|
}, null, 8, [
|
|
3113
3161
|
"actions",
|
|
3114
3162
|
"can-retry-end",
|
|
@@ -3135,21 +3183,22 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3135
3183
|
"load-more-locked": t.state.loadMoreLocked,
|
|
3136
3184
|
"media-indices": t.state.mediaIndices,
|
|
3137
3185
|
"next-page-error": !!t.state.nextPageError,
|
|
3138
|
-
"preview-states": E(
|
|
3186
|
+
"preview-states": E(R),
|
|
3139
3187
|
suspended: t.state.reelOrigin === "masonry" || _.value,
|
|
3140
3188
|
state: D.value,
|
|
3141
3189
|
total: t.state.total,
|
|
3142
|
-
onActivate:
|
|
3143
|
-
onError: E(
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3190
|
+
onActivate: se,
|
|
3191
|
+
onError: E(N),
|
|
3192
|
+
onMediaError: i[9] ||= (e, t) => E(A)(e, t, "masonry"),
|
|
3193
|
+
onFullyVisible: E(j),
|
|
3194
|
+
onLoadMore: i[10] ||= (e) => d("loadMore"),
|
|
3195
|
+
onMediaChange: J,
|
|
3196
|
+
onReady: E(P),
|
|
3197
|
+
onRetryEnd: i[11] ||= (e) => d("retryEnd"),
|
|
3198
|
+
onVisible: E(M)
|
|
3150
3199
|
}, null, 8, /* @__PURE__ */ "can-retry-end.entering-post-ids.entry-delays.leaving-post-ids.removal-delays.card-footer.card-header.feed-footer.feed-footer-actions.media-card.masonry.has-next.infinite-scroll.is-loading-more.items.load-more-locked.media-indices.next-page-error.preview-states.suspended.state.total.onError.onFullyVisible.onReady.onVisible".split(".")), u(n, {
|
|
3151
3200
|
name: "vibe-reel-viewer",
|
|
3152
|
-
onAfterLeave:
|
|
3201
|
+
onAfterLeave: fe
|
|
3153
3202
|
}, {
|
|
3154
3203
|
default: k(() => [t.state.reelOrigin === "masonry" ? (b(), s("section", {
|
|
3155
3204
|
key: 0,
|
|
@@ -3184,21 +3233,22 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3184
3233
|
"media-source": "original",
|
|
3185
3234
|
"next-page-error": !!t.state.nextPageError,
|
|
3186
3235
|
origin: "masonry",
|
|
3187
|
-
"preview-states": E(
|
|
3236
|
+
"preview-states": E(L),
|
|
3188
3237
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3189
3238
|
"reel-audio-state": t.reelAudioState,
|
|
3190
3239
|
"reel-forward": t.state.reelForward,
|
|
3191
3240
|
state: D.value,
|
|
3192
3241
|
total: t.state.total,
|
|
3193
|
-
onActiveChange: i[
|
|
3194
|
-
onCloseInfoSheet: i[
|
|
3195
|
-
onError: E(
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3242
|
+
onActiveChange: i[12] ||= (e) => d("activeReelChange", e),
|
|
3243
|
+
onCloseInfoSheet: i[13] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3244
|
+
onError: E(F),
|
|
3245
|
+
onMediaError: i[14] ||= (e, t) => E(A)(e, t, "reel"),
|
|
3246
|
+
onLoadMore: i[15] ||= (e) => d("loadMore"),
|
|
3247
|
+
onMediaChange: J,
|
|
3248
|
+
onReady: E(I),
|
|
3249
|
+
onRetryEnd: i[16] ||= (e) => d("retryEnd"),
|
|
3250
|
+
onRetryForward: i[17] ||= (e) => d("retryForward"),
|
|
3251
|
+
onReelAudioChange: i[18] ||= (e) => d("reelAudioChange", e)
|
|
3202
3252
|
}, null, 8, /* @__PURE__ */ "can-retry-end.card-footer.card-header.feed-footer.feed-footer-actions.forward-index.forward-item.media-card.has-next.infinite-scroll.initial-post-id.info-sheet.info-sheet-enabled.info-sheet-overlay.is-loading-more.items.load-more-locked.media-indices.next-page-error.preview-states.reel-auto-advance.reel-audio-state.reel-forward.state.total.onError.onReady".split("."))], 512)) : o("", !0)]),
|
|
3203
3253
|
_: 1
|
|
3204
3254
|
})], 64))], 512));
|
|
@@ -4331,7 +4381,7 @@ var ti = class {
|
|
|
4331
4381
|
let e = this.options.surface()?.getAutoScrollElement();
|
|
4332
4382
|
e && (e.scrollTop = 0);
|
|
4333
4383
|
}
|
|
4334
|
-
e.mediaIndices = new Map(a.map((t) => [t.postId,
|
|
4384
|
+
e.mediaIndices = new Map(a.map((t) => [t.postId, H(t, e.mediaIndices.get(t.postId) ?? 0)])), e.activeReelPostId !== null && !o.has(String(e.activeReelPostId)) && (e.activeReelPostId = null, e.reelOrigin = null), e.items = a, e.next = n.next, e.total = n.total ?? null, e.error = null, e.nextPageError = null, this.options.commit({
|
|
4335
4385
|
...n,
|
|
4336
4386
|
items: a
|
|
4337
4387
|
});
|
|
@@ -4522,7 +4572,7 @@ var ui = class {
|
|
|
4522
4572
|
li(e);
|
|
4523
4573
|
let t = this.state.items.findIndex(({ postId: t }) => t === e.postId), n = this.state.items[t];
|
|
4524
4574
|
if (!n) return null;
|
|
4525
|
-
let r = [...
|
|
4575
|
+
let r = [...V(n)], i = r[e.mediaIndex];
|
|
4526
4576
|
if (!i) return null;
|
|
4527
4577
|
let a = Object.freeze({
|
|
4528
4578
|
media: i,
|
|
@@ -4561,7 +4611,7 @@ var ui = class {
|
|
|
4561
4611
|
return this.state.layout === "reel" || this.state.reelOrigin === "masonry";
|
|
4562
4612
|
}
|
|
4563
4613
|
restoreIntoPost(e, t) {
|
|
4564
|
-
let n = this.state.items[e], r = [...
|
|
4614
|
+
let n = this.state.items[e], r = [...V(n)], i = Math.min(t.mediaIndex, r.length);
|
|
4565
4615
|
if (r.splice(i, 0, t.media), this.state.items[e] = ci(n, r), this.state.activeReelPostId !== t.postId) return;
|
|
4566
4616
|
let a = this.state.mediaIndices.get(t.postId) ?? 0;
|
|
4567
4617
|
a >= i && this.state.mediaIndices.set(t.postId, a + 1);
|
|
@@ -4569,7 +4619,7 @@ var ui = class {
|
|
|
4569
4619
|
updateMediaIndexAfterRemoval(e, t, n) {
|
|
4570
4620
|
let r = this.state.items.find((t) => t.postId === e);
|
|
4571
4621
|
if (!r) return;
|
|
4572
|
-
let i =
|
|
4622
|
+
let i = V(r).length, a = this.state.mediaIndices.get(e) ?? 0, o = a;
|
|
4573
4623
|
n ? o = t < i ? t : 0 : t < a && (o = a - 1), this.state.mediaIndices.set(e, Math.min(o, i - 1));
|
|
4574
4624
|
}
|
|
4575
4625
|
};
|
|
@@ -4801,7 +4851,7 @@ var mi = 20, hi = class {
|
|
|
4801
4851
|
if (!n) return;
|
|
4802
4852
|
let r = t.mediaIndices.get(e.postId) ?? 0;
|
|
4803
4853
|
if (e.mediaIndex === r) {
|
|
4804
|
-
if (
|
|
4854
|
+
if (V(n).length > 1) {
|
|
4805
4855
|
await this.options.transitionMedia(1);
|
|
4806
4856
|
return;
|
|
4807
4857
|
}
|
|
@@ -4970,7 +5020,7 @@ function Oi(e) {
|
|
|
4970
5020
|
return String(e);
|
|
4971
5021
|
}
|
|
4972
5022
|
function ki(e, t) {
|
|
4973
|
-
let n =
|
|
5023
|
+
let n = V(t).length;
|
|
4974
5024
|
(e.mediaIndices.get(t.postId) ?? 0) >= n && e.mediaIndices.set(t.postId, Math.max(0, n - 1));
|
|
4975
5025
|
}
|
|
4976
5026
|
function Ai(e, t) {
|
|
@@ -5015,7 +5065,7 @@ var ji = class {
|
|
|
5015
5065
|
constructor(e) {
|
|
5016
5066
|
this.options = e, Qr(e);
|
|
5017
5067
|
let t = e.layout ?? "masonry";
|
|
5018
|
-
this.state = x(Yr(e, t)), this.reelAudio = new Ei(e), this.lastLoadedCursor = e.initialPage ? Kn(e.initialPage) : null, this.notificationItems =
|
|
5068
|
+
this.state = x(Yr(e, t)), this.reelAudio = new Ei(e), this.lastLoadedCursor = e.initialPage ? Kn(e.initialPage) : null, this.notificationItems = G(this.state), this.autoScroll = new yr({
|
|
5019
5069
|
getScrollElement: () => this.surface?.getAutoScrollElement() ?? null,
|
|
5020
5070
|
state: this.state.autoScroll
|
|
5021
5071
|
}), this.autofillController = new pr({
|
|
@@ -5077,6 +5127,7 @@ var ji = class {
|
|
|
5077
5127
|
mediaCard: this.options.mediaCard,
|
|
5078
5128
|
masonry: this.options.masonry,
|
|
5079
5129
|
onMediaFullyVisible: this.options.onMediaFullyVisible,
|
|
5130
|
+
onMediaError: this.options.onMediaError,
|
|
5080
5131
|
onMediaReady: this.options.onMediaReady,
|
|
5081
5132
|
onMediaVisible: this.options.onMediaVisible,
|
|
5082
5133
|
onReelMediaChange: this.options.onReelMediaChange,
|
|
@@ -5107,7 +5158,7 @@ var ji = class {
|
|
|
5107
5158
|
this.restoreController?.abort(), this.restoreController = null, this.autoScroll.destroy(), this.fillController.destroy(), this.cancelRequest(), this.reelForward.reset(), this.reelRemoval.reset(), this.exactMediaRemoval.reset(), this.itemRemoval.destroy(), this.removalReconciliation.reset(), this.responsiveLayout.destroy(), this.stopStateWatcher?.(), this.stopStateWatcher = null, this.app?.unmount(), this.app = null, this.surface = null;
|
|
5108
5159
|
}
|
|
5109
5160
|
getState() {
|
|
5110
|
-
return
|
|
5161
|
+
return te(this.state);
|
|
5111
5162
|
}
|
|
5112
5163
|
getReelAudioState() {
|
|
5113
5164
|
return this.reelAudio.get();
|
|
@@ -5369,7 +5420,7 @@ var ji = class {
|
|
|
5369
5420
|
}
|
|
5370
5421
|
startStateNotifications() {
|
|
5371
5422
|
let e = this.options.onStateChange;
|
|
5372
|
-
!e || this.stopStateWatcher || (this.stopStateWatcher =
|
|
5423
|
+
!e || this.stopStateWatcher || (this.stopStateWatcher = K(this.state, this.notificationItems, e));
|
|
5373
5424
|
}
|
|
5374
5425
|
setCurrentCursor(e) {
|
|
5375
5426
|
this.lastLoadedCursor = this.state.current = e;
|