@articles-media/articles-dev-box 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/package.json +5 -1
  2. package/dist/Ad.cjs +0 -1
  3. package/dist/Ad.js +0 -600
  4. package/dist/AdConfirmExitModal-CKkMAvBK.js +0 -72
  5. package/dist/AdConfirmExitModal-CcSxmXKT.cjs +0 -1
  6. package/dist/AdDetailsModal-Bp5hZm9N.js +0 -83
  7. package/dist/AdDetailsModal-k840vrS2.cjs +0 -1
  8. package/dist/ArticlesAd.cjs +0 -1
  9. package/dist/ArticlesAd.js +0 -16
  10. package/dist/Button-0ZK0NKiK.cjs +0 -1
  11. package/dist/Button-_Quon8UV.js +0 -54
  12. package/dist/GameScoreboard.cjs +0 -1
  13. package/dist/GameScoreboard.js +0 -182
  14. package/dist/GlobalBody-BQ2qC81K.cjs +0 -33
  15. package/dist/GlobalBody-tmIC_GWn.js +0 -123
  16. package/dist/GlobalBody.cjs +0 -1
  17. package/dist/GlobalBody.js +0 -7
  18. package/dist/GlobalHead.cjs +0 -1
  19. package/dist/GlobalHead.js +0 -13
  20. package/dist/Modal-C9oYRgI1.js +0 -2073
  21. package/dist/Modal-Wmqy9fOm.cjs +0 -2
  22. package/dist/ReturnToLauncherButton.cjs +0 -1
  23. package/dist/ReturnToLauncherButton.js +0 -50
  24. package/dist/StatusModal-BlwaI-2B.cjs +0 -1
  25. package/dist/StatusModal-CAVxWCUq.js +0 -71
  26. package/dist/ViewUserModal.cjs +0 -1
  27. package/dist/ViewUserModal.js +0 -3189
  28. package/dist/articles-dev-box.css +0 -1
  29. package/dist/index-BlP2-uOi.cjs +0 -1
  30. package/dist/index-DLYx67wi.js +0 -2394
  31. package/dist/index-Ddv_TnxK.cjs +0 -6
  32. package/dist/index-YnD2EP-S.js +0 -43
  33. package/dist/index.cjs +0 -1
  34. package/dist/index.js +0 -20
  35. package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
  36. package/dist/jsx-runtime-tc70JA_2.js +0 -264
  37. package/dist/numberWithCommas-CRgrb58X.cjs +0 -1
  38. package/dist/numberWithCommas-DnAkiOFL.js +0 -1256
  39. package/dist/useUserDetails.cjs +0 -1
  40. package/dist/useUserDetails.js +0 -33
  41. package/dist/useUserToken.cjs +0 -1
  42. package/dist/useUserToken.js +0 -22
@@ -1,3189 +0,0 @@
1
- import { j as s } from "./jsx-runtime-tc70JA_2.js";
2
- import * as ee from "react";
3
- import { useRef as q, useEffect as X, useMemo as Me, useState as A, useCallback as z, useLayoutEffect as bs, cloneElement as Yt } from "react";
4
- import { t as Re, a as qt, L as Y, f as Te, n as tt, A as Kt } from "./numberWithCommas-DnAkiOFL.js";
5
- import { u as js, a as ys, c as st, b as at, o as Gt, l as Ee, i as ws, d as Ns, e as Nt, r as _s, f as ve, g as Jt, h as _t, j as Qt, k as Os, F as Ot, s as rt, m as Ss, P as Ds, M as Be } from "./Modal-C9oYRgI1.js";
6
- import { g as Ps, c as ue } from "./index-YnD2EP-S.js";
7
- import Es from "react-dom";
8
- import { w as As, u as Zt, a as es } from "./index-DLYx67wi.js";
9
- import { A as P } from "./Button-_Quon8UV.js";
10
- function Qe(t, e) {
11
- const a = +Re(t) - +Re(e);
12
- return a < 0 ? -1 : a > 0 ? 1 : a;
13
- }
14
- function Cs(t, e, a) {
15
- const [r, n] = qt(
16
- a?.in,
17
- t,
18
- e
19
- ), l = r.getFullYear() - n.getFullYear(), i = r.getMonth() - n.getMonth();
20
- return l * 12 + i;
21
- }
22
- function $s(t, e) {
23
- const a = Re(t, e?.in);
24
- return a.setHours(23, 59, 59, 999), a;
25
- }
26
- function Ms(t, e) {
27
- const a = Re(t, e?.in), r = a.getMonth();
28
- return a.setFullYear(a.getFullYear(), r + 1, 0), a.setHours(23, 59, 59, 999), a;
29
- }
30
- function Rs(t, e) {
31
- const a = Re(t, e?.in);
32
- return +$s(a, e) == +Ms(a, e);
33
- }
34
- function ks(t, e, a) {
35
- const [r, n, l] = qt(
36
- a?.in,
37
- t,
38
- t,
39
- e
40
- ), i = Qe(n, l), o = Math.abs(
41
- Cs(n, l)
42
- );
43
- if (o < 1) return 0;
44
- n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - i * o);
45
- let c = Qe(n, l) === -i;
46
- Rs(r) && o === 1 && Qe(r, l) === 1 && (c = !1);
47
- const f = i * (o - +c);
48
- return f === 0 ? 0 : f;
49
- }
50
- function Ls() {
51
- const t = q(!0), e = q(() => t.current);
52
- return X(() => (t.current = !0, () => {
53
- t.current = !1;
54
- }), []), e.current;
55
- }
56
- const nt = 2 ** 31 - 1;
57
- function ts(t, e, a) {
58
- const r = a - Date.now();
59
- t.current = r <= nt ? setTimeout(e, r) : setTimeout(() => ts(t, e, a), nt);
60
- }
61
- function Ts() {
62
- const t = Ls(), e = q();
63
- return js(() => clearTimeout(e.current)), Me(() => {
64
- const a = () => clearTimeout(e.current);
65
- function r(n, l = 0) {
66
- t() && (a(), l <= nt ? e.current = setTimeout(n, l) : ts(e, n, Date.now() + l));
67
- }
68
- return {
69
- set: r,
70
- clear: a,
71
- handleRef: e
72
- };
73
- }, []);
74
- }
75
- var Ze, St;
76
- function Fs() {
77
- if (St) return Ze;
78
- St = 1;
79
- var t = process.env.NODE_ENV !== "production", e = function() {
80
- };
81
- if (t) {
82
- var a = function(n, l) {
83
- var i = arguments.length;
84
- l = new Array(i > 1 ? i - 1 : 0);
85
- for (var o = 1; o < i; o++)
86
- l[o - 1] = arguments[o];
87
- var c = 0, f = "Warning: " + n.replace(/%s/g, function() {
88
- return l[c++];
89
- });
90
- typeof console < "u" && console.error(f);
91
- try {
92
- throw new Error(f);
93
- } catch {
94
- }
95
- };
96
- e = function(r, n, l) {
97
- var i = arguments.length;
98
- l = new Array(i > 2 ? i - 2 : 0);
99
- for (var o = 2; o < i; o++)
100
- l[o - 2] = arguments[o];
101
- if (n === void 0)
102
- throw new Error(
103
- "`warning(condition, format, ...args)` requires a warning message argument"
104
- );
105
- r || a.apply(null, [n].concat(l));
106
- };
107
- }
108
- return Ze = e, Ze;
109
- }
110
- var Us = Fs();
111
- const ss = /* @__PURE__ */ Ps(Us);
112
- function Bs(t, e, a) {
113
- var r = q(t !== void 0), n = A(e), l = n[0], i = n[1], o = t !== void 0, c = r.current;
114
- return r.current = o, !o && c && l !== e && i(e), [o ? t : l, z(function(f) {
115
- for (var u = arguments.length, m = new Array(u > 1 ? u - 1 : 0), h = 1; h < u; h++)
116
- m[h - 1] = arguments[h];
117
- a && a.apply(void 0, [f].concat(m)), i(f);
118
- }, [a])];
119
- }
120
- function Dt() {
121
- return A(null);
122
- }
123
- var Pt = Object.prototype.hasOwnProperty;
124
- function Et(t, e, a) {
125
- for (a of t.keys())
126
- if (Ae(a, e)) return a;
127
- }
128
- function Ae(t, e) {
129
- var a, r, n;
130
- if (t === e) return !0;
131
- if (t && e && (a = t.constructor) === e.constructor) {
132
- if (a === Date) return t.getTime() === e.getTime();
133
- if (a === RegExp) return t.toString() === e.toString();
134
- if (a === Array) {
135
- if ((r = t.length) === e.length)
136
- for (; r-- && Ae(t[r], e[r]); ) ;
137
- return r === -1;
138
- }
139
- if (a === Set) {
140
- if (t.size !== e.size)
141
- return !1;
142
- for (r of t)
143
- if (n = r, n && typeof n == "object" && (n = Et(e, n), !n) || !e.has(n)) return !1;
144
- return !0;
145
- }
146
- if (a === Map) {
147
- if (t.size !== e.size)
148
- return !1;
149
- for (r of t)
150
- if (n = r[0], n && typeof n == "object" && (n = Et(e, n), !n) || !Ae(r[1], e.get(n)))
151
- return !1;
152
- return !0;
153
- }
154
- if (a === ArrayBuffer)
155
- t = new Uint8Array(t), e = new Uint8Array(e);
156
- else if (a === DataView) {
157
- if ((r = t.byteLength) === e.byteLength)
158
- for (; r-- && t.getInt8(r) === e.getInt8(r); ) ;
159
- return r === -1;
160
- }
161
- if (ArrayBuffer.isView(t)) {
162
- if ((r = t.byteLength) === e.byteLength)
163
- for (; r-- && t[r] === e[r]; ) ;
164
- return r === -1;
165
- }
166
- if (!a || typeof t == "object") {
167
- r = 0;
168
- for (a in t)
169
- if (Pt.call(t, a) && ++r && !Pt.call(e, a) || !(a in e) || !Ae(t[a], e[a])) return !1;
170
- return Object.keys(e).length === r;
171
- }
172
- }
173
- return t !== t && e !== e;
174
- }
175
- function Is(t) {
176
- const e = ys();
177
- return [t[0], z((a) => {
178
- if (e())
179
- return t[1](a);
180
- }, [e, t[1]])];
181
- }
182
- var U = "top", K = "bottom", G = "right", B = "left", lt = "auto", Fe = [U, K, G, B], ye = "start", ke = "end", Vs = "clippingParents", as = "viewport", Pe = "popper", Ws = "reference", At = /* @__PURE__ */ Fe.reduce(function(t, e) {
183
- return t.concat([e + "-" + ye, e + "-" + ke]);
184
- }, []), rs = /* @__PURE__ */ [].concat(Fe, [lt]).reduce(function(t, e) {
185
- return t.concat([e, e + "-" + ye, e + "-" + ke]);
186
- }, []), Hs = "beforeRead", zs = "read", Xs = "afterRead", Ys = "beforeMain", qs = "main", Ks = "afterMain", Gs = "beforeWrite", Js = "write", Qs = "afterWrite", Zs = [Hs, zs, Xs, Ys, qs, Ks, Gs, Js, Qs];
187
- function ae(t) {
188
- return t.split("-")[0];
189
- }
190
- function W(t) {
191
- if (t == null)
192
- return window;
193
- if (t.toString() !== "[object Window]") {
194
- var e = t.ownerDocument;
195
- return e && e.defaultView || window;
196
- }
197
- return t;
198
- }
199
- function xe(t) {
200
- var e = W(t).Element;
201
- return t instanceof e || t instanceof Element;
202
- }
203
- function re(t) {
204
- var e = W(t).HTMLElement;
205
- return t instanceof e || t instanceof HTMLElement;
206
- }
207
- function ct(t) {
208
- if (typeof ShadowRoot > "u")
209
- return !1;
210
- var e = W(t).ShadowRoot;
211
- return t instanceof e || t instanceof ShadowRoot;
212
- }
213
- var he = Math.max, He = Math.min, we = Math.round;
214
- function it() {
215
- var t = navigator.userAgentData;
216
- return t != null && t.brands && Array.isArray(t.brands) ? t.brands.map(function(e) {
217
- return e.brand + "/" + e.version;
218
- }).join(" ") : navigator.userAgent;
219
- }
220
- function ns() {
221
- return !/^((?!chrome|android).)*safari/i.test(it());
222
- }
223
- function Ne(t, e, a) {
224
- e === void 0 && (e = !1), a === void 0 && (a = !1);
225
- var r = t.getBoundingClientRect(), n = 1, l = 1;
226
- e && re(t) && (n = t.offsetWidth > 0 && we(r.width) / t.offsetWidth || 1, l = t.offsetHeight > 0 && we(r.height) / t.offsetHeight || 1);
227
- var i = xe(t) ? W(t) : window, o = i.visualViewport, c = !ns() && a, f = (r.left + (c && o ? o.offsetLeft : 0)) / n, u = (r.top + (c && o ? o.offsetTop : 0)) / l, m = r.width / n, h = r.height / l;
228
- return {
229
- width: m,
230
- height: h,
231
- top: u,
232
- right: f + m,
233
- bottom: u + h,
234
- left: f,
235
- x: f,
236
- y: u
237
- };
238
- }
239
- function dt(t) {
240
- var e = Ne(t), a = t.offsetWidth, r = t.offsetHeight;
241
- return Math.abs(e.width - a) <= 1 && (a = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), {
242
- x: t.offsetLeft,
243
- y: t.offsetTop,
244
- width: a,
245
- height: r
246
- };
247
- }
248
- function is(t, e) {
249
- var a = e.getRootNode && e.getRootNode();
250
- if (t.contains(e))
251
- return !0;
252
- if (a && ct(a)) {
253
- var r = e;
254
- do {
255
- if (r && t.isSameNode(r))
256
- return !0;
257
- r = r.parentNode || r.host;
258
- } while (r);
259
- }
260
- return !1;
261
- }
262
- function pe(t) {
263
- return t ? (t.nodeName || "").toLowerCase() : null;
264
- }
265
- function de(t) {
266
- return W(t).getComputedStyle(t);
267
- }
268
- function ea(t) {
269
- return ["table", "td", "th"].indexOf(pe(t)) >= 0;
270
- }
271
- function me(t) {
272
- return ((xe(t) ? t.ownerDocument : (
273
- // $FlowFixMe[prop-missing]
274
- t.document
275
- )) || window.document).documentElement;
276
- }
277
- function ze(t) {
278
- return pe(t) === "html" ? t : (
279
- // this is a quicker (but less type safe) way to save quite some bytes from the bundle
280
- // $FlowFixMe[incompatible-return]
281
- // $FlowFixMe[prop-missing]
282
- t.assignedSlot || // step into the shadow DOM of the parent of a slotted node
283
- t.parentNode || // DOM Element detected
284
- (ct(t) ? t.host : null) || // ShadowRoot detected
285
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
286
- me(t)
287
- );
288
- }
289
- function Ct(t) {
290
- return !re(t) || // https://github.com/popperjs/popper-core/issues/837
291
- de(t).position === "fixed" ? null : t.offsetParent;
292
- }
293
- function ta(t) {
294
- var e = /firefox/i.test(it()), a = /Trident/i.test(it());
295
- if (a && re(t)) {
296
- var r = de(t);
297
- if (r.position === "fixed")
298
- return null;
299
- }
300
- var n = ze(t);
301
- for (ct(n) && (n = n.host); re(n) && ["html", "body"].indexOf(pe(n)) < 0; ) {
302
- var l = de(n);
303
- if (l.transform !== "none" || l.perspective !== "none" || l.contain === "paint" || ["transform", "perspective"].indexOf(l.willChange) !== -1 || e && l.willChange === "filter" || e && l.filter && l.filter !== "none")
304
- return n;
305
- n = n.parentNode;
306
- }
307
- return null;
308
- }
309
- function Ue(t) {
310
- for (var e = W(t), a = Ct(t); a && ea(a) && de(a).position === "static"; )
311
- a = Ct(a);
312
- return a && (pe(a) === "html" || pe(a) === "body" && de(a).position === "static") ? e : a || ta(t) || e;
313
- }
314
- function ut(t) {
315
- return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
316
- }
317
- function Ce(t, e, a) {
318
- return he(t, He(e, a));
319
- }
320
- function sa(t, e, a) {
321
- var r = Ce(t, e, a);
322
- return r > a ? a : r;
323
- }
324
- function os() {
325
- return {
326
- top: 0,
327
- right: 0,
328
- bottom: 0,
329
- left: 0
330
- };
331
- }
332
- function ls(t) {
333
- return Object.assign({}, os(), t);
334
- }
335
- function cs(t, e) {
336
- return e.reduce(function(a, r) {
337
- return a[r] = t, a;
338
- }, {});
339
- }
340
- var aa = function(e, a) {
341
- return e = typeof e == "function" ? e(Object.assign({}, a.rects, {
342
- placement: a.placement
343
- })) : e, ls(typeof e != "number" ? e : cs(e, Fe));
344
- };
345
- function ra(t) {
346
- var e, a = t.state, r = t.name, n = t.options, l = a.elements.arrow, i = a.modifiersData.popperOffsets, o = ae(a.placement), c = ut(o), f = [B, G].indexOf(o) >= 0, u = f ? "height" : "width";
347
- if (!(!l || !i)) {
348
- var m = aa(n.padding, a), h = dt(l), d = c === "y" ? U : B, v = c === "y" ? K : G, x = a.rects.reference[u] + a.rects.reference[c] - i[c] - a.rects.popper[u], p = i[c] - a.rects.reference[c], j = Ue(l), g = j ? c === "y" ? j.clientHeight || 0 : j.clientWidth || 0 : 0, N = x / 2 - p / 2, b = m[d], _ = g - h[u] - m[v], w = g / 2 - h[u] / 2 + N, O = Ce(b, w, _), $ = c;
349
- a.modifiersData[r] = (e = {}, e[$] = O, e.centerOffset = O - w, e);
350
- }
351
- }
352
- function na(t) {
353
- var e = t.state, a = t.options, r = a.element, n = r === void 0 ? "[data-popper-arrow]" : r;
354
- n != null && (typeof n == "string" && (n = e.elements.popper.querySelector(n), !n) || is(e.elements.popper, n) && (e.elements.arrow = n));
355
- }
356
- const ia = {
357
- name: "arrow",
358
- enabled: !0,
359
- phase: "main",
360
- fn: ra,
361
- effect: na,
362
- requires: ["popperOffsets"],
363
- requiresIfExists: ["preventOverflow"]
364
- };
365
- function _e(t) {
366
- return t.split("-")[1];
367
- }
368
- var oa = {
369
- top: "auto",
370
- right: "auto",
371
- bottom: "auto",
372
- left: "auto"
373
- };
374
- function la(t, e) {
375
- var a = t.x, r = t.y, n = e.devicePixelRatio || 1;
376
- return {
377
- x: we(a * n) / n || 0,
378
- y: we(r * n) / n || 0
379
- };
380
- }
381
- function $t(t) {
382
- var e, a = t.popper, r = t.popperRect, n = t.placement, l = t.variation, i = t.offsets, o = t.position, c = t.gpuAcceleration, f = t.adaptive, u = t.roundOffsets, m = t.isFixed, h = i.x, d = h === void 0 ? 0 : h, v = i.y, x = v === void 0 ? 0 : v, p = typeof u == "function" ? u({
383
- x: d,
384
- y: x
385
- }) : {
386
- x: d,
387
- y: x
388
- };
389
- d = p.x, x = p.y;
390
- var j = i.hasOwnProperty("x"), g = i.hasOwnProperty("y"), N = B, b = U, _ = window;
391
- if (f) {
392
- var w = Ue(a), O = "clientHeight", $ = "clientWidth";
393
- if (w === W(a) && (w = me(a), de(w).position !== "static" && o === "absolute" && (O = "scrollHeight", $ = "scrollWidth")), w = w, n === U || (n === B || n === G) && l === ke) {
394
- b = K;
395
- var M = m && w === _ && _.visualViewport ? _.visualViewport.height : (
396
- // $FlowFixMe[prop-missing]
397
- w[O]
398
- );
399
- x -= M - r.height, x *= c ? 1 : -1;
400
- }
401
- if (n === B || (n === U || n === K) && l === ke) {
402
- N = G;
403
- var E = m && w === _ && _.visualViewport ? _.visualViewport.width : (
404
- // $FlowFixMe[prop-missing]
405
- w[$]
406
- );
407
- d -= E - r.width, d *= c ? 1 : -1;
408
- }
409
- }
410
- var C = Object.assign({
411
- position: o
412
- }, f && oa), k = u === !0 ? la({
413
- x: d,
414
- y: x
415
- }, W(a)) : {
416
- x: d,
417
- y: x
418
- };
419
- if (d = k.x, x = k.y, c) {
420
- var S;
421
- return Object.assign({}, C, (S = {}, S[b] = g ? "0" : "", S[N] = j ? "0" : "", S.transform = (_.devicePixelRatio || 1) <= 1 ? "translate(" + d + "px, " + x + "px)" : "translate3d(" + d + "px, " + x + "px, 0)", S));
422
- }
423
- return Object.assign({}, C, (e = {}, e[b] = g ? x + "px" : "", e[N] = j ? d + "px" : "", e.transform = "", e));
424
- }
425
- function ca(t) {
426
- var e = t.state, a = t.options, r = a.gpuAcceleration, n = r === void 0 ? !0 : r, l = a.adaptive, i = l === void 0 ? !0 : l, o = a.roundOffsets, c = o === void 0 ? !0 : o, f = {
427
- placement: ae(e.placement),
428
- variation: _e(e.placement),
429
- popper: e.elements.popper,
430
- popperRect: e.rects.popper,
431
- gpuAcceleration: n,
432
- isFixed: e.options.strategy === "fixed"
433
- };
434
- e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, $t(Object.assign({}, f, {
435
- offsets: e.modifiersData.popperOffsets,
436
- position: e.options.strategy,
437
- adaptive: i,
438
- roundOffsets: c
439
- })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, $t(Object.assign({}, f, {
440
- offsets: e.modifiersData.arrow,
441
- position: "absolute",
442
- adaptive: !1,
443
- roundOffsets: c
444
- })))), e.attributes.popper = Object.assign({}, e.attributes.popper, {
445
- "data-popper-placement": e.placement
446
- });
447
- }
448
- const da = {
449
- name: "computeStyles",
450
- enabled: !0,
451
- phase: "beforeWrite",
452
- fn: ca,
453
- data: {}
454
- };
455
- var Ie = {
456
- passive: !0
457
- };
458
- function ua(t) {
459
- var e = t.state, a = t.instance, r = t.options, n = r.scroll, l = n === void 0 ? !0 : n, i = r.resize, o = i === void 0 ? !0 : i, c = W(e.elements.popper), f = [].concat(e.scrollParents.reference, e.scrollParents.popper);
460
- return l && f.forEach(function(u) {
461
- u.addEventListener("scroll", a.update, Ie);
462
- }), o && c.addEventListener("resize", a.update, Ie), function() {
463
- l && f.forEach(function(u) {
464
- u.removeEventListener("scroll", a.update, Ie);
465
- }), o && c.removeEventListener("resize", a.update, Ie);
466
- };
467
- }
468
- const fa = {
469
- name: "eventListeners",
470
- enabled: !0,
471
- phase: "write",
472
- fn: function() {
473
- },
474
- effect: ua,
475
- data: {}
476
- };
477
- var pa = {
478
- left: "right",
479
- right: "left",
480
- bottom: "top",
481
- top: "bottom"
482
- };
483
- function Ve(t) {
484
- return t.replace(/left|right|bottom|top/g, function(e) {
485
- return pa[e];
486
- });
487
- }
488
- var ma = {
489
- start: "end",
490
- end: "start"
491
- };
492
- function Mt(t) {
493
- return t.replace(/start|end/g, function(e) {
494
- return ma[e];
495
- });
496
- }
497
- function ft(t) {
498
- var e = W(t), a = e.pageXOffset, r = e.pageYOffset;
499
- return {
500
- scrollLeft: a,
501
- scrollTop: r
502
- };
503
- }
504
- function pt(t) {
505
- return Ne(me(t)).left + ft(t).scrollLeft;
506
- }
507
- function ha(t, e) {
508
- var a = W(t), r = me(t), n = a.visualViewport, l = r.clientWidth, i = r.clientHeight, o = 0, c = 0;
509
- if (n) {
510
- l = n.width, i = n.height;
511
- var f = ns();
512
- (f || !f && e === "fixed") && (o = n.offsetLeft, c = n.offsetTop);
513
- }
514
- return {
515
- width: l,
516
- height: i,
517
- x: o + pt(t),
518
- y: c
519
- };
520
- }
521
- function va(t) {
522
- var e, a = me(t), r = ft(t), n = (e = t.ownerDocument) == null ? void 0 : e.body, l = he(a.scrollWidth, a.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), i = he(a.scrollHeight, a.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), o = -r.scrollLeft + pt(t), c = -r.scrollTop;
523
- return de(n || a).direction === "rtl" && (o += he(a.clientWidth, n ? n.clientWidth : 0) - l), {
524
- width: l,
525
- height: i,
526
- x: o,
527
- y: c
528
- };
529
- }
530
- function mt(t) {
531
- var e = de(t), a = e.overflow, r = e.overflowX, n = e.overflowY;
532
- return /auto|scroll|overlay|hidden/.test(a + n + r);
533
- }
534
- function ds(t) {
535
- return ["html", "body", "#document"].indexOf(pe(t)) >= 0 ? t.ownerDocument.body : re(t) && mt(t) ? t : ds(ze(t));
536
- }
537
- function $e(t, e) {
538
- var a;
539
- e === void 0 && (e = []);
540
- var r = ds(t), n = r === ((a = t.ownerDocument) == null ? void 0 : a.body), l = W(r), i = n ? [l].concat(l.visualViewport || [], mt(r) ? r : []) : r, o = e.concat(i);
541
- return n ? o : (
542
- // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
543
- o.concat($e(ze(i)))
544
- );
545
- }
546
- function ot(t) {
547
- return Object.assign({}, t, {
548
- left: t.x,
549
- top: t.y,
550
- right: t.x + t.width,
551
- bottom: t.y + t.height
552
- });
553
- }
554
- function xa(t, e) {
555
- var a = Ne(t, !1, e === "fixed");
556
- return a.top = a.top + t.clientTop, a.left = a.left + t.clientLeft, a.bottom = a.top + t.clientHeight, a.right = a.left + t.clientWidth, a.width = t.clientWidth, a.height = t.clientHeight, a.x = a.left, a.y = a.top, a;
557
- }
558
- function Rt(t, e, a) {
559
- return e === as ? ot(ha(t, a)) : xe(e) ? xa(e, a) : ot(va(me(t)));
560
- }
561
- function ga(t) {
562
- var e = $e(ze(t)), a = ["absolute", "fixed"].indexOf(de(t).position) >= 0, r = a && re(t) ? Ue(t) : t;
563
- return xe(r) ? e.filter(function(n) {
564
- return xe(n) && is(n, r) && pe(n) !== "body";
565
- }) : [];
566
- }
567
- function ba(t, e, a, r) {
568
- var n = e === "clippingParents" ? ga(t) : [].concat(e), l = [].concat(n, [a]), i = l[0], o = l.reduce(function(c, f) {
569
- var u = Rt(t, f, r);
570
- return c.top = he(u.top, c.top), c.right = He(u.right, c.right), c.bottom = He(u.bottom, c.bottom), c.left = he(u.left, c.left), c;
571
- }, Rt(t, i, r));
572
- return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
573
- }
574
- function us(t) {
575
- var e = t.reference, a = t.element, r = t.placement, n = r ? ae(r) : null, l = r ? _e(r) : null, i = e.x + e.width / 2 - a.width / 2, o = e.y + e.height / 2 - a.height / 2, c;
576
- switch (n) {
577
- case U:
578
- c = {
579
- x: i,
580
- y: e.y - a.height
581
- };
582
- break;
583
- case K:
584
- c = {
585
- x: i,
586
- y: e.y + e.height
587
- };
588
- break;
589
- case G:
590
- c = {
591
- x: e.x + e.width,
592
- y: o
593
- };
594
- break;
595
- case B:
596
- c = {
597
- x: e.x - a.width,
598
- y: o
599
- };
600
- break;
601
- default:
602
- c = {
603
- x: e.x,
604
- y: e.y
605
- };
606
- }
607
- var f = n ? ut(n) : null;
608
- if (f != null) {
609
- var u = f === "y" ? "height" : "width";
610
- switch (l) {
611
- case ye:
612
- c[f] = c[f] - (e[u] / 2 - a[u] / 2);
613
- break;
614
- case ke:
615
- c[f] = c[f] + (e[u] / 2 - a[u] / 2);
616
- break;
617
- }
618
- }
619
- return c;
620
- }
621
- function Le(t, e) {
622
- e === void 0 && (e = {});
623
- var a = e, r = a.placement, n = r === void 0 ? t.placement : r, l = a.strategy, i = l === void 0 ? t.strategy : l, o = a.boundary, c = o === void 0 ? Vs : o, f = a.rootBoundary, u = f === void 0 ? as : f, m = a.elementContext, h = m === void 0 ? Pe : m, d = a.altBoundary, v = d === void 0 ? !1 : d, x = a.padding, p = x === void 0 ? 0 : x, j = ls(typeof p != "number" ? p : cs(p, Fe)), g = h === Pe ? Ws : Pe, N = t.rects.popper, b = t.elements[v ? g : h], _ = ba(xe(b) ? b : b.contextElement || me(t.elements.popper), c, u, i), w = Ne(t.elements.reference), O = us({
624
- reference: w,
625
- element: N,
626
- placement: n
627
- }), $ = ot(Object.assign({}, N, O)), M = h === Pe ? $ : w, E = {
628
- top: _.top - M.top + j.top,
629
- bottom: M.bottom - _.bottom + j.bottom,
630
- left: _.left - M.left + j.left,
631
- right: M.right - _.right + j.right
632
- }, C = t.modifiersData.offset;
633
- if (h === Pe && C) {
634
- var k = C[n];
635
- Object.keys(E).forEach(function(S) {
636
- var L = [G, K].indexOf(S) >= 0 ? 1 : -1, R = [U, K].indexOf(S) >= 0 ? "y" : "x";
637
- E[S] += k[R] * L;
638
- });
639
- }
640
- return E;
641
- }
642
- function ja(t, e) {
643
- e === void 0 && (e = {});
644
- var a = e, r = a.placement, n = a.boundary, l = a.rootBoundary, i = a.padding, o = a.flipVariations, c = a.allowedAutoPlacements, f = c === void 0 ? rs : c, u = _e(r), m = u ? o ? At : At.filter(function(v) {
645
- return _e(v) === u;
646
- }) : Fe, h = m.filter(function(v) {
647
- return f.indexOf(v) >= 0;
648
- });
649
- h.length === 0 && (h = m);
650
- var d = h.reduce(function(v, x) {
651
- return v[x] = Le(t, {
652
- placement: x,
653
- boundary: n,
654
- rootBoundary: l,
655
- padding: i
656
- })[ae(x)], v;
657
- }, {});
658
- return Object.keys(d).sort(function(v, x) {
659
- return d[v] - d[x];
660
- });
661
- }
662
- function ya(t) {
663
- if (ae(t) === lt)
664
- return [];
665
- var e = Ve(t);
666
- return [Mt(t), e, Mt(e)];
667
- }
668
- function wa(t) {
669
- var e = t.state, a = t.options, r = t.name;
670
- if (!e.modifiersData[r]._skip) {
671
- for (var n = a.mainAxis, l = n === void 0 ? !0 : n, i = a.altAxis, o = i === void 0 ? !0 : i, c = a.fallbackPlacements, f = a.padding, u = a.boundary, m = a.rootBoundary, h = a.altBoundary, d = a.flipVariations, v = d === void 0 ? !0 : d, x = a.allowedAutoPlacements, p = e.options.placement, j = ae(p), g = j === p, N = c || (g || !v ? [Ve(p)] : ya(p)), b = [p].concat(N).reduce(function(H, te) {
672
- return H.concat(ae(te) === lt ? ja(e, {
673
- placement: te,
674
- boundary: u,
675
- rootBoundary: m,
676
- padding: f,
677
- flipVariations: v,
678
- allowedAutoPlacements: x
679
- }) : te);
680
- }, []), _ = e.rects.reference, w = e.rects.popper, O = /* @__PURE__ */ new Map(), $ = !0, M = b[0], E = 0; E < b.length; E++) {
681
- var C = b[E], k = ae(C), S = _e(C) === ye, L = [U, K].indexOf(k) >= 0, R = L ? "width" : "height", F = Le(e, {
682
- placement: C,
683
- boundary: u,
684
- rootBoundary: m,
685
- altBoundary: h,
686
- padding: f
687
- }), I = L ? S ? G : B : S ? K : U;
688
- _[R] > w[R] && (I = Ve(I));
689
- var fe = Ve(I), ie = [];
690
- if (l && ie.push(F[k] <= 0), o && ie.push(F[I] <= 0, F[fe] <= 0), ie.every(function(H) {
691
- return H;
692
- })) {
693
- M = C, $ = !1;
694
- break;
695
- }
696
- O.set(C, ie);
697
- }
698
- if ($)
699
- for (var oe = v ? 3 : 1, Oe = function(te) {
700
- var le = b.find(function(be) {
701
- var J = O.get(be);
702
- if (J)
703
- return J.slice(0, te).every(function(Se) {
704
- return Se;
705
- });
706
- });
707
- if (le)
708
- return M = le, "break";
709
- }, D = oe; D > 0; D--) {
710
- var ge = Oe(D);
711
- if (ge === "break") break;
712
- }
713
- e.placement !== M && (e.modifiersData[r]._skip = !0, e.placement = M, e.reset = !0);
714
- }
715
- }
716
- const Na = {
717
- name: "flip",
718
- enabled: !0,
719
- phase: "main",
720
- fn: wa,
721
- requiresIfExists: ["offset"],
722
- data: {
723
- _skip: !1
724
- }
725
- };
726
- function kt(t, e, a) {
727
- return a === void 0 && (a = {
728
- x: 0,
729
- y: 0
730
- }), {
731
- top: t.top - e.height - a.y,
732
- right: t.right - e.width + a.x,
733
- bottom: t.bottom - e.height + a.y,
734
- left: t.left - e.width - a.x
735
- };
736
- }
737
- function Lt(t) {
738
- return [U, G, K, B].some(function(e) {
739
- return t[e] >= 0;
740
- });
741
- }
742
- function _a(t) {
743
- var e = t.state, a = t.name, r = e.rects.reference, n = e.rects.popper, l = e.modifiersData.preventOverflow, i = Le(e, {
744
- elementContext: "reference"
745
- }), o = Le(e, {
746
- altBoundary: !0
747
- }), c = kt(i, r), f = kt(o, n, l), u = Lt(c), m = Lt(f);
748
- e.modifiersData[a] = {
749
- referenceClippingOffsets: c,
750
- popperEscapeOffsets: f,
751
- isReferenceHidden: u,
752
- hasPopperEscaped: m
753
- }, e.attributes.popper = Object.assign({}, e.attributes.popper, {
754
- "data-popper-reference-hidden": u,
755
- "data-popper-escaped": m
756
- });
757
- }
758
- const Oa = {
759
- name: "hide",
760
- enabled: !0,
761
- phase: "main",
762
- requiresIfExists: ["preventOverflow"],
763
- fn: _a
764
- };
765
- function Sa(t, e, a) {
766
- var r = ae(t), n = [B, U].indexOf(r) >= 0 ? -1 : 1, l = typeof a == "function" ? a(Object.assign({}, e, {
767
- placement: t
768
- })) : a, i = l[0], o = l[1];
769
- return i = i || 0, o = (o || 0) * n, [B, G].indexOf(r) >= 0 ? {
770
- x: o,
771
- y: i
772
- } : {
773
- x: i,
774
- y: o
775
- };
776
- }
777
- function Da(t) {
778
- var e = t.state, a = t.options, r = t.name, n = a.offset, l = n === void 0 ? [0, 0] : n, i = rs.reduce(function(u, m) {
779
- return u[m] = Sa(m, e.rects, l), u;
780
- }, {}), o = i[e.placement], c = o.x, f = o.y;
781
- e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += f), e.modifiersData[r] = i;
782
- }
783
- const Pa = {
784
- name: "offset",
785
- enabled: !0,
786
- phase: "main",
787
- requires: ["popperOffsets"],
788
- fn: Da
789
- };
790
- function Ea(t) {
791
- var e = t.state, a = t.name;
792
- e.modifiersData[a] = us({
793
- reference: e.rects.reference,
794
- element: e.rects.popper,
795
- placement: e.placement
796
- });
797
- }
798
- const Aa = {
799
- name: "popperOffsets",
800
- enabled: !0,
801
- phase: "read",
802
- fn: Ea,
803
- data: {}
804
- };
805
- function Ca(t) {
806
- return t === "x" ? "y" : "x";
807
- }
808
- function $a(t) {
809
- var e = t.state, a = t.options, r = t.name, n = a.mainAxis, l = n === void 0 ? !0 : n, i = a.altAxis, o = i === void 0 ? !1 : i, c = a.boundary, f = a.rootBoundary, u = a.altBoundary, m = a.padding, h = a.tether, d = h === void 0 ? !0 : h, v = a.tetherOffset, x = v === void 0 ? 0 : v, p = Le(e, {
810
- boundary: c,
811
- rootBoundary: f,
812
- padding: m,
813
- altBoundary: u
814
- }), j = ae(e.placement), g = _e(e.placement), N = !g, b = ut(j), _ = Ca(b), w = e.modifiersData.popperOffsets, O = e.rects.reference, $ = e.rects.popper, M = typeof x == "function" ? x(Object.assign({}, e.rects, {
815
- placement: e.placement
816
- })) : x, E = typeof M == "number" ? {
817
- mainAxis: M,
818
- altAxis: M
819
- } : Object.assign({
820
- mainAxis: 0,
821
- altAxis: 0
822
- }, M), C = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, k = {
823
- x: 0,
824
- y: 0
825
- };
826
- if (w) {
827
- if (l) {
828
- var S, L = b === "y" ? U : B, R = b === "y" ? K : G, F = b === "y" ? "height" : "width", I = w[b], fe = I + p[L], ie = I - p[R], oe = d ? -$[F] / 2 : 0, Oe = g === ye ? O[F] : $[F], D = g === ye ? -$[F] : -O[F], ge = e.elements.arrow, H = d && ge ? dt(ge) : {
829
- width: 0,
830
- height: 0
831
- }, te = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : os(), le = te[L], be = te[R], J = Ce(0, O[F], H[F]), Se = N ? O[F] / 2 - oe - J - le - E.mainAxis : Oe - J - le - E.mainAxis, Xe = N ? -O[F] / 2 + oe + J + be + E.mainAxis : D + J + be + E.mainAxis, T = e.elements.arrow && Ue(e.elements.arrow), je = T ? b === "y" ? T.clientTop || 0 : T.clientLeft || 0 : 0, De = (S = C?.[b]) != null ? S : 0, vt = I + Se - De - je, xt = I + Xe - De, Ye = Ce(d ? He(fe, vt) : fe, I, d ? he(ie, xt) : ie);
832
- w[b] = Ye, k[b] = Ye - I;
833
- }
834
- if (o) {
835
- var qe, Ke = b === "x" ? U : B, Ge = b === "x" ? K : G, se = w[_], y = _ === "y" ? "height" : "width", V = se + p[Ke], gt = se - p[Ge], Je = [U, B].indexOf(j) !== -1, bt = (qe = C?.[_]) != null ? qe : 0, jt = Je ? V : se - O[y] - $[y] - bt + E.altAxis, yt = Je ? se + O[y] + $[y] - bt - E.altAxis : gt, wt = d && Je ? sa(jt, se, yt) : Ce(d ? jt : V, se, d ? yt : gt);
836
- w[_] = wt, k[_] = wt - se;
837
- }
838
- e.modifiersData[r] = k;
839
- }
840
- }
841
- const Ma = {
842
- name: "preventOverflow",
843
- enabled: !0,
844
- phase: "main",
845
- fn: $a,
846
- requiresIfExists: ["offset"]
847
- };
848
- function Ra(t) {
849
- return {
850
- scrollLeft: t.scrollLeft,
851
- scrollTop: t.scrollTop
852
- };
853
- }
854
- function ka(t) {
855
- return t === W(t) || !re(t) ? ft(t) : Ra(t);
856
- }
857
- function La(t) {
858
- var e = t.getBoundingClientRect(), a = we(e.width) / t.offsetWidth || 1, r = we(e.height) / t.offsetHeight || 1;
859
- return a !== 1 || r !== 1;
860
- }
861
- function Ta(t, e, a) {
862
- a === void 0 && (a = !1);
863
- var r = re(e), n = re(e) && La(e), l = me(e), i = Ne(t, n, a), o = {
864
- scrollLeft: 0,
865
- scrollTop: 0
866
- }, c = {
867
- x: 0,
868
- y: 0
869
- };
870
- return (r || !r && !a) && ((pe(e) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
871
- mt(l)) && (o = ka(e)), re(e) ? (c = Ne(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : l && (c.x = pt(l))), {
872
- x: i.left + o.scrollLeft - c.x,
873
- y: i.top + o.scrollTop - c.y,
874
- width: i.width,
875
- height: i.height
876
- };
877
- }
878
- function Fa(t) {
879
- var e = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), r = [];
880
- t.forEach(function(l) {
881
- e.set(l.name, l);
882
- });
883
- function n(l) {
884
- a.add(l.name);
885
- var i = [].concat(l.requires || [], l.requiresIfExists || []);
886
- i.forEach(function(o) {
887
- if (!a.has(o)) {
888
- var c = e.get(o);
889
- c && n(c);
890
- }
891
- }), r.push(l);
892
- }
893
- return t.forEach(function(l) {
894
- a.has(l.name) || n(l);
895
- }), r;
896
- }
897
- function Ua(t) {
898
- var e = Fa(t);
899
- return Zs.reduce(function(a, r) {
900
- return a.concat(e.filter(function(n) {
901
- return n.phase === r;
902
- }));
903
- }, []);
904
- }
905
- function Ba(t) {
906
- var e;
907
- return function() {
908
- return e || (e = new Promise(function(a) {
909
- Promise.resolve().then(function() {
910
- e = void 0, a(t());
911
- });
912
- })), e;
913
- };
914
- }
915
- function Ia(t) {
916
- var e = t.reduce(function(a, r) {
917
- var n = a[r.name];
918
- return a[r.name] = n ? Object.assign({}, n, r, {
919
- options: Object.assign({}, n.options, r.options),
920
- data: Object.assign({}, n.data, r.data)
921
- }) : r, a;
922
- }, {});
923
- return Object.keys(e).map(function(a) {
924
- return e[a];
925
- });
926
- }
927
- var Tt = {
928
- placement: "bottom",
929
- modifiers: [],
930
- strategy: "absolute"
931
- };
932
- function Ft() {
933
- for (var t = arguments.length, e = new Array(t), a = 0; a < t; a++)
934
- e[a] = arguments[a];
935
- return !e.some(function(r) {
936
- return !(r && typeof r.getBoundingClientRect == "function");
937
- });
938
- }
939
- function Va(t) {
940
- t === void 0 && (t = {});
941
- var e = t, a = e.defaultModifiers, r = a === void 0 ? [] : a, n = e.defaultOptions, l = n === void 0 ? Tt : n;
942
- return function(o, c, f) {
943
- f === void 0 && (f = l);
944
- var u = {
945
- placement: "bottom",
946
- orderedModifiers: [],
947
- options: Object.assign({}, Tt, l),
948
- modifiersData: {},
949
- elements: {
950
- reference: o,
951
- popper: c
952
- },
953
- attributes: {},
954
- styles: {}
955
- }, m = [], h = !1, d = {
956
- state: u,
957
- setOptions: function(j) {
958
- var g = typeof j == "function" ? j(u.options) : j;
959
- x(), u.options = Object.assign({}, l, u.options, g), u.scrollParents = {
960
- reference: xe(o) ? $e(o) : o.contextElement ? $e(o.contextElement) : [],
961
- popper: $e(c)
962
- };
963
- var N = Ua(Ia([].concat(r, u.options.modifiers)));
964
- return u.orderedModifiers = N.filter(function(b) {
965
- return b.enabled;
966
- }), v(), d.update();
967
- },
968
- // Sync update – it will always be executed, even if not necessary. This
969
- // is useful for low frequency updates where sync behavior simplifies the
970
- // logic.
971
- // For high frequency updates (e.g. `resize` and `scroll` events), always
972
- // prefer the async Popper#update method
973
- forceUpdate: function() {
974
- if (!h) {
975
- var j = u.elements, g = j.reference, N = j.popper;
976
- if (Ft(g, N)) {
977
- u.rects = {
978
- reference: Ta(g, Ue(N), u.options.strategy === "fixed"),
979
- popper: dt(N)
980
- }, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(E) {
981
- return u.modifiersData[E.name] = Object.assign({}, E.data);
982
- });
983
- for (var b = 0; b < u.orderedModifiers.length; b++) {
984
- if (u.reset === !0) {
985
- u.reset = !1, b = -1;
986
- continue;
987
- }
988
- var _ = u.orderedModifiers[b], w = _.fn, O = _.options, $ = O === void 0 ? {} : O, M = _.name;
989
- typeof w == "function" && (u = w({
990
- state: u,
991
- options: $,
992
- name: M,
993
- instance: d
994
- }) || u);
995
- }
996
- }
997
- }
998
- },
999
- // Async and optimistically optimized update – it will not be executed if
1000
- // not necessary (debounced to run at most once-per-tick)
1001
- update: Ba(function() {
1002
- return new Promise(function(p) {
1003
- d.forceUpdate(), p(u);
1004
- });
1005
- }),
1006
- destroy: function() {
1007
- x(), h = !0;
1008
- }
1009
- };
1010
- if (!Ft(o, c))
1011
- return d;
1012
- d.setOptions(f).then(function(p) {
1013
- !h && f.onFirstUpdate && f.onFirstUpdate(p);
1014
- });
1015
- function v() {
1016
- u.orderedModifiers.forEach(function(p) {
1017
- var j = p.name, g = p.options, N = g === void 0 ? {} : g, b = p.effect;
1018
- if (typeof b == "function") {
1019
- var _ = b({
1020
- state: u,
1021
- name: j,
1022
- instance: d,
1023
- options: N
1024
- }), w = function() {
1025
- };
1026
- m.push(_ || w);
1027
- }
1028
- });
1029
- }
1030
- function x() {
1031
- m.forEach(function(p) {
1032
- return p();
1033
- }), m = [];
1034
- }
1035
- return d;
1036
- };
1037
- }
1038
- const Wa = Va({
1039
- defaultModifiers: [Oa, Aa, da, fa, Pa, Na, Ma, ia]
1040
- }), Ha = ["enabled", "placement", "strategy", "modifiers"];
1041
- function za(t, e) {
1042
- if (t == null) return {};
1043
- var a = {};
1044
- for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
1045
- if (e.indexOf(r) >= 0) continue;
1046
- a[r] = t[r];
1047
- }
1048
- return a;
1049
- }
1050
- const Xa = {
1051
- name: "applyStyles",
1052
- enabled: !1,
1053
- phase: "afterWrite",
1054
- fn: () => {
1055
- }
1056
- }, Ya = {
1057
- name: "ariaDescribedBy",
1058
- enabled: !0,
1059
- phase: "afterWrite",
1060
- effect: ({
1061
- state: t
1062
- }) => () => {
1063
- const {
1064
- reference: e,
1065
- popper: a
1066
- } = t.elements;
1067
- if ("removeAttribute" in e) {
1068
- const r = (e.getAttribute("aria-describedby") || "").split(",").filter((n) => n.trim() !== a.id);
1069
- r.length ? e.setAttribute("aria-describedby", r.join(",")) : e.removeAttribute("aria-describedby");
1070
- }
1071
- },
1072
- fn: ({
1073
- state: t
1074
- }) => {
1075
- var e;
1076
- const {
1077
- popper: a,
1078
- reference: r
1079
- } = t.elements, n = (e = a.getAttribute("role")) == null ? void 0 : e.toLowerCase();
1080
- if (a.id && n === "tooltip" && "setAttribute" in r) {
1081
- const l = r.getAttribute("aria-describedby");
1082
- if (l && l.split(",").indexOf(a.id) !== -1)
1083
- return;
1084
- r.setAttribute("aria-describedby", l ? `${l},${a.id}` : a.id);
1085
- }
1086
- }
1087
- }, qa = [];
1088
- function Ka(t, e, a = {}) {
1089
- let {
1090
- enabled: r = !0,
1091
- placement: n = "bottom",
1092
- strategy: l = "absolute",
1093
- modifiers: i = qa
1094
- } = a, o = za(a, Ha);
1095
- const c = q(i), f = q(), u = z(() => {
1096
- var p;
1097
- (p = f.current) == null || p.update();
1098
- }, []), m = z(() => {
1099
- var p;
1100
- (p = f.current) == null || p.forceUpdate();
1101
- }, []), [h, d] = Is(A({
1102
- placement: n,
1103
- update: u,
1104
- forceUpdate: m,
1105
- attributes: {},
1106
- styles: {
1107
- popper: {},
1108
- arrow: {}
1109
- }
1110
- })), v = Me(() => ({
1111
- name: "updateStateModifier",
1112
- enabled: !0,
1113
- phase: "write",
1114
- requires: ["computeStyles"],
1115
- fn: ({
1116
- state: p
1117
- }) => {
1118
- const j = {}, g = {};
1119
- Object.keys(p.elements).forEach((N) => {
1120
- j[N] = p.styles[N], g[N] = p.attributes[N];
1121
- }), d({
1122
- state: p,
1123
- styles: j,
1124
- attributes: g,
1125
- update: u,
1126
- forceUpdate: m,
1127
- placement: p.placement
1128
- });
1129
- }
1130
- }), [u, m, d]), x = Me(() => (Ae(c.current, i) || (c.current = i), c.current), [i]);
1131
- return X(() => {
1132
- !f.current || !r || f.current.setOptions({
1133
- placement: n,
1134
- strategy: l,
1135
- modifiers: [...x, v, Xa]
1136
- });
1137
- }, [l, n, v, r, x]), X(() => {
1138
- if (!(!r || t == null || e == null))
1139
- return f.current = Wa(t, e, Object.assign({}, o, {
1140
- placement: n,
1141
- strategy: l,
1142
- modifiers: [...x, Ya, v]
1143
- })), () => {
1144
- f.current != null && (f.current.destroy(), f.current = void 0, d((p) => Object.assign({}, p, {
1145
- attributes: {},
1146
- styles: {
1147
- popper: {}
1148
- }
1149
- })));
1150
- };
1151
- }, [r, t, e]), h;
1152
- }
1153
- const Ut = () => {
1154
- };
1155
- function Ga(t) {
1156
- return t.button === 0;
1157
- }
1158
- function Ja(t) {
1159
- return !!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey);
1160
- }
1161
- const We = (t) => t && ("current" in t ? t.current : t), Bt = {
1162
- click: "mousedown",
1163
- mouseup: "mousedown",
1164
- pointerup: "pointerdown"
1165
- };
1166
- function Qa(t, e = Ut, {
1167
- disabled: a,
1168
- clickTrigger: r = "click"
1169
- } = {}) {
1170
- const n = q(!1), l = q(!1), i = z((f) => {
1171
- const u = We(t);
1172
- ss(!!u, "ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"), n.current = !u || Ja(f) || !Ga(f) || !!st(u, f.target) || l.current, l.current = !1;
1173
- }, [t]), o = at((f) => {
1174
- const u = We(t);
1175
- u && st(u, f.target) ? l.current = !0 : l.current = !1;
1176
- }), c = at((f) => {
1177
- n.current || e(f);
1178
- });
1179
- X(() => {
1180
- var f, u;
1181
- if (a || t == null) return;
1182
- const m = Gt(We(t)), h = m.defaultView || window;
1183
- let d = (f = h.event) != null ? f : (u = h.parent) == null ? void 0 : u.event, v = null;
1184
- Bt[r] && (v = Ee(m, Bt[r], o, !0));
1185
- const x = Ee(m, r, i, !0), p = Ee(m, r, (g) => {
1186
- if (g === d) {
1187
- d = void 0;
1188
- return;
1189
- }
1190
- c(g);
1191
- });
1192
- let j = [];
1193
- return "ontouchstart" in m.documentElement && (j = [].slice.call(m.body.children).map((g) => Ee(g, "mousemove", Ut))), () => {
1194
- v?.(), x(), p(), j.forEach((g) => g());
1195
- };
1196
- }, [t, a, r, i, o, c]);
1197
- }
1198
- const Za = () => {
1199
- };
1200
- function er(t, e, {
1201
- disabled: a,
1202
- clickTrigger: r
1203
- } = {}) {
1204
- const n = e || Za;
1205
- Qa(t, n, {
1206
- disabled: a,
1207
- clickTrigger: r
1208
- });
1209
- const l = at((i) => {
1210
- ws(i) && n(i);
1211
- });
1212
- X(() => {
1213
- if (a || t == null) return;
1214
- const i = Gt(We(t));
1215
- let o = (i.defaultView || window).event;
1216
- const c = Ee(i, "keyup", (f) => {
1217
- if (f === o) {
1218
- o = void 0;
1219
- return;
1220
- }
1221
- l(f);
1222
- });
1223
- return () => {
1224
- c();
1225
- };
1226
- }, [t, a, l]);
1227
- }
1228
- function tr(t) {
1229
- const e = {};
1230
- return Array.isArray(t) ? (t?.forEach((a) => {
1231
- e[a.name] = a;
1232
- }), e) : t || e;
1233
- }
1234
- function sr(t = {}) {
1235
- return Array.isArray(t) ? t : Object.keys(t).map((e) => (t[e].name = e, t[e]));
1236
- }
1237
- function ar({
1238
- enabled: t,
1239
- enableEvents: e,
1240
- placement: a,
1241
- flip: r,
1242
- offset: n,
1243
- fixed: l,
1244
- containerPadding: i,
1245
- arrowElement: o,
1246
- popperConfig: c = {}
1247
- }) {
1248
- var f, u, m, h;
1249
- const d = tr(c.modifiers);
1250
- return Object.assign({}, c, {
1251
- placement: a,
1252
- enabled: t,
1253
- strategy: l ? "fixed" : c.strategy,
1254
- modifiers: sr(Object.assign({}, d, {
1255
- eventListeners: {
1256
- enabled: e,
1257
- options: (f = d.eventListeners) == null ? void 0 : f.options
1258
- },
1259
- preventOverflow: Object.assign({}, d.preventOverflow, {
1260
- options: Object.assign({
1261
- padding: i
1262
- }, (u = d.preventOverflow) == null ? void 0 : u.options)
1263
- }),
1264
- offset: {
1265
- options: Object.assign({
1266
- offset: n
1267
- }, (m = d.offset) == null ? void 0 : m.options)
1268
- },
1269
- arrow: Object.assign({}, d.arrow, {
1270
- enabled: !!o,
1271
- options: Object.assign({}, (h = d.arrow) == null ? void 0 : h.options, {
1272
- element: o
1273
- })
1274
- }),
1275
- flip: Object.assign({
1276
- enabled: !!r
1277
- }, d.flip)
1278
- }))
1279
- });
1280
- }
1281
- const fs = /* @__PURE__ */ ee.forwardRef((t, e) => {
1282
- const {
1283
- flip: a,
1284
- offset: r,
1285
- placement: n,
1286
- containerPadding: l,
1287
- popperConfig: i = {},
1288
- transition: o,
1289
- runTransition: c
1290
- } = t, [f, u] = Dt(), [m, h] = Dt(), d = Ns(u, e), v = Nt(t.container), x = Nt(t.target), [p, j] = A(!t.show), g = Ka(x, f, ar({
1291
- placement: n,
1292
- enableEvents: !!t.show,
1293
- containerPadding: l || 5,
1294
- flip: a,
1295
- offset: r,
1296
- arrowElement: m,
1297
- popperConfig: i
1298
- }));
1299
- t.show && p && j(!1);
1300
- const N = (...C) => {
1301
- j(!0), t.onExited && t.onExited(...C);
1302
- }, b = t.show || !p;
1303
- if (er(f, t.onHide, {
1304
- disabled: !t.rootClose || t.rootCloseDisabled,
1305
- clickTrigger: t.rootCloseEvent
1306
- }), !b)
1307
- return null;
1308
- const {
1309
- onExit: _,
1310
- onExiting: w,
1311
- onEnter: O,
1312
- onEntering: $,
1313
- onEntered: M
1314
- } = t;
1315
- let E = t.children(Object.assign({}, g.attributes.popper, {
1316
- style: g.styles.popper,
1317
- ref: d
1318
- }), {
1319
- popper: g,
1320
- placement: n,
1321
- show: !!t.show,
1322
- arrowProps: Object.assign({}, g.attributes.arrow, {
1323
- style: g.styles.arrow,
1324
- ref: h
1325
- })
1326
- });
1327
- return E = _s(o, c, {
1328
- in: !!t.show,
1329
- appear: !0,
1330
- mountOnEnter: !0,
1331
- unmountOnExit: !0,
1332
- children: E,
1333
- onExit: _,
1334
- onExiting: w,
1335
- onExited: N,
1336
- onEnter: O,
1337
- onEntering: $,
1338
- onEntered: M
1339
- }), v ? /* @__PURE__ */ Es.createPortal(E, v) : null;
1340
- });
1341
- fs.displayName = "Overlay";
1342
- const rr = typeof global < "u" && // @ts-ignore
1343
- global.navigator && // @ts-ignore
1344
- global.navigator.product === "ReactNative", nr = typeof document < "u", ir = nr || rr ? bs : X, ps = /* @__PURE__ */ ee.forwardRef(({
1345
- className: t,
1346
- bsPrefix: e,
1347
- as: a = "div",
1348
- ...r
1349
- }, n) => (e = ve(e, "popover-header"), /* @__PURE__ */ s.jsx(a, {
1350
- ref: n,
1351
- className: ue(t, e),
1352
- ...r
1353
- })));
1354
- ps.displayName = "PopoverHeader";
1355
- const ht = /* @__PURE__ */ ee.forwardRef(({
1356
- className: t,
1357
- bsPrefix: e,
1358
- as: a = "div",
1359
- ...r
1360
- }, n) => (e = ve(e, "popover-body"), /* @__PURE__ */ s.jsx(a, {
1361
- ref: n,
1362
- className: ue(t, e),
1363
- ...r
1364
- })));
1365
- ht.displayName = "PopoverBody";
1366
- function ms(t, e) {
1367
- let a = t;
1368
- return t === "left" ? a = e ? "end" : "start" : t === "right" && (a = e ? "start" : "end"), a;
1369
- }
1370
- function hs(t = "absolute") {
1371
- return {
1372
- position: t,
1373
- top: "0",
1374
- left: "0",
1375
- opacity: "0",
1376
- pointerEvents: "none"
1377
- };
1378
- }
1379
- const vs = /* @__PURE__ */ ee.forwardRef(({
1380
- bsPrefix: t,
1381
- placement: e = "right",
1382
- className: a,
1383
- style: r,
1384
- children: n,
1385
- body: l,
1386
- arrowProps: i,
1387
- hasDoneInitialMeasure: o,
1388
- popper: c,
1389
- show: f,
1390
- ...u
1391
- }, m) => {
1392
- const h = ve(t, "popover"), d = Jt(), [v] = e?.split("-") || [], x = ms(v, d);
1393
- let p = r;
1394
- return f && !o && (p = {
1395
- ...r,
1396
- ...hs(c?.strategy)
1397
- }), /* @__PURE__ */ s.jsxs("div", {
1398
- ref: m,
1399
- role: "tooltip",
1400
- style: p,
1401
- "x-placement": v,
1402
- className: ue(a, h, v && `bs-popover-${x}`),
1403
- ...u,
1404
- children: [/* @__PURE__ */ s.jsx("div", {
1405
- className: "popover-arrow",
1406
- ...i
1407
- }), l ? /* @__PURE__ */ s.jsx(ht, {
1408
- children: n
1409
- }) : n]
1410
- });
1411
- });
1412
- vs.displayName = "Popover";
1413
- const or = Object.assign(vs, {
1414
- Header: ps,
1415
- Body: ht,
1416
- // Default popover offset.
1417
- // https://github.com/twbs/bootstrap/blob/5c32767e0e0dbac2d934bcdee03719a65d3f1187/js/src/popover.js#L28
1418
- POPPER_OFFSET: [0, 8]
1419
- }), xs = /* @__PURE__ */ ee.forwardRef(({
1420
- bsPrefix: t,
1421
- placement: e = "right",
1422
- className: a,
1423
- style: r,
1424
- children: n,
1425
- arrowProps: l,
1426
- hasDoneInitialMeasure: i,
1427
- popper: o,
1428
- show: c,
1429
- ...f
1430
- }, u) => {
1431
- t = ve(t, "tooltip");
1432
- const m = Jt(), [h] = e?.split("-") || [], d = ms(h, m);
1433
- let v = r;
1434
- return c && !i && (v = {
1435
- ...r,
1436
- ...hs(o?.strategy)
1437
- }), /* @__PURE__ */ s.jsxs("div", {
1438
- ref: u,
1439
- style: v,
1440
- role: "tooltip",
1441
- "x-placement": h,
1442
- className: ue(a, t, `bs-tooltip-${d}`),
1443
- ...f,
1444
- children: [/* @__PURE__ */ s.jsx("div", {
1445
- className: "tooltip-arrow",
1446
- ...l
1447
- }), /* @__PURE__ */ s.jsx("div", {
1448
- className: `${t}-inner`,
1449
- children: n
1450
- })]
1451
- });
1452
- });
1453
- xs.displayName = "Tooltip";
1454
- const Q = Object.assign(xs, {
1455
- // Default tooltip offset.
1456
- // https://github.com/twbs/bootstrap/blob/beca2a6c7f6bc88b6449339fc76edcda832c59e5/js/src/tooltip.js#L65
1457
- TOOLTIP_OFFSET: [0, 6]
1458
- });
1459
- function lr(t) {
1460
- const e = q(null), a = ve(void 0, "popover"), r = ve(void 0, "tooltip"), n = Me(() => ({
1461
- name: "offset",
1462
- options: {
1463
- offset: () => {
1464
- if (t)
1465
- return t;
1466
- if (e.current) {
1467
- if (_t(e.current, a))
1468
- return or.POPPER_OFFSET;
1469
- if (_t(e.current, r))
1470
- return Q.TOOLTIP_OFFSET;
1471
- }
1472
- return [0, 0];
1473
- }
1474
- }
1475
- }), [t, a, r]);
1476
- return [e, [n]];
1477
- }
1478
- function cr(t, e) {
1479
- const {
1480
- ref: a
1481
- } = t, {
1482
- ref: r
1483
- } = e;
1484
- t.ref = a.__wrapped || (a.__wrapped = (n) => a(rt(n))), e.ref = r.__wrapped || (r.__wrapped = (n) => r(rt(n)));
1485
- }
1486
- const gs = /* @__PURE__ */ ee.forwardRef(({
1487
- children: t,
1488
- transition: e = Ot,
1489
- popperConfig: a = {},
1490
- rootClose: r = !1,
1491
- placement: n = "top",
1492
- show: l = !1,
1493
- ...i
1494
- }, o) => {
1495
- const c = q({}), [f, u] = A(null), [m, h] = lr(i.offset), d = Qt(o, m), v = e === !0 ? Ot : e || void 0, x = Os((p) => {
1496
- u(p), a == null || a.onFirstUpdate == null || a.onFirstUpdate(p);
1497
- });
1498
- return ir(() => {
1499
- f && i.target && (c.current.scheduleUpdate == null || c.current.scheduleUpdate());
1500
- }, [f, i.target]), X(() => {
1501
- l || u(null);
1502
- }, [l]), /* @__PURE__ */ s.jsx(fs, {
1503
- ...i,
1504
- ref: d,
1505
- popperConfig: {
1506
- ...a,
1507
- modifiers: h.concat(a.modifiers || []),
1508
- onFirstUpdate: x
1509
- },
1510
- transition: v,
1511
- rootClose: r,
1512
- placement: n,
1513
- show: l,
1514
- children: (p, {
1515
- arrowProps: j,
1516
- popper: g,
1517
- show: N
1518
- }) => {
1519
- var b;
1520
- cr(p, j);
1521
- const _ = g?.placement, w = Object.assign(c.current, {
1522
- state: g?.state,
1523
- scheduleUpdate: g?.update,
1524
- placement: _,
1525
- outOfBoundaries: (g == null || (b = g.state) == null || (b = b.modifiersData.hide) == null ? void 0 : b.isReferenceHidden) || !1,
1526
- strategy: a.strategy
1527
- }), O = !!f;
1528
- return typeof t == "function" ? t({
1529
- ...p,
1530
- placement: _,
1531
- show: N,
1532
- ...!e && N && {
1533
- className: "show"
1534
- },
1535
- popper: w,
1536
- arrowProps: j,
1537
- hasDoneInitialMeasure: O
1538
- }) : /* @__PURE__ */ ee.cloneElement(t, {
1539
- ...p,
1540
- placement: _,
1541
- arrowProps: j,
1542
- popper: w,
1543
- hasDoneInitialMeasure: O,
1544
- className: ue(t.props.className, !e && N && "show"),
1545
- style: {
1546
- ...t.props.style,
1547
- ...p.style
1548
- }
1549
- });
1550
- }
1551
- });
1552
- });
1553
- gs.displayName = "Overlay";
1554
- function dr(t) {
1555
- return t && typeof t == "object" ? t : {
1556
- show: t,
1557
- hide: t
1558
- };
1559
- }
1560
- function It(t, e, a) {
1561
- const [r] = e, n = r.currentTarget, l = r.relatedTarget || r.nativeEvent[a];
1562
- (!l || l !== n) && !st(n, l) && t(...e);
1563
- }
1564
- Ds.oneOf(["click", "hover", "focus"]);
1565
- const ce = ({
1566
- trigger: t = ["hover", "focus"],
1567
- overlay: e,
1568
- children: a,
1569
- popperConfig: r = {},
1570
- show: n,
1571
- defaultShow: l = !1,
1572
- onToggle: i,
1573
- delay: o,
1574
- placement: c,
1575
- flip: f = c && c.indexOf("auto") !== -1,
1576
- ...u
1577
- }) => {
1578
- const m = q(null), h = Qt(m, Ss(a)), d = Ts(), v = q(""), [x, p] = Bs(n, l, i), j = dr(o), {
1579
- onFocus: g,
1580
- onBlur: N,
1581
- onClick: b
1582
- } = typeof a != "function" ? ee.Children.only(a).props : {}, _ = (R) => {
1583
- h(rt(R));
1584
- }, w = z(() => {
1585
- if (d.clear(), v.current = "show", !j.show) {
1586
- p(!0);
1587
- return;
1588
- }
1589
- d.set(() => {
1590
- v.current === "show" && p(!0);
1591
- }, j.show);
1592
- }, [j.show, p, d]), O = z(() => {
1593
- if (d.clear(), v.current = "hide", !j.hide) {
1594
- p(!1);
1595
- return;
1596
- }
1597
- d.set(() => {
1598
- v.current === "hide" && p(!1);
1599
- }, j.hide);
1600
- }, [j.hide, p, d]), $ = z((...R) => {
1601
- w(), g?.(...R);
1602
- }, [w, g]), M = z((...R) => {
1603
- O(), N?.(...R);
1604
- }, [O, N]), E = z((...R) => {
1605
- p(!x), b?.(...R);
1606
- }, [b, p, x]), C = z((...R) => {
1607
- It(w, R, "fromElement");
1608
- }, [w]), k = z((...R) => {
1609
- It(O, R, "toElement");
1610
- }, [O]), S = t == null ? [] : [].concat(t), L = {
1611
- ref: _
1612
- };
1613
- return S.indexOf("click") !== -1 && (L.onClick = E), S.indexOf("focus") !== -1 && (L.onFocus = $, L.onBlur = M), S.indexOf("hover") !== -1 && (process.env.NODE_ENV !== "production" && ss(S.length > 1, '[react-bootstrap] Specifying only the `"hover"` trigger limits the visibility of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.'), L.onMouseOver = C, L.onMouseOut = k), /* @__PURE__ */ s.jsxs(s.Fragment, {
1614
- children: [typeof a == "function" ? a(L) : /* @__PURE__ */ Yt(a, L), /* @__PURE__ */ s.jsx(gs, {
1615
- ...u,
1616
- show: x,
1617
- onHide: O,
1618
- flip: f,
1619
- placement: c,
1620
- popperConfig: r,
1621
- target: m.current,
1622
- children: e
1623
- })]
1624
- });
1625
- };
1626
- function Vt(t) {
1627
- const { profile_photo: e, width: a, alt: r, hideDefault: n, activityStatus: l, user_id: i } = t;
1628
- return e?.key ? /* @__PURE__ */ s.jsxs(
1629
- "div",
1630
- {
1631
- "data-using-react-profile-photo": "true",
1632
- className: `profile-photo-wrap ${a ? "" : "w-100 h-100"}`,
1633
- style: {
1634
- ...a && {
1635
- width: a,
1636
- height: a
1637
- }
1638
- },
1639
- children: [
1640
- /* @__PURE__ */ s.jsx(
1641
- Wt,
1642
- {
1643
- activityStatus: l,
1644
- user_id: i
1645
- }
1646
- ),
1647
- /* @__PURE__ */ s.jsx(
1648
- "img",
1649
- {
1650
- className: "w-100 h-100",
1651
- src: `${process.env.NEXT_PUBLIC_CDN}${e.key}`,
1652
- style: { objectFit: "contain" },
1653
- alt: r || "Profile photo of a user"
1654
- }
1655
- )
1656
- ]
1657
- }
1658
- ) : /* @__PURE__ */ s.jsxs(
1659
- "div",
1660
- {
1661
- "data-using-react-profile-photo": "true",
1662
- className: ue(
1663
- "profile-photo-wrap",
1664
- {
1665
- "w-100 h-100": !a,
1666
- "d-none": n
1667
- }
1668
- ),
1669
- style: {
1670
- ...a && {
1671
- width: a,
1672
- height: a
1673
- }
1674
- },
1675
- children: [
1676
- /* @__PURE__ */ s.jsx(
1677
- Wt,
1678
- {
1679
- activityStatus: l,
1680
- user_id: i
1681
- }
1682
- ),
1683
- /* @__PURE__ */ s.jsx(
1684
- "img",
1685
- {
1686
- className: "w-100 h-100",
1687
- src: `${process.env.NEXT_PUBLIC_CDN}profile_photos/starter/articles.jpg`,
1688
- style: { objectFit: "contain" },
1689
- alt: r || "Profile photo of a user"
1690
- }
1691
- )
1692
- ]
1693
- }
1694
- );
1695
- }
1696
- function Wt({
1697
- activityStatus: t,
1698
- user_id: e
1699
- }) {
1700
- if (!(!t || !e))
1701
- return /* @__PURE__ */ s.jsx(
1702
- "div",
1703
- {
1704
- "data-user_id": e,
1705
- className: ue(
1706
- "online-status",
1707
- {
1708
- "status-online": t?.status == "Online" || e == "630f0b337c52851e754b03f7",
1709
- "status-offline": t?.status == "Offline",
1710
- "status-away": t?.status == "Away",
1711
- // Maybe one day show that friends are in a game or on a page if they want to share, we already collect this data anyway!
1712
- "activity-active": !1
1713
- }
1714
- )
1715
- }
1716
- );
1717
- }
1718
- const ur = (t) => (e, a, r) => (r.revalidateOnFocus = !1, r.revalidateIfStale = !1, r.revalidateOnReconnect = !1, t(e, a, r)), fr = As(Zt, ur), pr = (t) => es.get(t.url, {
1719
- params: {
1720
- user_id: t.user_id
1721
- }
1722
- }).then((e) => e.data), mr = {
1723
- dedupingInterval: 1e3 * 60 * 1,
1724
- focusThrottleInterval: 1e3 * 60 * 1
1725
- // fallbackData: []
1726
- }, Ht = (t) => {
1727
- const { data: e, error: a, isLoading: r, isValidating: n, mutate: l } = fr(
1728
- t?.user_id ? {
1729
- url: process.env.NODE_ENV === "development" ? "http://localhost:3001/api/user-public/getUserDetails" : "https://articles.media/api/user-public/getUserDetails",
1730
- // "/api/user-public/getUserDetails",
1731
- user_id: t.user_id
1732
- } : null,
1733
- pr,
1734
- mr
1735
- );
1736
- return {
1737
- data: e,
1738
- error: a,
1739
- isLoading: r,
1740
- isValidating: n,
1741
- mutate: l
1742
- };
1743
- };
1744
- function et({ className: t, noOutline: e, children: a, inline: r }) {
1745
- const [l, i] = A();
1746
- if (X(() => {
1747
- i(!0);
1748
- }, []), a && (!1)?.roles?.isDev && l)
1749
- return /* @__PURE__ */ s.jsx("div", { className: `is-dev-content ${e && "no-outline"} ${t} ${r && "d-inline-block"}`, children: a });
1750
- }
1751
- function hr(t, e) {
1752
- let a = 0;
1753
- return ee.Children.map(t, (r) => /* @__PURE__ */ ee.isValidElement(r) ? e(r, a++) : r);
1754
- }
1755
- const zt = 1e3;
1756
- function vr(t, e, a) {
1757
- const r = (t - e) / (a - e) * 100;
1758
- return Math.round(r * zt) / zt;
1759
- }
1760
- function Xt({
1761
- min: t,
1762
- now: e,
1763
- max: a,
1764
- label: r,
1765
- visuallyHidden: n,
1766
- striped: l,
1767
- animated: i,
1768
- className: o,
1769
- style: c,
1770
- variant: f,
1771
- bsPrefix: u,
1772
- ...m
1773
- }, h) {
1774
- return /* @__PURE__ */ s.jsx("div", {
1775
- ref: h,
1776
- ...m,
1777
- role: "progressbar",
1778
- className: ue(o, `${u}-bar`, {
1779
- [`bg-${f}`]: f,
1780
- [`${u}-bar-animated`]: i,
1781
- [`${u}-bar-striped`]: i || l
1782
- }),
1783
- style: {
1784
- width: `${vr(e, t, a)}%`,
1785
- ...c
1786
- },
1787
- "aria-valuenow": e,
1788
- "aria-valuemin": t,
1789
- "aria-valuemax": a,
1790
- children: n ? /* @__PURE__ */ s.jsx("span", {
1791
- className: "visually-hidden",
1792
- children: r
1793
- }) : r
1794
- });
1795
- }
1796
- const Z = /* @__PURE__ */ ee.forwardRef(({
1797
- isChild: t = !1,
1798
- ...e
1799
- }, a) => {
1800
- const r = {
1801
- min: 0,
1802
- max: 100,
1803
- animated: !1,
1804
- visuallyHidden: !1,
1805
- striped: !1,
1806
- ...e
1807
- };
1808
- if (r.bsPrefix = ve(r.bsPrefix, "progress"), t)
1809
- return Xt(r, a);
1810
- const {
1811
- min: n,
1812
- now: l,
1813
- max: i,
1814
- label: o,
1815
- visuallyHidden: c,
1816
- striped: f,
1817
- animated: u,
1818
- bsPrefix: m,
1819
- variant: h,
1820
- className: d,
1821
- children: v,
1822
- ...x
1823
- } = r;
1824
- return /* @__PURE__ */ s.jsx("div", {
1825
- ref: a,
1826
- ...x,
1827
- className: ue(d, m),
1828
- children: v ? hr(v, (p) => /* @__PURE__ */ Yt(p, {
1829
- isChild: !0
1830
- })) : Xt({
1831
- min: n,
1832
- now: l,
1833
- max: i,
1834
- label: o,
1835
- visuallyHidden: c,
1836
- striped: f,
1837
- animated: u,
1838
- bsPrefix: m,
1839
- variant: h
1840
- }, a)
1841
- });
1842
- });
1843
- Z.displayName = "ProgressBar";
1844
- const ne = {
1845
- SIGN_IN: "/login",
1846
- SIGN_UP: "/signup",
1847
- HOME: "/",
1848
- PROPOSALS: "/politics/proposals",
1849
- PROPOSALS_SUBMISSIONS_ALL: "/politics/proposals/submissions",
1850
- STORIES: "/news/stories",
1851
- ISSUES: "/news/issues",
1852
- MYTHS: "/news/myths"
1853
- // ... other routes
1854
- };
1855
- function xr({
1856
- activeLayoutProposalSentiments: t,
1857
- populated_user: e,
1858
- usersProposalSentiments: a,
1859
- setShowFullStanceDetails: r,
1860
- showFullStanceDetails: n,
1861
- userData: l
1862
- }) {
1863
- return /* @__PURE__ */ s.jsx("div", { className: "row mx-0 mb-2", children: [
1864
- {
1865
- name: `${e?.display_name || l.display_name}`,
1866
- data: t || {}
1867
- },
1868
- {
1869
- name: "You",
1870
- data: a || {}
1871
- }
1872
- ].map((i) => i.name == "You" ? /* @__PURE__ */ s.jsx("div", { className: "col-lg-6 px-1", children: /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm h-100", children: [
1873
- /* @__PURE__ */ s.jsx("div", { className: "card-header", children: /* @__PURE__ */ s.jsx("b", { children: i.name }) }),
1874
- /* @__PURE__ */ s.jsx("div", { className: "card-body p-2", children: /* @__PURE__ */ s.jsx("small", { children: "Login or create an account to compare your political stance with this user!" }) }),
1875
- /* @__PURE__ */ s.jsxs("div", { className: "card-footer", children: [
1876
- /* @__PURE__ */ s.jsx(Y, { href: ne.SIGN_IN, children: /* @__PURE__ */ s.jsx(P, { small: !0, className: "", children: "Sign In" }) }),
1877
- /* @__PURE__ */ s.jsx(Y, { href: ne.SIGN_UP, children: /* @__PURE__ */ s.jsx(P, { small: !0, className: "", children: "Sign Up" }) })
1878
- ] })
1879
- ] }) }, i.name) : /* @__PURE__ */ s.jsx("div", { className: "col-lg-6 px-1", children: /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm", children: [
1880
- /* @__PURE__ */ s.jsx(
1881
- "div",
1882
- {
1883
- className: "card-header",
1884
- onClick: () => {
1885
- console.log(i.data);
1886
- },
1887
- children: /* @__PURE__ */ s.jsx("b", { children: i.name })
1888
- }
1889
- ),
1890
- /* @__PURE__ */ s.jsxs("div", { className: "card-body py-2 px-2 small", children: [
1891
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1892
- /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
1893
- "Fundamental: ",
1894
- i?.data?.fundamental?.filter((o) => i.data?.user_sentiments?.find((c) => c.proposal_id == o._id) ? o : null).length,
1895
- "/",
1896
- i?.data?.fundamental?.length
1897
- ] }),
1898
- /* @__PURE__ */ s.jsx(Z, { striped: !0, variant: "dark", className: "shadow-articles mb-2", now: (i.data?.fundamental?.filter((o) => i.data?.user_sentiments?.find((c) => c.proposal_id == o._id) ? o : null).length / i.data?.fundamental?.length * 100).toFixed(2), label: `${(i.data?.fundamental?.filter((o) => i.data?.user_sentiments?.find((c) => c.proposal_id == o._id) ? o : null).length / i.data?.fundamental?.length * 100).toFixed(2)}%` }),
1899
- /* @__PURE__ */ s.jsxs(Z, { className: "shadow-articles mb-2", style: { height: "10px" }, children: [
1900
- /* @__PURE__ */ s.jsx(Z, { striped: !0, variant: "danger", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Disagree" && o.populated_proposal.fundamental)?.length / i.data?.fundamental?.length * 100).toFixed(2) }),
1901
- /* @__PURE__ */ s.jsx(Z, { striped: !0, variant: "warning", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Needs Work" && o.populated_proposal.fundamental)?.length / i.data?.fundamental?.length * 100).toFixed(2) }),
1902
- /* @__PURE__ */ s.jsx(Z, { striped: !0, variant: "success", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Agree" && o.populated_proposal.fundamental)?.length / i.data?.fundamental?.length * 100).toFixed(2) })
1903
- ] }),
1904
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1905
- "Disagree: ",
1906
- i.data?.user_sentiments?.filter((o) => {
1907
- let c = i.data?.fundamental.find((f) => f._id == o.proposal_id);
1908
- return o.sentiment_status == "Disagree" && c;
1909
- })?.length || 0
1910
- ] }),
1911
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1912
- "Needs Work: ",
1913
- i.data?.user_sentiments?.filter((o) => {
1914
- let c = i.data?.fundamental.find((f) => f._id == o.proposal_id);
1915
- return o.sentiment_status == "Needs Work" && c;
1916
- })?.length || 0
1917
- ] }),
1918
- /* @__PURE__ */ s.jsxs("div", { className: "mb-2", children: [
1919
- "Agree: ",
1920
- i.data?.user_sentiments?.filter((o) => {
1921
- let c = i.data?.fundamental.find((f) => f._id == o.proposal_id);
1922
- return o.sentiment_status == "Agree" && c;
1923
- })?.length || 0
1924
- ] })
1925
- ] }),
1926
- !n && /* @__PURE__ */ s.jsx("span", { onClick: () => r(!0), className: "badge bg-articles-secondary shadow-articles badge-hover", children: "View More" }),
1927
- n && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
1928
- /* @__PURE__ */ s.jsx("hr", {}),
1929
- /* @__PURE__ */ s.jsxs("div", { className: "mb-2", children: [
1930
- /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
1931
- "All: ",
1932
- i.data?.user_sentiments?.length,
1933
- "/",
1934
- i.data?.total
1935
- ] }),
1936
- /* @__PURE__ */ s.jsx(Z, { striped: !0, animated: !0, variant: "dark", className: "shadow-articles mb-1", now: (i.data?.user_sentiments?.length / i.data?.total * 100).toFixed(2), label: `${(i.data?.user_sentiments?.length / i.data?.total * 100).toFixed(2)}%` }),
1937
- /* @__PURE__ */ s.jsxs(Z, { className: "shadow-articles mb-2", style: { height: "10px" }, children: [
1938
- /* @__PURE__ */ s.jsx(Z, { striped: !0, animated: !0, variant: "danger", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Disagree")?.length / i.data?.total * 100).toFixed(2) }),
1939
- /* @__PURE__ */ s.jsx(Z, { striped: !0, animated: !0, variant: "warning", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Needs Work")?.length / i.data?.total * 100).toFixed(2) }),
1940
- /* @__PURE__ */ s.jsx(Z, { striped: !0, animated: !0, variant: "success", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Agree")?.length / i.data?.total * 100).toFixed(2) })
1941
- ] }),
1942
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1943
- "Disagree: ",
1944
- i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Disagree")?.length || 0
1945
- ] }),
1946
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1947
- "Needs Work: ",
1948
- i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Needs Work")?.length || 0
1949
- ] }),
1950
- /* @__PURE__ */ s.jsxs("div", { className: "mb-2", children: [
1951
- "Agree: ",
1952
- i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Agree")?.length || 0
1953
- ] })
1954
- ] }),
1955
- /* @__PURE__ */ s.jsx("hr", {}),
1956
- /* @__PURE__ */ s.jsx("p", { className: "mb-0", children: /* @__PURE__ */ s.jsxs("div", { className: "row", children: [
1957
- /* @__PURE__ */ s.jsx("div", { className: "col-9", children: "Comments" }),
1958
- /* @__PURE__ */ s.jsx("div", { className: "col-3", children: /* @__PURE__ */ s.jsx("b", { children: i.data?.user_comments?.length || 0 }) }),
1959
- /* @__PURE__ */ s.jsx("div", { className: "col-9", children: "Submissions" }),
1960
- /* @__PURE__ */ s.jsx("div", { className: "col-3", children: /* @__PURE__ */ s.jsx("b", { children: i.data?.user_submissions }) })
1961
- ] }) })
1962
- ] })
1963
- ] })
1964
- ] }) }, i.name)) });
1965
- }
1966
- function gr({
1967
- activeLayoutProposalSentiments: t
1968
- }) {
1969
- return /* @__PURE__ */ s.jsx("div", { children: t.user_comments?.filter((e) => !e.parent_id).map((e) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm border mb-2", children: [
1970
- /* @__PURE__ */ s.jsxs("div", { className: "card-header small", children: [
1971
- "Commented on ",
1972
- /* @__PURE__ */ s.jsx("b", { children: e.populated_proposal.title })
1973
- ] }),
1974
- /* @__PURE__ */ s.jsx("div", { className: "card-body small p-2", children: /* @__PURE__ */ s.jsxs("div", { children: [
1975
- /* @__PURE__ */ s.jsx("span", { className: "small", children: Te(new Date(e.date), "M/dd/yy") }),
1976
- /* @__PURE__ */ s.jsx("div", { children: e.comment })
1977
- ] }) }),
1978
- /* @__PURE__ */ s.jsx("div", { className: "card-footer", children: /* @__PURE__ */ s.jsx(Y, { prefetch: !1, href: `${ne.PROPOSALS}/${e.populated_proposal.url}?interaction_id=${e._id}`, children: /* @__PURE__ */ s.jsx(
1979
- P,
1980
- {
1981
- small: !0,
1982
- children: "View"
1983
- }
1984
- ) }) })
1985
- ] }, e._id)) });
1986
- }
1987
- function br({
1988
- activeLayoutProposalSentiments: t
1989
- }) {
1990
- return /* @__PURE__ */ s.jsx("div", { children: t.user_sentiments?.map((e) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm border mb-2", children: [
1991
- /* @__PURE__ */ s.jsxs("div", { className: "card-header small", children: [
1992
- "Gave their sentiment on ",
1993
- /* @__PURE__ */ s.jsx("b", { children: e.populated_proposal.title })
1994
- ] }),
1995
- /* @__PURE__ */ s.jsxs("div", { className: "card-body small p-2", children: [
1996
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center border-bottom pb-1", children: [
1997
- e.sentiment_status == "Agree" && /* @__PURE__ */ s.jsx("div", { className: "badge shadow-articles bg-success", children: "Agree" }),
1998
- e.sentiment_status == "Needs Work" && /* @__PURE__ */ s.jsx("div", { className: "badge shadow-articles bg-warning text-dark", children: "Needs Work" }),
1999
- e.sentiment_status == "Disagree" && /* @__PURE__ */ s.jsx("div", { className: "badge shadow-articles bg-danger", children: "Disagree" }),
2000
- /* @__PURE__ */ s.jsx("span", { className: "small ms-2", children: Te(new Date(e.date), "M/dd/yy") })
2001
- ] }),
2002
- /* @__PURE__ */ s.jsx("div", { className: "mt-1", children: e.comment })
2003
- ] }),
2004
- /* @__PURE__ */ s.jsx("div", { className: "card-footer", children: /* @__PURE__ */ s.jsx(
2005
- Y,
2006
- {
2007
- prefetch: !1,
2008
- href: `https://articles.media/politics/proposals/${e.populated_proposal.url}?interaction_id=${e._id}`,
2009
- children: /* @__PURE__ */ s.jsx(
2010
- P,
2011
- {
2012
- small: !0,
2013
- children: "View"
2014
- }
2015
- )
2016
- }
2017
- ) })
2018
- ] }, e._id)) });
2019
- }
2020
- function jr({
2021
- activeLayoutProposalSentiments: t,
2022
- userProposalsSubmitted: e
2023
- }) {
2024
- const [a, r] = A(!1);
2025
- return /* @__PURE__ */ s.jsxs("div", { children: [
2026
- /* @__PURE__ */ s.jsx("div", { className: "mb-2", children: e?.slice(0, a ? 100 : 1).map((n) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm shadow-articles", children: [
2027
- /* @__PURE__ */ s.jsx("div", { className: "card-body p-2 lh-sm d-flex align-items-center", children: /* @__PURE__ */ s.jsxs("div", { className: "ms-2", children: [
2028
- /* @__PURE__ */ s.jsx("div", { children: n.title }),
2029
- /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
2030
- n.type,
2031
- n.fundamental && " - Fundamental"
2032
- ] })
2033
- ] }) }),
2034
- /* @__PURE__ */ s.jsx("div", { className: "card-footer d-flex", children: /* @__PURE__ */ s.jsx(
2035
- Y,
2036
- {
2037
- href: `${ne.PROPOSALS_SUBMISSIONS_ALL}/${n._id}`,
2038
- className: "",
2039
- children: /* @__PURE__ */ s.jsx(P, { small: !0, children: /* @__PURE__ */ s.jsxs("span", { children: [
2040
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-eye me-1" }),
2041
- "View"
2042
- ] }) })
2043
- }
2044
- ) })
2045
- ] }, n._id)) }),
2046
- e?.length > 1 && /* @__PURE__ */ s.jsx(
2047
- P,
2048
- {
2049
- onClick: () => r(!a),
2050
- className: "w-100",
2051
- children: a ? "View Less" : "View All"
2052
- }
2053
- ),
2054
- e?.length == 0 && /* @__PURE__ */ s.jsx("span", { className: "small", children: "User has no proposal submissions" })
2055
- ] });
2056
- }
2057
- function yr(t) {
2058
- const { featured_image: e, thumbnail_size: a } = t;
2059
- return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2060
- (e?.image_type == "S3 File System" || e?.thumbnails?.length > 0) && /* @__PURE__ */ s.jsx(s.Fragment, { children: e?.thumbnails?.length > 0 ? /* @__PURE__ */ s.jsx(s.Fragment, { children: a && e?.thumbnails?.find((r) => r.width == a) ? /* @__PURE__ */ s.jsx(
2061
- "img",
2062
- {
2063
- style: {
2064
- width: "100%",
2065
- height: "100%",
2066
- objectFit: "cover"
2067
- },
2068
- src: process.env.NEXT_PUBLIC_CDN + e?.thumbnails?.find((r) => r.width == a).key,
2069
- loading: "lazy",
2070
- alt: "",
2071
- className: "flex-shrink-0"
2072
- }
2073
- ) : /* @__PURE__ */ s.jsx(
2074
- "img",
2075
- {
2076
- style: {
2077
- width: "100%",
2078
- height: "100%",
2079
- objectFit: "cover"
2080
- },
2081
- src: process.env.NEXT_PUBLIC_CDN + [...e?.thumbnails].sort((r, n) => r.width - n.width)[0].key,
2082
- loading: "lazy",
2083
- alt: "",
2084
- className: "flex-shrink-0"
2085
- }
2086
- ) }) : /* @__PURE__ */ s.jsx(
2087
- "img",
2088
- {
2089
- style: {
2090
- width: "100%",
2091
- height: "100%",
2092
- objectFit: "cover"
2093
- },
2094
- src: process.env.NEXT_PUBLIC_CDN + e?.key,
2095
- loading: "lazy",
2096
- alt: "",
2097
- className: "flex-shrink-0"
2098
- }
2099
- ) }),
2100
- e?.location && !e?.image_type && (e?.thumbnails?.length || 0) < 1 && /* @__PURE__ */ s.jsx(
2101
- "img",
2102
- {
2103
- style: { objectFit: "cover", width: "100%", height: "100%" },
2104
- src: `${process.env.NEXT_PUBLIC_CDN}${e?.key}`,
2105
- alt: "",
2106
- loading: "lazy"
2107
- }
2108
- )
2109
- ] });
2110
- }
2111
- function wr(t) {
2112
- switch (t) {
2113
- case "story":
2114
- return ne.STORIES;
2115
- // break;
2116
- case "issue":
2117
- return ne.ISSUES;
2118
- // break;
2119
- case "myth":
2120
- return ne.MYTHS;
2121
- }
2122
- }
2123
- function Nr({
2124
- publicUserData: t
2125
- }) {
2126
- return /* @__PURE__ */ s.jsx("div", { children: t?.populated_news_comments?.filter((e) => !e.parent_id).map((e) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm border mb-2", children: [
2127
- /* @__PURE__ */ s.jsxs("div", { className: "card-header small", children: [
2128
- "Commented on ",
2129
- /* @__PURE__ */ s.jsx("b", { children: e.populated_news?.news_title })
2130
- ] }),
2131
- /* @__PURE__ */ s.jsxs("div", { className: "card-body small p-2 d-flex", children: [
2132
- /* @__PURE__ */ s.jsx(
2133
- "div",
2134
- {
2135
- style: {
2136
- width: "100px",
2137
- height: "100px"
2138
- },
2139
- className: "me-2 flex-shrink-0",
2140
- children: /* @__PURE__ */ s.jsx(
2141
- yr,
2142
- {
2143
- featured_image: e?.populated_news?.featured_image,
2144
- thumbnail_size: 100
2145
- }
2146
- )
2147
- }
2148
- ),
2149
- /* @__PURE__ */ s.jsxs("div", { children: [
2150
- /* @__PURE__ */ s.jsx("span", { className: "small", children: Te(new Date(e.date), "M/dd/yy") }),
2151
- /* @__PURE__ */ s.jsx("div", { children: e.comment })
2152
- ] })
2153
- ] }),
2154
- /* @__PURE__ */ s.jsx("div", { className: "card-footer", children: /* @__PURE__ */ s.jsx(Y, { prefetch: !1, href: `${wr(e.populated_news?.news_type)}/${e.populated_news?.url}?interaction_id=${e._id}`, children: /* @__PURE__ */ s.jsx(
2155
- P,
2156
- {
2157
- small: !0,
2158
- children: "View"
2159
- }
2160
- ) }) })
2161
- ] }, e._id)) });
2162
- }
2163
- function _r({
2164
- userNewsSubmitted: t
2165
- }) {
2166
- const [e, a] = A(!1);
2167
- return /* @__PURE__ */ s.jsxs("div", { children: [
2168
- /* @__PURE__ */ s.jsxs("div", { className: "mb-1 d-flex justify-content-between align-items-center", children: [
2169
- /* @__PURE__ */ s.jsxs("span", { children: [
2170
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-newspaper me-1" }),
2171
- /* @__PURE__ */ s.jsxs("span", { children: [
2172
- /* @__PURE__ */ s.jsx("span", { children: "News Submissions: " }),
2173
- /* @__PURE__ */ s.jsx("span", { className: "badge bg-dark", children: t?.length || 0 })
2174
- ] })
2175
- ] }),
2176
- /* @__PURE__ */ s.jsxs("span", { className: "badge bg-articles-secondary", children: [
2177
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-info me-1" }),
2178
- /* @__PURE__ */ s.jsx("span", { children: "Info" })
2179
- ] })
2180
- ] }),
2181
- /* @__PURE__ */ s.jsx("div", { className: "mb-1", children: t?.slice(0, e ? 100 : 1).map((r) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles shadow-articles", children: [
2182
- /* @__PURE__ */ s.jsxs("div", { className: "card-body py-1 px-2 lh-sm d-flex align-items-center", children: [
2183
- /* @__PURE__ */ s.jsx("img", { className: "", src: r?.featured_image?.location, width: "40px", height: "40px", style: { objectFit: "cover" }, alt: "" }),
2184
- /* @__PURE__ */ s.jsx("div", { className: "ms-2", children: /* @__PURE__ */ s.jsx("div", { children: r.news_title }) })
2185
- ] }),
2186
- /* @__PURE__ */ s.jsx("div", { className: "card-footer d-flex p-1", children: /* @__PURE__ */ s.jsx(Y, { href: `${ne.HOME}/${r.url}`, children: /* @__PURE__ */ s.jsxs(P, { small: !0, className: "", children: [
2187
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-eye me-1" }),
2188
- "View"
2189
- ] }) }) })
2190
- ] }, r._id)) }),
2191
- t?.length > 1 ? /* @__PURE__ */ s.jsx(P, { onClick: () => a(!e), small: !0, className: "", children: e ? "View Less" : "View All" }) : /* @__PURE__ */ s.jsx("span", { className: "small", children: "User has no news submissions" })
2192
- ] });
2193
- }
2194
- function Or({
2195
- activeLayoutProposalSentiments: t,
2196
- userDonations: e,
2197
- lifetimeContribution: a
2198
- }) {
2199
- const [r, n] = A(!1);
2200
- return /* @__PURE__ */ s.jsxs("div", { className: "card card-articles ", children: [
2201
- /* @__PURE__ */ s.jsxs("div", { className: "card-header d-flex justify-content-between align-items-center p-1", children: [
2202
- /* @__PURE__ */ s.jsx("span", { children: "Donations: " }),
2203
- /* @__PURE__ */ s.jsxs("span", { className: "badge bg-dark", children: [
2204
- e.count,
2205
- " - ",
2206
- `$${tt((a / 100 || 0).toFixed(2))}`
2207
- ] })
2208
- ] }),
2209
- /* @__PURE__ */ s.jsxs("div", { className: "card-body p-2", children: [
2210
- e?.list?.length == 0 && /* @__PURE__ */ s.jsx("span", { className: "small", children: "User has no donations" }),
2211
- /* @__PURE__ */ s.jsx("div", { className: "donations-wrap", children: e?.list?.slice(0, r ? 100 : 3).map((l) => /* @__PURE__ */ s.jsxs("div", { className: "border", children: [
2212
- /* @__PURE__ */ s.jsxs("div", { className: "card-body py-1 px-2 lh-sm d-flex align-items-center", children: [
2213
- /* @__PURE__ */ s.jsx("div", { className: "small", children: "Most Recent" }),
2214
- /* @__PURE__ */ s.jsxs("div", { className: "ms-2 d-flex align-items-center", children: [
2215
- /* @__PURE__ */ s.jsx("div", { className: "h4 mb-0 me-2", children: `$${tt((l.amount / 100).toFixed(2))}` }),
2216
- /* @__PURE__ */ s.jsx("div", { className: "small", children: Te(new Date(l.date), "M/dd/yy") })
2217
- ] })
2218
- ] }),
2219
- /* @__PURE__ */ s.jsx("div", { className: "card-footer d-flex p-1", children: /* @__PURE__ */ s.jsx(Y, { href: `${ne.HOME}/${l.url}`, children: /* @__PURE__ */ s.jsxs(
2220
- P,
2221
- {
2222
- className: "",
2223
- small: !0,
2224
- children: [
2225
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-eye me-1" }),
2226
- "View"
2227
- ]
2228
- }
2229
- ) }) })
2230
- ] }, l._id)) })
2231
- ] }),
2232
- /* @__PURE__ */ s.jsx("div", { className: "card-footer p-1 d-flex justify-content-center", children: e.count > 1 && /* @__PURE__ */ s.jsx(
2233
- P,
2234
- {
2235
- onClick: () => {
2236
- n(!r);
2237
- },
2238
- className: "w-100",
2239
- children: r ? "View Less" : "View All"
2240
- }
2241
- ) })
2242
- ] });
2243
- }
2244
- function Sr({
2245
- userLayoutsData: t,
2246
- handleClose: e
2247
- }) {
2248
- return /* @__PURE__ */ s.jsx("div", { children: t?.map((r) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles shadow-articles", children: [
2249
- /* @__PURE__ */ s.jsx("div", { className: "card-body py-1 px-2 lh-sm d-flex align-items-center", children: /* @__PURE__ */ s.jsxs("div", { className: "ms-2", children: [
2250
- /* @__PURE__ */ s.jsx("div", { children: r.name }),
2251
- /* @__PURE__ */ s.jsx("div", { className: "small", children: "Last Viewed: Never" })
2252
- ] }) }),
2253
- /* @__PURE__ */ s.jsxs("div", { className: "card-footer d-flex p-1", children: [
2254
- (!1)._id !== r.user_id && /* @__PURE__ */ s.jsxs(
2255
- P,
2256
- {
2257
- className: "",
2258
- small: !0,
2259
- children: [
2260
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-plus me-1" }),
2261
- "Follow"
2262
- ]
2263
- }
2264
- ),
2265
- /* @__PURE__ */ s.jsx(
2266
- Y,
2267
- {
2268
- href: `${ne.HOME}/${r.url}`,
2269
- children: /* @__PURE__ */ s.jsxs(
2270
- P,
2271
- {
2272
- className: "",
2273
- small: !0,
2274
- children: [
2275
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-eye me-1" }),
2276
- "View"
2277
- ]
2278
- }
2279
- )
2280
- }
2281
- )
2282
- ] })
2283
- ] }, r._id)) });
2284
- }
2285
- function Dr({
2286
- activeLayoutProposalSentiments: t,
2287
- userData: e
2288
- }) {
2289
- return /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsx("div", { className: "", children: e?.verified?.verified_methods?.map((a, r) => Object.keys(a)?.length > 0 ? /* @__PURE__ */ s.jsxs(
2290
- "div",
2291
- {
2292
- className: "card card-articles card-sm object mb-2",
2293
- children: [
2294
- /* @__PURE__ */ s.jsx("div", { className: "card-header", children: a?.method_name }),
2295
- /* @__PURE__ */ s.jsx("div", { className: "card-body p-2", children: /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
2296
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center", children: [
2297
- /* @__PURE__ */ s.jsx("span", { className: "me-2", children: "Approved On: " }),
2298
- /* @__PURE__ */ s.jsx(Kt, { date: a.approved_date })
2299
- ] }),
2300
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center", children: [
2301
- /* @__PURE__ */ s.jsx("span", { className: "me-2", children: "Approved By: " }),
2302
- /* @__PURE__ */ s.jsx($r, { user_id: a.approved_by, dangerousPopulate: !0 })
2303
- ] })
2304
- ] }) })
2305
- ]
2306
- },
2307
- r
2308
- ) : /* @__PURE__ */ s.jsx(
2309
- "div",
2310
- {
2311
- className: "single",
2312
- children: a
2313
- },
2314
- r
2315
- )) }) });
2316
- }
2317
- const Pr = [];
2318
- function Er({
2319
- activeLayoutProposalSentiments: t
2320
- }) {
2321
- return /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsx("div", { className: "achievements card card-articles", children: /* @__PURE__ */ s.jsx("div", { className: "card-body p-0", children: Pr.map(
2322
- (e) => /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsxs("div", { className: "achievement w-100 d-flex align-items-center", children: [
2323
- /* @__PURE__ */ s.jsx("div", { className: "icon", style: { width: "50px" }, children: /* @__PURE__ */ s.jsx("i", { className: `fad ${e.icon} fa-lg` }) }),
2324
- /* @__PURE__ */ s.jsxs("div", { className: "details small me-auto", children: [
2325
- /* @__PURE__ */ s.jsx("b", { className: "name", children: e.name }),
2326
- /* @__PURE__ */ s.jsx("div", { className: "description mb-1", children: e.description }),
2327
- /* @__PURE__ */ s.jsx("div", { className: "small", children: e.tags?.map((a) => /* @__PURE__ */ s.jsx("span", { className: "badge bg-dark border", children: a }, a)) })
2328
- ] }),
2329
- /* @__PURE__ */ s.jsx("div", { className: "icon border-end-0 border-start border-dark", children: /* @__PURE__ */ s.jsx("div", { className: "text-center px-3", children: /* @__PURE__ */ s.jsx("i", { className: "fad fa-square fa-lg me-0" }) }) })
2330
- ] }) }, e.name)
2331
- ) }) }) });
2332
- }
2333
- const Ar = (t) => es.get(t).then((e) => e.data), Cr = (t) => {
2334
- const { data: e, error: a, isLoading: r, mutate: n } = Zt(
2335
- process.env.NODE_ENV === "development" ? "http://localhost:3001/api/news/resources/political-parties" : "https://articles.media/api/news/resources/political-parties",
2336
- Ar,
2337
- {
2338
- dedupingInterval: 6e5
2339
- // fallbackData: []
2340
- }
2341
- );
2342
- return {
2343
- data: e,
2344
- error: a,
2345
- isLoading: r,
2346
- mutate: n
2347
- };
2348
- };
2349
- function $r(t) {
2350
- const {
2351
- populated_user: e,
2352
- hidePhoto: a,
2353
- visibleItems: r,
2354
- size: n,
2355
- className: l,
2356
- dangerousPopulate: i,
2357
- user_id: o,
2358
- buttonType: c,
2359
- children: f,
2360
- fakeMembership: u
2361
- // name
2362
- } = t, [m, h] = A(!1), [d, v] = A({}), [x, p] = A([]), [j, g] = A([]), [N, b] = A(null), [_, w] = A([]), [O, $] = A([]), [M, E] = A(!1), C = !1, { data: k } = Cr(), [S, L] = A("Proposals Stance"), R = () => {
2363
- h(!1);
2364
- };
2365
- X(() => {
2366
- e && v({
2367
- ...e
2368
- });
2369
- }, []);
2370
- const [F, I] = A(!1), [fe, ie] = A([]), [oe, Oe] = A([]), { data: D, mutate: ge } = Ht(
2371
- (o || e?._id) && (m || i) ? {
2372
- user_id: o || e?._id
2373
- } : null
2374
- ), { data: H, mutate: te } = Ht(
2375
- C?._id && (m || i) ? {
2376
- user_id: C?._id
2377
- } : null
2378
- );
2379
- X(() => {
2380
- D && (console.log("publicUserData", D), v(D), p(D?.populated_public_layouts), g(D?.populated_public_donations), b(D?.populated_public_donations.total), $(D?.populated_public_proposals), ie(D?.populated_public_proposals_stance), w(D?.populated_public_news_submissions || []));
2381
- }, [D]), X(() => {
2382
- H && (console.log("personalUserData", H), Oe(H?.populated_public_proposals_stance));
2383
- }, [H]);
2384
- let le = (e || d)?.articles_membership?.plan.replace(" ", "-").toLowerCase(), be = u?.replace(" ", "-").toLowerCase();
2385
- const J = "https://articles.media/images/store/memberships/", Se = () => {
2386
- let y = (e || d)?.articles_membership?.status == "Active";
2387
- return /* @__PURE__ */ s.jsxs(
2388
- "div",
2389
- {
2390
- style: {
2391
- position: "relative",
2392
- cursor: "pointer"
2393
- } && (n == "lg" ? { fontSize: "1.5rem" } : {}),
2394
- className: `view-user-modal-badge-wrap ${n == "lg" && "large"} ${l && l}`,
2395
- children: [
2396
- /* @__PURE__ */ s.jsxs(
2397
- "span",
2398
- {
2399
- onClick: () => {
2400
- h(!0);
2401
- },
2402
- className: "position-relative view-user-modal-badge d-flex justify-content-between align-items-center badge bg-articles badge-hover ",
2403
- children: [
2404
- (y || u) && /* @__PURE__ */ s.jsx(
2405
- "i",
2406
- {
2407
- className: `fad membership-badge ${be || le} fa-badge-check`,
2408
- style: {
2409
- position: "absolute",
2410
- // top: '50%',
2411
- top: "-2px",
2412
- left: "-2px",
2413
- // transform: 'translateY(-50%)',
2414
- fontSize: "0.9rem",
2415
- zIndex: 1
2416
- // marginRight: '-0.5rem'
2417
- // color: `${obj.badge_color}!important`
2418
- }
2419
- }
2420
- ),
2421
- /* @__PURE__ */ s.jsxs("div", { className: `d-flex align-items-center ${y && ""}`, children: [
2422
- !a && /* @__PURE__ */ s.jsx("div", { className: n == "lg" ? "me-0" : "me-1", children: /* @__PURE__ */ s.jsx(
2423
- Vt,
2424
- {
2425
- width: "15px",
2426
- profile_photo: d.profile_photo
2427
- }
2428
- ) }),
2429
- d.display_name || e?.display_name
2430
- ] }),
2431
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-plus-square me-0 ms-2" })
2432
- ]
2433
- }
2434
- ),
2435
- r?.includes("Not Verified") && e?.verified?.status !== "Verified" && /* @__PURE__ */ s.jsx(
2436
- ce,
2437
- {
2438
- placement: "bottom",
2439
- overlay: /* @__PURE__ */ s.jsx(Q, { style: { pointerEvents: "none" }, id: "button-tooltip", children: /* @__PURE__ */ s.jsx("div", { className: "", children: "User is not verified" }) }),
2440
- children: /* @__PURE__ */ s.jsxs(
2441
- "span",
2442
- {
2443
- className: "verification-user-badge badge bg-danger d-flex align-items-center",
2444
- children: [
2445
- /* @__PURE__ */ s.jsx("i", { style: { paddingBottom: "2px" }, className: "fas fa-robot me-1" }),
2446
- /* @__PURE__ */ s.jsx("span", { className: "", children: "Unverified" })
2447
- ]
2448
- }
2449
- )
2450
- }
2451
- ),
2452
- // true
2453
- // ||
2454
- // visibleItems?.includes("Membership")
2455
- !1,
2456
- r?.includes("Verification Status") && /* @__PURE__ */ s.jsx(
2457
- ce,
2458
- {
2459
- placement: "bottom",
2460
- overlay: /* @__PURE__ */ s.jsx(
2461
- Q,
2462
- {
2463
- id: "button-tooltip",
2464
- style: { pointerEvents: "none", transformX: "-20px" },
2465
- children: e?.verified?.status == "Verified" ? "Verified" : " Not Verified"
2466
- }
2467
- ),
2468
- children: e?.verified?.status == "Verified" ? /* @__PURE__ */ s.jsx("span", { className: "verification-user-badge badge bg-success cursor-pointer", children: /* @__PURE__ */ s.jsx("i", { className: "fas fa-check me-0" }) }) : /* @__PURE__ */ s.jsxs("span", { className: "verification-user-badge badge bg-danger cursor-pointer", children: [
2469
- /* @__PURE__ */ s.jsx("i", { className: "fas fa-robot me-1" }),
2470
- /* @__PURE__ */ s.jsx("span", { children: "?" })
2471
- ] })
2472
- }
2473
- ),
2474
- r?.includes("Political Party") && /* @__PURE__ */ s.jsx("div", { className: "d-flex", children: (e || d)?.political?.party_id && /* @__PURE__ */ s.jsx(
2475
- ce,
2476
- {
2477
- placement: "bottom",
2478
- overlay: /* @__PURE__ */ s.jsxs(
2479
- Q,
2480
- {
2481
- id: "tooltip-bottom",
2482
- style: { position: "fixed" },
2483
- children: [
2484
- /* @__PURE__ */ s.jsx(
2485
- "img",
2486
- {
2487
- width: "40px",
2488
- height: "40px",
2489
- style: {
2490
- objectFit: "contain",
2491
- padding: "0px",
2492
- zIndex: "10",
2493
- position: "relative"
2494
- },
2495
- loading: "lazy",
2496
- src: `${process.env.NEXT_PUBLIC_CDN}` + k?.find((V) => V._id == (e || d)?.political?.party_id)?.logo,
2497
- alt: ""
2498
- }
2499
- ),
2500
- /* @__PURE__ */ s.jsx(
2501
- "span",
2502
- {
2503
- className: "ms-2",
2504
- children: k?.find((V) => V._id == (e || d)?.political?.party_id)?.name
2505
- }
2506
- )
2507
- ]
2508
- }
2509
- ),
2510
- children: /* @__PURE__ */ s.jsx(
2511
- "div",
2512
- {
2513
- className: "badge bg-light text-capitalize ms-0 h-100 d-flex justify-content-center align-items-center",
2514
- style: {
2515
- padding: "0 0.15rem",
2516
- cursor: "pointer"
2517
- },
2518
- children: (e || d)?.political?.party_id && ((e || d)?.political?.party_id == "62a830440593acbd4061c48c" ? /* @__PURE__ */ s.jsx("i", { className: "fad fa-unlink unaffiliated-icon fa-lg me-0" }) : /* @__PURE__ */ s.jsx(
2519
- "img",
2520
- {
2521
- width: "15px",
2522
- height: "15px",
2523
- style: {
2524
- objectFit: "contain",
2525
- padding: "0px"
2526
- },
2527
- loading: "lazy",
2528
- src: `${process.env.NEXT_PUBLIC_CDN}` + k?.find((V) => V._id == (e || d)?.political?.party_id)?.logo,
2529
- alt: ""
2530
- }
2531
- ))
2532
- }
2533
- )
2534
- }
2535
- ) })
2536
- ]
2537
- }
2538
- );
2539
- };
2540
- function Xe(y) {
2541
- return y === "Link" ? /* @__PURE__ */ s.jsx(
2542
- "span",
2543
- {
2544
- type: "button",
2545
- onClick: () => {
2546
- h(!0);
2547
- },
2548
- children: f
2549
- }
2550
- ) : /* @__PURE__ */ s.jsx(Se, {});
2551
- }
2552
- const [T, je] = A(!1), [De, vt] = A({}), [xt, Ye] = A({});
2553
- X(() => {
2554
- T && Object.keys(De).length == 0 && console.log("adminUserData", H);
2555
- }, [T]);
2556
- const [qe, Ke] = A(null);
2557
- function Ge() {
2558
- alert("TODO");
2559
- }
2560
- const se = Me(() => x?.filter((y) => y.user_layout)?.[0]?.url, [x]);
2561
- return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2562
- Xe(c),
2563
- /* @__PURE__ */ s.jsxs(
2564
- Be,
2565
- {
2566
- show: m,
2567
- size: "lg",
2568
- id: "view-users-modal",
2569
- className: "view-users-modal articles-modal",
2570
- scrollable: !0,
2571
- onHide: R,
2572
- children: [
2573
- /* @__PURE__ */ s.jsx(Be.Header, { closeButton: !0, children: /* @__PURE__ */ s.jsx("div", { className: "w-100 d-flex justify-content-between align-items-center", children: /* @__PURE__ */ s.jsx("h3", { className: "mb-0", children: "User Info" }) }) }),
2574
- /* @__PURE__ */ s.jsx(Be.Body, { children: /* @__PURE__ */ s.jsxs("div", { className: "main-panel", children: [
2575
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex", children: [
2576
- /* @__PURE__ */ s.jsxs(
2577
- "div",
2578
- {
2579
- className: "d-flex flex-column align-items-center",
2580
- style: {
2581
- width: "100px"
2582
- },
2583
- children: [
2584
- /* @__PURE__ */ s.jsx(
2585
- "div",
2586
- {
2587
- type: "button",
2588
- onClick: () => {
2589
- Ke(`${process.env.NEXT_PUBLIC_CDN}${d?.profile_photo?.key}`);
2590
- },
2591
- children: /* @__PURE__ */ s.jsx(
2592
- Vt,
2593
- {
2594
- width: "100px",
2595
- profile_photo: d?.profile_photo
2596
- }
2597
- )
2598
- }
2599
- ),
2600
- /* @__PURE__ */ s.jsx(
2601
- ce,
2602
- {
2603
- placement: "bottom",
2604
- overlay: /* @__PURE__ */ s.jsx(
2605
- Q,
2606
- {
2607
- id: "tooltip-bottom",
2608
- children: "Joined Articles Media"
2609
- }
2610
- ),
2611
- children: /* @__PURE__ */ s.jsxs("div", { className: "badge bg-black border border-white shadow-sm rounded-0", children: [
2612
- "Joined ",
2613
- d?.sign_up_date && Te(new Date(d?.sign_up_date), "M/dd/yy")
2614
- ] })
2615
- }
2616
- ),
2617
- se && /* @__PURE__ */ s.jsx(
2618
- Y,
2619
- {
2620
- href: (
2621
- // `${ROUTES.LAYOUTS}/${userLayoutLink}`
2622
- `https://articles.media/layouts/${se}`
2623
- ),
2624
- className: "mt-2 w-100",
2625
- children: /* @__PURE__ */ s.jsxs(
2626
- P,
2627
- {
2628
- className: "w-100",
2629
- style: {
2630
- // fontSize: '0.75rem'
2631
- },
2632
- children: [
2633
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-home" }),
2634
- /* @__PURE__ */ s.jsx("span", { children: "Layout" })
2635
- ]
2636
- }
2637
- )
2638
- }
2639
- ),
2640
- /* @__PURE__ */ s.jsx(et, { className: "w-100", children: /* @__PURE__ */ s.jsx(
2641
- Y,
2642
- {
2643
- href: {
2644
- // pathname: ROUTES.MESSAGES,
2645
- pathname: "https://articles.media/messages",
2646
- query: {
2647
- startMsg: d?._id
2648
- }
2649
- },
2650
- className: "mt-2 w-100",
2651
- children: /* @__PURE__ */ s.jsxs(
2652
- P,
2653
- {
2654
- className: "w-100",
2655
- style: {
2656
- fontSize: "0.88rem"
2657
- },
2658
- children: [
2659
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-envelope" }),
2660
- /* @__PURE__ */ s.jsx("span", { children: "Message" })
2661
- ]
2662
- }
2663
- )
2664
- }
2665
- ) }),
2666
- T && /* @__PURE__ */ s.jsxs(
2667
- "div",
2668
- {
2669
- className: "d-flex flex-column w-100 mt-2",
2670
- style: {
2671
- maxWidth: "100px"
2672
- },
2673
- children: [
2674
- /* @__PURE__ */ s.jsx(P, { variant: "warning", small: !0, className: "", children: /* @__PURE__ */ s.jsx(Textfit, { max: 14, mode: "single", children: "Remove Photo" }) }),
2675
- De?.user?.profile_photo?.banned_uploads ? /* @__PURE__ */ s.jsx(
2676
- P,
2677
- {
2678
- variant: "warning",
2679
- small: !0,
2680
- className: "",
2681
- onClick: () => {
2682
- toggleBanCustomPhotoUpload();
2683
- },
2684
- children: /* @__PURE__ */ s.jsx(Textfit, { max: 14, mode: "single", children: "Unban Uploads" })
2685
- }
2686
- ) : /* @__PURE__ */ s.jsx(
2687
- P,
2688
- {
2689
- variant: "danger",
2690
- small: !0,
2691
- className: "",
2692
- onClick: () => {
2693
- toggleBanCustomPhotoUpload();
2694
- },
2695
- children: /* @__PURE__ */ s.jsx(Textfit, { max: 14, mode: "single", children: "Ban Uploads" })
2696
- }
2697
- )
2698
- ]
2699
- }
2700
- )
2701
- ]
2702
- }
2703
- ),
2704
- /* @__PURE__ */ s.jsxs("div", { className: "mx-2", children: [
2705
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center mb-1", children: [
2706
- /* @__PURE__ */ s.jsx("h5", { className: "mb-0", children: e?.display_name || d.display_name }),
2707
- /* @__PURE__ */ s.jsxs("span", { className: "ms-2", children: [
2708
- " @",
2709
- d?.username
2710
- ] })
2711
- ] }),
2712
- d?.articles_membership?.status == "Active" && /* @__PURE__ */ s.jsx(
2713
- ce,
2714
- {
2715
- placement: "bottom",
2716
- overlay: /* @__PURE__ */ s.jsx(
2717
- Q,
2718
- {
2719
- id: "tooltip-bottom",
2720
- children: /* @__PURE__ */ s.jsxs("div", { className: "d-flex flex-column py-1", children: [
2721
- /* @__PURE__ */ s.jsxs("div", { className: "position-relative", children: [
2722
- d?.articles_membership?.plan == "Supporter" && /* @__PURE__ */ s.jsx("img", { src: `${J}supporter.jpg`, width: 50, height: 50, alt: "Membership plan level" }),
2723
- d?.articles_membership?.plan == "Premium Supporter" && /* @__PURE__ */ s.jsx("img", { src: `${J}premiumSupporter.jpg`, width: 50, height: 50, alt: "Membership plan level" }),
2724
- d?.articles_membership?.plan == "Advocate" && /* @__PURE__ */ s.jsx("img", { src: `${J}advocate.jpg`, width: 50, height: 50, alt: "Membership plan level" }),
2725
- /* @__PURE__ */ s.jsx(
2726
- "i",
2727
- {
2728
- className: `fad membership-badge ${le} fa-badge-check me-1`,
2729
- style: {
2730
- position: "absolute",
2731
- top: "50%",
2732
- // top: '-2px',
2733
- left: "50%",
2734
- transform: "translateX(-50%) translateY(-50%)",
2735
- fontSize: "1.5rem"
2736
- // marginRight: '-0.5rem'
2737
- // color: `${obj.badge_color}!important`
2738
- }
2739
- }
2740
- )
2741
- ] }),
2742
- /* @__PURE__ */ s.jsxs("span", { className: "lh-sm", children: [
2743
- /* @__PURE__ */ s.jsx("div", { children: d?.articles_membership?.plan }),
2744
- /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
2745
- "Since ",
2746
- /* @__PURE__ */ s.jsx(Kt, { format: "MM/dd/yy", date: d?.articles_membership?.membership_started })
2747
- ] })
2748
- ] })
2749
- ] })
2750
- }
2751
- ),
2752
- children: /* @__PURE__ */ s.jsxs(
2753
- "div",
2754
- {
2755
- className: "badge bg-articles border me-1 mb-1",
2756
- style: {
2757
- // padding: '0 0.25rem',
2758
- cursor: "pointer"
2759
- },
2760
- children: [
2761
- /* @__PURE__ */ s.jsx(
2762
- "i",
2763
- {
2764
- className: `fad membership-badge ${le} fa-badge-check me-1`,
2765
- style: {
2766
- // position: 'absolute',
2767
- // top: '50%',
2768
- // top: '-2px',
2769
- // left: '-2px',
2770
- // transform: 'translateY(-50%)',
2771
- // fontSize: '0.9rem'
2772
- // marginRight: '-0.5rem'
2773
- // color: `${obj.badge_color}!important`
2774
- }
2775
- }
2776
- ),
2777
- /* @__PURE__ */ s.jsx("span", { children: d?.articles_membership?.plan }),
2778
- /* @__PURE__ */ s.jsx("span", { className: "px-1", children: "|" }),
2779
- /* @__PURE__ */ s.jsx("span", { className: "months fw-bold", children: ks(
2780
- /* @__PURE__ */ new Date(),
2781
- new Date(d?.articles_membership?.membership_started)
2782
- ) || 0 })
2783
- ]
2784
- }
2785
- )
2786
- }
2787
- ),
2788
- d?.address?.state && /* @__PURE__ */ s.jsx(
2789
- ce,
2790
- {
2791
- placement: "bottom",
2792
- overlay: d.address?.state?.length == 2 ? /* @__PURE__ */ s.jsxs(Q, { id: "tooltip-bottom", children: [
2793
- "From the state of ",
2794
- convertRegion(d.address?.state, "name") ? convertRegion(d.address?.state, "name")[0] : ""
2795
- ] }) : /* @__PURE__ */ s.jsxs(Q, { id: "tooltip-bottom", children: [
2796
- "From the state of ",
2797
- d.address?.state
2798
- ] }),
2799
- children: /* @__PURE__ */ s.jsxs("div", { className: "badge bg-articles border me-1 mb-1", children: [
2800
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-map-pin me-1" }),
2801
- d.address?.state
2802
- ] })
2803
- }
2804
- ),
2805
- d.verified?.status !== "Verified" && /* @__PURE__ */ s.jsx(
2806
- ce,
2807
- {
2808
- placement: "bottom",
2809
- overlay: /* @__PURE__ */ s.jsx(Q, { id: "tooltip-bottom", children: "User is not verified" }),
2810
- children: /* @__PURE__ */ s.jsxs("div", { className: "badge bg-danger me-1 mb-1", children: [
2811
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-robot me-1" }),
2812
- "Unverified"
2813
- ] })
2814
- }
2815
- ),
2816
- d.verified?.status == "Verified" && /* @__PURE__ */ s.jsx(
2817
- ce,
2818
- {
2819
- placement: "bottom",
2820
- overlay: /* @__PURE__ */ s.jsxs(
2821
- Q,
2822
- {
2823
- id: "tooltip-bottom",
2824
- className: "",
2825
- children: [
2826
- /* @__PURE__ */ s.jsxs("div", { children: [
2827
- "Verified by ",
2828
- d.verified?.verified_methods?.length,
2829
- " method",
2830
- d.verified?.verified_methods?.length > 1 && "s"
2831
- ] }),
2832
- /* @__PURE__ */ s.jsx("hr", {}),
2833
- /* @__PURE__ */ s.jsx("div", { className: "pb-2", children: d.verified?.verified_methods?.map((y, V) => Object.keys(y)?.length > 0 ? /* @__PURE__ */ s.jsx(
2834
- "div",
2835
- {
2836
- className: "object",
2837
- children: y?.method_name
2838
- },
2839
- V
2840
- ) : /* @__PURE__ */ s.jsx(
2841
- "div",
2842
- {
2843
- className: "single",
2844
- children: y
2845
- },
2846
- V
2847
- )) })
2848
- ]
2849
- }
2850
- ),
2851
- children: /* @__PURE__ */ s.jsxs("div", { className: "badge bg-articles border me-1 mb-1", children: [
2852
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-star me-1" }),
2853
- d.verified?.status
2854
- ] })
2855
- }
2856
- ),
2857
- d.political?.party_id && /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsx(
2858
- ce,
2859
- {
2860
- placement: "bottom",
2861
- overlay: /* @__PURE__ */ s.jsx(Q, { id: "tooltip-bottom", children: /* @__PURE__ */ s.jsx("div", { children: "Users political party" }) }),
2862
- children: /* @__PURE__ */ s.jsx(
2863
- Y,
2864
- {
2865
- href: (
2866
- // `${ROUTES.RESOURCES_POLITICAL_PARTIES}/${(populated_user || userData)?.political?.party_id}`
2867
- `https://articles.media/politics/parties/${(e || d)?.political?.party_id}`
2868
- ),
2869
- children: /* @__PURE__ */ s.jsx("div", { className: "badge bg-articles border text-capitalize me-1", children: /* @__PURE__ */ s.jsxs("div", { className: "", children: [
2870
- (e || d)?.political?.party_id == "62a830440593acbd4061c48c" ? /* @__PURE__ */ s.jsx("i", { className: "fad fa-unlink unaffiliated-icon fa-lg me-0" }) : /* @__PURE__ */ s.jsx(
2871
- "img",
2872
- {
2873
- width: "14px",
2874
- height: "14px",
2875
- style: {
2876
- objectFit: "contain",
2877
- padding: "0px"
2878
- },
2879
- loading: "lazy",
2880
- src: `${process.env.NEXT_PUBLIC_CDN}` + k?.find((y) => y._id == d?.political?.party_id)?.logo,
2881
- alt: ""
2882
- }
2883
- ),
2884
- /* @__PURE__ */ s.jsx("span", { className: "ms-1", children: k?.find((y) => y._id == d.political?.party_id)?.name })
2885
- ] }) })
2886
- }
2887
- )
2888
- }
2889
- ) }),
2890
- /* @__PURE__ */ s.jsx("hr", {}),
2891
- /* @__PURE__ */ s.jsx("div", { className: "small", children: d?._id == "5e90cc96579a17440c5d7d52" && /* @__PURE__ */ s.jsx("span", { children: "Founder of Articles Media, thank you for using the site, feel free to message me with any questions, concerns or anything else." }) })
2892
- ] })
2893
- ] }),
2894
- /* @__PURE__ */ s.jsx("hr", {}),
2895
- T && /* @__PURE__ */ s.jsxs("div", { children: [
2896
- /* @__PURE__ */ s.jsx("div", { className: "d-flex align-items-center justify-content-between", children: /* @__PURE__ */ s.jsx("div", { className: "small", children: "Admin Mode Toolbar" }) }),
2897
- /* @__PURE__ */ s.jsxs("div", { children: [
2898
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex mb-2", children: [
2899
- /* @__PURE__ */ s.jsx(
2900
- P,
2901
- {
2902
- small: !0,
2903
- variant: "warning",
2904
- className: "",
2905
- onClick: () => {
2906
- loadAdminUserData();
2907
- },
2908
- children: /* @__PURE__ */ s.jsx("i", { className: "fad fa-redo me-0" })
2909
- }
2910
- ),
2911
- /* @__PURE__ */ s.jsx(
2912
- P,
2913
- {
2914
- active: T?.edit,
2915
- small: !0,
2916
- className: "",
2917
- onClick: () => {
2918
- je({
2919
- ...T,
2920
- edit: !T?.edit
2921
- });
2922
- },
2923
- children: "Edit Mode"
2924
- }
2925
- ),
2926
- T?.edit && /* @__PURE__ */ s.jsx(
2927
- P,
2928
- {
2929
- small: !0,
2930
- variant: "success",
2931
- className: "me-0",
2932
- onClick: () => {
2933
- Ge();
2934
- },
2935
- children: /* @__PURE__ */ s.jsx("i", { className: "fad fa-save me-0" })
2936
- }
2937
- )
2938
- ] }),
2939
- [
2940
- "User Details",
2941
- "Verification",
2942
- "Moderation",
2943
- "Bans",
2944
- "Stripe",
2945
- "Layouts",
2946
- "Reset Password",
2947
- "Sessions"
2948
- ].map(
2949
- (y) => /* @__PURE__ */ s.jsx(
2950
- P,
2951
- {
2952
- active: y == T?.tab,
2953
- small: !0,
2954
- onClick: () => {
2955
- je({
2956
- ...T,
2957
- tab: y
2958
- });
2959
- },
2960
- children: y
2961
- },
2962
- y
2963
- )
2964
- )
2965
- ] }),
2966
- /* @__PURE__ */ s.jsx("hr", {})
2967
- ] }),
2968
- /* @__PURE__ */ s.jsxs("div", { className: "pe-3 pb-3", children: [
2969
- /* @__PURE__ */ s.jsx("div", { className: "mb-2 me-2", children: [
2970
- {
2971
- name: "Proposals Stance",
2972
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
2973
- /* @__PURE__ */ s.jsx("span", { children: oe?.fundamental?.filter((y) => oe?.user_sentiments?.find((V) => V.proposal_id == y._id) ? y : null).length }),
2974
- /* @__PURE__ */ s.jsx("span", { className: "px-1", children: "/" }),
2975
- /* @__PURE__ */ s.jsx("span", { children: oe?.fundamental?.length })
2976
- ] }) })
2977
- },
2978
- {
2979
- name: "Proposal Sentiments",
2980
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: d?.populated_public_proposals_stance?.user_sentiments_count || 0 })
2981
- },
2982
- {
2983
- name: "Proposal Comments",
2984
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: d?.populated_public_proposals_stance?.user_comments_count || 0 })
2985
- },
2986
- {
2987
- name: "Proposal Submissions",
2988
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: O?.length || 0 })
2989
- // TODO - Make conditional
2990
- },
2991
- {
2992
- name: "News Comments",
2993
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: d?.populated_news_comments_count || 0 })
2994
- },
2995
- {
2996
- name: "News Submissions",
2997
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: _?.length || 0 })
2998
- // TODO - Make conditional
2999
- },
3000
- {
3001
- name: "Verifications",
3002
- // dev: true,
3003
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: d.verified?.verified_methods?.length || 0 })
3004
- // TODO - Make conditional
3005
- },
3006
- {
3007
- name: "Layouts",
3008
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: x?.length || 0 })
3009
- },
3010
- {
3011
- name: "Donations",
3012
- badge: /* @__PURE__ */ s.jsxs("span", { children: [
3013
- /* @__PURE__ */ s.jsx("span", { className: "badge bg-primary ms-1", children: D?.populated_public_donations?.count || 0 }),
3014
- /* @__PURE__ */ s.jsxs("span", { className: "badge bg-black", children: [
3015
- "$",
3016
- tt((D?.populated_public_donations.total / 100).toFixed(2))
3017
- ] })
3018
- ] })
3019
- },
3020
- {
3021
- name: "Orders",
3022
- badge: /* @__PURE__ */ s.jsxs("span", { children: [
3023
- /* @__PURE__ */ s.jsx("span", { className: "badge bg-primary ms-1", children: "0" }),
3024
- /* @__PURE__ */ s.jsx("span", { className: "badge bg-black", children: "0" })
3025
- ] })
3026
- },
3027
- {
3028
- name: "Achievements",
3029
- dev: !0,
3030
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: "0" })
3031
- // TODO - Make conditional
3032
- }
3033
- ].map((y) => (P, y.name == S, y.name, y.badge, y.name, y.dev ? /* @__PURE__ */ s.jsx(
3034
- et,
3035
- {
3036
- inline: !0,
3037
- children: /* @__PURE__ */ s.jsxs(
3038
- P,
3039
- {
3040
- onClick: () => L(y.name),
3041
- active: y.name == S,
3042
- small: !0,
3043
- children: [
3044
- y.name,
3045
- y.badge
3046
- ]
3047
- },
3048
- y.name
3049
- )
3050
- },
3051
- y.name
3052
- ) : /* @__PURE__ */ s.jsxs(
3053
- P,
3054
- {
3055
- onClick: () => L(y.name),
3056
- active: y.name == S,
3057
- small: !0,
3058
- children: [
3059
- y.name,
3060
- y.badge
3061
- ]
3062
- },
3063
- y.name
3064
- ))) }),
3065
- S == "Proposals Stance" && /* @__PURE__ */ s.jsx(
3066
- xr,
3067
- {
3068
- activeLayoutProposalSentiments: fe,
3069
- populated_user: e,
3070
- usersProposalSentiments: oe,
3071
- setShowFullStanceDetails: I,
3072
- showFullStanceDetails: F,
3073
- userData: d
3074
- }
3075
- ),
3076
- S == "Proposal Comments" && /* @__PURE__ */ s.jsx(
3077
- gr,
3078
- {
3079
- activeLayoutProposalSentiments: fe
3080
- }
3081
- ),
3082
- S == "Proposal Sentiments" && /* @__PURE__ */ s.jsx(
3083
- br,
3084
- {
3085
- activeLayoutProposalSentiments: fe
3086
- }
3087
- ),
3088
- S == "Proposal Submissions" && /* @__PURE__ */ s.jsx(
3089
- jr,
3090
- {
3091
- userProposalsSubmitted: D?.populated_public_proposals
3092
- }
3093
- ),
3094
- S == "News Comments" && /* @__PURE__ */ s.jsx(
3095
- Nr,
3096
- {
3097
- publicUserData: D
3098
- }
3099
- ),
3100
- S == "News Submissions" && /* @__PURE__ */ s.jsx(
3101
- _r,
3102
- {
3103
- publicUserData: D,
3104
- userNewsSubmitted: D?.populated_public_news_submissions
3105
- }
3106
- ),
3107
- S == "Donations" && /* @__PURE__ */ s.jsx(
3108
- Or,
3109
- {
3110
- publicUserData: D,
3111
- userDonations: D?.populated_public_donations,
3112
- lifetimeContribution: N
3113
- }
3114
- ),
3115
- S == "Layouts" && /* @__PURE__ */ s.jsx(
3116
- Sr,
3117
- {
3118
- publicUserData: D,
3119
- userLayoutsData: D?.populated_public_layouts
3120
- }
3121
- ),
3122
- S == "Verifications" && /* @__PURE__ */ s.jsx(
3123
- Dr,
3124
- {
3125
- publicUserData: D,
3126
- userData: d
3127
- }
3128
- ),
3129
- S == "Achievements" && /* @__PURE__ */ s.jsx(
3130
- Er,
3131
- {
3132
- publicUserData: D
3133
- }
3134
- )
3135
- ] })
3136
- ] }) }),
3137
- /* @__PURE__ */ s.jsxs(Be.Footer, { className: "justify-content-between", children: [
3138
- C?._id == "5e90cc96579a17440c5d7d52" ? /* @__PURE__ */ s.jsxs("span", { children: [
3139
- /* @__PURE__ */ s.jsxs(
3140
- et,
3141
- {
3142
- inline: !0,
3143
- className: "me-2",
3144
- children: [
3145
- /* @__PURE__ */ s.jsxs(
3146
- P,
3147
- {
3148
- onClick: () => {
3149
- je(T ? !1 : {
3150
- tab: ""
3151
- });
3152
- },
3153
- small: !0,
3154
- active: T,
3155
- variant: "",
3156
- className: "me-1",
3157
- children: [
3158
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-pen" }),
3159
- /* @__PURE__ */ s.jsx("span", { children: "Admin Mode" })
3160
- ]
3161
- }
3162
- ),
3163
- /* @__PURE__ */ s.jsx(
3164
- P,
3165
- {
3166
- onClick: () => {
3167
- ge(), te();
3168
- },
3169
- small: !0,
3170
- variant: "warning",
3171
- className: "",
3172
- children: /* @__PURE__ */ s.jsx("i", { className: "fad fa-redo me-0" })
3173
- }
3174
- )
3175
- ]
3176
- }
3177
- ),
3178
- /* @__PURE__ */ s.jsx("span", { style: { fontSize: "0.8rem" }, children: d?._id })
3179
- ] }) : /* @__PURE__ */ s.jsx("span", {}),
3180
- /* @__PURE__ */ s.jsx("div", { className: "justify-content-", children: /* @__PURE__ */ s.jsx(P, { variant: "articles", onClick: R, children: "Close" }) })
3181
- ] })
3182
- ]
3183
- }
3184
- )
3185
- ] });
3186
- }
3187
- export {
3188
- $r as default
3189
- };