@apolitical/component-library 1.13.4-beta.1 → 1.13.4-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/banners/banner-section/banner-section.d.ts +5 -3
- package/general/divider/divider.d.ts +3 -1
- package/index.js +10 -10
- package/index.mjs +1002 -949
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/base/_index.scss +1 -1
- package/styles/base/_layout.scss +10 -0
- package/styles/variables/sizes/_common.scss +3 -0
package/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import N, { memo as Ne, useState as F, useEffect as X, useRef as ne, useMemo as et, Children as Mt, createContext as Ft, useContext as ge, Fragment as Ct, useCallback as ke, useReducer as rs, Suspense as os } from "react";
|
|
2
2
|
import as from "lodash.clonedeep";
|
|
3
3
|
import is from "lodash.set";
|
|
4
|
-
import { useIntl as
|
|
4
|
+
import { useIntl as A, IntlProvider as ls, createIntl as cs, FormattedMessage as ye } from "react-intl";
|
|
5
5
|
import tt from "truncate";
|
|
6
6
|
import nt from "markdown-to-jsx";
|
|
7
7
|
import { QueryClient as ds, QueryClientProvider as us, useQueryClient as st, useQuery as fn, useMutation as de } from "@tanstack/react-query";
|
|
@@ -26,24 +26,24 @@ var pn = { exports: {} };
|
|
|
26
26
|
(function() {
|
|
27
27
|
var t = {}.hasOwnProperty;
|
|
28
28
|
function n() {
|
|
29
|
-
for (var r = [],
|
|
30
|
-
var
|
|
31
|
-
if (
|
|
32
|
-
var d = typeof
|
|
29
|
+
for (var r = [], i = 0; i < arguments.length; i++) {
|
|
30
|
+
var c = arguments[i];
|
|
31
|
+
if (c) {
|
|
32
|
+
var d = typeof c;
|
|
33
33
|
if (d === "string" || d === "number")
|
|
34
|
-
r.push(
|
|
35
|
-
else if (Array.isArray(
|
|
36
|
-
if (
|
|
37
|
-
var o = n.apply(null,
|
|
34
|
+
r.push(c);
|
|
35
|
+
else if (Array.isArray(c)) {
|
|
36
|
+
if (c.length) {
|
|
37
|
+
var o = n.apply(null, c);
|
|
38
38
|
o && r.push(o);
|
|
39
39
|
}
|
|
40
40
|
} else if (d === "object") {
|
|
41
|
-
if (
|
|
42
|
-
r.push(
|
|
41
|
+
if (c.toString !== Object.prototype.toString && !c.toString.toString().includes("[native code]")) {
|
|
42
|
+
r.push(c.toString());
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
|
-
for (var
|
|
46
|
-
t.call(
|
|
45
|
+
for (var a in c)
|
|
46
|
+
t.call(c, a) && c[a] && r.push(a);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -53,7 +53,7 @@ var pn = { exports: {} };
|
|
|
53
53
|
})();
|
|
54
54
|
})(pn);
|
|
55
55
|
var vs = pn.exports;
|
|
56
|
-
const
|
|
56
|
+
const S = /* @__PURE__ */ bs(vs), ws = ({ element: e = "span", showOnFocus: t = !0, children: n, ...r }) => N.createElement(e, { ...r, className: S("hidden", { "show-on-focus": t }), children: n }), le = Ne(ws), ks = ({ element: e = "span", children: t = null, ...n }) => N.createElement(e, { ...n, "aria-hidden": !0 }, t), gn = Ne(ks);
|
|
57
57
|
var Dt = { exports: {} }, Re = {};
|
|
58
58
|
/**
|
|
59
59
|
* @license React
|
|
@@ -69,16 +69,16 @@ function js() {
|
|
|
69
69
|
if (tn)
|
|
70
70
|
return Re;
|
|
71
71
|
tn = 1;
|
|
72
|
-
var e =
|
|
73
|
-
function d(o,
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
for (
|
|
77
|
-
r.call(
|
|
72
|
+
var e = N, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
73
|
+
function d(o, a, u) {
|
|
74
|
+
var l, f = {}, h = null, p = null;
|
|
75
|
+
u !== void 0 && (h = "" + u), a.key !== void 0 && (h = "" + a.key), a.ref !== void 0 && (p = a.ref);
|
|
76
|
+
for (l in a)
|
|
77
|
+
r.call(a, l) && !c.hasOwnProperty(l) && (f[l] = a[l]);
|
|
78
78
|
if (o && o.defaultProps)
|
|
79
|
-
for (
|
|
80
|
-
f[
|
|
81
|
-
return { $$typeof: t, type: o, key: h, ref: p, props: f, _owner:
|
|
79
|
+
for (l in a = o.defaultProps, a)
|
|
80
|
+
f[l] === void 0 && (f[l] = a[l]);
|
|
81
|
+
return { $$typeof: t, type: o, key: h, ref: p, props: f, _owner: i.current };
|
|
82
82
|
}
|
|
83
83
|
return Re.Fragment = n, Re.jsx = d, Re.jsxs = d, Re;
|
|
84
84
|
}
|
|
@@ -95,14 +95,14 @@ var Fe = {};
|
|
|
95
95
|
var nn;
|
|
96
96
|
function ys() {
|
|
97
97
|
return nn || (nn = 1, process.env.NODE_ENV !== "production" && function() {
|
|
98
|
-
var e =
|
|
98
|
+
var e = N, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), o = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), _ = Symbol.iterator, j = "@@iterator";
|
|
99
99
|
function g(m) {
|
|
100
100
|
if (m === null || typeof m != "object")
|
|
101
101
|
return null;
|
|
102
102
|
var v = _ && m[_] || m[j];
|
|
103
103
|
return typeof v == "function" ? v : null;
|
|
104
104
|
}
|
|
105
|
-
var
|
|
105
|
+
var E = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
106
106
|
function k(m) {
|
|
107
107
|
{
|
|
108
108
|
for (var v = arguments.length, y = new Array(v > 1 ? v - 1 : 0), $ = 1; $ < v; $++)
|
|
@@ -112,7 +112,7 @@ function ys() {
|
|
|
112
112
|
}
|
|
113
113
|
function T(m, v, y) {
|
|
114
114
|
{
|
|
115
|
-
var $ =
|
|
115
|
+
var $ = E.ReactDebugCurrentFrame, B = $.getStackAddendum();
|
|
116
116
|
B !== "" && (v += "%s", y = y.concat([B]));
|
|
117
117
|
var z = y.map(function(R) {
|
|
118
118
|
return String(R);
|
|
@@ -123,7 +123,7 @@ function ys() {
|
|
|
123
123
|
var M = !1, C = !1, I = !1, V = !1, x = !1, b;
|
|
124
124
|
b = Symbol.for("react.module.reference");
|
|
125
125
|
function Q(m) {
|
|
126
|
-
return !!(typeof m == "string" || typeof m == "function" || m === r || m ===
|
|
126
|
+
return !!(typeof m == "string" || typeof m == "function" || m === r || m === c || x || m === i || m === u || m === l || V || m === p || M || C || I || typeof m == "object" && m !== null && (m.$$typeof === h || m.$$typeof === f || m.$$typeof === d || m.$$typeof === o || m.$$typeof === a || // This needs to include all possible module reference object
|
|
127
127
|
// types supported by any Flight configuration anywhere since
|
|
128
128
|
// we don't know which Flight build this will end up being used
|
|
129
129
|
// with.
|
|
@@ -151,13 +151,13 @@ function ys() {
|
|
|
151
151
|
return "Fragment";
|
|
152
152
|
case n:
|
|
153
153
|
return "Portal";
|
|
154
|
-
case
|
|
154
|
+
case c:
|
|
155
155
|
return "Profiler";
|
|
156
|
-
case
|
|
156
|
+
case i:
|
|
157
157
|
return "StrictMode";
|
|
158
|
-
case c:
|
|
159
|
-
return "Suspense";
|
|
160
158
|
case u:
|
|
159
|
+
return "Suspense";
|
|
160
|
+
case l:
|
|
161
161
|
return "SuspenseList";
|
|
162
162
|
}
|
|
163
163
|
if (typeof m == "object")
|
|
@@ -168,7 +168,7 @@ function ys() {
|
|
|
168
168
|
case d:
|
|
169
169
|
var y = m;
|
|
170
170
|
return Y(y._context) + ".Provider";
|
|
171
|
-
case
|
|
171
|
+
case a:
|
|
172
172
|
return w(m, m.render, "ForwardRef");
|
|
173
173
|
case f:
|
|
174
174
|
var $ = m.displayName || null;
|
|
@@ -246,7 +246,7 @@ function ys() {
|
|
|
246
246
|
U < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
var K =
|
|
249
|
+
var K = E.ReactCurrentDispatcher, ue;
|
|
250
250
|
function fe(m, v, y) {
|
|
251
251
|
{
|
|
252
252
|
if (ue === void 0)
|
|
@@ -265,7 +265,7 @@ function ys() {
|
|
|
265
265
|
var Ie = typeof WeakMap == "function" ? WeakMap : Map;
|
|
266
266
|
xe = new Ie();
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Ae(m, v) {
|
|
269
269
|
if (!m || _e)
|
|
270
270
|
return "";
|
|
271
271
|
{
|
|
@@ -337,7 +337,7 @@ function ys() {
|
|
|
337
337
|
return typeof m == "function" && xe.set(m, en), en;
|
|
338
338
|
}
|
|
339
339
|
function Fn(m, v, y) {
|
|
340
|
-
return
|
|
340
|
+
return Ae(m, !1);
|
|
341
341
|
}
|
|
342
342
|
function Ln(m) {
|
|
343
343
|
var v = m.prototype;
|
|
@@ -347,18 +347,18 @@ function ys() {
|
|
|
347
347
|
if (m == null)
|
|
348
348
|
return "";
|
|
349
349
|
if (typeof m == "function")
|
|
350
|
-
return
|
|
350
|
+
return Ae(m, Ln(m));
|
|
351
351
|
if (typeof m == "string")
|
|
352
352
|
return fe(m);
|
|
353
353
|
switch (m) {
|
|
354
|
-
case c:
|
|
355
|
-
return fe("Suspense");
|
|
356
354
|
case u:
|
|
355
|
+
return fe("Suspense");
|
|
356
|
+
case l:
|
|
357
357
|
return fe("SuspenseList");
|
|
358
358
|
}
|
|
359
359
|
if (typeof m == "object")
|
|
360
360
|
switch (m.$$typeof) {
|
|
361
|
-
case
|
|
361
|
+
case a:
|
|
362
362
|
return Fn(m.render);
|
|
363
363
|
case f:
|
|
364
364
|
return He(m.type, v, y);
|
|
@@ -372,7 +372,7 @@ function ys() {
|
|
|
372
372
|
}
|
|
373
373
|
return "";
|
|
374
374
|
}
|
|
375
|
-
var Qe = Object.prototype.hasOwnProperty, Qt = {}, Ut =
|
|
375
|
+
var Qe = Object.prototype.hasOwnProperty, Qt = {}, Ut = E.ReactDebugCurrentFrame;
|
|
376
376
|
function Ue(m) {
|
|
377
377
|
if (m) {
|
|
378
378
|
var v = m._owner, y = He(m.type, m._source, v ? v.type : null);
|
|
@@ -423,7 +423,7 @@ function ys() {
|
|
|
423
423
|
if (Hn(m))
|
|
424
424
|
return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", In(m)), zt(m);
|
|
425
425
|
}
|
|
426
|
-
var Pe =
|
|
426
|
+
var Pe = E.ReactCurrentOwner, Qn = {
|
|
427
427
|
key: !0,
|
|
428
428
|
ref: !0,
|
|
429
429
|
__self: !0,
|
|
@@ -521,7 +521,7 @@ function ys() {
|
|
|
521
521
|
return Gn(m, D, ce, B, $, Pe.current, R);
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
var mt =
|
|
524
|
+
var mt = E.ReactCurrentOwner, Gt = E.ReactDebugCurrentFrame;
|
|
525
525
|
function Te(m) {
|
|
526
526
|
if (m) {
|
|
527
527
|
var v = m._owner, y = He(m.type, m._source, v ? v.type : null);
|
|
@@ -610,7 +610,7 @@ Check the top-level render call using <` + y + ">.");
|
|
|
610
610
|
var y;
|
|
611
611
|
if (typeof v == "function")
|
|
612
612
|
y = v.propTypes;
|
|
613
|
-
else if (typeof v == "object" && (v.$$typeof ===
|
|
613
|
+
else if (typeof v == "object" && (v.$$typeof === a || // Note: Memo only checks outer props here.
|
|
614
614
|
// Inner props are checked in the reconciler.
|
|
615
615
|
v.$$typeof === f))
|
|
616
616
|
y = v.propTypes;
|
|
@@ -696,9 +696,9 @@ const Es = () => {
|
|
|
696
696
|
}, t);
|
|
697
697
|
};
|
|
698
698
|
function Ss(e, t, n) {
|
|
699
|
-
var r = this,
|
|
699
|
+
var r = this, i = ne(null), c = ne(0), d = ne(null), o = ne([]), a = ne(), u = ne(), l = ne(e), f = ne(!0);
|
|
700
700
|
X(function() {
|
|
701
|
-
|
|
701
|
+
l.current = e;
|
|
702
702
|
}, [e]);
|
|
703
703
|
var h = !t && t !== 0 && typeof window < "u";
|
|
704
704
|
if (typeof e != "function")
|
|
@@ -710,67 +710,67 @@ function Ss(e, t, n) {
|
|
|
710
710
|
f.current = !1;
|
|
711
711
|
};
|
|
712
712
|
}, []);
|
|
713
|
-
var
|
|
713
|
+
var E = et(function() {
|
|
714
714
|
var k = function(x) {
|
|
715
|
-
var b = o.current, Q =
|
|
716
|
-
return o.current =
|
|
715
|
+
var b = o.current, Q = a.current;
|
|
716
|
+
return o.current = a.current = null, c.current = x, u.current = l.current.apply(Q, b);
|
|
717
717
|
}, T = function(x, b) {
|
|
718
718
|
h && cancelAnimationFrame(d.current), d.current = h ? requestAnimationFrame(x) : setTimeout(x, b);
|
|
719
719
|
}, M = function(x) {
|
|
720
720
|
if (!f.current)
|
|
721
721
|
return !1;
|
|
722
|
-
var b = x -
|
|
723
|
-
return !
|
|
722
|
+
var b = x - i.current;
|
|
723
|
+
return !i.current || b >= t || b < 0 || j && x - c.current >= g;
|
|
724
724
|
}, C = function(x) {
|
|
725
|
-
return d.current = null, _ && o.current ? k(x) : (o.current =
|
|
725
|
+
return d.current = null, _ && o.current ? k(x) : (o.current = a.current = null, u.current);
|
|
726
726
|
}, I = function x() {
|
|
727
727
|
var b = Date.now();
|
|
728
728
|
if (M(b))
|
|
729
729
|
return C(b);
|
|
730
730
|
if (f.current) {
|
|
731
|
-
var Q = t - (b -
|
|
731
|
+
var Q = t - (b - i.current), w = j ? Math.min(Q, g - (b - c.current)) : Q;
|
|
732
732
|
T(x, w);
|
|
733
733
|
}
|
|
734
734
|
}, V = function() {
|
|
735
735
|
var x = Date.now(), b = M(x);
|
|
736
|
-
if (o.current = [].slice.call(arguments),
|
|
736
|
+
if (o.current = [].slice.call(arguments), a.current = r, i.current = x, b) {
|
|
737
737
|
if (!d.current && f.current)
|
|
738
|
-
return
|
|
738
|
+
return c.current = i.current, T(I, t), p ? k(i.current) : u.current;
|
|
739
739
|
if (j)
|
|
740
|
-
return T(I, t), k(
|
|
740
|
+
return T(I, t), k(i.current);
|
|
741
741
|
}
|
|
742
|
-
return d.current || T(I, t),
|
|
742
|
+
return d.current || T(I, t), u.current;
|
|
743
743
|
};
|
|
744
744
|
return V.cancel = function() {
|
|
745
|
-
d.current && (h ? cancelAnimationFrame(d.current) : clearTimeout(d.current)),
|
|
745
|
+
d.current && (h ? cancelAnimationFrame(d.current) : clearTimeout(d.current)), c.current = 0, o.current = i.current = a.current = d.current = null;
|
|
746
746
|
}, V.isPending = function() {
|
|
747
747
|
return !!d.current;
|
|
748
748
|
}, V.flush = function() {
|
|
749
|
-
return d.current ? C(Date.now()) :
|
|
749
|
+
return d.current ? C(Date.now()) : u.current;
|
|
750
750
|
}, V;
|
|
751
751
|
}, [p, j, t, g, _, h]);
|
|
752
|
-
return
|
|
752
|
+
return E;
|
|
753
753
|
}
|
|
754
754
|
function _n(e, t, n) {
|
|
755
|
-
var r = n === void 0 ? {} : n,
|
|
756
|
-
return Ss(e, t, { maxWait: t, leading:
|
|
755
|
+
var r = n === void 0 ? {} : n, i = r.leading, c = r.trailing;
|
|
756
|
+
return Ss(e, t, { maxWait: t, leading: i === void 0 || i, trailing: c === void 0 || c });
|
|
757
757
|
}
|
|
758
758
|
let pt;
|
|
759
759
|
const rt = (e = !0, t = !1) => {
|
|
760
760
|
if (!e)
|
|
761
761
|
return;
|
|
762
|
-
const [n, r] =
|
|
762
|
+
const [n, r] = N.useState(0) || [!1, () => {
|
|
763
763
|
}];
|
|
764
|
-
X(() => (
|
|
764
|
+
X(() => (c(), window.addEventListener("resize", d), () => {
|
|
765
765
|
clearTimeout(pt), d.flush(), window.removeEventListener("resize", d);
|
|
766
766
|
}), []);
|
|
767
|
-
const
|
|
768
|
-
r(
|
|
767
|
+
const i = () => window.innerWidth, c = () => {
|
|
768
|
+
r(i());
|
|
769
769
|
}, d = _n(
|
|
770
770
|
() => {
|
|
771
|
-
|
|
771
|
+
i() !== n && (t && (clearTimeout(pt), document.body.classList.add("is-resizing"), pt = setTimeout(() => {
|
|
772
772
|
document.body.classList.remove("is-resizing");
|
|
773
|
-
}, 550)),
|
|
773
|
+
}, 550)), c());
|
|
774
774
|
},
|
|
775
775
|
500,
|
|
776
776
|
{ leading: !0 }
|
|
@@ -787,23 +787,23 @@ const rt = (e = !0, t = !1) => {
|
|
|
787
787
|
}) => {
|
|
788
788
|
if (!window)
|
|
789
789
|
return;
|
|
790
|
-
const [
|
|
791
|
-
}], [d, o] =
|
|
790
|
+
const [i, c] = N.useState({ current: 0, past: 0 }) || [!1, () => {
|
|
791
|
+
}], [d, o] = N.useState({ scrollDown: !1, scrollUp: !1 }) || [!1, () => {
|
|
792
792
|
}];
|
|
793
|
-
X(() => (
|
|
794
|
-
|
|
793
|
+
X(() => (a(), window.addEventListener("scroll", u), () => {
|
|
794
|
+
u.flush(), window.removeEventListener("scroll", u);
|
|
795
795
|
}), []);
|
|
796
|
-
const
|
|
797
|
-
const
|
|
798
|
-
if (
|
|
799
|
-
|
|
796
|
+
const a = () => {
|
|
797
|
+
const l = window.scrollY, f = i.current, h = l - f, p = h > 0 ? "down" : "up";
|
|
798
|
+
if (c({ current: l, past: f }), p === "down") {
|
|
799
|
+
l >= e + t.down && !d.scrollDown && (!d.scrollUp || h > t.up) && (n(), o({ scrollUp: !1, scrollDown: !0 }));
|
|
800
800
|
return;
|
|
801
801
|
}
|
|
802
802
|
Math.abs(h) >= t.up && !d.scrollUp && (r(), o({ scrollUp: !0, scrollDown: !1 }));
|
|
803
|
-
},
|
|
804
|
-
|
|
803
|
+
}, u = _n(() => {
|
|
804
|
+
a();
|
|
805
805
|
}, 250);
|
|
806
|
-
return
|
|
806
|
+
return i;
|
|
807
807
|
}, mo = (e = [], t = !0) => {
|
|
808
808
|
e = Array.isArray(e) ? e : [e];
|
|
809
809
|
const n = ne(!1);
|
|
@@ -818,8 +818,8 @@ const rt = (e = !0, t = !1) => {
|
|
|
818
818
|
}, $s = (e, t) => {
|
|
819
819
|
Array.isArray(t) || (t = [t]);
|
|
820
820
|
const n = as(e);
|
|
821
|
-
return t.forEach(({ type: r, value:
|
|
822
|
-
is(n, r,
|
|
821
|
+
return t.forEach(({ type: r, value: i }) => {
|
|
822
|
+
is(n, r, i);
|
|
823
823
|
}), n;
|
|
824
824
|
}, xn = (e) => {
|
|
825
825
|
const t = [];
|
|
@@ -829,11 +829,11 @@ const rt = (e = !0, t = !1) => {
|
|
|
829
829
|
}), t.sort((n, r) => n - r);
|
|
830
830
|
}, bn = (e, t, n) => {
|
|
831
831
|
let r = n.mobile;
|
|
832
|
-
for (const
|
|
833
|
-
const
|
|
834
|
-
if (e >=
|
|
835
|
-
r = n[
|
|
836
|
-
else if (e <
|
|
832
|
+
for (const i in t) {
|
|
833
|
+
const c = parseInt(String(t[i]));
|
|
834
|
+
if (e >= c)
|
|
835
|
+
r = n[c];
|
|
836
|
+
else if (e < c)
|
|
837
837
|
break;
|
|
838
838
|
}
|
|
839
839
|
return r;
|
|
@@ -843,19 +843,19 @@ const rt = (e = !0, t = !1) => {
|
|
|
843
843
|
month: "short",
|
|
844
844
|
year: "numeric"
|
|
845
845
|
}), Cs = (e) => {
|
|
846
|
-
let
|
|
846
|
+
let c;
|
|
847
847
|
try {
|
|
848
|
-
|
|
848
|
+
c = (/* @__PURE__ */ new Date()).getTime() - new Date(e).getTime();
|
|
849
849
|
} catch {
|
|
850
850
|
return "";
|
|
851
851
|
}
|
|
852
|
-
const d =
|
|
852
|
+
const d = c / 36e5, o = Math.floor(c / 864e5);
|
|
853
853
|
if (o < 1)
|
|
854
854
|
return d < 1 ? { path: "now" } : { path: "hours", number: Math.floor(d) };
|
|
855
855
|
if (o < 7)
|
|
856
856
|
return { path: "days", number: o };
|
|
857
|
-
const
|
|
858
|
-
return
|
|
857
|
+
const a = Math.floor(o / 7);
|
|
858
|
+
return a <= 52 ? { path: "weeks", number: a } : { path: "years", number: Math.floor(o / 365) };
|
|
859
859
|
}, Ds = (e) => new Promise((t) => setTimeout(t, e)), Lt = {
|
|
860
860
|
apolitical: "Apolitical",
|
|
861
861
|
breadcrumbs_label: "Go back to:",
|
|
@@ -1139,13 +1139,13 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1139
1139
|
sharedLinks_copy_text: "Copy link",
|
|
1140
1140
|
tags_community: "From the community",
|
|
1141
1141
|
tooltip_loading: "Loading..."
|
|
1142
|
-
},
|
|
1142
|
+
}, Ns = {
|
|
1143
1143
|
languageSwitcher_label: "Me gustaría leer este artículo en...",
|
|
1144
1144
|
languageSwitcher_translation_original: "idioma original",
|
|
1145
1145
|
languageSwitcher_translation_human: "traducido por un humano",
|
|
1146
1146
|
languageSwitcher_translation_machine: "traducido por máquina",
|
|
1147
1147
|
languageSwitcher_disclaimer: "Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"
|
|
1148
|
-
},
|
|
1148
|
+
}, As = {
|
|
1149
1149
|
collapsibleSection_summary: "En savoir plus",
|
|
1150
1150
|
languageSwitcher_label: "Je voudrais lire cet article dans...",
|
|
1151
1151
|
languageSwitcher_translation_original: "langue originale",
|
|
@@ -1161,96 +1161,96 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1161
1161
|
}, Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1162
1162
|
__proto__: null,
|
|
1163
1163
|
en: Lt,
|
|
1164
|
-
es:
|
|
1165
|
-
fr:
|
|
1164
|
+
es: Ns,
|
|
1165
|
+
fr: As,
|
|
1166
1166
|
pt: Ps
|
|
1167
|
-
}, Symbol.toStringTag, { value: "Module" })), pe = (e, t, n, r,
|
|
1168
|
-
let
|
|
1169
|
-
return `${t}_${n}` in Lt ?
|
|
1167
|
+
}, Symbol.toStringTag, { value: "Module" })), pe = (e, t, n, r, i = {}) => {
|
|
1168
|
+
let c = "";
|
|
1169
|
+
return `${t}_${n}` in Lt ? c = e({ id: `${t}_${n}` }, i) : c = e({ id: t }, { [r]: n, ...i }), c;
|
|
1170
1170
|
}, Fs = (e, t, n) => {
|
|
1171
1171
|
if (!e || e === 0)
|
|
1172
1172
|
return "0";
|
|
1173
1173
|
t || (t = 0), n || (n = ["k", "m", "b", "t"]);
|
|
1174
1174
|
let r = e.toString();
|
|
1175
1175
|
t = Math.pow(10, t);
|
|
1176
|
-
for (let
|
|
1177
|
-
const
|
|
1178
|
-
if (
|
|
1179
|
-
e = Math.round(e * t /
|
|
1176
|
+
for (let i = n.length - 1; i >= 0; i--) {
|
|
1177
|
+
const c = Math.pow(10, (i + 1) * 3);
|
|
1178
|
+
if (c <= e) {
|
|
1179
|
+
e = Math.round(e * t / c) / t, e === 1e3 && i < n.length - 1 && (e = 1, i++), r = `${e}${n[i]}`;
|
|
1180
1180
|
break;
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
1183
|
return r;
|
|
1184
|
-
}, vn = (e, t) =>
|
|
1184
|
+
}, vn = (e, t) => N.Children.map(e, (n) => N.cloneElement(n, {
|
|
1185
1185
|
...t
|
|
1186
1186
|
})), Ls = (e) => e.replace(/\s+/g, "").length > 0, J = ({
|
|
1187
1187
|
variant: e = "primary",
|
|
1188
1188
|
size: t = "medium",
|
|
1189
1189
|
styling: n = { muted: !1, fullWidth: !1 },
|
|
1190
1190
|
icon: r = !1,
|
|
1191
|
-
href:
|
|
1192
|
-
element:
|
|
1191
|
+
href: i = !1,
|
|
1192
|
+
element: c = "button",
|
|
1193
1193
|
onClick: d = !1,
|
|
1194
1194
|
className: o = "",
|
|
1195
|
-
disabled:
|
|
1196
|
-
screenreaderText:
|
|
1197
|
-
children:
|
|
1195
|
+
disabled: a = !1,
|
|
1196
|
+
screenreaderText: u = !1,
|
|
1197
|
+
children: l = !1,
|
|
1198
1198
|
...f
|
|
1199
1199
|
}) => {
|
|
1200
1200
|
const p = rt(typeof t == "object");
|
|
1201
1201
|
if (typeof t == "object" && typeof p == "number") {
|
|
1202
|
-
const g = Object.assign({}, t),
|
|
1203
|
-
t = bn(p,
|
|
1202
|
+
const g = Object.assign({}, t), E = xn(Object.keys(g));
|
|
1203
|
+
t = bn(p, E, g);
|
|
1204
1204
|
}
|
|
1205
1205
|
const _ = [];
|
|
1206
1206
|
typeof t == "string" && _.push(t), r && (_.push("icon"), typeof r == "object" ? (_.push(r.icon), r.position ? _.push(r.position) : _.push("left"), r.hover && _.push(`hover_${r.hover}`), r.animate && (_.push("animate"), typeof r.animate == "string" && _.push(r.animate))) : (_.push(r), !r.includes("right") && !r.includes("left") && _.push("left"))), n.muted && _.push("muted"), n.fullWidth && _.push("full-width");
|
|
1207
1207
|
const j = {
|
|
1208
1208
|
...f,
|
|
1209
|
-
className:
|
|
1210
|
-
"no-text": !
|
|
1211
|
-
disabled:
|
|
1212
|
-
button:
|
|
1209
|
+
className: S(e, o, _, {
|
|
1210
|
+
"no-text": !l,
|
|
1211
|
+
disabled: a,
|
|
1212
|
+
button: i
|
|
1213
1213
|
}),
|
|
1214
1214
|
onClick: (g) => {
|
|
1215
|
-
(!
|
|
1215
|
+
(!i || i[0] === "#") && d && (g.preventDefault(), g.stopPropagation()), d && d(g);
|
|
1216
1216
|
},
|
|
1217
|
-
disabled: typeof
|
|
1217
|
+
disabled: typeof a == "object" && "isClickable" in a ? !a.isClickable : a
|
|
1218
1218
|
};
|
|
1219
|
-
return
|
|
1220
|
-
|
|
1219
|
+
return i && (c = "a", j.href = i), N.createElement(
|
|
1220
|
+
c,
|
|
1221
1221
|
j,
|
|
1222
|
-
|
|
1222
|
+
l || (u ? /* @__PURE__ */ s.jsx(le, { showOnFocus: !1, children: u }) : null)
|
|
1223
1223
|
);
|
|
1224
1224
|
}, ot = ({ buttons: e, className: t = "", ...n }) => {
|
|
1225
|
-
const r = e.length > 1 ? "ul" : "p",
|
|
1226
|
-
return
|
|
1225
|
+
const r = e.length > 1 ? "ul" : "p", i = e.map((c, d) => r === "p" ? /* @__PURE__ */ s.jsx(J, { ...c }, d) : /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(J, { ...c }) }, d));
|
|
1226
|
+
return N.createElement(r, { className: S("button-wrapper", t), ...n, children: i });
|
|
1227
1227
|
};
|
|
1228
|
-
const De = ({
|
|
1229
|
-
const
|
|
1230
|
-
return /* @__PURE__ */ s.jsx("hr", { className:
|
|
1228
|
+
const De = ({ className: e = "", maxWidth: t = !1 }) => {
|
|
1229
|
+
const n = t ? { "--max-width": `${t / 16}rem` } : {};
|
|
1230
|
+
return /* @__PURE__ */ s.jsx("hr", { className: S(e, { "has-max-width": t }), style: n });
|
|
1231
1231
|
}, at = ({
|
|
1232
1232
|
href: e,
|
|
1233
1233
|
children: t,
|
|
1234
1234
|
fallbackElement: n,
|
|
1235
1235
|
className: r = "",
|
|
1236
|
-
onClick:
|
|
1237
|
-
gtmContext:
|
|
1236
|
+
onClick: i,
|
|
1237
|
+
gtmContext: c,
|
|
1238
1238
|
gtmType: d,
|
|
1239
1239
|
...o
|
|
1240
1240
|
}) => {
|
|
1241
1241
|
if (e) {
|
|
1242
|
-
const
|
|
1243
|
-
return
|
|
1242
|
+
const a = { ...o };
|
|
1243
|
+
return i && (a.onClick = i), c && (a["data-gtm-event-context"] = c), d && (a["data-gtm-event-type"] = d), /* @__PURE__ */ s.jsx(
|
|
1244
1244
|
"a",
|
|
1245
1245
|
{
|
|
1246
1246
|
href: e,
|
|
1247
|
-
className:
|
|
1248
|
-
...
|
|
1247
|
+
className: S("gtm-trackable", r),
|
|
1248
|
+
...a,
|
|
1249
1249
|
children: t
|
|
1250
1250
|
}
|
|
1251
1251
|
);
|
|
1252
1252
|
}
|
|
1253
|
-
return n ?
|
|
1253
|
+
return n ? N.createElement(n, { children: t, className: r, ...o }) : t;
|
|
1254
1254
|
}, sn = {
|
|
1255
1255
|
card: {
|
|
1256
1256
|
range: [
|
|
@@ -1359,31 +1359,31 @@ const De = ({ maxWidth: e = !1 }) => {
|
|
|
1359
1359
|
range: t,
|
|
1360
1360
|
sizes: n
|
|
1361
1361
|
}) => {
|
|
1362
|
-
const { range: r, sizes:
|
|
1363
|
-
return { range: t && t.length > 0 ? t : r, sizes: n ||
|
|
1362
|
+
const { range: r, sizes: i } = e ? sn[e] : sn.fallback;
|
|
1363
|
+
return { range: t && t.length > 0 ? t : r, sizes: n || i };
|
|
1364
1364
|
}, Bs = ({ format: e, height: t, query: n, width: r }) => {
|
|
1365
|
-
let
|
|
1366
|
-
return
|
|
1367
|
-
}, gt = ({ format: e, range: t, url: n, query: r }) => t.map(({ height:
|
|
1365
|
+
let i = `w=${r}&h=${t}`;
|
|
1366
|
+
return i = e ? `${i}&fm=${e}` : i, i = n ? `${i}&${n}` : i, i;
|
|
1367
|
+
}, gt = ({ format: e, range: t, url: n, query: r }) => t.map(({ height: i, width: c }) => `${n}?${Bs({
|
|
1368
1368
|
format: e,
|
|
1369
|
-
height:
|
|
1369
|
+
height: i,
|
|
1370
1370
|
query: r,
|
|
1371
|
-
width:
|
|
1372
|
-
})} ${
|
|
1371
|
+
width: c
|
|
1372
|
+
})} ${c}w`).join(", ");
|
|
1373
1373
|
const Is = ({ image: e, className: t, testId: n }) => {
|
|
1374
1374
|
const {
|
|
1375
1375
|
description: r,
|
|
1376
|
-
height:
|
|
1377
|
-
type:
|
|
1376
|
+
height: i,
|
|
1377
|
+
type: c,
|
|
1378
1378
|
query: d,
|
|
1379
1379
|
url: o,
|
|
1380
|
-
width:
|
|
1381
|
-
loading:
|
|
1382
|
-
decoding:
|
|
1380
|
+
width: a,
|
|
1381
|
+
loading: u,
|
|
1382
|
+
decoding: l,
|
|
1383
1383
|
fetchPriority: f
|
|
1384
1384
|
} = e, { range: h, sizes: p } = Os(e), _ = gt({ format: "avif", query: d, range: h, url: o }), j = gt({ format: "webp", query: d, range: h, url: o }), g = gt({ format: "", query: d, range: h, url: o });
|
|
1385
1385
|
return /* @__PURE__ */ s.jsxs("picture", { className: t, children: [
|
|
1386
|
-
|
|
1386
|
+
c !== "image/gif" && /* @__PURE__ */ s.jsx(
|
|
1387
1387
|
"source",
|
|
1388
1388
|
{
|
|
1389
1389
|
type: "image/avif",
|
|
@@ -1408,11 +1408,11 @@ const Is = ({ image: e, className: t, testId: n }) => {
|
|
|
1408
1408
|
sizes: p,
|
|
1409
1409
|
src: o,
|
|
1410
1410
|
alt: r,
|
|
1411
|
-
loading:
|
|
1412
|
-
decoding:
|
|
1411
|
+
loading: u || "lazy",
|
|
1412
|
+
decoding: l || "async",
|
|
1413
1413
|
fetchpriority: f || "auto",
|
|
1414
|
-
width:
|
|
1415
|
-
height:
|
|
1414
|
+
width: a,
|
|
1415
|
+
height: i,
|
|
1416
1416
|
"data-testid": n || "image"
|
|
1417
1417
|
}
|
|
1418
1418
|
)
|
|
@@ -1420,41 +1420,41 @@ const Is = ({ image: e, className: t, testId: n }) => {
|
|
|
1420
1420
|
};
|
|
1421
1421
|
let Le = !1;
|
|
1422
1422
|
const Hs = ({ isOpen: e = !1, isLoading: t = !1, children: n }) => {
|
|
1423
|
-
const r =
|
|
1423
|
+
const r = A(), i = ne(null), [c, d] = F("hidden");
|
|
1424
1424
|
X(() => {
|
|
1425
|
-
const
|
|
1426
|
-
if (
|
|
1427
|
-
return
|
|
1428
|
-
|
|
1425
|
+
const a = i.current;
|
|
1426
|
+
if (a)
|
|
1427
|
+
return a.addEventListener("transitionend", o), () => {
|
|
1428
|
+
a.removeEventListener("transitionend", o);
|
|
1429
1429
|
};
|
|
1430
1430
|
}, []);
|
|
1431
|
-
const o = ({ propertyName:
|
|
1432
|
-
|
|
1431
|
+
const o = ({ propertyName: a }) => {
|
|
1432
|
+
a === "opacity" && (Le !== !1 && clearTimeout(Le), d((u) => u === "opening" ? "open" : u === "closing" ? "closed" : u === "closed" ? "hidden" : u));
|
|
1433
1433
|
};
|
|
1434
1434
|
return Ce(() => {
|
|
1435
1435
|
Le !== !1 && clearTimeout(Le);
|
|
1436
|
-
let
|
|
1437
|
-
e ? d("opening") : (d("closing"),
|
|
1438
|
-
d(
|
|
1436
|
+
let a = "open";
|
|
1437
|
+
e ? d("opening") : (d("closing"), a = "hidden"), Le = setTimeout(() => {
|
|
1438
|
+
d(a);
|
|
1439
1439
|
}, 300);
|
|
1440
|
-
}, [e]), /* @__PURE__ */ s.jsx("aside", { ref:
|
|
1440
|
+
}, [e]), /* @__PURE__ */ s.jsx("aside", { ref: i, className: S("tooltip text-medium", c, { loading: t }), hidden: c === "hidden", children: t ? /* @__PURE__ */ s.jsx("p", { children: r.formatMessage({ id: "tooltip_loading" }) }) : typeof n == "string" ? /* @__PURE__ */ s.jsx("p", { children: n }) : n });
|
|
1441
1441
|
};
|
|
1442
|
-
const wn = ({ children: e, className: t = "", ...n }) => /* @__PURE__ */ s.jsx("section", { className:
|
|
1442
|
+
const wn = ({ children: e, className: t = "", ...n }) => /* @__PURE__ */ s.jsx("section", { className: S("full-width-section", t), ...n, children: e });
|
|
1443
1443
|
const fo = ({ text: e, buttons: t, className: n = "" }) => {
|
|
1444
1444
|
const r = [];
|
|
1445
|
-
return t.forEach((
|
|
1445
|
+
return t.forEach((i) => {
|
|
1446
1446
|
r.push({
|
|
1447
|
-
href:
|
|
1447
|
+
href: i.link,
|
|
1448
1448
|
variant: "secondary",
|
|
1449
1449
|
size: { mobile: "medium", 1024: "large" },
|
|
1450
1450
|
className: "gtm-trackable",
|
|
1451
1451
|
"data-gtm-event-type": "download-click",
|
|
1452
|
-
"data-gtm-event-context":
|
|
1452
|
+
"data-gtm-event-context": i.eventContext || "Download",
|
|
1453
1453
|
target: "_blank",
|
|
1454
|
-
children:
|
|
1454
|
+
children: i.text
|
|
1455
1455
|
});
|
|
1456
|
-
}), /* @__PURE__ */ s.jsx(wn, { className:
|
|
1457
|
-
|
|
1456
|
+
}), /* @__PURE__ */ s.jsx(wn, { className: S("download-section", n), children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1457
|
+
N.createElement(typeof e == "string" ? "h2" : e.element, { className: "text" }, typeof e == "string" ? e : e.text),
|
|
1458
1458
|
/* @__PURE__ */ s.jsx(ot, { buttons: r })
|
|
1459
1459
|
] }) });
|
|
1460
1460
|
};
|
|
@@ -1462,26 +1462,26 @@ const ho = ({ title: e = !1, logos: t = [], className: n = "" }) => {
|
|
|
1462
1462
|
const r = t.length;
|
|
1463
1463
|
if (r === 0)
|
|
1464
1464
|
return null;
|
|
1465
|
-
const
|
|
1465
|
+
const i = {
|
|
1466
1466
|
element: typeof e == "object" ? e.element : "h2",
|
|
1467
1467
|
text: typeof e == "string" ? e : typeof e == "object" ? e.text : ""
|
|
1468
1468
|
};
|
|
1469
|
-
return /* @__PURE__ */ s.jsxs("div", { className:
|
|
1470
|
-
e &&
|
|
1469
|
+
return /* @__PURE__ */ s.jsxs("div", { className: S("logos", n), children: [
|
|
1470
|
+
e && N.createElement(i.element, { className: "title" }, i.text),
|
|
1471
1471
|
/* @__PURE__ */ s.jsx(
|
|
1472
1472
|
"ul",
|
|
1473
1473
|
{
|
|
1474
|
-
className:
|
|
1474
|
+
className: S({ "two-col": r === 2 || r === 4, "three-col": r === 5 || r <= 10 && r % 3 === 0 }),
|
|
1475
1475
|
children: t.map(
|
|
1476
|
-
({ logo:
|
|
1477
|
-
if (!
|
|
1476
|
+
({ logo: c, nameOfBusiness: d, link: o = !1, description: a = !1 }, u) => {
|
|
1477
|
+
if (!c || !c.url)
|
|
1478
1478
|
return null;
|
|
1479
|
-
const
|
|
1479
|
+
const l = /* @__PURE__ */ s.jsx(
|
|
1480
1480
|
"img",
|
|
1481
1481
|
{
|
|
1482
|
-
src:
|
|
1483
|
-
width:
|
|
1484
|
-
height:
|
|
1482
|
+
src: c.url,
|
|
1483
|
+
width: c.width || "auto",
|
|
1484
|
+
height: c.height || "auto",
|
|
1485
1485
|
alt: d
|
|
1486
1486
|
}
|
|
1487
1487
|
);
|
|
@@ -1492,11 +1492,11 @@ const ho = ({ title: e = !1, logos: t = [], className: n = "" }) => {
|
|
|
1492
1492
|
href: o,
|
|
1493
1493
|
target: "_blank",
|
|
1494
1494
|
rel: "nofollow noreferrer noopener",
|
|
1495
|
-
children:
|
|
1495
|
+
children: l
|
|
1496
1496
|
}
|
|
1497
|
-
) :
|
|
1498
|
-
|
|
1499
|
-
] }, window.btoa(`${
|
|
1497
|
+
) : l }),
|
|
1498
|
+
a && /* @__PURE__ */ s.jsx("small", { children: a })
|
|
1499
|
+
] }, window.btoa(`${c.url}_${u}`));
|
|
1500
1500
|
}
|
|
1501
1501
|
)
|
|
1502
1502
|
}
|
|
@@ -1517,68 +1517,88 @@ const Qs = [
|
|
|
1517
1517
|
"h6",
|
|
1518
1518
|
"blockquote",
|
|
1519
1519
|
"q"
|
|
1520
|
-
], Us = ({
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1520
|
+
], Us = ({
|
|
1521
|
+
className: e = "",
|
|
1522
|
+
content: t,
|
|
1523
|
+
image: n,
|
|
1524
|
+
variant: r = "default",
|
|
1525
|
+
spacing: i = "normal",
|
|
1526
|
+
cta: c,
|
|
1527
|
+
children: d
|
|
1528
|
+
}) => {
|
|
1529
|
+
const o = ["eyebrow", "title", "text"], a = { eyebrow: "small", title: "h1", text: "p" }, u = {};
|
|
1530
|
+
return o.forEach((l) => {
|
|
1531
|
+
if (!t[l]) {
|
|
1532
|
+
u[l] = !1;
|
|
1525
1533
|
return;
|
|
1526
1534
|
}
|
|
1527
|
-
if (typeof
|
|
1528
|
-
|
|
1529
|
-
const { text:
|
|
1530
|
-
if (
|
|
1535
|
+
if (typeof t[l] == "object") {
|
|
1536
|
+
u[l] = t[l];
|
|
1537
|
+
const { text: f, element: h } = t[l];
|
|
1538
|
+
if (h && Qs.includes(h.toLowerCase()))
|
|
1531
1539
|
return;
|
|
1532
|
-
|
|
1533
|
-
text:
|
|
1534
|
-
element:
|
|
1540
|
+
u[l] = {
|
|
1541
|
+
text: f,
|
|
1542
|
+
element: a[l]
|
|
1535
1543
|
};
|
|
1536
1544
|
return;
|
|
1537
1545
|
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
);
|
|
1553
|
-
}
|
|
1554
|
-
return null;
|
|
1546
|
+
u[l] = {
|
|
1547
|
+
text: t[l],
|
|
1548
|
+
element: a[l]
|
|
1549
|
+
};
|
|
1550
|
+
}), c && c.link && c.link[0] === "#" && (c.props || (c.props = {}), c.props.onClick = (l) => {
|
|
1551
|
+
l.preventDefault(), l.stopPropagation();
|
|
1552
|
+
const f = document.getElementById(c.link.substring(1));
|
|
1553
|
+
f && f.scrollIntoView({ behavior: "smooth" });
|
|
1554
|
+
}), /* @__PURE__ */ s.jsx(
|
|
1555
|
+
wn,
|
|
1556
|
+
{
|
|
1557
|
+
className: S("banner-section", r, i, e, {
|
|
1558
|
+
"has-image": n,
|
|
1559
|
+
"has-extra-spacing": i === "normal" && u.eyebrow && u.title
|
|
1555
1560
|
}),
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1561
|
+
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1562
|
+
/* @__PURE__ */ s.jsxs("div", { className: "content-wrapper", children: [
|
|
1563
|
+
o.map((l) => {
|
|
1564
|
+
if (u[l] && typeof u[l] == "object") {
|
|
1565
|
+
const { text: f, element: h = "" } = u[l];
|
|
1566
|
+
return N.createElement(
|
|
1567
|
+
h.toLowerCase(),
|
|
1568
|
+
{ key: l, className: l },
|
|
1569
|
+
f
|
|
1570
|
+
);
|
|
1571
|
+
}
|
|
1572
|
+
return null;
|
|
1573
|
+
}),
|
|
1574
|
+
d,
|
|
1575
|
+
c && c.text && c.link && /* @__PURE__ */ s.jsx(
|
|
1576
|
+
J,
|
|
1577
|
+
{
|
|
1578
|
+
variant: n || r === "light" ? "primary" : "secondary",
|
|
1579
|
+
size: { mobile: "medium", 768: "large" },
|
|
1580
|
+
href: c.link,
|
|
1581
|
+
...c.props,
|
|
1582
|
+
children: c.text
|
|
1583
|
+
}
|
|
1584
|
+
)
|
|
1585
|
+
] }),
|
|
1586
|
+
n && /* @__PURE__ */ s.jsx(Is, { image: { ...n, aspect: "banner" } })
|
|
1587
|
+
] })
|
|
1588
|
+
}
|
|
1589
|
+
);
|
|
1590
|
+
}, po = Ne(Us);
|
|
1571
1591
|
const go = ({
|
|
1572
1592
|
variant: e = "primary",
|
|
1573
1593
|
button: t = null,
|
|
1574
1594
|
title: n,
|
|
1575
1595
|
text: r,
|
|
1576
|
-
gtmContext:
|
|
1577
|
-
}) => !n && !r ? null : /* @__PURE__ */ s.jsxs("aside", { className:
|
|
1596
|
+
gtmContext: i
|
|
1597
|
+
}) => !n && !r ? null : /* @__PURE__ */ s.jsxs("aside", { className: S("marketing-block", e), children: [
|
|
1578
1598
|
n && /* @__PURE__ */ s.jsx("p", { className: "title", children: n }),
|
|
1579
1599
|
r && /* @__PURE__ */ s.jsx("p", { children: r }),
|
|
1580
|
-
t && /* @__PURE__ */ s.jsx(J, { variant: "secondary", size: "medium", href: t.link, className: "gtm-trackable", "data-gtm-event-context":
|
|
1581
|
-
] }),
|
|
1600
|
+
t && /* @__PURE__ */ s.jsx(J, { variant: "secondary", size: "medium", href: t.link, className: "gtm-trackable", "data-gtm-event-context": i, "data-gtm-event-type": "learn-more-click", children: t.text })
|
|
1601
|
+
] }), Nt = "https://storage.googleapis.com/apolitical-assets/", Oe = {
|
|
1582
1602
|
general: "hello@apolitical.co",
|
|
1583
1603
|
support: "concierge@apolitical.co",
|
|
1584
1604
|
"data-protection": {
|
|
@@ -1587,43 +1607,43 @@ const go = ({
|
|
|
1587
1607
|
}
|
|
1588
1608
|
}, _o = "200,000+";
|
|
1589
1609
|
const kn = ({ label: e = !1, className: t = "", children: n }) => {
|
|
1590
|
-
const r =
|
|
1591
|
-
return /* @__PURE__ */ s.jsxs("details", { className:
|
|
1610
|
+
const r = A();
|
|
1611
|
+
return /* @__PURE__ */ s.jsxs("details", { className: S("collapsible-section", t), children: [
|
|
1592
1612
|
/* @__PURE__ */ s.jsx("summary", { children: e || r.formatMessage({ id: "collapsibleSection_summary" }) }),
|
|
1593
1613
|
/* @__PURE__ */ s.jsx("div", { className: "content", children: n })
|
|
1594
1614
|
] });
|
|
1595
1615
|
};
|
|
1596
|
-
const Ee = ({ variant: e = "primary", className: t = "", children: n, ...r }) => /* @__PURE__ */ s.jsx("div", { className:
|
|
1616
|
+
const Ee = ({ variant: e = "primary", className: t = "", children: n, ...r }) => /* @__PURE__ */ s.jsx("div", { className: S("highlighted-text-box", e, t), ...r, children: n });
|
|
1597
1617
|
const it = ({ variant: e = "empty", text: t = !1, button: n = !1, className: r = "" }) => {
|
|
1598
|
-
let
|
|
1599
|
-
const
|
|
1600
|
-
if (
|
|
1618
|
+
let i = n && !!Object.keys(n).length;
|
|
1619
|
+
const c = typeof n == "object" && "breakpoints" in n, d = rt(c);
|
|
1620
|
+
if (c && typeof n == "object" && typeof d == "number") {
|
|
1601
1621
|
const f = Object.assign({}, n.breakpoints), h = xn(Object.keys(f));
|
|
1602
|
-
|
|
1622
|
+
i = bn(d, h, f);
|
|
1603
1623
|
}
|
|
1604
|
-
const { breakpoints: o, text:
|
|
1605
|
-
return /* @__PURE__ */ s.jsx(Ee, { variant: "subtle", className:
|
|
1624
|
+
const { breakpoints: o, text: a = "", component: u, ...l } = n;
|
|
1625
|
+
return /* @__PURE__ */ s.jsx(Ee, { variant: "subtle", className: S("empty-state-box", e, r), children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1606
1626
|
t && /* @__PURE__ */ s.jsx(nt, { options: { forceBlock: !0 }, children: t }),
|
|
1607
|
-
|
|
1627
|
+
i && typeof n == "object" && (u || /* @__PURE__ */ s.jsx(
|
|
1608
1628
|
J,
|
|
1609
1629
|
{
|
|
1610
|
-
...
|
|
1630
|
+
...l,
|
|
1611
1631
|
variant: n.variant ? n.variant : "secondary",
|
|
1612
|
-
children:
|
|
1632
|
+
children: a
|
|
1613
1633
|
}
|
|
1614
1634
|
))
|
|
1615
1635
|
] }) });
|
|
1616
1636
|
};
|
|
1617
|
-
const
|
|
1637
|
+
const At = ({ children: e, ...t }) => /* @__PURE__ */ s.jsx("p", { ...t, children: e }), jn = { q: At, blockquote: At };
|
|
1618
1638
|
for (let e = 1; e <= 6; e++)
|
|
1619
|
-
jn[`h${e}`] = { component:
|
|
1620
|
-
const zs = ({ type: e = "default", className: t = "", heading: n = !1, children: r }) => /* @__PURE__ */ s.jsxs("div", { className:
|
|
1639
|
+
jn[`h${e}`] = { component: At, props: { className: "title" } };
|
|
1640
|
+
const zs = ({ type: e = "default", className: t = "", heading: n = !1, children: r }) => /* @__PURE__ */ s.jsxs("div", { className: S("helper-text-box text-small", e, t), children: [
|
|
1621
1641
|
n && /* @__PURE__ */ s.jsx("p", { className: "title", children: n }),
|
|
1622
1642
|
typeof r == "string" ? /* @__PURE__ */ s.jsx(
|
|
1623
1643
|
nt,
|
|
1624
1644
|
{
|
|
1625
1645
|
options: {
|
|
1626
|
-
wrapper:
|
|
1646
|
+
wrapper: N.Fragment,
|
|
1627
1647
|
forceBlock: !0,
|
|
1628
1648
|
overrides: jn
|
|
1629
1649
|
},
|
|
@@ -1631,8 +1651,8 @@ const zs = ({ type: e = "default", className: t = "", heading: n = !1, children:
|
|
|
1631
1651
|
}
|
|
1632
1652
|
) : /* @__PURE__ */ s.jsx("p", { children: r })
|
|
1633
1653
|
] });
|
|
1634
|
-
const xo = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
1635
|
-
const
|
|
1654
|
+
const xo = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children: i }) => {
|
|
1655
|
+
const c = A(), d = ne(null), [o, a] = F(""), [u, l] = F("closed");
|
|
1636
1656
|
X(() => {
|
|
1637
1657
|
const p = d.current;
|
|
1638
1658
|
if (p)
|
|
@@ -1644,21 +1664,21 @@ const xo = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1644
1664
|
return;
|
|
1645
1665
|
const p = r.split(`
|
|
1646
1666
|
`);
|
|
1647
|
-
|
|
1667
|
+
a(p.length < 3 ? `${r.substring(0, 400)}...` : p.slice(0, 3).join(`
|
|
1648
1668
|
`));
|
|
1649
1669
|
}, [r]), X(() => {
|
|
1650
|
-
|
|
1651
|
-
}, [
|
|
1670
|
+
u === "ready-to-close" && l("closing");
|
|
1671
|
+
}, [u]);
|
|
1652
1672
|
const f = ({ propertyName: p }) => {
|
|
1653
|
-
p === "max-height" &&
|
|
1673
|
+
p === "max-height" && l((_) => _ === "opening" ? "open" : _ === "closing" ? "closed" : _);
|
|
1654
1674
|
};
|
|
1655
1675
|
if (!r)
|
|
1656
1676
|
return null;
|
|
1657
|
-
const h = ["opening", "open"].includes(
|
|
1658
|
-
return /* @__PURE__ */ s.jsxs(Ee, { variant: "subtle", className:
|
|
1659
|
-
/* @__PURE__ */ s.jsxs("div", { ref: d, className:
|
|
1660
|
-
/* @__PURE__ */ s.jsx(nt, { options: { forceBlock: !0 }, children:
|
|
1661
|
-
|
|
1677
|
+
const h = ["opening", "open"].includes(u);
|
|
1678
|
+
return /* @__PURE__ */ s.jsxs(Ee, { variant: "subtle", className: S("hide-show-text-box", e), children: [
|
|
1679
|
+
/* @__PURE__ */ s.jsxs("div", { ref: d, className: S("content", u), children: [
|
|
1680
|
+
/* @__PURE__ */ s.jsx(nt, { options: { forceBlock: !0 }, children: u === "closed" ? o : r }),
|
|
1681
|
+
u !== "closed" && i
|
|
1662
1682
|
] }),
|
|
1663
1683
|
/* @__PURE__ */ s.jsx("p", { className: "cta", children: /* @__PURE__ */ s.jsx(
|
|
1664
1684
|
J,
|
|
@@ -1666,26 +1686,26 @@ const xo = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1666
1686
|
variant: "tertiary",
|
|
1667
1687
|
icon: { icon: "navigation_arrow", position: "left", animate: !0 },
|
|
1668
1688
|
styling: { muted: !0 },
|
|
1669
|
-
className:
|
|
1689
|
+
className: S({ "rotate-180": h }),
|
|
1670
1690
|
onClick: () => {
|
|
1671
|
-
|
|
1691
|
+
l(h ? "ready-to-close" : "opening");
|
|
1672
1692
|
},
|
|
1673
|
-
children: h ? n ||
|
|
1693
|
+
children: h ? n || c.formatMessage({ id: "hideShowTextBox_hide" }) : t || c.formatMessage({ id: "hideShowTextBox_show" })
|
|
1674
1694
|
}
|
|
1675
1695
|
) })
|
|
1676
1696
|
] });
|
|
1677
|
-
}, Ws = () =>
|
|
1678
|
-
const t =
|
|
1697
|
+
}, Ws = () => N.Fragment, Vs = ({ children: e }) => /* @__PURE__ */ s.jsx(Ee, { variant: "secondary", children: e }), Ys = ["span", "strong", "h1", "h2", "h3", "h4", "h5", "h6", "p"], Gs = ({ children: e }) => {
|
|
1698
|
+
const t = A();
|
|
1679
1699
|
if (!e)
|
|
1680
1700
|
return null;
|
|
1681
1701
|
let n = t.formatMessage({ id: "markdown_collapsibleSection_summary" });
|
|
1682
1702
|
const r = [];
|
|
1683
|
-
for (const
|
|
1684
|
-
if (!(!
|
|
1685
|
-
if (
|
|
1686
|
-
if (
|
|
1687
|
-
for (const d of Mt.toArray(
|
|
1688
|
-
if (!(!d || typeof d == "string" || typeof d == "number") &&
|
|
1703
|
+
for (const c of Mt.toArray(e))
|
|
1704
|
+
if (!(!c || typeof c == "string" || typeof c == "number"))
|
|
1705
|
+
if (N.isValidElement(c) && c.type === "summary") {
|
|
1706
|
+
if (c.props && c.props.children) {
|
|
1707
|
+
for (const d of Mt.toArray(c.props.children))
|
|
1708
|
+
if (!(!d || typeof d == "string" || typeof d == "number") && N.isValidElement(d)) {
|
|
1689
1709
|
const o = d.type;
|
|
1690
1710
|
if (Ys.includes(o)) {
|
|
1691
1711
|
for (n = d.props.children; typeof n != "string" && (Array.isArray(n) && n[0].props && n[0].props.children && n[0].props.children[0]); )
|
|
@@ -1695,14 +1715,14 @@ const xo = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1695
1715
|
}
|
|
1696
1716
|
}
|
|
1697
1717
|
} else
|
|
1698
|
-
r.push(
|
|
1699
|
-
const
|
|
1718
|
+
r.push(c);
|
|
1719
|
+
const i = n ? n.toString() : "";
|
|
1700
1720
|
return /* @__PURE__ */ s.jsx(
|
|
1701
1721
|
kn,
|
|
1702
1722
|
{
|
|
1703
|
-
label:
|
|
1704
|
-
className: ["Sources", "Resources"].includes(
|
|
1705
|
-
children: r.map((
|
|
1723
|
+
label: i,
|
|
1724
|
+
className: ["Sources", "Resources"].includes(i) ? "discrete-links" : "",
|
|
1725
|
+
children: r.map((c) => c)
|
|
1706
1726
|
}
|
|
1707
1727
|
);
|
|
1708
1728
|
}, Js = ({ children: e, ...t }) => {
|
|
@@ -1720,10 +1740,10 @@ const xo = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1720
1740
|
}
|
|
1721
1741
|
return /* @__PURE__ */ s.jsx("div", { ...t, children: e });
|
|
1722
1742
|
}, Xs = (e) => {
|
|
1723
|
-
const t =
|
|
1743
|
+
const t = A(), n = Date.now().toString();
|
|
1724
1744
|
let r = "default";
|
|
1725
|
-
const
|
|
1726
|
-
return
|
|
1745
|
+
const i = e.src;
|
|
1746
|
+
return i.includes("youtube") || i.includes("vimeo") ? r = "video" : i.includes("riddle") || i.includes("sli.do") ? r = "poll" : i.includes("padlet") && (r = "padlet"), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1727
1747
|
/* @__PURE__ */ s.jsx(le, { children: /* @__PURE__ */ s.jsx("a", { href: `#content-after-iframe-${n}`, children: t.formatMessage({ id: `markdown_skip${r === "default" ? "" : `_${r}`}` }) }) }),
|
|
1728
1748
|
/* @__PURE__ */ s.jsx("iframe", { ...e, title: t.formatMessage({ id: `markdown_iframe${r === "default" ? "" : `_${r}`}` }) }),
|
|
1729
1749
|
/* @__PURE__ */ s.jsx("span", { id: `content-after-iframe-${n}`, tabIndex: -1 })
|
|
@@ -1734,23 +1754,23 @@ const xo = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1734
1754
|
}, Zs = ({ children: e, ...t }) => {
|
|
1735
1755
|
let n = { ...t };
|
|
1736
1756
|
t.href && (t.href.includes("http:") || t.href.includes("https:")) && !t.target && (n.target = "_blank");
|
|
1737
|
-
let r = e,
|
|
1738
|
-
for (const
|
|
1739
|
-
if (!(!
|
|
1740
|
-
const d =
|
|
1741
|
-
if (["button", "center", "span", "strong"].includes(d) &&
|
|
1742
|
-
for ((d === "button" || rn(
|
|
1757
|
+
let r = e, i = !1;
|
|
1758
|
+
for (const c of Mt.toArray(e))
|
|
1759
|
+
if (!(!c || typeof c == "string" || typeof c == "number") && N.isValidElement(c)) {
|
|
1760
|
+
const d = c.type;
|
|
1761
|
+
if (["button", "center", "span", "strong"].includes(d) && c.props && c.props.children && c.props.children[0])
|
|
1762
|
+
for ((d === "button" || rn(c.props.children[0]) === "button") && (i = !0), r = c.props.children[0]; r && typeof r != "string" && !(typeof r == "boolean" || typeof r == "number" || !N.isValidElement(r)); )
|
|
1743
1763
|
if (r.props && r.props.children && r.props.children[0])
|
|
1744
|
-
r = r.props.children[0], r && rn(r) === "button" && (
|
|
1764
|
+
r = r.props.children[0], r && rn(r) === "button" && (i = !0);
|
|
1745
1765
|
else
|
|
1746
1766
|
break;
|
|
1747
1767
|
}
|
|
1748
|
-
return
|
|
1768
|
+
return i ? (n = { ...n, className: "button primary medium" }, /* @__PURE__ */ s.jsx("p", { className: "center", children: /* @__PURE__ */ s.jsx(J, { variant: "primary", size: "medium", ...n, children: r }) })) : /* @__PURE__ */ s.jsx("a", { ...n, children: r });
|
|
1749
1769
|
}, Ks = ({ children: e }) => /* @__PURE__ */ s.jsx("span", { children: e });
|
|
1750
1770
|
const on = ({ className: e = "", options: t = {}, children: n }) => {
|
|
1751
1771
|
n = n.replace(/^<br\/?>/, "");
|
|
1752
1772
|
const r = {
|
|
1753
|
-
wrapper:
|
|
1773
|
+
wrapper: N.Fragment,
|
|
1754
1774
|
forceBlock: !0,
|
|
1755
1775
|
overrides: {
|
|
1756
1776
|
a: Zs,
|
|
@@ -1767,47 +1787,47 @@ const on = ({ className: e = "", options: t = {}, children: n }) => {
|
|
|
1767
1787
|
iframe: Xs
|
|
1768
1788
|
}
|
|
1769
1789
|
};
|
|
1770
|
-
return /* @__PURE__ */ s.jsx("div", { className:
|
|
1790
|
+
return /* @__PURE__ */ s.jsx("div", { className: S("markdown-text", e), children: /* @__PURE__ */ s.jsx(nt, { options: { ...r, ...t }, children: n }) });
|
|
1771
1791
|
};
|
|
1772
|
-
const qs = ({ size: e = "medium", variant: t = "default", className: n = "", children: r }) => /* @__PURE__ */ s.jsx("span", { className:
|
|
1773
|
-
const Pt = ({ element: e = "p", children: t = null, className: n = "", ...r }) =>
|
|
1792
|
+
const qs = ({ size: e = "medium", variant: t = "default", className: n = "", children: r }) => /* @__PURE__ */ s.jsx("span", { className: S("pill", e, t, n), children: r });
|
|
1793
|
+
const Pt = ({ element: e = "p", children: t = null, className: n = "", ...r }) => N.createElement(e, { ...r, className: S("status-banner text-small", n), "aria-live": "assertive" }, t);
|
|
1774
1794
|
const er = ({ progress: e = 0, text: t = !1, className: n = "" }) => {
|
|
1775
|
-
const r =
|
|
1776
|
-
return /* @__PURE__ */ s.jsx("span", { className:
|
|
1777
|
-
}, tr =
|
|
1795
|
+
const r = A(), i = e > 75 ? 100 : e > 50 ? 75 : e > 25 ? 50 : e > 5 ? 25 : 0, c = { "--progress": `${e}%` };
|
|
1796
|
+
return /* @__PURE__ */ s.jsx("span", { className: S(`progress-bar section-${i}`, n), style: c, children: /* @__PURE__ */ s.jsx(le, { children: t ? `${e} ${t}` : r.formatMessage({ id: "progressBar" }, { number: e }) }) });
|
|
1797
|
+
}, tr = Ne(er);
|
|
1778
1798
|
const _t = "loadingBlock_", nr = ({ progress: e = 0, steps: t = !1, className: n = "" }) => {
|
|
1779
|
-
const r =
|
|
1799
|
+
const r = A();
|
|
1780
1800
|
t || (t = {
|
|
1781
1801
|
0: { text: r.formatMessage({ id: `${_t}loading` }) },
|
|
1782
1802
|
75: { text: r.formatMessage({ id: `${_t}almostDone` }) },
|
|
1783
1803
|
100: { text: r.formatMessage({ id: `${_t}complete` }) }
|
|
1784
1804
|
});
|
|
1785
|
-
let
|
|
1786
|
-
const
|
|
1787
|
-
for (let o = 0; o <
|
|
1788
|
-
|
|
1789
|
-
const d =
|
|
1805
|
+
let i = null;
|
|
1806
|
+
const c = Object.keys(t);
|
|
1807
|
+
for (let o = 0; o < c.length && !(e < parseInt(c[o])); o++)
|
|
1808
|
+
i = c[o];
|
|
1809
|
+
const d = i && t[i].icon ? { "--icon": `url(${Nt}icons/${t[i].icon}.svg)` } : {};
|
|
1790
1810
|
return /* @__PURE__ */ s.jsxs(
|
|
1791
1811
|
Ee,
|
|
1792
1812
|
{
|
|
1793
|
-
className:
|
|
1813
|
+
className: S("loading-block", n, { "has-icon": i && t[i].icon }),
|
|
1794
1814
|
variant: "subtle",
|
|
1795
1815
|
style: d,
|
|
1796
1816
|
children: [
|
|
1797
|
-
|
|
1817
|
+
i && /* @__PURE__ */ s.jsx("span", { className: "step", children: t[i].text }),
|
|
1798
1818
|
/* @__PURE__ */ s.jsx(tr, { progress: e })
|
|
1799
1819
|
]
|
|
1800
1820
|
}
|
|
1801
1821
|
);
|
|
1802
|
-
}, bo =
|
|
1803
|
-
const je = ({ element: e = "div", className: t = "", ...n }) => /* @__PURE__ */ s.jsx(gn, { element: e, className:
|
|
1822
|
+
}, bo = Ne(nr);
|
|
1823
|
+
const je = ({ element: e = "div", className: t = "", ...n }) => /* @__PURE__ */ s.jsx(gn, { element: e, className: S("loading-placeholder", t), ...n });
|
|
1804
1824
|
const Rt = {
|
|
1805
1825
|
header: ["logo", "link", "link", "search"],
|
|
1806
1826
|
sidebar: ["text", "text", "text", "text", "text"],
|
|
1807
1827
|
"cards-section": ["subtitle", "cards"],
|
|
1808
1828
|
cards: ["card", "card", "card", "card"],
|
|
1809
1829
|
"overview-page": ["header", "sidebar", "title", "text", "cards-section", "cards-section", "footer"]
|
|
1810
|
-
}, yn = (e, t) => e in Rt ? /* @__PURE__ */ s.jsx("div", { className: e, children: Rt[e].map((n, r) => yn(n, r)) }, t) : /* @__PURE__ */ s.jsx(je, { className: e }, t), sr = ({ layout: e = "overview-page" }) => /* @__PURE__ */ s.jsx("div", { className:
|
|
1830
|
+
}, yn = (e, t) => e in Rt ? /* @__PURE__ */ s.jsx("div", { className: e, children: Rt[e].map((n, r) => yn(n, r)) }, t) : /* @__PURE__ */ s.jsx(je, { className: e }, t), sr = ({ layout: e = "overview-page" }) => /* @__PURE__ */ s.jsx("div", { className: S("loading-state", e), children: Rt[e].map((t, n) => yn(t, n)) }), En = (e) => {
|
|
1811
1831
|
const t = e && e.toUpperCase().split(" ");
|
|
1812
1832
|
return Array.isArray(t) && t.length > 1 && t[0] !== "" ? t[1] === "" ? t[0][0] : t[0][0] + t[t.length - 1][0] : e ? e.substr(0, 1) : "";
|
|
1813
1833
|
}, ze = ["#5AB6A3", "#A2D7AF", "#806056", "#3962B3"], rr = (e) => {
|
|
@@ -1815,39 +1835,39 @@ const Rt = {
|
|
|
1815
1835
|
if (n === "")
|
|
1816
1836
|
return ze[0];
|
|
1817
1837
|
const r = n.charCodeAt(0) - 96;
|
|
1818
|
-
for (let
|
|
1819
|
-
if (r <= t * (
|
|
1820
|
-
return ze[
|
|
1838
|
+
for (let i = 0; i < ze.length; i++)
|
|
1839
|
+
if (r <= t * (i + 1))
|
|
1840
|
+
return ze[i];
|
|
1821
1841
|
};
|
|
1822
|
-
const an = 256, Ot = ({ className: e = "", src: t = "", name: n, alt: r, width:
|
|
1823
|
-
const [o,
|
|
1842
|
+
const an = 256, Ot = ({ className: e = "", src: t = "", name: n, alt: r, width: i = an, height: c = an, ...d }) => {
|
|
1843
|
+
const [o, a] = F(!1), u = ne(null);
|
|
1824
1844
|
X(() => {
|
|
1825
|
-
const f =
|
|
1845
|
+
const f = u.current;
|
|
1826
1846
|
if (!f)
|
|
1827
1847
|
return;
|
|
1828
1848
|
const h = f.getContext("2d");
|
|
1829
1849
|
if (!h)
|
|
1830
1850
|
return;
|
|
1831
|
-
const p =
|
|
1851
|
+
const p = i, _ = c;
|
|
1832
1852
|
typeof window < "u" && window.devicePixelRatio && (f.width = p * window.devicePixelRatio, f.height = _ * window.devicePixelRatio, h.scale(window.devicePixelRatio, window.devicePixelRatio)), h.fillStyle = rr(n), h.fillRect(0, 0, p, _), h.font = `${p / 3}px Arial`, h.textAlign = "center", h.fillStyle = "white", h.fillText(En(n), p / 2, _ / 1.6);
|
|
1833
1853
|
}, [n]);
|
|
1834
|
-
let
|
|
1835
|
-
return t && t !== "" && !o && (t.includes("http") || t.includes("//")) && (
|
|
1854
|
+
let l = !1;
|
|
1855
|
+
return t && t !== "" && !o && (t.includes("http") || t.includes("//")) && (l = !0), /* @__PURE__ */ s.jsx("figure", { className: S("profile-picture", e, { error: o }), ...d, children: l ? /* @__PURE__ */ s.jsx(
|
|
1836
1856
|
"img",
|
|
1837
1857
|
{
|
|
1838
1858
|
src: t,
|
|
1839
1859
|
alt: r || n,
|
|
1840
1860
|
onError: () => {
|
|
1841
|
-
|
|
1861
|
+
a(!0);
|
|
1842
1862
|
},
|
|
1843
|
-
width:
|
|
1844
|
-
height:
|
|
1863
|
+
width: i,
|
|
1864
|
+
height: c
|
|
1845
1865
|
}
|
|
1846
|
-
) : /* @__PURE__ */ s.jsx("canvas", { ref:
|
|
1866
|
+
) : /* @__PURE__ */ s.jsx("canvas", { ref: u }) });
|
|
1847
1867
|
}, Sn = (e) => e === "apolitical" ? {
|
|
1848
|
-
image: `${
|
|
1868
|
+
image: `${Nt}logos/member_apolitical.svg`
|
|
1849
1869
|
} : e === "community" || typeof e == "object" && !e.name ? {
|
|
1850
|
-
image: `${
|
|
1870
|
+
image: `${Nt}logos/member_community.svg`
|
|
1851
1871
|
} : {
|
|
1852
1872
|
name: e.name,
|
|
1853
1873
|
role: e.jobTitle || "",
|
|
@@ -1861,39 +1881,39 @@ const an = 256, Ot = ({ className: e = "", src: t = "", name: n, alt: r, width:
|
|
|
1861
1881
|
country: n = "",
|
|
1862
1882
|
maximumCharacters: r = 80
|
|
1863
1883
|
}) => {
|
|
1864
|
-
const
|
|
1865
|
-
if (!
|
|
1884
|
+
const i = e !== "", c = t !== "", d = n !== "";
|
|
1885
|
+
if (!i && !c && !d)
|
|
1866
1886
|
return "";
|
|
1867
|
-
const o = `${e}${
|
|
1868
|
-
let
|
|
1869
|
-
return
|
|
1887
|
+
const o = `${e}${i && c ? ` — ${t}` : t}`;
|
|
1888
|
+
let a = `${o}${(i || c) && d ? `, ${n}` : n}`;
|
|
1889
|
+
return a.length > r && (a = o), a.length > r && (a = tt(a, r)), a;
|
|
1870
1890
|
};
|
|
1871
1891
|
const Bt = ({
|
|
1872
1892
|
element: e = "div",
|
|
1873
1893
|
member: t = "community",
|
|
1874
1894
|
additionalContent: n = !1,
|
|
1875
1895
|
gtmContext: r = "member",
|
|
1876
|
-
gtmType:
|
|
1877
|
-
className:
|
|
1896
|
+
gtmType: i = "member-click",
|
|
1897
|
+
className: c = ""
|
|
1878
1898
|
}) => {
|
|
1879
|
-
const d =
|
|
1899
|
+
const d = A(), o = Sn(t);
|
|
1880
1900
|
o.name || (o.name = d.formatMessage({ id: `member_${typeof t == "string" ? t : "community"}` }));
|
|
1881
|
-
const { name:
|
|
1882
|
-
return
|
|
1883
|
-
className:
|
|
1901
|
+
const { name: a, url: u, image: l } = o, f = or(o), h = n && n.createdAt ? Cs(n.createdAt) : !1, p = n && n.createdAt ? Ms(n.createdAt) : "";
|
|
1902
|
+
return N.createElement(e, {
|
|
1903
|
+
className: S("member text-medium", c),
|
|
1884
1904
|
children: /* @__PURE__ */ s.jsxs(
|
|
1885
1905
|
at,
|
|
1886
1906
|
{
|
|
1887
|
-
href:
|
|
1888
|
-
gtmType:
|
|
1907
|
+
href: u,
|
|
1908
|
+
gtmType: i,
|
|
1889
1909
|
gtmContext: r,
|
|
1890
1910
|
onClick: (_) => {
|
|
1891
1911
|
_ == null || _.stopPropagation();
|
|
1892
1912
|
},
|
|
1893
1913
|
children: [
|
|
1894
|
-
/* @__PURE__ */ s.jsx(Ot, { name:
|
|
1914
|
+
/* @__PURE__ */ s.jsx(Ot, { name: a, src: l }),
|
|
1895
1915
|
/* @__PURE__ */ s.jsxs("p", { className: "details", children: [
|
|
1896
|
-
/* @__PURE__ */ s.jsx("strong", { children:
|
|
1916
|
+
/* @__PURE__ */ s.jsx("strong", { children: a }),
|
|
1897
1917
|
n && /* @__PURE__ */ s.jsxs("span", { className: "additional-content", children: [
|
|
1898
1918
|
n.createdAt && h && /* @__PURE__ */ s.jsx("span", { className: "date", title: p, "aria-label": p, children: d.formatMessage({ id: `dates_${h.path}` }, { number: h.number }) }),
|
|
1899
1919
|
n.didEdit && /* @__PURE__ */ s.jsx("em", { children: d.formatMessage({ id: "discussion_edited" }) })
|
|
@@ -1908,28 +1928,28 @@ const Bt = ({
|
|
|
1908
1928
|
const ln = {
|
|
1909
1929
|
small: 24,
|
|
1910
1930
|
medium: 48
|
|
1911
|
-
}, ar = ({ element: e = "div", contributors: { total: t, data: n } = { total: void 0, data: [] }, styling: { showText: r, size:
|
|
1912
|
-
const
|
|
1913
|
-
return !n || n.length === 0 ? null :
|
|
1931
|
+
}, ar = ({ element: e = "div", contributors: { total: t, data: n } = { total: void 0, data: [] }, styling: { showText: r, size: i, showGap: c, showPlaceholders: d } = { showText: !0, size: "medium", showGap: !0, showPlaceholders: !1 }, cutoff: o = 2, className: a = "" }) => {
|
|
1932
|
+
const u = A();
|
|
1933
|
+
return !n || n.length === 0 ? null : N.createElement(
|
|
1914
1934
|
e,
|
|
1915
|
-
{ className:
|
|
1916
|
-
/* @__PURE__ */ s.jsx("ul", { children: n.map((
|
|
1935
|
+
{ className: S("contributors", a, i, { "has-gap": c }), children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1936
|
+
/* @__PURE__ */ s.jsx("ul", { children: n.map((l, f) => {
|
|
1917
1937
|
let h, p = "";
|
|
1918
1938
|
if (f < o) {
|
|
1919
|
-
const { name: _ = "", image: j = "" } = Sn(
|
|
1939
|
+
const { name: _ = "", image: j = "" } = Sn(l);
|
|
1920
1940
|
if (d)
|
|
1921
1941
|
return /* @__PURE__ */ s.jsx(je, { element: "li", className: "contributor" }, f);
|
|
1922
|
-
h = /* @__PURE__ */ s.jsx(Ot, { name: _, src: j, width: ln[
|
|
1942
|
+
h = /* @__PURE__ */ s.jsx(Ot, { name: _, src: j, width: ln[i || "medium"], height: ln[i || "medium"] });
|
|
1923
1943
|
} else if (f === o) {
|
|
1924
1944
|
const _ = (t || n.length) - o;
|
|
1925
|
-
h = /* @__PURE__ */ s.jsxs("small", { className:
|
|
1945
|
+
h = /* @__PURE__ */ s.jsxs("small", { className: S({ "large-number": _ > 99 }), children: [
|
|
1926
1946
|
"+",
|
|
1927
1947
|
Fs(_, 0)
|
|
1928
1948
|
] }), p = "number-left";
|
|
1929
1949
|
}
|
|
1930
|
-
return h ? /* @__PURE__ */ s.jsx("li", { className:
|
|
1950
|
+
return h ? /* @__PURE__ */ s.jsx("li", { className: S("contributor", p), children: h }, f) : null;
|
|
1931
1951
|
}) }),
|
|
1932
|
-
r && /* @__PURE__ */ s.jsx("span", { className: "label", children: typeof r == "string" ? r : n.length === 1 ? typeof n[0] == "string" ?
|
|
1952
|
+
r && /* @__PURE__ */ s.jsx("span", { className: "label", children: typeof r == "string" ? r : n.length === 1 ? typeof n[0] == "string" ? u.formatMessage({ id: `member_${n[0]}` }) : tt(n[0].name || "", 20) : null })
|
|
1933
1953
|
] }) }
|
|
1934
1954
|
);
|
|
1935
1955
|
}, ir = ({ showDevTools: e = !0, children: t }) => {
|
|
@@ -1951,10 +1971,10 @@ const ln = {
|
|
|
1951
1971
|
};
|
|
1952
1972
|
var lr = Ft({ client: Xe });
|
|
1953
1973
|
function cr(e) {
|
|
1954
|
-
var t = e.children, n = e.client, r = e.apiKey,
|
|
1955
|
-
return n && r && console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."), n &&
|
|
1974
|
+
var t = e.children, n = e.client, r = e.apiKey, i = e.options, c = et(function() {
|
|
1975
|
+
return n && r && console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."), n && i && console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."), n || (r && (Xe.__loaded && console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."), Xe.init(r, i)), Xe);
|
|
1956
1976
|
}, [n, r]);
|
|
1957
|
-
return
|
|
1977
|
+
return N.createElement(lr.Provider, { value: { client: c } }, t);
|
|
1958
1978
|
}
|
|
1959
1979
|
const dr = ({ children: e, user: t }) => t.isLoading ? /* @__PURE__ */ s.jsx(s.Fragment, {}) : process.env.REACT_APP_PUBLIC_POSTHOG_KEY ? /* @__PURE__ */ s.jsx(
|
|
1960
1980
|
cr,
|
|
@@ -1973,45 +1993,45 @@ const dr = ({ children: e, user: t }) => t.isLoading ? /* @__PURE__ */ s.jsx(s.F
|
|
|
1973
1993
|
children: e
|
|
1974
1994
|
}
|
|
1975
1995
|
) : e, ur = ({ children: e, locale: t, messages: n }) => {
|
|
1976
|
-
const r = t || "en",
|
|
1996
|
+
const r = t || "en", i = {
|
|
1977
1997
|
...Rs[r],
|
|
1978
1998
|
...n || {}
|
|
1979
1999
|
};
|
|
1980
|
-
return /* @__PURE__ */ s.jsx(ls, { locale: r, messages:
|
|
2000
|
+
return /* @__PURE__ */ s.jsx(ls, { locale: r, messages: i, children: e });
|
|
1981
2001
|
}, Se = Ft(null), mr = ({ children: e, user: t }) => /* @__PURE__ */ s.jsx(Se.Provider, { value: t, children: e }), vo = ({ bootstrap: e, children: t, intl: n }) => {
|
|
1982
|
-
const [r,
|
|
2002
|
+
const [r, i] = F({ isLoading: !0 });
|
|
1983
2003
|
return X(() => {
|
|
1984
|
-
e().then((
|
|
2004
|
+
e().then((c) => i({ ...c, isLoading: !1 })).catch(() => i({ isLoading: !1 }));
|
|
1985
2005
|
}, []), /* @__PURE__ */ s.jsx(ur, { locale: n == null ? void 0 : n.locale, messages: n == null ? void 0 : n.messages, children: /* @__PURE__ */ s.jsx(mr, { user: r, children: /* @__PURE__ */ s.jsx(ir, { children: /* @__PURE__ */ s.jsx(dr, { user: r, children: t }) }) }) });
|
|
1986
2006
|
};
|
|
1987
2007
|
const xt = "joinCommunityButton", Tn = ({ isMember: e = !1, isShort: t = !1, functions: { join: n, leave: r } = { join: () => {
|
|
1988
2008
|
}, leave: () => {
|
|
1989
2009
|
} } }) => {
|
|
1990
|
-
const
|
|
2010
|
+
const i = A(), c = ge(Se), d = c && typeof c.id == "string", [o, a] = F(e), [u, l] = F(e ? "joined" : "notJoined");
|
|
1991
2011
|
X(() => {
|
|
1992
|
-
|
|
2012
|
+
u === "joining" ? l("joined") : u === "leaving" && l("notJoined");
|
|
1993
2013
|
}, [o]);
|
|
1994
2014
|
const f = {}, h = {};
|
|
1995
|
-
return o &&
|
|
2015
|
+
return o && u !== "leaving" && (f["data-hover-text"] = i.formatMessage({ id: `${xt}_leave` }), f["aria-label"] = i.formatMessage({ id: `${xt}_member_aria` }), h["aria-hidden"] = "true"), /* @__PURE__ */ s.jsx(
|
|
1996
2016
|
J,
|
|
1997
2017
|
{
|
|
1998
2018
|
variant: o ? "secondary" : "primary",
|
|
1999
2019
|
size: "medium",
|
|
2000
2020
|
styling: { fullWidth: !0 },
|
|
2001
|
-
icon: o &&
|
|
2021
|
+
icon: o && u !== "leaving" ? { icon: "tick", position: "left" } : !1,
|
|
2002
2022
|
onClick: async (p) => {
|
|
2003
|
-
d && (p.currentTarget.blur(), o ? (
|
|
2023
|
+
d && (p.currentTarget.blur(), o ? (l("leaving"), typeof r == "function" && await r()) : (l("joining"), typeof n == "function" && await n()), a(!o));
|
|
2004
2024
|
},
|
|
2005
|
-
className:
|
|
2025
|
+
className: S("join-community-button", u, { active: u === "joining" }),
|
|
2006
2026
|
disabled: !d,
|
|
2007
2027
|
...f,
|
|
2008
|
-
children: /* @__PURE__ */ s.jsx("span", { className: "text", ...h, children:
|
|
2028
|
+
children: /* @__PURE__ */ s.jsx("span", { className: "text", ...h, children: i.formatMessage({ id: `${xt}${["joining", "leaving"].includes(u) ? `_${u}` : o ? "_member" : t ? "_short" : ""}` }) })
|
|
2009
2029
|
}
|
|
2010
2030
|
);
|
|
2011
2031
|
};
|
|
2012
|
-
const bt = "communityDetails_", wo = ({ isMember: e = !1, slug: t, members: { number: n, data: r } = { number: void 0, data: [] }, className:
|
|
2013
|
-
const d =
|
|
2014
|
-
return /* @__PURE__ */ s.jsxs("div", { className:
|
|
2032
|
+
const bt = "communityDetails_", wo = ({ isMember: e = !1, slug: t, members: { number: n, data: r } = { number: void 0, data: [] }, className: i = "", ...c }) => {
|
|
2033
|
+
const d = A(), o = n || (r == null ? void 0 : r.length) || 0;
|
|
2034
|
+
return /* @__PURE__ */ s.jsxs("div", { className: S("community-details", i), children: [
|
|
2015
2035
|
/* @__PURE__ */ s.jsx(De, {}),
|
|
2016
2036
|
/* @__PURE__ */ s.jsxs("div", { className: "member-details", children: [
|
|
2017
2037
|
/* @__PURE__ */ s.jsxs("div", { className: "top", children: [
|
|
@@ -2023,7 +2043,7 @@ const bt = "communityDetails_", wo = ({ isMember: e = !1, slug: t, members: { nu
|
|
|
2023
2043
|
] }),
|
|
2024
2044
|
/* @__PURE__ */ s.jsx(ar, { contributors: { total: n, data: r != null && r.length ? r : [{}, {}, {}, {}, {}] }, styling: { size: "medium", showGap: !0, showPlaceholders: o === 0 }, cutoff: 5 })
|
|
2025
2045
|
] }),
|
|
2026
|
-
/* @__PURE__ */ s.jsx(Tn, { isMember: e, ...
|
|
2046
|
+
/* @__PURE__ */ s.jsx(Tn, { isMember: e, ...c }),
|
|
2027
2047
|
e && /* @__PURE__ */ s.jsx(J, { variant: "primary", icon: { icon: "plus" }, styling: { fullWidth: !0 }, children: d.formatMessage({ id: `${bt}invite` }) })
|
|
2028
2048
|
] });
|
|
2029
2049
|
};
|
|
@@ -2032,13 +2052,13 @@ const ko = ({
|
|
|
2032
2052
|
cutoff: t = 20,
|
|
2033
2053
|
className: n = ""
|
|
2034
2054
|
}) => {
|
|
2035
|
-
const r =
|
|
2055
|
+
const r = A();
|
|
2036
2056
|
return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2037
2057
|
/* @__PURE__ */ s.jsx(le, { element: "p", children: r.formatMessage({ id: "breadcrumbs_label" }) }),
|
|
2038
|
-
/* @__PURE__ */ s.jsx("ul", { className:
|
|
2058
|
+
/* @__PURE__ */ s.jsx("ul", { className: S("breadcrumbs text-small", n), children: e.map(({ text: i, href: c, current: d = !1 }, o) => /* @__PURE__ */ s.jsxs("li", { children: [
|
|
2039
2059
|
d && /* @__PURE__ */ s.jsx(le, { element: "span", children: r.formatMessage({ id: "breadcrumbs_currentPage" }) }),
|
|
2040
|
-
/* @__PURE__ */ s.jsx(at, { href: d ? void 0 :
|
|
2041
|
-
] }, `${window.btoa(
|
|
2060
|
+
/* @__PURE__ */ s.jsx(at, { href: d ? void 0 : c, children: tt(i, t) })
|
|
2061
|
+
] }, `${window.btoa(i)}_${o}`)) })
|
|
2042
2062
|
] });
|
|
2043
2063
|
};
|
|
2044
2064
|
const jo = ({
|
|
@@ -2047,34 +2067,34 @@ const jo = ({
|
|
|
2047
2067
|
allowMultiple: n = !0,
|
|
2048
2068
|
onChange: r = () => {
|
|
2049
2069
|
},
|
|
2050
|
-
className:
|
|
2070
|
+
className: i = ""
|
|
2051
2071
|
}) => {
|
|
2052
|
-
const
|
|
2072
|
+
const c = A(), d = t ? [{ id: "all", text: typeof t != "boolean" && t.text || c.formatMessage({ id: "filters_all" }) }, ...e] : e, [o, a] = F(t ? ["all"] : []), u = (l, f) => {
|
|
2053
2073
|
let h = [];
|
|
2054
|
-
o.includes(
|
|
2074
|
+
o.includes(l) ? h = o.filter((p) => p !== l) : l === "all" ? h = ["all"] : n ? h = [...o.filter((p) => p !== "all"), l] : h = [l], a((p) => (r && typeof r == "function" && r({ current: h, previous: p }), h)), f && typeof f == "function" && f();
|
|
2055
2075
|
};
|
|
2056
|
-
return /* @__PURE__ */ s.jsx("ul", { className:
|
|
2076
|
+
return /* @__PURE__ */ s.jsx("ul", { className: S("filters", i), children: d.map(({ id: l, text: f, disabled: h = !1, callback: p = () => {
|
|
2057
2077
|
} }) => {
|
|
2058
2078
|
let _ = {};
|
|
2059
|
-
return h && (_ = { disabled: !0, "aria-label":
|
|
2079
|
+
return h && (_ = { disabled: !0, "aria-label": c.formatMessage({ id: "filters_disabled" }, { name: f }) }), /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(
|
|
2060
2080
|
"button",
|
|
2061
2081
|
{
|
|
2062
|
-
className:
|
|
2082
|
+
className: S(l, { selected: o.includes(l) }),
|
|
2063
2083
|
onClick: (j) => {
|
|
2064
|
-
j.preventDefault(), j.stopPropagation(),
|
|
2084
|
+
j.preventDefault(), j.stopPropagation(), u(l, p);
|
|
2065
2085
|
},
|
|
2066
2086
|
..._,
|
|
2067
2087
|
children: f
|
|
2068
2088
|
}
|
|
2069
|
-
) },
|
|
2089
|
+
) }, l);
|
|
2070
2090
|
}) });
|
|
2071
2091
|
}, fr = (e, t) => {
|
|
2072
2092
|
const n = String(e);
|
|
2073
2093
|
if (!t || !t.length)
|
|
2074
2094
|
return `/${n}`;
|
|
2075
2095
|
let r = "";
|
|
2076
|
-
return t.forEach(({ url:
|
|
2077
|
-
|
|
2096
|
+
return t.forEach(({ url: i, position: c }) => {
|
|
2097
|
+
c === "before-lang" ? r += `/${i}` : (r.includes(`/${n}/`) || (r += `/${n}`), r += `/${i}`);
|
|
2078
2098
|
}), r.includes(`/${n}/`) || (r += `/${n}`), r;
|
|
2079
2099
|
};
|
|
2080
2100
|
const vt = { en: "English", es: "Español", fr: "Français", pt: "Português" }, We = "languageSwitcher_", yo = ({
|
|
@@ -2082,41 +2102,41 @@ const vt = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2082
2102
|
isOriginalLanguage: t = !1,
|
|
2083
2103
|
isHumanTranslation: n = !1,
|
|
2084
2104
|
translations: r,
|
|
2085
|
-
onChange:
|
|
2105
|
+
onChange: i = () => {
|
|
2086
2106
|
},
|
|
2087
|
-
urlParts:
|
|
2107
|
+
urlParts: c,
|
|
2088
2108
|
variant: d = "default",
|
|
2089
2109
|
label: o,
|
|
2090
|
-
className:
|
|
2110
|
+
className: a = ""
|
|
2091
2111
|
}) => {
|
|
2092
|
-
const
|
|
2112
|
+
const u = A(), [l, f] = F(e);
|
|
2093
2113
|
if (X(() => {
|
|
2094
|
-
e !==
|
|
2114
|
+
e !== l && f(e);
|
|
2095
2115
|
}, [e]), !r || !Object.values(r).some((j) => j && j.post_name))
|
|
2096
2116
|
return null;
|
|
2097
|
-
const p = Object.keys(r), _ =
|
|
2098
|
-
return /* @__PURE__ */ s.jsxs("div", { className:
|
|
2117
|
+
const p = Object.keys(r), _ = l !== e;
|
|
2118
|
+
return /* @__PURE__ */ s.jsxs("div", { className: S("language-switcher text-small", d, a), children: [
|
|
2099
2119
|
/* @__PURE__ */ s.jsxs("nav", { children: [
|
|
2100
|
-
d !== "short" && /* @__PURE__ */ s.jsx("p", { children: o ||
|
|
2120
|
+
d !== "short" && /* @__PURE__ */ s.jsx("p", { children: o || u.formatMessage({ id: `${We}label` }) }),
|
|
2101
2121
|
/* @__PURE__ */ s.jsx("ul", { children: p.map((j) => {
|
|
2102
2122
|
if (!vt[j])
|
|
2103
2123
|
return null;
|
|
2104
2124
|
let g = { className: j };
|
|
2105
|
-
return
|
|
2125
|
+
return l === j ? g["aria-label"] = u.formatMessage({ id: `${We}selected` }, { language: vt[j] }) : g = {
|
|
2106
2126
|
...g,
|
|
2107
|
-
href: fr(j,
|
|
2108
|
-
onClick: (
|
|
2109
|
-
|
|
2127
|
+
href: fr(j, c),
|
|
2128
|
+
onClick: (E) => {
|
|
2129
|
+
E.preventDefault(), E.stopPropagation(), f(j), i(j);
|
|
2110
2130
|
}
|
|
2111
2131
|
}, /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(at, { ...g, fallbackElement: "span", children: vt[j] }) }, j);
|
|
2112
2132
|
}) }),
|
|
2113
|
-
d !== "short" && !_ && /* @__PURE__ */ s.jsx("p", { children:
|
|
2133
|
+
d !== "short" && !_ && /* @__PURE__ */ s.jsx("p", { children: u.formatMessage({ id: `${We}translation_${t ? "original" : n ? "human" : "machine"}` }) })
|
|
2114
2134
|
] }),
|
|
2115
2135
|
d !== "short" && !_ && !t && !n && /* @__PURE__ */ s.jsx("small", {
|
|
2116
2136
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2117
2137
|
// @ts-ignore
|
|
2118
2138
|
// `values` are throwing a type error: https://github.com/formatjs/formatjs/issues/3633
|
|
2119
|
-
children:
|
|
2139
|
+
children: u.formatMessage({ id: `${We}disclaimer` }, {
|
|
2120
2140
|
email: Oe.support,
|
|
2121
2141
|
link: (j) => {
|
|
2122
2142
|
const g = `mailto:${j}`;
|
|
@@ -2132,8 +2152,8 @@ const wt = cs({ locale: "en", messages: Lt }), hr = ({
|
|
|
2132
2152
|
limit: n = 10,
|
|
2133
2153
|
loadNextPage: r = () => {
|
|
2134
2154
|
},
|
|
2135
|
-
icon:
|
|
2136
|
-
messages:
|
|
2155
|
+
icon: i = !1,
|
|
2156
|
+
messages: c = {
|
|
2137
2157
|
button: wt.formatMessage({ id: "loadMore_button" }),
|
|
2138
2158
|
endOfFeed: wt.formatMessage({ id: "loadMore_endOfFeed" }),
|
|
2139
2159
|
error: wt.formatMessage({ id: "loadMore_error" })
|
|
@@ -2141,43 +2161,43 @@ const wt = cs({ locale: "en", messages: Lt }), hr = ({
|
|
|
2141
2161
|
className: d = "",
|
|
2142
2162
|
gtmContext: o = "LoadMore"
|
|
2143
2163
|
}) => {
|
|
2144
|
-
const [
|
|
2164
|
+
const [a, u] = F(!1), [l, f] = F(!1);
|
|
2145
2165
|
if (t <= 0 || t < n * e)
|
|
2146
2166
|
return null;
|
|
2147
2167
|
const h = async (p) => {
|
|
2148
2168
|
try {
|
|
2149
2169
|
await r(p);
|
|
2150
2170
|
} catch (_) {
|
|
2151
|
-
_ instanceof Error && _.message && _.message.includes("Cannot read items") ? f(!0) :
|
|
2171
|
+
_ instanceof Error && _.message && _.message.includes("Cannot read items") ? f(!0) : u(!0);
|
|
2152
2172
|
}
|
|
2153
2173
|
};
|
|
2154
|
-
return /* @__PURE__ */ s.jsxs("footer", { className:
|
|
2155
|
-
|
|
2156
|
-
|
|
2174
|
+
return /* @__PURE__ */ s.jsxs("footer", { className: S("load-more", d), children: [
|
|
2175
|
+
a && /* @__PURE__ */ s.jsx("p", { className: "error", children: c.error }),
|
|
2176
|
+
l ? /* @__PURE__ */ s.jsx("p", { children: c.endOfFeed }) : /* @__PURE__ */ s.jsx(
|
|
2157
2177
|
J,
|
|
2158
2178
|
{
|
|
2159
2179
|
variant: "secondary",
|
|
2160
|
-
icon:
|
|
2180
|
+
icon: i,
|
|
2161
2181
|
onClick: h,
|
|
2162
2182
|
"data-gtm-event-context": o,
|
|
2163
2183
|
"data-gtm-event-type": "load-more-click",
|
|
2164
2184
|
className: "gtm-trackable",
|
|
2165
2185
|
"data-testid": "load-more-button",
|
|
2166
|
-
children:
|
|
2186
|
+
children: c.button
|
|
2167
2187
|
}
|
|
2168
2188
|
)
|
|
2169
2189
|
] });
|
|
2170
2190
|
};
|
|
2171
2191
|
let Ve = !1;
|
|
2172
2192
|
const pr = ({ element: e = "div", id: t = "more-menu", options: n, className: r = "" }) => {
|
|
2173
|
-
const
|
|
2174
|
-
|
|
2193
|
+
const i = A(), c = ne(null), [d, o] = F(!1), a = (u) => {
|
|
2194
|
+
c.current && u.target instanceof HTMLElement && !c.current.contains(u.target) && o(!1);
|
|
2175
2195
|
};
|
|
2176
|
-
return X(() => (document.addEventListener("click",
|
|
2177
|
-
document.removeEventListener("click",
|
|
2178
|
-
})),
|
|
2179
|
-
ref:
|
|
2180
|
-
className:
|
|
2196
|
+
return X(() => (document.addEventListener("click", a, !0), () => {
|
|
2197
|
+
document.removeEventListener("click", a, !0);
|
|
2198
|
+
})), N.createElement(e, {
|
|
2199
|
+
ref: c,
|
|
2200
|
+
className: S("more-menu text-medium", r),
|
|
2181
2201
|
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2182
2202
|
/* @__PURE__ */ s.jsx(
|
|
2183
2203
|
J,
|
|
@@ -2189,14 +2209,14 @@ const pr = ({ element: e = "div", id: t = "more-menu", options: n, className: r
|
|
|
2189
2209
|
"aria-haspopup": "true",
|
|
2190
2210
|
"aria-expanded": d,
|
|
2191
2211
|
"aria-controls": t,
|
|
2192
|
-
screenreaderText:
|
|
2212
|
+
screenreaderText: i.formatMessage({ id: "moreMenu" })
|
|
2193
2213
|
}
|
|
2194
2214
|
),
|
|
2195
|
-
/* @__PURE__ */ s.jsx("ul", { id: t, hidden: !d, children: n.map(({ href:
|
|
2215
|
+
/* @__PURE__ */ s.jsx("ul", { id: t, hidden: !d, children: n.map(({ href: u, onClick: l, text: f, icon: h, ...p }, _) => {
|
|
2196
2216
|
const j = {
|
|
2197
2217
|
...p,
|
|
2198
2218
|
onClick: (g) => {
|
|
2199
|
-
o(!1), typeof
|
|
2219
|
+
o(!1), typeof l == "function" && l(g);
|
|
2200
2220
|
},
|
|
2201
2221
|
onFocus: () => {
|
|
2202
2222
|
Ve && (clearTimeout(Ve), Ve = !1);
|
|
@@ -2207,7 +2227,7 @@ const pr = ({ element: e = "div", id: t = "more-menu", options: n, className: r
|
|
|
2207
2227
|
}, 100);
|
|
2208
2228
|
}
|
|
2209
2229
|
};
|
|
2210
|
-
return
|
|
2230
|
+
return u && (j.href = u), /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(
|
|
2211
2231
|
J,
|
|
2212
2232
|
{
|
|
2213
2233
|
variant: "tertiary",
|
|
@@ -2221,59 +2241,59 @@ const pr = ({ element: e = "div", id: t = "more-menu", options: n, className: r
|
|
|
2221
2241
|
] })
|
|
2222
2242
|
});
|
|
2223
2243
|
};
|
|
2224
|
-
const $n = ({ variant: e = "default", version: t = "default", className: n = "", ...r }) => /* @__PURE__ */ s.jsx("p", { className: "logo-wrapper", children: /* @__PURE__ */ s.jsx("a", { href: "/home/", className:
|
|
2244
|
+
const $n = ({ variant: e = "default", version: t = "default", className: n = "", ...r }) => /* @__PURE__ */ s.jsx("p", { className: "logo-wrapper", children: /* @__PURE__ */ s.jsx("a", { href: "/home/", className: S("logo", e, t, n), ...r, children: /* @__PURE__ */ s.jsx(le, { children: /* @__PURE__ */ s.jsx(ye, { id: "apolitical" }) }) }) });
|
|
2225
2245
|
const gr = {
|
|
2226
2246
|
"2-1": 901
|
|
2227
2247
|
}, Eo = ({ layout: e = "2-1", hideOnMobile: t = !1, className: n = "", children: r }) => {
|
|
2228
|
-
const
|
|
2229
|
-
let
|
|
2230
|
-
return
|
|
2248
|
+
const i = rt(!0);
|
|
2249
|
+
let c = r;
|
|
2250
|
+
return N.Children.count(r) === 1 && (c = N.Children.toArray(r)[0], c.props && (c = c.props.children)), /* @__PURE__ */ s.jsx("section", { className: S("columns", `layout-${e}`, n), children: N.Children.map(c, (d, o) => t !== !1 && o === t && i && i < gr[e] ? null : d) });
|
|
2231
2251
|
};
|
|
2232
2252
|
const kt = "cookieBanner_", jt = ["apol-cookie-banner", "apolitical-performance-cookie-consent", "functional-cookie-consent"], yt = new Date(Date.now() + 12 * 30 * 24 * 60 * 60 * 1e3), _r = () => {
|
|
2233
|
-
const e =
|
|
2234
|
-
jt.forEach((
|
|
2235
|
-
n(
|
|
2253
|
+
const e = A(), [t, n, r] = fs(jt), [i, c] = F(!t["apol-cookie-banner"]), d = () => {
|
|
2254
|
+
jt.forEach((l) => {
|
|
2255
|
+
n(l, !0, {
|
|
2236
2256
|
path: "/",
|
|
2237
2257
|
expires: yt,
|
|
2238
|
-
domain:
|
|
2258
|
+
domain: l === "apolitical-performance-cookie-consent" ? ".apolitical.co" : void 0
|
|
2239
2259
|
});
|
|
2240
|
-
}),
|
|
2260
|
+
}), c(!1), window.location.reload();
|
|
2241
2261
|
}, o = () => {
|
|
2242
2262
|
n("apol-cookie-banner", !0, {
|
|
2243
2263
|
path: "/",
|
|
2244
2264
|
expires: yt
|
|
2245
|
-
}), jt.forEach((
|
|
2246
|
-
if (
|
|
2247
|
-
n(
|
|
2265
|
+
}), jt.forEach((l) => {
|
|
2266
|
+
if (l === "apol-cookie-banner") {
|
|
2267
|
+
n(l, !0, {
|
|
2248
2268
|
path: "/",
|
|
2249
2269
|
expires: yt
|
|
2250
2270
|
});
|
|
2251
2271
|
return;
|
|
2252
2272
|
}
|
|
2253
|
-
r(
|
|
2254
|
-
}),
|
|
2273
|
+
r(l);
|
|
2274
|
+
}), c(!1);
|
|
2255
2275
|
};
|
|
2256
|
-
if (!
|
|
2276
|
+
if (!i)
|
|
2257
2277
|
return null;
|
|
2258
|
-
const
|
|
2278
|
+
const a = [
|
|
2259
2279
|
{ id: "settings", href: "/pages/cookie-policy", gtmType: "policy-page" },
|
|
2260
2280
|
{ id: "reject", onClick: o, gtmType: "reject-all" },
|
|
2261
2281
|
{ id: "accept", onClick: d, gtmType: "accepted-all" }
|
|
2262
|
-
],
|
|
2263
|
-
return
|
|
2264
|
-
|
|
2265
|
-
variant:
|
|
2266
|
-
href:
|
|
2267
|
-
onClick:
|
|
2282
|
+
], u = [];
|
|
2283
|
+
return a.forEach((l) => {
|
|
2284
|
+
u.push({
|
|
2285
|
+
variant: l.href ? "tertiary" : "primary",
|
|
2286
|
+
href: l.href,
|
|
2287
|
+
onClick: l.onClick,
|
|
2268
2288
|
className: "gtm-trackable",
|
|
2269
2289
|
"data-gtm-event-context": "cookie-banner",
|
|
2270
|
-
"data-gtm-event-type": `cookie-${
|
|
2271
|
-
children: e.formatMessage({ id: `${kt}buttons_${
|
|
2290
|
+
"data-gtm-event-type": `cookie-${l.gtmType}-click`,
|
|
2291
|
+
children: e.formatMessage({ id: `${kt}buttons_${l.id}` })
|
|
2272
2292
|
});
|
|
2273
2293
|
}), /* @__PURE__ */ s.jsxs("aside", { id: "cookie-banner", className: "text-medium", children: [
|
|
2274
2294
|
/* @__PURE__ */ s.jsx("h6", { children: e.formatMessage({ id: `${kt}title` }) }),
|
|
2275
2295
|
/* @__PURE__ */ s.jsx("p", { children: e.formatMessage({ id: `${kt}text` }) }),
|
|
2276
|
-
/* @__PURE__ */ s.jsx(ot, { buttons:
|
|
2296
|
+
/* @__PURE__ */ s.jsx(ot, { buttons: u })
|
|
2277
2297
|
] });
|
|
2278
2298
|
}, we = {
|
|
2279
2299
|
platform: {
|
|
@@ -2377,14 +2397,14 @@ const Me = "footer_", Ze = "SiteFooter", cn = ({ group: e }) => {
|
|
|
2377
2397
|
Array.isArray(t) && t.length > 0 && /* @__PURE__ */ s.jsx("ul", { className: "text-medium", children: t.map((r) => {
|
|
2378
2398
|
if (["order", "child", "text"].includes(r))
|
|
2379
2399
|
return null;
|
|
2380
|
-
const { href:
|
|
2400
|
+
const { href: i, gtmType: c } = we[e][r], d = {};
|
|
2381
2401
|
return ["legal"].includes(e) && (d.target = "_blank", d.rel = "noopener"), /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(
|
|
2382
2402
|
"a",
|
|
2383
2403
|
{
|
|
2384
|
-
href:
|
|
2404
|
+
href: i,
|
|
2385
2405
|
className: "gtm-trackable",
|
|
2386
2406
|
"data-gtm-event-context": Ze,
|
|
2387
|
-
"data-gtm-event-type":
|
|
2407
|
+
"data-gtm-event-type": c,
|
|
2388
2408
|
...d,
|
|
2389
2409
|
children: /* @__PURE__ */ s.jsx(ye, { id: `${Me}${e}_${r}` })
|
|
2390
2410
|
}
|
|
@@ -2444,7 +2464,7 @@ const Me = "footer_", Ze = "SiteFooter", cn = ({ group: e }) => {
|
|
|
2444
2464
|
] })
|
|
2445
2465
|
] }) });
|
|
2446
2466
|
const Ye = "emailHelperTextBox_", So = ({ type: e, email: t, redirectPath: n, resendVerificationCode: r }) => {
|
|
2447
|
-
const
|
|
2467
|
+
const i = A(), [c, d] = F({ path: `${Ye}default`, type: "default", link: {}, mail: {}, error: "" }), [o, a] = F(!1), u = ke(
|
|
2448
2468
|
(p) => {
|
|
2449
2469
|
p.preventDefault(), p.stopPropagation();
|
|
2450
2470
|
const _ = (j) => {
|
|
@@ -2455,7 +2475,7 @@ const Ye = "emailHelperTextBox_", So = ({ type: e, email: t, redirectPath: n, re
|
|
|
2455
2475
|
"data-gtm-event-context": "VerifyEmailBox",
|
|
2456
2476
|
"data-gtm-event-type": "SendEmailClick",
|
|
2457
2477
|
className: "gtm-trackable",
|
|
2458
|
-
onClick: (g) =>
|
|
2478
|
+
onClick: (g) => u(g),
|
|
2459
2479
|
href: "#",
|
|
2460
2480
|
"data-testid": "send-verify-email-click"
|
|
2461
2481
|
},
|
|
@@ -2469,15 +2489,15 @@ const Ye = "emailHelperTextBox_", So = ({ type: e, email: t, redirectPath: n, re
|
|
|
2469
2489
|
});
|
|
2470
2490
|
};
|
|
2471
2491
|
if (typeof r != "function") {
|
|
2472
|
-
_(
|
|
2492
|
+
_(i.formatMessage({ id: `${Ye}error_noFunction` }));
|
|
2473
2493
|
return;
|
|
2474
2494
|
}
|
|
2475
|
-
|
|
2495
|
+
a(!0), r(t).then(() => {
|
|
2476
2496
|
localStorage.setItem("email", t), window.location.href = n || "/signup/verify-email";
|
|
2477
2497
|
}).catch((j) => {
|
|
2478
2498
|
_(j.message);
|
|
2479
2499
|
}).finally(() => {
|
|
2480
|
-
|
|
2500
|
+
a(!1);
|
|
2481
2501
|
});
|
|
2482
2502
|
},
|
|
2483
2503
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
@@ -2511,7 +2531,7 @@ const Ye = "emailHelperTextBox_", So = ({ type: e, email: t, redirectPath: n, re
|
|
|
2511
2531
|
"data-gtm-event-context": "VerifyEmailBox",
|
|
2512
2532
|
"data-gtm-event-type": "SendEmailClick",
|
|
2513
2533
|
className: "gtm-trackable",
|
|
2514
|
-
onClick: (
|
|
2534
|
+
onClick: (E) => u(E),
|
|
2515
2535
|
"data-testid": "send-verify-email-click"
|
|
2516
2536
|
};
|
|
2517
2537
|
break;
|
|
@@ -2535,45 +2555,45 @@ const Ye = "emailHelperTextBox_", So = ({ type: e, email: t, redirectPath: n, re
|
|
|
2535
2555
|
};
|
|
2536
2556
|
break;
|
|
2537
2557
|
}
|
|
2538
|
-
d({ ...
|
|
2558
|
+
d({ ...c, path: p, type: _, link: j, mail: g });
|
|
2539
2559
|
},
|
|
2540
2560
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2541
2561
|
[e]
|
|
2542
2562
|
);
|
|
2543
|
-
const
|
|
2563
|
+
const l = {};
|
|
2544
2564
|
return ["link", "mail"].forEach((p) => {
|
|
2545
|
-
|
|
2546
|
-
}), /* @__PURE__ */ s.jsx(zs, { type:
|
|
2565
|
+
l[p] = Object.keys(c[p]).length ? (_) => /* @__PURE__ */ s.jsx("a", { ...c[p], children: _ }) : (_) => _;
|
|
2566
|
+
}), /* @__PURE__ */ s.jsx(zs, { type: c.type, heading: o ? !1 : i.formatMessage({ id: `${c.path}_title` }), children: o ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2547
2567
|
/* @__PURE__ */ s.jsx(je, { element: "span" }),
|
|
2548
2568
|
/* @__PURE__ */ s.jsx(je, { element: "span" })
|
|
2549
2569
|
] }) : (
|
|
2550
2570
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2551
2571
|
// @ts-ignore
|
|
2552
2572
|
// `values` are throwing a type error: https://github.com/formatjs/formatjs/issues/3633
|
|
2553
|
-
|
|
2554
|
-
{ id: `${
|
|
2573
|
+
i.formatMessage(
|
|
2574
|
+
{ id: `${c.path}_text` },
|
|
2555
2575
|
{
|
|
2556
|
-
...
|
|
2576
|
+
...l,
|
|
2557
2577
|
strong: (p) => /* @__PURE__ */ s.jsx("strong", { children: p }),
|
|
2558
2578
|
em: (p) => /* @__PURE__ */ s.jsx("em", { children: p }),
|
|
2559
2579
|
br: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2560
2580
|
/* @__PURE__ */ s.jsx("br", {}),
|
|
2561
2581
|
/* @__PURE__ */ s.jsx("br", {})
|
|
2562
2582
|
] }),
|
|
2563
|
-
error:
|
|
2583
|
+
error: c.error
|
|
2564
2584
|
}
|
|
2565
2585
|
)
|
|
2566
2586
|
) });
|
|
2567
2587
|
};
|
|
2568
|
-
const Ge = "passwordRules_", Cn = "isMoreThanEightCharacters", Dn = "includesNumberAndSymbol",
|
|
2588
|
+
const Ge = "passwordRules_", Cn = "isMoreThanEightCharacters", Dn = "includesNumberAndSymbol", Nn = "includesLowerAndUppercase", xr = {
|
|
2569
2589
|
[Cn]: "8Characters",
|
|
2570
2590
|
[Dn]: "numberSymbol",
|
|
2571
|
-
[
|
|
2591
|
+
[Nn]: "lowercaseUppercase"
|
|
2572
2592
|
}, br = ({ matchingRules: e = { isMoreThanEightCharacters: !1, includesNumberAndSymbol: !1, includesLowerAndUppercase: !1 }, className: t = "" }) => {
|
|
2573
|
-
const n =
|
|
2574
|
-
return /* @__PURE__ */ s.jsxs("aside", { className:
|
|
2593
|
+
const n = A();
|
|
2594
|
+
return /* @__PURE__ */ s.jsxs("aside", { className: S("password-rules", t), children: [
|
|
2575
2595
|
/* @__PURE__ */ s.jsx("small", { children: n.formatMessage({ id: `${Ge}intro` }) }),
|
|
2576
|
-
/* @__PURE__ */ s.jsx("ul", { children: [Cn, Dn,
|
|
2596
|
+
/* @__PURE__ */ s.jsx("ul", { children: [Cn, Dn, Nn].map((r) => /* @__PURE__ */ s.jsxs("li", { className: S({ matches: e[r] }), children: [
|
|
2577
2597
|
/* @__PURE__ */ s.jsxs(le, { children: [
|
|
2578
2598
|
n.formatMessage({ id: `${Ge}rule_label` }),
|
|
2579
2599
|
" "
|
|
@@ -2586,49 +2606,49 @@ const Ge = "passwordRules_", Cn = "isMoreThanEightCharacters", Dn = "includesNum
|
|
|
2586
2606
|
] })
|
|
2587
2607
|
] }, `rule-${r}`)) })
|
|
2588
2608
|
] });
|
|
2589
|
-
}, To =
|
|
2609
|
+
}, To = Ne(br);
|
|
2590
2610
|
const $o = ({
|
|
2591
2611
|
text: e = {},
|
|
2592
2612
|
topRating: t = 5,
|
|
2593
2613
|
functions: { createRating: n = () => null, updateRating: r = () => {
|
|
2594
|
-
}, reportError:
|
|
2614
|
+
}, reportError: i = () => {
|
|
2595
2615
|
} },
|
|
2596
|
-
className:
|
|
2616
|
+
className: c = "",
|
|
2597
2617
|
hasLoaded: d = !1
|
|
2598
2618
|
}) => {
|
|
2599
|
-
const o =
|
|
2619
|
+
const o = A(), [a, u] = F({ setUp: !1, id: null, rating: null, disabled: !0 }), l = async () => {
|
|
2600
2620
|
try {
|
|
2601
|
-
const
|
|
2602
|
-
|
|
2603
|
-
} catch (
|
|
2604
|
-
|
|
2621
|
+
const E = await n();
|
|
2622
|
+
u((k) => ({ ...k, setUp: !0, id: E && E.id, disabled: !1 }));
|
|
2623
|
+
} catch (E) {
|
|
2624
|
+
u((k) => ({ ...k, setUp: !0, disabled: !0 })), i(E);
|
|
2605
2625
|
}
|
|
2606
2626
|
};
|
|
2607
2627
|
if (X(() => {
|
|
2608
|
-
d && !
|
|
2628
|
+
d && !a.setUp && l();
|
|
2609
2629
|
}, [d]), !d)
|
|
2610
2630
|
return /* @__PURE__ */ s.jsx(je, { className: "rating-placeholder" });
|
|
2611
|
-
const { id: f, rating: h, disabled: p } =
|
|
2631
|
+
const { id: f, rating: h, disabled: p } = a, _ = "ratings_", j = {
|
|
2612
2632
|
text: o.formatMessage({ id: `${_}text` }),
|
|
2613
2633
|
low: o.formatMessage({ id: `${_}low` }),
|
|
2614
2634
|
high: o.formatMessage({ id: `${_}high` }),
|
|
2615
2635
|
success: o.formatMessage({ id: `${_}success` }),
|
|
2616
2636
|
...e
|
|
2617
|
-
}, g = async (
|
|
2637
|
+
}, g = async (E) => {
|
|
2618
2638
|
if (!(!f || p))
|
|
2619
2639
|
try {
|
|
2620
|
-
|
|
2640
|
+
u((k) => ({ ...k, rating: E, disabled: !0 })), await r({ id: f, value: E });
|
|
2621
2641
|
} catch (k) {
|
|
2622
|
-
|
|
2642
|
+
u((T) => ({ ...T, rating: null })), i(k);
|
|
2623
2643
|
} finally {
|
|
2624
|
-
|
|
2644
|
+
u((k) => ({ ...k, disabled: !1 }));
|
|
2625
2645
|
}
|
|
2626
2646
|
};
|
|
2627
|
-
return /* @__PURE__ */ s.jsxs("div", { className:
|
|
2647
|
+
return /* @__PURE__ */ s.jsxs("div", { className: S("rating", c), children: [
|
|
2628
2648
|
/* @__PURE__ */ s.jsx("span", { className: "label", children: j[h ? "success" : "text"] }),
|
|
2629
|
-
/* @__PURE__ */ s.jsx("ol", { children: Array.from(new Array(t).keys()).map((
|
|
2630
|
-
const k =
|
|
2631
|
-
return /* @__PURE__ */ s.jsx("li", { className:
|
|
2649
|
+
/* @__PURE__ */ s.jsx("ol", { children: Array.from(new Array(t).keys()).map((E) => {
|
|
2650
|
+
const k = E + 1;
|
|
2651
|
+
return /* @__PURE__ */ s.jsx("li", { className: S({ selected: h && k <= h }), children: /* @__PURE__ */ s.jsx(
|
|
2632
2652
|
J,
|
|
2633
2653
|
{
|
|
2634
2654
|
variant: "tertiary",
|
|
@@ -2652,36 +2672,36 @@ const vr = ({
|
|
|
2652
2672
|
className: t = "",
|
|
2653
2673
|
handleToggle: n = !1,
|
|
2654
2674
|
defaultValue: r = "",
|
|
2655
|
-
gtmContext:
|
|
2656
|
-
gtmEvent:
|
|
2675
|
+
gtmContext: i = "search-bar",
|
|
2676
|
+
gtmEvent: c = "form-submission"
|
|
2657
2677
|
}) => {
|
|
2658
|
-
const { searchIsOpen: d = !0, isDesktopVersion: o = !1 } = n || {},
|
|
2678
|
+
const { searchIsOpen: d = !0, isDesktopVersion: o = !1 } = n || {}, a = A(), u = ne(null);
|
|
2659
2679
|
Ce(() => {
|
|
2660
|
-
!n || o || !d ||
|
|
2680
|
+
!n || o || !d || u.current && u.current.focus();
|
|
2661
2681
|
}, [d]);
|
|
2662
|
-
const
|
|
2663
|
-
f.preventDefault(), f.stopPropagation(), !(!
|
|
2682
|
+
const l = (f) => {
|
|
2683
|
+
f.preventDefault(), f.stopPropagation(), !(!u.current || !u.current.value || u.current.value.length < 1) && (window.location.href = `/search?search=${encodeURIComponent(u.current.value)}`);
|
|
2664
2684
|
};
|
|
2665
2685
|
return /* @__PURE__ */ s.jsx(
|
|
2666
2686
|
"form",
|
|
2667
2687
|
{
|
|
2668
|
-
onSubmit:
|
|
2669
|
-
className:
|
|
2670
|
-
"data-gtm-event-context":
|
|
2671
|
-
"data-gtm-event-type":
|
|
2688
|
+
onSubmit: l,
|
|
2689
|
+
className: S("search-form gtm-trackable", t),
|
|
2690
|
+
"data-gtm-event-context": i,
|
|
2691
|
+
"data-gtm-event-type": c,
|
|
2672
2692
|
children: /* @__PURE__ */ s.jsx("fieldset", { id: `${e}-form`, hidden: n ? !d : !1, role: "search", children: /* @__PURE__ */ s.jsxs("p", { children: [
|
|
2673
|
-
/* @__PURE__ */ s.jsx(le, { element: "label", htmlFor: e, children:
|
|
2693
|
+
/* @__PURE__ */ s.jsx(le, { element: "label", htmlFor: e, children: a.formatMessage({ id: "search_label" }) }),
|
|
2674
2694
|
/* @__PURE__ */ s.jsx(
|
|
2675
2695
|
"input",
|
|
2676
2696
|
{
|
|
2677
|
-
ref:
|
|
2697
|
+
ref: u,
|
|
2678
2698
|
type: "search",
|
|
2679
2699
|
id: e,
|
|
2680
2700
|
name: e,
|
|
2681
2701
|
defaultValue: r,
|
|
2682
|
-
placeholder:
|
|
2702
|
+
placeholder: a.formatMessage({ id: "search_placeholder" }),
|
|
2683
2703
|
onKeyDown: (f) => {
|
|
2684
|
-
f.key === "Enter" &&
|
|
2704
|
+
f.key === "Enter" && l(f);
|
|
2685
2705
|
}
|
|
2686
2706
|
}
|
|
2687
2707
|
),
|
|
@@ -2690,12 +2710,12 @@ const vr = ({
|
|
|
2690
2710
|
{
|
|
2691
2711
|
className: "clear",
|
|
2692
2712
|
onClick: (f) => {
|
|
2693
|
-
f.preventDefault(), f.stopPropagation(),
|
|
2713
|
+
f.preventDefault(), f.stopPropagation(), u.current && u.current.value && (u.current.value = "");
|
|
2694
2714
|
},
|
|
2695
|
-
children: /* @__PURE__ */ s.jsx(le, { children:
|
|
2715
|
+
children: /* @__PURE__ */ s.jsx(le, { children: a.formatMessage({ id: "search_clear" }) })
|
|
2696
2716
|
}
|
|
2697
2717
|
),
|
|
2698
|
-
/* @__PURE__ */ s.jsx("button", { className: "search", onClick:
|
|
2718
|
+
/* @__PURE__ */ s.jsx("button", { className: "search", onClick: l, children: /* @__PURE__ */ s.jsx(le, { children: a.formatMessage({ id: "search_cta" }) }) })
|
|
2699
2719
|
] }) })
|
|
2700
2720
|
}
|
|
2701
2721
|
);
|
|
@@ -2705,18 +2725,18 @@ const wr = ({
|
|
|
2705
2725
|
label: t,
|
|
2706
2726
|
ctaMessage: n,
|
|
2707
2727
|
titleColor: r,
|
|
2708
|
-
labelColor:
|
|
2709
|
-
backgroundColor:
|
|
2728
|
+
labelColor: i,
|
|
2729
|
+
backgroundColor: c,
|
|
2710
2730
|
onClose: d,
|
|
2711
2731
|
reportError: o,
|
|
2712
|
-
sendInvites:
|
|
2713
|
-
initialFormStatus:
|
|
2732
|
+
sendInvites: a,
|
|
2733
|
+
initialFormStatus: u = "NOT_SUBMITTED"
|
|
2714
2734
|
/* NOT_SUBMITTED */
|
|
2715
2735
|
}) => {
|
|
2716
|
-
const [
|
|
2736
|
+
const [l, f] = F([]), [h, p] = F(!0), [_, j] = F(u), { formatMessage: g } = A(), E = async (M) => {
|
|
2717
2737
|
M.preventDefault();
|
|
2718
2738
|
try {
|
|
2719
|
-
await
|
|
2739
|
+
await a(l), f([]), j(
|
|
2720
2740
|
"SUCCESS"
|
|
2721
2741
|
/* SUCCESS */
|
|
2722
2742
|
);
|
|
@@ -2737,7 +2757,7 @@ const wr = ({
|
|
|
2737
2757
|
/* CLOSED */
|
|
2738
2758
|
);
|
|
2739
2759
|
};
|
|
2740
|
-
return _ === "CLOSED" ? null : _ === "ERROR" || _ === "SUCCESS" ? /* @__PURE__ */ s.jsxs(
|
|
2760
|
+
return _ === "CLOSED" ? null : _ === "ERROR" || _ === "SUCCESS" ? /* @__PURE__ */ s.jsxs("div", { className: "invite-form-wrapper", children: [
|
|
2741
2761
|
/* @__PURE__ */ s.jsx("div", { className: "content centred", children: _ === "SUCCESS" ? /* @__PURE__ */ s.jsx("h2", { className: "success-title", children: g({ id: "inviteForm_success" }) }) : /* @__PURE__ */ s.jsxs("h2", { className: "error-title", children: [
|
|
2742
2762
|
" ",
|
|
2743
2763
|
g({ id: "inviteForm_error" })
|
|
@@ -2747,23 +2767,23 @@ const wr = ({
|
|
|
2747
2767
|
/* @__PURE__ */ s.jsx(J, { variant: "secondary", onClick: k, children: g({ id: "inviteForm_ctaSendMoreInvites" }) }),
|
|
2748
2768
|
/* @__PURE__ */ s.jsx(J, { onClick: T, children: g({ id: "inviteForm_ctaDone" }) })
|
|
2749
2769
|
] }) : /* @__PURE__ */ s.jsx(J, { onClick: k, children: g({ id: "inviteForm_ctaTryAgain" }) }) })
|
|
2750
|
-
] }) : /* @__PURE__ */ s.jsxs(
|
|
2770
|
+
] }) : /* @__PURE__ */ s.jsx("div", { className: "invite-form-wrapper", children: /* @__PURE__ */ s.jsxs(
|
|
2751
2771
|
"form",
|
|
2752
2772
|
{
|
|
2753
|
-
style: { backgroundColor:
|
|
2754
|
-
onSubmit:
|
|
2755
|
-
className:
|
|
2773
|
+
style: { backgroundColor: c },
|
|
2774
|
+
onSubmit: E,
|
|
2775
|
+
className: S("invite-form gtm-trackable"),
|
|
2756
2776
|
children: [
|
|
2757
2777
|
/* @__PURE__ */ s.jsxs("fieldset", { className: "content", children: [
|
|
2758
2778
|
/* @__PURE__ */ s.jsx("h2", { className: "title", style: { color: r }, children: e }),
|
|
2759
|
-
/* @__PURE__ */ s.jsx("label", { htmlFor: "email-input", className: "label", style: { color:
|
|
2779
|
+
/* @__PURE__ */ s.jsx("label", { htmlFor: "email-input", className: "label", style: { color: i }, children: t }),
|
|
2760
2780
|
/* @__PURE__ */ s.jsx(
|
|
2761
2781
|
ps,
|
|
2762
2782
|
{
|
|
2763
2783
|
id: "email-input",
|
|
2764
2784
|
inputClassName: "email-input input",
|
|
2765
2785
|
placeholder: g({ id: "inviteForm_email_placeholder" }),
|
|
2766
|
-
emails:
|
|
2786
|
+
emails: l,
|
|
2767
2787
|
onChange: (M) => {
|
|
2768
2788
|
f(M), p(!M.length);
|
|
2769
2789
|
},
|
|
@@ -2777,7 +2797,7 @@ const wr = ({
|
|
|
2777
2797
|
size: "small",
|
|
2778
2798
|
icon: { icon: "close" },
|
|
2779
2799
|
onClick: () => {
|
|
2780
|
-
I(C), p(!
|
|
2800
|
+
I(C), p(!l.length);
|
|
2781
2801
|
},
|
|
2782
2802
|
className: "remove-email-button",
|
|
2783
2803
|
screenreaderText: g({ id: "overlay_close" })
|
|
@@ -2791,7 +2811,7 @@ const wr = ({
|
|
|
2791
2811
|
/* @__PURE__ */ s.jsx("fieldset", { className: "footer", children: /* @__PURE__ */ s.jsx(J, { className: "sendEmailsButton", disabled: h, children: n }) })
|
|
2792
2812
|
]
|
|
2793
2813
|
}
|
|
2794
|
-
);
|
|
2814
|
+
) });
|
|
2795
2815
|
}, H = {
|
|
2796
2816
|
timeouts: {},
|
|
2797
2817
|
handlerCalled: {},
|
|
@@ -2799,29 +2819,29 @@ const wr = ({
|
|
|
2799
2819
|
const n = {
|
|
2800
2820
|
navigation: { loggedIn: 769, loggedOut: 881 },
|
|
2801
2821
|
search: { loggedIn: 961, loggedOut: 1121 }
|
|
2802
|
-
}, r = (
|
|
2822
|
+
}, r = (c) => {
|
|
2803
2823
|
const d = `logged${e ? "In" : "Out"}`;
|
|
2804
|
-
return t >= n[
|
|
2824
|
+
return t >= n[c][d];
|
|
2805
2825
|
};
|
|
2806
|
-
let
|
|
2807
|
-
return ["navigation", "search"].forEach((
|
|
2808
|
-
|
|
2809
|
-
}),
|
|
2826
|
+
let i = {};
|
|
2827
|
+
return ["navigation", "search"].forEach((c) => {
|
|
2828
|
+
i[c] = r(c);
|
|
2829
|
+
}), i;
|
|
2810
2830
|
},
|
|
2811
2831
|
shouldChangeHeaderIsVisible: (e, t, n) => {
|
|
2812
|
-
Object.values(t).filter((
|
|
2832
|
+
Object.values(t).filter((i) => i === !0).length || n([{ type: "headerIsVisible", value: e }]);
|
|
2813
2833
|
},
|
|
2814
2834
|
handleMenus: ({ id: e, value: t, menus: n, dispatch: r }) => {
|
|
2815
2835
|
if (n[e] === t || e === "account" && t === !1 && n.navigation === !0)
|
|
2816
2836
|
return;
|
|
2817
|
-
const
|
|
2818
|
-
if (!t && H.handlerCalled[e] &&
|
|
2837
|
+
const i = Date.now();
|
|
2838
|
+
if (!t && H.handlerCalled[e] && i - H.handlerCalled[e] < 500)
|
|
2819
2839
|
return;
|
|
2820
|
-
H.handlerCalled[e] =
|
|
2821
|
-
let
|
|
2840
|
+
H.handlerCalled[e] = i;
|
|
2841
|
+
let c = [{ type: `menus.${e}`, value: t }];
|
|
2822
2842
|
t === !0 && Object.keys(n).forEach((d) => {
|
|
2823
|
-
d === e || n[d] === !1 ||
|
|
2824
|
-
}), r(
|
|
2843
|
+
d === e || n[d] === !1 || c.push({ type: `menus.${d}`, value: !1 });
|
|
2844
|
+
}), r(c);
|
|
2825
2845
|
},
|
|
2826
2846
|
// Find the first child inside a ref that matches the `key` (and optional `value`) we're looking for,
|
|
2827
2847
|
// so we can automatically focus on the first link inside a menu for accessibility.
|
|
@@ -2838,30 +2858,30 @@ const wr = ({
|
|
|
2838
2858
|
return e[r];
|
|
2839
2859
|
if (!t.includes("."))
|
|
2840
2860
|
continue;
|
|
2841
|
-
const
|
|
2842
|
-
if (!(typeof
|
|
2861
|
+
const i = hn(e[r], t);
|
|
2862
|
+
if (!(typeof i > "u") && (!n || i[t] && i[t].includes(n) || i.value && i.value.includes(n) || i.toString().includes(n)))
|
|
2843
2863
|
return e[r];
|
|
2844
2864
|
}
|
|
2845
2865
|
return e[0].children ? H.findFirstChild(e[0].children, t, n) : !1;
|
|
2846
2866
|
},
|
|
2847
|
-
autoFocus: ({ menu: e, navigationRef: t, isDesktopVersion: n, focusElements: r, dispatch:
|
|
2867
|
+
autoFocus: ({ menu: e, navigationRef: t, isDesktopVersion: n, focusElements: r, dispatch: i }) => {
|
|
2848
2868
|
if (!t.current || !t.current.children)
|
|
2849
2869
|
return;
|
|
2850
|
-
const
|
|
2851
|
-
if (r[e][
|
|
2852
|
-
r[e][
|
|
2870
|
+
const c = n ? "desktop" : "default";
|
|
2871
|
+
if (r[e][c]) {
|
|
2872
|
+
r[e][c].focus();
|
|
2853
2873
|
return;
|
|
2854
2874
|
}
|
|
2855
2875
|
let d, o;
|
|
2856
2876
|
switch (e) {
|
|
2857
2877
|
case "navigation":
|
|
2858
2878
|
if (n) {
|
|
2859
|
-
const
|
|
2879
|
+
const a = H.findFirstChild(
|
|
2860
2880
|
t.current.children,
|
|
2861
2881
|
"attributes.aria-controls",
|
|
2862
2882
|
"navigation"
|
|
2863
2883
|
);
|
|
2864
|
-
d = H.findFirstChild(
|
|
2884
|
+
d = H.findFirstChild(a.children, "href");
|
|
2865
2885
|
} else
|
|
2866
2886
|
d = H.findFirstChild(t.current.children, "href");
|
|
2867
2887
|
d || (d = t.current);
|
|
@@ -2874,7 +2894,7 @@ const wr = ({
|
|
|
2874
2894
|
default:
|
|
2875
2895
|
return;
|
|
2876
2896
|
}
|
|
2877
|
-
d && (
|
|
2897
|
+
d && (i([{ type: `focusElements.${e}.${c}`, value: d }]), d.focus());
|
|
2878
2898
|
},
|
|
2879
2899
|
events: {
|
|
2880
2900
|
onClick: (e, { id: t, callback: n, isOpen: r }) => {
|
|
@@ -2973,14 +2993,14 @@ const wr = ({
|
|
|
2973
2993
|
isLoggedIn: t = !1,
|
|
2974
2994
|
isDesktopVersion: n = !1,
|
|
2975
2995
|
menus: r = {},
|
|
2976
|
-
callback:
|
|
2996
|
+
callback: i = () => {
|
|
2977
2997
|
},
|
|
2978
|
-
doTrack:
|
|
2998
|
+
doTrack: c = null
|
|
2979
2999
|
}) => {
|
|
2980
|
-
const d =
|
|
3000
|
+
const d = A(), o = hn(Ke, e);
|
|
2981
3001
|
if (!o || o.onlyShow && (o.onlyShow === "logged-in" && !t || o.onlyShow === "logged-out" && t))
|
|
2982
3002
|
return null;
|
|
2983
|
-
const
|
|
3003
|
+
const a = "doTrack" in o, u = c === null ? a ? o.doTrack : !0 : c, l = e.includes("buttons.");
|
|
2984
3004
|
let f = `header_${e.replaceAll(".", "_")}`;
|
|
2985
3005
|
o.hasVariantText && (f += `_logged${t ? "In" : "Out"}`);
|
|
2986
3006
|
let h = !1;
|
|
@@ -2993,12 +3013,12 @@ const wr = ({
|
|
|
2993
3013
|
h = {
|
|
2994
3014
|
href: o.href,
|
|
2995
3015
|
role: "menuitem"
|
|
2996
|
-
},
|
|
3016
|
+
}, u && (h = {
|
|
2997
3017
|
...h,
|
|
2998
3018
|
className: "gtm-trackable",
|
|
2999
3019
|
"data-gtm-event-type": k,
|
|
3000
3020
|
"data-gtm-event-context": "HeaderButtons"
|
|
3001
|
-
}),
|
|
3021
|
+
}), l && (h = {
|
|
3002
3022
|
...h,
|
|
3003
3023
|
variant: "secondary",
|
|
3004
3024
|
size: { mobile: "small", 881: "large" },
|
|
@@ -3006,108 +3026,108 @@ const wr = ({
|
|
|
3006
3026
|
});
|
|
3007
3027
|
}
|
|
3008
3028
|
const p = o.order && o.order[0] && o[o.order[0]], _ = p && o[o.order[0]].order, j = h && window.location.pathname === o.href;
|
|
3009
|
-
let g = {},
|
|
3029
|
+
let g = {}, E = {};
|
|
3010
3030
|
if (p) {
|
|
3011
3031
|
const k = o.menuId || e, T = {
|
|
3012
|
-
onClick: (M) => H.events.onClick(M, { id: k, callback:
|
|
3032
|
+
onClick: (M) => H.events.onClick(M, { id: k, callback: i, isOpen: r[k] }),
|
|
3013
3033
|
onFocus: () => H.events.onFocus({ id: k }),
|
|
3014
|
-
onBlur: () => H.events.onBlur({ id: k, callback:
|
|
3015
|
-
onMouseLeave: () => H.events.onBlur({ id: k, callback:
|
|
3016
|
-
onMouseEnter: () => H.events.onMouseEnter({ id: k, callback:
|
|
3034
|
+
onBlur: () => H.events.onBlur({ id: k, callback: i }),
|
|
3035
|
+
onMouseLeave: () => H.events.onBlur({ id: k, callback: i }),
|
|
3036
|
+
onMouseEnter: () => H.events.onMouseEnter({ id: k, callback: i })
|
|
3017
3037
|
};
|
|
3018
3038
|
n && (_ && (g = {
|
|
3019
3039
|
...T,
|
|
3020
3040
|
onKeyPress: (M) => {
|
|
3021
|
-
M.key === "Enter" && H.events.onClick(M, { id: k, callback:
|
|
3041
|
+
M.key === "Enter" && H.events.onClick(M, { id: k, callback: i, isOpen: r[k] });
|
|
3022
3042
|
},
|
|
3023
3043
|
tabIndex: "0",
|
|
3024
3044
|
// Add a `tabIndex` so keyboard users can focus on the `li`
|
|
3025
3045
|
"aria-haspopup": !0,
|
|
3026
3046
|
"aria-expanded": r[k],
|
|
3027
3047
|
"aria-controls": k
|
|
3028
|
-
}),
|
|
3029
|
-
...
|
|
3048
|
+
}), E = { hidden: k in r ? !r[k] : !0 }), _ || (E = {
|
|
3049
|
+
...E,
|
|
3030
3050
|
...T
|
|
3031
3051
|
});
|
|
3032
3052
|
}
|
|
3033
|
-
return /* @__PURE__ */ s.jsxs("li", { className:
|
|
3034
|
-
h ?
|
|
3035
|
-
o.order && /* @__PURE__ */ s.jsx("ul", { ...
|
|
3053
|
+
return /* @__PURE__ */ s.jsxs("li", { className: S({ [o.className]: o.className, "has-submenu": p, parent: _, active: j }), role: "none", ...g, children: [
|
|
3054
|
+
h ? N.createElement(l ? J : "a", h, d.formatMessage({ id: f })) : d.formatMessage({ id: f }),
|
|
3055
|
+
o.order && /* @__PURE__ */ s.jsx("ul", { ...E, children: o.order.map((k) => {
|
|
3036
3056
|
if (!o[k])
|
|
3037
3057
|
return null;
|
|
3038
3058
|
const T = {
|
|
3039
3059
|
isLoggedIn: t,
|
|
3040
3060
|
isDesktopVersion: n,
|
|
3041
3061
|
menus: r,
|
|
3042
|
-
callback:
|
|
3043
|
-
doTrack:
|
|
3062
|
+
callback: i,
|
|
3063
|
+
doTrack: a ? u : null
|
|
3044
3064
|
};
|
|
3045
|
-
return o[k].order ? /* @__PURE__ */ s.jsxs("li", { className:
|
|
3065
|
+
return o[k].order ? /* @__PURE__ */ s.jsxs("li", { className: S({ [o[k].className]: o[k].className }), children: [
|
|
3046
3066
|
d.formatMessage({ id: `${f}_${k}` }),
|
|
3047
3067
|
/* @__PURE__ */ s.jsx("ul", { children: o[k].order.map((M) => /* @__PURE__ */ s.jsx(qe, { id: `${e}.${k}.${M}`, ...T }, M)) })
|
|
3048
3068
|
] }, k) : /* @__PURE__ */ s.jsx(qe, { id: `${e}.${k}`, ...T }, k);
|
|
3049
3069
|
}) })
|
|
3050
3070
|
] }, e);
|
|
3051
3071
|
};
|
|
3052
|
-
const kr = { height: 67, height_desktop: 83 },
|
|
3053
|
-
const e =
|
|
3072
|
+
const kr = { height: 67, height_desktop: 83 }, An = () => {
|
|
3073
|
+
const e = A(), t = ge(Se), n = rt(!0, !0), r = t && typeof t.id == "string", i = et(
|
|
3054
3074
|
() => H.getIsDesktopVersion(r, n),
|
|
3055
3075
|
[r, n]
|
|
3056
|
-
), [
|
|
3076
|
+
), [c, d] = rs($s, {
|
|
3057
3077
|
headerIsVisible: !0,
|
|
3058
3078
|
menus: { navigation: !1, search: !1, account: !1 },
|
|
3059
3079
|
focusElements: {
|
|
3060
3080
|
navigation: { desktop: !1, default: !1 },
|
|
3061
3081
|
account: { desktop: !1, default: !1 }
|
|
3062
3082
|
}
|
|
3063
|
-
}), { headerIsVisible: o, menus:
|
|
3083
|
+
}), { headerIsVisible: o, menus: a, focusElements: u } = c;
|
|
3064
3084
|
Ts({
|
|
3065
|
-
scrollPosition: kr[`height${
|
|
3085
|
+
scrollPosition: kr[`height${i.navigation ? "_desktop" : ""}`],
|
|
3066
3086
|
callbacks: {
|
|
3067
3087
|
scrollUp: () => {
|
|
3068
|
-
!
|
|
3088
|
+
!i && a.navigation || H.shouldChangeHeaderIsVisible(!0, a, d);
|
|
3069
3089
|
},
|
|
3070
3090
|
scrollDown: () => {
|
|
3071
|
-
!
|
|
3091
|
+
!i && a.navigation || H.shouldChangeHeaderIsVisible(!1, a, d);
|
|
3072
3092
|
}
|
|
3073
3093
|
}
|
|
3074
3094
|
});
|
|
3075
|
-
const
|
|
3076
|
-
H.handleMenus({ id: h, value: p, menus:
|
|
3095
|
+
const l = (h, p) => {
|
|
3096
|
+
H.handleMenus({ id: h, value: p, menus: a, dispatch: d });
|
|
3077
3097
|
}, f = ne(null);
|
|
3078
3098
|
return Ce(() => {
|
|
3079
|
-
|
|
3099
|
+
a.navigation && H.autoFocus({
|
|
3080
3100
|
menu: "navigation",
|
|
3081
3101
|
navigationRef: f,
|
|
3082
|
-
isDesktopVersion:
|
|
3083
|
-
focusElements:
|
|
3102
|
+
isDesktopVersion: i.navigation,
|
|
3103
|
+
focusElements: u,
|
|
3084
3104
|
dispatch: d
|
|
3085
3105
|
});
|
|
3086
|
-
}, [
|
|
3087
|
-
|
|
3106
|
+
}, [a.navigation]), Ce(() => {
|
|
3107
|
+
a.account && H.autoFocus({
|
|
3088
3108
|
menu: "account",
|
|
3089
3109
|
navigationRef: f,
|
|
3090
|
-
isDesktopVersion:
|
|
3091
|
-
focusElements:
|
|
3110
|
+
isDesktopVersion: i.navigation,
|
|
3111
|
+
focusElements: u,
|
|
3092
3112
|
dispatch: d
|
|
3093
3113
|
});
|
|
3094
|
-
}, [
|
|
3095
|
-
/* @__PURE__ */ s.jsxs("nav", { id: "header", className:
|
|
3114
|
+
}, [a.account]), t && t.isLoading ? null : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
3115
|
+
/* @__PURE__ */ s.jsxs("nav", { id: "header", className: S({ "logged-in": r, "logged-out": !r, visible: o }), children: [
|
|
3096
3116
|
/* @__PURE__ */ s.jsx(le, { element: "a", href: "#content-of-page", children: e.formatMessage({ id: "header_skip" }) }),
|
|
3097
3117
|
/* @__PURE__ */ s.jsx($n, {}),
|
|
3098
|
-
!
|
|
3118
|
+
!i.navigation && /* @__PURE__ */ s.jsx(
|
|
3099
3119
|
"button",
|
|
3100
3120
|
{
|
|
3101
3121
|
className: "menu-button gtm-trackable",
|
|
3102
3122
|
onClick: (h) => {
|
|
3103
|
-
h.preventDefault(), h.stopPropagation(),
|
|
3123
|
+
h.preventDefault(), h.stopPropagation(), l("navigation", !a.navigation);
|
|
3104
3124
|
},
|
|
3105
3125
|
"data-gtm-event-type": "open-tab-menu-click",
|
|
3106
3126
|
"data-gtm-event-context": "HeaderLeft-Chevron",
|
|
3107
3127
|
"aria-haspopup": "true",
|
|
3108
|
-
"aria-expanded":
|
|
3128
|
+
"aria-expanded": a.navigation,
|
|
3109
3129
|
"aria-controls": "navigation",
|
|
3110
|
-
children: /* @__PURE__ */ s.jsx(le, { children: e.formatMessage({ id: `header_menu_${
|
|
3130
|
+
children: /* @__PURE__ */ s.jsx(le, { children: e.formatMessage({ id: `header_menu_${a.navigation ? "hide" : "show"}` }) })
|
|
3111
3131
|
}
|
|
3112
3132
|
),
|
|
3113
3133
|
/* @__PURE__ */ s.jsx(
|
|
@@ -3115,40 +3135,40 @@ const kr = { height: 67, height_desktop: 83 }, Nn = () => {
|
|
|
3115
3135
|
{
|
|
3116
3136
|
ref: f,
|
|
3117
3137
|
id: "navigation",
|
|
3118
|
-
hidden:
|
|
3138
|
+
hidden: i.navigation || a.account ? !1 : !a.navigation,
|
|
3119
3139
|
role: "menu",
|
|
3120
|
-
"data-showing": !
|
|
3140
|
+
"data-showing": !i.navigation && a.account ? "account" : "default",
|
|
3121
3141
|
children: Ke.order.map((h) => /* @__PURE__ */ s.jsx(
|
|
3122
3142
|
qe,
|
|
3123
3143
|
{
|
|
3124
3144
|
id: h,
|
|
3125
3145
|
isLoggedIn: r,
|
|
3126
|
-
isDesktopVersion:
|
|
3127
|
-
menus: { navigation:
|
|
3128
|
-
callback:
|
|
3146
|
+
isDesktopVersion: i.navigation,
|
|
3147
|
+
menus: { navigation: a.navigation, account: a.account },
|
|
3148
|
+
callback: l
|
|
3129
3149
|
},
|
|
3130
3150
|
h
|
|
3131
3151
|
))
|
|
3132
3152
|
}
|
|
3133
3153
|
),
|
|
3134
|
-
!
|
|
3154
|
+
!i.search && /* @__PURE__ */ s.jsx(
|
|
3135
3155
|
"button",
|
|
3136
3156
|
{
|
|
3137
3157
|
className: "search toggle-search-button",
|
|
3138
3158
|
onClick: (h) => {
|
|
3139
|
-
h.preventDefault(), h.stopPropagation(),
|
|
3159
|
+
h.preventDefault(), h.stopPropagation(), l("search", !a.search);
|
|
3140
3160
|
},
|
|
3141
3161
|
"aria-haspopup": "true",
|
|
3142
|
-
"aria-expanded":
|
|
3162
|
+
"aria-expanded": a.search,
|
|
3143
3163
|
"aria-controls": "search-form",
|
|
3144
|
-
children: /* @__PURE__ */ s.jsx(le, { children: e.formatMessage({ id: `header_search_${
|
|
3164
|
+
children: /* @__PURE__ */ s.jsx(le, { children: e.formatMessage({ id: `header_search_${a.search ? "hide" : "show"}` }) })
|
|
3145
3165
|
}
|
|
3146
3166
|
),
|
|
3147
3167
|
/* @__PURE__ */ s.jsx(
|
|
3148
3168
|
vr,
|
|
3149
3169
|
{
|
|
3150
3170
|
id: "global-search",
|
|
3151
|
-
handleToggle: { searchIsOpen:
|
|
3171
|
+
handleToggle: { searchIsOpen: a.search, isDesktopVersion: i.search },
|
|
3152
3172
|
gtmContext: "search-bar-header",
|
|
3153
3173
|
gtmEvent: "form-submission"
|
|
3154
3174
|
}
|
|
@@ -3157,14 +3177,14 @@ const kr = { height: 67, height_desktop: 83 }, Nn = () => {
|
|
|
3157
3177
|
"button",
|
|
3158
3178
|
{
|
|
3159
3179
|
className: "account-button",
|
|
3160
|
-
onClick: (h) => H.events.onClick(h, { id: "account", callback:
|
|
3161
|
-
onMouseEnter: () => H.events.onMouseEnter({ id: "account", callback:
|
|
3162
|
-
onMouseLeave: () => H.events.onBlur({ id: "account", callback:
|
|
3180
|
+
onClick: (h) => H.events.onClick(h, { id: "account", callback: l, isOpen: a.account }),
|
|
3181
|
+
onMouseEnter: () => H.events.onMouseEnter({ id: "account", callback: l }),
|
|
3182
|
+
onMouseLeave: () => H.events.onBlur({ id: "account", callback: l }),
|
|
3163
3183
|
"aria-haspopup": "true",
|
|
3164
|
-
"aria-expanded":
|
|
3184
|
+
"aria-expanded": a.account,
|
|
3165
3185
|
"aria-controls": "navigation",
|
|
3166
3186
|
children: [
|
|
3167
|
-
/* @__PURE__ */ s.jsx(le, { children: e.formatMessage({ id: `header_account_${
|
|
3187
|
+
/* @__PURE__ */ s.jsx(le, { children: e.formatMessage({ id: `header_account_${a.account ? "hide" : "show"}` }) }),
|
|
3168
3188
|
/* @__PURE__ */ s.jsx(Ot, { name: t && t.name || "", src: t && t.image && t.image.thumbnail || "" })
|
|
3169
3189
|
]
|
|
3170
3190
|
}
|
|
@@ -3174,26 +3194,26 @@ const kr = { height: 67, height_desktop: 83 }, Nn = () => {
|
|
|
3174
3194
|
/* @__PURE__ */ s.jsx(
|
|
3175
3195
|
"div",
|
|
3176
3196
|
{
|
|
3177
|
-
className:
|
|
3197
|
+
className: S("overlay", { open: a.navigation || a.account || !i.search && a.search })
|
|
3178
3198
|
}
|
|
3179
3199
|
)
|
|
3180
3200
|
] });
|
|
3181
3201
|
};
|
|
3182
3202
|
const jr = () => {
|
|
3183
|
-
const e =
|
|
3203
|
+
const e = A();
|
|
3184
3204
|
return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
3185
|
-
/* @__PURE__ */ s.jsx(
|
|
3205
|
+
/* @__PURE__ */ s.jsx(An, {}),
|
|
3186
3206
|
/* @__PURE__ */ s.jsx("div", { className: "content", children: /* @__PURE__ */ s.jsx(it, { variant: "error", text: e.formatMessage({ id: "pageLayout_error" }) }) }),
|
|
3187
3207
|
/* @__PURE__ */ s.jsx(Mn, {})
|
|
3188
3208
|
] });
|
|
3189
|
-
}, Mo = ({ children: e, reportError: t, showFooter: n = !0, background: r = "default", className:
|
|
3209
|
+
}, Mo = ({ children: e, reportError: t, showFooter: n = !0, background: r = "default", className: i = "", locale: c = "en" }) => {
|
|
3190
3210
|
const d = Es();
|
|
3191
3211
|
X(() => {
|
|
3192
3212
|
window.scrollTo(0, 0);
|
|
3193
3213
|
}, [d]);
|
|
3194
|
-
const o = vn(e, { locale:
|
|
3195
|
-
return /* @__PURE__ */ s.jsx(gs, { onError: t, fallback: /* @__PURE__ */ s.jsx(jr, {}), children: /* @__PURE__ */ s.jsx(os, { fallback: /* @__PURE__ */ s.jsx(sr, { layout: "overview-page" }), children: /* @__PURE__ */ s.jsx("div", { id: "wrapper", className:
|
|
3196
|
-
/* @__PURE__ */ s.jsx(
|
|
3214
|
+
const o = vn(e, { locale: c });
|
|
3215
|
+
return /* @__PURE__ */ s.jsx(gs, { onError: t, fallback: /* @__PURE__ */ s.jsx(jr, {}), children: /* @__PURE__ */ s.jsx(os, { fallback: /* @__PURE__ */ s.jsx(sr, { layout: "overview-page" }), children: /* @__PURE__ */ s.jsx("div", { id: "wrapper", className: S(i, { [r]: r !== "default" }), children: /* @__PURE__ */ s.jsxs(hs, { children: [
|
|
3216
|
+
/* @__PURE__ */ s.jsx(An, {}),
|
|
3197
3217
|
/* @__PURE__ */ s.jsx("div", { className: "content", children: o }),
|
|
3198
3218
|
n && /* @__PURE__ */ s.jsx(Mn, {}),
|
|
3199
3219
|
/* @__PURE__ */ s.jsx(_r, {})
|
|
@@ -3234,50 +3254,50 @@ const Co = ({
|
|
|
3234
3254
|
color: t = "default",
|
|
3235
3255
|
forceOneLine: n = !1,
|
|
3236
3256
|
canHaveLinks: r = !0,
|
|
3237
|
-
className:
|
|
3238
|
-
gtmType:
|
|
3257
|
+
className: i = "",
|
|
3258
|
+
gtmType: c = "tag-click",
|
|
3239
3259
|
gtmContext: d = "tags"
|
|
3240
3260
|
}) => {
|
|
3241
|
-
const o =
|
|
3261
|
+
const o = A();
|
|
3242
3262
|
if (!e || e.length < 1)
|
|
3243
3263
|
return null;
|
|
3244
|
-
const
|
|
3245
|
-
return e.forEach((
|
|
3246
|
-
if (!
|
|
3264
|
+
const a = [];
|
|
3265
|
+
return e.forEach((u) => {
|
|
3266
|
+
if (!u)
|
|
3247
3267
|
return;
|
|
3248
|
-
const
|
|
3249
|
-
|
|
3250
|
-
}),
|
|
3251
|
-
const
|
|
3252
|
-
return /* @__PURE__ */ s.jsx("li", { children:
|
|
3268
|
+
const l = yr.getTagDetails(u);
|
|
3269
|
+
l && a.push(l);
|
|
3270
|
+
}), a.length < 1 ? null : /* @__PURE__ */ s.jsx("ul", { className: S("tags text-small", t, i, { "one-line": n }), children: a.map((u) => {
|
|
3271
|
+
const l = o.formatMessage({ id: u.text });
|
|
3272
|
+
return /* @__PURE__ */ s.jsx("li", { children: u.href && r ? /* @__PURE__ */ s.jsx(
|
|
3253
3273
|
"a",
|
|
3254
3274
|
{
|
|
3255
|
-
href:
|
|
3275
|
+
href: u.href,
|
|
3256
3276
|
className: "gtm-trackable",
|
|
3257
|
-
"data-gtm-event-type":
|
|
3277
|
+
"data-gtm-event-type": c,
|
|
3258
3278
|
"data-gtm-event-context": d,
|
|
3259
|
-
children:
|
|
3279
|
+
children: l
|
|
3260
3280
|
}
|
|
3261
|
-
) :
|
|
3281
|
+
) : l }, u.id);
|
|
3262
3282
|
}) });
|
|
3263
3283
|
};
|
|
3264
3284
|
const Do = ({
|
|
3265
3285
|
members: { total: e, data: t = [] },
|
|
3266
3286
|
pagination: n,
|
|
3267
3287
|
gtmContext: r = "member",
|
|
3268
|
-
gtmType:
|
|
3269
|
-
className:
|
|
3288
|
+
gtmType: i = "member-click",
|
|
3289
|
+
className: c = ""
|
|
3270
3290
|
}) => {
|
|
3271
|
-
const d =
|
|
3272
|
-
return t.length === 0 ? null : (e || (e = t.length), /* @__PURE__ */ s.jsxs("div", { className:
|
|
3291
|
+
const d = A();
|
|
3292
|
+
return t.length === 0 ? null : (e || (e = t.length), /* @__PURE__ */ s.jsxs("div", { className: S("members-list", c), children: [
|
|
3273
3293
|
/* @__PURE__ */ s.jsxs("h1", { children: [
|
|
3274
3294
|
d.formatMessage({ id: "membersList" }),
|
|
3275
3295
|
/* @__PURE__ */ s.jsx("span", { className: "count", children: e })
|
|
3276
3296
|
] }),
|
|
3277
|
-
/* @__PURE__ */ s.jsx("ul", { children: t.map((o,
|
|
3278
|
-
/* @__PURE__ */ s.jsx(Bt, { member: o, gtmContext: r, gtmType:
|
|
3297
|
+
/* @__PURE__ */ s.jsx("ul", { children: t.map((o, a) => /* @__PURE__ */ s.jsxs("li", { children: [
|
|
3298
|
+
/* @__PURE__ */ s.jsx(Bt, { member: o, gtmContext: r, gtmType: i }),
|
|
3279
3299
|
o.isAdmin && /* @__PURE__ */ s.jsx(qs, { children: d.formatMessage({ id: "membersList_admin" }) })
|
|
3280
|
-
] },
|
|
3300
|
+
] }, a)) }),
|
|
3281
3301
|
n && /* @__PURE__ */ s.jsx(
|
|
3282
3302
|
hr,
|
|
3283
3303
|
{
|
|
@@ -3299,8 +3319,8 @@ const me = "discussion_form_", Pn = ({
|
|
|
3299
3319
|
showTitle: !1
|
|
3300
3320
|
},
|
|
3301
3321
|
inputRef: r,
|
|
3302
|
-
maxLength:
|
|
3303
|
-
minRows:
|
|
3322
|
+
maxLength: i = 5e4,
|
|
3323
|
+
minRows: c = 4,
|
|
3304
3324
|
forceShow: d = {
|
|
3305
3325
|
cancel: !1,
|
|
3306
3326
|
error: !1
|
|
@@ -3318,13 +3338,13 @@ const me = "discussion_form_", Pn = ({
|
|
|
3318
3338
|
create: { projectNames: ["questions-answers"] }
|
|
3319
3339
|
}
|
|
3320
3340
|
},
|
|
3321
|
-
gtmContext:
|
|
3341
|
+
gtmContext: a = "DiscussionForm"
|
|
3322
3342
|
}) => {
|
|
3323
3343
|
var b, Q;
|
|
3324
|
-
const
|
|
3344
|
+
const u = A(), l = ge(Se), [f, h] = F(
|
|
3325
3345
|
n.isEditing && n.isEditing.text || ""
|
|
3326
|
-
), [p, _] = F(d.error || !1), [j, g] = F(!1),
|
|
3327
|
-
if (r || (r =
|
|
3346
|
+
), [p, _] = F(d.error || !1), [j, g] = F(!1), E = ne(null);
|
|
3347
|
+
if (r || (r = E), n.isLoading)
|
|
3328
3348
|
return /* @__PURE__ */ s.jsx(
|
|
3329
3349
|
je,
|
|
3330
3350
|
{
|
|
@@ -3336,13 +3356,13 @@ const me = "discussion_form_", Pn = ({
|
|
|
3336
3356
|
const Y = w.target.value;
|
|
3337
3357
|
h(Y);
|
|
3338
3358
|
let L;
|
|
3339
|
-
!
|
|
3340
|
-
|
|
3359
|
+
!l || !l.id ? L = pe(
|
|
3360
|
+
u.formatMessage,
|
|
3341
3361
|
`${me}error_loggedOut`,
|
|
3342
3362
|
e.type,
|
|
3343
3363
|
"action"
|
|
3344
|
-
) : t ? Y.length >=
|
|
3345
|
-
|
|
3364
|
+
) : t ? Y.length >= i && (L = `${me}error_tooLong`) : L = pe(
|
|
3365
|
+
u.formatMessage,
|
|
3346
3366
|
`${me}error_noPermission`,
|
|
3347
3367
|
e.type,
|
|
3348
3368
|
"action"
|
|
@@ -3355,7 +3375,7 @@ const me = "discussion_form_", Pn = ({
|
|
|
3355
3375
|
}
|
|
3356
3376
|
const M = async (w) => {
|
|
3357
3377
|
var L;
|
|
3358
|
-
if (w.preventDefault(), w.stopPropagation(), !
|
|
3378
|
+
if (w.preventDefault(), w.stopPropagation(), !l || !l.id || !t || I)
|
|
3359
3379
|
return;
|
|
3360
3380
|
Je && clearTimeout(Je), g("submitting");
|
|
3361
3381
|
const Y = window.location.pathname;
|
|
@@ -3368,20 +3388,20 @@ const me = "discussion_form_", Pn = ({
|
|
|
3368
3388
|
case "question":
|
|
3369
3389
|
O = await o.create({
|
|
3370
3390
|
title: f,
|
|
3371
|
-
authorId:
|
|
3391
|
+
authorId: l && l.id,
|
|
3372
3392
|
...(L = o.props) == null ? void 0 : L.create
|
|
3373
3393
|
});
|
|
3374
3394
|
break;
|
|
3375
3395
|
case "response":
|
|
3376
3396
|
O = await o.create(
|
|
3377
3397
|
{ question: e.slugs.question },
|
|
3378
|
-
{ body: f, authorId:
|
|
3398
|
+
{ body: f, authorId: l && l.id, contentPath: Y }
|
|
3379
3399
|
);
|
|
3380
3400
|
break;
|
|
3381
3401
|
case "reply":
|
|
3382
3402
|
O = await o.create(
|
|
3383
3403
|
{ question: e.slugs.question, answer: e.slugs.answer },
|
|
3384
|
-
{ body: f, authorId:
|
|
3404
|
+
{ body: f, authorId: l && l.id, contentPath: Y }
|
|
3385
3405
|
);
|
|
3386
3406
|
break;
|
|
3387
3407
|
default:
|
|
@@ -3394,12 +3414,12 @@ const me = "discussion_form_", Pn = ({
|
|
|
3394
3414
|
const U = O;
|
|
3395
3415
|
let W = `${me}error`;
|
|
3396
3416
|
U.message.includes("entry already exists") && (W = pe(
|
|
3397
|
-
|
|
3417
|
+
u.formatMessage,
|
|
3398
3418
|
`${me}error_alreadyExists`,
|
|
3399
3419
|
e.type,
|
|
3400
3420
|
"action"
|
|
3401
3421
|
)), U.message.includes("429") ? W = pe(
|
|
3402
|
-
|
|
3422
|
+
u.formatMessage,
|
|
3403
3423
|
`${me}error_tooMany`,
|
|
3404
3424
|
e.type,
|
|
3405
3425
|
"action"
|
|
@@ -3415,49 +3435,49 @@ const me = "discussion_form_", Pn = ({
|
|
|
3415
3435
|
size: { mobile: "small", 600: "medium" },
|
|
3416
3436
|
onClick: o.handleCancel,
|
|
3417
3437
|
className: "gtm-trackable",
|
|
3418
|
-
"data-gtm-event-context":
|
|
3438
|
+
"data-gtm-event-context": a,
|
|
3419
3439
|
"data-gtm-event-type": `cancel-${e.type}-click`,
|
|
3420
|
-
disabled: !d.cancel && (!
|
|
3421
|
-
children:
|
|
3440
|
+
disabled: !d.cancel && (!l || !l.id || !f),
|
|
3441
|
+
children: u.formatMessage({ id: `${me}cancel` })
|
|
3422
3442
|
}), x.push({
|
|
3423
3443
|
variant: "primary",
|
|
3424
3444
|
size: { mobile: "small", 600: "medium" },
|
|
3425
3445
|
onClick: (w) => {
|
|
3426
3446
|
if (n.isEditing) {
|
|
3427
3447
|
g("submitting"), o.handleSaveEdit && o.handleSaveEdit(
|
|
3428
|
-
|
|
3448
|
+
E.current && "value" in E.current ? E.current.value : ""
|
|
3429
3449
|
);
|
|
3430
3450
|
return;
|
|
3431
3451
|
}
|
|
3432
3452
|
M(w);
|
|
3433
3453
|
},
|
|
3434
3454
|
className: "gtm-trackable",
|
|
3435
|
-
"data-gtm-event-context":
|
|
3455
|
+
"data-gtm-event-context": a,
|
|
3436
3456
|
"data-gtm-event-type": `${n.isEditing ? "save" : "submit"}-${e.type}-click`,
|
|
3437
3457
|
"data-testid": "save-button",
|
|
3438
|
-
disabled: !
|
|
3439
|
-
children:
|
|
3458
|
+
disabled: !l || !l.id || !t || I || V || n.isEditing && f === n.isEditing.text,
|
|
3459
|
+
children: u.formatMessage({
|
|
3440
3460
|
id: `${me}${V ? n.isEditing ? "saving" : "posting" : n.isEditing ? "save" : "post"}`
|
|
3441
3461
|
})
|
|
3442
3462
|
}), /* @__PURE__ */ s.jsxs(
|
|
3443
3463
|
"form",
|
|
3444
3464
|
{
|
|
3445
3465
|
id: T,
|
|
3446
|
-
className:
|
|
3466
|
+
className: S("discussion-card discussion-form", {
|
|
3447
3467
|
"no-styling": n.isInWrapper && n.isEditing
|
|
3448
3468
|
}),
|
|
3449
3469
|
"data-testid": `discussion-${e.type}-form`,
|
|
3450
3470
|
children: [
|
|
3451
|
-
(n == null ? void 0 : n.showTitle) && !n.isEditing && ["question"].includes(e.type) && /* @__PURE__ */ s.jsx("h2", { children: pe(
|
|
3471
|
+
(n == null ? void 0 : n.showTitle) && !n.isEditing && ["question"].includes(e.type) && /* @__PURE__ */ s.jsx("h2", { children: pe(u.formatMessage, `${me}title`, e.type, "action") }),
|
|
3452
3472
|
/* @__PURE__ */ s.jsx(
|
|
3453
3473
|
Bt,
|
|
3454
3474
|
{
|
|
3455
|
-
member:
|
|
3456
|
-
gtmContext:
|
|
3475
|
+
member: l || "community",
|
|
3476
|
+
gtmContext: a,
|
|
3457
3477
|
gtmType: "profile-click"
|
|
3458
3478
|
}
|
|
3459
3479
|
),
|
|
3460
|
-
/* @__PURE__ */ s.jsx(le, { element: "label", showOnFocus: !1, htmlFor: `${T}-input`, children: pe(
|
|
3480
|
+
/* @__PURE__ */ s.jsx(le, { element: "label", showOnFocus: !1, htmlFor: `${T}-input`, children: pe(u.formatMessage, `${me}label`, e.type, "action") }),
|
|
3461
3481
|
/* @__PURE__ */ s.jsx(
|
|
3462
3482
|
_s,
|
|
3463
3483
|
{
|
|
@@ -3465,28 +3485,28 @@ const me = "discussion_form_", Pn = ({
|
|
|
3465
3485
|
id: `${T}-input`,
|
|
3466
3486
|
name: e.type,
|
|
3467
3487
|
placeholder: pe(
|
|
3468
|
-
|
|
3488
|
+
u.formatMessage,
|
|
3469
3489
|
`${me}placeholder`,
|
|
3470
3490
|
e.type,
|
|
3471
3491
|
"action"
|
|
3472
3492
|
),
|
|
3473
3493
|
onChange: k,
|
|
3474
3494
|
value: f,
|
|
3475
|
-
maxLength:
|
|
3495
|
+
maxLength: i,
|
|
3476
3496
|
"aria-invalid": !!p,
|
|
3477
3497
|
"aria-errormessage": "error-message",
|
|
3478
|
-
minRows:
|
|
3498
|
+
minRows: c,
|
|
3479
3499
|
autoFocus: !!n.isEditing
|
|
3480
3500
|
}
|
|
3481
3501
|
),
|
|
3482
|
-
/* @__PURE__ */ s.jsx("small", { children: pe(
|
|
3502
|
+
/* @__PURE__ */ s.jsx("small", { children: pe(u.formatMessage, `${me}explainer`, e.type, "action", {
|
|
3483
3503
|
a: (w) => /* @__PURE__ */ s.jsx(
|
|
3484
3504
|
"a",
|
|
3485
3505
|
{
|
|
3486
3506
|
href: "https://about.apolitical.co/q-and-a-community-guidelines",
|
|
3487
3507
|
target: "_blank",
|
|
3488
3508
|
className: "gtm-trackable",
|
|
3489
|
-
"data-gtm-event-context":
|
|
3509
|
+
"data-gtm-event-context": a,
|
|
3490
3510
|
"data-gtm-event-type": "community-guidelines-link",
|
|
3491
3511
|
rel: "noreferrer",
|
|
3492
3512
|
children: w
|
|
@@ -3494,14 +3514,14 @@ const me = "discussion_form_", Pn = ({
|
|
|
3494
3514
|
)
|
|
3495
3515
|
}) }),
|
|
3496
3516
|
/* @__PURE__ */ s.jsx(ot, { buttons: x }),
|
|
3497
|
-
j === "submitted" && /* @__PURE__ */ s.jsx(Pt, { className: "success", "data-testid": "success", children: pe(
|
|
3498
|
-
p && /* @__PURE__ */ s.jsx(Pt, { id: "error-message", className: "error", "data-testid": "error", children: d.error ? d.error : typeof p == "string" ? p.includes(" ") ? p :
|
|
3517
|
+
j === "submitted" && /* @__PURE__ */ s.jsx(Pt, { className: "success", "data-testid": "success", children: pe(u.formatMessage, `${me}success`, e.type, "action") }),
|
|
3518
|
+
p && /* @__PURE__ */ s.jsx(Pt, { id: "error-message", className: "error", "data-testid": "error", children: d.error ? d.error : typeof p == "string" ? p.includes(" ") ? p : u.formatMessage(
|
|
3499
3519
|
{ id: p },
|
|
3500
3520
|
{
|
|
3501
|
-
action:
|
|
3521
|
+
action: u.formatMessage({
|
|
3502
3522
|
id: `discussion_action_${e.type}`
|
|
3503
3523
|
}),
|
|
3504
|
-
maxLength:
|
|
3524
|
+
maxLength: i
|
|
3505
3525
|
}
|
|
3506
3526
|
) : p })
|
|
3507
3527
|
]
|
|
@@ -3510,13 +3530,13 @@ const me = "discussion_form_", Pn = ({
|
|
|
3510
3530
|
}, It = ({
|
|
3511
3531
|
contentType: e,
|
|
3512
3532
|
createPost: t,
|
|
3513
|
-
membershipRequiredToPost: { isMember: n, required: r, join:
|
|
3533
|
+
membershipRequiredToPost: { isMember: n, required: r, join: i, leave: c, notMemberStateText: d }
|
|
3514
3534
|
}) => r && !n ? /* @__PURE__ */ s.jsx(
|
|
3515
3535
|
it,
|
|
3516
3536
|
{
|
|
3517
3537
|
text: d,
|
|
3518
3538
|
button: {
|
|
3519
|
-
component: /* @__PURE__ */ s.jsx(Tn, { functions: { join:
|
|
3539
|
+
component: /* @__PURE__ */ s.jsx(Tn, { functions: { join: i, leave: c } })
|
|
3520
3540
|
}
|
|
3521
3541
|
}
|
|
3522
3542
|
) : /* @__PURE__ */ s.jsx(
|
|
@@ -3553,19 +3573,19 @@ const St = () => {
|
|
|
3553
3573
|
likes: t = 0,
|
|
3554
3574
|
peopleWhoLiked: n = !1,
|
|
3555
3575
|
isShort: r = !0,
|
|
3556
|
-
userLiked:
|
|
3557
|
-
content:
|
|
3576
|
+
userLiked: i = !1,
|
|
3577
|
+
content: c = { type: "reply", slugs: {} },
|
|
3558
3578
|
canLike: d = !0,
|
|
3559
3579
|
functions: { createLike: o = () => {
|
|
3560
|
-
}, deleteLike:
|
|
3580
|
+
}, deleteLike: a = () => {
|
|
3561
3581
|
} } = {}
|
|
3562
3582
|
}) => {
|
|
3563
|
-
const
|
|
3583
|
+
const u = A();
|
|
3564
3584
|
X(() => {
|
|
3565
|
-
p(
|
|
3566
|
-
}, [
|
|
3567
|
-
const [
|
|
3568
|
-
if (C.preventDefault(), C.stopPropagation(),
|
|
3585
|
+
p(i);
|
|
3586
|
+
}, [i]);
|
|
3587
|
+
const [l, f] = F(t), [h, p] = F(i), [_, j] = F(!1), [g, E] = F(!1), k = et(() => $r(n, Tt), [n]), T = (C) => {
|
|
3588
|
+
if (C.preventDefault(), C.stopPropagation(), E(!1), Be)
|
|
3569
3589
|
return St(), !1;
|
|
3570
3590
|
if (St(), _ || !d)
|
|
3571
3591
|
return !1;
|
|
@@ -3573,35 +3593,35 @@ const St = () => {
|
|
|
3573
3593
|
}, M = async () => {
|
|
3574
3594
|
if (St(), _ || !d)
|
|
3575
3595
|
return !1;
|
|
3576
|
-
let C = h ?
|
|
3596
|
+
let C = h ? l - 1 : l + 1;
|
|
3577
3597
|
C < 0 && (C = 0), j(!0), f(C), p(!h);
|
|
3578
3598
|
try {
|
|
3579
|
-
if (
|
|
3580
|
-
const I = Tr(
|
|
3581
|
-
h ? await
|
|
3599
|
+
if (c && c.slugs) {
|
|
3600
|
+
const I = Tr(c.slugs);
|
|
3601
|
+
h ? await a(I) : await o(I, { contentPath: window.location.pathname });
|
|
3582
3602
|
}
|
|
3583
3603
|
} catch {
|
|
3584
|
-
f(t), p(
|
|
3604
|
+
f(t), p(i);
|
|
3585
3605
|
} finally {
|
|
3586
3606
|
j(!1);
|
|
3587
3607
|
}
|
|
3588
3608
|
};
|
|
3589
|
-
return
|
|
3609
|
+
return N.createElement(
|
|
3590
3610
|
e,
|
|
3591
3611
|
{
|
|
3592
|
-
className:
|
|
3612
|
+
className: S("likes-wrapper text-medium action-button", { "show-spinner": _, "is-liked": h, disabled: !d }),
|
|
3593
3613
|
onClick: T,
|
|
3594
3614
|
onMouseEnter: () => {
|
|
3595
|
-
|
|
3615
|
+
E(!0);
|
|
3596
3616
|
},
|
|
3597
3617
|
onMouseLeave: () => {
|
|
3598
|
-
|
|
3618
|
+
E(!1);
|
|
3599
3619
|
},
|
|
3600
3620
|
onFocus: () => {
|
|
3601
|
-
|
|
3621
|
+
E(!0);
|
|
3602
3622
|
},
|
|
3603
3623
|
onBlur: () => {
|
|
3604
|
-
|
|
3624
|
+
E(!1);
|
|
3605
3625
|
},
|
|
3606
3626
|
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
3607
3627
|
/* @__PURE__ */ s.jsx(
|
|
@@ -3610,31 +3630,31 @@ const St = () => {
|
|
|
3610
3630
|
variant: "tertiary",
|
|
3611
3631
|
size: "medium",
|
|
3612
3632
|
icon: { icon: h ? "heart" : "heart_empty", animate: "bounce" },
|
|
3613
|
-
className:
|
|
3614
|
-
screenreaderText: d ?
|
|
3633
|
+
className: S({ "do-animation": h && !i }),
|
|
3634
|
+
screenreaderText: d ? u.formatMessage({
|
|
3615
3635
|
id: `discussion_likes_${h ? "unlike" : "like"}`
|
|
3616
|
-
}, { action:
|
|
3636
|
+
}, { action: u.formatMessage({ id: `discussion_action_${c.type}` }) }) : !1,
|
|
3617
3637
|
onClick: T,
|
|
3618
3638
|
disabled: !d,
|
|
3619
3639
|
"aria-hidden": !d,
|
|
3620
3640
|
"data-testid": "like-button",
|
|
3621
3641
|
"data-gtm-event-context": "Likes",
|
|
3622
|
-
"data-gtm-event-type": `like-${
|
|
3642
|
+
"data-gtm-event-type": `like-${c.type}-click`
|
|
3623
3643
|
}
|
|
3624
3644
|
),
|
|
3625
|
-
/* @__PURE__ */ s.jsx("span", { className:
|
|
3645
|
+
/* @__PURE__ */ s.jsx("span", { className: S("number-of-likes", { "no-likes": l === 0 }), "data-testid": "number-of-likes", children: u.formatMessage({ id: `discussion_likes${r ? "_short" : ""}` }, { number: l }) }),
|
|
3626
3646
|
n && /* @__PURE__ */ s.jsx(Hs, { isOpen: g, isLoading: n.length === 0, children: n.length && /* @__PURE__ */ s.jsxs("ul", { children: [
|
|
3627
3647
|
k.map((C) => typeof C == "string" || !C.name ? null : /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(at, { href: C.id ? `/profiles/${C.id}` : void 0, gtmContext: "Likes", gtmType: "liked-name-click", children: C.name }) }, C.id || window.btoa(C.name))),
|
|
3628
|
-
n.length > Tt && /* @__PURE__ */ s.jsx("li", { children:
|
|
3648
|
+
n.length > Tt && /* @__PURE__ */ s.jsx("li", { children: u.formatMessage({ id: "discussion_likes_more" }, { number: n.length - Tt }) })
|
|
3629
3649
|
] }) })
|
|
3630
3650
|
] })
|
|
3631
3651
|
}
|
|
3632
3652
|
);
|
|
3633
3653
|
};
|
|
3634
|
-
const Cr = ({ element: e = "section", children: t, className: n, ...r }) =>
|
|
3654
|
+
const Cr = ({ element: e = "section", children: t, className: n, ...r }) => N.createElement(
|
|
3635
3655
|
e,
|
|
3636
3656
|
{
|
|
3637
|
-
className:
|
|
3657
|
+
className: S("modal", n),
|
|
3638
3658
|
children: typeof t == "string" ? /* @__PURE__ */ s.jsx("p", { children: t }) : t,
|
|
3639
3659
|
...r
|
|
3640
3660
|
}
|
|
@@ -3644,28 +3664,28 @@ const Rn = ({
|
|
|
3644
3664
|
isOpen: t = !1,
|
|
3645
3665
|
showDivider: n = !0,
|
|
3646
3666
|
maxWidth: r,
|
|
3647
|
-
functions: { onOpen:
|
|
3648
|
-
}, onClose:
|
|
3667
|
+
functions: { onOpen: i = () => {
|
|
3668
|
+
}, onClose: c = () => {
|
|
3649
3669
|
} } = {},
|
|
3650
3670
|
forceShow: { error: d = !1 } = {},
|
|
3651
3671
|
title: o,
|
|
3652
|
-
children:
|
|
3653
|
-
buttons:
|
|
3654
|
-
className:
|
|
3672
|
+
children: a,
|
|
3673
|
+
buttons: u,
|
|
3674
|
+
className: l = "",
|
|
3655
3675
|
gtmContext: f = "Modal"
|
|
3656
3676
|
}) => {
|
|
3657
|
-
const h =
|
|
3658
|
-
_(
|
|
3677
|
+
const h = A(), [p, _] = F(t), j = (E) => {
|
|
3678
|
+
_(E), E ? (i(), document.body.classList.add("has-overlay")) : (c(), document.body.classList.remove("has-overlay"));
|
|
3659
3679
|
};
|
|
3660
3680
|
X(() => {
|
|
3661
3681
|
j(t);
|
|
3662
3682
|
}, [t]);
|
|
3663
3683
|
const g = r ? { "--max-width": `${r / 16}rem` } : {};
|
|
3664
|
-
return /* @__PURE__ */ s.jsx("div", { className:
|
|
3684
|
+
return /* @__PURE__ */ s.jsx("div", { className: S("overlay", { open: p }), children: /* @__PURE__ */ s.jsx(
|
|
3665
3685
|
Cr,
|
|
3666
3686
|
{
|
|
3667
3687
|
id: e,
|
|
3668
|
-
className:
|
|
3688
|
+
className: S("overlay-modal", l, { "has-max-width": r }),
|
|
3669
3689
|
hidden: !p,
|
|
3670
3690
|
style: g,
|
|
3671
3691
|
children: t && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
@@ -3686,10 +3706,10 @@ const Rn = ({
|
|
|
3686
3706
|
)
|
|
3687
3707
|
] }),
|
|
3688
3708
|
n && /* @__PURE__ */ s.jsx(De, {}),
|
|
3689
|
-
|
|
3690
|
-
|
|
3709
|
+
a,
|
|
3710
|
+
u && /* @__PURE__ */ s.jsxs("div", { className: "bottom", children: [
|
|
3691
3711
|
/* @__PURE__ */ s.jsx(De, {}),
|
|
3692
|
-
/* @__PURE__ */ s.jsx(ot, { buttons:
|
|
3712
|
+
/* @__PURE__ */ s.jsx(ot, { buttons: u })
|
|
3693
3713
|
] }),
|
|
3694
3714
|
d && /* @__PURE__ */ s.jsx(Pt, { className: "error", children: d })
|
|
3695
3715
|
] })
|
|
@@ -3700,18 +3720,18 @@ const Rn = ({
|
|
|
3700
3720
|
"aria-expanded": t,
|
|
3701
3721
|
"aria-controls": e
|
|
3702
3722
|
});
|
|
3703
|
-
const
|
|
3723
|
+
const No = ({
|
|
3704
3724
|
className: e,
|
|
3705
3725
|
showModal: t = !0,
|
|
3706
3726
|
title: n,
|
|
3707
3727
|
formTitle: r = "Know someone who might like to join this workshop?",
|
|
3708
|
-
formLabel:
|
|
3709
|
-
ctaMessage:
|
|
3728
|
+
formLabel: i = "Send an invitation to your colleagues below",
|
|
3729
|
+
ctaMessage: c = "Send invites",
|
|
3710
3730
|
showIcon: d,
|
|
3711
3731
|
onClose: o,
|
|
3712
|
-
reportError:
|
|
3732
|
+
reportError: a = () => {
|
|
3713
3733
|
},
|
|
3714
|
-
sendInvites:
|
|
3734
|
+
sendInvites: u
|
|
3715
3735
|
}) => /* @__PURE__ */ s.jsx(
|
|
3716
3736
|
Rn,
|
|
3717
3737
|
{
|
|
@@ -3719,16 +3739,16 @@ const Ao = ({
|
|
|
3719
3739
|
isOpen: t,
|
|
3720
3740
|
showDivider: !1,
|
|
3721
3741
|
showIcon: d,
|
|
3722
|
-
className:
|
|
3742
|
+
className: S("invite-modal", e, { success: !!n }),
|
|
3723
3743
|
children: /* @__PURE__ */ s.jsx(
|
|
3724
3744
|
wr,
|
|
3725
3745
|
{
|
|
3726
3746
|
title: r,
|
|
3727
|
-
label:
|
|
3728
|
-
ctaMessage:
|
|
3747
|
+
label: i,
|
|
3748
|
+
ctaMessage: c,
|
|
3729
3749
|
onClose: o,
|
|
3730
|
-
sendInvites:
|
|
3731
|
-
reportError:
|
|
3750
|
+
sendInvites: u,
|
|
3751
|
+
reportError: a
|
|
3732
3752
|
}
|
|
3733
3753
|
)
|
|
3734
3754
|
}
|
|
@@ -3736,14 +3756,14 @@ const Ao = ({
|
|
|
3736
3756
|
const t = {};
|
|
3737
3757
|
return Object.keys(e).forEach((n) => n.includes("Id") ? t[n] = e[n] : t[`${n}Slug`] = e[n]), t;
|
|
3738
3758
|
}, Ht = (e, t) => e && !t;
|
|
3739
|
-
const ve = "discussion_",
|
|
3759
|
+
const ve = "discussion_", Nr = 280, ct = ({
|
|
3740
3760
|
element: e = "div",
|
|
3741
3761
|
content: t,
|
|
3742
3762
|
userHasPermissions: n = !0,
|
|
3743
3763
|
isLoading: r = !1,
|
|
3744
|
-
originalAuthorId:
|
|
3764
|
+
originalAuthorId: i,
|
|
3745
3765
|
functions: {
|
|
3746
|
-
content: { createContent:
|
|
3766
|
+
content: { createContent: c, deleteContent: d, updateContent: o } = {
|
|
3747
3767
|
createContent: () => {
|
|
3748
3768
|
},
|
|
3749
3769
|
deleteContent: () => {
|
|
@@ -3751,10 +3771,10 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3751
3771
|
updateContent: () => {
|
|
3752
3772
|
}
|
|
3753
3773
|
},
|
|
3754
|
-
likes: { createLike:
|
|
3774
|
+
likes: { createLike: a, deleteLike: u } = { createLike: () => {
|
|
3755
3775
|
}, deleteLike: () => {
|
|
3756
3776
|
} },
|
|
3757
|
-
comments: { openComments:
|
|
3777
|
+
comments: { openComments: l } = { openComments: () => {
|
|
3758
3778
|
} }
|
|
3759
3779
|
},
|
|
3760
3780
|
links: f = {},
|
|
@@ -3763,7 +3783,7 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3763
3783
|
children: _,
|
|
3764
3784
|
isTruncated: j = !1
|
|
3765
3785
|
}) => {
|
|
3766
|
-
const g =
|
|
3786
|
+
const g = A(), E = ge(Se), k = ge(lt), [T, M] = F({
|
|
3767
3787
|
body: t && t.body || "",
|
|
3768
3788
|
isEditing: !1,
|
|
3769
3789
|
didEdit: t && t.isEdited || !1
|
|
@@ -3776,7 +3796,7 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3776
3796
|
});
|
|
3777
3797
|
}, [t.isEdited]), r || !t || t.type === "answer" && (!t.slugs || !t.slugs.question))
|
|
3778
3798
|
return /* @__PURE__ */ s.jsx(je, { className: "discussion-card discussion-post" });
|
|
3779
|
-
const { author: b, canLike: Q, createdAt: w, id: Y, likes: L = 0, userLiked: O, comments: U = 0 } = t, W = j ? tt(T.body,
|
|
3799
|
+
const { author: b, canLike: Q, createdAt: w, id: Y, likes: L = 0, userLiked: O, comments: U = 0 } = t, W = j ? tt(T.body, Nr) : T.body, Z = E && E.id && typeof b != "string" && b.id && b.id === E.id || !1, re = typeof Q == "boolean" ? Q : n ? !Z : !1, oe = async (P) => {
|
|
3780
3800
|
P || (P = ""), x("");
|
|
3781
3801
|
try {
|
|
3782
3802
|
if (!xs(P, T.body)) {
|
|
@@ -3836,15 +3856,15 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3836
3856
|
"data-gtm-event-type": `delete-${t.type}-click`,
|
|
3837
3857
|
...Dr(`delete-${t.slug}-modal`, C)
|
|
3838
3858
|
}
|
|
3839
|
-
),
|
|
3840
|
-
className:
|
|
3859
|
+
), N.createElement(e, {
|
|
3860
|
+
className: S("discussion-post", h),
|
|
3841
3861
|
"data-testid": `discussion-${t.type}-thread`,
|
|
3842
3862
|
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
3843
3863
|
/* @__PURE__ */ s.jsxs(
|
|
3844
3864
|
"div",
|
|
3845
3865
|
{
|
|
3846
3866
|
id: Y || t.slug,
|
|
3847
|
-
className:
|
|
3867
|
+
className: S("discussion-card", t.type, {
|
|
3848
3868
|
editing: T.isEditing,
|
|
3849
3869
|
"has-link": f.post && !T.isEditing
|
|
3850
3870
|
}),
|
|
@@ -3857,7 +3877,7 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3857
3877
|
{
|
|
3858
3878
|
member: b,
|
|
3859
3879
|
additionalContent: { createdAt: w, didEdit: T.didEdit },
|
|
3860
|
-
className: typeof b != "string" && b.id ===
|
|
3880
|
+
className: typeof b != "string" && b.id === i ? "highlighted" : "",
|
|
3861
3881
|
gtmContext: p,
|
|
3862
3882
|
gtmType: "profile-click"
|
|
3863
3883
|
}
|
|
@@ -3884,7 +3904,7 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3884
3904
|
) : !1
|
|
3885
3905
|
},
|
|
3886
3906
|
functions: {
|
|
3887
|
-
create:
|
|
3907
|
+
create: c,
|
|
3888
3908
|
handleSaveEdit: oe,
|
|
3889
3909
|
handleCancel: () => {
|
|
3890
3910
|
x(""), M({ ...T, isEditing: !1 });
|
|
@@ -3905,7 +3925,7 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3905
3925
|
on,
|
|
3906
3926
|
{
|
|
3907
3927
|
options: {
|
|
3908
|
-
wrapper: t.type === "question" ? "h1" :
|
|
3928
|
+
wrapper: t.type === "question" ? "h1" : N.Fragment,
|
|
3909
3929
|
forceWrapper: t.type === "question",
|
|
3910
3930
|
forceInline: t.type === "question",
|
|
3911
3931
|
forceBlock: t.type !== "question"
|
|
@@ -3916,7 +3936,7 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3916
3936
|
!T.isEditing && /* @__PURE__ */ s.jsxs(
|
|
3917
3937
|
"ul",
|
|
3918
3938
|
{
|
|
3919
|
-
className:
|
|
3939
|
+
className: S("actions text-medium", t.type),
|
|
3920
3940
|
"data-testid": `${t.type}-actions`,
|
|
3921
3941
|
children: [
|
|
3922
3942
|
/* @__PURE__ */ s.jsx(
|
|
@@ -3929,17 +3949,17 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3929
3949
|
content: { type: t.type, slugs: t.slugs },
|
|
3930
3950
|
canLike: re,
|
|
3931
3951
|
functions: {
|
|
3932
|
-
createLike:
|
|
3933
|
-
deleteLike:
|
|
3952
|
+
createLike: a,
|
|
3953
|
+
deleteLike: u
|
|
3934
3954
|
}
|
|
3935
3955
|
}
|
|
3936
3956
|
),
|
|
3937
|
-
(["question", "post"].includes(t.type) || f.comments || typeof
|
|
3957
|
+
(["question", "post"].includes(t.type) || f.comments || typeof l == "function") && /* @__PURE__ */ s.jsxs(
|
|
3938
3958
|
"li",
|
|
3939
3959
|
{
|
|
3940
3960
|
className: "action-button",
|
|
3941
3961
|
onClick: (P) => {
|
|
3942
|
-
P.preventDefault(), P.stopPropagation(), f.comments && (window.location.href = f.comments), typeof
|
|
3962
|
+
P.preventDefault(), P.stopPropagation(), f.comments && (window.location.href = f.comments), typeof l == "function" && l();
|
|
3943
3963
|
},
|
|
3944
3964
|
children: [
|
|
3945
3965
|
/* @__PURE__ */ s.jsx(
|
|
@@ -3950,7 +3970,7 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
3950
3970
|
styling: { muted: !0 },
|
|
3951
3971
|
icon: { icon: "speech-bubble_square_thick" },
|
|
3952
3972
|
href: f.comments ? f.comments : !1,
|
|
3953
|
-
onClick: f.comments || typeof
|
|
3973
|
+
onClick: f.comments || typeof l != "function" ? !1 : l,
|
|
3954
3974
|
className: "gtm-trackable",
|
|
3955
3975
|
"data-gtm-event-context": p,
|
|
3956
3976
|
"data-gtm-event-type": `answer-${t.type}-click`,
|
|
@@ -4044,29 +4064,46 @@ const ve = "discussion_", Ar = 280, ct = ({
|
|
|
4044
4064
|
] })
|
|
4045
4065
|
});
|
|
4046
4066
|
};
|
|
4047
|
-
const $t = "discussion_responses_",
|
|
4048
|
-
const n =
|
|
4067
|
+
const $t = "discussion_responses_", Ao = ({ type: e = "answer", responses: t = 0 }) => {
|
|
4068
|
+
const n = A();
|
|
4049
4069
|
return /* @__PURE__ */ s.jsxs("div", { className: "responses-heading", children: [
|
|
4050
4070
|
/* @__PURE__ */ s.jsx("h3", { children: n.formatMessage({ id: `${$t}title` }, { action: n.formatMessage({ id: `${$t}${e}` }), count: t }) }),
|
|
4051
4071
|
t === 0 && /* @__PURE__ */ s.jsx("p", { children: pe(n.formatMessage, `${$t}empty`, e, e) })
|
|
4052
4072
|
] });
|
|
4053
4073
|
};
|
|
4054
|
-
const
|
|
4055
|
-
const r =
|
|
4074
|
+
const Ar = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
4075
|
+
const r = A(), i = ne(null), c = ge(lt), [d, o] = F(
|
|
4076
|
+
"closed"
|
|
4077
|
+
/* Closed */
|
|
4078
|
+
);
|
|
4056
4079
|
X(() => {
|
|
4057
|
-
const f =
|
|
4080
|
+
const f = i.current;
|
|
4058
4081
|
if (f)
|
|
4059
|
-
return f.addEventListener("transitionend",
|
|
4060
|
-
f.removeEventListener("transitionend",
|
|
4082
|
+
return f.addEventListener("transitionend", a), () => {
|
|
4083
|
+
f.removeEventListener("transitionend", a);
|
|
4061
4084
|
};
|
|
4062
4085
|
}, []), Ce(() => {
|
|
4063
|
-
d === "closed" && !
|
|
4064
|
-
|
|
4065
|
-
|
|
4086
|
+
d === "closed" && !c.showThread || o(
|
|
4087
|
+
[
|
|
4088
|
+
"opening",
|
|
4089
|
+
"open"
|
|
4090
|
+
/* Open */
|
|
4091
|
+
].includes(d) ? "ready-to-close" : "opening"
|
|
4092
|
+
/* Opening */
|
|
4093
|
+
);
|
|
4094
|
+
}, [c.showThread]), X(() => {
|
|
4095
|
+
d === "ready-to-close" && o(
|
|
4096
|
+
"closing"
|
|
4097
|
+
/* Closing */
|
|
4098
|
+
);
|
|
4066
4099
|
}, [d]);
|
|
4067
|
-
const
|
|
4100
|
+
const a = ({ propertyName: f }) => {
|
|
4068
4101
|
f === "max-height" && o((h) => h === "opening" ? "open" : h === "closing" ? "closed" : h);
|
|
4069
|
-
},
|
|
4102
|
+
}, u = [
|
|
4103
|
+
"opening",
|
|
4104
|
+
"open"
|
|
4105
|
+
/* Open */
|
|
4106
|
+
].includes(d), l = vn(n, {
|
|
4070
4107
|
element: "li"
|
|
4071
4108
|
});
|
|
4072
4109
|
return /* @__PURE__ */ s.jsxs("div", { className: "thread-wrapper", children: [
|
|
@@ -4076,16 +4113,16 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4076
4113
|
variant: "secondary",
|
|
4077
4114
|
size: "small",
|
|
4078
4115
|
styling: { muted: !0 },
|
|
4079
|
-
icon: { icon: `arrow_corner-down_${
|
|
4116
|
+
icon: { icon: `arrow_corner-down_${u ? "left" : "right"}` },
|
|
4080
4117
|
onClick: () => {
|
|
4081
4118
|
var f;
|
|
4082
|
-
(f =
|
|
4119
|
+
(f = c.updateConversation) == null || f.call(c, (h) => ({
|
|
4083
4120
|
showThread: !h.showThread,
|
|
4084
4121
|
showForm: !1
|
|
4085
4122
|
}));
|
|
4086
4123
|
},
|
|
4087
4124
|
children: r.formatMessage(
|
|
4088
|
-
{ id: `discussion_thread_${
|
|
4125
|
+
{ id: `discussion_thread_${u ? "hide" : "show"}` },
|
|
4089
4126
|
{ count: e }
|
|
4090
4127
|
)
|
|
4091
4128
|
}
|
|
@@ -4093,10 +4130,10 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4093
4130
|
/* @__PURE__ */ s.jsx(
|
|
4094
4131
|
"ul",
|
|
4095
4132
|
{
|
|
4096
|
-
ref:
|
|
4097
|
-
className:
|
|
4098
|
-
hidden: !
|
|
4099
|
-
children:
|
|
4133
|
+
ref: i,
|
|
4134
|
+
className: S("thread", d),
|
|
4135
|
+
hidden: !c.showThread,
|
|
4136
|
+
children: l
|
|
4100
4137
|
}
|
|
4101
4138
|
)
|
|
4102
4139
|
] });
|
|
@@ -4129,12 +4166,12 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4129
4166
|
}) => ({ mutationFn: r, onMutate: async ({ content: o }) => {
|
|
4130
4167
|
if (!n)
|
|
4131
4168
|
return;
|
|
4132
|
-
const
|
|
4169
|
+
const a = Pr({ user: n, content: o, verb: "post" });
|
|
4133
4170
|
await e.cancelQueries({ queryKey: t });
|
|
4134
|
-
const
|
|
4135
|
-
return e.setQueryData(t, (
|
|
4136
|
-
}, onError: (o,
|
|
4137
|
-
e.setQueryData(t,
|
|
4171
|
+
const u = e.getQueryData(t);
|
|
4172
|
+
return e.setQueryData(t, (l) => [...l, a]), { previousActivities: u };
|
|
4173
|
+
}, onError: (o, a, u) => {
|
|
4174
|
+
e.setQueryData(t, u.previousActivities);
|
|
4138
4175
|
}, onSettled: () => {
|
|
4139
4176
|
e.invalidateQueries({ queryKey: t });
|
|
4140
4177
|
} }), Fr = ({
|
|
@@ -4150,11 +4187,11 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4150
4187
|
if (o.length === 0)
|
|
4151
4188
|
return;
|
|
4152
4189
|
await e.cancelQueries({ queryKey: t });
|
|
4153
|
-
const
|
|
4154
|
-
return e.setQueryData(t, () =>
|
|
4190
|
+
const a = e.getQueryData(t), u = a == null ? void 0 : a.map((l) => ((l == null ? void 0 : l.id) === (d == null ? void 0 : d.activityId) && (l.content = o), l));
|
|
4191
|
+
return e.setQueryData(t, () => u && [...u]), { previousActivities: u };
|
|
4155
4192
|
},
|
|
4156
|
-
onError: (d, o,
|
|
4157
|
-
e.setQueryData(t,
|
|
4193
|
+
onError: (d, o, a) => {
|
|
4194
|
+
e.setQueryData(t, a.previousActivities);
|
|
4158
4195
|
},
|
|
4159
4196
|
onSettled: () => {
|
|
4160
4197
|
e.invalidateQueries({ queryKey: t });
|
|
@@ -4165,59 +4202,64 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4165
4202
|
mutationFn: n
|
|
4166
4203
|
}) => ({ mutationFn: n, onMutate: async ({ activityId: o }) => {
|
|
4167
4204
|
await e.cancelQueries({ queryKey: t });
|
|
4168
|
-
const
|
|
4205
|
+
const a = e.getQueryData(t), u = a == null ? void 0 : a.map((l) => {
|
|
4169
4206
|
var f;
|
|
4170
|
-
return (
|
|
4207
|
+
return (l == null ? void 0 : l.id) === o && ((f = l.reaction_counts) != null && f.like ? l.reaction_counts.like += 1 : l.reaction_counts.like = 1), l;
|
|
4171
4208
|
});
|
|
4172
|
-
return e.setQueryData(t, () =>
|
|
4173
|
-
}, onError: (o,
|
|
4174
|
-
e.setQueryData(t,
|
|
4209
|
+
return e.setQueryData(t, () => u && [...u]), { previousActivities: u };
|
|
4210
|
+
}, onError: (o, a, u) => {
|
|
4211
|
+
e.setQueryData(t, u.previousActivities);
|
|
4175
4212
|
}, onSuccess: (o) => {
|
|
4176
|
-
const
|
|
4177
|
-
|
|
4178
|
-
|
|
4213
|
+
const a = e.getQueryData(t), u = a == null ? void 0 : a.map((l) => {
|
|
4214
|
+
var f, h;
|
|
4215
|
+
return (l == null ? void 0 : l.id) === (o == null ? void 0 : o.activity_id) && ((f = l.own_reactions) != null && f.like ? l.own_reactions.like.push(o) : l.own_reactions.like = [o], (h = l.latest_reactions) != null && h.like ? l.latest_reactions.like.push(o) : l.latest_reactions.like = [o]), l;
|
|
4216
|
+
});
|
|
4217
|
+
return e.setQueryData(t, () => u && [...u]), { previousActivities: a };
|
|
4218
|
+
}, onSettled: (o, a, u) => {
|
|
4179
4219
|
e.invalidateQueries({
|
|
4180
|
-
queryKey: [...t,
|
|
4220
|
+
queryKey: [...t, u.activityId]
|
|
4181
4221
|
});
|
|
4182
4222
|
} }), Or = ({
|
|
4183
4223
|
queryClient: e,
|
|
4184
4224
|
queryKey: t,
|
|
4185
4225
|
user: n,
|
|
4186
4226
|
mutationFn: r
|
|
4187
|
-
}) => ({ mutationFn: r, onMutate: async ({ activityId:
|
|
4227
|
+
}) => ({ mutationFn: r, onMutate: async ({ activityId: a }) => {
|
|
4188
4228
|
await e.cancelQueries({ queryKey: t });
|
|
4189
|
-
const
|
|
4229
|
+
const u = e.getQueryData(t), l = u == null ? void 0 : u.map((f) => {
|
|
4190
4230
|
var h;
|
|
4191
|
-
return (f == null ? void 0 : f.id) ===
|
|
4231
|
+
return (f == null ? void 0 : f.id) === a && (h = f.reaction_counts) != null && h.like && (f.reaction_counts.like -= 1), f;
|
|
4192
4232
|
});
|
|
4193
|
-
return e.setQueryData(t, () =>
|
|
4194
|
-
}, onError: (
|
|
4195
|
-
e.setQueryData(t,
|
|
4196
|
-
}, onSuccess: (
|
|
4197
|
-
const
|
|
4198
|
-
var p, _, j, g;
|
|
4199
|
-
if (h.id ===
|
|
4200
|
-
const
|
|
4201
|
-
(
|
|
4233
|
+
return e.setQueryData(t, () => l && [...l]), { previousActivities: l };
|
|
4234
|
+
}, onError: (a, u, l) => {
|
|
4235
|
+
e.setQueryData(t, l.previousActivities);
|
|
4236
|
+
}, onSuccess: (a, { activityId: u }) => {
|
|
4237
|
+
const l = e.getQueryData(t), f = l == null ? void 0 : l.map((h) => {
|
|
4238
|
+
var p, _, j, g, E;
|
|
4239
|
+
if (h.id === u) {
|
|
4240
|
+
const k = (j = (_ = (p = h.own_reactions) == null ? void 0 : p.like) == null ? void 0 : _.find(
|
|
4241
|
+
(T) => T.user_id === (n == null ? void 0 : n.id)
|
|
4202
4242
|
)) == null ? void 0 : j.id;
|
|
4203
|
-
return h.
|
|
4204
|
-
(
|
|
4243
|
+
return h.own_reactions.like = (g = h.own_reactions.like) == null ? void 0 : g.filter(
|
|
4244
|
+
(T) => T.id !== k
|
|
4245
|
+
), h.latest_reactions.like = (E = h.latest_reactions.like) == null ? void 0 : E.filter(
|
|
4246
|
+
(T) => T.id !== k
|
|
4205
4247
|
), h;
|
|
4206
4248
|
} else
|
|
4207
4249
|
return h;
|
|
4208
4250
|
});
|
|
4209
|
-
return e.setQueryData(t, () => f && [...f]), { previousActivities:
|
|
4210
|
-
}, onSettled: (
|
|
4251
|
+
return e.setQueryData(t, () => f && [...f]), { previousActivities: l };
|
|
4252
|
+
}, onSettled: (a, u, l) => {
|
|
4211
4253
|
e.invalidateQueries({
|
|
4212
|
-
queryKey: [...t,
|
|
4254
|
+
queryKey: [...t, l.activityId]
|
|
4213
4255
|
});
|
|
4214
4256
|
} }), Po = ({
|
|
4215
4257
|
basePath: e,
|
|
4216
4258
|
parentId: t,
|
|
4217
4259
|
isMember: n,
|
|
4218
|
-
functions: { list: r, create:
|
|
4260
|
+
functions: { list: r, create: i, edit: c, like: d, unlike: o, join: a, leave: u }
|
|
4219
4261
|
}) => {
|
|
4220
|
-
const
|
|
4262
|
+
const l = A(), f = st(), h = ge(Se), {
|
|
4221
4263
|
data: p,
|
|
4222
4264
|
error: _,
|
|
4223
4265
|
isLoading: j,
|
|
@@ -4225,15 +4267,15 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4225
4267
|
} = fn({
|
|
4226
4268
|
queryKey: [e, t],
|
|
4227
4269
|
queryFn: r
|
|
4228
|
-
}),
|
|
4270
|
+
}), E = Rr({
|
|
4229
4271
|
queryClient: f,
|
|
4230
4272
|
queryKey: [e, t],
|
|
4231
4273
|
user: h,
|
|
4232
|
-
mutationFn:
|
|
4233
|
-
}), { mutate: k } = de(
|
|
4274
|
+
mutationFn: i
|
|
4275
|
+
}), { mutate: k } = de(E), T = Fr({
|
|
4234
4276
|
queryClient: f,
|
|
4235
4277
|
queryKey: [e, t],
|
|
4236
|
-
mutationFn: async (w) => await
|
|
4278
|
+
mutationFn: async (w) => await c(w)
|
|
4237
4279
|
}), {
|
|
4238
4280
|
mutate: M
|
|
4239
4281
|
} = de(T), C = Lr({
|
|
@@ -4273,9 +4315,9 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4273
4315
|
membershipRequiredToPost: {
|
|
4274
4316
|
isMember: n,
|
|
4275
4317
|
required: !0,
|
|
4276
|
-
join:
|
|
4277
|
-
leave:
|
|
4278
|
-
notMemberStateText:
|
|
4318
|
+
join: a,
|
|
4319
|
+
leave: u,
|
|
4320
|
+
notMemberStateText: l.formatMessage({ id: "community_joinToPost" })
|
|
4279
4321
|
}
|
|
4280
4322
|
}
|
|
4281
4323
|
),
|
|
@@ -4341,17 +4383,17 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4341
4383
|
mutationFn: n
|
|
4342
4384
|
}) => ({ mutationFn: n, onMutate: async () => {
|
|
4343
4385
|
await e.cancelQueries({ queryKey: t });
|
|
4344
|
-
}, onError: (o,
|
|
4345
|
-
e.setQueryData(t,
|
|
4386
|
+
}, onError: (o, a, u) => {
|
|
4387
|
+
e.setQueryData(t, u.previousActivity);
|
|
4346
4388
|
}, onSuccess: (o) => {
|
|
4347
|
-
var
|
|
4348
|
-
const
|
|
4349
|
-
if (
|
|
4350
|
-
return (
|
|
4351
|
-
reply:
|
|
4352
|
-
})) : (
|
|
4353
|
-
...
|
|
4354
|
-
})), { previousActivity:
|
|
4389
|
+
var u;
|
|
4390
|
+
const a = e.getQueryData(t);
|
|
4391
|
+
if (a)
|
|
4392
|
+
return (u = a == null ? void 0 : a.latest_reactions) != null && u.reply ? (a.latest_reactions.reply.unshift(o), a && (a.reaction_counts = {
|
|
4393
|
+
reply: a.latest_reactions.reply.length
|
|
4394
|
+
})) : (a.latest_reactions = { reply: [o] }, a.reaction_counts = { reply: 1 }), e.setQueryData(t, () => ({
|
|
4395
|
+
...a
|
|
4396
|
+
})), { previousActivity: a };
|
|
4355
4397
|
}, onSettled: () => {
|
|
4356
4398
|
e.invalidateQueries({ queryKey: t });
|
|
4357
4399
|
} }), Ir = ({
|
|
@@ -4361,23 +4403,23 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4361
4403
|
}) => ({
|
|
4362
4404
|
mutationFn: n,
|
|
4363
4405
|
onMutate: async ({
|
|
4364
|
-
replyInfo:
|
|
4406
|
+
replyInfo: c,
|
|
4365
4407
|
content: { body: d }
|
|
4366
4408
|
}) => {
|
|
4367
|
-
var
|
|
4409
|
+
var u, l, f;
|
|
4368
4410
|
if (d.length === 0)
|
|
4369
4411
|
return;
|
|
4370
4412
|
await e.cancelQueries({ queryKey: t });
|
|
4371
4413
|
const o = e.getQueryData(t);
|
|
4372
|
-
if (!o || !((
|
|
4414
|
+
if (!o || !((u = o == null ? void 0 : o.latest_reactions) != null && u.reply))
|
|
4373
4415
|
return;
|
|
4374
|
-
const
|
|
4416
|
+
const a = (f = (l = o == null ? void 0 : o.latest_reactions) == null ? void 0 : l.reply) == null ? void 0 : f.map((h) => (h.id === c.replySlug && (h.data.content = d), h));
|
|
4375
4417
|
return e.setQueryData(t, () => ({
|
|
4376
4418
|
...o,
|
|
4377
|
-
latest_reactions: { reply:
|
|
4419
|
+
latest_reactions: { reply: a }
|
|
4378
4420
|
})), { previousActivity: o };
|
|
4379
4421
|
},
|
|
4380
|
-
onError: (
|
|
4422
|
+
onError: (c, d, o) => {
|
|
4381
4423
|
e.setQueryData(t, o.previousActivity);
|
|
4382
4424
|
}
|
|
4383
4425
|
}), Hr = ({
|
|
@@ -4385,24 +4427,27 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4385
4427
|
queryKey: t,
|
|
4386
4428
|
mutationFn: n
|
|
4387
4429
|
}) => ({ mutationFn: n, onMutate: async ({ replyId: d }) => {
|
|
4388
|
-
var
|
|
4430
|
+
var u, l;
|
|
4389
4431
|
await e.cancelQueries({ queryKey: t });
|
|
4390
|
-
const o = e.getQueryData(t),
|
|
4432
|
+
const o = e.getQueryData(t), a = (l = (u = o == null ? void 0 : o.latest_reactions) == null ? void 0 : u.reply) == null ? void 0 : l.map((f) => {
|
|
4391
4433
|
var h;
|
|
4392
4434
|
return f.id === d && ((h = f.children_counts) != null && h.like ? f.children_counts.like += 1 : f.children_counts = { like: 1 }), f;
|
|
4393
4435
|
});
|
|
4394
4436
|
return e.setQueryData(t, () => ({
|
|
4395
4437
|
...o,
|
|
4396
|
-
latest_reactions: { reply:
|
|
4438
|
+
latest_reactions: { reply: a }
|
|
4397
4439
|
})), { previousActivity: o };
|
|
4398
|
-
}, onError: (d, o,
|
|
4399
|
-
e.setQueryData(t,
|
|
4440
|
+
}, onError: (d, o, a) => {
|
|
4441
|
+
e.setQueryData(t, a.previousActivity);
|
|
4400
4442
|
}, onSuccess: (d) => {
|
|
4401
|
-
var
|
|
4402
|
-
const o = e.getQueryData(t),
|
|
4443
|
+
var u;
|
|
4444
|
+
const o = e.getQueryData(t), a = (u = o == null ? void 0 : o.latest_reactions.reply) == null ? void 0 : u.map((l) => {
|
|
4445
|
+
var f, h;
|
|
4446
|
+
return l.id === d.id && ((f = l.own_children) != null && f.like ? l.own_children.like.push(d) : l.own_children = { like: [d] }, (h = l.latest_children) != null && h.like ? l.latest_children.like.push(d) : l.latest_children = { like: [d] }), l;
|
|
4447
|
+
});
|
|
4403
4448
|
return e.setQueryData(t, () => ({
|
|
4404
4449
|
...o,
|
|
4405
|
-
latest_reactions: { reply:
|
|
4450
|
+
latest_reactions: { reply: a }
|
|
4406
4451
|
})), { previousActivity: o };
|
|
4407
4452
|
} }), Qr = ({
|
|
4408
4453
|
queryClient: e,
|
|
@@ -4410,33 +4455,39 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4410
4455
|
user: n,
|
|
4411
4456
|
mutationFn: r
|
|
4412
4457
|
}) => ({ mutationFn: r, onMutate: async ({ replyId: o }) => {
|
|
4413
|
-
var
|
|
4458
|
+
var l;
|
|
4414
4459
|
await e.cancelQueries({ queryKey: t });
|
|
4415
|
-
const
|
|
4416
|
-
if (!
|
|
4460
|
+
const a = e.getQueryData(t);
|
|
4461
|
+
if (!a)
|
|
4417
4462
|
return;
|
|
4418
|
-
const
|
|
4463
|
+
const u = (l = a.latest_reactions.reply) == null ? void 0 : l.map((f) => (f.id === o && f.children_counts.like && (f.children_counts.like -= 1), f));
|
|
4419
4464
|
return e.setQueryData(t, () => ({
|
|
4420
|
-
...
|
|
4421
|
-
latest_reactions: { reply:
|
|
4422
|
-
})), { previousActivity:
|
|
4423
|
-
}, onError: (o,
|
|
4424
|
-
e.setQueryData(t,
|
|
4425
|
-
}, onSuccess: (o, { replyId:
|
|
4465
|
+
...a,
|
|
4466
|
+
latest_reactions: { reply: u }
|
|
4467
|
+
})), { previousActivity: a };
|
|
4468
|
+
}, onError: (o, a, u) => {
|
|
4469
|
+
e.setQueryData(t, u.previousActivity);
|
|
4470
|
+
}, onSuccess: (o, { replyId: a }) => {
|
|
4426
4471
|
var f;
|
|
4427
|
-
const
|
|
4428
|
-
if (!
|
|
4472
|
+
const u = e.getQueryData(t);
|
|
4473
|
+
if (!u)
|
|
4429
4474
|
return;
|
|
4430
|
-
const
|
|
4431
|
-
var p;
|
|
4432
|
-
|
|
4433
|
-
(
|
|
4434
|
-
|
|
4475
|
+
const l = (f = u.latest_reactions.reply) == null ? void 0 : f.map((h) => {
|
|
4476
|
+
var p, _, j;
|
|
4477
|
+
if (h.id === a) {
|
|
4478
|
+
let g = (p = h.latest_children.reply) == null ? void 0 : p.filter(
|
|
4479
|
+
(E) => E.user_id !== (n == null ? void 0 : n.id)
|
|
4480
|
+
);
|
|
4481
|
+
return g = (j = (_ = h == null ? void 0 : h.own_children) == null ? void 0 : _.reply) == null ? void 0 : j.filter(
|
|
4482
|
+
(E) => E.user_id !== (n == null ? void 0 : n.id)
|
|
4483
|
+
), g;
|
|
4484
|
+
}
|
|
4485
|
+
return h;
|
|
4435
4486
|
});
|
|
4436
4487
|
return e.setQueryData(t, () => ({
|
|
4437
|
-
...
|
|
4438
|
-
latest_reactions: { reply:
|
|
4439
|
-
})), { previousActivity:
|
|
4488
|
+
...u,
|
|
4489
|
+
latest_reactions: { reply: l }
|
|
4490
|
+
})), { previousActivity: u };
|
|
4440
4491
|
} }), Ur = ({
|
|
4441
4492
|
queryClient: e,
|
|
4442
4493
|
queryKey: t,
|
|
@@ -4447,15 +4498,15 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4447
4498
|
await e.cancelQueries({ queryKey: t });
|
|
4448
4499
|
},
|
|
4449
4500
|
onSuccess: (o) => {
|
|
4450
|
-
var
|
|
4451
|
-
const
|
|
4501
|
+
var l;
|
|
4502
|
+
const a = e.getQueryData(t), u = (l = a == null ? void 0 : a.latest_reactions.reply) == null ? void 0 : l.map((f) => (f.id === o.parent && (f.latest_children.reply && f.children_counts.reply ? (f.latest_children.reply.push(o), f.children_counts.reply += 1) : (f.latest_children.reply = [o], f.children_counts.reply = 1)), f));
|
|
4452
4503
|
return e.setQueryData(t, () => ({
|
|
4453
|
-
...
|
|
4454
|
-
latest_reactions: { reply:
|
|
4455
|
-
})), { previousActivity:
|
|
4504
|
+
...a,
|
|
4505
|
+
latest_reactions: { reply: u }
|
|
4506
|
+
})), { previousActivity: a };
|
|
4456
4507
|
},
|
|
4457
|
-
onError: (o,
|
|
4458
|
-
e.setQueryData(t,
|
|
4508
|
+
onError: (o, a, u) => {
|
|
4509
|
+
e.setQueryData(t, u.previousActivity);
|
|
4459
4510
|
},
|
|
4460
4511
|
onSettled: () => {
|
|
4461
4512
|
e.invalidateQueries({ queryKey: t });
|
|
@@ -4464,26 +4515,26 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4464
4515
|
queryClient: e,
|
|
4465
4516
|
queryKey: t,
|
|
4466
4517
|
mutationFn: n
|
|
4467
|
-
}) => ({ mutationFn: n, onError: (
|
|
4518
|
+
}) => ({ mutationFn: n, onError: (c, d, o) => {
|
|
4468
4519
|
e.setQueryData(t, o.previousActivity);
|
|
4469
4520
|
}, onMutate: async ({
|
|
4470
|
-
replyInfo:
|
|
4521
|
+
replyInfo: c,
|
|
4471
4522
|
content: { body: d }
|
|
4472
4523
|
}) => {
|
|
4473
|
-
var
|
|
4524
|
+
var u, l, f;
|
|
4474
4525
|
if (d.length === 0)
|
|
4475
4526
|
return;
|
|
4476
4527
|
await e.cancelQueries({ queryKey: t });
|
|
4477
4528
|
const o = e.getQueryData(t);
|
|
4478
|
-
if (!o || !((
|
|
4529
|
+
if (!o || !((u = o == null ? void 0 : o.latest_reactions) != null && u.reply))
|
|
4479
4530
|
return;
|
|
4480
|
-
const
|
|
4531
|
+
const a = (f = (l = o == null ? void 0 : o.latest_reactions) == null ? void 0 : l.reply) == null ? void 0 : f.map((h) => {
|
|
4481
4532
|
var p;
|
|
4482
|
-
return h.id ===
|
|
4533
|
+
return h.id === c.replyParentId && ((p = h.latest_children.reply) == null || p.map((_) => (_.id === c.replySlug && (_.data.content = d), _))), h;
|
|
4483
4534
|
});
|
|
4484
4535
|
return e.setQueryData(t, () => ({
|
|
4485
4536
|
...o,
|
|
4486
|
-
latest_reactions: { reply:
|
|
4537
|
+
latest_reactions: { reply: a }
|
|
4487
4538
|
})), { previousActivity: o };
|
|
4488
4539
|
} }), mn = ({
|
|
4489
4540
|
queryClient: e,
|
|
@@ -4493,9 +4544,9 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4493
4544
|
replyId: d,
|
|
4494
4545
|
replyParentId: o
|
|
4495
4546
|
}) => {
|
|
4496
|
-
var
|
|
4547
|
+
var l;
|
|
4497
4548
|
await e.cancelQueries({ queryKey: t });
|
|
4498
|
-
const
|
|
4549
|
+
const a = e.getQueryData(t), u = (l = a == null ? void 0 : a.latest_reactions.reply) == null ? void 0 : l.map((f) => {
|
|
4499
4550
|
var h;
|
|
4500
4551
|
return f.id === o && ((h = f.latest_children.reply) == null || h.map((p) => {
|
|
4501
4552
|
var _;
|
|
@@ -4503,44 +4554,44 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4503
4554
|
})), f;
|
|
4504
4555
|
});
|
|
4505
4556
|
return e.setQueryData(t, () => ({
|
|
4506
|
-
...
|
|
4507
|
-
latest_reactions: { reply:
|
|
4508
|
-
})), { previousActivity:
|
|
4509
|
-
}, onError: (d, o,
|
|
4510
|
-
e.setQueryData(t,
|
|
4557
|
+
...a,
|
|
4558
|
+
latest_reactions: { reply: u }
|
|
4559
|
+
})), { previousActivity: a };
|
|
4560
|
+
}, onError: (d, o, a) => {
|
|
4561
|
+
e.setQueryData(t, a.previousActivity);
|
|
4511
4562
|
}, onSuccess: (d, o) => {
|
|
4512
|
-
var
|
|
4513
|
-
const
|
|
4563
|
+
var l;
|
|
4564
|
+
const a = e.getQueryData(t), u = (l = a == null ? void 0 : a.latest_reactions.reply) == null ? void 0 : l.map((f) => {
|
|
4514
4565
|
var h;
|
|
4515
4566
|
return f.id === o.replyParentId && ((h = f.latest_children.reply) == null || h.map((p) => (p.id === o.replyId && (p.latest_children = p.latest_children || {}, p.own_children = p.own_children || {}, p.latest_children.like = p.latest_children.like || [], p.own_children.like = p.own_children.like || [], p.latest_children.like.push(d), p.own_children.like.push(d)), p))), f;
|
|
4516
4567
|
});
|
|
4517
4568
|
return e.setQueryData(t, () => ({
|
|
4518
|
-
...
|
|
4519
|
-
latest_reactions: { reply:
|
|
4520
|
-
})), { previousActivity:
|
|
4569
|
+
...a,
|
|
4570
|
+
latest_reactions: { reply: u }
|
|
4571
|
+
})), { previousActivity: a };
|
|
4521
4572
|
} }), Wr = ({
|
|
4522
4573
|
basePath: e,
|
|
4523
4574
|
parentId: t,
|
|
4524
4575
|
replyParentId: n,
|
|
4525
4576
|
activityId: r,
|
|
4526
|
-
replyCount:
|
|
4527
|
-
replies:
|
|
4528
|
-
functions: { create: d, edit: o, join:
|
|
4577
|
+
replyCount: i,
|
|
4578
|
+
replies: c,
|
|
4579
|
+
functions: { create: d, edit: o, join: a, leave: u, like: l, unlike: f }
|
|
4529
4580
|
}) => {
|
|
4530
|
-
const h =
|
|
4581
|
+
const h = A(), p = st(), _ = ge(lt), j = Ur({
|
|
4531
4582
|
queryClient: p,
|
|
4532
4583
|
queryKey: [e, t, r],
|
|
4533
4584
|
mutationFn: async (b) => d({ replyId: n, content: b.body })
|
|
4534
|
-
}), { mutate: g } = de(j),
|
|
4585
|
+
}), { mutate: g } = de(j), E = zr({
|
|
4535
4586
|
queryClient: p,
|
|
4536
4587
|
queryKey: [e, t, r],
|
|
4537
4588
|
mutationFn: o
|
|
4538
4589
|
}), {
|
|
4539
4590
|
mutate: k
|
|
4540
|
-
} = de(
|
|
4591
|
+
} = de(E), T = mn({
|
|
4541
4592
|
queryClient: p,
|
|
4542
4593
|
queryKey: [e, t, r],
|
|
4543
|
-
mutationFn:
|
|
4594
|
+
mutationFn: l
|
|
4544
4595
|
}), {
|
|
4545
4596
|
mutate: M
|
|
4546
4597
|
} = de(T), C = mn({
|
|
@@ -4557,12 +4608,26 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4557
4608
|
[I]
|
|
4558
4609
|
);
|
|
4559
4610
|
return /* @__PURE__ */ s.jsx(
|
|
4560
|
-
|
|
4611
|
+
Ar,
|
|
4561
4612
|
{
|
|
4562
|
-
count:
|
|
4563
|
-
showRepliesButton:
|
|
4613
|
+
count: i,
|
|
4614
|
+
showRepliesButton: i > 0 || _.showForm,
|
|
4564
4615
|
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
4565
|
-
|
|
4616
|
+
_.showForm && /* @__PURE__ */ s.jsx(
|
|
4617
|
+
It,
|
|
4618
|
+
{
|
|
4619
|
+
contentType: "reply",
|
|
4620
|
+
createPost: (b, Q) => g(Q),
|
|
4621
|
+
membershipRequiredToPost: {
|
|
4622
|
+
isMember: !0,
|
|
4623
|
+
required: !0,
|
|
4624
|
+
join: a,
|
|
4625
|
+
leave: u,
|
|
4626
|
+
notMemberStateText: h.formatMessage({ id: "community_joinToPost" })
|
|
4627
|
+
}
|
|
4628
|
+
}
|
|
4629
|
+
),
|
|
4630
|
+
(c == null ? void 0 : c.length) === 0 || (c == null ? void 0 : c.map((b) => {
|
|
4566
4631
|
var Q, w, Y, L, O, U, W, Z, re, oe, ae, ie, se, P, te;
|
|
4567
4632
|
return /* @__PURE__ */ s.jsx(
|
|
4568
4633
|
ct,
|
|
@@ -4614,21 +4679,7 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4614
4679
|
},
|
|
4615
4680
|
b == null ? void 0 : b.id
|
|
4616
4681
|
);
|
|
4617
|
-
}))
|
|
4618
|
-
_.showForm && /* @__PURE__ */ s.jsx(
|
|
4619
|
-
It,
|
|
4620
|
-
{
|
|
4621
|
-
contentType: "reply",
|
|
4622
|
-
createPost: (b, Q) => g(Q),
|
|
4623
|
-
membershipRequiredToPost: {
|
|
4624
|
-
isMember: !0,
|
|
4625
|
-
required: !0,
|
|
4626
|
-
join: i,
|
|
4627
|
-
leave: c,
|
|
4628
|
-
notMemberStateText: h.formatMessage({ id: "community_joinToPost" })
|
|
4629
|
-
}
|
|
4630
|
-
}
|
|
4631
|
-
)
|
|
4682
|
+
}))
|
|
4632
4683
|
] })
|
|
4633
4684
|
}
|
|
4634
4685
|
);
|
|
@@ -4637,19 +4688,19 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4637
4688
|
parentId: t,
|
|
4638
4689
|
activityId: n,
|
|
4639
4690
|
repliesList: r,
|
|
4640
|
-
isMember:
|
|
4641
|
-
functions: { createReply:
|
|
4691
|
+
isMember: i,
|
|
4692
|
+
functions: { createReply: c, editReply: d, like: o, unlike: a, join: u, leave: l }
|
|
4642
4693
|
}) => {
|
|
4643
|
-
const f =
|
|
4694
|
+
const f = A(), h = st(), p = ge(Se), _ = Br({
|
|
4644
4695
|
queryClient: h,
|
|
4645
4696
|
queryKey: [e, t, n],
|
|
4646
|
-
mutationFn: async (x) =>
|
|
4697
|
+
mutationFn: async (x) => c({ activityId: n, content: x.body })
|
|
4647
4698
|
}), { mutate: j } = de(_), g = Ir({
|
|
4648
4699
|
queryClient: h,
|
|
4649
4700
|
queryKey: [e, t, n],
|
|
4650
4701
|
mutationFn: async (x) => d(x)
|
|
4651
4702
|
}), {
|
|
4652
|
-
mutate:
|
|
4703
|
+
mutate: E
|
|
4653
4704
|
} = de(g), k = Hr({
|
|
4654
4705
|
queryClient: h,
|
|
4655
4706
|
queryKey: [e, t, n],
|
|
@@ -4660,7 +4711,7 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4660
4711
|
queryClient: h,
|
|
4661
4712
|
queryKey: [e, t, n],
|
|
4662
4713
|
user: p,
|
|
4663
|
-
mutationFn:
|
|
4714
|
+
mutationFn: a
|
|
4664
4715
|
}), {
|
|
4665
4716
|
mutate: C
|
|
4666
4717
|
} = de(M), I = ke(
|
|
@@ -4675,21 +4726,19 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4675
4726
|
It,
|
|
4676
4727
|
{
|
|
4677
4728
|
contentType: "reply",
|
|
4678
|
-
createPost: (x, b) =>
|
|
4679
|
-
j(b);
|
|
4680
|
-
},
|
|
4729
|
+
createPost: (x, b) => j(b),
|
|
4681
4730
|
membershipRequiredToPost: {
|
|
4682
|
-
isMember:
|
|
4731
|
+
isMember: i,
|
|
4683
4732
|
required: !0,
|
|
4684
|
-
join:
|
|
4685
|
-
leave:
|
|
4733
|
+
join: u,
|
|
4734
|
+
leave: l,
|
|
4686
4735
|
notMemberStateText: f.formatMessage({ id: "community_joinToPost" })
|
|
4687
4736
|
}
|
|
4688
4737
|
}
|
|
4689
4738
|
),
|
|
4690
4739
|
(r == null ? void 0 : r.length) === 0 || (r == null ? void 0 : r.map((x) => {
|
|
4691
4740
|
var w, Y, L, O, U, W, Z, re, oe, ae, ie, se, P, te, G, K, ue, fe;
|
|
4692
|
-
const b = ((w = x == null ? void 0 : x.user) == null ? void 0 : w.id) === (p == null ? void 0 : p.id), Q = Ht(
|
|
4741
|
+
const b = ((w = x == null ? void 0 : x.user) == null ? void 0 : w.id) === (p == null ? void 0 : p.id), Q = Ht(i, b);
|
|
4693
4742
|
return /* @__PURE__ */ s.jsx(Sr, { children: /* @__PURE__ */ s.jsx(
|
|
4694
4743
|
ct,
|
|
4695
4744
|
{
|
|
@@ -4720,13 +4769,13 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4720
4769
|
content: {
|
|
4721
4770
|
createContent: () => console.log("create"),
|
|
4722
4771
|
deleteContent: () => console.log("delete"),
|
|
4723
|
-
updateContent: (_e, xe) =>
|
|
4772
|
+
updateContent: (_e, xe) => E({ replyInfo: _e, content: xe })
|
|
4724
4773
|
},
|
|
4725
4774
|
likes: {
|
|
4726
4775
|
createLike: () => I({ replyId: x == null ? void 0 : x.id }),
|
|
4727
4776
|
deleteLike: () => {
|
|
4728
|
-
var xe, Ie,
|
|
4729
|
-
const _e = ((xe = x == null ? void 0 : x.own_children) == null ? void 0 : xe.like) && ((
|
|
4777
|
+
var xe, Ie, Ae;
|
|
4778
|
+
const _e = ((xe = x == null ? void 0 : x.own_children) == null ? void 0 : xe.like) && ((Ae = (Ie = x == null ? void 0 : x.own_children) == null ? void 0 : Ie.like[0]) == null ? void 0 : Ae.id);
|
|
4730
4779
|
return V({ replyId: _e || "" });
|
|
4731
4780
|
}
|
|
4732
4781
|
},
|
|
@@ -4741,14 +4790,14 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4741
4790
|
activityId: n,
|
|
4742
4791
|
replyCount: ((ue = x == null ? void 0 : x.children_counts) == null ? void 0 : ue.reply) || 0,
|
|
4743
4792
|
replies: (fe = x == null ? void 0 : x.latest_children) == null ? void 0 : fe.reply,
|
|
4744
|
-
isMember:
|
|
4793
|
+
isMember: i,
|
|
4745
4794
|
functions: {
|
|
4746
|
-
create:
|
|
4795
|
+
create: c,
|
|
4747
4796
|
edit: d,
|
|
4748
4797
|
like: o,
|
|
4749
|
-
unlike:
|
|
4750
|
-
join:
|
|
4751
|
-
leave:
|
|
4798
|
+
unlike: a,
|
|
4799
|
+
join: u,
|
|
4800
|
+
leave: l
|
|
4752
4801
|
}
|
|
4753
4802
|
}
|
|
4754
4803
|
)
|
|
@@ -4770,13 +4819,13 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4770
4819
|
if (o.length === 0)
|
|
4771
4820
|
return;
|
|
4772
4821
|
await e.cancelQueries({ queryKey: t });
|
|
4773
|
-
const
|
|
4774
|
-
return
|
|
4775
|
-
...
|
|
4776
|
-
})), { previousActivity:
|
|
4822
|
+
const a = e.getQueryData(t);
|
|
4823
|
+
return a && a.id === (d == null ? void 0 : d.activityId) && (a.content = o), e.setQueryData(t, () => ({
|
|
4824
|
+
...a
|
|
4825
|
+
})), { previousActivity: a };
|
|
4777
4826
|
},
|
|
4778
|
-
onError: (d, o,
|
|
4779
|
-
e.setQueryData(t,
|
|
4827
|
+
onError: (d, o, a) => {
|
|
4828
|
+
e.setQueryData(t, a.previousActivity);
|
|
4780
4829
|
},
|
|
4781
4830
|
onSettled: () => {
|
|
4782
4831
|
e.invalidateQueries({ queryKey: t });
|
|
@@ -4786,19 +4835,19 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4786
4835
|
queryKey: t,
|
|
4787
4836
|
mutationFn: n
|
|
4788
4837
|
}) => ({ mutationFn: n, onMutate: async () => {
|
|
4789
|
-
var
|
|
4838
|
+
var a;
|
|
4790
4839
|
await e.cancelQueries({ queryKey: t });
|
|
4791
4840
|
const o = e.getQueryData(t);
|
|
4792
|
-
return (
|
|
4841
|
+
return (a = o == null ? void 0 : o.reaction_counts) != null && a.like ? o.reaction_counts.like += 1 : o && (o.reaction_counts = { like: 1 }), e.setQueryData(t, () => ({
|
|
4793
4842
|
...o
|
|
4794
4843
|
})), { previousActivity: o };
|
|
4795
|
-
}, onError: (o,
|
|
4796
|
-
e.setQueryData(t,
|
|
4844
|
+
}, onError: (o, a, u) => {
|
|
4845
|
+
e.setQueryData(t, u.previousActivity);
|
|
4797
4846
|
}, onSuccess: (o) => {
|
|
4798
|
-
const
|
|
4799
|
-
return
|
|
4800
|
-
...
|
|
4801
|
-
})), { previousActivity:
|
|
4847
|
+
const a = e.getQueryData(t);
|
|
4848
|
+
return a != null && a.own_reactions.like ? a.own_reactions.like.push(o) : a && (a.own_reactions = { like: [o] }), a != null && a.latest_reactions.like ? a.latest_reactions.like.push(o) : a && (a.latest_reactions = { like: [o] }), e.setQueryData(t, () => ({
|
|
4849
|
+
...a
|
|
4850
|
+
})), { previousActivity: a };
|
|
4802
4851
|
}, onSettled: () => {
|
|
4803
4852
|
e.invalidateQueries({ queryKey: t });
|
|
4804
4853
|
} }), Jr = ({
|
|
@@ -4806,44 +4855,47 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4806
4855
|
queryKey: t,
|
|
4807
4856
|
user: n,
|
|
4808
4857
|
activity: r,
|
|
4809
|
-
mutationFn:
|
|
4810
|
-
}) => ({ mutationFn:
|
|
4811
|
-
var
|
|
4858
|
+
mutationFn: i
|
|
4859
|
+
}) => ({ mutationFn: i, onMutate: async () => {
|
|
4860
|
+
var l;
|
|
4812
4861
|
await e.cancelQueries({ queryKey: t });
|
|
4813
|
-
const
|
|
4814
|
-
return (
|
|
4815
|
-
...
|
|
4816
|
-
})), { previousActivity:
|
|
4817
|
-
}, onError: (
|
|
4862
|
+
const u = e.getQueryData(t);
|
|
4863
|
+
return (l = u == null ? void 0 : u.reaction_counts) != null && l.like && u.reaction_counts.like > 0 && (u.reaction_counts.like -= 1), e.setQueryData(t, () => ({
|
|
4864
|
+
...u
|
|
4865
|
+
})), { previousActivity: u };
|
|
4866
|
+
}, onError: (u, l, f) => {
|
|
4818
4867
|
e.setQueryData(t, f.previousActivity);
|
|
4819
4868
|
}, onSuccess: () => {
|
|
4820
4869
|
var f, h, p;
|
|
4821
4870
|
if (!r)
|
|
4822
4871
|
return;
|
|
4823
|
-
const
|
|
4872
|
+
const u = (p = (h = (f = r.own_reactions) == null ? void 0 : f.like) == null ? void 0 : h.find(
|
|
4824
4873
|
(_) => _.user_id === (n == null ? void 0 : n.id)
|
|
4825
|
-
)) == null ? void 0 : p.id,
|
|
4826
|
-
if (
|
|
4827
|
-
|
|
4828
|
-
|
|
4874
|
+
)) == null ? void 0 : p.id, l = e.getQueryData(t);
|
|
4875
|
+
if (l != null && l.own_reactions.like && (l.own_reactions.like = l.own_reactions.like.filter(
|
|
4876
|
+
(_) => _.id !== u
|
|
4877
|
+
), !!(l != null && l.latest_reactions.like)))
|
|
4878
|
+
return l.latest_reactions.like = l.latest_reactions.like.filter(
|
|
4879
|
+
(_) => _.id !== u
|
|
4829
4880
|
), e.setQueryData(t, () => ({
|
|
4830
|
-
...
|
|
4831
|
-
})), { previousActivity:
|
|
4881
|
+
...l
|
|
4882
|
+
})), { previousActivity: l };
|
|
4832
4883
|
}, onSettled: () => {
|
|
4833
4884
|
e.invalidateQueries({ queryKey: t });
|
|
4834
|
-
} })
|
|
4885
|
+
} });
|
|
4886
|
+
const Ro = ({
|
|
4835
4887
|
basePath: e,
|
|
4836
4888
|
parentId: t,
|
|
4837
4889
|
activityId: n,
|
|
4838
4890
|
isMember: r,
|
|
4839
4891
|
functions: {
|
|
4840
|
-
get:
|
|
4841
|
-
editActivity:
|
|
4892
|
+
get: i,
|
|
4893
|
+
editActivity: c,
|
|
4842
4894
|
likeActivity: d,
|
|
4843
4895
|
unlikeActivity: o,
|
|
4844
|
-
createReply:
|
|
4845
|
-
editReply:
|
|
4846
|
-
likeReply:
|
|
4896
|
+
createReply: a,
|
|
4897
|
+
editReply: u,
|
|
4898
|
+
likeReply: l,
|
|
4847
4899
|
unlikeReply: f,
|
|
4848
4900
|
join: h,
|
|
4849
4901
|
leave: p
|
|
@@ -4852,16 +4904,16 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4852
4904
|
var O, U, W, Z, re, oe, ae, ie, se, P, te;
|
|
4853
4905
|
const _ = ge(Se), j = st(), {
|
|
4854
4906
|
data: g,
|
|
4855
|
-
error:
|
|
4907
|
+
error: E,
|
|
4856
4908
|
isLoading: k,
|
|
4857
4909
|
isFetching: T
|
|
4858
4910
|
} = fn({
|
|
4859
4911
|
queryKey: [e, t, n],
|
|
4860
|
-
queryFn:
|
|
4912
|
+
queryFn: i
|
|
4861
4913
|
}), M = Yr({
|
|
4862
4914
|
queryClient: j,
|
|
4863
4915
|
queryKey: [e, t, n],
|
|
4864
|
-
mutationFn: async (G) => await
|
|
4916
|
+
mutationFn: async (G) => await c(G)
|
|
4865
4917
|
}), {
|
|
4866
4918
|
mutate: C
|
|
4867
4919
|
} = de(M), I = Gr({
|
|
@@ -4891,14 +4943,15 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4891
4943
|
async ({ activityId: G }) => b({ activityId: G }),
|
|
4892
4944
|
[b]
|
|
4893
4945
|
);
|
|
4894
|
-
if (
|
|
4895
|
-
return /* @__PURE__ */ s.jsx(it, { variant: "error", text:
|
|
4946
|
+
if (E)
|
|
4947
|
+
return /* @__PURE__ */ s.jsx(it, { variant: "error", text: E.message });
|
|
4896
4948
|
if (k || T)
|
|
4897
4949
|
return /* @__PURE__ */ s.jsx(je, { style: { height: "400px" } });
|
|
4898
4950
|
const Y = ((O = g == null ? void 0 : g.actor) == null ? void 0 : O.id) === (_ == null ? void 0 : _.id), L = Ht(r, Y);
|
|
4899
4951
|
return /* @__PURE__ */ s.jsx(
|
|
4900
4952
|
ct,
|
|
4901
4953
|
{
|
|
4954
|
+
className: "activity-section",
|
|
4902
4955
|
content: {
|
|
4903
4956
|
type: "post",
|
|
4904
4957
|
body: g == null ? void 0 : g.content,
|
|
@@ -4954,10 +5007,10 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4954
5007
|
repliesList: (te = g == null ? void 0 : g.latest_reactions) == null ? void 0 : te.reply,
|
|
4955
5008
|
isMember: r,
|
|
4956
5009
|
functions: {
|
|
4957
|
-
createReply:
|
|
4958
|
-
like:
|
|
5010
|
+
createReply: a,
|
|
5011
|
+
like: l,
|
|
4959
5012
|
unlike: f,
|
|
4960
|
-
editReply:
|
|
5013
|
+
editReply: u,
|
|
4961
5014
|
join: h,
|
|
4962
5015
|
leave: p
|
|
4963
5016
|
}
|
|
@@ -4967,15 +5020,15 @@ const Nr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4967
5020
|
},
|
|
4968
5021
|
n
|
|
4969
5022
|
);
|
|
4970
|
-
}, Fo = ({ id: e, data: { jobTitle: t, name: n, organization: r, thumbnail:
|
|
5023
|
+
}, Fo = ({ id: e, data: { jobTitle: t, name: n, organization: r, thumbnail: i } }) => ({
|
|
4971
5024
|
id: e,
|
|
4972
5025
|
name: n,
|
|
4973
5026
|
jobTitle: t,
|
|
4974
5027
|
organization: r,
|
|
4975
|
-
image: { thumbnail:
|
|
5028
|
+
image: { thumbnail: i }
|
|
4976
5029
|
});
|
|
4977
5030
|
export {
|
|
4978
|
-
|
|
5031
|
+
Nt as ASSETS_BUCKET,
|
|
4979
5032
|
Po as ActivitiesFeed,
|
|
4980
5033
|
Ro as ActivitySection,
|
|
4981
5034
|
It as AddPost,
|
|
@@ -4994,7 +5047,7 @@ export {
|
|
|
4994
5047
|
Pn as DiscussionForm,
|
|
4995
5048
|
Mr as DiscussionLikes,
|
|
4996
5049
|
ct as DiscussionPost,
|
|
4997
|
-
|
|
5050
|
+
Ar as DiscussionThread,
|
|
4998
5051
|
De as Divider,
|
|
4999
5052
|
fo as DownloadSection,
|
|
5000
5053
|
Oe as EMAILS,
|
|
@@ -5005,14 +5058,14 @@ export {
|
|
|
5005
5058
|
Mn as Footer,
|
|
5006
5059
|
wn as FullWidthSection,
|
|
5007
5060
|
vo as GlobalProviders,
|
|
5008
|
-
|
|
5061
|
+
An as Header,
|
|
5009
5062
|
zs as HelperTextBox,
|
|
5010
5063
|
gn as HiddenFromScreenReaders,
|
|
5011
5064
|
xo as HideShowTextBox,
|
|
5012
5065
|
Ee as HighlightedTextBox,
|
|
5013
5066
|
ur as IntlProvider,
|
|
5014
5067
|
wr as InviteForm,
|
|
5015
|
-
|
|
5068
|
+
No as InviteModal,
|
|
5016
5069
|
Tn as JoinButton,
|
|
5017
5070
|
yo as LanguageSwitcher,
|
|
5018
5071
|
at as Link,
|
|
@@ -5037,7 +5090,7 @@ export {
|
|
|
5037
5090
|
tr as ProgressBar,
|
|
5038
5091
|
$o as Rating,
|
|
5039
5092
|
Vr as RepliesFeed,
|
|
5040
|
-
|
|
5093
|
+
Ao as ResponsesHeading,
|
|
5041
5094
|
Is as ResponsiveImage,
|
|
5042
5095
|
vr as SearchForm,
|
|
5043
5096
|
Ks as Span,
|