hive-react-kit 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/VideoDetail.d.ts +16 -1
- package/dist/components/user/UserProfilePage.d.ts +9 -1
- package/dist/index.es.js +1385 -1336
- package/dist/index.umd.js +22 -22
- package/package.json +5 -34
- package/dist/components/ui/index.d.ts +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var mr = Object.defineProperty;
|
|
2
2
|
var ur = (t, s, r) => s in t ? mr(t, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[s] = r;
|
|
3
|
-
var
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import { Clock as
|
|
7
|
-
import { formatDistanceToNow as
|
|
3
|
+
var De = (t, s, r) => ur(t, typeof s != "symbol" ? s + "" : s, r);
|
|
4
|
+
import * as Be from "react";
|
|
5
|
+
import xe, { useState as y, useEffect as B, useMemo as gr, useCallback as Ce, useRef as Ie } from "react";
|
|
6
|
+
import { Clock as Pt, Play as ot, ThumbsUp as it, MessageCircle as lt, Eye as Vt, Info as At, Share2 as ct, Heart as hr, Users as ze, RefreshCw as ce, Loader2 as de, X as xr, Send as fr, FileText as pr, ArrowLeft as Le, BookmarkCheck as br, Bookmark as yr, Search as Ze, Calendar as Dt, Rss as Mt, MoreVertical as dt, Upload as vr, Video as Ct, Hourglass as jr, Ban as St } from "lucide-react";
|
|
7
|
+
import { formatDistanceToNow as mt } from "date-fns";
|
|
8
8
|
import * as wr from "@hiveio/dhive";
|
|
9
9
|
import { Client as Nr } from "@hiveio/dhive";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
var
|
|
10
|
+
import Ee from "hls.js";
|
|
11
|
+
import { create as kr } from "zustand";
|
|
12
|
+
import { useNavigate as It } from "react-router-dom";
|
|
13
|
+
var nt = { exports: {} }, Oe = {};
|
|
14
14
|
/**
|
|
15
15
|
* @license React
|
|
16
16
|
* react-jsx-runtime.production.min.js
|
|
@@ -20,21 +20,21 @@ var Ze = { exports: {} }, ke = {};
|
|
|
20
20
|
* This source code is licensed under the MIT license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
var t =
|
|
23
|
+
var Tt;
|
|
24
|
+
function _r() {
|
|
25
|
+
if (Tt) return Oe;
|
|
26
|
+
Tt = 1;
|
|
27
|
+
var t = xe, s = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
28
28
|
function i(u, c, m) {
|
|
29
|
-
var l,
|
|
30
|
-
m !== void 0 && (
|
|
31
|
-
for (l in c)
|
|
32
|
-
if (u && u.defaultProps) for (l in c = u.defaultProps, c)
|
|
33
|
-
return { $$typeof: s, type: u, key:
|
|
29
|
+
var l, f = {}, b = null, p = null;
|
|
30
|
+
m !== void 0 && (b = "" + m), c.key !== void 0 && (b = "" + c.key), c.ref !== void 0 && (p = c.ref);
|
|
31
|
+
for (l in c) n.call(c, l) && !d.hasOwnProperty(l) && (f[l] = c[l]);
|
|
32
|
+
if (u && u.defaultProps) for (l in c = u.defaultProps, c) f[l] === void 0 && (f[l] = c[l]);
|
|
33
|
+
return { $$typeof: s, type: u, key: b, ref: p, props: f, _owner: o.current };
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return Oe.Fragment = r, Oe.jsx = i, Oe.jsxs = i, Oe;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var $e = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -44,62 +44,62 @@ var _e = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
var t =
|
|
51
|
-
function
|
|
52
|
-
if (
|
|
47
|
+
var Ot;
|
|
48
|
+
function Er() {
|
|
49
|
+
return Ot || (Ot = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
var t = xe, s = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), u = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), h = Symbol.iterator, T = "@@iterator";
|
|
51
|
+
function w(a) {
|
|
52
|
+
if (a === null || typeof a != "object")
|
|
53
53
|
return null;
|
|
54
|
-
var
|
|
55
|
-
return typeof
|
|
54
|
+
var x = h && a[h] || a[T];
|
|
55
|
+
return typeof x == "function" ? x : null;
|
|
56
56
|
}
|
|
57
|
-
var
|
|
58
|
-
function
|
|
57
|
+
var k = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
58
|
+
function v(a) {
|
|
59
59
|
{
|
|
60
|
-
for (var
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
for (var x = arguments.length, j = new Array(x > 1 ? x - 1 : 0), E = 1; E < x; E++)
|
|
61
|
+
j[E - 1] = arguments[E];
|
|
62
|
+
D("error", a, j);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function D(a, x, j) {
|
|
66
66
|
{
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
var
|
|
67
|
+
var E = k.ReactDebugCurrentFrame, V = E.getStackAddendum();
|
|
68
|
+
V !== "" && (x += "%s", j = j.concat([V]));
|
|
69
|
+
var M = j.map(function(P) {
|
|
70
70
|
return String(P);
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
M.unshift("Warning: " + x), Function.prototype.apply.call(console[a], console, M);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
function
|
|
78
|
-
return !!(typeof
|
|
75
|
+
var N = !1, R = !1, A = !1, $ = !1, g = !1, C;
|
|
76
|
+
C = Symbol.for("react.module.reference");
|
|
77
|
+
function S(a) {
|
|
78
|
+
return !!(typeof a == "string" || typeof a == "function" || a === n || a === d || g || a === o || a === m || a === l || $ || a === p || N || R || A || typeof a == "object" && a !== null && (a.$$typeof === b || a.$$typeof === f || a.$$typeof === i || a.$$typeof === u || a.$$typeof === c || // This needs to include all possible module reference object
|
|
79
79
|
// types supported by any Flight configuration anywhere since
|
|
80
80
|
// we don't know which Flight build this will end up being used
|
|
81
81
|
// with.
|
|
82
|
-
|
|
82
|
+
a.$$typeof === C || a.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
|
-
function F(
|
|
85
|
-
var
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
88
|
-
var
|
|
89
|
-
return
|
|
84
|
+
function F(a, x, j) {
|
|
85
|
+
var E = a.displayName;
|
|
86
|
+
if (E)
|
|
87
|
+
return E;
|
|
88
|
+
var V = x.displayName || x.name || "";
|
|
89
|
+
return V !== "" ? j + "(" + V + ")" : j;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
91
|
+
function O(a) {
|
|
92
|
+
return a.displayName || "Context";
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
if (
|
|
94
|
+
function _(a) {
|
|
95
|
+
if (a == null)
|
|
96
96
|
return null;
|
|
97
|
-
if (typeof
|
|
98
|
-
return
|
|
99
|
-
if (typeof
|
|
100
|
-
return
|
|
101
|
-
switch (
|
|
102
|
-
case
|
|
97
|
+
if (typeof a.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof a == "function")
|
|
98
|
+
return a.displayName || a.name || null;
|
|
99
|
+
if (typeof a == "string")
|
|
100
|
+
return a;
|
|
101
|
+
switch (a) {
|
|
102
|
+
case n:
|
|
103
103
|
return "Fragment";
|
|
104
104
|
case r:
|
|
105
105
|
return "Portal";
|
|
@@ -112,23 +112,23 @@ function Cr() {
|
|
|
112
112
|
case l:
|
|
113
113
|
return "SuspenseList";
|
|
114
114
|
}
|
|
115
|
-
if (typeof
|
|
116
|
-
switch (
|
|
115
|
+
if (typeof a == "object")
|
|
116
|
+
switch (a.$$typeof) {
|
|
117
117
|
case u:
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var x = a;
|
|
119
|
+
return O(x) + ".Consumer";
|
|
120
120
|
case i:
|
|
121
|
-
var
|
|
122
|
-
return
|
|
121
|
+
var j = a;
|
|
122
|
+
return O(j._context) + ".Provider";
|
|
123
123
|
case c:
|
|
124
|
-
return F(
|
|
125
|
-
case
|
|
126
|
-
var
|
|
127
|
-
return
|
|
128
|
-
case
|
|
129
|
-
var
|
|
124
|
+
return F(a, a.render, "ForwardRef");
|
|
125
|
+
case f:
|
|
126
|
+
var E = a.displayName || null;
|
|
127
|
+
return E !== null ? E : _(a.type) || "Memo";
|
|
128
|
+
case b: {
|
|
129
|
+
var V = a, M = V._payload, P = V._init;
|
|
130
130
|
try {
|
|
131
|
-
return
|
|
131
|
+
return _(P(M));
|
|
132
132
|
} catch {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
@@ -136,103 +136,103 @@ function Cr() {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
139
|
+
var Y = Object.assign, Q = 0, U, H, re, X, ue, Z, we;
|
|
140
|
+
function Ne() {
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
function
|
|
142
|
+
Ne.__reactDisabledLog = !0;
|
|
143
|
+
function I() {
|
|
144
144
|
{
|
|
145
|
-
if (
|
|
146
|
-
U = console.log,
|
|
147
|
-
var
|
|
145
|
+
if (Q === 0) {
|
|
146
|
+
U = console.log, H = console.info, re = console.warn, X = console.error, ue = console.group, Z = console.groupCollapsed, we = console.groupEnd;
|
|
147
|
+
var a = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
150
|
-
value:
|
|
150
|
+
value: Ne,
|
|
151
151
|
writable: !0
|
|
152
152
|
};
|
|
153
153
|
Object.defineProperties(console, {
|
|
154
|
-
info:
|
|
155
|
-
log:
|
|
156
|
-
warn:
|
|
157
|
-
error:
|
|
158
|
-
group:
|
|
159
|
-
groupCollapsed:
|
|
160
|
-
groupEnd:
|
|
154
|
+
info: a,
|
|
155
|
+
log: a,
|
|
156
|
+
warn: a,
|
|
157
|
+
error: a,
|
|
158
|
+
group: a,
|
|
159
|
+
groupCollapsed: a,
|
|
160
|
+
groupEnd: a
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
Q++;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function G() {
|
|
167
167
|
{
|
|
168
|
-
if (
|
|
169
|
-
var
|
|
168
|
+
if (Q--, Q === 0) {
|
|
169
|
+
var a = {
|
|
170
170
|
configurable: !0,
|
|
171
171
|
enumerable: !0,
|
|
172
172
|
writable: !0
|
|
173
173
|
};
|
|
174
174
|
Object.defineProperties(console, {
|
|
175
|
-
log:
|
|
175
|
+
log: Y({}, a, {
|
|
176
176
|
value: U
|
|
177
177
|
}),
|
|
178
|
-
info:
|
|
179
|
-
value:
|
|
178
|
+
info: Y({}, a, {
|
|
179
|
+
value: H
|
|
180
180
|
}),
|
|
181
|
-
warn:
|
|
182
|
-
value:
|
|
181
|
+
warn: Y({}, a, {
|
|
182
|
+
value: re
|
|
183
183
|
}),
|
|
184
|
-
error:
|
|
185
|
-
value:
|
|
184
|
+
error: Y({}, a, {
|
|
185
|
+
value: X
|
|
186
186
|
}),
|
|
187
|
-
group:
|
|
188
|
-
value:
|
|
187
|
+
group: Y({}, a, {
|
|
188
|
+
value: ue
|
|
189
189
|
}),
|
|
190
|
-
groupCollapsed:
|
|
191
|
-
value:
|
|
190
|
+
groupCollapsed: Y({}, a, {
|
|
191
|
+
value: Z
|
|
192
192
|
}),
|
|
193
|
-
groupEnd:
|
|
194
|
-
value:
|
|
193
|
+
groupEnd: Y({}, a, {
|
|
194
|
+
value: we
|
|
195
195
|
})
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
Q < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
201
|
+
var W = k.ReactCurrentDispatcher, me;
|
|
202
|
+
function se(a, x, j) {
|
|
203
203
|
{
|
|
204
|
-
if (
|
|
204
|
+
if (me === void 0)
|
|
205
205
|
try {
|
|
206
206
|
throw Error();
|
|
207
|
-
} catch (
|
|
208
|
-
var
|
|
209
|
-
|
|
207
|
+
} catch (V) {
|
|
208
|
+
var E = V.stack.trim().match(/\n( *(at )?)/);
|
|
209
|
+
me = E && E[1] || "";
|
|
210
210
|
}
|
|
211
211
|
return `
|
|
212
|
-
` +
|
|
212
|
+
` + me + a;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
var
|
|
215
|
+
var oe = !1, ge;
|
|
216
216
|
{
|
|
217
|
-
var
|
|
218
|
-
|
|
217
|
+
var Re = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
+
ge = new Re();
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
if (!
|
|
220
|
+
function Te(a, x) {
|
|
221
|
+
if (!a || oe)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var
|
|
225
|
-
if (
|
|
226
|
-
return
|
|
224
|
+
var j = ge.get(a);
|
|
225
|
+
if (j !== void 0)
|
|
226
|
+
return j;
|
|
227
227
|
}
|
|
228
|
-
var
|
|
229
|
-
|
|
230
|
-
var
|
|
228
|
+
var E;
|
|
229
|
+
oe = !0;
|
|
230
|
+
var V = Error.prepareStackTrace;
|
|
231
231
|
Error.prepareStackTrace = void 0;
|
|
232
|
-
var
|
|
233
|
-
|
|
232
|
+
var M;
|
|
233
|
+
M = W.current, W.current = null, I();
|
|
234
234
|
try {
|
|
235
|
-
if (
|
|
235
|
+
if (x) {
|
|
236
236
|
var P = function() {
|
|
237
237
|
throw Error();
|
|
238
238
|
};
|
|
@@ -243,413 +243,413 @@ function Cr() {
|
|
|
243
243
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
244
244
|
try {
|
|
245
245
|
Reflect.construct(P, []);
|
|
246
|
-
} catch (
|
|
247
|
-
|
|
246
|
+
} catch (ae) {
|
|
247
|
+
E = ae;
|
|
248
248
|
}
|
|
249
|
-
Reflect.construct(
|
|
249
|
+
Reflect.construct(a, [], P);
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
252
|
P.call();
|
|
253
|
-
} catch (
|
|
254
|
-
|
|
253
|
+
} catch (ae) {
|
|
254
|
+
E = ae;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
a.call(P.prototype);
|
|
257
257
|
}
|
|
258
258
|
} else {
|
|
259
259
|
try {
|
|
260
260
|
throw Error();
|
|
261
|
-
} catch (
|
|
262
|
-
|
|
261
|
+
} catch (ae) {
|
|
262
|
+
E = ae;
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
a();
|
|
265
265
|
}
|
|
266
|
-
} catch (
|
|
267
|
-
if (
|
|
268
|
-
for (var
|
|
269
|
-
`),
|
|
270
|
-
`),
|
|
271
|
-
|
|
272
|
-
for (;
|
|
273
|
-
if (
|
|
274
|
-
if (
|
|
266
|
+
} catch (ae) {
|
|
267
|
+
if (ae && E && typeof ae.stack == "string") {
|
|
268
|
+
for (var L = ae.stack.split(`
|
|
269
|
+
`), ee = E.stack.split(`
|
|
270
|
+
`), q = L.length - 1, J = ee.length - 1; q >= 1 && J >= 0 && L[q] !== ee[J]; )
|
|
271
|
+
J--;
|
|
272
|
+
for (; q >= 1 && J >= 0; q--, J--)
|
|
273
|
+
if (L[q] !== ee[J]) {
|
|
274
|
+
if (q !== 1 || J !== 1)
|
|
275
275
|
do
|
|
276
|
-
if (
|
|
277
|
-
var
|
|
278
|
-
` +
|
|
279
|
-
return
|
|
276
|
+
if (q--, J--, J < 0 || L[q] !== ee[J]) {
|
|
277
|
+
var le = `
|
|
278
|
+
` + L[q].replace(" at new ", " at ");
|
|
279
|
+
return a.displayName && le.includes("<anonymous>") && (le = le.replace("<anonymous>", a.displayName)), typeof a == "function" && ge.set(a, le), le;
|
|
280
280
|
}
|
|
281
|
-
while (
|
|
281
|
+
while (q >= 1 && J >= 0);
|
|
282
282
|
break;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
|
-
|
|
286
|
+
oe = !1, W.current = M, G(), Error.prepareStackTrace = V;
|
|
287
287
|
}
|
|
288
|
-
var
|
|
289
|
-
return typeof
|
|
288
|
+
var _e = a ? a.displayName || a.name : "", ve = _e ? se(_e) : "";
|
|
289
|
+
return typeof a == "function" && ge.set(a, ve), ve;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
return
|
|
291
|
+
function Pe(a, x, j) {
|
|
292
|
+
return Te(a, !1);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
var
|
|
296
|
-
return !!(
|
|
294
|
+
function Ve(a) {
|
|
295
|
+
var x = a.prototype;
|
|
296
|
+
return !!(x && x.isReactComponent);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
if (
|
|
298
|
+
function z(a, x, j) {
|
|
299
|
+
if (a == null)
|
|
300
300
|
return "";
|
|
301
|
-
if (typeof
|
|
302
|
-
return
|
|
303
|
-
if (typeof
|
|
304
|
-
return
|
|
305
|
-
switch (
|
|
301
|
+
if (typeof a == "function")
|
|
302
|
+
return Te(a, Ve(a));
|
|
303
|
+
if (typeof a == "string")
|
|
304
|
+
return se(a);
|
|
305
|
+
switch (a) {
|
|
306
306
|
case m:
|
|
307
|
-
return
|
|
307
|
+
return se("Suspense");
|
|
308
308
|
case l:
|
|
309
|
-
return
|
|
309
|
+
return se("SuspenseList");
|
|
310
310
|
}
|
|
311
|
-
if (typeof
|
|
312
|
-
switch (
|
|
311
|
+
if (typeof a == "object")
|
|
312
|
+
switch (a.$$typeof) {
|
|
313
313
|
case c:
|
|
314
|
-
return
|
|
315
|
-
case
|
|
316
|
-
return
|
|
317
|
-
case
|
|
318
|
-
var
|
|
314
|
+
return Pe(a.render);
|
|
315
|
+
case f:
|
|
316
|
+
return z(a.type, x, j);
|
|
317
|
+
case b: {
|
|
318
|
+
var E = a, V = E._payload, M = E._init;
|
|
319
319
|
try {
|
|
320
|
-
return
|
|
320
|
+
return z(M(V), x, j);
|
|
321
321
|
} catch {
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var
|
|
328
|
-
function
|
|
329
|
-
if (
|
|
330
|
-
var
|
|
331
|
-
|
|
327
|
+
var ne = Object.prototype.hasOwnProperty, ie = {}, be = k.ReactDebugCurrentFrame;
|
|
328
|
+
function ye(a) {
|
|
329
|
+
if (a) {
|
|
330
|
+
var x = a._owner, j = z(a.type, a._source, x ? x.type : null);
|
|
331
|
+
be.setExtraStackFrame(j);
|
|
332
332
|
} else
|
|
333
|
-
|
|
333
|
+
be.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Ae(a, x, j, E, V) {
|
|
336
336
|
{
|
|
337
|
-
var
|
|
338
|
-
for (var P in
|
|
339
|
-
if (
|
|
340
|
-
var
|
|
337
|
+
var M = Function.call.bind(ne);
|
|
338
|
+
for (var P in a)
|
|
339
|
+
if (M(a, P)) {
|
|
340
|
+
var L = void 0;
|
|
341
341
|
try {
|
|
342
|
-
if (typeof
|
|
343
|
-
var
|
|
344
|
-
throw
|
|
342
|
+
if (typeof a[P] != "function") {
|
|
343
|
+
var ee = Error((E || "React class") + ": " + j + " type `" + P + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[P] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
|
+
throw ee.name = "Invariant Violation", ee;
|
|
345
345
|
}
|
|
346
|
-
|
|
347
|
-
} catch (
|
|
348
|
-
|
|
346
|
+
L = a[P](x, P, E, j, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
|
+
} catch (q) {
|
|
348
|
+
L = q;
|
|
349
349
|
}
|
|
350
|
-
|
|
350
|
+
L && !(L instanceof Error) && (ye(V), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", E || "React class", j, P, typeof L), ye(null)), L instanceof Error && !(L.message in ie) && (ie[L.message] = !0, ye(V), v("Failed %s type: %s", j, L.message), ye(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
var Bt = Array.isArray;
|
|
355
|
-
function
|
|
356
|
-
return Bt(
|
|
355
|
+
function Je(a) {
|
|
356
|
+
return Bt(a);
|
|
357
357
|
}
|
|
358
|
-
function zt(
|
|
358
|
+
function zt(a) {
|
|
359
359
|
{
|
|
360
|
-
var
|
|
361
|
-
return
|
|
360
|
+
var x = typeof Symbol == "function" && Symbol.toStringTag, j = x && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
361
|
+
return j;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function qt(
|
|
364
|
+
function qt(a) {
|
|
365
365
|
try {
|
|
366
|
-
return
|
|
366
|
+
return xt(a), !1;
|
|
367
367
|
} catch {
|
|
368
368
|
return !0;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
function
|
|
372
|
-
return "" +
|
|
371
|
+
function xt(a) {
|
|
372
|
+
return "" + a;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
if (qt(
|
|
376
|
-
return
|
|
374
|
+
function ft(a) {
|
|
375
|
+
if (qt(a))
|
|
376
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", zt(a)), xt(a);
|
|
377
377
|
}
|
|
378
|
-
var
|
|
378
|
+
var pt = k.ReactCurrentOwner, Yt = {
|
|
379
379
|
key: !0,
|
|
380
380
|
ref: !0,
|
|
381
381
|
__self: !0,
|
|
382
382
|
__source: !0
|
|
383
|
-
},
|
|
384
|
-
function Jt(
|
|
385
|
-
if (
|
|
386
|
-
var
|
|
387
|
-
if (
|
|
383
|
+
}, bt, yt;
|
|
384
|
+
function Jt(a) {
|
|
385
|
+
if (ne.call(a, "ref")) {
|
|
386
|
+
var x = Object.getOwnPropertyDescriptor(a, "ref").get;
|
|
387
|
+
if (x && x.isReactWarning)
|
|
388
388
|
return !1;
|
|
389
389
|
}
|
|
390
|
-
return
|
|
390
|
+
return a.ref !== void 0;
|
|
391
391
|
}
|
|
392
|
-
function Gt(
|
|
393
|
-
if (
|
|
394
|
-
var
|
|
395
|
-
if (
|
|
392
|
+
function Gt(a) {
|
|
393
|
+
if (ne.call(a, "key")) {
|
|
394
|
+
var x = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
395
|
+
if (x && x.isReactWarning)
|
|
396
396
|
return !1;
|
|
397
397
|
}
|
|
398
|
-
return
|
|
398
|
+
return a.key !== void 0;
|
|
399
399
|
}
|
|
400
|
-
function Kt(
|
|
401
|
-
typeof
|
|
400
|
+
function Kt(a, x) {
|
|
401
|
+
typeof a.ref == "string" && pt.current;
|
|
402
402
|
}
|
|
403
|
-
function Qt(
|
|
403
|
+
function Qt(a, x) {
|
|
404
404
|
{
|
|
405
|
-
var
|
|
406
|
-
|
|
405
|
+
var j = function() {
|
|
406
|
+
bt || (bt = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x));
|
|
407
407
|
};
|
|
408
|
-
|
|
409
|
-
get:
|
|
408
|
+
j.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
409
|
+
get: j,
|
|
410
410
|
configurable: !0
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
function Xt(
|
|
414
|
+
function Xt(a, x) {
|
|
415
415
|
{
|
|
416
|
-
var
|
|
417
|
-
|
|
416
|
+
var j = function() {
|
|
417
|
+
yt || (yt = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x));
|
|
418
418
|
};
|
|
419
|
-
|
|
420
|
-
get:
|
|
419
|
+
j.isReactWarning = !0, Object.defineProperty(a, "ref", {
|
|
420
|
+
get: j,
|
|
421
421
|
configurable: !0
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
var Zt = function(
|
|
426
|
-
var
|
|
425
|
+
var Zt = function(a, x, j, E, V, M, P) {
|
|
426
|
+
var L = {
|
|
427
427
|
// This tag allows us to uniquely identify this as a React Element
|
|
428
428
|
$$typeof: s,
|
|
429
429
|
// Built-in properties that belong on the element
|
|
430
|
-
type:
|
|
431
|
-
key:
|
|
432
|
-
ref:
|
|
430
|
+
type: a,
|
|
431
|
+
key: x,
|
|
432
|
+
ref: j,
|
|
433
433
|
props: P,
|
|
434
434
|
// Record the component responsible for creating this element.
|
|
435
|
-
_owner:
|
|
435
|
+
_owner: M
|
|
436
436
|
};
|
|
437
|
-
return
|
|
437
|
+
return L._store = {}, Object.defineProperty(L._store, "validated", {
|
|
438
438
|
configurable: !1,
|
|
439
439
|
enumerable: !1,
|
|
440
440
|
writable: !0,
|
|
441
441
|
value: !1
|
|
442
|
-
}), Object.defineProperty(
|
|
442
|
+
}), Object.defineProperty(L, "_self", {
|
|
443
443
|
configurable: !1,
|
|
444
444
|
enumerable: !1,
|
|
445
445
|
writable: !1,
|
|
446
|
-
value:
|
|
447
|
-
}), Object.defineProperty(
|
|
446
|
+
value: E
|
|
447
|
+
}), Object.defineProperty(L, "_source", {
|
|
448
448
|
configurable: !1,
|
|
449
449
|
enumerable: !1,
|
|
450
450
|
writable: !1,
|
|
451
|
-
value:
|
|
452
|
-
}), Object.freeze && (Object.freeze(
|
|
451
|
+
value: V
|
|
452
|
+
}), Object.freeze && (Object.freeze(L.props), Object.freeze(L)), L;
|
|
453
453
|
};
|
|
454
|
-
function er(
|
|
454
|
+
function er(a, x, j, E, V) {
|
|
455
455
|
{
|
|
456
|
-
var
|
|
457
|
-
|
|
458
|
-
for (
|
|
459
|
-
|
|
460
|
-
if (
|
|
461
|
-
var
|
|
462
|
-
for (
|
|
463
|
-
P[
|
|
456
|
+
var M, P = {}, L = null, ee = null;
|
|
457
|
+
j !== void 0 && (ft(j), L = "" + j), Gt(x) && (ft(x.key), L = "" + x.key), Jt(x) && (ee = x.ref, Kt(x, V));
|
|
458
|
+
for (M in x)
|
|
459
|
+
ne.call(x, M) && !Yt.hasOwnProperty(M) && (P[M] = x[M]);
|
|
460
|
+
if (a && a.defaultProps) {
|
|
461
|
+
var q = a.defaultProps;
|
|
462
|
+
for (M in q)
|
|
463
|
+
P[M] === void 0 && (P[M] = q[M]);
|
|
464
464
|
}
|
|
465
|
-
if (
|
|
466
|
-
var
|
|
467
|
-
|
|
465
|
+
if (L || ee) {
|
|
466
|
+
var J = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
|
|
467
|
+
L && Qt(P, J), ee && Xt(P, J);
|
|
468
468
|
}
|
|
469
|
-
return Zt(
|
|
469
|
+
return Zt(a, L, ee, V, E, pt.current, P);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
var
|
|
473
|
-
function
|
|
474
|
-
if (
|
|
475
|
-
var
|
|
476
|
-
|
|
472
|
+
var Ge = k.ReactCurrentOwner, vt = k.ReactDebugCurrentFrame;
|
|
473
|
+
function ke(a) {
|
|
474
|
+
if (a) {
|
|
475
|
+
var x = a._owner, j = z(a.type, a._source, x ? x.type : null);
|
|
476
|
+
vt.setExtraStackFrame(j);
|
|
477
477
|
} else
|
|
478
|
-
|
|
478
|
+
vt.setExtraStackFrame(null);
|
|
479
479
|
}
|
|
480
|
-
var
|
|
481
|
-
|
|
482
|
-
function
|
|
483
|
-
return typeof
|
|
480
|
+
var Ke;
|
|
481
|
+
Ke = !1;
|
|
482
|
+
function Qe(a) {
|
|
483
|
+
return typeof a == "object" && a !== null && a.$$typeof === s;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function jt() {
|
|
486
486
|
{
|
|
487
|
-
if (
|
|
488
|
-
var
|
|
489
|
-
if (
|
|
487
|
+
if (Ge.current) {
|
|
488
|
+
var a = _(Ge.current.type);
|
|
489
|
+
if (a)
|
|
490
490
|
return `
|
|
491
491
|
|
|
492
|
-
Check the render method of \`` +
|
|
492
|
+
Check the render method of \`` + a + "`.";
|
|
493
493
|
}
|
|
494
494
|
return "";
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function tr(
|
|
497
|
+
function tr(a) {
|
|
498
498
|
return "";
|
|
499
499
|
}
|
|
500
|
-
var
|
|
501
|
-
function rr(
|
|
500
|
+
var wt = {};
|
|
501
|
+
function rr(a) {
|
|
502
502
|
{
|
|
503
|
-
var
|
|
504
|
-
if (!
|
|
505
|
-
var
|
|
506
|
-
|
|
503
|
+
var x = jt();
|
|
504
|
+
if (!x) {
|
|
505
|
+
var j = typeof a == "string" ? a : a.displayName || a.name;
|
|
506
|
+
j && (x = `
|
|
507
507
|
|
|
508
|
-
Check the top-level render call using <` +
|
|
508
|
+
Check the top-level render call using <` + j + ">.");
|
|
509
509
|
}
|
|
510
|
-
return
|
|
510
|
+
return x;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function Nt(a, x) {
|
|
514
514
|
{
|
|
515
|
-
if (!
|
|
515
|
+
if (!a._store || a._store.validated || a.key != null)
|
|
516
516
|
return;
|
|
517
|
-
|
|
518
|
-
var
|
|
519
|
-
if (
|
|
517
|
+
a._store.validated = !0;
|
|
518
|
+
var j = rr(x);
|
|
519
|
+
if (wt[j])
|
|
520
520
|
return;
|
|
521
|
-
|
|
522
|
-
var
|
|
523
|
-
|
|
521
|
+
wt[j] = !0;
|
|
522
|
+
var E = "";
|
|
523
|
+
a && a._owner && a._owner !== Ge.current && (E = " It was passed a child from " + _(a._owner.type) + "."), ke(a), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', j, E), ke(null);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function kt(a, x) {
|
|
527
527
|
{
|
|
528
|
-
if (typeof
|
|
528
|
+
if (typeof a != "object")
|
|
529
529
|
return;
|
|
530
|
-
if (
|
|
531
|
-
for (var
|
|
532
|
-
var
|
|
533
|
-
|
|
530
|
+
if (Je(a))
|
|
531
|
+
for (var j = 0; j < a.length; j++) {
|
|
532
|
+
var E = a[j];
|
|
533
|
+
Qe(E) && Nt(E, x);
|
|
534
534
|
}
|
|
535
|
-
else if (
|
|
536
|
-
|
|
537
|
-
else if (
|
|
538
|
-
var
|
|
539
|
-
if (typeof
|
|
540
|
-
for (var
|
|
541
|
-
|
|
535
|
+
else if (Qe(a))
|
|
536
|
+
a._store && (a._store.validated = !0);
|
|
537
|
+
else if (a) {
|
|
538
|
+
var V = w(a);
|
|
539
|
+
if (typeof V == "function" && V !== a.entries)
|
|
540
|
+
for (var M = V.call(a), P; !(P = M.next()).done; )
|
|
541
|
+
Qe(P.value) && Nt(P.value, x);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function sr(
|
|
545
|
+
function sr(a) {
|
|
546
546
|
{
|
|
547
|
-
var
|
|
548
|
-
if (
|
|
547
|
+
var x = a.type;
|
|
548
|
+
if (x == null || typeof x == "string")
|
|
549
549
|
return;
|
|
550
|
-
var
|
|
551
|
-
if (typeof
|
|
552
|
-
|
|
553
|
-
else if (typeof
|
|
550
|
+
var j;
|
|
551
|
+
if (typeof x == "function")
|
|
552
|
+
j = x.propTypes;
|
|
553
|
+
else if (typeof x == "object" && (x.$$typeof === c || // Note: Memo only checks outer props here.
|
|
554
554
|
// Inner props are checked in the reconciler.
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
x.$$typeof === f))
|
|
556
|
+
j = x.propTypes;
|
|
557
557
|
else
|
|
558
558
|
return;
|
|
559
|
-
if (
|
|
560
|
-
var
|
|
561
|
-
|
|
562
|
-
} else if (
|
|
563
|
-
|
|
564
|
-
var
|
|
565
|
-
|
|
559
|
+
if (j) {
|
|
560
|
+
var E = _(x);
|
|
561
|
+
Ae(j, a.props, "prop", E, a);
|
|
562
|
+
} else if (x.PropTypes !== void 0 && !Ke) {
|
|
563
|
+
Ke = !0;
|
|
564
|
+
var V = _(x);
|
|
565
|
+
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", V || "Unknown");
|
|
566
566
|
}
|
|
567
|
-
typeof
|
|
567
|
+
typeof x.getDefaultProps == "function" && !x.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
function ar(
|
|
570
|
+
function ar(a) {
|
|
571
571
|
{
|
|
572
|
-
for (var
|
|
573
|
-
var
|
|
574
|
-
if (
|
|
575
|
-
|
|
572
|
+
for (var x = Object.keys(a.props), j = 0; j < x.length; j++) {
|
|
573
|
+
var E = x[j];
|
|
574
|
+
if (E !== "children" && E !== "key") {
|
|
575
|
+
ke(a), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), ke(null);
|
|
576
576
|
break;
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
|
|
579
|
+
a.ref !== null && (ke(a), v("Invalid attribute `ref` supplied to `React.Fragment`."), ke(null));
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
var
|
|
583
|
-
function
|
|
582
|
+
var _t = {};
|
|
583
|
+
function Et(a, x, j, E, V, M) {
|
|
584
584
|
{
|
|
585
|
-
var P =
|
|
585
|
+
var P = S(a);
|
|
586
586
|
if (!P) {
|
|
587
|
-
var
|
|
588
|
-
(
|
|
589
|
-
var
|
|
590
|
-
|
|
591
|
-
var
|
|
592
|
-
|
|
587
|
+
var L = "";
|
|
588
|
+
(a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (L += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
589
|
+
var ee = tr();
|
|
590
|
+
ee ? L += ee : L += jt();
|
|
591
|
+
var q;
|
|
592
|
+
a === null ? q = "null" : Je(a) ? q = "array" : a !== void 0 && a.$$typeof === s ? (q = "<" + (_(a.type) || "Unknown") + " />", L = " Did you accidentally export a JSX literal instead of a component?") : q = typeof a, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, L);
|
|
593
593
|
}
|
|
594
|
-
var
|
|
595
|
-
if (
|
|
596
|
-
return
|
|
594
|
+
var J = er(a, x, j, V, M);
|
|
595
|
+
if (J == null)
|
|
596
|
+
return J;
|
|
597
597
|
if (P) {
|
|
598
|
-
var
|
|
599
|
-
if (
|
|
600
|
-
if (
|
|
601
|
-
if (
|
|
602
|
-
for (var
|
|
603
|
-
|
|
604
|
-
Object.freeze && Object.freeze(
|
|
598
|
+
var le = x.children;
|
|
599
|
+
if (le !== void 0)
|
|
600
|
+
if (E)
|
|
601
|
+
if (Je(le)) {
|
|
602
|
+
for (var _e = 0; _e < le.length; _e++)
|
|
603
|
+
kt(le[_e], a);
|
|
604
|
+
Object.freeze && Object.freeze(le);
|
|
605
605
|
} else
|
|
606
|
-
|
|
606
|
+
v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
607
607
|
else
|
|
608
|
-
|
|
608
|
+
kt(le, a);
|
|
609
609
|
}
|
|
610
|
-
if (
|
|
611
|
-
var
|
|
610
|
+
if (ne.call(x, "key")) {
|
|
611
|
+
var ve = _(a), ae = Object.keys(x).filter(function(dr) {
|
|
612
612
|
return dr !== "key";
|
|
613
|
-
}),
|
|
614
|
-
if (!
|
|
615
|
-
var cr =
|
|
616
|
-
|
|
613
|
+
}), Xe = ae.length > 0 ? "{key: someKey, " + ae.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
614
|
+
if (!_t[ve + Xe]) {
|
|
615
|
+
var cr = ae.length > 0 ? "{" + ae.join(": ..., ") + ": ...}" : "{}";
|
|
616
|
+
v(`A props object containing a "key" prop is being spread into JSX:
|
|
617
617
|
let props = %s;
|
|
618
618
|
<%s {...props} />
|
|
619
619
|
React keys must be passed directly to JSX without using spread:
|
|
620
620
|
let props = %s;
|
|
621
|
-
<%s key={someKey} {...props} />`,
|
|
621
|
+
<%s key={someKey} {...props} />`, Xe, ve, cr, ve), _t[ve + Xe] = !0;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
return
|
|
624
|
+
return a === n ? ar(J) : sr(J), J;
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function nr(
|
|
628
|
-
return
|
|
627
|
+
function nr(a, x, j) {
|
|
628
|
+
return Et(a, x, j, !0);
|
|
629
629
|
}
|
|
630
|
-
function or(
|
|
631
|
-
return
|
|
630
|
+
function or(a, x, j) {
|
|
631
|
+
return Et(a, x, j, !1);
|
|
632
632
|
}
|
|
633
633
|
var ir = or, lr = nr;
|
|
634
|
-
|
|
635
|
-
}()),
|
|
634
|
+
$e.Fragment = n, $e.jsx = ir, $e.jsxs = lr;
|
|
635
|
+
}()), $e;
|
|
636
636
|
}
|
|
637
|
-
process.env.NODE_ENV === "production" ?
|
|
638
|
-
var e =
|
|
639
|
-
const
|
|
637
|
+
process.env.NODE_ENV === "production" ? nt.exports = _r() : nt.exports = Er();
|
|
638
|
+
var e = nt.exports;
|
|
639
|
+
const pe = {
|
|
640
640
|
domain: "https://studio.3speak.tv",
|
|
641
641
|
kThreeSpeakApiUrl: "https://studio.3speak.tv/mobile/api",
|
|
642
642
|
userOwnerThumb: (t) => `https://images.hive.blog/u/${t}/avatar`,
|
|
643
643
|
graphQLServerUrl: "https://union.us-02.infra.3speak.tv"
|
|
644
|
-
},
|
|
644
|
+
}, et = new Nr([
|
|
645
645
|
"https://api.hive.blog",
|
|
646
646
|
"https://api.syncad.com",
|
|
647
647
|
"https://api.deathwing.me"
|
|
648
648
|
]);
|
|
649
|
-
class
|
|
649
|
+
class Cr {
|
|
650
650
|
constructor() {
|
|
651
651
|
// Common data fields fragment (for reuse)
|
|
652
|
-
|
|
652
|
+
De(this, "commonFields", `
|
|
653
653
|
items {
|
|
654
654
|
created_at
|
|
655
655
|
title
|
|
@@ -682,9 +682,9 @@ class Sr {
|
|
|
682
682
|
// Generic GraphQL feed fetcher
|
|
683
683
|
async getGQLFeed(s, r) {
|
|
684
684
|
var o, d, i;
|
|
685
|
-
const
|
|
685
|
+
const n = `${pe.graphQLServerUrl}/api/v2/graphql`;
|
|
686
686
|
try {
|
|
687
|
-
const u = await fetch(
|
|
687
|
+
const u = await fetch(n, {
|
|
688
688
|
method: "POST",
|
|
689
689
|
headers: {
|
|
690
690
|
"Content-Type": "application/json"
|
|
@@ -708,7 +708,7 @@ class Sr {
|
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
710
|
async handleLogin(s) {
|
|
711
|
-
const r = `${
|
|
711
|
+
const r = `${pe.domain}/mobile/login`, n = await fetch(r, {
|
|
712
712
|
method: "POST",
|
|
713
713
|
headers: { "Content-Type": "application/json" },
|
|
714
714
|
body: JSON.stringify({
|
|
@@ -718,17 +718,17 @@ class Sr {
|
|
|
718
718
|
username: s.username
|
|
719
719
|
})
|
|
720
720
|
});
|
|
721
|
-
if (
|
|
722
|
-
return await
|
|
723
|
-
throw new Error(`Login API error: ${await
|
|
721
|
+
if (n.ok)
|
|
722
|
+
return await n.json();
|
|
723
|
+
throw new Error(`Login API error: ${await n.text()}`);
|
|
724
724
|
}
|
|
725
725
|
async handleUpvote({
|
|
726
726
|
author: s,
|
|
727
727
|
permlink: r,
|
|
728
|
-
weight:
|
|
728
|
+
weight: n,
|
|
729
729
|
authToken: o
|
|
730
730
|
}) {
|
|
731
|
-
const d = `${
|
|
731
|
+
const d = `${pe.domain}/mobile/vote`, i = await fetch(d, {
|
|
732
732
|
method: "POST",
|
|
733
733
|
headers: {
|
|
734
734
|
"Content-Type": "application/json",
|
|
@@ -737,7 +737,7 @@ class Sr {
|
|
|
737
737
|
body: JSON.stringify({
|
|
738
738
|
author: s,
|
|
739
739
|
permlink: r,
|
|
740
|
-
weight:
|
|
740
|
+
weight: n
|
|
741
741
|
})
|
|
742
742
|
});
|
|
743
743
|
if (i.ok)
|
|
@@ -750,10 +750,10 @@ class Sr {
|
|
|
750
750
|
async handleComment({
|
|
751
751
|
author: s,
|
|
752
752
|
permlink: r,
|
|
753
|
-
body:
|
|
753
|
+
body: n,
|
|
754
754
|
authToken: o
|
|
755
755
|
}) {
|
|
756
|
-
const d = `${
|
|
756
|
+
const d = `${pe.domain}/mobile/comment`, i = await fetch(d, {
|
|
757
757
|
method: "POST",
|
|
758
758
|
headers: {
|
|
759
759
|
"Content-Type": "application/json",
|
|
@@ -762,7 +762,7 @@ class Sr {
|
|
|
762
762
|
body: JSON.stringify({
|
|
763
763
|
author: s,
|
|
764
764
|
permlink: r,
|
|
765
|
-
comment:
|
|
765
|
+
comment: n
|
|
766
766
|
})
|
|
767
767
|
});
|
|
768
768
|
if (i.ok)
|
|
@@ -773,17 +773,17 @@ class Sr {
|
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
async getVideoDetails(s, r) {
|
|
776
|
-
const
|
|
776
|
+
const n = `${pe.kThreeSpeakApiUrl}/video/@${s}/${r}`, o = await fetch(n);
|
|
777
777
|
if (o.ok)
|
|
778
778
|
return await o.json();
|
|
779
779
|
console.error("Failed to fetch video details:", o.statusText);
|
|
780
780
|
}
|
|
781
781
|
// Common feed fetching method to reduce code duplication
|
|
782
|
-
async fetchFeed(s, r,
|
|
782
|
+
async fetchFeed(s, r, n, o, d = { limit: 50, skip: 0 }) {
|
|
783
783
|
const { limit: i = 50, skip: u = 0 } = d, c = `
|
|
784
784
|
query ${s} {
|
|
785
785
|
${r}(
|
|
786
|
-
spkvideo: { ${
|
|
786
|
+
spkvideo: { ${n} }
|
|
787
787
|
feedOptions: ${o}
|
|
788
788
|
pagination: { limit: ${i}, skip: ${u} }
|
|
789
789
|
) {
|
|
@@ -803,12 +803,12 @@ class Sr {
|
|
|
803
803
|
);
|
|
804
804
|
}
|
|
805
805
|
async getHomeVideos(s = 0) {
|
|
806
|
-
const r = `${
|
|
807
|
-
if (
|
|
808
|
-
const o = await
|
|
806
|
+
const r = `${pe.kThreeSpeakApiUrl}/feed/home?skip=${s}`, n = await fetch(r);
|
|
807
|
+
if (n.ok) {
|
|
808
|
+
const o = await n.json();
|
|
809
809
|
return Array.isArray(o) ? o : [];
|
|
810
810
|
} else
|
|
811
|
-
return console.error("Failed to fetch home videos:",
|
|
811
|
+
return console.error("Failed to fetch home videos:", n.statusText), [];
|
|
812
812
|
}
|
|
813
813
|
async getTrendingVideos(s = 0) {
|
|
814
814
|
return await this.fetchFeed(
|
|
@@ -864,8 +864,8 @@ class Sr {
|
|
|
864
864
|
{ skip: r }
|
|
865
865
|
);
|
|
866
866
|
}
|
|
867
|
-
async getSearchFeed(s, r = 0,
|
|
868
|
-
const o =
|
|
867
|
+
async getSearchFeed(s, r = 0, n) {
|
|
868
|
+
const o = n ? `{ byLang: { _eq: "${n}" } }` : "{}", d = `
|
|
869
869
|
query SearchFeed {
|
|
870
870
|
searchFeed(
|
|
871
871
|
searchTerm: "${s}"
|
|
@@ -880,8 +880,8 @@ class Sr {
|
|
|
880
880
|
return this.convertGQLItemsToThreeSpeakVideos(i);
|
|
881
881
|
}
|
|
882
882
|
async getTrendingTags() {
|
|
883
|
-
var
|
|
884
|
-
const s = `${
|
|
883
|
+
var n, o;
|
|
884
|
+
const s = `${pe.graphQLServerUrl}/api/v2/graphql`, r = `
|
|
885
885
|
query TrendingTags {
|
|
886
886
|
trendingTags(limit: 50) {
|
|
887
887
|
tags {
|
|
@@ -909,7 +909,7 @@ class Sr {
|
|
|
909
909
|
throw new Error(
|
|
910
910
|
`GraphQL error: ${i.errors.map((u) => u.message).join(", ")}`
|
|
911
911
|
);
|
|
912
|
-
return ((o = (
|
|
912
|
+
return ((o = (n = i.data) == null ? void 0 : n.trendingTags) == null ? void 0 : o.tags) || [];
|
|
913
913
|
} catch (d) {
|
|
914
914
|
throw console.error("Failed to fetch trending tags:", d), d;
|
|
915
915
|
}
|
|
@@ -917,12 +917,12 @@ class Sr {
|
|
|
917
917
|
// Convert GQL items to ThreeSpeakVideo format
|
|
918
918
|
convertGQLItemsToThreeSpeakVideos(s) {
|
|
919
919
|
return s.map((r) => {
|
|
920
|
-
var o, d, i, u, c, m, l,
|
|
921
|
-
let
|
|
920
|
+
var o, d, i, u, c, m, l, f, b, p, h, T, w, k;
|
|
921
|
+
let n = null;
|
|
922
922
|
try {
|
|
923
|
-
typeof r.spkvideo == "string" ?
|
|
924
|
-
} catch (
|
|
925
|
-
console.error("Error parsing spkvideo JSON",
|
|
923
|
+
typeof r.spkvideo == "string" ? n = JSON.parse(r.spkvideo) : n = r.spkvideo;
|
|
924
|
+
} catch (v) {
|
|
925
|
+
console.error("Error parsing spkvideo JSON", v);
|
|
926
926
|
}
|
|
927
927
|
return {
|
|
928
928
|
title: r.title || "Untitled",
|
|
@@ -930,33 +930,33 @@ class Sr {
|
|
|
930
930
|
permlink: r.permlink || "",
|
|
931
931
|
created: new Date(r.created_at),
|
|
932
932
|
category: r.tags && r.tags.length > 0 ? r.tags[0] : "general",
|
|
933
|
-
duration: (
|
|
934
|
-
thumbnail: (
|
|
933
|
+
duration: (n == null ? void 0 : n.duration) || ((c = (u = (i = (d = r.json_metadata) == null ? void 0 : d.raw) == null ? void 0 : i.video) == null ? void 0 : u.info) == null ? void 0 : c.duration) || 0,
|
|
934
|
+
thumbnail: (n == null ? void 0 : n.thumbnail_url) || ((b = (f = (l = (m = r.json_metadata) == null ? void 0 : m.raw) == null ? void 0 : l.video) == null ? void 0 : f.info) == null ? void 0 : b.thumbnail),
|
|
935
935
|
// Include stats from GraphQL response
|
|
936
|
-
numOfUpvotes: (
|
|
937
|
-
numOfComments: (
|
|
936
|
+
numOfUpvotes: (p = r.stats) == null ? void 0 : p.num_votes,
|
|
937
|
+
numOfComments: (h = r.stats) == null ? void 0 : h.num_comments,
|
|
938
938
|
hiveValue: (T = r.stats) == null ? void 0 : T.total_hive_reward,
|
|
939
939
|
// Store active_voters for later use
|
|
940
|
-
active_votes: ((
|
|
941
|
-
voter:
|
|
942
|
-
percent:
|
|
943
|
-
rshares:
|
|
944
|
-
weight:
|
|
940
|
+
active_votes: ((k = (w = r.stats) == null ? void 0 : w.active_voters) == null ? void 0 : k.map((v) => ({
|
|
941
|
+
voter: v.voter,
|
|
942
|
+
percent: v.percent,
|
|
943
|
+
rshares: v.rshares,
|
|
944
|
+
weight: v.weight
|
|
945
945
|
}))) || []
|
|
946
946
|
};
|
|
947
947
|
});
|
|
948
948
|
}
|
|
949
949
|
async getContentStats(s, r) {
|
|
950
950
|
try {
|
|
951
|
-
const
|
|
951
|
+
const n = await et.call(
|
|
952
952
|
"condenser_api",
|
|
953
953
|
"get_content",
|
|
954
954
|
[s, r]
|
|
955
955
|
);
|
|
956
956
|
return {
|
|
957
|
-
numOfUpvotes: (
|
|
958
|
-
numOfComments: (
|
|
959
|
-
hiveValue:
|
|
957
|
+
numOfUpvotes: (n == null ? void 0 : n.net_votes) ?? 0,
|
|
958
|
+
numOfComments: (n == null ? void 0 : n.children) ?? 0,
|
|
959
|
+
hiveValue: n != null && n.pending_payout_value ? parseFloat(n.pending_payout_value) : 0
|
|
960
960
|
};
|
|
961
961
|
} catch {
|
|
962
962
|
return {
|
|
@@ -968,23 +968,23 @@ class Sr {
|
|
|
968
968
|
}
|
|
969
969
|
async getActiveVotes(s, r) {
|
|
970
970
|
try {
|
|
971
|
-
return await
|
|
971
|
+
return await et.call(
|
|
972
972
|
"condenser_api",
|
|
973
973
|
"get_active_votes",
|
|
974
974
|
[s, r]
|
|
975
975
|
);
|
|
976
|
-
} catch (
|
|
977
|
-
return console.error("Error calling get_active_votes:",
|
|
976
|
+
} catch (n) {
|
|
977
|
+
return console.error("Error calling get_active_votes:", n), [];
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
980
|
async getCommentsList(s, r) {
|
|
981
981
|
try {
|
|
982
|
-
const
|
|
982
|
+
const n = await et.call(
|
|
983
983
|
"bridge",
|
|
984
984
|
"get_discussion",
|
|
985
985
|
[s, r]
|
|
986
986
|
);
|
|
987
|
-
return (Array.isArray(
|
|
987
|
+
return (Array.isArray(n) ? n : n && typeof n == "object" ? Object.values(n) : []).map((d) => {
|
|
988
988
|
const i = d.depth;
|
|
989
989
|
if (typeof i == "string") {
|
|
990
990
|
const c = parseInt(i, 10);
|
|
@@ -1003,42 +1003,42 @@ class Sr {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
return d;
|
|
1005
1005
|
});
|
|
1006
|
-
} catch (
|
|
1007
|
-
return console.error("Error fetching comments list:",
|
|
1006
|
+
} catch (n) {
|
|
1007
|
+
return console.error("Error fetching comments list:", n), [];
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
async getMyVideos(s) {
|
|
1011
|
-
const r = `${
|
|
1011
|
+
const r = `${pe.domain}/mobile/api/my-videos`, n = await fetch(r, {
|
|
1012
1012
|
method: "GET",
|
|
1013
1013
|
headers: {
|
|
1014
1014
|
"Content-Type": "application/json",
|
|
1015
1015
|
Authorization: s
|
|
1016
1016
|
}
|
|
1017
1017
|
});
|
|
1018
|
-
if (
|
|
1019
|
-
const o = await
|
|
1018
|
+
if (n.ok) {
|
|
1019
|
+
const o = await n.json();
|
|
1020
1020
|
return Array.isArray(o) ? o : [];
|
|
1021
1021
|
} else
|
|
1022
|
-
throw console.error("Failed to fetch my videos:",
|
|
1022
|
+
throw console.error("Failed to fetch my videos:", n.statusText), new Error(`Failed to fetch my videos: ${n.status}`);
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
const
|
|
1025
|
+
const te = new Cr(), je = (t) => t ? t.startsWith("Qm") || t.startsWith("baf") ? `https://ipfs-3speak.b-cdn.net/ipfs/${t}` : t.startsWith("http") ? t : t.startsWith("/") ? `https://3speak.tv${t}` : t : "/placeholder.svg", Sr = ({
|
|
1026
1026
|
video: t,
|
|
1027
1027
|
onVideoClick: s,
|
|
1028
1028
|
onAuthorClick: r,
|
|
1029
|
-
isGrid:
|
|
1029
|
+
isGrid: n = !1
|
|
1030
1030
|
}) => {
|
|
1031
|
-
const [o, d] =
|
|
1031
|
+
const [o, d] = y({
|
|
1032
1032
|
numOfUpvotes: t.numOfUpvotes,
|
|
1033
1033
|
numOfComments: t.numOfComments,
|
|
1034
1034
|
hiveValue: t.hiveValue
|
|
1035
1035
|
});
|
|
1036
|
-
|
|
1036
|
+
B(() => {
|
|
1037
1037
|
if (o.numOfUpvotes === void 0 && t.numOfUpvotes === void 0) {
|
|
1038
1038
|
let c = !0;
|
|
1039
1039
|
return (async () => {
|
|
1040
1040
|
try {
|
|
1041
|
-
const m = await
|
|
1041
|
+
const m = await te.getContentStats(
|
|
1042
1042
|
t.author || "",
|
|
1043
1043
|
t.permlink || ""
|
|
1044
1044
|
);
|
|
@@ -1057,8 +1057,8 @@ const Z = new Sr(), fe = (t) => t ? t.startsWith("Qm") || t.startsWith("baf") ?
|
|
|
1057
1057
|
}, [t.author, t.permlink, o.numOfUpvotes, t.numOfUpvotes, t.numOfComments, t.hiveValue]);
|
|
1058
1058
|
const i = (c) => {
|
|
1059
1059
|
if (!c) return "00:00";
|
|
1060
|
-
const m = Math.floor(c), l = Math.floor(m / 3600),
|
|
1061
|
-
return m < 60 ? `00:${
|
|
1060
|
+
const m = Math.floor(c), l = Math.floor(m / 3600), f = Math.floor(m % 3600 / 60), b = m % 60, p = (h) => h.toString().padStart(2, "0");
|
|
1061
|
+
return m < 60 ? `00:${p(b)}` : l === 0 ? `${p(f)}:${p(b)}` : `${p(l)}:${p(f)}:${p(b)}`;
|
|
1062
1062
|
}, u = (c) => c == null ? "" : c >= 1e6 ? `${(c / 1e6).toFixed(1)}M` : c >= 1e3 ? `${(c / 1e3).toFixed(1)}K` : c.toString();
|
|
1063
1063
|
return /* @__PURE__ */ e.jsxs("div", { className: "group bg-card border border-border rounded-xl overflow-hidden shadow-card hover:shadow-card-hover transition-all duration-200 hover:-translate-y-1 cursor-pointer", children: [
|
|
1064
1064
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -1070,7 +1070,7 @@ const Z = new Sr(), fe = (t) => t ? t.startsWith("Qm") || t.startsWith("baf") ?
|
|
|
1070
1070
|
/* @__PURE__ */ e.jsx(
|
|
1071
1071
|
"img",
|
|
1072
1072
|
{
|
|
1073
|
-
src:
|
|
1073
|
+
src: je(t.thumbnail),
|
|
1074
1074
|
alt: t.title,
|
|
1075
1075
|
onError: (c) => {
|
|
1076
1076
|
c.target.src = `https://images.hive.blog/u/${t.author}/avatar`;
|
|
@@ -1079,10 +1079,10 @@ const Z = new Sr(), fe = (t) => t ? t.startsWith("Qm") || t.startsWith("baf") ?
|
|
|
1079
1079
|
}
|
|
1080
1080
|
),
|
|
1081
1081
|
t.duration && /* @__PURE__ */ e.jsxs("div", { className: "absolute bottom-3 right-3 bg-black/80 text-white text-xs px-2 py-1 rounded-md flex items-center gap-1 backdrop-blur-sm", children: [
|
|
1082
|
-
/* @__PURE__ */ e.jsx(
|
|
1082
|
+
/* @__PURE__ */ e.jsx(Pt, { className: "w-3 h-3" }),
|
|
1083
1083
|
i(t.duration)
|
|
1084
1084
|
] }),
|
|
1085
|
-
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-300 bg-black/20", children: /* @__PURE__ */ e.jsx("div", { className: "bg-primary hover:bg-primary-hover rounded-full p-4 transform scale-75 group-hover:scale-100 transition-all duration-300 shadow-lg", children: /* @__PURE__ */ e.jsx(
|
|
1085
|
+
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-300 bg-black/20", children: /* @__PURE__ */ e.jsx("div", { className: "bg-primary hover:bg-primary-hover rounded-full p-4 transform scale-75 group-hover:scale-100 transition-all duration-300 shadow-lg", children: /* @__PURE__ */ e.jsx(ot, { className: "w-6 h-6 text-primary-foreground ml-0.5", fill: "currentColor" }) }) }),
|
|
1086
1086
|
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 bg-gradient-overlay opacity-0 group-hover:opacity-30 transition-opacity duration-300" })
|
|
1087
1087
|
]
|
|
1088
1088
|
}
|
|
@@ -1121,16 +1121,16 @@ const Z = new Sr(), fe = (t) => t ? t.startsWith("Qm") || t.startsWith("baf") ?
|
|
|
1121
1121
|
]
|
|
1122
1122
|
}
|
|
1123
1123
|
),
|
|
1124
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children:
|
|
1124
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: mt(t.created, { addSuffix: !0 }) })
|
|
1125
1125
|
] }),
|
|
1126
1126
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
1127
1127
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
1128
1128
|
o.numOfUpvotes != null && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 text-muted-foreground hover:text-primary transition-colors cursor-pointer", children: [
|
|
1129
|
-
/* @__PURE__ */ e.jsx(
|
|
1129
|
+
/* @__PURE__ */ e.jsx(it, { className: "w-4 h-4" }),
|
|
1130
1130
|
/* @__PURE__ */ e.jsx("span", { children: u(o.numOfUpvotes) })
|
|
1131
1131
|
] }),
|
|
1132
1132
|
o.numOfComments != null && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 text-muted-foreground hover:text-primary transition-colors cursor-pointer", children: [
|
|
1133
|
-
/* @__PURE__ */ e.jsx(
|
|
1133
|
+
/* @__PURE__ */ e.jsx(lt, { className: "w-4 h-4" }),
|
|
1134
1134
|
/* @__PURE__ */ e.jsx("span", { children: u(o.numOfComments) })
|
|
1135
1135
|
] })
|
|
1136
1136
|
] }),
|
|
@@ -1143,12 +1143,12 @@ const Z = new Sr(), fe = (t) => t ? t.startsWith("Qm") || t.startsWith("baf") ?
|
|
|
1143
1143
|
] })
|
|
1144
1144
|
] });
|
|
1145
1145
|
};
|
|
1146
|
-
var
|
|
1147
|
-
const
|
|
1146
|
+
var K = /* @__PURE__ */ ((t) => (t.HOME = "home", t.TRENDING = "trending", t.NEW_VIDEOS = "newVideos", t.FIRST_UPLOADS = "firstUploads", t.USER = "user", t.COMMUNITY = "community", t.RELATED = "related", t.TAG_FEED = "tag_feed", t.SEARCH = "search", t))(K || {});
|
|
1147
|
+
const $t = /* @__PURE__ */ new Map(), Tr = ({
|
|
1148
1148
|
title: t,
|
|
1149
1149
|
author: s,
|
|
1150
1150
|
permlink: r,
|
|
1151
|
-
createdAt:
|
|
1151
|
+
createdAt: n,
|
|
1152
1152
|
video: o,
|
|
1153
1153
|
currentUser: d,
|
|
1154
1154
|
isContentVoted: i = !1,
|
|
@@ -1156,40 +1156,40 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1156
1156
|
onTapComment: c,
|
|
1157
1157
|
onTapUpvote: m,
|
|
1158
1158
|
onTapShare: l,
|
|
1159
|
-
onTapBookmark:
|
|
1160
|
-
onTapAuthor:
|
|
1161
|
-
onTapInfo:
|
|
1159
|
+
onTapBookmark: f,
|
|
1160
|
+
onTapAuthor: b,
|
|
1161
|
+
onTapInfo: p
|
|
1162
1162
|
}) => {
|
|
1163
|
-
const [
|
|
1164
|
-
|
|
1165
|
-
},
|
|
1166
|
-
|
|
1167
|
-
const U =
|
|
1168
|
-
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
comments:
|
|
1172
|
-
upvotes:
|
|
1163
|
+
const [h, T] = y(o.numOfComments || 0), [w, k] = y(o.numOfUpvotes || 0), [v, D] = y(!1), [N, R] = y(!1), [A, $] = y(""), g = (U) => {
|
|
1164
|
+
$(U), R(!0), setTimeout(() => R(!1), 3e3);
|
|
1165
|
+
}, C = (U, H) => `${U}:${H}`;
|
|
1166
|
+
B(() => {
|
|
1167
|
+
const U = C(s, r), H = $t.get(U);
|
|
1168
|
+
H ? (T(H.comments), k(H.upvotes)) : (async () => {
|
|
1169
|
+
const X = await te.getContentStats(s, r);
|
|
1170
|
+
k(X.numOfUpvotes), T(X.numOfComments), $t.set(C(s, r), {
|
|
1171
|
+
comments: X.numOfComments,
|
|
1172
|
+
upvotes: X.numOfUpvotes
|
|
1173
1173
|
});
|
|
1174
1174
|
})();
|
|
1175
1175
|
}, [s, r]);
|
|
1176
|
-
const
|
|
1177
|
-
c ? c(s, r) :
|
|
1176
|
+
const S = () => {
|
|
1177
|
+
c ? c(s, r) : g("Comments feature coming soon!");
|
|
1178
1178
|
}, F = () => {
|
|
1179
|
-
m ? m(s, r) :
|
|
1180
|
-
},
|
|
1179
|
+
m ? m(s, r) : g("Upvote feature requires authentication!");
|
|
1180
|
+
}, O = () => {
|
|
1181
1181
|
if (l)
|
|
1182
1182
|
l(s, r);
|
|
1183
1183
|
else {
|
|
1184
1184
|
const U = `https://3speak.tv/user/${s}/${r}`;
|
|
1185
|
-
navigator.share ? navigator.share({ title: t, url: U }) : (navigator.clipboard.writeText(U),
|
|
1185
|
+
navigator.share ? navigator.share({ title: t, url: U }) : (navigator.clipboard.writeText(U), g("Link copied to clipboard!"));
|
|
1186
1186
|
}
|
|
1187
|
-
},
|
|
1188
|
-
|
|
1189
|
-
|
|
1187
|
+
}, _ = () => {
|
|
1188
|
+
f ? f(s, r) : (D(!v), g(
|
|
1189
|
+
v ? "Removed from bookmarks" : "Added to bookmarks"
|
|
1190
1190
|
));
|
|
1191
|
-
},
|
|
1192
|
-
|
|
1191
|
+
}, Y = () => b == null ? void 0 : b(s, r), Q = () => {
|
|
1192
|
+
p ? p(s, r) : g("Video details coming soon!");
|
|
1193
1193
|
};
|
|
1194
1194
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1195
1195
|
/* @__PURE__ */ e.jsxs("div", { className: "p-6 bg-card border-b border-border", children: [
|
|
@@ -1198,7 +1198,7 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1198
1198
|
/* @__PURE__ */ e.jsx(
|
|
1199
1199
|
"button",
|
|
1200
1200
|
{
|
|
1201
|
-
onClick:
|
|
1201
|
+
onClick: Y,
|
|
1202
1202
|
className: "flex-shrink-0 group",
|
|
1203
1203
|
children: /* @__PURE__ */ e.jsx(
|
|
1204
1204
|
"img",
|
|
@@ -1218,7 +1218,7 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1218
1218
|
/* @__PURE__ */ e.jsxs(
|
|
1219
1219
|
"button",
|
|
1220
1220
|
{
|
|
1221
|
-
onClick:
|
|
1221
|
+
onClick: Y,
|
|
1222
1222
|
className: "font-semibold text-card-foreground hover:text-primary transition-colors text-base",
|
|
1223
1223
|
children: [
|
|
1224
1224
|
"@",
|
|
@@ -1228,13 +1228,13 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1228
1228
|
),
|
|
1229
1229
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4 mt-1 text-sm text-muted-foreground", children: [
|
|
1230
1230
|
o.views && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
1231
|
-
/* @__PURE__ */ e.jsx(
|
|
1231
|
+
/* @__PURE__ */ e.jsx(Vt, { className: "w-4 h-4" }),
|
|
1232
1232
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
1233
1233
|
o.views.toLocaleString(),
|
|
1234
1234
|
" views"
|
|
1235
1235
|
] })
|
|
1236
1236
|
] }),
|
|
1237
|
-
|
|
1237
|
+
n && /* @__PURE__ */ e.jsx("span", { children: mt(n, { addSuffix: !0 }) })
|
|
1238
1238
|
] })
|
|
1239
1239
|
] }) }),
|
|
1240
1240
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
@@ -1242,11 +1242,11 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1242
1242
|
"button",
|
|
1243
1243
|
{
|
|
1244
1244
|
type: "button",
|
|
1245
|
-
onClick:
|
|
1245
|
+
onClick: Q,
|
|
1246
1246
|
className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-muted text-muted-foreground hover:bg-primary/10 hover:text-primary transition-all duration-200",
|
|
1247
1247
|
"aria-label": "Show description",
|
|
1248
1248
|
children: [
|
|
1249
|
-
/* @__PURE__ */ e.jsx(
|
|
1249
|
+
/* @__PURE__ */ e.jsx(At, { className: "w-4 h-4" }),
|
|
1250
1250
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: "Info" })
|
|
1251
1251
|
]
|
|
1252
1252
|
}
|
|
@@ -1255,12 +1255,12 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1255
1255
|
"button",
|
|
1256
1256
|
{
|
|
1257
1257
|
type: "button",
|
|
1258
|
-
onClick:
|
|
1258
|
+
onClick: S,
|
|
1259
1259
|
className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-muted text-muted-foreground hover:bg-primary/10 hover:text-primary transition-all duration-200",
|
|
1260
1260
|
"aria-label": "Show comments",
|
|
1261
1261
|
children: [
|
|
1262
|
-
/* @__PURE__ */ e.jsx(
|
|
1263
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children:
|
|
1262
|
+
/* @__PURE__ */ e.jsx(lt, { className: "w-4 h-4" }),
|
|
1263
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: h })
|
|
1264
1264
|
]
|
|
1265
1265
|
}
|
|
1266
1266
|
),
|
|
@@ -1273,12 +1273,12 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1273
1273
|
"aria-label": "Show upvotes",
|
|
1274
1274
|
children: [
|
|
1275
1275
|
/* @__PURE__ */ e.jsx(
|
|
1276
|
-
|
|
1276
|
+
it,
|
|
1277
1277
|
{
|
|
1278
1278
|
className: `w-4 h-4 ${i ? "fill-current" : ""}`
|
|
1279
1279
|
}
|
|
1280
1280
|
),
|
|
1281
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children:
|
|
1281
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: w })
|
|
1282
1282
|
]
|
|
1283
1283
|
}
|
|
1284
1284
|
),
|
|
@@ -1286,11 +1286,11 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1286
1286
|
"button",
|
|
1287
1287
|
{
|
|
1288
1288
|
type: "button",
|
|
1289
|
-
onClick:
|
|
1289
|
+
onClick: O,
|
|
1290
1290
|
className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-muted text-muted-foreground hover:bg-secondary/10 hover:text-secondary transition-all duration-200",
|
|
1291
1291
|
"aria-label": "Share video",
|
|
1292
1292
|
children: [
|
|
1293
|
-
/* @__PURE__ */ e.jsx(
|
|
1293
|
+
/* @__PURE__ */ e.jsx(ct, { className: "w-4 h-4" }),
|
|
1294
1294
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: "Share" })
|
|
1295
1295
|
]
|
|
1296
1296
|
}
|
|
@@ -1299,17 +1299,17 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1299
1299
|
"button",
|
|
1300
1300
|
{
|
|
1301
1301
|
type: "button",
|
|
1302
|
-
onClick:
|
|
1303
|
-
className: `inline-flex items-center gap-2 px-3 py-2 rounded-lg transition-all duration-200 ${
|
|
1302
|
+
onClick: _,
|
|
1303
|
+
className: `inline-flex items-center gap-2 px-3 py-2 rounded-lg transition-all duration-200 ${v ? "bg-error/10 text-error" : "bg-muted text-muted-foreground hover:bg-error/10 hover:text-error"}`,
|
|
1304
1304
|
"aria-label": "Bookmark video",
|
|
1305
1305
|
children: [
|
|
1306
1306
|
/* @__PURE__ */ e.jsx(
|
|
1307
1307
|
hr,
|
|
1308
1308
|
{
|
|
1309
|
-
className: `w-4 h-4 ${
|
|
1309
|
+
className: `w-4 h-4 ${v ? "fill-current" : ""}`
|
|
1310
1310
|
}
|
|
1311
1311
|
),
|
|
1312
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children:
|
|
1312
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: v ? "Saved" : "Save" })
|
|
1313
1313
|
]
|
|
1314
1314
|
}
|
|
1315
1315
|
)
|
|
@@ -1321,147 +1321,149 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1321
1321
|
" earned"
|
|
1322
1322
|
] }) }),
|
|
1323
1323
|
o.category && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
1324
|
-
/* @__PURE__ */ e.jsx(
|
|
1324
|
+
/* @__PURE__ */ e.jsx(ze, { className: "w-4 h-4 text-muted-foreground" }),
|
|
1325
1325
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground capitalize", children: o.category })
|
|
1326
1326
|
] })
|
|
1327
1327
|
] })
|
|
1328
1328
|
] })
|
|
1329
1329
|
] })
|
|
1330
1330
|
] }),
|
|
1331
|
-
|
|
1331
|
+
N && /* @__PURE__ */ e.jsx("div", { className: "fixed bottom-4 right-4 z-50 animate-slide-up", children: /* @__PURE__ */ e.jsx("div", { className: "bg-card border border-border text-card-foreground rounded-lg px-4 py-3 shadow-lg max-w-sm", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: A }) }) })
|
|
1332
1332
|
] });
|
|
1333
|
-
},
|
|
1333
|
+
}, Me = /* @__PURE__ */ new Map(), ut = ({
|
|
1334
1334
|
feedType: t,
|
|
1335
1335
|
username: s,
|
|
1336
1336
|
communityId: r,
|
|
1337
|
-
tag:
|
|
1337
|
+
tag: n,
|
|
1338
1338
|
onVideoClick: o,
|
|
1339
1339
|
onAuthorClick: d
|
|
1340
1340
|
}) => {
|
|
1341
|
-
const [i, u] =
|
|
1341
|
+
const [i, u] = y([]), [c, m] = y(!0), [l, f] = y(!1), [b, p] = y(null), [h, T] = y(!0), [w, k] = y(0), v = gr(() => {
|
|
1342
1342
|
switch (t) {
|
|
1343
|
-
case
|
|
1343
|
+
case K.USER:
|
|
1344
1344
|
return `user:${s || ""}`;
|
|
1345
|
-
case
|
|
1345
|
+
case K.COMMUNITY:
|
|
1346
1346
|
return `community:${r || ""}`;
|
|
1347
|
-
case
|
|
1348
|
-
return `tag:${
|
|
1347
|
+
case K.TAG_FEED:
|
|
1348
|
+
return `tag:${n || ""}`;
|
|
1349
|
+
case K.SEARCH:
|
|
1350
|
+
return `search:${n || ""}`;
|
|
1349
1351
|
default:
|
|
1350
1352
|
return t;
|
|
1351
1353
|
}
|
|
1352
|
-
}, [t, s, r,
|
|
1353
|
-
async (
|
|
1354
|
-
var
|
|
1355
|
-
if ((
|
|
1356
|
-
if (!
|
|
1357
|
-
let
|
|
1354
|
+
}, [t, s, r, n]), D = Ce(
|
|
1355
|
+
async (g) => {
|
|
1356
|
+
var C, S, F, O, _, Y, Q, U, H, re, X, ue;
|
|
1357
|
+
if ((C = g.author) != null && C.username) {
|
|
1358
|
+
if (!g.permlink) return null;
|
|
1359
|
+
let Z = null;
|
|
1358
1360
|
try {
|
|
1359
|
-
typeof
|
|
1360
|
-
} catch (
|
|
1361
|
-
console.error("Error parsing spkvideo JSON",
|
|
1361
|
+
typeof g.spkvideo == "string" ? Z = JSON.parse(g.spkvideo) : Z = g.spkvideo;
|
|
1362
|
+
} catch (I) {
|
|
1363
|
+
console.error("Error parsing spkvideo JSON", I);
|
|
1362
1364
|
}
|
|
1363
|
-
const
|
|
1365
|
+
const we = je(Z == null ? void 0 : Z.thumbnail_url) || je((_ = (O = (F = (S = g.json_metadata) == null ? void 0 : S.raw) == null ? void 0 : F.video) == null ? void 0 : O.info) == null ? void 0 : _.thumbnail), Ne = (Z == null ? void 0 : Z.duration) || ((H = (U = (Q = (Y = g.json_metadata) == null ? void 0 : Y.raw) == null ? void 0 : Q.video) == null ? void 0 : U.info) == null ? void 0 : H.duration) || 0;
|
|
1364
1366
|
return {
|
|
1365
|
-
title:
|
|
1366
|
-
author:
|
|
1367
|
-
permlink:
|
|
1368
|
-
created: new Date(
|
|
1369
|
-
category:
|
|
1370
|
-
duration:
|
|
1371
|
-
thumbnail:
|
|
1372
|
-
numOfUpvotes: ((
|
|
1373
|
-
numOfComments: ((
|
|
1374
|
-
hiveValue: ((
|
|
1367
|
+
title: g.title || "Untitled",
|
|
1368
|
+
author: g.author.username,
|
|
1369
|
+
permlink: g.permlink,
|
|
1370
|
+
created: new Date(g.created_at),
|
|
1371
|
+
category: g.tags && g.tags.length > 0 ? g.tags[0] : "general",
|
|
1372
|
+
duration: Ne,
|
|
1373
|
+
thumbnail: we,
|
|
1374
|
+
numOfUpvotes: ((re = g.stats) == null ? void 0 : re.num_votes) || g.numOfUpvotes,
|
|
1375
|
+
numOfComments: ((X = g.stats) == null ? void 0 : X.num_comments) || g.numOfComments,
|
|
1376
|
+
hiveValue: ((ue = g.stats) == null ? void 0 : ue.total_hive_reward) || g.hiveValue
|
|
1375
1377
|
};
|
|
1376
1378
|
}
|
|
1377
|
-
return
|
|
1378
|
-
title:
|
|
1379
|
-
author:
|
|
1380
|
-
permlink:
|
|
1381
|
-
created: new Date(
|
|
1382
|
-
category:
|
|
1383
|
-
duration:
|
|
1384
|
-
thumbnail:
|
|
1379
|
+
return g.owner ? {
|
|
1380
|
+
title: g.title || "Untitled",
|
|
1381
|
+
author: g.owner,
|
|
1382
|
+
permlink: g.permlink || "",
|
|
1383
|
+
created: new Date(g.created || Date.now()),
|
|
1384
|
+
category: g.category || "general",
|
|
1385
|
+
duration: g.duration,
|
|
1386
|
+
thumbnail: je(g.thumbnail),
|
|
1385
1387
|
// Use stats from GraphQL if available
|
|
1386
|
-
numOfUpvotes:
|
|
1387
|
-
numOfComments:
|
|
1388
|
-
hiveValue:
|
|
1388
|
+
numOfUpvotes: g.numOfUpvotes,
|
|
1389
|
+
numOfComments: g.numOfComments,
|
|
1390
|
+
hiveValue: g.hiveValue
|
|
1389
1391
|
} : null;
|
|
1390
1392
|
},
|
|
1391
1393
|
[]
|
|
1392
|
-
),
|
|
1393
|
-
async (
|
|
1394
|
+
), N = Ce(
|
|
1395
|
+
async (g, C = !1) => {
|
|
1394
1396
|
try {
|
|
1395
|
-
let
|
|
1397
|
+
let S = [];
|
|
1396
1398
|
switch (t) {
|
|
1397
|
-
case
|
|
1398
|
-
|
|
1399
|
+
case K.SEARCH:
|
|
1400
|
+
n && (S = await te.getSearchFeed(n, g));
|
|
1399
1401
|
break;
|
|
1400
|
-
case
|
|
1401
|
-
|
|
1402
|
+
case K.TAG_FEED:
|
|
1403
|
+
n && (S = await te.getTaggedVideos(n, g));
|
|
1402
1404
|
break;
|
|
1403
|
-
case
|
|
1404
|
-
|
|
1405
|
+
case K.HOME:
|
|
1406
|
+
S = await te.getHomeVideos(g);
|
|
1405
1407
|
break;
|
|
1406
|
-
case
|
|
1407
|
-
|
|
1408
|
+
case K.TRENDING:
|
|
1409
|
+
S = await te.getTrendingVideos(g);
|
|
1408
1410
|
break;
|
|
1409
|
-
case
|
|
1410
|
-
|
|
1411
|
+
case K.NEW_VIDEOS:
|
|
1412
|
+
S = await te.getNewVideos(g);
|
|
1411
1413
|
break;
|
|
1412
|
-
case
|
|
1413
|
-
|
|
1414
|
+
case K.FIRST_UPLOADS:
|
|
1415
|
+
S = await te.getFirstUploadsVideos(g);
|
|
1414
1416
|
break;
|
|
1415
|
-
case
|
|
1416
|
-
s && (
|
|
1417
|
+
case K.USER:
|
|
1418
|
+
s && (S = await te.getUserVideos(s, g));
|
|
1417
1419
|
break;
|
|
1418
|
-
case
|
|
1419
|
-
r && (
|
|
1420
|
+
case K.COMMUNITY:
|
|
1421
|
+
r && (S = await te.getCommunityVideos(
|
|
1420
1422
|
r,
|
|
1421
|
-
|
|
1423
|
+
g
|
|
1422
1424
|
));
|
|
1423
1425
|
break;
|
|
1424
|
-
case
|
|
1425
|
-
s && (
|
|
1426
|
+
case K.RELATED:
|
|
1427
|
+
s && (S = await te.getRelatedVideos(
|
|
1426
1428
|
s,
|
|
1427
|
-
|
|
1429
|
+
g
|
|
1428
1430
|
));
|
|
1429
1431
|
break;
|
|
1430
1432
|
}
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
+
const O = (await Promise.all(
|
|
1434
|
+
S.map(D)
|
|
1433
1435
|
)).filter(
|
|
1434
|
-
(
|
|
1436
|
+
(_) => _ !== null
|
|
1435
1437
|
);
|
|
1436
|
-
|
|
1437
|
-
const
|
|
1438
|
-
return
|
|
1439
|
-
}), T(
|
|
1440
|
-
} catch (
|
|
1441
|
-
|
|
1438
|
+
C ? (u(O), Me.set(v, O)) : u((_) => {
|
|
1439
|
+
const Y = [..._, ...O];
|
|
1440
|
+
return Me.set(v, Y), Y;
|
|
1441
|
+
}), T(S.length >= 20), k(g + S.length), p(null);
|
|
1442
|
+
} catch (S) {
|
|
1443
|
+
p(S instanceof Error ? S.message : "Failed to load videos");
|
|
1442
1444
|
}
|
|
1443
1445
|
},
|
|
1444
|
-
[t, s, r,
|
|
1446
|
+
[t, s, r, n, v, D]
|
|
1445
1447
|
);
|
|
1446
|
-
|
|
1448
|
+
B(() => {
|
|
1447
1449
|
(async () => {
|
|
1448
|
-
m(!0), u([]),
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1450
|
+
m(!0), u([]), k(0);
|
|
1451
|
+
const C = Me.get(v);
|
|
1452
|
+
C != null && C.length && (u(C), m(!1)), await N(0, !0), m(!1);
|
|
1451
1453
|
})();
|
|
1452
|
-
}, [
|
|
1453
|
-
const
|
|
1454
|
-
l || !
|
|
1455
|
-
}, [l,
|
|
1456
|
-
|
|
1457
|
-
}, [
|
|
1458
|
-
|
|
1459
|
-
const
|
|
1460
|
-
window.innerHeight + document.documentElement.scrollTop >= document.documentElement.offsetHeight - 1e3 &&
|
|
1454
|
+
}, [v, N]);
|
|
1455
|
+
const R = Ce(async () => {
|
|
1456
|
+
l || !h || (f(!0), await N(w), f(!1));
|
|
1457
|
+
}, [l, h, w, N]), A = Ce(async () => {
|
|
1458
|
+
Me.delete(v), m(!0), k(0), await N(0, !0), m(!1);
|
|
1459
|
+
}, [v, N]);
|
|
1460
|
+
B(() => {
|
|
1461
|
+
const g = () => {
|
|
1462
|
+
window.innerHeight + document.documentElement.scrollTop >= document.documentElement.offsetHeight - 1e3 && R();
|
|
1461
1463
|
};
|
|
1462
|
-
return window.addEventListener("scroll",
|
|
1463
|
-
}, [
|
|
1464
|
-
const
|
|
1464
|
+
return window.addEventListener("scroll", g), () => window.removeEventListener("scroll", g);
|
|
1465
|
+
}, [R]);
|
|
1466
|
+
const $ = () => /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6", children: Array.from({ length: 8 }).map((g, C) => /* @__PURE__ */ e.jsxs(
|
|
1465
1467
|
"div",
|
|
1466
1468
|
{
|
|
1467
1469
|
className: "bg-card border border-border rounded-xl overflow-hidden animate-pulse",
|
|
@@ -1480,18 +1482,18 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1480
1482
|
] })
|
|
1481
1483
|
]
|
|
1482
1484
|
},
|
|
1483
|
-
|
|
1485
|
+
C
|
|
1484
1486
|
)) });
|
|
1485
|
-
return c && i.length === 0 ? /* @__PURE__ */ e.jsx(
|
|
1487
|
+
return c && i.length === 0 ? /* @__PURE__ */ e.jsx($, {}) : b && i.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center min-h-[400px] space-y-4", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
1486
1488
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-card-foreground mb-2", children: "Failed to load videos" }),
|
|
1487
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground mb-4", children:
|
|
1489
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground mb-4", children: b }),
|
|
1488
1490
|
/* @__PURE__ */ e.jsxs(
|
|
1489
1491
|
"button",
|
|
1490
1492
|
{
|
|
1491
|
-
onClick:
|
|
1493
|
+
onClick: A,
|
|
1492
1494
|
className: "inline-flex items-center justify-center rounded-md border border-border bg-card px-4 py-2 text-sm font-medium text-card-foreground shadow-sm transition-colors hover:bg-card-hover focus:outline-none focus:ring-2 focus:ring-primary",
|
|
1493
1495
|
children: [
|
|
1494
|
-
/* @__PURE__ */ e.jsx(
|
|
1496
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4 mr-2" }),
|
|
1495
1497
|
"Try Again"
|
|
1496
1498
|
]
|
|
1497
1499
|
}
|
|
@@ -1502,10 +1504,10 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1502
1504
|
/* @__PURE__ */ e.jsxs(
|
|
1503
1505
|
"button",
|
|
1504
1506
|
{
|
|
1505
|
-
onClick:
|
|
1507
|
+
onClick: A,
|
|
1506
1508
|
className: "inline-flex items-center justify-center rounded-md border border-border bg-card px-4 py-2 text-sm font-medium text-card-foreground shadow-sm transition-colors hover:bg-card-hover focus:outline-none focus:ring-2 focus:ring-primary",
|
|
1507
1509
|
children: [
|
|
1508
|
-
/* @__PURE__ */ e.jsx(
|
|
1510
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4 mr-2" }),
|
|
1509
1511
|
"Refresh"
|
|
1510
1512
|
]
|
|
1511
1513
|
}
|
|
@@ -1519,38 +1521,38 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1519
1521
|
/* @__PURE__ */ e.jsxs(
|
|
1520
1522
|
"button",
|
|
1521
1523
|
{
|
|
1522
|
-
onClick:
|
|
1524
|
+
onClick: A,
|
|
1523
1525
|
className: "inline-flex items-center justify-center rounded-md border border-border bg-card px-3 py-2 text-sm font-medium text-card-foreground shadow-sm transition-colors hover:bg-card-hover focus:outline-none focus:ring-2 focus:ring-primary",
|
|
1524
1526
|
children: [
|
|
1525
|
-
/* @__PURE__ */ e.jsx(
|
|
1527
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4 mr-2" }),
|
|
1526
1528
|
"Refresh"
|
|
1527
1529
|
]
|
|
1528
1530
|
}
|
|
1529
1531
|
)
|
|
1530
1532
|
] }),
|
|
1531
|
-
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6", children: i.map((
|
|
1532
|
-
|
|
1533
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6", children: i.map((g, C) => /* @__PURE__ */ e.jsx(
|
|
1534
|
+
Sr,
|
|
1533
1535
|
{
|
|
1534
|
-
video:
|
|
1536
|
+
video: g,
|
|
1535
1537
|
onVideoClick: o,
|
|
1536
1538
|
onAuthorClick: d,
|
|
1537
1539
|
isGrid: !0
|
|
1538
1540
|
},
|
|
1539
|
-
`${
|
|
1541
|
+
`${g.author}-${g.permlink}-${C}`
|
|
1540
1542
|
)) }),
|
|
1541
|
-
|
|
1542
|
-
/* @__PURE__ */ e.jsx(
|
|
1543
|
+
h && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-8", children: l ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [
|
|
1544
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-4 h-4 animate-spin" }),
|
|
1543
1545
|
"Loading more videos..."
|
|
1544
1546
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1545
1547
|
"button",
|
|
1546
1548
|
{
|
|
1547
|
-
onClick:
|
|
1549
|
+
onClick: R,
|
|
1548
1550
|
className: "inline-flex items-center justify-center rounded-md border border-border bg-card px-4 py-2 text-sm font-medium text-card-foreground shadow-sm transition-colors hover:bg-card-hover focus:outline-none focus:ring-2 focus:ring-primary",
|
|
1549
1551
|
children: "Load More Videos"
|
|
1550
1552
|
}
|
|
1551
1553
|
) })
|
|
1552
1554
|
] });
|
|
1553
|
-
},
|
|
1555
|
+
}, gt = ({ isOpen: t, onClose: s, title: r, children: n, maxWidth: o = "max-w-2xl" }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
1554
1556
|
/* @__PURE__ */ e.jsx(
|
|
1555
1557
|
"div",
|
|
1556
1558
|
{
|
|
@@ -1570,72 +1572,72 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1570
1572
|
}
|
|
1571
1573
|
)
|
|
1572
1574
|
] }),
|
|
1573
|
-
/* @__PURE__ */ e.jsx("div", { className: "overflow-y-auto max-h-[calc(90vh-80px)] custom-scrollbar", children:
|
|
1575
|
+
/* @__PURE__ */ e.jsx("div", { className: "overflow-y-auto max-h-[calc(90vh-80px)] custom-scrollbar", children: n })
|
|
1574
1576
|
] })
|
|
1575
|
-
] }) : null,
|
|
1576
|
-
const [o, d] =
|
|
1577
|
-
|
|
1577
|
+
] }) : null, Or = ({ author: t, permlink: s, currentUser: r, onClose: n }) => {
|
|
1578
|
+
const [o, d] = y([]), [i, u] = y(!0), [c, m] = y(null), [l, f] = y(""), [b, p] = y(!1);
|
|
1579
|
+
B(() => {
|
|
1578
1580
|
(async () => {
|
|
1579
1581
|
try {
|
|
1580
1582
|
u(!0);
|
|
1581
|
-
const
|
|
1582
|
-
d(
|
|
1583
|
-
} catch (
|
|
1584
|
-
m(
|
|
1583
|
+
const v = (await te.getCommentsList(t, s)).filter((D) => D.depth && D.depth > 0).sort((D, N) => new Date(N.created || 0).getTime() - new Date(D.created || 0).getTime());
|
|
1584
|
+
d(v);
|
|
1585
|
+
} catch (k) {
|
|
1586
|
+
m(k instanceof Error ? k.message : "Failed to load comments");
|
|
1585
1587
|
} finally {
|
|
1586
1588
|
u(!1);
|
|
1587
1589
|
}
|
|
1588
1590
|
})();
|
|
1589
1591
|
}, [t, s]);
|
|
1590
|
-
const
|
|
1592
|
+
const h = async () => {
|
|
1591
1593
|
if (!(!l.trim() || !r))
|
|
1592
1594
|
try {
|
|
1593
|
-
|
|
1594
|
-
} catch (
|
|
1595
|
-
console.error("Failed to submit comment:",
|
|
1595
|
+
p(!0), console.log("Would submit comment:", l), f("");
|
|
1596
|
+
} catch (w) {
|
|
1597
|
+
console.error("Failed to submit comment:", w);
|
|
1596
1598
|
} finally {
|
|
1597
|
-
|
|
1599
|
+
p(!1);
|
|
1598
1600
|
}
|
|
1599
|
-
}, T = (
|
|
1600
|
-
const
|
|
1601
|
+
}, T = (w) => {
|
|
1602
|
+
const k = Math.min(w.depth || 0, 5);
|
|
1601
1603
|
return /* @__PURE__ */ e.jsx(
|
|
1602
1604
|
"div",
|
|
1603
1605
|
{
|
|
1604
|
-
className: `border-l-2 border-border ${
|
|
1606
|
+
className: `border-l-2 border-border ${k > 0 ? `ml-${k * 4}` : ""}`,
|
|
1605
1607
|
children: /* @__PURE__ */ e.jsxs("div", { className: "p-4 bg-muted/30 rounded-r-lg", children: [
|
|
1606
1608
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
1607
1609
|
/* @__PURE__ */ e.jsx(
|
|
1608
1610
|
"img",
|
|
1609
1611
|
{
|
|
1610
|
-
src: `https://images.hive.blog/u/${
|
|
1611
|
-
alt:
|
|
1612
|
+
src: `https://images.hive.blog/u/${w.author}/avatar`,
|
|
1613
|
+
alt: w.author,
|
|
1612
1614
|
className: "w-6 h-6 rounded-full object-cover border border-border",
|
|
1613
|
-
onError: (
|
|
1614
|
-
|
|
1615
|
+
onError: (v) => {
|
|
1616
|
+
v.target.src = `https://ui-avatars.com/api/?name=${w.author}&background=random`;
|
|
1615
1617
|
}
|
|
1616
1618
|
}
|
|
1617
1619
|
),
|
|
1618
1620
|
/* @__PURE__ */ e.jsxs("span", { className: "font-medium text-card-foreground text-sm", children: [
|
|
1619
1621
|
"@",
|
|
1620
|
-
|
|
1622
|
+
w.author
|
|
1621
1623
|
] }),
|
|
1622
|
-
|
|
1624
|
+
w.created && /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: mt(new Date(w.created), { addSuffix: !0 }) })
|
|
1623
1625
|
] }),
|
|
1624
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-sm text-card-foreground leading-relaxed", children:
|
|
1625
|
-
|
|
1626
|
-
|
|
1626
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-sm text-card-foreground leading-relaxed", children: w.body || "No content" }),
|
|
1627
|
+
w.net_votes && w.net_votes > 0 && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1 mt-2", children: /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
1628
|
+
w.net_votes,
|
|
1627
1629
|
" votes"
|
|
1628
1630
|
] }) })
|
|
1629
1631
|
] })
|
|
1630
1632
|
},
|
|
1631
|
-
`${
|
|
1633
|
+
`${w.author}-${w.permlink}`
|
|
1632
1634
|
);
|
|
1633
1635
|
};
|
|
1634
1636
|
return /* @__PURE__ */ e.jsx(
|
|
1635
|
-
|
|
1637
|
+
gt,
|
|
1636
1638
|
{
|
|
1637
1639
|
isOpen: !0,
|
|
1638
|
-
onClose:
|
|
1640
|
+
onClose: n,
|
|
1639
1641
|
title: `Comments (${o.length})`,
|
|
1640
1642
|
maxWidth: "max-w-2xl",
|
|
1641
1643
|
children: /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
|
|
@@ -1653,7 +1655,7 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1653
1655
|
"textarea",
|
|
1654
1656
|
{
|
|
1655
1657
|
value: l,
|
|
1656
|
-
onChange: (
|
|
1658
|
+
onChange: (w) => f(w.target.value),
|
|
1657
1659
|
placeholder: "Write a comment...",
|
|
1658
1660
|
className: "w-full p-3 bg-background border border-border rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-primary",
|
|
1659
1661
|
rows: 3
|
|
@@ -1662,38 +1664,38 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1662
1664
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ e.jsxs(
|
|
1663
1665
|
"button",
|
|
1664
1666
|
{
|
|
1665
|
-
onClick:
|
|
1666
|
-
disabled: !l.trim() ||
|
|
1667
|
+
onClick: h,
|
|
1668
|
+
disabled: !l.trim() || b,
|
|
1667
1669
|
className: "inline-flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary-hover disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1668
1670
|
children: [
|
|
1669
|
-
|
|
1670
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children:
|
|
1671
|
+
b ? /* @__PURE__ */ e.jsx(de, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ e.jsx(fr, { className: "w-4 h-4" }),
|
|
1672
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: b ? "Posting..." : "Post Comment" })
|
|
1671
1673
|
]
|
|
1672
1674
|
}
|
|
1673
1675
|
) })
|
|
1674
1676
|
] })
|
|
1675
1677
|
] }) }),
|
|
1676
1678
|
i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
|
|
1677
|
-
/* @__PURE__ */ e.jsx(
|
|
1679
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-6 h-6 animate-spin text-primary" }),
|
|
1678
1680
|
/* @__PURE__ */ e.jsx("span", { className: "ml-2 text-muted-foreground", children: "Loading comments..." })
|
|
1679
1681
|
] }) : c ? /* @__PURE__ */ e.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ e.jsx("p", { className: "text-error", children: c }) }) : o.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "text-center py-8", children: [
|
|
1680
|
-
/* @__PURE__ */ e.jsx(
|
|
1682
|
+
/* @__PURE__ */ e.jsx(lt, { className: "w-12 h-12 text-muted-foreground mx-auto mb-2" }),
|
|
1681
1683
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground", children: "No comments yet" }),
|
|
1682
1684
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Be the first to share your thoughts!" })
|
|
1683
1685
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: o.map(T) })
|
|
1684
1686
|
] })
|
|
1685
1687
|
}
|
|
1686
1688
|
);
|
|
1687
|
-
},
|
|
1688
|
-
const [
|
|
1689
|
-
|
|
1689
|
+
}, $r = ({ author: t, permlink: s, onClose: r }) => {
|
|
1690
|
+
const [n, o] = y([]), [d, i] = y(!0), [u, c] = y(null);
|
|
1691
|
+
B(() => {
|
|
1690
1692
|
(async () => {
|
|
1691
1693
|
try {
|
|
1692
1694
|
i(!0);
|
|
1693
|
-
const
|
|
1694
|
-
o(
|
|
1695
|
-
} catch (
|
|
1696
|
-
c(
|
|
1695
|
+
const b = (await te.getActiveVotes(t, s)).sort((p, h) => h.rshares - p.rshares);
|
|
1696
|
+
o(b);
|
|
1697
|
+
} catch (f) {
|
|
1698
|
+
c(f instanceof Error ? f.message : "Failed to load votes");
|
|
1697
1699
|
} finally {
|
|
1698
1700
|
i(!1);
|
|
1699
1701
|
}
|
|
@@ -1701,19 +1703,19 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1701
1703
|
}, [t, s]);
|
|
1702
1704
|
const m = (l) => l >= 1e9 ? `${(l / 1e9).toFixed(1)}B` : l >= 1e6 ? `${(l / 1e6).toFixed(1)}M` : l >= 1e3 ? `${(l / 1e3).toFixed(1)}K` : l.toString();
|
|
1703
1705
|
return /* @__PURE__ */ e.jsx(
|
|
1704
|
-
|
|
1706
|
+
gt,
|
|
1705
1707
|
{
|
|
1706
1708
|
isOpen: !0,
|
|
1707
1709
|
onClose: r,
|
|
1708
|
-
title: `Votes (${
|
|
1710
|
+
title: `Votes (${n.length})`,
|
|
1709
1711
|
maxWidth: "max-w-md",
|
|
1710
1712
|
children: /* @__PURE__ */ e.jsx("div", { className: "p-6", children: d ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
|
|
1711
|
-
/* @__PURE__ */ e.jsx(
|
|
1713
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-6 h-6 animate-spin text-primary" }),
|
|
1712
1714
|
/* @__PURE__ */ e.jsx("span", { className: "ml-2 text-muted-foreground", children: "Loading votes..." })
|
|
1713
|
-
] }) : u ? /* @__PURE__ */ e.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ e.jsx("p", { className: "text-error", children: u }) }) :
|
|
1714
|
-
/* @__PURE__ */ e.jsx(
|
|
1715
|
+
] }) : u ? /* @__PURE__ */ e.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ e.jsx("p", { className: "text-error", children: u }) }) : n.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "text-center py-8", children: [
|
|
1716
|
+
/* @__PURE__ */ e.jsx(it, { className: "w-12 h-12 text-muted-foreground mx-auto mb-2" }),
|
|
1715
1717
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground", children: "No votes yet" })
|
|
1716
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children:
|
|
1718
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: n.map((l, f) => /* @__PURE__ */ e.jsxs(
|
|
1717
1719
|
"div",
|
|
1718
1720
|
{
|
|
1719
1721
|
className: "flex items-center justify-between p-3 rounded-lg bg-muted/50 hover:bg-muted transition-colors",
|
|
@@ -1725,8 +1727,8 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1725
1727
|
src: `https://images.hive.blog/u/${l.voter}/avatar`,
|
|
1726
1728
|
alt: l.voter,
|
|
1727
1729
|
className: "w-8 h-8 rounded-full object-cover border border-border",
|
|
1728
|
-
onError: (
|
|
1729
|
-
|
|
1730
|
+
onError: (b) => {
|
|
1731
|
+
b.target.src = `https://ui-avatars.com/api/?name=${l.voter}&background=random`;
|
|
1730
1732
|
}
|
|
1731
1733
|
}
|
|
1732
1734
|
),
|
|
@@ -1750,15 +1752,15 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1750
1752
|
] })
|
|
1751
1753
|
]
|
|
1752
1754
|
},
|
|
1753
|
-
`${l.voter}-${
|
|
1755
|
+
`${l.voter}-${f}`
|
|
1754
1756
|
)) }) })
|
|
1755
1757
|
}
|
|
1756
1758
|
);
|
|
1757
|
-
},
|
|
1758
|
-
|
|
1759
|
+
}, Fr = ({ author: t, permlink: s, content: r, onClose: n }) => /* @__PURE__ */ e.jsx(
|
|
1760
|
+
gt,
|
|
1759
1761
|
{
|
|
1760
1762
|
isOpen: !0,
|
|
1761
|
-
onClose:
|
|
1763
|
+
onClose: n,
|
|
1762
1764
|
title: "Video Description",
|
|
1763
1765
|
maxWidth: "max-w-2xl",
|
|
1764
1766
|
children: /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
|
|
@@ -1780,35 +1782,35 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1780
1782
|
] }) })
|
|
1781
1783
|
] })
|
|
1782
1784
|
}
|
|
1783
|
-
),
|
|
1784
|
-
const
|
|
1785
|
-
|
|
1785
|
+
), ps = ({ username: t, permlink: s, onAuthorClick: r, onVideoClick: n, onTagClick: o, onBack: d, onCommentsModal: i, onUpvotesModal: u, onDescriptionModal: c, onVideoInfo: m, onShare: l, onBookmark: f } = {}) => {
|
|
1786
|
+
const b = t, p = s, [h, T] = y(null), [w, k] = y(!0), [v, D] = y(null), [N, R] = y(!1), [A, $] = y(null), [g, C] = y(!1), [S, F] = y(!1), [O, _] = y(!1), [Y, Q] = y(!1), U = Ie(null), H = Ie(null), re = Ie(null);
|
|
1787
|
+
B(() => {
|
|
1786
1788
|
(async () => {
|
|
1787
|
-
if (!(!
|
|
1789
|
+
if (!(!b || !p))
|
|
1788
1790
|
try {
|
|
1789
|
-
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1792
|
-
} catch (
|
|
1793
|
-
|
|
1791
|
+
k(!0), D(null);
|
|
1792
|
+
const G = await te.getVideoDetails(b, p);
|
|
1793
|
+
T(G), R(!1), $(null);
|
|
1794
|
+
} catch (G) {
|
|
1795
|
+
D(G instanceof Error ? G.message : "Failed to load video");
|
|
1794
1796
|
} finally {
|
|
1795
|
-
|
|
1797
|
+
k(!1);
|
|
1796
1798
|
}
|
|
1797
1799
|
})();
|
|
1798
|
-
}, [
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1801
|
-
const
|
|
1802
|
-
if (!
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1800
|
+
}, [b, p]);
|
|
1801
|
+
const X = (I) => I ? I.startsWith("ipfs://") ? `https://ipfs-3speak.b-cdn.net/ipfs/${I.replace("ipfs://", "").split("/")[0]}/manifest.m3u8` : I : "";
|
|
1802
|
+
B(() => ((async () => {
|
|
1803
|
+
const G = h == null ? void 0 : h.video_v2;
|
|
1804
|
+
if (!N || !G || !U.current) return;
|
|
1805
|
+
const W = U.current, me = X(G);
|
|
1806
|
+
H.current && (H.current.destroy(), H.current = null), W.src = "", W.load();
|
|
1805
1807
|
try {
|
|
1806
|
-
let
|
|
1807
|
-
const
|
|
1808
|
-
|
|
1808
|
+
let se = !1;
|
|
1809
|
+
const oe = () => {
|
|
1810
|
+
se || (se = !0, W.play().then(() => $(null)).catch((z) => $(`Playback failed: ${z.message}`)));
|
|
1809
1811
|
};
|
|
1810
|
-
if (
|
|
1811
|
-
const
|
|
1812
|
+
if (Ee.isSupported()) {
|
|
1813
|
+
const z = new Ee({
|
|
1812
1814
|
debug: !1,
|
|
1813
1815
|
enableWorker: !1,
|
|
1814
1816
|
lowLatencyMode: !1,
|
|
@@ -1818,77 +1820,77 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1818
1820
|
maxMaxBufferLength: 600,
|
|
1819
1821
|
startLevel: -1
|
|
1820
1822
|
});
|
|
1821
|
-
|
|
1822
|
-
}),
|
|
1823
|
-
if (
|
|
1824
|
-
switch (
|
|
1825
|
-
case
|
|
1826
|
-
|
|
1823
|
+
H.current = z, z.on(Ee.Events.MANIFEST_PARSED, () => {
|
|
1824
|
+
}), z.on(Ee.Events.ERROR, (ne, ie) => {
|
|
1825
|
+
if (ie.fatal)
|
|
1826
|
+
switch (ie.type) {
|
|
1827
|
+
case Ee.ErrorTypes.NETWORK_ERROR:
|
|
1828
|
+
$("Network error, retrying..."), setTimeout(() => z.startLoad(), 1e3);
|
|
1827
1829
|
break;
|
|
1828
|
-
case
|
|
1829
|
-
|
|
1830
|
+
case Ee.ErrorTypes.MEDIA_ERROR:
|
|
1831
|
+
$("Media error, retrying..."), setTimeout(() => z.recoverMediaError(), 1e3);
|
|
1830
1832
|
break;
|
|
1831
1833
|
default:
|
|
1832
|
-
|
|
1834
|
+
$(`Fatal error: ${ie.details}`), z.destroy(), H.current = null;
|
|
1833
1835
|
break;
|
|
1834
1836
|
}
|
|
1835
|
-
}),
|
|
1836
|
-
} else if (
|
|
1837
|
-
|
|
1837
|
+
}), z.attachMedia(W), z.loadSource(me);
|
|
1838
|
+
} else if (W.canPlayType("application/vnd.apple.mpegurl"))
|
|
1839
|
+
W.src = me;
|
|
1838
1840
|
else {
|
|
1839
|
-
const
|
|
1841
|
+
const z = me.replace(
|
|
1840
1842
|
"/manifest.m3u8",
|
|
1841
1843
|
"/480p/index.m3u8"
|
|
1842
1844
|
);
|
|
1843
|
-
|
|
1844
|
-
}
|
|
1845
|
-
const
|
|
1846
|
-
|
|
1847
|
-
},
|
|
1848
|
-
var
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
`Video error: ${((
|
|
1852
|
-
),
|
|
1853
|
-
},
|
|
1854
|
-
|
|
1855
|
-
const
|
|
1856
|
-
var
|
|
1857
|
-
const
|
|
1845
|
+
W.src = z;
|
|
1846
|
+
}
|
|
1847
|
+
const ge = () => C(!0), Re = () => {
|
|
1848
|
+
C(!1), oe();
|
|
1849
|
+
}, Te = (z) => {
|
|
1850
|
+
var ie;
|
|
1851
|
+
const ne = z.target;
|
|
1852
|
+
$(
|
|
1853
|
+
`Video error: ${((ie = ne.error) == null ? void 0 : ie.message) || "Unknown error"}`
|
|
1854
|
+
), C(!1);
|
|
1855
|
+
}, Pe = () => C(!1);
|
|
1856
|
+
W.addEventListener("loadstart", ge), W.addEventListener("canplay", Re), W.addEventListener("error", Te), W.addEventListener("loadeddata", Pe);
|
|
1857
|
+
const Ve = async () => {
|
|
1858
|
+
var ne, ie, be, ye;
|
|
1859
|
+
const z = !!document.fullscreenElement;
|
|
1858
1860
|
try {
|
|
1859
|
-
|
|
1861
|
+
z ? "orientation" in screen && await (((ie = (ne = screen.orientation) == null ? void 0 : ne.lock) == null ? void 0 : ie.call(ne, "landscape")) ?? Promise.resolve()) : "orientation" in screen && ((ye = (be = screen.orientation) == null ? void 0 : be.unlock) == null || ye.call(be));
|
|
1860
1862
|
} catch {
|
|
1861
1863
|
}
|
|
1862
1864
|
};
|
|
1863
|
-
return document.addEventListener("fullscreenchange",
|
|
1864
|
-
document.removeEventListener("fullscreenchange",
|
|
1865
|
+
return document.addEventListener("fullscreenchange", Ve), re.current = () => {
|
|
1866
|
+
document.removeEventListener("fullscreenchange", Ve);
|
|
1865
1867
|
}, () => {
|
|
1866
|
-
|
|
1868
|
+
W.removeEventListener("loadstart", ge), W.removeEventListener("canplay", Re), W.removeEventListener("error", Te), W.removeEventListener("loadeddata", Pe), re.current && re.current();
|
|
1867
1869
|
};
|
|
1868
|
-
} catch (
|
|
1869
|
-
|
|
1870
|
-
`Setup error: ${
|
|
1870
|
+
} catch (se) {
|
|
1871
|
+
$(
|
|
1872
|
+
`Setup error: ${se instanceof Error ? se.message : "Unknown"}`
|
|
1871
1873
|
);
|
|
1872
1874
|
}
|
|
1873
1875
|
})(), () => {
|
|
1874
|
-
|
|
1875
|
-
}), [
|
|
1876
|
-
const
|
|
1877
|
-
if (!(
|
|
1878
|
-
|
|
1876
|
+
H.current && (H.current.destroy(), H.current = null);
|
|
1877
|
+
}), [N, h == null ? void 0 : h.video_v2]);
|
|
1878
|
+
const ue = () => {
|
|
1879
|
+
if (!(h == null ? void 0 : h.video_v2)) {
|
|
1880
|
+
$("No video source available");
|
|
1879
1881
|
return;
|
|
1880
1882
|
}
|
|
1881
|
-
|
|
1882
|
-
},
|
|
1883
|
-
|
|
1884
|
-
},
|
|
1885
|
-
r(
|
|
1886
|
-
},
|
|
1887
|
-
if (!
|
|
1888
|
-
const
|
|
1889
|
-
return
|
|
1883
|
+
R(!0), $(null), C(!0);
|
|
1884
|
+
}, Z = (I) => {
|
|
1885
|
+
n && n(I);
|
|
1886
|
+
}, we = (I) => {
|
|
1887
|
+
r && r(I);
|
|
1888
|
+
}, Ne = (I) => {
|
|
1889
|
+
if (!I) return "00:00";
|
|
1890
|
+
const G = Math.floor(I), W = Math.floor(G / 3600), me = Math.floor(G % 3600 / 60), se = G % 60, oe = (ge) => ge.toString().padStart(2, "0");
|
|
1891
|
+
return G < 60 ? `00:${oe(se)}` : W === 0 ? `${oe(me)}:${oe(se)}` : `${oe(W)}:${oe(me)}:${oe(se)}`;
|
|
1890
1892
|
};
|
|
1891
|
-
return
|
|
1893
|
+
return w ? /* @__PURE__ */ e.jsxs("div", { className: "min-h-screen bg-background", children: [
|
|
1892
1894
|
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-50 w-full bg-background border-b border-border", children: /* @__PURE__ */ e.jsx("div", { className: "container mx-auto px-4 py-3", children: /* @__PURE__ */ e.jsx("div", { className: "h-8 w-24 bg-muted rounded-full animate-pulse" }) }) }),
|
|
1893
1895
|
/* @__PURE__ */ e.jsx("div", { className: "container mx-auto px-4 py-8 max-w-6xl", children: /* @__PURE__ */ e.jsxs("div", { className: "animate-pulse space-y-6", children: [
|
|
1894
1896
|
/* @__PURE__ */ e.jsx("div", { className: "aspect-video bg-muted rounded-xl" }),
|
|
@@ -1897,16 +1899,18 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1897
1899
|
/* @__PURE__ */ e.jsx("div", { className: "h-4 bg-muted rounded w-1/2" })
|
|
1898
1900
|
] })
|
|
1899
1901
|
] }) })
|
|
1900
|
-
] }) :
|
|
1902
|
+
] }) : v || !h ? /* @__PURE__ */ e.jsx("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center max-w-md mx-auto px-4", children: [
|
|
1901
1903
|
/* @__PURE__ */ e.jsx("h2", { className: "text-xl font-semibold text-card-foreground mb-2", children: "Failed to Load Video" }),
|
|
1902
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground mb-4", children:
|
|
1904
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground mb-4", children: v || "Video not found" }),
|
|
1903
1905
|
/* @__PURE__ */ e.jsxs(
|
|
1904
1906
|
"button",
|
|
1905
1907
|
{
|
|
1906
|
-
onClick: () =>
|
|
1908
|
+
onClick: () => {
|
|
1909
|
+
d && d();
|
|
1910
|
+
},
|
|
1907
1911
|
className: "inline-flex items-center gap-2 px-4 py-2 bg-card border border-border text-card-foreground rounded-lg hover:bg-card-hover transition-colors",
|
|
1908
1912
|
children: [
|
|
1909
|
-
/* @__PURE__ */ e.jsx(
|
|
1913
|
+
/* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4" }),
|
|
1910
1914
|
"Go Back"
|
|
1911
1915
|
]
|
|
1912
1916
|
}
|
|
@@ -1915,41 +1919,43 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1915
1919
|
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-50 w-full bg-background/95 backdrop-blur-sm border-b border-border", children: /* @__PURE__ */ e.jsx("div", { className: "container mx-auto px-4 py-3", children: /* @__PURE__ */ e.jsxs(
|
|
1916
1920
|
"button",
|
|
1917
1921
|
{
|
|
1918
|
-
onClick: () =>
|
|
1922
|
+
onClick: () => {
|
|
1923
|
+
d && d();
|
|
1924
|
+
},
|
|
1919
1925
|
className: "inline-flex items-center gap-2 text-muted-foreground hover:text-card-foreground transition-colors",
|
|
1920
1926
|
children: [
|
|
1921
|
-
/* @__PURE__ */ e.jsx(
|
|
1927
|
+
/* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4" }),
|
|
1922
1928
|
"Back"
|
|
1923
1929
|
]
|
|
1924
1930
|
}
|
|
1925
1931
|
) }) }),
|
|
1926
1932
|
/* @__PURE__ */ e.jsx("div", { className: "container mx-auto px-4 py-8 max-w-6xl", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-8", children: [
|
|
1927
1933
|
/* @__PURE__ */ e.jsxs("div", { className: "lg:col-span-2 space-y-6", children: [
|
|
1928
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-full aspect-video bg-black rounded-xl overflow-hidden relative shadow-card", children:
|
|
1934
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full aspect-video bg-black rounded-xl overflow-hidden relative shadow-card", children: N ? /* @__PURE__ */ e.jsxs("div", { className: "relative w-full h-full", children: [
|
|
1929
1935
|
/* @__PURE__ */ e.jsx(
|
|
1930
1936
|
"video",
|
|
1931
1937
|
{
|
|
1932
|
-
ref:
|
|
1938
|
+
ref: U,
|
|
1933
1939
|
controls: !0,
|
|
1934
|
-
poster:
|
|
1940
|
+
poster: je(h.thumbnail),
|
|
1935
1941
|
className: "w-full h-full object-contain bg-black",
|
|
1936
|
-
onDoubleClick: async (
|
|
1937
|
-
const
|
|
1942
|
+
onDoubleClick: async (I) => {
|
|
1943
|
+
const G = I.currentTarget;
|
|
1938
1944
|
try {
|
|
1939
|
-
document.fullscreenElement ? await document.exitFullscreen() : await
|
|
1945
|
+
document.fullscreenElement ? await document.exitFullscreen() : await G.requestFullscreen();
|
|
1940
1946
|
} catch {
|
|
1941
1947
|
}
|
|
1942
1948
|
}
|
|
1943
1949
|
}
|
|
1944
1950
|
),
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
/* @__PURE__ */ e.jsx("p", { className: "mb-4", children:
|
|
1951
|
+
g && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ e.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-primary" }) }),
|
|
1952
|
+
A && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/80", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center text-white", children: [
|
|
1953
|
+
/* @__PURE__ */ e.jsx("p", { className: "mb-4", children: A }),
|
|
1948
1954
|
/* @__PURE__ */ e.jsx(
|
|
1949
1955
|
"button",
|
|
1950
1956
|
{
|
|
1951
1957
|
onClick: () => {
|
|
1952
|
-
|
|
1958
|
+
R(!1), $(null);
|
|
1953
1959
|
},
|
|
1954
1960
|
className: "px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary-hover transition-colors",
|
|
1955
1961
|
children: "Try Again"
|
|
@@ -1960,11 +1966,11 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1960
1966
|
/* @__PURE__ */ e.jsx(
|
|
1961
1967
|
"img",
|
|
1962
1968
|
{
|
|
1963
|
-
src:
|
|
1964
|
-
alt:
|
|
1969
|
+
src: je(h.thumbnail) || `https://images.hive.blog/u/${h.owner}/avatar`,
|
|
1970
|
+
alt: h.title,
|
|
1965
1971
|
className: "w-full h-full object-cover",
|
|
1966
|
-
onError: (
|
|
1967
|
-
|
|
1972
|
+
onError: (I) => {
|
|
1973
|
+
I.target.src = `https://images.hive.blog/u/${h.owner}/avatar`;
|
|
1968
1974
|
}
|
|
1969
1975
|
}
|
|
1970
1976
|
),
|
|
@@ -1972,255 +1978,271 @@ const St = /* @__PURE__ */ new Map(), Or = ({
|
|
|
1972
1978
|
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1973
1979
|
"button",
|
|
1974
1980
|
{
|
|
1975
|
-
onClick:
|
|
1981
|
+
onClick: ue,
|
|
1976
1982
|
className: "bg-primary hover:bg-primary-hover rounded-full p-6 transform hover:scale-110 transition-all duration-300 shadow-lg",
|
|
1977
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1983
|
+
children: /* @__PURE__ */ e.jsx(ot, { className: "w-8 h-8 text-primary-foreground ml-1", fill: "currentColor" })
|
|
1978
1984
|
}
|
|
1979
1985
|
) }),
|
|
1980
|
-
|
|
1981
|
-
/* @__PURE__ */ e.jsx(
|
|
1982
|
-
|
|
1986
|
+
h.duration && /* @__PURE__ */ e.jsxs("div", { className: "absolute bottom-4 right-4 bg-black/80 text-white text-sm px-3 py-1 rounded-md flex items-center gap-1 backdrop-blur-sm", children: [
|
|
1987
|
+
/* @__PURE__ */ e.jsx(Pt, { className: "w-3 h-3" }),
|
|
1988
|
+
Ne(h.duration)
|
|
1983
1989
|
] }),
|
|
1984
|
-
|
|
1985
|
-
/* @__PURE__ */ e.jsx(
|
|
1986
|
-
|
|
1990
|
+
h.views && /* @__PURE__ */ e.jsxs("div", { className: "absolute bottom-4 left-4 bg-black/80 text-white text-sm px-3 py-1 rounded-md flex items-center gap-1 backdrop-blur-sm", children: [
|
|
1991
|
+
/* @__PURE__ */ e.jsx(Vt, { className: "w-3 h-3" }),
|
|
1992
|
+
h.views.toLocaleString(),
|
|
1987
1993
|
" views"
|
|
1988
1994
|
] })
|
|
1989
1995
|
] }) }),
|
|
1990
1996
|
/* @__PURE__ */ e.jsx(
|
|
1991
|
-
|
|
1997
|
+
Tr,
|
|
1992
1998
|
{
|
|
1993
|
-
title:
|
|
1994
|
-
author:
|
|
1995
|
-
permlink:
|
|
1996
|
-
createdAt:
|
|
1997
|
-
description:
|
|
1999
|
+
title: h.title || "",
|
|
2000
|
+
author: h.owner || "",
|
|
2001
|
+
permlink: h.permlink || "",
|
|
2002
|
+
createdAt: h.created,
|
|
2003
|
+
description: h.description || "",
|
|
1998
2004
|
video: {
|
|
1999
|
-
title:
|
|
2000
|
-
author:
|
|
2001
|
-
permlink:
|
|
2002
|
-
created:
|
|
2003
|
-
category:
|
|
2005
|
+
title: h.title || "",
|
|
2006
|
+
author: h.owner || "",
|
|
2007
|
+
permlink: h.permlink || "",
|
|
2008
|
+
created: h.created || /* @__PURE__ */ new Date(),
|
|
2009
|
+
category: h.category || "",
|
|
2004
2010
|
numOfUpvotes: void 0,
|
|
2005
2011
|
numOfComments: void 0,
|
|
2006
2012
|
hiveValue: void 0,
|
|
2007
|
-
duration:
|
|
2008
|
-
thumbnail:
|
|
2009
|
-
views:
|
|
2013
|
+
duration: h.duration,
|
|
2014
|
+
thumbnail: h.thumbnail,
|
|
2015
|
+
views: h.views
|
|
2016
|
+
},
|
|
2017
|
+
onTapComment: () => {
|
|
2018
|
+
i ? i(b, p) : F(!0);
|
|
2019
|
+
},
|
|
2020
|
+
onTapUpvote: () => {
|
|
2021
|
+
u ? u(b, p) : _(!0);
|
|
2010
2022
|
},
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
onTapAuthor: () =>
|
|
2023
|
+
onTapInfo: () => {
|
|
2024
|
+
c ? c(b, p, h.description || "") : Q(!0);
|
|
2025
|
+
},
|
|
2026
|
+
onTapAuthor: () => {
|
|
2027
|
+
r && r(h.owner);
|
|
2028
|
+
},
|
|
2029
|
+
onTapShare: () => {
|
|
2030
|
+
l && l(b, p);
|
|
2031
|
+
},
|
|
2032
|
+
onTapBookmark: () => {
|
|
2033
|
+
f && f(b, p);
|
|
2034
|
+
}
|
|
2015
2035
|
}
|
|
2016
2036
|
),
|
|
2017
|
-
|
|
2037
|
+
h.tags && /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-2", children: h.tags.split(",").map((I, G) => /* @__PURE__ */ e.jsxs(
|
|
2018
2038
|
"span",
|
|
2019
2039
|
{
|
|
2020
2040
|
className: "bg-primary/10 text-primary px-3 py-1 rounded-full text-sm font-medium hover:bg-primary/20 transition-colors cursor-pointer",
|
|
2021
|
-
onClick: () =>
|
|
2041
|
+
onClick: () => {
|
|
2042
|
+
o && o(I.trim());
|
|
2043
|
+
},
|
|
2022
2044
|
children: [
|
|
2023
2045
|
"#",
|
|
2024
|
-
|
|
2046
|
+
I.trim()
|
|
2025
2047
|
]
|
|
2026
2048
|
},
|
|
2027
|
-
|
|
2049
|
+
G
|
|
2028
2050
|
)) })
|
|
2029
2051
|
] }),
|
|
2030
2052
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-card border border-border rounded-xl p-6 sticky top-24", children: [
|
|
2031
2053
|
/* @__PURE__ */ e.jsx("h3", { className: "font-semibold text-card-foreground mb-4 text-lg", children: "Related Videos" }),
|
|
2032
2054
|
/* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ e.jsx(
|
|
2033
|
-
|
|
2055
|
+
ut,
|
|
2034
2056
|
{
|
|
2035
|
-
feedType:
|
|
2036
|
-
username:
|
|
2037
|
-
onVideoClick:
|
|
2038
|
-
onAuthorClick:
|
|
2057
|
+
feedType: K.RELATED,
|
|
2058
|
+
username: h.owner,
|
|
2059
|
+
onVideoClick: Z,
|
|
2060
|
+
onAuthorClick: we
|
|
2039
2061
|
}
|
|
2040
2062
|
) })
|
|
2041
2063
|
] })
|
|
2042
2064
|
] }) }),
|
|
2043
|
-
|
|
2044
|
-
|
|
2065
|
+
S && b && p && /* @__PURE__ */ e.jsx(
|
|
2066
|
+
Or,
|
|
2045
2067
|
{
|
|
2046
|
-
author:
|
|
2047
|
-
permlink:
|
|
2048
|
-
onClose: () =>
|
|
2068
|
+
author: b,
|
|
2069
|
+
permlink: p,
|
|
2070
|
+
onClose: () => F(!1)
|
|
2049
2071
|
}
|
|
2050
2072
|
),
|
|
2051
|
-
|
|
2052
|
-
|
|
2073
|
+
O && b && p && /* @__PURE__ */ e.jsx(
|
|
2074
|
+
$r,
|
|
2053
2075
|
{
|
|
2054
|
-
author:
|
|
2055
|
-
permlink:
|
|
2056
|
-
onClose: () =>
|
|
2076
|
+
author: b,
|
|
2077
|
+
permlink: p,
|
|
2078
|
+
onClose: () => _(!1)
|
|
2057
2079
|
}
|
|
2058
2080
|
),
|
|
2059
|
-
|
|
2060
|
-
|
|
2081
|
+
Y && b && p && /* @__PURE__ */ e.jsx(
|
|
2082
|
+
Fr,
|
|
2061
2083
|
{
|
|
2062
|
-
author:
|
|
2063
|
-
permlink:
|
|
2064
|
-
content:
|
|
2065
|
-
onClose: () =>
|
|
2084
|
+
author: b,
|
|
2085
|
+
permlink: p,
|
|
2086
|
+
content: h.description || "",
|
|
2087
|
+
onClose: () => Q(!1)
|
|
2066
2088
|
}
|
|
2067
2089
|
)
|
|
2068
2090
|
] });
|
|
2069
2091
|
};
|
|
2070
|
-
var
|
|
2092
|
+
var Ut = {
|
|
2071
2093
|
color: void 0,
|
|
2072
2094
|
size: void 0,
|
|
2073
2095
|
className: void 0,
|
|
2074
2096
|
style: void 0,
|
|
2075
2097
|
attr: void 0
|
|
2076
|
-
},
|
|
2077
|
-
function
|
|
2098
|
+
}, Ft = xe.createContext && /* @__PURE__ */ xe.createContext(Ut), Lr = ["attr", "size", "title"];
|
|
2099
|
+
function Rr(t, s) {
|
|
2078
2100
|
if (t == null) return {};
|
|
2079
|
-
var r =
|
|
2101
|
+
var r = Pr(t, s), n, o;
|
|
2080
2102
|
if (Object.getOwnPropertySymbols) {
|
|
2081
2103
|
var d = Object.getOwnPropertySymbols(t);
|
|
2082
2104
|
for (o = 0; o < d.length; o++)
|
|
2083
|
-
|
|
2105
|
+
n = d[o], !(s.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (r[n] = t[n]);
|
|
2084
2106
|
}
|
|
2085
2107
|
return r;
|
|
2086
2108
|
}
|
|
2087
|
-
function
|
|
2109
|
+
function Pr(t, s) {
|
|
2088
2110
|
if (t == null) return {};
|
|
2089
2111
|
var r = {};
|
|
2090
|
-
for (var
|
|
2091
|
-
if (Object.prototype.hasOwnProperty.call(t,
|
|
2092
|
-
if (s.indexOf(
|
|
2093
|
-
r[
|
|
2112
|
+
for (var n in t)
|
|
2113
|
+
if (Object.prototype.hasOwnProperty.call(t, n)) {
|
|
2114
|
+
if (s.indexOf(n) >= 0) continue;
|
|
2115
|
+
r[n] = t[n];
|
|
2094
2116
|
}
|
|
2095
2117
|
return r;
|
|
2096
2118
|
}
|
|
2097
|
-
function
|
|
2098
|
-
return
|
|
2119
|
+
function qe() {
|
|
2120
|
+
return qe = Object.assign ? Object.assign.bind() : function(t) {
|
|
2099
2121
|
for (var s = 1; s < arguments.length; s++) {
|
|
2100
2122
|
var r = arguments[s];
|
|
2101
|
-
for (var
|
|
2102
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
2123
|
+
for (var n in r)
|
|
2124
|
+
Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
|
|
2103
2125
|
}
|
|
2104
2126
|
return t;
|
|
2105
|
-
},
|
|
2127
|
+
}, qe.apply(this, arguments);
|
|
2106
2128
|
}
|
|
2107
|
-
function
|
|
2129
|
+
function Lt(t, s) {
|
|
2108
2130
|
var r = Object.keys(t);
|
|
2109
2131
|
if (Object.getOwnPropertySymbols) {
|
|
2110
|
-
var
|
|
2111
|
-
s && (
|
|
2132
|
+
var n = Object.getOwnPropertySymbols(t);
|
|
2133
|
+
s && (n = n.filter(function(o) {
|
|
2112
2134
|
return Object.getOwnPropertyDescriptor(t, o).enumerable;
|
|
2113
|
-
})), r.push.apply(r,
|
|
2135
|
+
})), r.push.apply(r, n);
|
|
2114
2136
|
}
|
|
2115
2137
|
return r;
|
|
2116
2138
|
}
|
|
2117
|
-
function
|
|
2139
|
+
function Ye(t) {
|
|
2118
2140
|
for (var s = 1; s < arguments.length; s++) {
|
|
2119
2141
|
var r = arguments[s] != null ? arguments[s] : {};
|
|
2120
|
-
s % 2 ?
|
|
2121
|
-
|
|
2122
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
2123
|
-
Object.defineProperty(t,
|
|
2142
|
+
s % 2 ? Lt(Object(r), !0).forEach(function(n) {
|
|
2143
|
+
Vr(t, n, r[n]);
|
|
2144
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Lt(Object(r)).forEach(function(n) {
|
|
2145
|
+
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
|
|
2124
2146
|
});
|
|
2125
2147
|
}
|
|
2126
2148
|
return t;
|
|
2127
2149
|
}
|
|
2128
|
-
function
|
|
2129
|
-
return s =
|
|
2150
|
+
function Vr(t, s, r) {
|
|
2151
|
+
return s = Ar(s), s in t ? Object.defineProperty(t, s, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[s] = r, t;
|
|
2130
2152
|
}
|
|
2131
|
-
function
|
|
2132
|
-
var s =
|
|
2153
|
+
function Ar(t) {
|
|
2154
|
+
var s = Dr(t, "string");
|
|
2133
2155
|
return typeof s == "symbol" ? s : s + "";
|
|
2134
2156
|
}
|
|
2135
|
-
function
|
|
2157
|
+
function Dr(t, s) {
|
|
2136
2158
|
if (typeof t != "object" || !t) return t;
|
|
2137
2159
|
var r = t[Symbol.toPrimitive];
|
|
2138
2160
|
if (r !== void 0) {
|
|
2139
|
-
var
|
|
2140
|
-
if (typeof
|
|
2161
|
+
var n = r.call(t, s);
|
|
2162
|
+
if (typeof n != "object") return n;
|
|
2141
2163
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2142
2164
|
}
|
|
2143
2165
|
return (s === "string" ? String : Number)(t);
|
|
2144
2166
|
}
|
|
2145
|
-
function
|
|
2146
|
-
return t && t.map((s, r) => /* @__PURE__ */
|
|
2167
|
+
function Ht(t) {
|
|
2168
|
+
return t && t.map((s, r) => /* @__PURE__ */ xe.createElement(s.tag, Ye({
|
|
2147
2169
|
key: r
|
|
2148
|
-
}, s.attr),
|
|
2170
|
+
}, s.attr), Ht(s.child)));
|
|
2149
2171
|
}
|
|
2150
|
-
function
|
|
2151
|
-
return (s) => /* @__PURE__ */
|
|
2152
|
-
attr:
|
|
2153
|
-
}, s),
|
|
2172
|
+
function Se(t) {
|
|
2173
|
+
return (s) => /* @__PURE__ */ xe.createElement(Mr, qe({
|
|
2174
|
+
attr: Ye({}, t.attr)
|
|
2175
|
+
}, s), Ht(t.child));
|
|
2154
2176
|
}
|
|
2155
|
-
function
|
|
2177
|
+
function Mr(t) {
|
|
2156
2178
|
var s = (r) => {
|
|
2157
2179
|
var {
|
|
2158
|
-
attr:
|
|
2180
|
+
attr: n,
|
|
2159
2181
|
size: o,
|
|
2160
2182
|
title: d
|
|
2161
|
-
} = t, i =
|
|
2162
|
-
return r.className && (c = r.className), t.className && (c = (c ? c + " " : "") + t.className), /* @__PURE__ */
|
|
2183
|
+
} = t, i = Rr(t, Lr), u = o || r.size || "1em", c;
|
|
2184
|
+
return r.className && (c = r.className), t.className && (c = (c ? c + " " : "") + t.className), /* @__PURE__ */ xe.createElement("svg", qe({
|
|
2163
2185
|
stroke: "currentColor",
|
|
2164
2186
|
fill: "currentColor",
|
|
2165
2187
|
strokeWidth: "0"
|
|
2166
|
-
}, r.attr,
|
|
2188
|
+
}, r.attr, n, i, {
|
|
2167
2189
|
className: c,
|
|
2168
|
-
style:
|
|
2190
|
+
style: Ye(Ye({
|
|
2169
2191
|
color: t.color || r.color
|
|
2170
2192
|
}, r.style), t.style),
|
|
2171
2193
|
height: u,
|
|
2172
2194
|
width: u,
|
|
2173
2195
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2174
|
-
}), d && /* @__PURE__ */
|
|
2196
|
+
}), d && /* @__PURE__ */ xe.createElement("title", null, d), t.children);
|
|
2175
2197
|
};
|
|
2176
|
-
return
|
|
2198
|
+
return Ft !== void 0 ? /* @__PURE__ */ xe.createElement(Ft.Consumer, null, (r) => s(r)) : s(Ut);
|
|
2177
2199
|
}
|
|
2178
2200
|
function Ir(t) {
|
|
2179
|
-
return
|
|
2201
|
+
return Se({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M296 160H180.6l42.6-129.8C227.2 15 215.7 0 200 0H56C44 0 33.8 8.9 32.2 20.8l-32 240C-1.7 275.2 9.5 288 24 288h118.7L96.6 482.5c-3.6 15.2 8 29.5 23.3 29.5 8.4 0 16.4-4.4 20.8-12l176-304c9.3-15.9-2.2-36-20.7-36z" }, child: [] }] })(t);
|
|
2202
|
+
}
|
|
2203
|
+
function Ur(t) {
|
|
2204
|
+
return Se({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 405.3V448c0 35.3 86 64 192 64s192-28.7 192-64v-42.7C342.7 434.4 267.2 448 192 448S41.3 434.4 0 405.3zM320 128c106 0 192-28.7 192-64S426 0 320 0 128 28.7 128 64s86 64 192 64zM0 300.4V352c0 35.3 86 64 192 64s192-28.7 192-64v-51.6c-41.3 34-116.9 51.6-192 51.6S41.3 334.4 0 300.4zm416 11c57.3-11.1 96-31.7 96-55.4v-42.7c-23.2 16.4-57.3 27.6-96 34.5v63.6zM192 160C86 160 0 195.8 0 240s86 80 192 80 192-35.8 192-80-86-80-192-80zm219.3 56.3c60-10.8 100.7-32 100.7-56.3v-42.7c-35.5 25.1-96.5 38.6-160.7 41.8 29.5 14.3 51.2 33.5 60 57.2z" }, child: [] }] })(t);
|
|
2180
2205
|
}
|
|
2181
2206
|
function Hr(t) {
|
|
2182
|
-
return
|
|
2207
|
+
return Se({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z" }, child: [] }] })(t);
|
|
2183
2208
|
}
|
|
2184
2209
|
function Wr(t) {
|
|
2185
|
-
return
|
|
2210
|
+
return Se({ attr: { viewBox: "0 0 640 512" }, child: [{ tag: "path", attr: { d: "M608 64H32C14.33 64 0 78.33 0 96v320c0 17.67 14.33 32 32 32h576c17.67 0 32-14.33 32-32V96c0-17.67-14.33-32-32-32zM48 400v-64c35.35 0 64 28.65 64 64H48zm0-224v-64h64c0 35.35-28.65 64-64 64zm272 176c-44.19 0-80-42.99-80-96 0-53.02 35.82-96 80-96s80 42.98 80 96c0 53.03-35.83 96-80 96zm272 48h-64c0-35.35 28.65-64 64-64v64zm0-224c-35.35 0-64-28.65-64-64h64v64z" }, child: [] }] })(t);
|
|
2186
2211
|
}
|
|
2187
2212
|
function Br(t) {
|
|
2188
|
-
return
|
|
2213
|
+
return Se({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M560 224h-29.5c-8.8-20-21.6-37.7-37.4-52.5L512 96h-32c-29.4 0-55.4 13.5-73 34.3-7.6-1.1-15.1-2.3-23-2.3H256c-77.4 0-141.9 55-156.8 128H56c-14.8 0-26.5-13.5-23.5-28.8C34.7 215.8 45.4 208 57 208h1c3.3 0 6-2.7 6-6v-20c0-3.3-2.7-6-6-6-28.5 0-53.9 20.4-57.5 48.6C-3.9 258.8 22.7 288 56 288h40c0 52.2 25.4 98.1 64 127.3V496c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16v-48h128v48c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16v-80.7c11.8-8.9 22.3-19.4 31.3-31.3H560c8.8 0 16-7.2 16-16V240c0-8.8-7.2-16-16-16zm-128 64c-8.8 0-16-7.2-16-16s7.2-16 16-16 16 7.2 16 16-7.2 16-16 16zM256 96h128c5.4 0 10.7.4 15.9.8 0-.3.1-.5.1-.8 0-53-43-96-96-96s-96 43-96 96c0 2.1.5 4.1.6 6.2 15.2-3.9 31-6.2 47.4-6.2z" }, child: [] }] })(t);
|
|
2189
2214
|
}
|
|
2190
2215
|
function zr(t) {
|
|
2191
|
-
return
|
|
2192
|
-
}
|
|
2193
|
-
function qr(t) {
|
|
2194
|
-
return we({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M461.2 128H80c-8.84 0-16-7.16-16-16s7.16-16 16-16h384c8.84 0 16-7.16 16-16 0-26.51-21.49-48-48-48H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h397.2c28.02 0 50.8-21.53 50.8-48V176c0-26.47-22.78-48-50.8-48zM416 336c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z" }, child: [] }] })(t);
|
|
2216
|
+
return Se({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M461.2 128H80c-8.84 0-16-7.16-16-16s7.16-16 16-16h384c8.84 0 16-7.16 16-16 0-26.51-21.49-48-48-48H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h397.2c28.02 0 50.8-21.53 50.8-48V176c0-26.47-22.78-48-50.8-48zM416 336c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z" }, child: [] }] })(t);
|
|
2195
2217
|
}
|
|
2196
|
-
const
|
|
2218
|
+
const ht = new wr.Client(["https://api.hive.blog"]), qr = async (t) => {
|
|
2197
2219
|
try {
|
|
2198
|
-
const s = await
|
|
2220
|
+
const s = await ht.database.getAccounts([t]);
|
|
2199
2221
|
if (!s || s.length === 0)
|
|
2200
2222
|
throw new Error("Account not found");
|
|
2201
2223
|
return s[0];
|
|
2202
2224
|
} catch (s) {
|
|
2203
2225
|
return console.error("Error in getWalletDataDetail:", s), { error: s instanceof Error ? s.message : "Unknown error" };
|
|
2204
2226
|
}
|
|
2205
|
-
},
|
|
2227
|
+
}, Yr = async (t) => {
|
|
2206
2228
|
try {
|
|
2207
|
-
const s = await
|
|
2229
|
+
const s = await ht.database.getDynamicGlobalProperties(), r = parseFloat(t.split(" ")[0]), n = parseFloat(
|
|
2208
2230
|
String(s.total_vesting_shares).split(" ")[0]
|
|
2209
2231
|
), o = parseFloat(
|
|
2210
2232
|
String(s.total_vesting_fund_hive).split(" ")[0]
|
|
2211
2233
|
);
|
|
2212
|
-
return (r * o /
|
|
2234
|
+
return (r * o / n).toFixed(3);
|
|
2213
2235
|
} catch (s) {
|
|
2214
2236
|
return console.error("Error in convertVestingSharesToHiveData:", s), "0";
|
|
2215
2237
|
}
|
|
2216
|
-
},
|
|
2238
|
+
}, Jr = async (t) => {
|
|
2217
2239
|
try {
|
|
2218
|
-
const r = (await
|
|
2219
|
-
return (
|
|
2240
|
+
const r = (await ht.database.call("get_feed_history", [])).current_median_history, n = parseFloat(r.base.split(" ")[0]), o = typeof t == "string" ? parseFloat(t) : t;
|
|
2241
|
+
return (n * o).toFixed(2);
|
|
2220
2242
|
} catch (s) {
|
|
2221
2243
|
return console.error("Error in convertHivetoUSDData:", s), "0";
|
|
2222
2244
|
}
|
|
2223
|
-
},
|
|
2245
|
+
}, Gr = kr((t) => ({
|
|
2224
2246
|
walletData: null,
|
|
2225
2247
|
isLoading: !1,
|
|
2226
2248
|
error: null,
|
|
@@ -2229,21 +2251,21 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2229
2251
|
fetchWalletData: async (s) => {
|
|
2230
2252
|
t({ isLoading: !0, error: null });
|
|
2231
2253
|
try {
|
|
2232
|
-
const r = await
|
|
2233
|
-
if (!r ||
|
|
2234
|
-
throw new Error(
|
|
2235
|
-
const o = typeof r.vesting_shares == "string" ? r.vesting_shares : "0.000000 VESTS", d = typeof r.balance == "string" ? r.balance : r.balance.toString(), i = typeof r.hbd_balance == "string" ? r.hbd_balance : r.hbd_balance.toString(), u = typeof r.savings_balance == "string" ? r.savings_balance : r.savings_balance.toString(), c = typeof r.savings_hbd_balance == "string" ? r.savings_hbd_balance : r.savings_hbd_balance.toString(), m = await
|
|
2254
|
+
const r = await qr(s), n = (T) => "error" in T;
|
|
2255
|
+
if (!r || n(r))
|
|
2256
|
+
throw new Error(n(r) ? r.error : "Account not found");
|
|
2257
|
+
const o = typeof r.vesting_shares == "string" ? r.vesting_shares : "0.000000 VESTS", d = typeof r.balance == "string" ? r.balance : r.balance.toString(), i = typeof r.hbd_balance == "string" ? r.hbd_balance : r.hbd_balance.toString(), u = typeof r.savings_balance == "string" ? r.savings_balance : r.savings_balance.toString(), c = typeof r.savings_hbd_balance == "string" ? r.savings_hbd_balance : r.savings_hbd_balance.toString(), m = await Yr(o), l = parseFloat(d.split(" ")[0] || "0"), f = parseFloat(m), b = (l + f).toFixed(3), p = await Jr(b), h = {
|
|
2236
2258
|
balance: d,
|
|
2237
2259
|
hbd_balance: i,
|
|
2238
2260
|
savings_balance: u,
|
|
2239
2261
|
savings_hbd_balance: c,
|
|
2240
2262
|
hive_power: `${m} HP`,
|
|
2241
|
-
estimated_value: `$${
|
|
2263
|
+
estimated_value: `$${p}`
|
|
2242
2264
|
};
|
|
2243
|
-
return t({ walletData:
|
|
2265
|
+
return t({ walletData: h }), h;
|
|
2244
2266
|
} catch (r) {
|
|
2245
|
-
const
|
|
2246
|
-
console.error("Wallet fetch error:",
|
|
2267
|
+
const n = r instanceof Error ? r.message : "Failed to fetch wallet data";
|
|
2268
|
+
console.error("Wallet fetch error:", n);
|
|
2247
2269
|
const o = {
|
|
2248
2270
|
balance: "0.000 HIVE",
|
|
2249
2271
|
hbd_balance: "0.000 HBD",
|
|
@@ -2251,18 +2273,18 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2251
2273
|
savings_hbd_balance: "0.000 HBD",
|
|
2252
2274
|
hive_power: "0 HP",
|
|
2253
2275
|
estimated_value: "$0.00",
|
|
2254
|
-
error:
|
|
2276
|
+
error: n
|
|
2255
2277
|
};
|
|
2256
|
-
return t({ walletData: o, error:
|
|
2278
|
+
return t({ walletData: o, error: n }), o;
|
|
2257
2279
|
} finally {
|
|
2258
2280
|
t({ isLoading: !1 });
|
|
2259
2281
|
}
|
|
2260
2282
|
}
|
|
2261
|
-
})),
|
|
2262
|
-
const { walletData: r, fetchWalletData:
|
|
2263
|
-
|
|
2264
|
-
t &&
|
|
2265
|
-
}, [t,
|
|
2283
|
+
})), bs = ({ username: t, className: s = "" }) => {
|
|
2284
|
+
const { walletData: r, fetchWalletData: n, isLoading: o, error: d } = Gr();
|
|
2285
|
+
B(() => {
|
|
2286
|
+
t && n(t);
|
|
2287
|
+
}, [t, n]);
|
|
2266
2288
|
const i = ({ label: u, value: c, icon: m, colorClass: l = "bg-primary/10" }) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-4 rounded-lg bg-card border border-border shadow-sm mb-3 transition-all duration-200 hover:shadow-md", children: [
|
|
2267
2289
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2268
2290
|
m && /* @__PURE__ */ e.jsx("div", { className: `p-2 rounded-full flex items-center justify-center ${l} text-primary`, children: m }),
|
|
@@ -2294,7 +2316,7 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2294
2316
|
] }) : (r == null ? void 0 : r.estimated_value) ?? "-" })
|
|
2295
2317
|
] }),
|
|
2296
2318
|
d && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center p-3 rounded-lg bg-destructive/10 border border-destructive/20 text-destructive mb-4", children: [
|
|
2297
|
-
/* @__PURE__ */ e.jsx(
|
|
2319
|
+
/* @__PURE__ */ e.jsx(Hr, { className: "mr-2" }),
|
|
2298
2320
|
/* @__PURE__ */ e.jsx("span", { children: d })
|
|
2299
2321
|
] }),
|
|
2300
2322
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2302,7 +2324,7 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2302
2324
|
{
|
|
2303
2325
|
label: "Balance",
|
|
2304
2326
|
value: r == null ? void 0 : r.balance,
|
|
2305
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2327
|
+
icon: /* @__PURE__ */ e.jsx(zr, {}),
|
|
2306
2328
|
colorClass: "bg-blue-500/10"
|
|
2307
2329
|
}
|
|
2308
2330
|
),
|
|
@@ -2311,7 +2333,7 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2311
2333
|
{
|
|
2312
2334
|
label: "HBD Balance",
|
|
2313
2335
|
value: r == null ? void 0 : r.hbd_balance,
|
|
2314
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2336
|
+
icon: /* @__PURE__ */ e.jsx(Wr, {}),
|
|
2315
2337
|
colorClass: "bg-green-500/10"
|
|
2316
2338
|
}
|
|
2317
2339
|
),
|
|
@@ -2320,7 +2342,7 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2320
2342
|
{
|
|
2321
2343
|
label: "Savings Balance",
|
|
2322
2344
|
value: r == null ? void 0 : r.savings_balance,
|
|
2323
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2345
|
+
icon: /* @__PURE__ */ e.jsx(Br, {}),
|
|
2324
2346
|
colorClass: "bg-yellow-500/10"
|
|
2325
2347
|
}
|
|
2326
2348
|
),
|
|
@@ -2329,7 +2351,7 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2329
2351
|
{
|
|
2330
2352
|
label: "Savings HBD Balance",
|
|
2331
2353
|
value: r == null ? void 0 : r.savings_hbd_balance,
|
|
2332
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2354
|
+
icon: /* @__PURE__ */ e.jsx(Ur, {}),
|
|
2333
2355
|
colorClass: "bg-purple-500/10"
|
|
2334
2356
|
}
|
|
2335
2357
|
),
|
|
@@ -2343,38 +2365,38 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2343
2365
|
}
|
|
2344
2366
|
)
|
|
2345
2367
|
] }) });
|
|
2346
|
-
},
|
|
2368
|
+
}, tt = "_communityLocalKey", Ue = {
|
|
2347
2369
|
getBookmarkedCommunities: () => {
|
|
2348
|
-
const t = localStorage.getItem(
|
|
2370
|
+
const t = localStorage.getItem(tt);
|
|
2349
2371
|
return t ? JSON.parse(t) : [];
|
|
2350
2372
|
},
|
|
2351
2373
|
isUserPresentLocally: (t) => {
|
|
2352
|
-
const s = localStorage.getItem(
|
|
2374
|
+
const s = localStorage.getItem(tt);
|
|
2353
2375
|
return s ? JSON.parse(s).includes(t) : !1;
|
|
2354
2376
|
},
|
|
2355
2377
|
storeLikedCommunityLocally: (t, s = !1) => {
|
|
2356
|
-
let r =
|
|
2357
|
-
return r.includes(t) ? r = r.filter((
|
|
2378
|
+
let r = Ue.getBookmarkedCommunities();
|
|
2379
|
+
return r.includes(t) ? r = r.filter((n) => n !== t) : s || r.push(t), localStorage.setItem(tt, JSON.stringify(r)), r;
|
|
2358
2380
|
}
|
|
2359
|
-
},
|
|
2381
|
+
}, Wt = ({
|
|
2360
2382
|
id: t,
|
|
2361
2383
|
toastType: s,
|
|
2362
2384
|
isLiked: r,
|
|
2363
|
-
onAdd:
|
|
2385
|
+
onAdd: n,
|
|
2364
2386
|
onRemove: o,
|
|
2365
2387
|
onFavourite: d
|
|
2366
2388
|
}) => {
|
|
2367
|
-
const [i, u] =
|
|
2368
|
-
r ??
|
|
2389
|
+
const [i, u] = y(
|
|
2390
|
+
r ?? Ue.isUserPresentLocally(t)
|
|
2369
2391
|
);
|
|
2370
|
-
|
|
2392
|
+
B(() => {
|
|
2371
2393
|
r !== void 0 && u(r);
|
|
2372
2394
|
}, [r]);
|
|
2373
2395
|
const c = () => {
|
|
2374
|
-
d && d(), i ? (o ? o(t, "remove_bookmark") :
|
|
2396
|
+
d && d(), i ? (o ? o(t, "remove_bookmark") : Ue.storeLikedCommunityLocally(
|
|
2375
2397
|
t,
|
|
2376
2398
|
!0
|
|
2377
|
-
), m(!1)) : (
|
|
2399
|
+
), m(!1)) : (n ? n(t, "add_bookmark") : Ue.storeLikedCommunityLocally(t), m(!0)), u(!i);
|
|
2378
2400
|
}, m = (l) => {
|
|
2379
2401
|
alert(`The ${s} is ${l ? "added to" : "removed from"} your bookmarks`);
|
|
2380
2402
|
};
|
|
@@ -2387,13 +2409,13 @@ const lt = new wr.Client(["https://api.hive.blog"]), Yr = async (t) => {
|
|
|
2387
2409
|
}
|
|
2388
2410
|
);
|
|
2389
2411
|
};
|
|
2390
|
-
class
|
|
2412
|
+
class Kr {
|
|
2391
2413
|
constructor() {
|
|
2392
|
-
|
|
2414
|
+
De(this, "HIVE_API_URL", "https://api.hive.blog");
|
|
2393
2415
|
}
|
|
2394
|
-
async getListOfCommunities(s, r = 20,
|
|
2416
|
+
async getListOfCommunities(s, r = 20, n) {
|
|
2395
2417
|
const o = { limit: r };
|
|
2396
|
-
|
|
2418
|
+
n && n.trim() !== "" && (o.last = n), s && s.trim() !== "" && (o.query = s);
|
|
2397
2419
|
const d = {
|
|
2398
2420
|
jsonrpc: "2.0",
|
|
2399
2421
|
method: "bridge.list_communities",
|
|
@@ -2423,23 +2445,23 @@ class Qr {
|
|
|
2423
2445
|
id: 1
|
|
2424
2446
|
};
|
|
2425
2447
|
try {
|
|
2426
|
-
const
|
|
2448
|
+
const n = await fetch(this.HIVE_API_URL, {
|
|
2427
2449
|
method: "POST",
|
|
2428
2450
|
headers: {
|
|
2429
2451
|
"Content-Type": "application/json"
|
|
2430
2452
|
},
|
|
2431
2453
|
body: JSON.stringify(r)
|
|
2432
2454
|
});
|
|
2433
|
-
if (!
|
|
2434
|
-
throw new Error(`HTTP error! status: ${
|
|
2435
|
-
return await
|
|
2436
|
-
} catch (
|
|
2437
|
-
throw console.error("Error fetching community details:",
|
|
2455
|
+
if (!n.ok)
|
|
2456
|
+
throw new Error(`HTTP error! status: ${n.status}`);
|
|
2457
|
+
return await n.json();
|
|
2458
|
+
} catch (n) {
|
|
2459
|
+
throw console.error("Error fetching community details:", n), n;
|
|
2438
2460
|
}
|
|
2439
2461
|
}
|
|
2440
|
-
async getCommunitySubscribers(s, r = 100,
|
|
2462
|
+
async getCommunitySubscribers(s, r = 100, n) {
|
|
2441
2463
|
const o = { community: s, limit: r };
|
|
2442
|
-
|
|
2464
|
+
n && n.trim() !== "" && (o.last = n);
|
|
2443
2465
|
const d = {
|
|
2444
2466
|
jsonrpc: "2.0",
|
|
2445
2467
|
method: "bridge.list_community_roles",
|
|
@@ -2473,50 +2495,50 @@ class Qr {
|
|
|
2473
2495
|
return `https://images.hive.blog/u/${s}/avatar`;
|
|
2474
2496
|
}
|
|
2475
2497
|
}
|
|
2476
|
-
const
|
|
2477
|
-
const [s, r] =
|
|
2498
|
+
const fe = new Kr(), ys = ({ onSelectCommunity: t }) => {
|
|
2499
|
+
const [s, r] = y([]), [n, o] = y(""), [d, i] = y(!0), [u, c] = y(!1), [m, l] = y(!0), [f, b] = y(
|
|
2478
2500
|
null
|
|
2479
|
-
), [
|
|
2480
|
-
async (
|
|
2481
|
-
if (!(!
|
|
2501
|
+
), [p, h] = y(null), T = 20, w = Ie(null), k = Ce(
|
|
2502
|
+
async (N = !1) => {
|
|
2503
|
+
if (!(!N && (u || !m)))
|
|
2482
2504
|
try {
|
|
2483
|
-
|
|
2484
|
-
const
|
|
2485
|
-
|
|
2505
|
+
N ? (i(!0), h(null), r([]), b(null), l(!0)) : c(!0);
|
|
2506
|
+
const R = n.trim(), A = await fe.getListOfCommunities(
|
|
2507
|
+
R.length >= 3 ? R : void 0,
|
|
2486
2508
|
T,
|
|
2487
|
-
|
|
2509
|
+
N ? void 0 : f || void 0
|
|
2488
2510
|
);
|
|
2489
|
-
r((
|
|
2490
|
-
} catch (
|
|
2491
|
-
|
|
2492
|
-
|
|
2511
|
+
r(($) => N ? A : [...$, ...A]), A.length < T || A.length > 0 && A[A.length - 1].name === f ? l(!1) : A.length > 0 && b(A[A.length - 1].name || null);
|
|
2512
|
+
} catch (R) {
|
|
2513
|
+
h(
|
|
2514
|
+
R instanceof Error ? R.message : "Failed to load communities"
|
|
2493
2515
|
), l(!1);
|
|
2494
2516
|
} finally {
|
|
2495
2517
|
i(!1), c(!1);
|
|
2496
2518
|
}
|
|
2497
2519
|
},
|
|
2498
|
-
[
|
|
2520
|
+
[n, u, m, f]
|
|
2499
2521
|
);
|
|
2500
|
-
|
|
2501
|
-
const
|
|
2522
|
+
B(() => {
|
|
2523
|
+
const N = setTimeout(
|
|
2502
2524
|
() => {
|
|
2503
|
-
|
|
2525
|
+
k(!0);
|
|
2504
2526
|
},
|
|
2505
|
-
|
|
2527
|
+
n.length >= 3 || n.length === 0 ? 0 : 500
|
|
2506
2528
|
);
|
|
2507
|
-
return () => clearTimeout(
|
|
2508
|
-
}, [
|
|
2509
|
-
var
|
|
2510
|
-
(
|
|
2511
|
-
}, [
|
|
2512
|
-
const
|
|
2513
|
-
window.innerHeight + document.documentElement.scrollTop >= document.documentElement.offsetHeight - 200 && !u && !d && m &&
|
|
2529
|
+
return () => clearTimeout(N);
|
|
2530
|
+
}, [n]), B(() => {
|
|
2531
|
+
var N;
|
|
2532
|
+
(N = w.current) == null || N.focus();
|
|
2533
|
+
}, [n, d, p]), B(() => {
|
|
2534
|
+
const N = () => {
|
|
2535
|
+
window.innerHeight + document.documentElement.scrollTop >= document.documentElement.offsetHeight - 200 && !u && !d && m && k();
|
|
2514
2536
|
};
|
|
2515
|
-
return window.addEventListener("scroll",
|
|
2516
|
-
}, [
|
|
2517
|
-
const
|
|
2518
|
-
|
|
2519
|
-
},
|
|
2537
|
+
return window.addEventListener("scroll", N), () => window.removeEventListener("scroll", N);
|
|
2538
|
+
}, [k, u, d, m]);
|
|
2539
|
+
const v = () => {
|
|
2540
|
+
k(!0);
|
|
2541
|
+
}, D = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: Array.from({ length: 6 }).map((N, R) => /* @__PURE__ */ e.jsx(
|
|
2520
2542
|
"div",
|
|
2521
2543
|
{
|
|
2522
2544
|
className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-4 animate-pulse",
|
|
@@ -2529,19 +2551,19 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2529
2551
|
/* @__PURE__ */ e.jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-16" })
|
|
2530
2552
|
] })
|
|
2531
2553
|
},
|
|
2532
|
-
|
|
2554
|
+
R
|
|
2533
2555
|
)) });
|
|
2534
2556
|
return d && s.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
2535
2557
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
2536
|
-
/* @__PURE__ */ e.jsx(
|
|
2558
|
+
/* @__PURE__ */ e.jsx(Ze, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500 dark:text-gray-400 w-5 h-5" }),
|
|
2537
2559
|
/* @__PURE__ */ e.jsx(
|
|
2538
2560
|
"input",
|
|
2539
2561
|
{
|
|
2540
2562
|
type: "text",
|
|
2541
2563
|
placeholder: "Search communities...",
|
|
2542
|
-
value:
|
|
2543
|
-
onChange: (
|
|
2544
|
-
ref:
|
|
2564
|
+
value: n,
|
|
2565
|
+
onChange: (N) => o(N.target.value),
|
|
2566
|
+
ref: w,
|
|
2545
2567
|
autoFocus: !0,
|
|
2546
2568
|
className: `w-full pl-10 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700
|
|
2547
2569
|
rounded-xl text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400
|
|
@@ -2549,18 +2571,18 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2549
2571
|
}
|
|
2550
2572
|
)
|
|
2551
2573
|
] }),
|
|
2552
|
-
/* @__PURE__ */ e.jsx(
|
|
2553
|
-
] }) :
|
|
2574
|
+
/* @__PURE__ */ e.jsx(D, {})
|
|
2575
|
+
] }) : p && s.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
2554
2576
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
2555
|
-
/* @__PURE__ */ e.jsx(
|
|
2577
|
+
/* @__PURE__ */ e.jsx(Ze, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500 dark:text-gray-400 w-5 h-5" }),
|
|
2556
2578
|
/* @__PURE__ */ e.jsx(
|
|
2557
2579
|
"input",
|
|
2558
2580
|
{
|
|
2559
2581
|
type: "text",
|
|
2560
2582
|
placeholder: "Search communities...",
|
|
2561
|
-
value:
|
|
2562
|
-
onChange: (
|
|
2563
|
-
ref:
|
|
2583
|
+
value: n,
|
|
2584
|
+
onChange: (N) => o(N.target.value),
|
|
2585
|
+
ref: w,
|
|
2564
2586
|
autoFocus: !0,
|
|
2565
2587
|
className: `w-full pl-10 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700
|
|
2566
2588
|
rounded-xl text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400
|
|
@@ -2570,14 +2592,14 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2570
2592
|
] }),
|
|
2571
2593
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center min-h-[400px] space-y-4", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
2572
2594
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-2", children: "Failed to load communities" }),
|
|
2573
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400 mb-4", children:
|
|
2595
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400 mb-4", children: p }),
|
|
2574
2596
|
/* @__PURE__ */ e.jsxs(
|
|
2575
2597
|
"button",
|
|
2576
2598
|
{
|
|
2577
|
-
onClick:
|
|
2599
|
+
onClick: v,
|
|
2578
2600
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input text-gray-400 cursor-pointer bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
2579
2601
|
children: [
|
|
2580
|
-
/* @__PURE__ */ e.jsx(
|
|
2602
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4 mr-2" }),
|
|
2581
2603
|
"Try Again"
|
|
2582
2604
|
]
|
|
2583
2605
|
}
|
|
@@ -2586,15 +2608,15 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2586
2608
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
2587
2609
|
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx("h2", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: "Communities" }) }),
|
|
2588
2610
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex justify-between items-center", children: [
|
|
2589
|
-
/* @__PURE__ */ e.jsx(
|
|
2611
|
+
/* @__PURE__ */ e.jsx(Ze, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500 dark:text-gray-400 w-5 h-5" }),
|
|
2590
2612
|
/* @__PURE__ */ e.jsx(
|
|
2591
2613
|
"input",
|
|
2592
2614
|
{
|
|
2593
2615
|
type: "text",
|
|
2594
2616
|
placeholder: "Search communities...",
|
|
2595
|
-
value:
|
|
2596
|
-
onChange: (
|
|
2597
|
-
ref:
|
|
2617
|
+
value: n,
|
|
2618
|
+
onChange: (N) => o(N.target.value),
|
|
2619
|
+
ref: w,
|
|
2598
2620
|
autoFocus: !0,
|
|
2599
2621
|
className: `w-full pl-10 pr-4 py-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700
|
|
2600
2622
|
rounded-xl text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400
|
|
@@ -2604,92 +2626,92 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2604
2626
|
/* @__PURE__ */ e.jsx(
|
|
2605
2627
|
"button",
|
|
2606
2628
|
{
|
|
2607
|
-
onClick:
|
|
2629
|
+
onClick: v,
|
|
2608
2630
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
2609
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2631
|
+
children: /* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4" })
|
|
2610
2632
|
}
|
|
2611
2633
|
)
|
|
2612
2634
|
] }),
|
|
2613
2635
|
s.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center min-h-[400px] space-y-4", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
2614
2636
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-2", children: "No communities found" }),
|
|
2615
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400", children:
|
|
2637
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400", children: n ? "Try adjusting your search terms" : "Check back later for new communities" })
|
|
2616
2638
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2617
|
-
s.map((
|
|
2639
|
+
s.map((N) => /* @__PURE__ */ e.jsx(
|
|
2618
2640
|
"div",
|
|
2619
2641
|
{
|
|
2620
2642
|
className: `bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700
|
|
2621
2643
|
rounded-xl p-4 hover:bg-gray-300 dark:hover:bg-gray-700
|
|
2622
2644
|
transition-colors cursor-pointer`,
|
|
2623
|
-
onClick: () => t(
|
|
2645
|
+
onClick: () => t(N.name || ""),
|
|
2624
2646
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
2625
2647
|
/* @__PURE__ */ e.jsx(
|
|
2626
2648
|
"img",
|
|
2627
2649
|
{
|
|
2628
|
-
src:
|
|
2629
|
-
alt:
|
|
2650
|
+
src: fe.communityIcon(N.name || ""),
|
|
2651
|
+
alt: N.title,
|
|
2630
2652
|
className: "w-12 h-12 rounded-full object-cover",
|
|
2631
|
-
onError: (
|
|
2632
|
-
|
|
2653
|
+
onError: (R) => {
|
|
2654
|
+
R.target.src = `https://ui-avatars.com/api/?name=${N.title}&background=random`;
|
|
2633
2655
|
}
|
|
2634
2656
|
}
|
|
2635
2657
|
),
|
|
2636
2658
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2637
|
-
/* @__PURE__ */ e.jsx("h3", { className: "font-semibold text-gray-900 dark:text-white truncate", children:
|
|
2638
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 line-clamp-2", children:
|
|
2659
|
+
/* @__PURE__ */ e.jsx("h3", { className: "font-semibold text-gray-900 dark:text-white truncate", children: N.title }),
|
|
2660
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 line-clamp-2", children: N.about })
|
|
2639
2661
|
] }),
|
|
2640
2662
|
/* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
2641
|
-
(
|
|
2663
|
+
(N.subscribers || 0).toLocaleString(),
|
|
2642
2664
|
" members"
|
|
2643
2665
|
] }) })
|
|
2644
2666
|
] })
|
|
2645
2667
|
},
|
|
2646
|
-
|
|
2668
|
+
N.id
|
|
2647
2669
|
)),
|
|
2648
2670
|
m && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-4", children: u ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
2649
|
-
/* @__PURE__ */ e.jsx(
|
|
2671
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-4 h-4 animate-spin" }),
|
|
2650
2672
|
"Loading more communities..."
|
|
2651
2673
|
] }) : /* @__PURE__ */ e.jsx(
|
|
2652
2674
|
"button",
|
|
2653
2675
|
{
|
|
2654
|
-
onClick: () =>
|
|
2676
|
+
onClick: () => k(),
|
|
2655
2677
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input text-gray-400 cursor-pointer bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
2656
2678
|
children: "Load More Communities"
|
|
2657
2679
|
}
|
|
2658
2680
|
) })
|
|
2659
2681
|
] })
|
|
2660
2682
|
] });
|
|
2661
|
-
},
|
|
2662
|
-
var
|
|
2663
|
-
const [s, r] =
|
|
2683
|
+
}, Qr = ({ communityId: t }) => {
|
|
2684
|
+
var f, b, p;
|
|
2685
|
+
const [s, r] = y(null), [n, o] = y(!0), [d, i] = y(null), u = async () => {
|
|
2664
2686
|
try {
|
|
2665
2687
|
o(!0), i(null);
|
|
2666
|
-
const
|
|
2667
|
-
r(
|
|
2668
|
-
} catch (
|
|
2688
|
+
const h = await fe.getCommunityDetails(t);
|
|
2689
|
+
r(h);
|
|
2690
|
+
} catch (h) {
|
|
2669
2691
|
i(
|
|
2670
|
-
|
|
2692
|
+
h instanceof Error ? h.message : "Failed to load community details"
|
|
2671
2693
|
);
|
|
2672
2694
|
} finally {
|
|
2673
2695
|
o(!1);
|
|
2674
2696
|
}
|
|
2675
2697
|
};
|
|
2676
|
-
|
|
2698
|
+
B(() => {
|
|
2677
2699
|
u();
|
|
2678
2700
|
}, [t]);
|
|
2679
|
-
const c = (
|
|
2701
|
+
const c = (h) => {
|
|
2680
2702
|
try {
|
|
2681
|
-
return new Date(
|
|
2703
|
+
return new Date(h).toLocaleDateString("en-US", {
|
|
2682
2704
|
year: "numeric",
|
|
2683
2705
|
month: "long",
|
|
2684
2706
|
day: "numeric"
|
|
2685
2707
|
});
|
|
2686
2708
|
} catch {
|
|
2687
|
-
return
|
|
2709
|
+
return h;
|
|
2688
2710
|
}
|
|
2689
|
-
}, m = (
|
|
2690
|
-
if (
|
|
2711
|
+
}, m = (h) => h.replace(/<[^>]*>/g, "");
|
|
2712
|
+
if (n)
|
|
2691
2713
|
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
2692
|
-
/* @__PURE__ */ e.jsx(
|
|
2714
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-5 h-5 animate-spin" }),
|
|
2693
2715
|
"Loading community details..."
|
|
2694
2716
|
] }) });
|
|
2695
2717
|
if (d)
|
|
@@ -2702,7 +2724,7 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2702
2724
|
onClick: u,
|
|
2703
2725
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
2704
2726
|
children: [
|
|
2705
|
-
/* @__PURE__ */ e.jsx(
|
|
2727
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4" }),
|
|
2706
2728
|
"Try Again"
|
|
2707
2729
|
]
|
|
2708
2730
|
}
|
|
@@ -2727,11 +2749,11 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2727
2749
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: [
|
|
2728
2750
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
2729
2751
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Total Authors" }),
|
|
2730
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((
|
|
2752
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((f = l.num_authors) == null ? void 0 : f.toLocaleString()) || "0" })
|
|
2731
2753
|
] }),
|
|
2732
2754
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
2733
2755
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Subscribers" }),
|
|
2734
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((
|
|
2756
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((b = l.subscribers) == null ? void 0 : b.toLocaleString()) || "0" })
|
|
2735
2757
|
] }),
|
|
2736
2758
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
2737
2759
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Created" }),
|
|
@@ -2743,7 +2765,7 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2743
2765
|
] }),
|
|
2744
2766
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
2745
2767
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Pending Posts" }),
|
|
2746
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: ((
|
|
2768
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: ((p = l.num_pending) == null ? void 0 : p.toLocaleString()) || "0" })
|
|
2747
2769
|
] }),
|
|
2748
2770
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
2749
2771
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Type" }),
|
|
@@ -2751,30 +2773,30 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2751
2773
|
] })
|
|
2752
2774
|
] })
|
|
2753
2775
|
] }) });
|
|
2754
|
-
},
|
|
2776
|
+
}, Xr = ({
|
|
2755
2777
|
communityId: t,
|
|
2756
2778
|
onSelectTeamMember: s
|
|
2757
2779
|
}) => {
|
|
2758
2780
|
var l;
|
|
2759
|
-
const [r,
|
|
2781
|
+
const [r, n] = y(null), [o, d] = y(!0), [i, u] = y(null), c = async () => {
|
|
2760
2782
|
try {
|
|
2761
2783
|
d(!0), u(null);
|
|
2762
|
-
const
|
|
2763
|
-
|
|
2764
|
-
} catch (
|
|
2784
|
+
const f = await fe.getCommunityDetails(t);
|
|
2785
|
+
n(f);
|
|
2786
|
+
} catch (f) {
|
|
2765
2787
|
u(
|
|
2766
|
-
|
|
2788
|
+
f instanceof Error ? f.message : "Failed to load team details"
|
|
2767
2789
|
);
|
|
2768
2790
|
} finally {
|
|
2769
2791
|
d(!1);
|
|
2770
2792
|
}
|
|
2771
2793
|
};
|
|
2772
|
-
|
|
2794
|
+
B(() => {
|
|
2773
2795
|
c();
|
|
2774
2796
|
}, [t]);
|
|
2775
2797
|
const m = ((l = r == null ? void 0 : r.result) == null ? void 0 : l.team) || [];
|
|
2776
2798
|
return o ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
2777
|
-
/* @__PURE__ */ e.jsx(
|
|
2799
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-5 h-5 animate-spin" }),
|
|
2778
2800
|
"Loading team members..."
|
|
2779
2801
|
] }) }) : i ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center min-h-[400px] space-y-4", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
2780
2802
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-2", children: "Failed to load team details" }),
|
|
@@ -2785,17 +2807,17 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2785
2807
|
onClick: c,
|
|
2786
2808
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input text-gray-400 cursor-pointer bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
2787
2809
|
children: [
|
|
2788
|
-
/* @__PURE__ */ e.jsx(
|
|
2810
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4 mr-2" }),
|
|
2789
2811
|
"Try Again"
|
|
2790
2812
|
]
|
|
2791
2813
|
}
|
|
2792
2814
|
)
|
|
2793
|
-
] }) }) : m.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400", children: "No team members found" }) }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", children: m.map((
|
|
2794
|
-
const
|
|
2815
|
+
] }) }) : m.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400", children: "No team members found" }) }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", children: m.map((f, b) => {
|
|
2816
|
+
const p = f[0], h = f.length > 1 ? f[1] : "";
|
|
2795
2817
|
return /* @__PURE__ */ e.jsx(
|
|
2796
2818
|
"div",
|
|
2797
2819
|
{
|
|
2798
|
-
onClick: () => s && s(
|
|
2820
|
+
onClick: () => s && s(p),
|
|
2799
2821
|
className: `bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700
|
|
2800
2822
|
rounded-xl p-4 hover:bg-gray-300 dark:hover:bg-gray-700
|
|
2801
2823
|
transition-colors cursor-pointer`,
|
|
@@ -2803,107 +2825,107 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2803
2825
|
/* @__PURE__ */ e.jsx(
|
|
2804
2826
|
"img",
|
|
2805
2827
|
{
|
|
2806
|
-
src:
|
|
2807
|
-
alt:
|
|
2828
|
+
src: fe.userOwnerThumb(p),
|
|
2829
|
+
alt: p,
|
|
2808
2830
|
className: "w-12 h-12 rounded-full object-cover",
|
|
2809
2831
|
onError: (T) => {
|
|
2810
|
-
T.target.src = `https://ui-avatars.com/api/?name=${
|
|
2832
|
+
T.target.src = `https://ui-avatars.com/api/?name=${p}&background=random`;
|
|
2811
2833
|
}
|
|
2812
2834
|
}
|
|
2813
2835
|
),
|
|
2814
2836
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2815
2837
|
/* @__PURE__ */ e.jsxs("h3", { className: "font-semibold text-gray-900 dark:text-white truncate", children: [
|
|
2816
2838
|
"@",
|
|
2817
|
-
|
|
2839
|
+
p
|
|
2818
2840
|
] }),
|
|
2819
|
-
|
|
2841
|
+
h && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 capitalize truncate", children: h })
|
|
2820
2842
|
] })
|
|
2821
2843
|
] })
|
|
2822
2844
|
},
|
|
2823
|
-
`${
|
|
2845
|
+
`${p}-${b}`
|
|
2824
2846
|
);
|
|
2825
2847
|
}) }) });
|
|
2826
|
-
},
|
|
2827
|
-
const [r,
|
|
2828
|
-
async (
|
|
2829
|
-
if (!(i && !
|
|
2848
|
+
}, Zr = ({ communityId: t, onSelectCommunityMember: s }) => {
|
|
2849
|
+
const [r, n] = y([]), [o, d] = y(!0), [i, u] = y(!1), [c, m] = y(!0), [l, f] = y(null), [b, p] = y(null), h = 100, T = Ce(
|
|
2850
|
+
async (w = !1) => {
|
|
2851
|
+
if (!(i && !w))
|
|
2830
2852
|
try {
|
|
2831
|
-
|
|
2832
|
-
const
|
|
2853
|
+
w ? (d(!0), p(null), n([]), f(null), m(!0)) : u(!0);
|
|
2854
|
+
const k = await fe.getCommunitySubscribers(
|
|
2833
2855
|
t,
|
|
2834
|
-
|
|
2835
|
-
|
|
2856
|
+
h,
|
|
2857
|
+
w ? void 0 : l || void 0
|
|
2836
2858
|
);
|
|
2837
|
-
|
|
2838
|
-
if (
|
|
2839
|
-
const
|
|
2840
|
-
(
|
|
2859
|
+
k.length === 0 ? m(!1) : (n((v) => {
|
|
2860
|
+
if (w) return k;
|
|
2861
|
+
const D = new Set(v.map((R) => R.username)), N = k.filter(
|
|
2862
|
+
(R) => !D.has(R.username)
|
|
2841
2863
|
);
|
|
2842
|
-
return [...
|
|
2843
|
-
}),
|
|
2844
|
-
} catch (
|
|
2845
|
-
|
|
2864
|
+
return [...v, ...N];
|
|
2865
|
+
}), k.length > 0 && f(k[k.length - 1].username), m(k.length === h));
|
|
2866
|
+
} catch (k) {
|
|
2867
|
+
p(k instanceof Error ? k.message : "Failed to load members");
|
|
2846
2868
|
} finally {
|
|
2847
2869
|
d(!1), u(!1);
|
|
2848
2870
|
}
|
|
2849
2871
|
},
|
|
2850
2872
|
[t, i, l]
|
|
2851
2873
|
);
|
|
2852
|
-
return
|
|
2874
|
+
return B(() => {
|
|
2853
2875
|
T(!0);
|
|
2854
|
-
}, [t]),
|
|
2855
|
-
const
|
|
2876
|
+
}, [t]), B(() => {
|
|
2877
|
+
const w = () => {
|
|
2856
2878
|
window.innerHeight + document.documentElement.scrollTop >= document.documentElement.offsetHeight - 200 && !i && !o && c && T();
|
|
2857
2879
|
};
|
|
2858
|
-
return window.addEventListener("scroll",
|
|
2880
|
+
return window.addEventListener("scroll", w), () => window.removeEventListener("scroll", w);
|
|
2859
2881
|
}, [T, i, o, c]), o && r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
2860
|
-
/* @__PURE__ */ e.jsx(
|
|
2882
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-5 h-5 animate-spin" }),
|
|
2861
2883
|
"Loading members..."
|
|
2862
|
-
] }) }) :
|
|
2884
|
+
] }) }) : b && r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center min-h-[400px] space-y-4", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
2863
2885
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-2", children: "Failed to load members" }),
|
|
2864
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400 mb-4", children:
|
|
2886
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400 mb-4", children: b }),
|
|
2865
2887
|
/* @__PURE__ */ e.jsxs(
|
|
2866
2888
|
"button",
|
|
2867
2889
|
{
|
|
2868
2890
|
onClick: () => T(!0),
|
|
2869
2891
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
2870
2892
|
children: [
|
|
2871
|
-
/* @__PURE__ */ e.jsx(
|
|
2893
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4 mr-2" }),
|
|
2872
2894
|
"Try Again"
|
|
2873
2895
|
]
|
|
2874
2896
|
}
|
|
2875
2897
|
)
|
|
2876
2898
|
] }) }) : r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400", children: "No community members found" }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
2877
|
-
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", children: r.map((
|
|
2899
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", children: r.map((w, k) => /* @__PURE__ */ e.jsx(
|
|
2878
2900
|
"div",
|
|
2879
2901
|
{
|
|
2880
2902
|
className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-4 hover:bg-gray-300 dark:hover:bg-gray-700 transition-colors cursor-pointer",
|
|
2881
|
-
onClick: () => s == null ? void 0 : s(
|
|
2903
|
+
onClick: () => s == null ? void 0 : s(w.username),
|
|
2882
2904
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2883
2905
|
/* @__PURE__ */ e.jsx(
|
|
2884
2906
|
"img",
|
|
2885
2907
|
{
|
|
2886
|
-
src:
|
|
2887
|
-
alt:
|
|
2908
|
+
src: fe.userOwnerThumb(w.username),
|
|
2909
|
+
alt: w.username,
|
|
2888
2910
|
className: "w-12 h-12 rounded-full object-cover",
|
|
2889
|
-
onError: (
|
|
2890
|
-
|
|
2911
|
+
onError: (v) => {
|
|
2912
|
+
v.target.src = `https://ui-avatars.com/api/?name=${w.username}&background=random`;
|
|
2891
2913
|
}
|
|
2892
2914
|
}
|
|
2893
2915
|
),
|
|
2894
2916
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2895
2917
|
/* @__PURE__ */ e.jsxs("h3", { className: "font-semibold text-gray-900 dark:text-white truncate", children: [
|
|
2896
2918
|
"@",
|
|
2897
|
-
|
|
2919
|
+
w.username
|
|
2898
2920
|
] }),
|
|
2899
|
-
|
|
2921
|
+
w.role && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 capitalize truncate", children: w.role })
|
|
2900
2922
|
] })
|
|
2901
2923
|
] })
|
|
2902
2924
|
},
|
|
2903
|
-
`${
|
|
2925
|
+
`${w.username}-${k}`
|
|
2904
2926
|
)) }),
|
|
2905
2927
|
c && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-4", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
2906
|
-
/* @__PURE__ */ e.jsx(
|
|
2928
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-4 h-4 animate-spin" }),
|
|
2907
2929
|
"Loading more members..."
|
|
2908
2930
|
] }) : /* @__PURE__ */ e.jsx(
|
|
2909
2931
|
"button",
|
|
@@ -2914,11 +2936,11 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2914
2936
|
}
|
|
2915
2937
|
) })
|
|
2916
2938
|
] });
|
|
2917
|
-
},
|
|
2939
|
+
}, vs = ({
|
|
2918
2940
|
communityId: t,
|
|
2919
2941
|
onVideoClick: s,
|
|
2920
2942
|
onAuthorClick: r,
|
|
2921
|
-
onBack:
|
|
2943
|
+
onBack: n,
|
|
2922
2944
|
onclickAboutTab: o,
|
|
2923
2945
|
onclickTeamTab: d,
|
|
2924
2946
|
onclickMemberTab: i,
|
|
@@ -2926,35 +2948,35 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2926
2948
|
onFavourite: c,
|
|
2927
2949
|
onRss: m,
|
|
2928
2950
|
onMoreVertical: l,
|
|
2929
|
-
showMoreVertical:
|
|
2951
|
+
showMoreVertical: f = !0
|
|
2930
2952
|
}) => {
|
|
2931
|
-
const
|
|
2932
|
-
|
|
2953
|
+
const b = It(), [p, h] = y("videos"), [T, w] = y(null), [k, v] = y(!1), [D, N] = y(!0);
|
|
2954
|
+
B(() => {
|
|
2933
2955
|
(async () => {
|
|
2934
2956
|
try {
|
|
2935
|
-
|
|
2936
|
-
const
|
|
2937
|
-
|
|
2938
|
-
} catch (
|
|
2939
|
-
console.error("Failed to fetch community details:",
|
|
2957
|
+
N(!0);
|
|
2958
|
+
const S = await fe.getCommunityDetails(t);
|
|
2959
|
+
w(S);
|
|
2960
|
+
} catch (S) {
|
|
2961
|
+
console.error("Failed to fetch community details:", S);
|
|
2940
2962
|
} finally {
|
|
2941
|
-
|
|
2963
|
+
N(!1);
|
|
2942
2964
|
}
|
|
2943
2965
|
})();
|
|
2944
2966
|
}, [t]);
|
|
2945
|
-
const
|
|
2946
|
-
var
|
|
2947
|
-
const
|
|
2967
|
+
const R = () => {
|
|
2968
|
+
var S;
|
|
2969
|
+
const C = `https://3speak.tv/user/${t}`;
|
|
2948
2970
|
navigator.share ? navigator.share({
|
|
2949
|
-
title: ((
|
|
2950
|
-
url:
|
|
2951
|
-
}) : navigator.clipboard.writeText(
|
|
2952
|
-
},
|
|
2971
|
+
title: ((S = T == null ? void 0 : T.result) == null ? void 0 : S.title) || t,
|
|
2972
|
+
url: C
|
|
2973
|
+
}) : navigator.clipboard.writeText(C);
|
|
2974
|
+
}, A = () => {
|
|
2953
2975
|
window.open(`https://3speak.tv/rss/${t}.xml`, "_blank");
|
|
2954
|
-
},
|
|
2955
|
-
|
|
2976
|
+
}, $ = (C) => {
|
|
2977
|
+
b(`/user/${C}`);
|
|
2956
2978
|
};
|
|
2957
|
-
if (
|
|
2979
|
+
if (D)
|
|
2958
2980
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ e.jsxs("div", { className: "animate-pulse", children: [
|
|
2959
2981
|
/* @__PURE__ */ e.jsx("div", { className: "h-8 bg-gray-200 dark:bg-gray-700 rounded w-32 mb-6" }),
|
|
2960
2982
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6", children: [
|
|
@@ -2965,24 +2987,24 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2965
2987
|
/* @__PURE__ */ e.jsx("div", { className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-32" })
|
|
2966
2988
|
] })
|
|
2967
2989
|
] }),
|
|
2968
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: Array.from({ length: 4 }).map((
|
|
2990
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: Array.from({ length: 4 }).map((C, S) => /* @__PURE__ */ e.jsx(
|
|
2969
2991
|
"div",
|
|
2970
2992
|
{
|
|
2971
2993
|
className: "h-10 bg-gray-200 dark:bg-gray-700 rounded w-20"
|
|
2972
2994
|
},
|
|
2973
|
-
|
|
2995
|
+
S
|
|
2974
2996
|
)) })
|
|
2975
2997
|
] })
|
|
2976
2998
|
] }) });
|
|
2977
|
-
const
|
|
2999
|
+
const g = T == null ? void 0 : T.result;
|
|
2978
3000
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
2979
3001
|
/* @__PURE__ */ e.jsxs(
|
|
2980
3002
|
"button",
|
|
2981
3003
|
{
|
|
2982
|
-
onClick:
|
|
3004
|
+
onClick: n,
|
|
2983
3005
|
className: "flex items-center justify-center mr-4 px-2 text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-full",
|
|
2984
3006
|
children: [
|
|
2985
|
-
/* @__PURE__ */ e.jsx(
|
|
3007
|
+
/* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4 mr-2" }),
|
|
2986
3008
|
"Back"
|
|
2987
3009
|
]
|
|
2988
3010
|
}
|
|
@@ -2991,69 +3013,69 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
2991
3013
|
/* @__PURE__ */ e.jsx(
|
|
2992
3014
|
"img",
|
|
2993
3015
|
{
|
|
2994
|
-
src:
|
|
2995
|
-
alt: (
|
|
3016
|
+
src: fe.userOwnerThumb(t),
|
|
3017
|
+
alt: (g == null ? void 0 : g.title) || t,
|
|
2996
3018
|
className: "w-16 h-16 rounded-full object-cover",
|
|
2997
|
-
onError: (
|
|
2998
|
-
|
|
3019
|
+
onError: (C) => {
|
|
3020
|
+
C.target.src = `https://images.hive.blog/u/${(g == null ? void 0 : g.title) || t}/avatar`;
|
|
2999
3021
|
}
|
|
3000
3022
|
}
|
|
3001
3023
|
),
|
|
3002
3024
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1", children: [
|
|
3003
|
-
/* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: (
|
|
3004
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-4", children: (
|
|
3025
|
+
/* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: (g == null ? void 0 : g.title) || t }),
|
|
3026
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-4", children: (g == null ? void 0 : g.about) || "Community description" }),
|
|
3005
3027
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-6 text-sm", children: [
|
|
3006
3028
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
3007
|
-
/* @__PURE__ */ e.jsx(
|
|
3029
|
+
/* @__PURE__ */ e.jsx(ze, { className: "w-4 h-4" }),
|
|
3008
3030
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
3009
|
-
((
|
|
3031
|
+
((g == null ? void 0 : g.subscribers) || 0).toLocaleString(),
|
|
3010
3032
|
" members"
|
|
3011
3033
|
] })
|
|
3012
3034
|
] }),
|
|
3013
3035
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
3014
|
-
/* @__PURE__ */ e.jsx(
|
|
3036
|
+
/* @__PURE__ */ e.jsx(Dt, { className: "w-4 h-4" }),
|
|
3015
3037
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
3016
3038
|
"Created",
|
|
3017
3039
|
" ",
|
|
3018
|
-
|
|
3040
|
+
g != null && g.created_at ? new Date(g.created_at).getFullYear() : "Unknown"
|
|
3019
3041
|
] })
|
|
3020
3042
|
] })
|
|
3021
3043
|
] })
|
|
3022
3044
|
] }),
|
|
3023
3045
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3024
3046
|
/* @__PURE__ */ e.jsx(
|
|
3025
|
-
|
|
3047
|
+
Wt,
|
|
3026
3048
|
{
|
|
3027
3049
|
id: t,
|
|
3028
3050
|
toastType: "community",
|
|
3029
|
-
onAdd: (
|
|
3030
|
-
onRemove: (
|
|
3051
|
+
onAdd: (C, S) => console.log("Added:", C, S),
|
|
3052
|
+
onRemove: (C, S) => console.log("Removed:", C, S),
|
|
3031
3053
|
onFavourite: c
|
|
3032
3054
|
}
|
|
3033
3055
|
),
|
|
3034
3056
|
/* @__PURE__ */ e.jsx(
|
|
3035
3057
|
"button",
|
|
3036
3058
|
{
|
|
3037
|
-
onClick: m ||
|
|
3059
|
+
onClick: m || A,
|
|
3038
3060
|
className: "p-2 rounded-lg border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",
|
|
3039
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3061
|
+
children: /* @__PURE__ */ e.jsx(Mt, { className: "w-4 h-4" })
|
|
3040
3062
|
}
|
|
3041
3063
|
),
|
|
3042
3064
|
/* @__PURE__ */ e.jsx(
|
|
3043
3065
|
"button",
|
|
3044
3066
|
{
|
|
3045
|
-
onClick: u ||
|
|
3067
|
+
onClick: u || R,
|
|
3046
3068
|
className: "p-2 rounded-lg border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",
|
|
3047
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3069
|
+
children: /* @__PURE__ */ e.jsx(ct, { className: "w-4 h-4" })
|
|
3048
3070
|
}
|
|
3049
3071
|
),
|
|
3050
|
-
|
|
3072
|
+
f && /* @__PURE__ */ e.jsx(
|
|
3051
3073
|
"button",
|
|
3052
3074
|
{
|
|
3053
3075
|
onClick: l || (() => {
|
|
3054
3076
|
}),
|
|
3055
3077
|
className: "p-2 rounded-lg border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",
|
|
3056
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3078
|
+
children: /* @__PURE__ */ e.jsx(dt, { className: "w-4 h-4" })
|
|
3057
3079
|
}
|
|
3058
3080
|
)
|
|
3059
3081
|
] })
|
|
@@ -3063,76 +3085,76 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3063
3085
|
/* @__PURE__ */ e.jsx(
|
|
3064
3086
|
"button",
|
|
3065
3087
|
{
|
|
3066
|
-
onClick: () =>
|
|
3067
|
-
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${
|
|
3088
|
+
onClick: () => h("videos"),
|
|
3089
|
+
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${p === "videos" ? "bg-blue-600 dark:bg-blue-500 text-white" : "text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700"}`,
|
|
3068
3090
|
children: "Videos"
|
|
3069
3091
|
}
|
|
3070
3092
|
),
|
|
3071
3093
|
/* @__PURE__ */ e.jsx(
|
|
3072
3094
|
"button",
|
|
3073
3095
|
{
|
|
3074
|
-
onClick: () => o ? o() :
|
|
3075
|
-
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${
|
|
3096
|
+
onClick: () => o ? o() : h("about"),
|
|
3097
|
+
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${p === "about" ? "bg-blue-600 dark:bg-blue-500 text-white" : "text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700"}`,
|
|
3076
3098
|
children: "About"
|
|
3077
3099
|
}
|
|
3078
3100
|
),
|
|
3079
3101
|
/* @__PURE__ */ e.jsx(
|
|
3080
3102
|
"button",
|
|
3081
3103
|
{
|
|
3082
|
-
onClick: () => d ? d() :
|
|
3083
|
-
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${
|
|
3104
|
+
onClick: () => d ? d() : h("team"),
|
|
3105
|
+
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${p === "team" ? "bg-blue-600 dark:bg-blue-500 text-white" : "text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700"}`,
|
|
3084
3106
|
children: "Team"
|
|
3085
3107
|
}
|
|
3086
3108
|
),
|
|
3087
3109
|
/* @__PURE__ */ e.jsx(
|
|
3088
3110
|
"button",
|
|
3089
3111
|
{
|
|
3090
|
-
onClick: () => i ? i() :
|
|
3091
|
-
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${
|
|
3112
|
+
onClick: () => i ? i() : h("members"),
|
|
3113
|
+
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${p === "members" ? "bg-blue-600 dark:bg-blue-500 text-white" : "text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700"}`,
|
|
3092
3114
|
children: "Members"
|
|
3093
3115
|
}
|
|
3094
3116
|
)
|
|
3095
3117
|
] }),
|
|
3096
3118
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-6", children: [
|
|
3097
|
-
|
|
3098
|
-
|
|
3119
|
+
p === "videos" && /* @__PURE__ */ e.jsx(
|
|
3120
|
+
ut,
|
|
3099
3121
|
{
|
|
3100
|
-
feedType:
|
|
3122
|
+
feedType: K.COMMUNITY,
|
|
3101
3123
|
communityId: t,
|
|
3102
3124
|
onVideoClick: s,
|
|
3103
3125
|
onAuthorClick: r
|
|
3104
3126
|
}
|
|
3105
3127
|
),
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3128
|
+
p === "about" && !o && /* @__PURE__ */ e.jsx(Qr, { communityId: t }),
|
|
3129
|
+
p === "team" && !d && /* @__PURE__ */ e.jsx(
|
|
3130
|
+
Xr,
|
|
3109
3131
|
{
|
|
3110
3132
|
communityId: t,
|
|
3111
|
-
onSelectTeamMember:
|
|
3133
|
+
onSelectTeamMember: $
|
|
3112
3134
|
}
|
|
3113
3135
|
),
|
|
3114
|
-
|
|
3115
|
-
|
|
3136
|
+
p === "members" && !i && /* @__PURE__ */ e.jsx(
|
|
3137
|
+
Zr,
|
|
3116
3138
|
{
|
|
3117
3139
|
communityId: t,
|
|
3118
|
-
onSelectCommunityMember:
|
|
3140
|
+
onSelectCommunityMember: $
|
|
3119
3141
|
}
|
|
3120
3142
|
)
|
|
3121
3143
|
] })
|
|
3122
3144
|
] })
|
|
3123
3145
|
] });
|
|
3124
|
-
},
|
|
3146
|
+
}, js = ({
|
|
3125
3147
|
currentUser: t,
|
|
3126
3148
|
onTabChanged: s,
|
|
3127
3149
|
onPublish: r,
|
|
3128
|
-
onViewMyVideo:
|
|
3150
|
+
onViewMyVideo: n,
|
|
3129
3151
|
onMoreOptions: o,
|
|
3130
3152
|
onTapBackButton: d,
|
|
3131
3153
|
shouldShowBackButton: i = !0,
|
|
3132
3154
|
shouldShowPublishButton: u = !1,
|
|
3133
3155
|
shouldShowMoreOptionsButton: c = !1
|
|
3134
3156
|
}) => {
|
|
3135
|
-
const m =
|
|
3157
|
+
const m = It(), [l, f] = y(0), [b, p] = y([]), [h, T] = y(!0), [w, k] = y(null), v = b.filter(
|
|
3136
3158
|
(F) => [
|
|
3137
3159
|
"encoding",
|
|
3138
3160
|
"uploaded",
|
|
@@ -3143,31 +3165,31 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3143
3165
|
"encoding_failed",
|
|
3144
3166
|
"encoding_ipfs"
|
|
3145
3167
|
].includes(F.status || "")
|
|
3146
|
-
),
|
|
3147
|
-
|
|
3148
|
-
t != null && t.token &&
|
|
3168
|
+
), D = b.filter((F) => F.status === "publish_manual"), N = b.filter((F) => F.status === "published");
|
|
3169
|
+
B(() => {
|
|
3170
|
+
t != null && t.token && R();
|
|
3149
3171
|
}, [t]);
|
|
3150
|
-
const
|
|
3172
|
+
const R = async () => {
|
|
3151
3173
|
if (!(t != null && t.token)) {
|
|
3152
|
-
|
|
3174
|
+
k("No authentication token provided"), T(!1);
|
|
3153
3175
|
return;
|
|
3154
3176
|
}
|
|
3155
|
-
T(!0),
|
|
3177
|
+
T(!0), k(null);
|
|
3156
3178
|
try {
|
|
3157
|
-
const F = await
|
|
3158
|
-
|
|
3179
|
+
const F = await te.getMyVideos(t.token);
|
|
3180
|
+
p(F);
|
|
3159
3181
|
} catch (F) {
|
|
3160
|
-
console.error("Error fetching videos:", F),
|
|
3182
|
+
console.error("Error fetching videos:", F), k(
|
|
3161
3183
|
`Failed to load videos: ${F instanceof Error ? F.message : "Unknown error"}`
|
|
3162
3184
|
);
|
|
3163
3185
|
} finally {
|
|
3164
3186
|
T(!1);
|
|
3165
3187
|
}
|
|
3166
|
-
},
|
|
3167
|
-
|
|
3168
|
-
},
|
|
3188
|
+
}, A = (F) => {
|
|
3189
|
+
f(F), s == null || s(F);
|
|
3190
|
+
}, $ = (F) => {
|
|
3169
3191
|
F.owner && F.permlink && m(`/video/${F.owner}/${F.permlink}`);
|
|
3170
|
-
},
|
|
3192
|
+
}, g = (F) => {
|
|
3171
3193
|
switch (F.toLowerCase()) {
|
|
3172
3194
|
case "published":
|
|
3173
3195
|
return "bg-green-500";
|
|
@@ -3181,33 +3203,33 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3181
3203
|
default:
|
|
3182
3204
|
return "bg-gray-500";
|
|
3183
3205
|
}
|
|
3184
|
-
},
|
|
3206
|
+
}, C = [
|
|
3185
3207
|
"ipfs_pinning",
|
|
3186
3208
|
"ipfs_pinning_failed",
|
|
3187
3209
|
"encoding",
|
|
3188
3210
|
"encoding_failed",
|
|
3189
3211
|
"encoding_ipfs"
|
|
3190
|
-
],
|
|
3212
|
+
], S = (F, O) => {
|
|
3191
3213
|
if (F.length === 0) {
|
|
3192
|
-
let
|
|
3193
|
-
switch (
|
|
3214
|
+
let _ = "";
|
|
3215
|
+
switch (O) {
|
|
3194
3216
|
case "publishNow":
|
|
3195
|
-
|
|
3217
|
+
_ = "No videos ready to publish.";
|
|
3196
3218
|
break;
|
|
3197
3219
|
case "myVideos":
|
|
3198
|
-
|
|
3220
|
+
_ = "No published videos found.";
|
|
3199
3221
|
break;
|
|
3200
3222
|
case "encoding":
|
|
3201
|
-
|
|
3223
|
+
_ = "No videos currently encoding.";
|
|
3202
3224
|
break;
|
|
3203
3225
|
}
|
|
3204
3226
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-16", children: [
|
|
3205
|
-
/* @__PURE__ */ e.jsx(
|
|
3206
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400 text-center", children:
|
|
3227
|
+
/* @__PURE__ */ e.jsx(Ct, { className: "w-16 h-16 text-gray-400 mb-4" }),
|
|
3228
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400 text-center", children: _ })
|
|
3207
3229
|
] });
|
|
3208
3230
|
}
|
|
3209
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3 w-full", children: F.map((
|
|
3210
|
-
const
|
|
3231
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3 w-full", children: F.map((_, Y) => {
|
|
3232
|
+
const Q = _.thumbnail || "", U = _.title || "No Title", H = _.permlink || "", re = _.owner || (t == null ? void 0 : t.username) || "", X = _.id || "", ue = C.includes(_.status || "");
|
|
3211
3233
|
return /* @__PURE__ */ e.jsx(
|
|
3212
3234
|
"div",
|
|
3213
3235
|
{
|
|
@@ -3217,20 +3239,20 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3217
3239
|
/* @__PURE__ */ e.jsx(
|
|
3218
3240
|
"img",
|
|
3219
3241
|
{
|
|
3220
|
-
src:
|
|
3242
|
+
src: je(Q) || `https://images.hive.blog/u/${t == null ? void 0 : t.username}/avatar`,
|
|
3221
3243
|
alt: U,
|
|
3222
3244
|
className: "w-24 h-16 rounded-lg object-cover",
|
|
3223
|
-
onError: (
|
|
3224
|
-
|
|
3245
|
+
onError: (Z) => {
|
|
3246
|
+
Z.target.src = `https://images.hive.blog/u/${t == null ? void 0 : t.username}/avatar`;
|
|
3225
3247
|
}
|
|
3226
3248
|
}
|
|
3227
3249
|
),
|
|
3228
|
-
|
|
3250
|
+
C.includes(_.status || "") ? /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30 rounded-lg", children: /* @__PURE__ */ e.jsx(St, { className: "w-6 h-6 text-red-500" }) }) : /* @__PURE__ */ e.jsx(
|
|
3229
3251
|
"div",
|
|
3230
3252
|
{
|
|
3231
3253
|
className: "absolute inset-0 flex items-center justify-center bg-black/20 opacity-0 hover:opacity-100 transition-opacity cursor-pointer rounded-lg",
|
|
3232
|
-
onClick: () =>
|
|
3233
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3254
|
+
onClick: () => $(_),
|
|
3255
|
+
children: /* @__PURE__ */ e.jsx(ot, { className: "w-6 h-6 text-white" })
|
|
3234
3256
|
}
|
|
3235
3257
|
)
|
|
3236
3258
|
] }),
|
|
@@ -3239,7 +3261,7 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3239
3261
|
"h3",
|
|
3240
3262
|
{
|
|
3241
3263
|
className: "font-semibold text-gray-900 dark:text-white text-sm cursor-pointer hover:text-blue-600 dark:hover:text-blue-400",
|
|
3242
|
-
onClick: () =>
|
|
3264
|
+
onClick: () => $(_),
|
|
3243
3265
|
style: {
|
|
3244
3266
|
display: "-webkit-box",
|
|
3245
3267
|
WebkitLineClamp: 2,
|
|
@@ -3252,31 +3274,31 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3252
3274
|
),
|
|
3253
3275
|
/* @__PURE__ */ e.jsxs("p", { className: "text-gray-600 dark:text-gray-400 text-xs mt-1", children: [
|
|
3254
3276
|
"By ",
|
|
3255
|
-
|
|
3277
|
+
re
|
|
3256
3278
|
] }),
|
|
3257
|
-
|
|
3279
|
+
_.status && /* @__PURE__ */ e.jsx("div", { className: "mt-2", children: /* @__PURE__ */ e.jsx(
|
|
3258
3280
|
"span",
|
|
3259
3281
|
{
|
|
3260
|
-
className: `inline-block px-2 py-1 rounded-full text-xs font-semibold text-white ${
|
|
3261
|
-
|
|
3282
|
+
className: `inline-block px-2 py-1 rounded-full text-xs font-semibold text-white ${g(
|
|
3283
|
+
_.status
|
|
3262
3284
|
)}`,
|
|
3263
|
-
children:
|
|
3285
|
+
children: _.status.toUpperCase()
|
|
3264
3286
|
}
|
|
3265
3287
|
) })
|
|
3266
3288
|
] }),
|
|
3267
|
-
|
|
3268
|
-
|
|
3289
|
+
ue ? /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 pl-2", children: /* @__PURE__ */ e.jsx(St, { className: "w-5 h-5 text-red-500" }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-end gap-2", children: [
|
|
3290
|
+
O === "publishNow" && u && /* @__PURE__ */ e.jsx(
|
|
3269
3291
|
"button",
|
|
3270
3292
|
{
|
|
3271
|
-
onClick: () => r == null ? void 0 : r(
|
|
3293
|
+
onClick: () => r == null ? void 0 : r(re, H),
|
|
3272
3294
|
className: "bg-green-600 hover:bg-green-700 text-white text-xs px-3 py-1 rounded-md transition-colors",
|
|
3273
3295
|
children: "Publish"
|
|
3274
3296
|
}
|
|
3275
3297
|
),
|
|
3276
|
-
|
|
3298
|
+
O === "myVideos" && /* @__PURE__ */ e.jsx(
|
|
3277
3299
|
"button",
|
|
3278
3300
|
{
|
|
3279
|
-
onClick: () =>
|
|
3301
|
+
onClick: () => n ? n(re, H) : $(_),
|
|
3280
3302
|
className: "bg-blue-600 hover:bg-blue-700 text-white text-xs px-3 py-1 rounded-md transition-colors",
|
|
3281
3303
|
children: "View"
|
|
3282
3304
|
}
|
|
@@ -3284,15 +3306,15 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3284
3306
|
c && /* @__PURE__ */ e.jsx(
|
|
3285
3307
|
"button",
|
|
3286
3308
|
{
|
|
3287
|
-
onClick: () => o == null ? void 0 : o(
|
|
3309
|
+
onClick: () => o == null ? void 0 : o(X),
|
|
3288
3310
|
className: "p-1 h-6 w-6 rounded-md hover:bg-gray-300 dark:hover:bg-gray-700 transition-colors",
|
|
3289
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3311
|
+
children: /* @__PURE__ */ e.jsx(dt, { className: "w-4 h-4" })
|
|
3290
3312
|
}
|
|
3291
3313
|
)
|
|
3292
3314
|
] })
|
|
3293
3315
|
] })
|
|
3294
3316
|
},
|
|
3295
|
-
`${
|
|
3317
|
+
`${X}-${Y}`
|
|
3296
3318
|
);
|
|
3297
3319
|
}) });
|
|
3298
3320
|
};
|
|
@@ -3303,7 +3325,7 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3303
3325
|
onClick: d,
|
|
3304
3326
|
className: "flex items-center justify-center mr-4 my-2 px-2 text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-full",
|
|
3305
3327
|
children: [
|
|
3306
|
-
/* @__PURE__ */ e.jsx(
|
|
3328
|
+
/* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4 mr-2" }),
|
|
3307
3329
|
"Back"
|
|
3308
3330
|
]
|
|
3309
3331
|
}
|
|
@@ -3327,9 +3349,9 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3327
3349
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
3328
3350
|
"button",
|
|
3329
3351
|
{
|
|
3330
|
-
onClick:
|
|
3352
|
+
onClick: R,
|
|
3331
3353
|
className: "p-2 rounded-md hover:bg-gray-300 dark:hover:bg-gray-700 transition-colors",
|
|
3332
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3354
|
+
children: /* @__PURE__ */ e.jsx(ce, { className: "w-5 h-5" })
|
|
3333
3355
|
}
|
|
3334
3356
|
) })
|
|
3335
3357
|
] }),
|
|
@@ -3337,78 +3359,78 @@ const ce = new Qr(), vs = ({ onSelectCommunity: t }) => {
|
|
|
3337
3359
|
/* @__PURE__ */ e.jsxs(
|
|
3338
3360
|
"button",
|
|
3339
3361
|
{
|
|
3340
|
-
onClick: () =>
|
|
3362
|
+
onClick: () => A(0),
|
|
3341
3363
|
className: `flex items-center gap-2 px-4 md:px-6 py-3 border-b-2 font-medium text-sm transition-colors whitespace-nowrap flex-shrink-0 ${l === 0 ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"}`,
|
|
3342
3364
|
children: [
|
|
3343
3365
|
/* @__PURE__ */ e.jsx(vr, { className: "w-4 h-4" }),
|
|
3344
3366
|
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: "Publish Now" }),
|
|
3345
3367
|
/* @__PURE__ */ e.jsx("span", { className: "sm:hidden", children: "Publish" }),
|
|
3346
|
-
|
|
3368
|
+
D.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 text-xs px-2 py-1 rounded-full", children: D.length })
|
|
3347
3369
|
]
|
|
3348
3370
|
}
|
|
3349
3371
|
),
|
|
3350
3372
|
/* @__PURE__ */ e.jsxs(
|
|
3351
3373
|
"button",
|
|
3352
3374
|
{
|
|
3353
|
-
onClick: () =>
|
|
3375
|
+
onClick: () => A(1),
|
|
3354
3376
|
className: `flex items-center gap-2 px-4 md:px-6 py-3 border-b-2 font-medium text-sm transition-colors whitespace-nowrap flex-shrink-0 ${l === 1 ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"}`,
|
|
3355
3377
|
children: [
|
|
3356
|
-
/* @__PURE__ */ e.jsx(
|
|
3378
|
+
/* @__PURE__ */ e.jsx(Ct, { className: "w-4 h-4" }),
|
|
3357
3379
|
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: "My Videos" }),
|
|
3358
3380
|
/* @__PURE__ */ e.jsx("span", { className: "sm:hidden", children: "Videos" }),
|
|
3359
|
-
|
|
3381
|
+
N.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 text-xs px-2 py-1 rounded-full", children: N.length })
|
|
3360
3382
|
]
|
|
3361
3383
|
}
|
|
3362
3384
|
),
|
|
3363
3385
|
/* @__PURE__ */ e.jsxs(
|
|
3364
3386
|
"button",
|
|
3365
3387
|
{
|
|
3366
|
-
onClick: () =>
|
|
3388
|
+
onClick: () => A(2),
|
|
3367
3389
|
className: `flex items-center gap-2 px-4 md:px-6 py-3 border-b-2 font-medium text-sm transition-colors whitespace-nowrap flex-shrink-0 ${l === 2 ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"}`,
|
|
3368
3390
|
children: [
|
|
3369
3391
|
/* @__PURE__ */ e.jsx(jr, { className: "w-4 h-4" }),
|
|
3370
3392
|
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: "Encoding" }),
|
|
3371
3393
|
/* @__PURE__ */ e.jsx("span", { className: "sm:hidden", children: "Encoding" }),
|
|
3372
|
-
|
|
3394
|
+
v.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 text-xs px-2 py-1 rounded-full", children: v.length })
|
|
3373
3395
|
]
|
|
3374
3396
|
}
|
|
3375
3397
|
)
|
|
3376
3398
|
] }) })
|
|
3377
3399
|
] }),
|
|
3378
|
-
/* @__PURE__ */ e.jsx("div", { className: "py-4 md:py-6 w-full", children:
|
|
3379
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-16 h-16 bg-red-100 dark:bg-red-900 rounded-full flex items-center justify-center mb-4", children: /* @__PURE__ */ e.jsx(
|
|
3400
|
+
/* @__PURE__ */ e.jsx("div", { className: "py-4 md:py-6 w-full", children: h ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600" }) }) : w ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center min-h-[400px] text-center", children: [
|
|
3401
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-16 h-16 bg-red-100 dark:bg-red-900 rounded-full flex items-center justify-center mb-4", children: /* @__PURE__ */ e.jsx(At, { className: "w-8 h-8 text-red-600 dark:text-red-400" }) }),
|
|
3380
3402
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-2", children: "Failed to load videos" }),
|
|
3381
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-4", children:
|
|
3403
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-4", children: w }),
|
|
3382
3404
|
/* @__PURE__ */ e.jsx(
|
|
3383
3405
|
"button",
|
|
3384
3406
|
{
|
|
3385
|
-
onClick:
|
|
3407
|
+
onClick: R,
|
|
3386
3408
|
className: "bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md transition-colors",
|
|
3387
3409
|
children: "Retry"
|
|
3388
3410
|
}
|
|
3389
3411
|
)
|
|
3390
3412
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
3391
|
-
l === 0 &&
|
|
3392
|
-
|
|
3413
|
+
l === 0 && S(
|
|
3414
|
+
D,
|
|
3393
3415
|
"publishNow"
|
|
3394
3416
|
/* PUBLISH_NOW */
|
|
3395
3417
|
),
|
|
3396
|
-
l === 1 &&
|
|
3397
|
-
|
|
3418
|
+
l === 1 && S(
|
|
3419
|
+
N,
|
|
3398
3420
|
"myVideos"
|
|
3399
3421
|
/* MY_VIDEOS */
|
|
3400
3422
|
),
|
|
3401
|
-
l === 2 &&
|
|
3402
|
-
|
|
3423
|
+
l === 2 && S(
|
|
3424
|
+
v,
|
|
3403
3425
|
"encoding"
|
|
3404
3426
|
/* ENCODING */
|
|
3405
3427
|
)
|
|
3406
3428
|
] }) })
|
|
3407
3429
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400", children: "Please login to view your account" }) });
|
|
3408
3430
|
};
|
|
3409
|
-
class
|
|
3431
|
+
class es {
|
|
3410
3432
|
constructor() {
|
|
3411
|
-
|
|
3433
|
+
De(this, "HIVE_API_URL", "https://api.hive.blog");
|
|
3412
3434
|
}
|
|
3413
3435
|
async getProfile(s) {
|
|
3414
3436
|
const r = {
|
|
@@ -3418,16 +3440,16 @@ class ts {
|
|
|
3418
3440
|
account: s
|
|
3419
3441
|
},
|
|
3420
3442
|
id: 1
|
|
3421
|
-
},
|
|
3443
|
+
}, n = await fetch(this.HIVE_API_URL, {
|
|
3422
3444
|
method: "POST",
|
|
3423
3445
|
headers: {
|
|
3424
3446
|
"Content-Type": "application/json"
|
|
3425
3447
|
},
|
|
3426
3448
|
body: JSON.stringify(r)
|
|
3427
3449
|
});
|
|
3428
|
-
if (!
|
|
3429
|
-
throw new Error(`HTTP error! status: ${
|
|
3430
|
-
return await
|
|
3450
|
+
if (!n.ok)
|
|
3451
|
+
throw new Error(`HTTP error! status: ${n.status}`);
|
|
3452
|
+
return await n.json();
|
|
3431
3453
|
}
|
|
3432
3454
|
async getFollowers(s) {
|
|
3433
3455
|
const r = {
|
|
@@ -3435,16 +3457,16 @@ class ts {
|
|
|
3435
3457
|
method: "condenser_api.get_followers",
|
|
3436
3458
|
params: [s, null, "blog"],
|
|
3437
3459
|
id: 1
|
|
3438
|
-
},
|
|
3460
|
+
}, n = await fetch(this.HIVE_API_URL, {
|
|
3439
3461
|
method: "POST",
|
|
3440
3462
|
headers: {
|
|
3441
3463
|
"Content-Type": "application/json"
|
|
3442
3464
|
},
|
|
3443
3465
|
body: JSON.stringify(r)
|
|
3444
3466
|
});
|
|
3445
|
-
if (!
|
|
3446
|
-
throw new Error(`HTTP error! status: ${
|
|
3447
|
-
return (await
|
|
3467
|
+
if (!n.ok)
|
|
3468
|
+
throw new Error(`HTTP error! status: ${n.status}`);
|
|
3469
|
+
return (await n.json()).result;
|
|
3448
3470
|
}
|
|
3449
3471
|
async getFollowing(s) {
|
|
3450
3472
|
const r = {
|
|
@@ -3452,30 +3474,30 @@ class ts {
|
|
|
3452
3474
|
method: "condenser_api.get_following",
|
|
3453
3475
|
params: [s, null, "blog"],
|
|
3454
3476
|
id: 1
|
|
3455
|
-
},
|
|
3477
|
+
}, n = await fetch(this.HIVE_API_URL, {
|
|
3456
3478
|
method: "POST",
|
|
3457
3479
|
headers: {
|
|
3458
3480
|
"Content-Type": "application/json"
|
|
3459
3481
|
},
|
|
3460
3482
|
body: JSON.stringify(r)
|
|
3461
3483
|
});
|
|
3462
|
-
if (!
|
|
3463
|
-
throw new Error(`HTTP error! status: ${
|
|
3464
|
-
return (await
|
|
3484
|
+
if (!n.ok)
|
|
3485
|
+
throw new Error(`HTTP error! status: ${n.status}`);
|
|
3486
|
+
return (await n.json()).result;
|
|
3465
3487
|
}
|
|
3466
3488
|
userAvatar(s) {
|
|
3467
3489
|
return `https://images.hive.blog/u/${s}/avatar`;
|
|
3468
3490
|
}
|
|
3469
3491
|
}
|
|
3470
|
-
const
|
|
3492
|
+
const he = new es(), ts = ({
|
|
3471
3493
|
username: t,
|
|
3472
3494
|
onSelectUser: s
|
|
3473
3495
|
}) => {
|
|
3474
|
-
const [r,
|
|
3496
|
+
const [r, n] = y([]), [o, d] = y(!0), [i, u] = y(null), c = async () => {
|
|
3475
3497
|
try {
|
|
3476
3498
|
d(!0), u(null);
|
|
3477
|
-
const m = await
|
|
3478
|
-
|
|
3499
|
+
const m = await he.getFollowers(t);
|
|
3500
|
+
n(m);
|
|
3479
3501
|
} catch (m) {
|
|
3480
3502
|
u(
|
|
3481
3503
|
m instanceof Error ? m.message : "Failed to load followers"
|
|
@@ -3484,10 +3506,10 @@ const ie = new ts(), rs = ({
|
|
|
3484
3506
|
d(!1);
|
|
3485
3507
|
}
|
|
3486
3508
|
};
|
|
3487
|
-
return
|
|
3509
|
+
return B(() => {
|
|
3488
3510
|
c();
|
|
3489
3511
|
}, [t]), o ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
3490
|
-
/* @__PURE__ */ e.jsx(
|
|
3512
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-5 h-5 animate-spin" }),
|
|
3491
3513
|
"Loading followers..."
|
|
3492
3514
|
] }) }) : i ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center min-h-[400px] space-y-4", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
3493
3515
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-2", children: "Failed to load followers" }),
|
|
@@ -3498,7 +3520,7 @@ const ie = new ts(), rs = ({
|
|
|
3498
3520
|
onClick: c,
|
|
3499
3521
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input text-gray-400 cursor-pointer bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
3500
3522
|
children: [
|
|
3501
|
-
/* @__PURE__ */ e.jsx(
|
|
3523
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4 mr-2" }),
|
|
3502
3524
|
"Try Again"
|
|
3503
3525
|
]
|
|
3504
3526
|
}
|
|
@@ -3514,11 +3536,11 @@ const ie = new ts(), rs = ({
|
|
|
3514
3536
|
/* @__PURE__ */ e.jsx(
|
|
3515
3537
|
"img",
|
|
3516
3538
|
{
|
|
3517
|
-
src:
|
|
3539
|
+
src: he.userAvatar(m.follower),
|
|
3518
3540
|
alt: m.follower,
|
|
3519
3541
|
className: "w-12 h-12 rounded-full object-cover",
|
|
3520
|
-
onError: (
|
|
3521
|
-
|
|
3542
|
+
onError: (f) => {
|
|
3543
|
+
f.target.src = `https://ui-avatars.com/api/?name=${m.follower}&background=random`;
|
|
3522
3544
|
}
|
|
3523
3545
|
}
|
|
3524
3546
|
),
|
|
@@ -3530,15 +3552,15 @@ const ie = new ts(), rs = ({
|
|
|
3530
3552
|
},
|
|
3531
3553
|
`${m.follower}-${l}`
|
|
3532
3554
|
)) }) });
|
|
3533
|
-
},
|
|
3555
|
+
}, rs = ({
|
|
3534
3556
|
username: t,
|
|
3535
3557
|
onSelectUser: s
|
|
3536
3558
|
}) => {
|
|
3537
|
-
const [r,
|
|
3559
|
+
const [r, n] = y([]), [o, d] = y(!0), [i, u] = y(null), c = async () => {
|
|
3538
3560
|
try {
|
|
3539
3561
|
d(!0), u(null);
|
|
3540
|
-
const m = await
|
|
3541
|
-
|
|
3562
|
+
const m = await he.getFollowing(t);
|
|
3563
|
+
n(m);
|
|
3542
3564
|
} catch (m) {
|
|
3543
3565
|
u(
|
|
3544
3566
|
m instanceof Error ? m.message : "Failed to load following list"
|
|
@@ -3547,10 +3569,10 @@ const ie = new ts(), rs = ({
|
|
|
3547
3569
|
d(!1);
|
|
3548
3570
|
}
|
|
3549
3571
|
};
|
|
3550
|
-
return
|
|
3572
|
+
return B(() => {
|
|
3551
3573
|
c();
|
|
3552
3574
|
}, [t]), o ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
3553
|
-
/* @__PURE__ */ e.jsx(
|
|
3575
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-5 h-5 animate-spin" }),
|
|
3554
3576
|
"Loading following list..."
|
|
3555
3577
|
] }) }) : i ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center min-h-[400px] space-y-4", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
3556
3578
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-2", children: "Failed to load following list" }),
|
|
@@ -3561,7 +3583,7 @@ const ie = new ts(), rs = ({
|
|
|
3561
3583
|
onClick: c,
|
|
3562
3584
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input text-gray-400 cursor-pointer bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
3563
3585
|
children: [
|
|
3564
|
-
/* @__PURE__ */ e.jsx(
|
|
3586
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4 mr-2" }),
|
|
3565
3587
|
"Try Again"
|
|
3566
3588
|
]
|
|
3567
3589
|
}
|
|
@@ -3577,11 +3599,11 @@ const ie = new ts(), rs = ({
|
|
|
3577
3599
|
/* @__PURE__ */ e.jsx(
|
|
3578
3600
|
"img",
|
|
3579
3601
|
{
|
|
3580
|
-
src:
|
|
3602
|
+
src: he.userAvatar(m.following),
|
|
3581
3603
|
alt: m.following,
|
|
3582
3604
|
className: "w-12 h-12 rounded-full object-cover",
|
|
3583
|
-
onError: (
|
|
3584
|
-
|
|
3605
|
+
onError: (f) => {
|
|
3606
|
+
f.target.src = `https://ui-avatars.com/api/?name=${m.following}&background=random`;
|
|
3585
3607
|
}
|
|
3586
3608
|
}
|
|
3587
3609
|
),
|
|
@@ -3593,38 +3615,38 @@ const ie = new ts(), rs = ({
|
|
|
3593
3615
|
},
|
|
3594
3616
|
`${m.following}-${l}`
|
|
3595
3617
|
)) }) });
|
|
3596
|
-
},
|
|
3597
|
-
var
|
|
3598
|
-
const [s, r] =
|
|
3618
|
+
}, ss = ({ username: t }) => {
|
|
3619
|
+
var b, p, h, T, w, k;
|
|
3620
|
+
const [s, r] = y(null), [n, o] = y(!0), [d, i] = y(null), u = async () => {
|
|
3599
3621
|
try {
|
|
3600
3622
|
o(!0), i(null);
|
|
3601
|
-
const
|
|
3602
|
-
r(
|
|
3603
|
-
} catch (
|
|
3623
|
+
const v = await he.getProfile(t);
|
|
3624
|
+
r(v);
|
|
3625
|
+
} catch (v) {
|
|
3604
3626
|
i(
|
|
3605
|
-
|
|
3627
|
+
v instanceof Error ? v.message : "Failed to load user details"
|
|
3606
3628
|
);
|
|
3607
3629
|
} finally {
|
|
3608
3630
|
o(!1);
|
|
3609
3631
|
}
|
|
3610
3632
|
};
|
|
3611
|
-
|
|
3633
|
+
B(() => {
|
|
3612
3634
|
u();
|
|
3613
3635
|
}, [t]);
|
|
3614
|
-
const c = (
|
|
3636
|
+
const c = (v) => {
|
|
3615
3637
|
try {
|
|
3616
|
-
return new Date(
|
|
3638
|
+
return new Date(v).toLocaleDateString("en-US", {
|
|
3617
3639
|
year: "numeric",
|
|
3618
3640
|
month: "long",
|
|
3619
3641
|
day: "numeric"
|
|
3620
3642
|
});
|
|
3621
3643
|
} catch {
|
|
3622
|
-
return
|
|
3644
|
+
return v;
|
|
3623
3645
|
}
|
|
3624
|
-
}, m = (
|
|
3625
|
-
if (
|
|
3646
|
+
}, m = (v) => v.replace(/<[^>]*>/g, "");
|
|
3647
|
+
if (n)
|
|
3626
3648
|
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
3627
|
-
/* @__PURE__ */ e.jsx(
|
|
3649
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-5 h-5 animate-spin" }),
|
|
3628
3650
|
"Loading user details..."
|
|
3629
3651
|
] }) });
|
|
3630
3652
|
if (d)
|
|
@@ -3637,7 +3659,7 @@ const ie = new ts(), rs = ({
|
|
|
3637
3659
|
onClick: u,
|
|
3638
3660
|
className: "m-2 inline-flex items-center justify-center rounded-md border border-input bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",
|
|
3639
3661
|
children: [
|
|
3640
|
-
/* @__PURE__ */ e.jsx(
|
|
3662
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-4 h-4" }),
|
|
3641
3663
|
"Try Again"
|
|
3642
3664
|
]
|
|
3643
3665
|
}
|
|
@@ -3645,20 +3667,20 @@ const ie = new ts(), rs = ({
|
|
|
3645
3667
|
] }) });
|
|
3646
3668
|
if (!(s != null && s.result))
|
|
3647
3669
|
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 dark:text-gray-400", children: "No user details available" }) });
|
|
3648
|
-
const l = s.result,
|
|
3670
|
+
const l = s.result, f = (b = l.metadata) == null ? void 0 : b.profile;
|
|
3649
3671
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ e.jsxs("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6", children: [
|
|
3650
|
-
(
|
|
3672
|
+
(f == null ? void 0 : f.about) && /* @__PURE__ */ e.jsxs("div", { className: "mb-6", children: [
|
|
3651
3673
|
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-3", children: "About" }),
|
|
3652
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-wrap", children: m(
|
|
3674
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-wrap", children: m(f.about) })
|
|
3653
3675
|
] }),
|
|
3654
3676
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: [
|
|
3655
3677
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
3656
3678
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Location" }),
|
|
3657
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: (
|
|
3679
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: (f == null ? void 0 : f.location) || "Not specified" })
|
|
3658
3680
|
] }),
|
|
3659
3681
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
3660
3682
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Website" }),
|
|
3661
|
-
/* @__PURE__ */ e.jsx("a", { href:
|
|
3683
|
+
/* @__PURE__ */ e.jsx("a", { href: f == null ? void 0 : f.website, target: "_blank", rel: "noopener noreferrer", className: "text-lg font-semibold text-blue-500 hover:underline", children: (f == null ? void 0 : f.website) || "Not specified" })
|
|
3662
3684
|
] }),
|
|
3663
3685
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
3664
3686
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Joined" }),
|
|
@@ -3666,52 +3688,64 @@ const ie = new ts(), rs = ({
|
|
|
3666
3688
|
] }),
|
|
3667
3689
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
3668
3690
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Followers" }),
|
|
3669
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((
|
|
3691
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((h = (p = l.stats) == null ? void 0 : p.followers) == null ? void 0 : h.toLocaleString()) || "0" })
|
|
3670
3692
|
] }),
|
|
3671
3693
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
3672
3694
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Following" }),
|
|
3673
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((
|
|
3695
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((w = (T = l.stats) == null ? void 0 : T.following) == null ? void 0 : w.toLocaleString()) || "0" })
|
|
3674
3696
|
] }),
|
|
3675
3697
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-4 rounded-lg", children: [
|
|
3676
3698
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-medium text-gray-500 dark:text-gray-400 mb-1", children: "Post Count" }),
|
|
3677
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((
|
|
3699
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: ((k = l.post_count) == null ? void 0 : k.toLocaleString()) || "0" })
|
|
3678
3700
|
] })
|
|
3679
3701
|
] })
|
|
3680
3702
|
] }) });
|
|
3681
|
-
},
|
|
3703
|
+
}, ws = ({
|
|
3682
3704
|
username: t,
|
|
3683
3705
|
onVideoClick: s,
|
|
3684
3706
|
onAuthorClick: r,
|
|
3685
|
-
onBack:
|
|
3707
|
+
onBack: n,
|
|
3708
|
+
onClickUserInfoTab: o,
|
|
3709
|
+
onClickFollowersTab: d,
|
|
3710
|
+
onClickFollowingTab: i,
|
|
3711
|
+
onBookmarkToggle: u,
|
|
3712
|
+
onRss: c,
|
|
3713
|
+
onShare: m,
|
|
3714
|
+
onMoreMenu: l,
|
|
3715
|
+
showMoreMenu: f = !1
|
|
3686
3716
|
}) => {
|
|
3687
|
-
var
|
|
3688
|
-
const
|
|
3689
|
-
|
|
3717
|
+
var C, S, F;
|
|
3718
|
+
const [b, p] = y("videos"), [h, T] = y(null), [w, k] = y(!1), [v, D] = y(!0);
|
|
3719
|
+
B(() => {
|
|
3690
3720
|
(async () => {
|
|
3691
3721
|
try {
|
|
3692
|
-
|
|
3693
|
-
const
|
|
3694
|
-
|
|
3695
|
-
} catch (
|
|
3696
|
-
console.error("Failed to fetch user details:",
|
|
3722
|
+
D(!0);
|
|
3723
|
+
const _ = await he.getProfile(t);
|
|
3724
|
+
T(_);
|
|
3725
|
+
} catch (_) {
|
|
3726
|
+
console.error("Failed to fetch user details:", _);
|
|
3697
3727
|
} finally {
|
|
3698
|
-
|
|
3728
|
+
D(!1);
|
|
3699
3729
|
}
|
|
3700
3730
|
})();
|
|
3701
3731
|
}, [t]);
|
|
3702
|
-
const
|
|
3703
|
-
var
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3732
|
+
const N = () => {
|
|
3733
|
+
var O;
|
|
3734
|
+
if (m)
|
|
3735
|
+
m(t);
|
|
3736
|
+
else {
|
|
3737
|
+
const _ = `https://3speak.tv/user/${t}`;
|
|
3738
|
+
navigator.share ? navigator.share({
|
|
3739
|
+
title: ((O = h == null ? void 0 : h.result) == null ? void 0 : O.name) || t,
|
|
3740
|
+
url: _
|
|
3741
|
+
}) : navigator.clipboard.writeText(_);
|
|
3742
|
+
}
|
|
3743
|
+
}, R = () => {
|
|
3744
|
+
c ? c(t) : window.open(`https://3speak.tv/rss/${t}.xml`, "_blank");
|
|
3745
|
+
}, A = (O) => {
|
|
3746
|
+
r(O);
|
|
3713
3747
|
};
|
|
3714
|
-
if (
|
|
3748
|
+
if (v)
|
|
3715
3749
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ e.jsxs("div", { className: "animate-pulse", children: [
|
|
3716
3750
|
/* @__PURE__ */ e.jsx("div", { className: "h-8 bg-gray-200 dark:bg-gray-700 rounded w-32 mb-6" }),
|
|
3717
3751
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6", children: [
|
|
@@ -3722,24 +3756,24 @@ const ie = new ts(), rs = ({
|
|
|
3722
3756
|
/* @__PURE__ */ e.jsx("div", { className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-32" })
|
|
3723
3757
|
] })
|
|
3724
3758
|
] }),
|
|
3725
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: Array.from({ length: 4 }).map((
|
|
3759
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: Array.from({ length: 4 }).map((O, _) => /* @__PURE__ */ e.jsx(
|
|
3726
3760
|
"div",
|
|
3727
3761
|
{
|
|
3728
3762
|
className: "h-10 bg-gray-200 dark:bg-gray-700 rounded w-20"
|
|
3729
3763
|
},
|
|
3730
|
-
|
|
3764
|
+
_
|
|
3731
3765
|
)) })
|
|
3732
3766
|
] })
|
|
3733
3767
|
] }) });
|
|
3734
|
-
const
|
|
3768
|
+
const $ = h == null ? void 0 : h.result, g = (C = $ == null ? void 0 : $.metadata) == null ? void 0 : C.profile;
|
|
3735
3769
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
3736
3770
|
/* @__PURE__ */ e.jsxs(
|
|
3737
3771
|
"button",
|
|
3738
3772
|
{
|
|
3739
|
-
onClick:
|
|
3773
|
+
onClick: n,
|
|
3740
3774
|
className: "flex items-center justify-center mr-4 px-2 text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-full",
|
|
3741
3775
|
children: [
|
|
3742
|
-
/* @__PURE__ */ e.jsx(
|
|
3776
|
+
/* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4 mr-2" }),
|
|
3743
3777
|
"Back"
|
|
3744
3778
|
]
|
|
3745
3779
|
}
|
|
@@ -3748,11 +3782,11 @@ const ie = new ts(), rs = ({
|
|
|
3748
3782
|
/* @__PURE__ */ e.jsx(
|
|
3749
3783
|
"img",
|
|
3750
3784
|
{
|
|
3751
|
-
src:
|
|
3785
|
+
src: g.cover_image || he.userAvatar(t),
|
|
3752
3786
|
alt: "Cover",
|
|
3753
3787
|
className: "w-full h-48 object-cover",
|
|
3754
|
-
onError: (
|
|
3755
|
-
|
|
3788
|
+
onError: (O) => {
|
|
3789
|
+
O.target.src = he.userAvatar(t);
|
|
3756
3790
|
}
|
|
3757
3791
|
}
|
|
3758
3792
|
),
|
|
@@ -3760,134 +3794,149 @@ const ie = new ts(), rs = ({
|
|
|
3760
3794
|
/* @__PURE__ */ e.jsx(
|
|
3761
3795
|
"img",
|
|
3762
3796
|
{
|
|
3763
|
-
src:
|
|
3764
|
-
alt:
|
|
3797
|
+
src: g == null ? void 0 : g.profile_image,
|
|
3798
|
+
alt: g == null ? void 0 : g.name,
|
|
3765
3799
|
className: "w-24 h-24 rounded-full object-cover border-4 border-white dark:border-gray-800 -mt-16",
|
|
3766
|
-
onError: (
|
|
3767
|
-
|
|
3800
|
+
onError: (O) => {
|
|
3801
|
+
O.target.src = he.userAvatar(t);
|
|
3768
3802
|
}
|
|
3769
3803
|
}
|
|
3770
3804
|
),
|
|
3771
3805
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1", children: [
|
|
3772
|
-
/* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: (
|
|
3773
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-4", children: (
|
|
3806
|
+
/* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: (g == null ? void 0 : g.name) || t }),
|
|
3807
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-4", children: (g == null ? void 0 : g.about) || "No description available" }),
|
|
3774
3808
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-6 text-sm", children: [
|
|
3775
3809
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
3776
|
-
/* @__PURE__ */ e.jsx(
|
|
3810
|
+
/* @__PURE__ */ e.jsx(ze, { className: "w-4 h-4" }),
|
|
3777
3811
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
3778
|
-
(((
|
|
3812
|
+
(((S = $ == null ? void 0 : $.stats) == null ? void 0 : S.followers) || 0).toLocaleString(),
|
|
3779
3813
|
" Followers"
|
|
3780
3814
|
] })
|
|
3781
3815
|
] }),
|
|
3782
3816
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
3783
|
-
/* @__PURE__ */ e.jsx(
|
|
3817
|
+
/* @__PURE__ */ e.jsx(ze, { className: "w-4 h-4" }),
|
|
3784
3818
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
3785
|
-
(((
|
|
3819
|
+
(((F = $ == null ? void 0 : $.stats) == null ? void 0 : F.following) || 0).toLocaleString(),
|
|
3786
3820
|
" Following"
|
|
3787
3821
|
] })
|
|
3788
3822
|
] }),
|
|
3789
3823
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
|
|
3790
|
-
/* @__PURE__ */ e.jsx(
|
|
3824
|
+
/* @__PURE__ */ e.jsx(Dt, { className: "w-4 h-4" }),
|
|
3791
3825
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
3792
3826
|
"Joined",
|
|
3793
3827
|
" ",
|
|
3794
|
-
|
|
3828
|
+
$ != null && $.created ? new Date($.created).getFullYear() : "Unknown"
|
|
3795
3829
|
] })
|
|
3796
3830
|
] })
|
|
3797
3831
|
] })
|
|
3798
3832
|
] }),
|
|
3799
3833
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3800
3834
|
/* @__PURE__ */ e.jsx(
|
|
3801
|
-
|
|
3835
|
+
Wt,
|
|
3802
3836
|
{
|
|
3803
3837
|
id: t,
|
|
3804
3838
|
toastType: "user",
|
|
3805
|
-
onAdd: (
|
|
3806
|
-
|
|
3839
|
+
onAdd: (O, _) => {
|
|
3840
|
+
u ? u(O, !0) : console.log("Added:", O, _);
|
|
3841
|
+
},
|
|
3842
|
+
onRemove: (O, _) => {
|
|
3843
|
+
u ? u(O, !1) : console.log("Removed:", O, _);
|
|
3844
|
+
}
|
|
3807
3845
|
}
|
|
3808
3846
|
),
|
|
3809
3847
|
/* @__PURE__ */ e.jsx(
|
|
3810
3848
|
"button",
|
|
3811
3849
|
{
|
|
3812
|
-
onClick:
|
|
3850
|
+
onClick: R,
|
|
3813
3851
|
className: "p-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",
|
|
3814
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3852
|
+
children: /* @__PURE__ */ e.jsx(Mt, { className: "w-4 h-4" })
|
|
3815
3853
|
}
|
|
3816
3854
|
),
|
|
3817
3855
|
/* @__PURE__ */ e.jsx(
|
|
3818
3856
|
"button",
|
|
3819
3857
|
{
|
|
3820
|
-
onClick:
|
|
3858
|
+
onClick: N,
|
|
3821
3859
|
className: "p-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",
|
|
3822
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3860
|
+
children: /* @__PURE__ */ e.jsx(ct, { className: "w-4 h-4" })
|
|
3823
3861
|
}
|
|
3824
3862
|
),
|
|
3825
|
-
|
|
3863
|
+
f && /* @__PURE__ */ e.jsx(
|
|
3864
|
+
"button",
|
|
3865
|
+
{
|
|
3866
|
+
onClick: () => {
|
|
3867
|
+
l && l(t);
|
|
3868
|
+
},
|
|
3869
|
+
className: "p-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",
|
|
3870
|
+
children: /* @__PURE__ */ e.jsx(dt, { className: "w-4 h-4" })
|
|
3871
|
+
}
|
|
3872
|
+
)
|
|
3826
3873
|
] })
|
|
3827
3874
|
] }) })
|
|
3828
3875
|
] }),
|
|
3829
3876
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3830
3877
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden", children: [
|
|
3831
3878
|
{ key: "videos", label: "Videos" },
|
|
3832
|
-
{ key: "about", label: "User Info" },
|
|
3833
|
-
{ key: "followers", label: "Followers" },
|
|
3834
|
-
{ key: "following", label: "Following" }
|
|
3835
|
-
].map((
|
|
3879
|
+
{ key: "about", label: "User Info", callback: o },
|
|
3880
|
+
{ key: "followers", label: "Followers", callback: d },
|
|
3881
|
+
{ key: "following", label: "Following", callback: i }
|
|
3882
|
+
].map((O, _) => /* @__PURE__ */ e.jsx(
|
|
3836
3883
|
"button",
|
|
3837
3884
|
{
|
|
3838
|
-
onClick: () =>
|
|
3839
|
-
|
|
3840
|
-
|
|
3885
|
+
onClick: () => {
|
|
3886
|
+
O.callback ? O.callback() : p(O.key);
|
|
3887
|
+
},
|
|
3888
|
+
className: `px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${b === O.key ? "bg-blue-600 dark:bg-blue-500 text-white" : "text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700"}`,
|
|
3889
|
+
children: O.label
|
|
3841
3890
|
},
|
|
3842
|
-
|
|
3891
|
+
O.key
|
|
3843
3892
|
)) }),
|
|
3844
3893
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-6", children: [
|
|
3845
|
-
|
|
3846
|
-
|
|
3894
|
+
b === "videos" && /* @__PURE__ */ e.jsx(
|
|
3895
|
+
ut,
|
|
3847
3896
|
{
|
|
3848
|
-
feedType:
|
|
3897
|
+
feedType: K.USER,
|
|
3849
3898
|
username: t,
|
|
3850
3899
|
onVideoClick: s,
|
|
3851
3900
|
onAuthorClick: r
|
|
3852
3901
|
}
|
|
3853
3902
|
),
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3903
|
+
b === "about" && /* @__PURE__ */ e.jsx(ss, { username: t }),
|
|
3904
|
+
b === "followers" && /* @__PURE__ */ e.jsx(ts, { username: t, onSelectUser: A }),
|
|
3905
|
+
b === "following" && /* @__PURE__ */ e.jsx(rs, { username: t, onSelectUser: A })
|
|
3857
3906
|
] })
|
|
3858
3907
|
] })
|
|
3859
3908
|
] });
|
|
3860
|
-
},
|
|
3861
|
-
function
|
|
3862
|
-
const [t, s] =
|
|
3863
|
-
return
|
|
3864
|
-
const r = window.matchMedia(`(max-width: ${
|
|
3865
|
-
s(window.innerWidth <
|
|
3909
|
+
}, rt = 768;
|
|
3910
|
+
function Ns() {
|
|
3911
|
+
const [t, s] = Be.useState(void 0);
|
|
3912
|
+
return Be.useEffect(() => {
|
|
3913
|
+
const r = window.matchMedia(`(max-width: ${rt - 1}px)`), n = () => {
|
|
3914
|
+
s(window.innerWidth < rt);
|
|
3866
3915
|
};
|
|
3867
|
-
return r.addEventListener("change",
|
|
3916
|
+
return r.addEventListener("change", n), s(window.innerWidth < rt), () => r.removeEventListener("change", n);
|
|
3868
3917
|
}, []), !!t;
|
|
3869
3918
|
}
|
|
3870
|
-
const
|
|
3871
|
-
let
|
|
3872
|
-
function
|
|
3873
|
-
return
|
|
3919
|
+
const as = 1, ns = 1e6;
|
|
3920
|
+
let st = 0;
|
|
3921
|
+
function os() {
|
|
3922
|
+
return st = (st + 1) % Number.MAX_SAFE_INTEGER, st.toString();
|
|
3874
3923
|
}
|
|
3875
|
-
const
|
|
3876
|
-
if (
|
|
3924
|
+
const at = /* @__PURE__ */ new Map(), Rt = (t) => {
|
|
3925
|
+
if (at.has(t))
|
|
3877
3926
|
return;
|
|
3878
3927
|
const s = setTimeout(() => {
|
|
3879
|
-
|
|
3928
|
+
at.delete(t), Fe({
|
|
3880
3929
|
type: "REMOVE_TOAST",
|
|
3881
3930
|
toastId: t
|
|
3882
3931
|
});
|
|
3883
|
-
},
|
|
3884
|
-
|
|
3885
|
-
},
|
|
3932
|
+
}, ns);
|
|
3933
|
+
at.set(t, s);
|
|
3934
|
+
}, is = (t, s) => {
|
|
3886
3935
|
switch (s.type) {
|
|
3887
3936
|
case "ADD_TOAST":
|
|
3888
3937
|
return {
|
|
3889
3938
|
...t,
|
|
3890
|
-
toasts: [s.toast, ...t.toasts].slice(0,
|
|
3939
|
+
toasts: [s.toast, ...t.toasts].slice(0, as)
|
|
3891
3940
|
};
|
|
3892
3941
|
case "UPDATE_TOAST":
|
|
3893
3942
|
return {
|
|
@@ -3896,15 +3945,15 @@ const Xe = /* @__PURE__ */ new Map(), $t = (t) => {
|
|
|
3896
3945
|
};
|
|
3897
3946
|
case "DISMISS_TOAST": {
|
|
3898
3947
|
const { toastId: r } = s;
|
|
3899
|
-
return r ?
|
|
3900
|
-
|
|
3948
|
+
return r ? Rt(r) : t.toasts.forEach((n) => {
|
|
3949
|
+
Rt(n.id);
|
|
3901
3950
|
}), {
|
|
3902
3951
|
...t,
|
|
3903
3952
|
toasts: t.toasts.map(
|
|
3904
|
-
(
|
|
3905
|
-
...
|
|
3953
|
+
(n) => n.id === r || r === void 0 ? {
|
|
3954
|
+
...n,
|
|
3906
3955
|
open: !1
|
|
3907
|
-
} :
|
|
3956
|
+
} : n
|
|
3908
3957
|
)
|
|
3909
3958
|
};
|
|
3910
3959
|
}
|
|
@@ -3917,72 +3966,72 @@ const Xe = /* @__PURE__ */ new Map(), $t = (t) => {
|
|
|
3917
3966
|
toasts: t.toasts.filter((r) => r.id !== s.toastId)
|
|
3918
3967
|
};
|
|
3919
3968
|
}
|
|
3920
|
-
},
|
|
3921
|
-
let
|
|
3922
|
-
function
|
|
3923
|
-
|
|
3924
|
-
s(
|
|
3969
|
+
}, He = [];
|
|
3970
|
+
let We = { toasts: [] };
|
|
3971
|
+
function Fe(t) {
|
|
3972
|
+
We = is(We, t), He.forEach((s) => {
|
|
3973
|
+
s(We);
|
|
3925
3974
|
});
|
|
3926
3975
|
}
|
|
3927
|
-
function
|
|
3928
|
-
const s =
|
|
3976
|
+
function ls({ ...t }) {
|
|
3977
|
+
const s = os(), r = (o) => Fe({
|
|
3929
3978
|
type: "UPDATE_TOAST",
|
|
3930
3979
|
toast: { ...o, id: s }
|
|
3931
|
-
}),
|
|
3932
|
-
return
|
|
3980
|
+
}), n = () => Fe({ type: "DISMISS_TOAST", toastId: s });
|
|
3981
|
+
return Fe({
|
|
3933
3982
|
type: "ADD_TOAST",
|
|
3934
3983
|
toast: {
|
|
3935
3984
|
...t,
|
|
3936
3985
|
id: s,
|
|
3937
3986
|
open: !0,
|
|
3938
3987
|
onOpenChange: (o) => {
|
|
3939
|
-
o ||
|
|
3988
|
+
o || n();
|
|
3940
3989
|
}
|
|
3941
3990
|
}
|
|
3942
3991
|
}), {
|
|
3943
3992
|
id: s,
|
|
3944
|
-
dismiss:
|
|
3993
|
+
dismiss: n,
|
|
3945
3994
|
update: r
|
|
3946
3995
|
};
|
|
3947
3996
|
}
|
|
3948
|
-
function
|
|
3949
|
-
const [t, s] =
|
|
3950
|
-
return
|
|
3951
|
-
const r =
|
|
3952
|
-
r > -1 &&
|
|
3997
|
+
function ks() {
|
|
3998
|
+
const [t, s] = Be.useState(We);
|
|
3999
|
+
return Be.useEffect(() => (He.push(s), () => {
|
|
4000
|
+
const r = He.indexOf(s);
|
|
4001
|
+
r > -1 && He.splice(r, 1);
|
|
3953
4002
|
}), [t]), {
|
|
3954
4003
|
...t,
|
|
3955
|
-
toast:
|
|
3956
|
-
dismiss: (r) =>
|
|
4004
|
+
toast: ls,
|
|
4005
|
+
dismiss: (r) => Fe({ type: "DISMISS_TOAST", toastId: r })
|
|
3957
4006
|
};
|
|
3958
4007
|
}
|
|
3959
4008
|
export {
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
4009
|
+
K as ApiVideoFeedType,
|
|
4010
|
+
Or as CommentsModal,
|
|
4011
|
+
ys as CommunitiesList,
|
|
4012
|
+
Qr as CommunityAbout,
|
|
4013
|
+
vs as CommunityDetail,
|
|
4014
|
+
Zr as CommunityMembers,
|
|
4015
|
+
Xr as CommunityTeam,
|
|
4016
|
+
Fr as DescriptionModal,
|
|
4017
|
+
Wt as FavouriteWidget,
|
|
4018
|
+
gt as Modal,
|
|
4019
|
+
$r as UpvoteListModal,
|
|
4020
|
+
js as UserAccount,
|
|
4021
|
+
ts as UserFollowers,
|
|
4022
|
+
rs as UserFollowing,
|
|
4023
|
+
ss as UserInfo,
|
|
4024
|
+
ws as UserProfilePage,
|
|
4025
|
+
Sr as VideoCard,
|
|
4026
|
+
ps as VideoDetail,
|
|
4027
|
+
ut as VideoFeed,
|
|
4028
|
+
Tr as VideoInfo,
|
|
4029
|
+
bs as Wallet,
|
|
4030
|
+
te as apiService,
|
|
4031
|
+
is as reducer,
|
|
4032
|
+
pe as server,
|
|
4033
|
+
ls as toast,
|
|
4034
|
+
Ns as useIsMobile,
|
|
4035
|
+
ks as useToast,
|
|
4036
|
+
Gr as useWalletStore
|
|
3988
4037
|
};
|