@apolitical/component-library 1.15.1-beta.0 → 1.15.3
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/communities/members-list/members-list.d.ts +7 -6
- package/index.js +12 -12
- package/index.mjs +450 -453
- package/navigation/load-more/load-more.d.ts +4 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -27,23 +27,23 @@ var Nn = { exports: {} };
|
|
|
27
27
|
var t = {}.hasOwnProperty;
|
|
28
28
|
function n() {
|
|
29
29
|
for (var r = [], i = 0; i < arguments.length; i++) {
|
|
30
|
-
var
|
|
31
|
-
if (
|
|
32
|
-
var u = typeof
|
|
30
|
+
var d = arguments[i];
|
|
31
|
+
if (d) {
|
|
32
|
+
var u = typeof d;
|
|
33
33
|
if (u === "string" || u === "number")
|
|
34
|
-
r.push(
|
|
35
|
-
else if (Array.isArray(
|
|
36
|
-
if (
|
|
37
|
-
var a = n.apply(null,
|
|
34
|
+
r.push(d);
|
|
35
|
+
else if (Array.isArray(d)) {
|
|
36
|
+
if (d.length) {
|
|
37
|
+
var a = n.apply(null, d);
|
|
38
38
|
a && r.push(a);
|
|
39
39
|
}
|
|
40
40
|
} else if (u === "object") {
|
|
41
|
-
if (
|
|
42
|
-
r.push(
|
|
41
|
+
if (d.toString !== Object.prototype.toString && !d.toString.toString().includes("[native code]")) {
|
|
42
|
+
r.push(d.toString());
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
|
-
for (var
|
|
46
|
-
t.call(
|
|
45
|
+
for (var l in d)
|
|
46
|
+
t.call(d, l) && d[l] && r.push(l);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -69,15 +69,15 @@ function Rs() {
|
|
|
69
69
|
if (pn)
|
|
70
70
|
return Ye;
|
|
71
71
|
pn = 1;
|
|
72
|
-
var e = C, 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,
|
|
73
|
-
function u(a,
|
|
72
|
+
var e = C, 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, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
73
|
+
function u(a, l, o) {
|
|
74
74
|
var m, c = {}, h = null, p = null;
|
|
75
|
-
o !== void 0 && (h = "" + o),
|
|
76
|
-
for (m in
|
|
77
|
-
r.call(
|
|
75
|
+
o !== void 0 && (h = "" + o), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (p = l.ref);
|
|
76
|
+
for (m in l)
|
|
77
|
+
r.call(l, m) && !d.hasOwnProperty(m) && (c[m] = l[m]);
|
|
78
78
|
if (a && a.defaultProps)
|
|
79
|
-
for (m in
|
|
80
|
-
c[m] === void 0 && (c[m] =
|
|
79
|
+
for (m in l = a.defaultProps, l)
|
|
80
|
+
c[m] === void 0 && (c[m] = l[m]);
|
|
81
81
|
return { $$typeof: t, type: a, key: h, ref: p, props: c, _owner: i.current };
|
|
82
82
|
}
|
|
83
83
|
return Ye.Fragment = n, Ye.jsx = u, Ye.jsxs = u, Ye;
|
|
@@ -95,7 +95,7 @@ var Ge = {};
|
|
|
95
95
|
var gn;
|
|
96
96
|
function Fs() {
|
|
97
97
|
return gn || (gn = 1, process.env.NODE_ENV !== "production" && function() {
|
|
98
|
-
var e = C, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"),
|
|
98
|
+
var e = C, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), o = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), g = Symbol.iterator, b = "@@iterator";
|
|
99
99
|
function v(f) {
|
|
100
100
|
if (f === null || typeof f != "object")
|
|
101
101
|
return null;
|
|
@@ -123,7 +123,7 @@ function Fs() {
|
|
|
123
123
|
var T = !1, N = !1, R = !1, J = !1, O = !1, H;
|
|
124
124
|
H = Symbol.for("react.module.reference");
|
|
125
125
|
function F(f) {
|
|
126
|
-
return !!(typeof f == "string" || typeof f == "function" || f === r || f ===
|
|
126
|
+
return !!(typeof f == "string" || typeof f == "function" || f === r || f === d || O || f === i || f === o || f === m || J || f === p || T || N || R || typeof f == "object" && f !== null && (f.$$typeof === h || f.$$typeof === c || f.$$typeof === u || f.$$typeof === a || f.$$typeof === l || // 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,7 +151,7 @@ function Fs() {
|
|
|
151
151
|
return "Fragment";
|
|
152
152
|
case n:
|
|
153
153
|
return "Portal";
|
|
154
|
-
case
|
|
154
|
+
case d:
|
|
155
155
|
return "Profiler";
|
|
156
156
|
case i:
|
|
157
157
|
return "StrictMode";
|
|
@@ -168,7 +168,7 @@ function Fs() {
|
|
|
168
168
|
case u:
|
|
169
169
|
var $ = f;
|
|
170
170
|
return Y($._context) + ".Provider";
|
|
171
|
-
case
|
|
171
|
+
case l:
|
|
172
172
|
return x(f, f.render, "ForwardRef");
|
|
173
173
|
case c:
|
|
174
174
|
var M = f.displayName || null;
|
|
@@ -358,7 +358,7 @@ function Fs() {
|
|
|
358
358
|
}
|
|
359
359
|
if (typeof f == "object")
|
|
360
360
|
switch (f.$$typeof) {
|
|
361
|
-
case
|
|
361
|
+
case l:
|
|
362
362
|
return le(f.render);
|
|
363
363
|
case c:
|
|
364
364
|
return me(f.type, y, $);
|
|
@@ -610,7 +610,7 @@ Check the top-level render call using <` + $ + ">.");
|
|
|
610
610
|
var $;
|
|
611
611
|
if (typeof y == "function")
|
|
612
612
|
$ = y.propTypes;
|
|
613
|
-
else if (typeof y == "object" && (y.$$typeof ===
|
|
613
|
+
else if (typeof y == "object" && (y.$$typeof === l || // Note: Memo only checks outer props here.
|
|
614
614
|
// Inner props are checked in the reconciler.
|
|
615
615
|
y.$$typeof === c))
|
|
616
616
|
$ = y.propTypes;
|
|
@@ -696,7 +696,7 @@ const Ls = () => {
|
|
|
696
696
|
}, t);
|
|
697
697
|
};
|
|
698
698
|
function Is(e, t, n) {
|
|
699
|
-
var r = this, i = de(null),
|
|
699
|
+
var r = this, i = de(null), d = de(0), u = de(null), a = de([]), l = de(), o = de(), m = de(e), c = de(!0);
|
|
700
700
|
m.current = e;
|
|
701
701
|
var h = typeof window < "u", p = !t && t !== 0 && h;
|
|
702
702
|
if (typeof e != "function")
|
|
@@ -710,31 +710,31 @@ function Is(e, t, n) {
|
|
|
710
710
|
}, []);
|
|
711
711
|
var _ = xt(function() {
|
|
712
712
|
var T = function(F) {
|
|
713
|
-
var x = a.current, Y =
|
|
714
|
-
return a.current =
|
|
713
|
+
var x = a.current, Y = l.current;
|
|
714
|
+
return a.current = l.current = null, d.current = F, o.current = m.current.apply(Y, x);
|
|
715
715
|
}, N = function(F, x) {
|
|
716
716
|
p && cancelAnimationFrame(u.current), u.current = p ? requestAnimationFrame(F) : setTimeout(F, x);
|
|
717
717
|
}, R = function(F) {
|
|
718
718
|
if (!c.current)
|
|
719
719
|
return !1;
|
|
720
720
|
var x = F - i.current;
|
|
721
|
-
return !i.current || x >= t || x < 0 || v && F -
|
|
721
|
+
return !i.current || x >= t || x < 0 || v && F - d.current >= j;
|
|
722
722
|
}, J = function(F) {
|
|
723
|
-
return u.current = null, b && a.current ? T(F) : (a.current =
|
|
723
|
+
return u.current = null, b && a.current ? T(F) : (a.current = l.current = null, o.current);
|
|
724
724
|
}, O = function F() {
|
|
725
725
|
var x = Date.now();
|
|
726
726
|
if (R(x))
|
|
727
727
|
return J(x);
|
|
728
728
|
if (c.current) {
|
|
729
|
-
var Y = t - (x - i.current), k = v ? Math.min(Y, j - (x -
|
|
729
|
+
var Y = t - (x - i.current), k = v ? Math.min(Y, j - (x - d.current)) : Y;
|
|
730
730
|
N(F, k);
|
|
731
731
|
}
|
|
732
732
|
}, H = function() {
|
|
733
733
|
if (h || E) {
|
|
734
734
|
var F = Date.now(), x = R(F);
|
|
735
|
-
if (a.current = [].slice.call(arguments),
|
|
735
|
+
if (a.current = [].slice.call(arguments), l.current = r, i.current = F, x) {
|
|
736
736
|
if (!u.current && c.current)
|
|
737
|
-
return
|
|
737
|
+
return d.current = i.current, N(O, t), g ? T(i.current) : o.current;
|
|
738
738
|
if (v)
|
|
739
739
|
return N(O, t), T(i.current);
|
|
740
740
|
}
|
|
@@ -742,7 +742,7 @@ function Is(e, t, n) {
|
|
|
742
742
|
}
|
|
743
743
|
};
|
|
744
744
|
return H.cancel = function() {
|
|
745
|
-
u.current && (p ? cancelAnimationFrame(u.current) : clearTimeout(u.current)),
|
|
745
|
+
u.current && (p ? cancelAnimationFrame(u.current) : clearTimeout(u.current)), d.current = 0, a.current = i.current = l.current = u.current = null;
|
|
746
746
|
}, H.isPending = function() {
|
|
747
747
|
return !!u.current;
|
|
748
748
|
}, H.flush = function() {
|
|
@@ -752,8 +752,8 @@ function Is(e, t, n) {
|
|
|
752
752
|
return _;
|
|
753
753
|
}
|
|
754
754
|
function Cn(e, t, n) {
|
|
755
|
-
var r = n === void 0 ? {} : n, i = r.leading,
|
|
756
|
-
return Is(e, t, { maxWait: t, leading: i === void 0 || i, trailing:
|
|
755
|
+
var r = n === void 0 ? {} : n, i = r.leading, d = r.trailing;
|
|
756
|
+
return Is(e, t, { maxWait: t, leading: i === void 0 || i, trailing: d === void 0 || d });
|
|
757
757
|
}
|
|
758
758
|
let Dt;
|
|
759
759
|
const vt = (e = !0, t = !1, n = "window") => {
|
|
@@ -761,15 +761,15 @@ const vt = (e = !0, t = !1, n = "window") => {
|
|
|
761
761
|
return;
|
|
762
762
|
const [r, i] = C.useState(0) || [!1, () => {
|
|
763
763
|
}];
|
|
764
|
-
G(() => (a(), window.addEventListener("resize",
|
|
765
|
-
clearTimeout(Dt),
|
|
764
|
+
G(() => (a(), window.addEventListener("resize", l), () => {
|
|
765
|
+
clearTimeout(Dt), l.flush(), window.removeEventListener("resize", l);
|
|
766
766
|
}), n === "window" ? [] : [n]);
|
|
767
767
|
const u = () => {
|
|
768
768
|
if (n)
|
|
769
769
|
return n === "window" ? window.innerWidth : n.offsetWidth;
|
|
770
770
|
}, a = () => {
|
|
771
771
|
i(u());
|
|
772
|
-
},
|
|
772
|
+
}, l = Cn(
|
|
773
773
|
() => {
|
|
774
774
|
u() !== r && (t && (clearTimeout(Dt), document.body.classList.add("is-resizing"), Dt = setTimeout(() => {
|
|
775
775
|
document.body.classList.remove("is-resizing");
|
|
@@ -790,21 +790,21 @@ const vt = (e = !0, t = !1, n = "window") => {
|
|
|
790
790
|
}) => {
|
|
791
791
|
if (!window)
|
|
792
792
|
return;
|
|
793
|
-
const [i,
|
|
793
|
+
const [i, d] = C.useState({ current: 0, past: 0 }) || [!1, () => {
|
|
794
794
|
}], [u, a] = C.useState({ scrollDown: !1, scrollUp: !1 }) || [!1, () => {
|
|
795
795
|
}];
|
|
796
|
-
G(() => (
|
|
796
|
+
G(() => (l(), window.addEventListener("scroll", o), () => {
|
|
797
797
|
o.flush(), window.removeEventListener("scroll", o);
|
|
798
798
|
}), []);
|
|
799
|
-
const
|
|
799
|
+
const l = () => {
|
|
800
800
|
const m = window.scrollY, c = i.current, h = m - c, p = h > 0 ? "down" : "up";
|
|
801
|
-
if (
|
|
801
|
+
if (d({ current: m, past: c }), p === "down") {
|
|
802
802
|
m >= e + t.down && !u.scrollDown && (!u.scrollUp || h > t.up) && (n(), a({ scrollUp: !1, scrollDown: !0 }));
|
|
803
803
|
return;
|
|
804
804
|
}
|
|
805
805
|
Math.abs(h) >= t.up && !u.scrollUp && (r(), a({ scrollUp: !0, scrollDown: !1 }));
|
|
806
806
|
}, o = Cn(() => {
|
|
807
|
-
|
|
807
|
+
l();
|
|
808
808
|
}, 250);
|
|
809
809
|
return i;
|
|
810
810
|
}, Bs = (e = [], t = !0) => {
|
|
@@ -827,10 +827,10 @@ const vt = (e = !0, t = !1, n = "window") => {
|
|
|
827
827
|
}, Pn = (e, t, n) => {
|
|
828
828
|
let r = n.mobile;
|
|
829
829
|
for (const i in t) {
|
|
830
|
-
const
|
|
831
|
-
if (e >=
|
|
832
|
-
r = n[
|
|
833
|
-
else if (e <
|
|
830
|
+
const d = parseInt(String(t[i]));
|
|
831
|
+
if (e >= d)
|
|
832
|
+
r = n[d];
|
|
833
|
+
else if (e < d)
|
|
834
834
|
break;
|
|
835
835
|
}
|
|
836
836
|
return r;
|
|
@@ -840,16 +840,16 @@ const vt = (e = !0, t = !1, n = "window") => {
|
|
|
840
840
|
month: "short",
|
|
841
841
|
year: "numeric"
|
|
842
842
|
}), Gt = (e) => {
|
|
843
|
-
let
|
|
843
|
+
let d;
|
|
844
844
|
const u = _n(), a = _n(new Date(e));
|
|
845
845
|
try {
|
|
846
|
-
|
|
846
|
+
d = u.getTime() - a.getTime();
|
|
847
847
|
} catch {
|
|
848
848
|
return "";
|
|
849
849
|
}
|
|
850
|
-
const
|
|
850
|
+
const l = d / 36e5, o = Math.floor(d / 864e5);
|
|
851
851
|
if (o < 1)
|
|
852
|
-
return
|
|
852
|
+
return l < 1 ? { path: "now" } : { path: "hours", number: Math.floor(l) };
|
|
853
853
|
if (o < 7)
|
|
854
854
|
return { path: "days", number: o };
|
|
855
855
|
const m = Math.floor(o / 7);
|
|
@@ -1200,8 +1200,8 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1200
1200
|
fr: Ws,
|
|
1201
1201
|
pt: zs
|
|
1202
1202
|
}, Symbol.toStringTag, { value: "Module" })), Fn = (e) => e in qt, Te = (e, t, n, r, i = {}) => {
|
|
1203
|
-
let
|
|
1204
|
-
return Fn(`${t}_${n}`) ?
|
|
1203
|
+
let d = "";
|
|
1204
|
+
return Fn(`${t}_${n}`) ? d = e({ id: `${t}_${n}` }, i) : d = e({ id: t }, { [r]: n, ...i }), d;
|
|
1205
1205
|
}, Ys = (e, t, n) => {
|
|
1206
1206
|
if (!e || e === 0)
|
|
1207
1207
|
return "0";
|
|
@@ -1209,9 +1209,9 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1209
1209
|
let r = e.toString();
|
|
1210
1210
|
t = Math.pow(10, t);
|
|
1211
1211
|
for (let i = n.length - 1; i >= 0; i--) {
|
|
1212
|
-
const
|
|
1213
|
-
if (
|
|
1214
|
-
e = Math.round(e * t /
|
|
1212
|
+
const d = Math.pow(10, (i + 1) * 3);
|
|
1213
|
+
if (d <= e) {
|
|
1214
|
+
e = Math.round(e * t / d) / t, e === 1e3 && i < n.length - 1 && (e = 1, i++), r = `${e}${n[i]}`;
|
|
1215
1215
|
break;
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
@@ -1235,10 +1235,10 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1235
1235
|
styling: n = { muted: !1, fullWidth: !1 },
|
|
1236
1236
|
icon: r = !1,
|
|
1237
1237
|
href: i = !1,
|
|
1238
|
-
element:
|
|
1238
|
+
element: d = "button",
|
|
1239
1239
|
onClick: u = !1,
|
|
1240
1240
|
className: a = "",
|
|
1241
|
-
disabled:
|
|
1241
|
+
disabled: l = !1,
|
|
1242
1242
|
screenreaderText: o = !1,
|
|
1243
1243
|
children: m = !1,
|
|
1244
1244
|
...c
|
|
@@ -1254,21 +1254,21 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1254
1254
|
...c,
|
|
1255
1255
|
className: S(e, a, g, {
|
|
1256
1256
|
"no-text": !m,
|
|
1257
|
-
disabled:
|
|
1257
|
+
disabled: l,
|
|
1258
1258
|
button: i
|
|
1259
1259
|
}),
|
|
1260
1260
|
onClick: (v) => {
|
|
1261
1261
|
(!i || i[0] === "#") && u && (v.preventDefault(), v.stopPropagation()), u && u(v);
|
|
1262
1262
|
},
|
|
1263
|
-
disabled: typeof
|
|
1263
|
+
disabled: typeof l == "object" && "isClickable" in l ? !l.isClickable : l
|
|
1264
1264
|
};
|
|
1265
|
-
return i && (
|
|
1266
|
-
|
|
1265
|
+
return i && (d = "a", b.href = i), C.createElement(
|
|
1266
|
+
d,
|
|
1267
1267
|
b,
|
|
1268
1268
|
m || (o ? /* @__PURE__ */ s.jsx(_e, { showOnFocus: !1, children: o }) : null)
|
|
1269
1269
|
);
|
|
1270
1270
|
}, kt = ({ buttons: e, className: t = "", ...n }) => {
|
|
1271
|
-
const r = e.length > 1 ? "ul" : "p", i = e.map((
|
|
1271
|
+
const r = e.length > 1 ? "ul" : "p", i = e.map((d, u) => r === "p" ? /* @__PURE__ */ s.jsx(W, { ...d }, u) : /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(W, { ...d }) }, u));
|
|
1272
1272
|
return C.createElement(r, { className: S("button-wrapper", t), ...n, children: i });
|
|
1273
1273
|
};
|
|
1274
1274
|
const Ue = ({ className: e = "", maxWidth: t = !1 }) => {
|
|
@@ -1280,18 +1280,18 @@ const Ue = ({ className: e = "", maxWidth: t = !1 }) => {
|
|
|
1280
1280
|
fallbackElement: n,
|
|
1281
1281
|
className: r = "",
|
|
1282
1282
|
onClick: i,
|
|
1283
|
-
gtmContext:
|
|
1283
|
+
gtmContext: d,
|
|
1284
1284
|
gtmType: u,
|
|
1285
1285
|
...a
|
|
1286
1286
|
}) => {
|
|
1287
1287
|
if (e) {
|
|
1288
|
-
const
|
|
1289
|
-
return i && (
|
|
1288
|
+
const l = { ...a };
|
|
1289
|
+
return i && (l.onClick = i), d && (l["data-gtm-event-context"] = d), u && (l["data-gtm-event-type"] = u), /* @__PURE__ */ s.jsx(
|
|
1290
1290
|
"a",
|
|
1291
1291
|
{
|
|
1292
1292
|
href: e,
|
|
1293
1293
|
className: S("gtm-trackable", r),
|
|
1294
|
-
...
|
|
1294
|
+
...l,
|
|
1295
1295
|
children: t
|
|
1296
1296
|
}
|
|
1297
1297
|
);
|
|
@@ -1410,26 +1410,26 @@ const Ue = ({ className: e = "", maxWidth: t = !1 }) => {
|
|
|
1410
1410
|
}, qs = ({ format: e, height: t, query: n, width: r }) => {
|
|
1411
1411
|
let i = `w=${r}&h=${t}`;
|
|
1412
1412
|
return i = e ? `${i}&fm=${e}` : i, i = n ? `${i}&${n}` : i, i;
|
|
1413
|
-
}, Ct = ({ format: e, range: t, url: n, query: r }) => t.map(({ height: i, width:
|
|
1413
|
+
}, Ct = ({ format: e, range: t, url: n, query: r }) => t.map(({ height: i, width: d }) => `${n}?${qs({
|
|
1414
1414
|
format: e,
|
|
1415
1415
|
height: i,
|
|
1416
1416
|
query: r,
|
|
1417
|
-
width:
|
|
1418
|
-
})} ${
|
|
1417
|
+
width: d
|
|
1418
|
+
})} ${d}w`).join(", ");
|
|
1419
1419
|
const Ln = ({ image: e, className: t, testId: n }) => {
|
|
1420
1420
|
const {
|
|
1421
1421
|
description: r,
|
|
1422
1422
|
height: i,
|
|
1423
|
-
type:
|
|
1423
|
+
type: d,
|
|
1424
1424
|
query: u,
|
|
1425
1425
|
url: a,
|
|
1426
|
-
width:
|
|
1426
|
+
width: l,
|
|
1427
1427
|
loading: o,
|
|
1428
1428
|
decoding: m,
|
|
1429
1429
|
fetchPriority: c
|
|
1430
1430
|
} = e, { range: h, sizes: p } = Ks(e), g = Ct({ format: "avif", query: u, range: h, url: a }), b = Ct({ format: "webp", query: u, range: h, url: a }), v = Ct({ format: "", query: u, range: h, url: a });
|
|
1431
1431
|
return /* @__PURE__ */ s.jsxs("picture", { className: t, children: [
|
|
1432
|
-
|
|
1432
|
+
d !== "image/gif" && /* @__PURE__ */ s.jsx(
|
|
1433
1433
|
"source",
|
|
1434
1434
|
{
|
|
1435
1435
|
type: "image/avif",
|
|
@@ -1457,7 +1457,7 @@ const Ln = ({ image: e, className: t, testId: n }) => {
|
|
|
1457
1457
|
loading: o || "lazy",
|
|
1458
1458
|
decoding: m || "async",
|
|
1459
1459
|
fetchpriority: c || "auto",
|
|
1460
|
-
width:
|
|
1460
|
+
width: l,
|
|
1461
1461
|
height: i,
|
|
1462
1462
|
"data-testid": n || "image"
|
|
1463
1463
|
}
|
|
@@ -1466,24 +1466,24 @@ const Ln = ({ image: e, className: t, testId: n }) => {
|
|
|
1466
1466
|
};
|
|
1467
1467
|
let Je = !1;
|
|
1468
1468
|
const er = ({ isOpen: e = !1, isLoading: t = !1, children: n }) => {
|
|
1469
|
-
const r = D(), i = de(null), [
|
|
1469
|
+
const r = D(), i = de(null), [d, u] = P("hidden");
|
|
1470
1470
|
G(() => {
|
|
1471
|
-
const
|
|
1472
|
-
if (
|
|
1473
|
-
return
|
|
1474
|
-
|
|
1471
|
+
const l = i.current;
|
|
1472
|
+
if (l)
|
|
1473
|
+
return l.addEventListener("transitionend", a), () => {
|
|
1474
|
+
l.removeEventListener("transitionend", a);
|
|
1475
1475
|
};
|
|
1476
1476
|
}, []);
|
|
1477
|
-
const a = ({ propertyName:
|
|
1478
|
-
|
|
1477
|
+
const a = ({ propertyName: l }) => {
|
|
1478
|
+
l === "opacity" && (Je !== !1 && clearTimeout(Je), u((o) => o === "opening" ? "open" : o === "closing" ? "closed" : o === "closed" ? "hidden" : o));
|
|
1479
1479
|
};
|
|
1480
1480
|
return He(() => {
|
|
1481
1481
|
Je !== !1 && clearTimeout(Je);
|
|
1482
|
-
let
|
|
1483
|
-
e ? u("opening") : (u("closing"),
|
|
1484
|
-
u(
|
|
1482
|
+
let l = "open";
|
|
1483
|
+
e ? u("opening") : (u("closing"), l = "hidden"), Je = setTimeout(() => {
|
|
1484
|
+
u(l);
|
|
1485
1485
|
}, 300);
|
|
1486
|
-
}, [e]), /* @__PURE__ */ s.jsx("aside", { ref: i, className: S("tooltip text-medium",
|
|
1486
|
+
}, [e]), /* @__PURE__ */ s.jsx("aside", { ref: i, className: S("tooltip text-medium", d, { loading: t }), hidden: d === "hidden", children: t ? /* @__PURE__ */ s.jsx("p", { children: r.formatMessage({ id: "tooltip_loading" }) }) : typeof n == "string" ? /* @__PURE__ */ s.jsx("p", { children: n }) : n });
|
|
1487
1487
|
};
|
|
1488
1488
|
const en = ({ children: e, className: t = "", ...n }) => /* @__PURE__ */ s.jsx("section", { className: S("full-width-section", t), ...n, children: e });
|
|
1489
1489
|
const Ba = ({ text: e, buttons: t, className: n = "" }) => {
|
|
@@ -1519,15 +1519,15 @@ const Qa = ({ title: e = !1, logos: t = [], className: n = "" }) => {
|
|
|
1519
1519
|
{
|
|
1520
1520
|
className: S({ "two-col": r === 2 || r === 4, "three-col": r === 5 || r <= 10 && r % 3 === 0 }),
|
|
1521
1521
|
children: t.map(
|
|
1522
|
-
({ logo:
|
|
1523
|
-
if (!
|
|
1522
|
+
({ logo: d, nameOfBusiness: u, link: a = !1, description: l = !1 }, o) => {
|
|
1523
|
+
if (!d || !d.url)
|
|
1524
1524
|
return null;
|
|
1525
1525
|
const m = /* @__PURE__ */ s.jsx(
|
|
1526
1526
|
"img",
|
|
1527
1527
|
{
|
|
1528
|
-
src:
|
|
1529
|
-
width:
|
|
1530
|
-
height:
|
|
1528
|
+
src: d.url,
|
|
1529
|
+
width: d.width || "auto",
|
|
1530
|
+
height: d.height || "auto",
|
|
1531
1531
|
alt: u
|
|
1532
1532
|
}
|
|
1533
1533
|
);
|
|
@@ -1541,8 +1541,8 @@ const Qa = ({ title: e = !1, logos: t = [], className: n = "" }) => {
|
|
|
1541
1541
|
children: m
|
|
1542
1542
|
}
|
|
1543
1543
|
) : m }),
|
|
1544
|
-
|
|
1545
|
-
] }, window.btoa(`${
|
|
1544
|
+
l && /* @__PURE__ */ s.jsx("small", { children: l })
|
|
1545
|
+
] }, window.btoa(`${d.url}_${o}`));
|
|
1546
1546
|
}
|
|
1547
1547
|
)
|
|
1548
1548
|
}
|
|
@@ -1569,7 +1569,7 @@ const tr = [
|
|
|
1569
1569
|
image: n,
|
|
1570
1570
|
variant: r = "default",
|
|
1571
1571
|
spacing: i = "normal",
|
|
1572
|
-
hideElements:
|
|
1572
|
+
hideElements: d = {
|
|
1573
1573
|
eyebrow: !1,
|
|
1574
1574
|
title: !1,
|
|
1575
1575
|
text: !1
|
|
@@ -1577,13 +1577,13 @@ const tr = [
|
|
|
1577
1577
|
cta: u,
|
|
1578
1578
|
children: a
|
|
1579
1579
|
}) => {
|
|
1580
|
-
const
|
|
1581
|
-
return
|
|
1580
|
+
const l = ["eyebrow", "title", "text"], o = { eyebrow: "small", title: "h1", text: "p" }, m = {};
|
|
1581
|
+
return l.forEach((c) => {
|
|
1582
1582
|
if (!t[c]) {
|
|
1583
1583
|
m[c] = !1;
|
|
1584
1584
|
return;
|
|
1585
1585
|
}
|
|
1586
|
-
if (!
|
|
1586
|
+
if (!d[c]) {
|
|
1587
1587
|
if (typeof t[c] == "object") {
|
|
1588
1588
|
m[c] = t[c];
|
|
1589
1589
|
const { text: h, element: p } = t[c];
|
|
@@ -1613,7 +1613,7 @@ const tr = [
|
|
|
1613
1613
|
}),
|
|
1614
1614
|
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
1615
1615
|
/* @__PURE__ */ s.jsxs("div", { className: "content-wrapper", children: [
|
|
1616
|
-
|
|
1616
|
+
l.map((c) => {
|
|
1617
1617
|
if (m[c] && typeof m[c] == "object") {
|
|
1618
1618
|
const { text: h, element: p = "" } = m[c];
|
|
1619
1619
|
return C.createElement(
|
|
@@ -1674,14 +1674,14 @@ const yt = ({
|
|
|
1674
1674
|
className: r = ""
|
|
1675
1675
|
}) => {
|
|
1676
1676
|
let i = n && !!Object.keys(n).length;
|
|
1677
|
-
const
|
|
1678
|
-
if (
|
|
1677
|
+
const d = typeof n == "object" && "breakpoints" in n, u = vt(d);
|
|
1678
|
+
if (d && typeof n == "object" && typeof u == "number") {
|
|
1679
1679
|
const c = Object.assign({}, n.breakpoints), h = An(Object.keys(c));
|
|
1680
1680
|
i = Pn(u, h, c);
|
|
1681
1681
|
}
|
|
1682
1682
|
const {
|
|
1683
1683
|
breakpoints: a,
|
|
1684
|
-
text:
|
|
1684
|
+
text: l = "",
|
|
1685
1685
|
component: o,
|
|
1686
1686
|
...m
|
|
1687
1687
|
} = n;
|
|
@@ -1697,7 +1697,7 @@ const yt = ({
|
|
|
1697
1697
|
{
|
|
1698
1698
|
...m,
|
|
1699
1699
|
variant: n.variant ? n.variant : "secondary",
|
|
1700
|
-
children:
|
|
1700
|
+
children: l
|
|
1701
1701
|
}
|
|
1702
1702
|
))
|
|
1703
1703
|
] })
|
|
@@ -1722,7 +1722,7 @@ const sr = ({ type: e = "default", className: t = "", heading: n = !1, children:
|
|
|
1722
1722
|
) : /* @__PURE__ */ s.jsx("p", { children: r })
|
|
1723
1723
|
] });
|
|
1724
1724
|
const za = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children: i }) => {
|
|
1725
|
-
const
|
|
1725
|
+
const d = D(), u = de(null), [a, l] = P(""), [o, m] = P("closed");
|
|
1726
1726
|
G(() => {
|
|
1727
1727
|
const p = u.current;
|
|
1728
1728
|
if (p)
|
|
@@ -1734,7 +1734,7 @@ const za = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1734
1734
|
return;
|
|
1735
1735
|
const p = r.split(`
|
|
1736
1736
|
`);
|
|
1737
|
-
|
|
1737
|
+
l(p.length < 3 ? `${r.substring(0, 400)}...` : p.slice(0, 3).join(`
|
|
1738
1738
|
`));
|
|
1739
1739
|
}, [r]), G(() => {
|
|
1740
1740
|
o === "ready-to-close" && m("closing");
|
|
@@ -1760,7 +1760,7 @@ const za = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1760
1760
|
onClick: () => {
|
|
1761
1761
|
m(h ? "ready-to-close" : "opening");
|
|
1762
1762
|
},
|
|
1763
|
-
children: h ? n ||
|
|
1763
|
+
children: h ? n || d.formatMessage({ id: "hideShowTextBox_hide" }) : t || d.formatMessage({ id: "hideShowTextBox_show" })
|
|
1764
1764
|
}
|
|
1765
1765
|
) })
|
|
1766
1766
|
] });
|
|
@@ -1770,11 +1770,11 @@ const za = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1770
1770
|
return null;
|
|
1771
1771
|
let n = t.formatMessage({ id: "markdown_collapsibleSection_summary" });
|
|
1772
1772
|
const r = [];
|
|
1773
|
-
for (const
|
|
1774
|
-
if (!(!
|
|
1775
|
-
if (C.isValidElement(
|
|
1776
|
-
if (
|
|
1777
|
-
for (const u of zt.toArray(
|
|
1773
|
+
for (const d of zt.toArray(e))
|
|
1774
|
+
if (!(!d || typeof d == "string" || typeof d == "number"))
|
|
1775
|
+
if (C.isValidElement(d) && d.type === "summary") {
|
|
1776
|
+
if (d.props && d.props.children) {
|
|
1777
|
+
for (const u of zt.toArray(d.props.children))
|
|
1778
1778
|
if (!(!u || typeof u == "string" || typeof u == "number") && C.isValidElement(u)) {
|
|
1779
1779
|
const a = u.type;
|
|
1780
1780
|
if (or.includes(a)) {
|
|
@@ -1785,14 +1785,14 @@ const za = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
1787
|
} else
|
|
1788
|
-
r.push(
|
|
1788
|
+
r.push(d);
|
|
1789
1789
|
const i = n ? n.toString() : "";
|
|
1790
1790
|
return /* @__PURE__ */ s.jsx(
|
|
1791
1791
|
In,
|
|
1792
1792
|
{
|
|
1793
1793
|
label: i,
|
|
1794
1794
|
className: ["Sources", "Resources"].includes(i) ? "discrete-links" : "",
|
|
1795
|
-
children: r.map((
|
|
1795
|
+
children: r.map((d) => d)
|
|
1796
1796
|
}
|
|
1797
1797
|
);
|
|
1798
1798
|
}, cr = ({ children: e, ...t }) => {
|
|
@@ -1825,11 +1825,11 @@ const za = ({ className: e = "", show: t = !1, hide: n = !1, text: r, children:
|
|
|
1825
1825
|
let n = { ...t };
|
|
1826
1826
|
t.href && (t.href.includes("http:") || t.href.includes("https:")) && !t.target && (n.target = "_blank");
|
|
1827
1827
|
let r = e, i = !1;
|
|
1828
|
-
for (const
|
|
1829
|
-
if (!(!
|
|
1830
|
-
const u =
|
|
1831
|
-
if (["button", "center", "span", "strong"].includes(u) &&
|
|
1832
|
-
for ((u === "button" || bn(
|
|
1828
|
+
for (const d of zt.toArray(e))
|
|
1829
|
+
if (!(!d || typeof d == "string" || typeof d == "number") && C.isValidElement(d)) {
|
|
1830
|
+
const u = d.type;
|
|
1831
|
+
if (["button", "center", "span", "strong"].includes(u) && d.props && d.props.children && d.props.children[0])
|
|
1832
|
+
for ((u === "button" || bn(d.props.children[0]) === "button") && (i = !0), r = d.props.children[0]; r && typeof r != "string" && !(typeof r == "boolean" || typeof r == "number" || !C.isValidElement(r)); )
|
|
1833
1833
|
if (r.props && r.props.children && r.props.children[0])
|
|
1834
1834
|
r = r.props.children[0], r && bn(r) === "button" && (i = !0);
|
|
1835
1835
|
else
|
|
@@ -1866,9 +1866,9 @@ const mr = ({
|
|
|
1866
1866
|
children: r,
|
|
1867
1867
|
className: i = ""
|
|
1868
1868
|
}) => {
|
|
1869
|
-
const
|
|
1869
|
+
const d = e ? { "--max-width": `${e / 16}rem` } : {};
|
|
1870
1870
|
return /* @__PURE__ */ s.jsxs("section", { className: S("page-heading", i), children: [
|
|
1871
|
-
/* @__PURE__ */ s.jsxs("div", { className: S("content", { "has-max-width": e }), style:
|
|
1871
|
+
/* @__PURE__ */ s.jsxs("div", { className: S("content", { "has-max-width": e }), style: d, children: [
|
|
1872
1872
|
t && t.text && C.createElement(t.element || "h1", { className: "title" }, t.text),
|
|
1873
1873
|
n && n.text && C.createElement(
|
|
1874
1874
|
n.element || "h2",
|
|
@@ -1888,8 +1888,8 @@ const ft = ({
|
|
|
1888
1888
|
}) => /* @__PURE__ */ s.jsx("span", { className: S("pill", e, t, n), ...i, children: r });
|
|
1889
1889
|
const Xt = ({ element: e = "p", children: t = null, className: n = "", ...r }) => C.createElement(e, { ...r, className: S("status-banner text-small", n), "aria-live": "assertive" }, t);
|
|
1890
1890
|
const fr = ({ progress: e = 0, text: t = !1, className: n = "" }) => {
|
|
1891
|
-
const r = D(), i = e > 75 ? 100 : e > 50 ? 75 : e > 25 ? 50 : e > 5 ? 25 : 0,
|
|
1892
|
-
return /* @__PURE__ */ s.jsx("span", { className: S(`progress-bar section-${i}`, n), style:
|
|
1891
|
+
const r = D(), i = e > 75 ? 100 : e > 50 ? 75 : e > 25 ? 50 : e > 5 ? 25 : 0, d = { "--progress": `${e}%` };
|
|
1892
|
+
return /* @__PURE__ */ s.jsx("span", { className: S(`progress-bar section-${i}`, n), style: d, children: /* @__PURE__ */ s.jsx(_e, { children: t ? `${e} ${t}` : r.formatMessage({ id: "progressBar" }, { number: e }) }) });
|
|
1893
1893
|
}, hr = We(fr);
|
|
1894
1894
|
const At = "loadingBlock_", pr = ({ progress: e = 0, steps: t = !1, className: n = "" }) => {
|
|
1895
1895
|
const r = D();
|
|
@@ -1899,9 +1899,9 @@ const At = "loadingBlock_", pr = ({ progress: e = 0, steps: t = !1, className: n
|
|
|
1899
1899
|
100: { text: r.formatMessage({ id: `${At}complete` }) }
|
|
1900
1900
|
});
|
|
1901
1901
|
let i = null;
|
|
1902
|
-
const
|
|
1903
|
-
for (let a = 0; a <
|
|
1904
|
-
i =
|
|
1902
|
+
const d = Object.keys(t);
|
|
1903
|
+
for (let a = 0; a < d.length && !(e < parseInt(d[a])); a++)
|
|
1904
|
+
i = d[a];
|
|
1905
1905
|
const u = i && t[i].icon ? { "--icon": `url(${mt}icons/${t[i].icon}.svg)` } : {};
|
|
1906
1906
|
return /* @__PURE__ */ s.jsxs(
|
|
1907
1907
|
Re,
|
|
@@ -1952,10 +1952,10 @@ const vn = 256, qe = ({
|
|
|
1952
1952
|
name: n,
|
|
1953
1953
|
alt: r,
|
|
1954
1954
|
width: i = vn,
|
|
1955
|
-
height:
|
|
1955
|
+
height: d = vn,
|
|
1956
1956
|
...u
|
|
1957
1957
|
}) => {
|
|
1958
|
-
const [a,
|
|
1958
|
+
const [a, l] = P(!1), o = de(null);
|
|
1959
1959
|
G(() => {
|
|
1960
1960
|
const c = o.current;
|
|
1961
1961
|
if (!c)
|
|
@@ -1963,7 +1963,7 @@ const vn = 256, qe = ({
|
|
|
1963
1963
|
const h = c.getContext("2d");
|
|
1964
1964
|
if (!h)
|
|
1965
1965
|
return;
|
|
1966
|
-
const p = i, g =
|
|
1966
|
+
const p = i, g = d;
|
|
1967
1967
|
typeof window < "u" && window.devicePixelRatio && (c.width = p * window.devicePixelRatio, c.height = g * window.devicePixelRatio, h.scale(window.devicePixelRatio, window.devicePixelRatio)), h.fillStyle = gr(n), h.fillRect(0, 0, p, g), h.font = `${p / 3}px Arial`, h.textAlign = "center", h.fillStyle = "white", h.fillText(Qn(n), p / 2, g / 1.6);
|
|
1968
1968
|
}, [n]);
|
|
1969
1969
|
let m = !1;
|
|
@@ -1978,10 +1978,10 @@ const vn = 256, qe = ({
|
|
|
1978
1978
|
src: t,
|
|
1979
1979
|
alt: r || n,
|
|
1980
1980
|
onError: () => {
|
|
1981
|
-
|
|
1981
|
+
l(!0);
|
|
1982
1982
|
},
|
|
1983
1983
|
width: i,
|
|
1984
|
-
height:
|
|
1984
|
+
height: d
|
|
1985
1985
|
}
|
|
1986
1986
|
) : /* @__PURE__ */ s.jsx("canvas", { ref: o })
|
|
1987
1987
|
}
|
|
@@ -2003,12 +2003,12 @@ const vn = 256, qe = ({
|
|
|
2003
2003
|
country: n = "",
|
|
2004
2004
|
maximumCharacters: r = 80
|
|
2005
2005
|
}) => {
|
|
2006
|
-
const i = e !== "",
|
|
2007
|
-
if (!i && !
|
|
2006
|
+
const i = e !== "", d = t !== "", u = n !== "";
|
|
2007
|
+
if (!i && !d && !u)
|
|
2008
2008
|
return "";
|
|
2009
|
-
const a = `${e}${i &&
|
|
2010
|
-
let
|
|
2011
|
-
return
|
|
2009
|
+
const a = `${e}${i && d ? ` — ${t}` : t}`;
|
|
2010
|
+
let l = `${a}${(i || d) && u ? `, ${n}` : n}`;
|
|
2011
|
+
return l.length > r && (l = a), l.length > r && (l = Qe(l, r)), l;
|
|
2012
2012
|
};
|
|
2013
2013
|
const tn = ({
|
|
2014
2014
|
element: e = "div",
|
|
@@ -2016,13 +2016,13 @@ const tn = ({
|
|
|
2016
2016
|
additionalContent: n = !1,
|
|
2017
2017
|
gtmContext: r = "member",
|
|
2018
2018
|
gtmType: i = "member-click",
|
|
2019
|
-
className:
|
|
2019
|
+
className: d = ""
|
|
2020
2020
|
}) => {
|
|
2021
2021
|
const u = D(), a = Hn(t);
|
|
2022
2022
|
a.name || (a.name = u.formatMessage({ id: `member_${typeof t == "string" ? t : "community"}` }));
|
|
2023
|
-
const { name:
|
|
2023
|
+
const { name: l, url: o, image: m } = a, c = _r(a), h = n && n.createdAt ? Gt(n.createdAt) : !1, p = n && n.createdAt ? Rn(n.createdAt) : "";
|
|
2024
2024
|
return C.createElement(e, {
|
|
2025
|
-
className: S("member text-medium",
|
|
2025
|
+
className: S("member text-medium", d),
|
|
2026
2026
|
children: /* @__PURE__ */ s.jsxs(
|
|
2027
2027
|
jt,
|
|
2028
2028
|
{
|
|
@@ -2033,9 +2033,9 @@ const tn = ({
|
|
|
2033
2033
|
g == null || g.stopPropagation();
|
|
2034
2034
|
},
|
|
2035
2035
|
children: [
|
|
2036
|
-
/* @__PURE__ */ s.jsx(qe, { name:
|
|
2036
|
+
/* @__PURE__ */ s.jsx(qe, { name: l, src: m }),
|
|
2037
2037
|
/* @__PURE__ */ s.jsxs("p", { className: "details", children: [
|
|
2038
|
-
/* @__PURE__ */ s.jsx("strong", { children:
|
|
2038
|
+
/* @__PURE__ */ s.jsx("strong", { children: l }),
|
|
2039
2039
|
n && /* @__PURE__ */ s.jsxs("span", { className: "additional-content", children: [
|
|
2040
2040
|
n.createdAt && h && /* @__PURE__ */ s.jsx("span", { className: "date", title: p, "aria-label": p, children: u.formatMessage({ id: `dates_${h.path}` }, { number: h.number }) }),
|
|
2041
2041
|
n.didEdit && /* @__PURE__ */ s.jsx("em", { children: u.formatMessage({ id: "discussion_edited" }) })
|
|
@@ -2053,20 +2053,20 @@ const kn = {
|
|
|
2053
2053
|
}, Un = ({
|
|
2054
2054
|
element: e = "div",
|
|
2055
2055
|
contributors: { total: t, data: n } = { total: void 0, data: [] },
|
|
2056
|
-
styling: { showText: r, size: i, showGap:
|
|
2056
|
+
styling: { showText: r, size: i, showGap: d, showPlaceholders: u } = {
|
|
2057
2057
|
showText: !0,
|
|
2058
2058
|
size: "medium",
|
|
2059
2059
|
showGap: !0,
|
|
2060
2060
|
showPlaceholders: !1
|
|
2061
2061
|
},
|
|
2062
2062
|
cutoff: a = 2,
|
|
2063
|
-
className:
|
|
2063
|
+
className: l = "",
|
|
2064
2064
|
...o
|
|
2065
2065
|
}) => {
|
|
2066
2066
|
const m = D();
|
|
2067
2067
|
return !n || n.length === 0 ? null : C.createElement(e, {
|
|
2068
2068
|
...o,
|
|
2069
|
-
className: S("contributors",
|
|
2069
|
+
className: S("contributors", l, i, { "has-gap": d }),
|
|
2070
2070
|
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2071
2071
|
/* @__PURE__ */ s.jsx("ul", { children: n.map((c, h) => {
|
|
2072
2072
|
let p, g = "";
|
|
@@ -2120,10 +2120,10 @@ const kn = {
|
|
|
2120
2120
|
};
|
|
2121
2121
|
var br = Kt({ client: dt });
|
|
2122
2122
|
function wr(e) {
|
|
2123
|
-
var t = e.children, n = e.client, r = e.apiKey, i = e.options,
|
|
2123
|
+
var t = e.children, n = e.client, r = e.apiKey, i = e.options, d = xt(function() {
|
|
2124
2124
|
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 && (dt.__loaded && console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."), dt.init(r, i)), dt);
|
|
2125
2125
|
}, [n, r]);
|
|
2126
|
-
return C.createElement(br.Provider, { value: { client:
|
|
2126
|
+
return C.createElement(br.Provider, { value: { client: d } }, t);
|
|
2127
2127
|
}
|
|
2128
2128
|
const vr = ({ children: e, user: t }) => t.isLoading ? null : process.env.REACT_APP_PUBLIC_POSTHOG_KEY ? /* @__PURE__ */ s.jsx(
|
|
2129
2129
|
wr,
|
|
@@ -2151,15 +2151,15 @@ const vr = ({ children: e, user: t }) => t.isLoading ? null : process.env.REACT_
|
|
|
2151
2151
|
}, $e = Kt(null), jr = ({ children: e, user: t }) => /* @__PURE__ */ s.jsx($e.Provider, { value: t, children: e }), Ga = ({ bootstrap: e, children: t, intl: n }) => {
|
|
2152
2152
|
const [r, i] = P({ isLoading: !0 });
|
|
2153
2153
|
return G(() => {
|
|
2154
|
-
e().then((
|
|
2155
|
-
i({ ...
|
|
2154
|
+
e().then((d) => {
|
|
2155
|
+
i({ ...d, isLoading: !1 }), Gs(5e3);
|
|
2156
2156
|
}).catch(() => i({ isLoading: !1 }));
|
|
2157
2157
|
}, []), /* @__PURE__ */ s.jsx(kr, { locale: n == null ? void 0 : n.locale, messages: n == null ? void 0 : n.messages, children: /* @__PURE__ */ s.jsx(Es, { children: /* @__PURE__ */ s.jsx(jr, { user: r, children: /* @__PURE__ */ s.jsx(xr, { children: /* @__PURE__ */ s.jsx(vr, { user: r, children: t }) }) }) }) });
|
|
2158
2158
|
};
|
|
2159
2159
|
const Pt = "joinCommunityButton", Wn = ({ isMember: e = !1, isShort: t = !1, functions: { join: n, leave: r } = { join: () => {
|
|
2160
2160
|
}, leave: () => {
|
|
2161
2161
|
} } }) => {
|
|
2162
|
-
const i = D(),
|
|
2162
|
+
const i = D(), d = je($e), u = d && typeof d.id == "string", [a, l] = P(e), [o, m] = P(e ? "joined" : "notJoined");
|
|
2163
2163
|
G(() => {
|
|
2164
2164
|
o === "joining" ? m("joined") : o === "leaving" && m("notJoined");
|
|
2165
2165
|
}, [a]);
|
|
@@ -2172,7 +2172,7 @@ const Pt = "joinCommunityButton", Wn = ({ isMember: e = !1, isShort: t = !1, fun
|
|
|
2172
2172
|
styling: { fullWidth: !0 },
|
|
2173
2173
|
icon: a && o !== "leaving" ? { icon: "tick", position: "left" } : !1,
|
|
2174
2174
|
onClick: async (p) => {
|
|
2175
|
-
u && (p.currentTarget.blur(), a ? (m("leaving"), typeof r == "function" && await r()) : (m("joining"), typeof n == "function" && await n()),
|
|
2175
|
+
u && (p.currentTarget.blur(), a ? (m("leaving"), typeof r == "function" && await r()) : (m("joining"), typeof n == "function" && await n()), l(!a));
|
|
2176
2176
|
},
|
|
2177
2177
|
className: S("join-community-button", o, { active: o === "joining" }),
|
|
2178
2178
|
disabled: !u,
|
|
@@ -2186,9 +2186,9 @@ const Rt = "communityDetails_", Ja = ({
|
|
|
2186
2186
|
isMember: t = !1,
|
|
2187
2187
|
slug: n,
|
|
2188
2188
|
members: { number: r = 0, data: i = [] } = { number: 0, data: [] },
|
|
2189
|
-
functions: { invite:
|
|
2189
|
+
functions: { invite: d, ...u }
|
|
2190
2190
|
}) => {
|
|
2191
|
-
const a = D(),
|
|
2191
|
+
const a = D(), l = 5, o = r || i.length, m = i.length ? i : Array(l).fill({});
|
|
2192
2192
|
return /* @__PURE__ */ s.jsxs("div", { className: S("community-details", e), children: [
|
|
2193
2193
|
/* @__PURE__ */ s.jsx(Ue, {}),
|
|
2194
2194
|
/* @__PURE__ */ s.jsxs("div", { className: "member-details", children: [
|
|
@@ -2211,7 +2211,7 @@ const Rt = "communityDetails_", Ja = ({
|
|
|
2211
2211
|
showGap: !0,
|
|
2212
2212
|
showPlaceholders: o === 0
|
|
2213
2213
|
},
|
|
2214
|
-
cutoff:
|
|
2214
|
+
cutoff: l
|
|
2215
2215
|
}
|
|
2216
2216
|
)
|
|
2217
2217
|
] }),
|
|
@@ -2220,7 +2220,7 @@ const Rt = "communityDetails_", Ja = ({
|
|
|
2220
2220
|
W,
|
|
2221
2221
|
{
|
|
2222
2222
|
variant: "primary",
|
|
2223
|
-
onClick:
|
|
2223
|
+
onClick: d,
|
|
2224
2224
|
icon: { icon: "plus" },
|
|
2225
2225
|
styling: { fullWidth: !0 },
|
|
2226
2226
|
children: a.formatMessage({ id: `${Rt}invite` })
|
|
@@ -2236,9 +2236,9 @@ const Xa = ({
|
|
|
2236
2236
|
const r = D();
|
|
2237
2237
|
return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2238
2238
|
/* @__PURE__ */ s.jsx(_e, { element: "p", children: r.formatMessage({ id: "breadcrumbs_label" }) }),
|
|
2239
|
-
/* @__PURE__ */ s.jsx("ul", { className: S("breadcrumbs text-small", n), children: e.map(({ text: i, href:
|
|
2239
|
+
/* @__PURE__ */ s.jsx("ul", { className: S("breadcrumbs text-small", n), children: e.map(({ text: i, href: d, current: u = !1 }, a) => /* @__PURE__ */ s.jsxs("li", { children: [
|
|
2240
2240
|
u && /* @__PURE__ */ s.jsx(_e, { element: "span", children: r.formatMessage({ id: "breadcrumbs_currentPage" }) }),
|
|
2241
|
-
/* @__PURE__ */ s.jsx(jt, { href: u ? void 0 :
|
|
2241
|
+
/* @__PURE__ */ s.jsx(jt, { href: u ? void 0 : d, children: Qe(i, t) })
|
|
2242
2242
|
] }, `${window.btoa(i)}_${a}`)) })
|
|
2243
2243
|
] });
|
|
2244
2244
|
};
|
|
@@ -2250,14 +2250,14 @@ const Za = ({
|
|
|
2250
2250
|
},
|
|
2251
2251
|
className: i = ""
|
|
2252
2252
|
}) => {
|
|
2253
|
-
const
|
|
2253
|
+
const d = D(), u = t ? [{ id: "all", text: typeof t != "boolean" && t.text || d.formatMessage({ id: "filters_all" }) }, ...e] : e, [a, l] = P(t ? ["all"] : []), o = (m, c) => {
|
|
2254
2254
|
let h = [];
|
|
2255
|
-
a.includes(m) ? h = a.filter((p) => p !== m) : m === "all" ? h = ["all"] : n ? h = [...a.filter((p) => p !== "all"), m] : h = [m],
|
|
2255
|
+
a.includes(m) ? h = a.filter((p) => p !== m) : m === "all" ? h = ["all"] : n ? h = [...a.filter((p) => p !== "all"), m] : h = [m], l((p) => (r && typeof r == "function" && r({ current: h, previous: p }), h)), c && typeof c == "function" && c();
|
|
2256
2256
|
};
|
|
2257
2257
|
return /* @__PURE__ */ s.jsx("ul", { className: S("filters", i), children: u.map(({ id: m, text: c, disabled: h = !1, callback: p = () => {
|
|
2258
2258
|
} }) => {
|
|
2259
2259
|
let g = {};
|
|
2260
|
-
return h && (g = { disabled: !0, "aria-label":
|
|
2260
|
+
return h && (g = { disabled: !0, "aria-label": d.formatMessage({ id: "filters_disabled" }, { name: c }) }), /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(
|
|
2261
2261
|
"button",
|
|
2262
2262
|
{
|
|
2263
2263
|
className: S(m, { selected: a.includes(m) }),
|
|
@@ -2274,8 +2274,8 @@ const Za = ({
|
|
|
2274
2274
|
if (!t || !t.length)
|
|
2275
2275
|
return `/${n}`;
|
|
2276
2276
|
let r = "";
|
|
2277
|
-
return t.forEach(({ url: i, position:
|
|
2278
|
-
|
|
2277
|
+
return t.forEach(({ url: i, position: d }) => {
|
|
2278
|
+
d === "before-lang" ? r += `/${i}` : (r.includes(`/${n}/`) || (r += `/${n}`), r += `/${i}`);
|
|
2279
2279
|
}), r.includes(`/${n}/`) || (r += `/${n}`), r;
|
|
2280
2280
|
};
|
|
2281
2281
|
const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" }, rt = "languageSwitcher_", Ka = ({
|
|
@@ -2285,10 +2285,10 @@ const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2285
2285
|
translations: r,
|
|
2286
2286
|
onChange: i = () => {
|
|
2287
2287
|
},
|
|
2288
|
-
urlParts:
|
|
2288
|
+
urlParts: d,
|
|
2289
2289
|
variant: u = "default",
|
|
2290
2290
|
label: a,
|
|
2291
|
-
className:
|
|
2291
|
+
className: l = ""
|
|
2292
2292
|
}) => {
|
|
2293
2293
|
const o = D(), [m, c] = P(e);
|
|
2294
2294
|
if (G(() => {
|
|
@@ -2296,7 +2296,7 @@ const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2296
2296
|
}, [e]), !r || !Object.values(r).some((b) => b && b.post_name))
|
|
2297
2297
|
return null;
|
|
2298
2298
|
const p = Object.keys(r), g = m !== e;
|
|
2299
|
-
return /* @__PURE__ */ s.jsxs("div", { className: S("language-switcher text-small", u,
|
|
2299
|
+
return /* @__PURE__ */ s.jsxs("div", { className: S("language-switcher text-small", u, l), children: [
|
|
2300
2300
|
/* @__PURE__ */ s.jsxs("nav", { children: [
|
|
2301
2301
|
u !== "short" && /* @__PURE__ */ s.jsx("p", { children: a || o.formatMessage({ id: `${rt}label` }) }),
|
|
2302
2302
|
/* @__PURE__ */ s.jsx("ul", { children: p.map((b) => {
|
|
@@ -2305,7 +2305,7 @@ const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2305
2305
|
let v = { className: b };
|
|
2306
2306
|
return m === b ? v["aria-label"] = o.formatMessage({ id: `${rt}selected` }, { language: Ft[b] }) : v = {
|
|
2307
2307
|
...v,
|
|
2308
|
-
href: yr(b,
|
|
2308
|
+
href: yr(b, d),
|
|
2309
2309
|
onClick: (E) => {
|
|
2310
2310
|
E.preventDefault(), E.stopPropagation(), c(b), i(b);
|
|
2311
2311
|
}
|
|
@@ -2328,57 +2328,51 @@ const Ft = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2328
2328
|
] });
|
|
2329
2329
|
};
|
|
2330
2330
|
const Lt = vs({ locale: "en", messages: qt }), Er = ({
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
},
|
|
2336
|
-
icon: i = !1,
|
|
2337
|
-
messages: l = {
|
|
2331
|
+
hasNextPage: e,
|
|
2332
|
+
loadNextPage: t,
|
|
2333
|
+
icon: n = !1,
|
|
2334
|
+
messages: r = {
|
|
2338
2335
|
button: Lt.formatMessage({ id: "loadMore_button" }),
|
|
2339
2336
|
endOfFeed: Lt.formatMessage({ id: "loadMore_endOfFeed" }),
|
|
2340
2337
|
error: Lt.formatMessage({ id: "loadMore_error" })
|
|
2341
2338
|
},
|
|
2342
|
-
className:
|
|
2343
|
-
gtmContext:
|
|
2339
|
+
className: i = "",
|
|
2340
|
+
gtmContext: d = "LoadMore"
|
|
2344
2341
|
}) => {
|
|
2345
|
-
const [
|
|
2346
|
-
if (t <= 0 || t < n * e)
|
|
2347
|
-
return null;
|
|
2348
|
-
const h = async (p) => {
|
|
2342
|
+
const [u, a] = P(!1), [l, o] = P(e), m = async (c) => {
|
|
2349
2343
|
try {
|
|
2350
|
-
await
|
|
2351
|
-
} catch (
|
|
2352
|
-
|
|
2344
|
+
await t(c);
|
|
2345
|
+
} catch (h) {
|
|
2346
|
+
h instanceof Error && h.message && h.message.includes("Cannot read items") ? o(!1) : a(!0);
|
|
2353
2347
|
}
|
|
2354
2348
|
};
|
|
2355
|
-
return /* @__PURE__ */ s.jsxs("footer", { className: S("load-more",
|
|
2356
|
-
|
|
2357
|
-
|
|
2349
|
+
return /* @__PURE__ */ s.jsxs("footer", { className: S("load-more", i), children: [
|
|
2350
|
+
u && /* @__PURE__ */ s.jsx("p", { className: "error", children: r.error }),
|
|
2351
|
+
l ? /* @__PURE__ */ s.jsx(
|
|
2358
2352
|
W,
|
|
2359
2353
|
{
|
|
2360
2354
|
variant: "secondary",
|
|
2361
|
-
icon:
|
|
2362
|
-
onClick:
|
|
2363
|
-
"data-gtm-event-context":
|
|
2355
|
+
icon: n,
|
|
2356
|
+
onClick: m,
|
|
2357
|
+
"data-gtm-event-context": d,
|
|
2364
2358
|
"data-gtm-event-type": "load-more-click",
|
|
2365
2359
|
className: "gtm-trackable",
|
|
2366
2360
|
"data-testid": "load-more-button",
|
|
2367
|
-
children:
|
|
2361
|
+
children: r.button
|
|
2368
2362
|
}
|
|
2369
|
-
)
|
|
2363
|
+
) : /* @__PURE__ */ s.jsx("p", { children: r.endOfFeed })
|
|
2370
2364
|
] });
|
|
2371
2365
|
};
|
|
2372
2366
|
const zn = ({ 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(_e, { children: /* @__PURE__ */ s.jsx(Pe, { id: "apolitical" }) }) }) });
|
|
2373
2367
|
let at = !1;
|
|
2374
2368
|
const Sr = ({ element: e = "div", id: t = "more-menu", options: n, className: r = "" }) => {
|
|
2375
|
-
const i = D(),
|
|
2376
|
-
|
|
2369
|
+
const i = D(), d = de(null), [u, a] = P(!1), l = (o) => {
|
|
2370
|
+
d.current && o.target instanceof HTMLElement && !d.current.contains(o.target) && a(!1);
|
|
2377
2371
|
};
|
|
2378
|
-
return G(() => (document.addEventListener("click",
|
|
2379
|
-
document.removeEventListener("click",
|
|
2372
|
+
return G(() => (document.addEventListener("click", l, !0), () => {
|
|
2373
|
+
document.removeEventListener("click", l, !0);
|
|
2380
2374
|
})), C.createElement(e, {
|
|
2381
|
-
ref:
|
|
2375
|
+
ref: d,
|
|
2382
2376
|
className: S("more-menu text-medium", r),
|
|
2383
2377
|
children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2384
2378
|
/* @__PURE__ */ s.jsx(
|
|
@@ -2447,14 +2441,14 @@ const Tr = [
|
|
|
2447
2441
|
], Mr = ({ activeLink: e }) => {
|
|
2448
2442
|
const t = D(), n = je($e), r = n && typeof n.id == "string";
|
|
2449
2443
|
return /* @__PURE__ */ s.jsxs("ul", { id: "navigation-menu", className: "text-medium", children: [
|
|
2450
|
-
Tr.map(({ key: i, href:
|
|
2444
|
+
Tr.map(({ key: i, href: d }) => /* @__PURE__ */ s.jsx(
|
|
2451
2445
|
"li",
|
|
2452
2446
|
{
|
|
2453
|
-
className: S(i, { active: $r(
|
|
2447
|
+
className: S(i, { active: $r(d, e) }),
|
|
2454
2448
|
children: /* @__PURE__ */ s.jsx(
|
|
2455
2449
|
"a",
|
|
2456
2450
|
{
|
|
2457
|
-
href:
|
|
2451
|
+
href: d,
|
|
2458
2452
|
"data-gtm-event-type": `${i}-click`,
|
|
2459
2453
|
"data-gtm-event-context": "NavigationMenu",
|
|
2460
2454
|
className: "gtm-trackable",
|
|
@@ -2533,13 +2527,13 @@ const Dr = "shareLinks_", qa = ({
|
|
|
2533
2527
|
referrer: n,
|
|
2534
2528
|
gtmContext: r = "ShareLinks",
|
|
2535
2529
|
size: i = "large",
|
|
2536
|
-
variant:
|
|
2530
|
+
variant: d = "default",
|
|
2537
2531
|
className: u = ""
|
|
2538
2532
|
}) => {
|
|
2539
|
-
const a = D(),
|
|
2540
|
-
return /* @__PURE__ */ s.jsxs("aside", { className: S("share-links", i,
|
|
2533
|
+
const a = D(), l = Nr({ title: e, link: t, referrer: n });
|
|
2534
|
+
return /* @__PURE__ */ s.jsxs("aside", { className: S("share-links", i, d, u), children: [
|
|
2541
2535
|
/* @__PURE__ */ s.jsx("p", { className: "text-small", children: a.formatMessage({ id: "shareLinks_label" }) }),
|
|
2542
|
-
/* @__PURE__ */ s.jsx("ul", { children:
|
|
2536
|
+
/* @__PURE__ */ s.jsx("ul", { children: l.map(({ key: o, icon: m, url: c, shouldRender: h = !0, onClick: p }) => {
|
|
2543
2537
|
if (typeof h == "function" && !h())
|
|
2544
2538
|
return null;
|
|
2545
2539
|
const g = {};
|
|
@@ -2564,7 +2558,7 @@ const Dr = "shareLinks_", qa = ({
|
|
|
2564
2558
|
] });
|
|
2565
2559
|
};
|
|
2566
2560
|
const eo = ({ tabs: e, className: t = "" }) => {
|
|
2567
|
-
var
|
|
2561
|
+
var l;
|
|
2568
2562
|
const n = (o, m, c) => (o || (o = `panel-${window.btoa(m)}-${c}`), o);
|
|
2569
2563
|
let r = e.findIndex((o) => o.current === !0);
|
|
2570
2564
|
if (r < 0 && (r = 0), window.location.hash) {
|
|
@@ -2577,14 +2571,14 @@ const eo = ({ tabs: e, className: t = "" }) => {
|
|
|
2577
2571
|
}
|
|
2578
2572
|
}
|
|
2579
2573
|
}
|
|
2580
|
-
const [i,
|
|
2581
|
-
(
|
|
2574
|
+
const [i, d] = P(
|
|
2575
|
+
(l = e[r]) != null && l.id ? e[r].id : n(e[r].id, e[r].text, r)
|
|
2582
2576
|
), u = [], a = [];
|
|
2583
2577
|
return e.forEach(({ id: o, text: m, content: c, href: h }, p) => {
|
|
2584
2578
|
o = n(o, m, p);
|
|
2585
2579
|
const g = i === o, b = {};
|
|
2586
2580
|
h || (b["aria-controls"] = o, b.onClick = (v) => {
|
|
2587
|
-
v.preventDefault(), v.stopPropagation(),
|
|
2581
|
+
v.preventDefault(), v.stopPropagation(), d(o), window.location.hash = `#${o}`;
|
|
2588
2582
|
}, a.push(
|
|
2589
2583
|
/* @__PURE__ */ s.jsx(
|
|
2590
2584
|
"section",
|
|
@@ -2627,21 +2621,21 @@ const Cr = {
|
|
|
2627
2621
|
children: r
|
|
2628
2622
|
}) => {
|
|
2629
2623
|
const i = vt(!0);
|
|
2630
|
-
let
|
|
2631
|
-
return C.Children.count(r) === 1 && (
|
|
2624
|
+
let d = r;
|
|
2625
|
+
return C.Children.count(r) === 1 && (d = C.Children.toArray(r)[0], d.props && (d = d.props.children)), /* @__PURE__ */ s.jsx("section", { className: S("columns", `layout-${e}`, n), children: C.Children.map(d, (u, a) => t !== !1 && a === t && i && i < Cr[e] ? null : u) });
|
|
2632
2626
|
}, to = ({ activeLink: e, ...t }) => /* @__PURE__ */ s.jsx(Ar, { layout: "1-3", children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2633
2627
|
/* @__PURE__ */ s.jsx(Mr, { activeLink: e }),
|
|
2634
2628
|
/* @__PURE__ */ s.jsx(mr, { ...t })
|
|
2635
2629
|
] }) });
|
|
2636
2630
|
const It = "cookieBanner_", Ot = ["apol-cookie-banner", "apolitical-performance-cookie-consent", "functional-cookie-consent"], Bt = new Date(Date.now() + 12 * 30 * 24 * 60 * 60 * 1e3), Pr = () => {
|
|
2637
|
-
const e = D(), [t, n, r] = Ss(Ot), [i,
|
|
2631
|
+
const e = D(), [t, n, r] = Ss(Ot), [i, d] = P(!t["apol-cookie-banner"]), u = () => {
|
|
2638
2632
|
Ot.forEach((m) => {
|
|
2639
2633
|
n(m, !0, {
|
|
2640
2634
|
path: "/",
|
|
2641
2635
|
expires: Bt,
|
|
2642
2636
|
domain: m === "apolitical-performance-cookie-consent" ? ".apolitical.co" : void 0
|
|
2643
2637
|
});
|
|
2644
|
-
}),
|
|
2638
|
+
}), d(!1), window.location.reload();
|
|
2645
2639
|
}, a = () => {
|
|
2646
2640
|
n("apol-cookie-banner", !0, {
|
|
2647
2641
|
path: "/",
|
|
@@ -2655,16 +2649,16 @@ const It = "cookieBanner_", Ot = ["apol-cookie-banner", "apolitical-performance-
|
|
|
2655
2649
|
return;
|
|
2656
2650
|
}
|
|
2657
2651
|
r(m);
|
|
2658
|
-
}),
|
|
2652
|
+
}), d(!1);
|
|
2659
2653
|
};
|
|
2660
2654
|
if (!i)
|
|
2661
2655
|
return null;
|
|
2662
|
-
const
|
|
2656
|
+
const l = [
|
|
2663
2657
|
{ id: "settings", href: "/pages/cookie-policy", gtmType: "policy-page" },
|
|
2664
2658
|
{ id: "reject", onClick: a, gtmType: "reject-all" },
|
|
2665
2659
|
{ id: "accept", onClick: u, gtmType: "accepted-all" }
|
|
2666
2660
|
], o = [];
|
|
2667
|
-
return
|
|
2661
|
+
return l.forEach((m) => {
|
|
2668
2662
|
o.push({
|
|
2669
2663
|
variant: m.href ? "tertiary" : "primary",
|
|
2670
2664
|
href: m.href,
|
|
@@ -2781,14 +2775,14 @@ const Be = "footer_", ht = "SiteFooter", jn = ({ group: e }) => {
|
|
|
2781
2775
|
Array.isArray(t) && t.length > 0 && /* @__PURE__ */ s.jsx("ul", { className: "text-medium", children: t.map((r) => {
|
|
2782
2776
|
if (["order", "child", "text"].includes(r))
|
|
2783
2777
|
return null;
|
|
2784
|
-
const { href: i, gtmType:
|
|
2778
|
+
const { href: i, gtmType: d } = Ce[e][r], u = {};
|
|
2785
2779
|
return ["legal"].includes(e) && (u.target = "_blank", u.rel = "noopener"), /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx(
|
|
2786
2780
|
"a",
|
|
2787
2781
|
{
|
|
2788
2782
|
href: i,
|
|
2789
2783
|
className: "gtm-trackable",
|
|
2790
2784
|
"data-gtm-event-context": ht,
|
|
2791
|
-
"data-gtm-event-type":
|
|
2785
|
+
"data-gtm-event-type": d,
|
|
2792
2786
|
...u,
|
|
2793
2787
|
children: /* @__PURE__ */ s.jsx(Pe, { id: `${Be}${e}_${r}` })
|
|
2794
2788
|
}
|
|
@@ -2848,7 +2842,7 @@ const Be = "footer_", ht = "SiteFooter", jn = ({ group: e }) => {
|
|
|
2848
2842
|
] })
|
|
2849
2843
|
] }) });
|
|
2850
2844
|
const ot = "emailHelperTextBox_", no = ({ type: e, email: t, redirectPath: n, resendVerificationCode: r }) => {
|
|
2851
|
-
const i = D(), [
|
|
2845
|
+
const i = D(), [d, u] = P({ path: `${ot}default`, type: "default", link: {}, mail: {}, error: "" }), [a, l] = P(!1), o = Me(
|
|
2852
2846
|
(p) => {
|
|
2853
2847
|
p.preventDefault(), p.stopPropagation();
|
|
2854
2848
|
const g = (b) => {
|
|
@@ -2876,12 +2870,12 @@ const ot = "emailHelperTextBox_", no = ({ type: e, email: t, redirectPath: n, re
|
|
|
2876
2870
|
g(i.formatMessage({ id: `${ot}error_noFunction` }));
|
|
2877
2871
|
return;
|
|
2878
2872
|
}
|
|
2879
|
-
|
|
2873
|
+
l(!0), r(t).then(() => {
|
|
2880
2874
|
localStorage.setItem("email", t), window.location.href = n || "/signup/verify-email";
|
|
2881
2875
|
}).catch((b) => {
|
|
2882
2876
|
g(b.message);
|
|
2883
2877
|
}).finally(() => {
|
|
2884
|
-
|
|
2878
|
+
l(!1);
|
|
2885
2879
|
});
|
|
2886
2880
|
},
|
|
2887
2881
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
@@ -2939,15 +2933,15 @@ const ot = "emailHelperTextBox_", no = ({ type: e, email: t, redirectPath: n, re
|
|
|
2939
2933
|
};
|
|
2940
2934
|
break;
|
|
2941
2935
|
}
|
|
2942
|
-
u({ ...
|
|
2936
|
+
u({ ...d, path: p, type: g, link: b, mail: v });
|
|
2943
2937
|
},
|
|
2944
2938
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2945
2939
|
[e]
|
|
2946
2940
|
);
|
|
2947
2941
|
const m = {};
|
|
2948
2942
|
return ["link", "mail"].forEach((p) => {
|
|
2949
|
-
m[p] = Object.keys(
|
|
2950
|
-
}), /* @__PURE__ */ s.jsx(sr, { type:
|
|
2943
|
+
m[p] = Object.keys(d[p]).length ? (g) => /* @__PURE__ */ s.jsx("a", { ...d[p], children: g }) : (g) => g;
|
|
2944
|
+
}), /* @__PURE__ */ s.jsx(sr, { type: d.type, heading: a ? !1 : i.formatMessage({ id: `${d.path}_title` }), children: a ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
2951
2945
|
/* @__PURE__ */ s.jsx(Se, { element: "span" }),
|
|
2952
2946
|
/* @__PURE__ */ s.jsx(Se, { element: "span" })
|
|
2953
2947
|
] }) : (
|
|
@@ -2955,7 +2949,7 @@ const ot = "emailHelperTextBox_", no = ({ type: e, email: t, redirectPath: n, re
|
|
|
2955
2949
|
// @ts-ignore
|
|
2956
2950
|
// `values` are throwing a type error: https://github.com/formatjs/formatjs/issues/3633
|
|
2957
2951
|
i.formatMessage(
|
|
2958
|
-
{ id: `${
|
|
2952
|
+
{ id: `${d.path}_text` },
|
|
2959
2953
|
{
|
|
2960
2954
|
...m,
|
|
2961
2955
|
strong: (p) => /* @__PURE__ */ s.jsx("strong", { children: p }),
|
|
@@ -2964,7 +2958,7 @@ const ot = "emailHelperTextBox_", no = ({ type: e, email: t, redirectPath: n, re
|
|
|
2964
2958
|
/* @__PURE__ */ s.jsx("br", {}),
|
|
2965
2959
|
/* @__PURE__ */ s.jsx("br", {})
|
|
2966
2960
|
] }),
|
|
2967
|
-
error:
|
|
2961
|
+
error: d.error
|
|
2968
2962
|
}
|
|
2969
2963
|
)
|
|
2970
2964
|
) });
|
|
@@ -2997,10 +2991,10 @@ const ro = ({
|
|
|
2997
2991
|
functions: { createRating: n = () => null, updateRating: r = () => {
|
|
2998
2992
|
}, reportError: i = () => {
|
|
2999
2993
|
} },
|
|
3000
|
-
className:
|
|
2994
|
+
className: d = "",
|
|
3001
2995
|
hasLoaded: u = !1
|
|
3002
2996
|
}) => {
|
|
3003
|
-
const a = D(), [
|
|
2997
|
+
const a = D(), [l, o] = P({ setUp: !1, id: null, rating: null, disabled: !0 }), m = async () => {
|
|
3004
2998
|
try {
|
|
3005
2999
|
const E = await n();
|
|
3006
3000
|
o((j) => ({ ...j, setUp: !0, id: E && E.id, disabled: !1 }));
|
|
@@ -3009,10 +3003,10 @@ const ro = ({
|
|
|
3009
3003
|
}
|
|
3010
3004
|
};
|
|
3011
3005
|
if (G(() => {
|
|
3012
|
-
u && !
|
|
3006
|
+
u && !l.setUp && m();
|
|
3013
3007
|
}, [u]), !u)
|
|
3014
3008
|
return /* @__PURE__ */ s.jsx(Se, { className: "rating-placeholder" });
|
|
3015
|
-
const { id: c, rating: h, disabled: p } =
|
|
3009
|
+
const { id: c, rating: h, disabled: p } = l, g = "ratings_", b = {
|
|
3016
3010
|
text: a.formatMessage({ id: `${g}text` }),
|
|
3017
3011
|
low: a.formatMessage({ id: `${g}low` }),
|
|
3018
3012
|
high: a.formatMessage({ id: `${g}high` }),
|
|
@@ -3028,7 +3022,7 @@ const ro = ({
|
|
|
3028
3022
|
o((j) => ({ ...j, disabled: !1 }));
|
|
3029
3023
|
}
|
|
3030
3024
|
};
|
|
3031
|
-
return /* @__PURE__ */ s.jsxs("div", { className: S("rating",
|
|
3025
|
+
return /* @__PURE__ */ s.jsxs("div", { className: S("rating", d), children: [
|
|
3032
3026
|
/* @__PURE__ */ s.jsx("span", { className: "label", children: b[h ? "success" : "text"] }),
|
|
3033
3027
|
/* @__PURE__ */ s.jsx("ol", { children: Array.from(new Array(t).keys()).map((E) => {
|
|
3034
3028
|
const j = E + 1;
|
|
@@ -3057,9 +3051,9 @@ const Lr = ({
|
|
|
3057
3051
|
handleToggle: n = !1,
|
|
3058
3052
|
defaultValue: r = "",
|
|
3059
3053
|
gtmContext: i = "search-bar",
|
|
3060
|
-
gtmEvent:
|
|
3054
|
+
gtmEvent: d = "form-submission"
|
|
3061
3055
|
}) => {
|
|
3062
|
-
const { searchIsOpen: u = !0, isDesktopVersion: a = !1 } = n || {},
|
|
3056
|
+
const { searchIsOpen: u = !0, isDesktopVersion: a = !1 } = n || {}, l = D(), o = de(null);
|
|
3063
3057
|
He(() => {
|
|
3064
3058
|
!n || a || !u || o.current && o.current.focus();
|
|
3065
3059
|
}, [u]);
|
|
@@ -3072,9 +3066,9 @@ const Lr = ({
|
|
|
3072
3066
|
onSubmit: m,
|
|
3073
3067
|
className: S("search-form gtm-trackable", t),
|
|
3074
3068
|
"data-gtm-event-context": i,
|
|
3075
|
-
"data-gtm-event-type":
|
|
3069
|
+
"data-gtm-event-type": d,
|
|
3076
3070
|
children: /* @__PURE__ */ s.jsx("fieldset", { id: `${e}-form`, hidden: n ? !u : !1, role: "search", children: /* @__PURE__ */ s.jsxs("p", { children: [
|
|
3077
|
-
/* @__PURE__ */ s.jsx(_e, { element: "label", htmlFor: e, children:
|
|
3071
|
+
/* @__PURE__ */ s.jsx(_e, { element: "label", htmlFor: e, children: l.formatMessage({ id: "search_label" }) }),
|
|
3078
3072
|
/* @__PURE__ */ s.jsx(
|
|
3079
3073
|
"input",
|
|
3080
3074
|
{
|
|
@@ -3083,7 +3077,7 @@ const Lr = ({
|
|
|
3083
3077
|
id: e,
|
|
3084
3078
|
name: e,
|
|
3085
3079
|
defaultValue: r,
|
|
3086
|
-
placeholder:
|
|
3080
|
+
placeholder: l.formatMessage({ id: "search_placeholder" }),
|
|
3087
3081
|
onKeyDown: (c) => {
|
|
3088
3082
|
c.key === "Enter" && m(c);
|
|
3089
3083
|
}
|
|
@@ -3096,10 +3090,10 @@ const Lr = ({
|
|
|
3096
3090
|
onClick: (c) => {
|
|
3097
3091
|
c.preventDefault(), c.stopPropagation(), o.current && o.current.value && (o.current.value = "");
|
|
3098
3092
|
},
|
|
3099
|
-
children: /* @__PURE__ */ s.jsx(_e, { children:
|
|
3093
|
+
children: /* @__PURE__ */ s.jsx(_e, { children: l.formatMessage({ id: "search_clear" }) })
|
|
3100
3094
|
}
|
|
3101
3095
|
),
|
|
3102
|
-
/* @__PURE__ */ s.jsx("button", { className: "search", onClick: m, children: /* @__PURE__ */ s.jsx(_e, { children:
|
|
3096
|
+
/* @__PURE__ */ s.jsx("button", { className: "search", onClick: m, children: /* @__PURE__ */ s.jsx(_e, { children: l.formatMessage({ id: "search_cta" }) }) })
|
|
3103
3097
|
] }) })
|
|
3104
3098
|
}
|
|
3105
3099
|
);
|
|
@@ -3110,17 +3104,17 @@ const Ir = ({
|
|
|
3110
3104
|
ctaMessage: n,
|
|
3111
3105
|
titleColor: r,
|
|
3112
3106
|
labelColor: i,
|
|
3113
|
-
backgroundColor:
|
|
3107
|
+
backgroundColor: d,
|
|
3114
3108
|
onClose: u,
|
|
3115
3109
|
reportError: a,
|
|
3116
|
-
sendInvites:
|
|
3110
|
+
sendInvites: l,
|
|
3117
3111
|
initialFormStatus: o = "NOT_SUBMITTED"
|
|
3118
3112
|
/* NOT_SUBMITTED */
|
|
3119
3113
|
}) => {
|
|
3120
3114
|
const [m, c] = P([]), [h, p] = P(!0), [g, b] = P(o), { formatMessage: v } = D(), E = async (T) => {
|
|
3121
3115
|
T.preventDefault();
|
|
3122
3116
|
try {
|
|
3123
|
-
await
|
|
3117
|
+
await l(m), c([]), b(
|
|
3124
3118
|
"SUCCESS"
|
|
3125
3119
|
/* SUCCESS */
|
|
3126
3120
|
);
|
|
@@ -3154,7 +3148,7 @@ const Ir = ({
|
|
|
3154
3148
|
] }) : /* @__PURE__ */ s.jsx("div", { className: "invite-form-wrapper", children: /* @__PURE__ */ s.jsxs(
|
|
3155
3149
|
"form",
|
|
3156
3150
|
{
|
|
3157
|
-
style: { backgroundColor:
|
|
3151
|
+
style: { backgroundColor: d },
|
|
3158
3152
|
onSubmit: E,
|
|
3159
3153
|
className: S("invite-form gtm-trackable"),
|
|
3160
3154
|
children: [
|
|
@@ -3203,13 +3197,13 @@ const Ir = ({
|
|
|
3203
3197
|
const n = {
|
|
3204
3198
|
navigation: { loggedIn: 769, loggedOut: 881 },
|
|
3205
3199
|
search: { loggedIn: 961, loggedOut: 1121 }
|
|
3206
|
-
}, r = (
|
|
3200
|
+
}, r = (d) => {
|
|
3207
3201
|
const u = `logged${e ? "In" : "Out"}`;
|
|
3208
|
-
return t >= n[
|
|
3202
|
+
return t >= n[d][u];
|
|
3209
3203
|
};
|
|
3210
3204
|
let i = {};
|
|
3211
|
-
return ["navigation", "search"].forEach((
|
|
3212
|
-
i[
|
|
3205
|
+
return ["navigation", "search"].forEach((d) => {
|
|
3206
|
+
i[d] = r(d);
|
|
3213
3207
|
}), i;
|
|
3214
3208
|
},
|
|
3215
3209
|
shouldChangeHeaderIsVisible: (e, t, n) => {
|
|
@@ -3222,10 +3216,10 @@ const Ir = ({
|
|
|
3222
3216
|
if (!t && U.handlerCalled[e] && i - U.handlerCalled[e] < 500)
|
|
3223
3217
|
return;
|
|
3224
3218
|
U.handlerCalled[e] = i;
|
|
3225
|
-
let
|
|
3219
|
+
let d = [{ type: `menus.${e}`, value: t }];
|
|
3226
3220
|
t === !0 && Object.keys(n).forEach((u) => {
|
|
3227
|
-
u === e || n[u] === !1 ||
|
|
3228
|
-
}), r(
|
|
3221
|
+
u === e || n[u] === !1 || d.push({ type: `menus.${u}`, value: !1 });
|
|
3222
|
+
}), r(d);
|
|
3229
3223
|
},
|
|
3230
3224
|
// Find the first child inside a ref that matches the `key` (and optional `value`) we're looking for,
|
|
3231
3225
|
// so we can automatically focus on the first link inside a menu for accessibility.
|
|
@@ -3251,21 +3245,21 @@ const Ir = ({
|
|
|
3251
3245
|
autoFocus: ({ menu: e, navigationRef: t, isDesktopVersion: n, focusElements: r, dispatch: i }) => {
|
|
3252
3246
|
if (!t.current || !t.current.children)
|
|
3253
3247
|
return;
|
|
3254
|
-
const
|
|
3255
|
-
if (r[e][
|
|
3256
|
-
r[e][
|
|
3248
|
+
const d = n ? "desktop" : "default";
|
|
3249
|
+
if (r[e][d]) {
|
|
3250
|
+
r[e][d].focus();
|
|
3257
3251
|
return;
|
|
3258
3252
|
}
|
|
3259
3253
|
let u, a;
|
|
3260
3254
|
switch (e) {
|
|
3261
3255
|
case "navigation":
|
|
3262
3256
|
if (n) {
|
|
3263
|
-
const
|
|
3257
|
+
const l = U.findFirstChild(
|
|
3264
3258
|
t.current.children,
|
|
3265
3259
|
"attributes.aria-controls",
|
|
3266
3260
|
"navigation"
|
|
3267
3261
|
);
|
|
3268
|
-
u = U.findFirstChild(
|
|
3262
|
+
u = U.findFirstChild(l.children, "href");
|
|
3269
3263
|
} else
|
|
3270
3264
|
u = U.findFirstChild(t.current.children, "href");
|
|
3271
3265
|
u || (u = t.current);
|
|
@@ -3278,7 +3272,7 @@ const Ir = ({
|
|
|
3278
3272
|
default:
|
|
3279
3273
|
return;
|
|
3280
3274
|
}
|
|
3281
|
-
u && (i([{ type: `focusElements.${e}.${
|
|
3275
|
+
u && (i([{ type: `focusElements.${e}.${d}`, value: u }]), u.focus());
|
|
3282
3276
|
},
|
|
3283
3277
|
events: {
|
|
3284
3278
|
onClick: (e, { id: t, callback: n, isOpen: r }) => {
|
|
@@ -3379,12 +3373,12 @@ const Ir = ({
|
|
|
3379
3373
|
menus: r = {},
|
|
3380
3374
|
callback: i = () => {
|
|
3381
3375
|
},
|
|
3382
|
-
doTrack:
|
|
3376
|
+
doTrack: d = null
|
|
3383
3377
|
}) => {
|
|
3384
3378
|
const u = D(), a = Mn(pt, e);
|
|
3385
3379
|
if (!a || a.onlyShow && (a.onlyShow === "logged-in" && !t || a.onlyShow === "logged-out" && t))
|
|
3386
3380
|
return null;
|
|
3387
|
-
const
|
|
3381
|
+
const l = "doTrack" in a, o = d === null ? l ? a.doTrack : !0 : d, m = e.includes("buttons.");
|
|
3388
3382
|
let c = `header_${e.replaceAll(".", "_")}`;
|
|
3389
3383
|
a.hasVariantText && (c += `_logged${t ? "In" : "Out"}`);
|
|
3390
3384
|
let h = !1;
|
|
@@ -3444,7 +3438,7 @@ const Ir = ({
|
|
|
3444
3438
|
isDesktopVersion: n,
|
|
3445
3439
|
menus: r,
|
|
3446
3440
|
callback: i,
|
|
3447
|
-
doTrack:
|
|
3441
|
+
doTrack: l ? o : null
|
|
3448
3442
|
};
|
|
3449
3443
|
return a[j].order ? /* @__PURE__ */ s.jsxs("li", { className: S({ [a[j].className]: a[j].className }), children: [
|
|
3450
3444
|
u.formatMessage({ id: `${c}_${j}` }),
|
|
@@ -3454,7 +3448,7 @@ const Ir = ({
|
|
|
3454
3448
|
] }, e);
|
|
3455
3449
|
};
|
|
3456
3450
|
const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 }) => {
|
|
3457
|
-
const t = D(), n = je($e), r = vt(!0, !0), i = n && typeof n.id == "string",
|
|
3451
|
+
const t = D(), n = je($e), r = vt(!0, !0), i = n && typeof n.id == "string", d = xt(
|
|
3458
3452
|
() => U.getIsDesktopVersion(i, r),
|
|
3459
3453
|
[i, r]
|
|
3460
3454
|
), [u, a] = gs(Xs, {
|
|
@@ -3464,15 +3458,15 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3464
3458
|
navigation: { desktop: !1, default: !1 },
|
|
3465
3459
|
account: { desktop: !1, default: !1 }
|
|
3466
3460
|
}
|
|
3467
|
-
}), { headerIsVisible:
|
|
3461
|
+
}), { headerIsVisible: l, menus: o, focusElements: m } = u;
|
|
3468
3462
|
Os({
|
|
3469
|
-
scrollPosition: Or[`height${
|
|
3463
|
+
scrollPosition: Or[`height${d.navigation ? "_desktop" : ""}`],
|
|
3470
3464
|
callbacks: {
|
|
3471
3465
|
scrollUp: () => {
|
|
3472
|
-
!
|
|
3466
|
+
!d && o.navigation || U.shouldChangeHeaderIsVisible(!0, o, a);
|
|
3473
3467
|
},
|
|
3474
3468
|
scrollDown: () => {
|
|
3475
|
-
!
|
|
3469
|
+
!d && o.navigation || U.shouldChangeHeaderIsVisible(!1, o, a);
|
|
3476
3470
|
}
|
|
3477
3471
|
}
|
|
3478
3472
|
});
|
|
@@ -3483,7 +3477,7 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3483
3477
|
o.navigation && U.autoFocus({
|
|
3484
3478
|
menu: "navigation",
|
|
3485
3479
|
navigationRef: h,
|
|
3486
|
-
isDesktopVersion:
|
|
3480
|
+
isDesktopVersion: d.navigation,
|
|
3487
3481
|
focusElements: m,
|
|
3488
3482
|
dispatch: a
|
|
3489
3483
|
});
|
|
@@ -3491,7 +3485,7 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3491
3485
|
o.account && U.autoFocus({
|
|
3492
3486
|
menu: "account",
|
|
3493
3487
|
navigationRef: h,
|
|
3494
|
-
isDesktopVersion:
|
|
3488
|
+
isDesktopVersion: d.navigation,
|
|
3495
3489
|
focusElements: m,
|
|
3496
3490
|
dispatch: a
|
|
3497
3491
|
});
|
|
@@ -3503,7 +3497,7 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3503
3497
|
className: S({
|
|
3504
3498
|
"logged-in": i,
|
|
3505
3499
|
"logged-out": !i,
|
|
3506
|
-
visible:
|
|
3500
|
+
visible: l
|
|
3507
3501
|
}),
|
|
3508
3502
|
children: [
|
|
3509
3503
|
/* @__PURE__ */ s.jsx(
|
|
@@ -3516,7 +3510,7 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3516
3510
|
),
|
|
3517
3511
|
/* @__PURE__ */ s.jsx(zn, {}),
|
|
3518
3512
|
e && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
3519
|
-
!
|
|
3513
|
+
!d.navigation && /* @__PURE__ */ s.jsx(
|
|
3520
3514
|
"button",
|
|
3521
3515
|
{
|
|
3522
3516
|
className: "menu-button gtm-trackable",
|
|
@@ -3538,15 +3532,15 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3538
3532
|
{
|
|
3539
3533
|
ref: h,
|
|
3540
3534
|
id: "navigation",
|
|
3541
|
-
hidden:
|
|
3535
|
+
hidden: d.navigation || o.account ? !1 : !o.navigation,
|
|
3542
3536
|
role: "menu",
|
|
3543
|
-
"data-showing": !
|
|
3537
|
+
"data-showing": !d.navigation && o.account ? "account" : "default",
|
|
3544
3538
|
children: pt.order.map((p) => /* @__PURE__ */ s.jsx(
|
|
3545
3539
|
gt,
|
|
3546
3540
|
{
|
|
3547
3541
|
id: p,
|
|
3548
3542
|
isLoggedIn: i,
|
|
3549
|
-
isDesktopVersion:
|
|
3543
|
+
isDesktopVersion: d.navigation,
|
|
3550
3544
|
menus: { navigation: o.navigation, account: o.account },
|
|
3551
3545
|
callback: c
|
|
3552
3546
|
},
|
|
@@ -3554,7 +3548,7 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3554
3548
|
))
|
|
3555
3549
|
}
|
|
3556
3550
|
),
|
|
3557
|
-
!
|
|
3551
|
+
!d.search && /* @__PURE__ */ s.jsx(
|
|
3558
3552
|
"button",
|
|
3559
3553
|
{
|
|
3560
3554
|
className: "search toggle-search-button",
|
|
@@ -3580,7 +3574,7 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3580
3574
|
id: "global-search",
|
|
3581
3575
|
handleToggle: {
|
|
3582
3576
|
searchIsOpen: o.search,
|
|
3583
|
-
isDesktopVersion:
|
|
3577
|
+
isDesktopVersion: d.search
|
|
3584
3578
|
},
|
|
3585
3579
|
gtmContext: "search-bar-header",
|
|
3586
3580
|
gtmEvent: "form-submission"
|
|
@@ -3623,7 +3617,7 @@ const Or = { height: 67, height_desktop: 83 }, Xn = ({ showNavigation: e = !0 })
|
|
|
3623
3617
|
"div",
|
|
3624
3618
|
{
|
|
3625
3619
|
className: S("overlay", {
|
|
3626
|
-
open: o.navigation || o.account || !
|
|
3620
|
+
open: o.navigation || o.account || !d.search && o.search
|
|
3627
3621
|
})
|
|
3628
3622
|
}
|
|
3629
3623
|
)
|
|
@@ -3643,17 +3637,17 @@ const Kn = ({
|
|
|
3643
3637
|
showDivider: n = !0,
|
|
3644
3638
|
maxWidth: r,
|
|
3645
3639
|
functions: { onOpen: i = () => {
|
|
3646
|
-
}, onClose:
|
|
3640
|
+
}, onClose: d = () => {
|
|
3647
3641
|
} } = {},
|
|
3648
3642
|
forceShow: { error: u = !1 } = {},
|
|
3649
3643
|
title: a,
|
|
3650
|
-
children:
|
|
3644
|
+
children: l,
|
|
3651
3645
|
buttons: o,
|
|
3652
3646
|
className: m = "",
|
|
3653
3647
|
gtmContext: c = "Modal"
|
|
3654
3648
|
}) => {
|
|
3655
3649
|
const h = D(), [p, g] = P(t), b = (E) => {
|
|
3656
|
-
g(E), E ? (i(), document.body.classList.add("has-overlay")) : (
|
|
3650
|
+
g(E), E ? (i(), document.body.classList.add("has-overlay")) : (d(), document.body.classList.remove("has-overlay"));
|
|
3657
3651
|
};
|
|
3658
3652
|
G(() => {
|
|
3659
3653
|
b(t);
|
|
@@ -3684,7 +3678,7 @@ const Kn = ({
|
|
|
3684
3678
|
)
|
|
3685
3679
|
] }),
|
|
3686
3680
|
n && /* @__PURE__ */ s.jsx(Ue, {}),
|
|
3687
|
-
|
|
3681
|
+
l,
|
|
3688
3682
|
o && /* @__PURE__ */ s.jsxs("div", { className: "bottom", children: [
|
|
3689
3683
|
/* @__PURE__ */ s.jsx(Ue, {}),
|
|
3690
3684
|
/* @__PURE__ */ s.jsx(kt, { buttons: o })
|
|
@@ -3704,10 +3698,10 @@ const ao = ({
|
|
|
3704
3698
|
title: n,
|
|
3705
3699
|
formTitle: r = "Know someone who might like to join this workshop?",
|
|
3706
3700
|
formLabel: i = "Invite your colleagues by typing or pasting their emails below.",
|
|
3707
|
-
ctaMessage:
|
|
3701
|
+
ctaMessage: d = "Send",
|
|
3708
3702
|
showIcon: u,
|
|
3709
3703
|
onClose: a,
|
|
3710
|
-
reportError:
|
|
3704
|
+
reportError: l = () => {
|
|
3711
3705
|
},
|
|
3712
3706
|
sendInvites: o
|
|
3713
3707
|
}) => /* @__PURE__ */ s.jsx(
|
|
@@ -3724,10 +3718,10 @@ const ao = ({
|
|
|
3724
3718
|
{
|
|
3725
3719
|
title: r,
|
|
3726
3720
|
label: i,
|
|
3727
|
-
ctaMessage:
|
|
3721
|
+
ctaMessage: d,
|
|
3728
3722
|
onClose: a,
|
|
3729
3723
|
sendInvites: o,
|
|
3730
|
-
reportError:
|
|
3724
|
+
reportError: l
|
|
3731
3725
|
}
|
|
3732
3726
|
)
|
|
3733
3727
|
}
|
|
@@ -3750,11 +3744,11 @@ const Qr = () => {
|
|
|
3750
3744
|
additionalContent: { prepended: t, appended: n } = {},
|
|
3751
3745
|
reportError: r,
|
|
3752
3746
|
forceShow: i = {},
|
|
3753
|
-
styling:
|
|
3747
|
+
styling: d = {},
|
|
3754
3748
|
className: u = "",
|
|
3755
3749
|
locale: a = "en"
|
|
3756
3750
|
}) => {
|
|
3757
|
-
const { navigation:
|
|
3751
|
+
const { navigation: l = !0, footer: o = !0 } = i, { background: m = "default", variant: c = "default", circle: h = "default" } = d, p = Ls();
|
|
3758
3752
|
G(() => {
|
|
3759
3753
|
window.scrollTo(0, 0);
|
|
3760
3754
|
}, [p]);
|
|
@@ -3769,7 +3763,7 @@ const Qr = () => {
|
|
|
3769
3763
|
id: "wrapper",
|
|
3770
3764
|
className: S(u, E, { "has-footer": o }),
|
|
3771
3765
|
children: [
|
|
3772
|
-
/* @__PURE__ */ s.jsx(Xn, { showNavigation:
|
|
3766
|
+
/* @__PURE__ */ s.jsx(Xn, { showNavigation: l }),
|
|
3773
3767
|
/* @__PURE__ */ s.jsxs("section", { id: "content-wrapper", children: [
|
|
3774
3768
|
b && /* @__PURE__ */ s.jsx("div", { className: "additional-content prepended", children: b }),
|
|
3775
3769
|
C.createElement(m === "bold" ? Zn : "div", {
|
|
@@ -3820,26 +3814,26 @@ const oo = ({
|
|
|
3820
3814
|
forceOneLine: n = !1,
|
|
3821
3815
|
canHaveLinks: r = !0,
|
|
3822
3816
|
className: i = "",
|
|
3823
|
-
gtmType:
|
|
3817
|
+
gtmType: d = "tag-click",
|
|
3824
3818
|
gtmContext: u = "tags"
|
|
3825
3819
|
}) => {
|
|
3826
3820
|
const a = D();
|
|
3827
3821
|
if (!e || e.length < 1)
|
|
3828
3822
|
return null;
|
|
3829
|
-
const
|
|
3823
|
+
const l = [];
|
|
3830
3824
|
return e.forEach((o) => {
|
|
3831
3825
|
if (!o)
|
|
3832
3826
|
return;
|
|
3833
3827
|
const m = Ur.getTagDetails(o);
|
|
3834
|
-
m &&
|
|
3835
|
-
}),
|
|
3828
|
+
m && l.push(m);
|
|
3829
|
+
}), l.length < 1 ? null : /* @__PURE__ */ s.jsx("ul", { className: S("tags text-small", t, i, { "one-line": n }), children: l.map((o) => {
|
|
3836
3830
|
const m = a.formatMessage({ id: o.text });
|
|
3837
3831
|
return /* @__PURE__ */ s.jsx("li", { children: o.href && r ? /* @__PURE__ */ s.jsx(
|
|
3838
3832
|
"a",
|
|
3839
3833
|
{
|
|
3840
3834
|
href: o.href,
|
|
3841
3835
|
className: "gtm-trackable",
|
|
3842
|
-
"data-gtm-event-type":
|
|
3836
|
+
"data-gtm-event-type": d,
|
|
3843
3837
|
"data-gtm-event-context": u,
|
|
3844
3838
|
children: m
|
|
3845
3839
|
}
|
|
@@ -3847,31 +3841,34 @@ const oo = ({
|
|
|
3847
3841
|
}) });
|
|
3848
3842
|
};
|
|
3849
3843
|
const io = ({
|
|
3850
|
-
members: {
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3844
|
+
members: { data: e = [], total: t = e.length },
|
|
3845
|
+
hasNextPage: n = !1,
|
|
3846
|
+
loadNextPage: r = () => {
|
|
3847
|
+
},
|
|
3848
|
+
gtmContext: i = "member",
|
|
3849
|
+
gtmType: d = "member-click",
|
|
3850
|
+
className: u = ""
|
|
3855
3851
|
}) => {
|
|
3856
|
-
const
|
|
3857
|
-
return
|
|
3852
|
+
const a = D();
|
|
3853
|
+
return e.length === 0 ? null : /* @__PURE__ */ s.jsxs("div", { className: S("members-list", u), children: [
|
|
3858
3854
|
/* @__PURE__ */ s.jsxs("h1", { children: [
|
|
3859
|
-
|
|
3860
|
-
/* @__PURE__ */ s.jsx("span", { className: "count", children:
|
|
3855
|
+
a.formatMessage({ id: "membersList" }),
|
|
3856
|
+
/* @__PURE__ */ s.jsx("span", { className: "count", children: t })
|
|
3861
3857
|
] }),
|
|
3862
|
-
/* @__PURE__ */ s.jsx("ul", { children:
|
|
3863
|
-
/* @__PURE__ */ s.jsx(tn, { member:
|
|
3864
|
-
|
|
3865
|
-
] },
|
|
3858
|
+
/* @__PURE__ */ s.jsx("ul", { children: e.map((l, o) => /* @__PURE__ */ s.jsxs("li", { children: [
|
|
3859
|
+
/* @__PURE__ */ s.jsx(tn, { member: l, gtmContext: i, gtmType: d }),
|
|
3860
|
+
l.isAdmin && /* @__PURE__ */ s.jsx(ft, { children: a.formatMessage({ id: "membersList_admin" }) })
|
|
3861
|
+
] }, o)) }),
|
|
3866
3862
|
n && /* @__PURE__ */ s.jsx(
|
|
3867
3863
|
Er,
|
|
3868
3864
|
{
|
|
3869
|
-
|
|
3865
|
+
hasNextPage: n,
|
|
3866
|
+
loadNextPage: r,
|
|
3870
3867
|
icon: { icon: "arrow-down", position: "right" },
|
|
3871
|
-
gtmContext:
|
|
3868
|
+
gtmContext: i
|
|
3872
3869
|
}
|
|
3873
3870
|
)
|
|
3874
|
-
] })
|
|
3871
|
+
] });
|
|
3875
3872
|
};
|
|
3876
3873
|
let ct = null;
|
|
3877
3874
|
const ve = "discussion_form_", qn = ({
|
|
@@ -3885,7 +3882,7 @@ const ve = "discussion_form_", qn = ({
|
|
|
3885
3882
|
},
|
|
3886
3883
|
inputRef: r,
|
|
3887
3884
|
maxLength: i = 5e4,
|
|
3888
|
-
minRows:
|
|
3885
|
+
minRows: d = 4,
|
|
3889
3886
|
forceShow: u = {
|
|
3890
3887
|
cancel: !1,
|
|
3891
3888
|
error: !1
|
|
@@ -3903,7 +3900,7 @@ const ve = "discussion_form_", qn = ({
|
|
|
3903
3900
|
create: { projectNames: ["questions-answers"] }
|
|
3904
3901
|
}
|
|
3905
3902
|
},
|
|
3906
|
-
gtmContext:
|
|
3903
|
+
gtmContext: l = "DiscussionForm"
|
|
3907
3904
|
}) => {
|
|
3908
3905
|
var H, F;
|
|
3909
3906
|
const o = D(), m = je($e), [c, h] = P(
|
|
@@ -4000,7 +3997,7 @@ const ve = "discussion_form_", qn = ({
|
|
|
4000
3997
|
size: { mobile: "small", 600: "medium" },
|
|
4001
3998
|
onClick: a.handleCancel,
|
|
4002
3999
|
className: "gtm-trackable",
|
|
4003
|
-
"data-gtm-event-context":
|
|
4000
|
+
"data-gtm-event-context": l,
|
|
4004
4001
|
"data-gtm-event-type": `cancel-${e.type}-click`,
|
|
4005
4002
|
disabled: !u.cancel && (!m || !m.id || !c),
|
|
4006
4003
|
children: o.formatMessage({ id: `${ve}cancel` })
|
|
@@ -4017,7 +4014,7 @@ const ve = "discussion_form_", qn = ({
|
|
|
4017
4014
|
T(x);
|
|
4018
4015
|
},
|
|
4019
4016
|
className: "gtm-trackable",
|
|
4020
|
-
"data-gtm-event-context":
|
|
4017
|
+
"data-gtm-event-context": l,
|
|
4021
4018
|
"data-gtm-event-type": `${n.isEditing ? "save" : "submit"}-${e.type}-click`,
|
|
4022
4019
|
"data-testid": "save-button",
|
|
4023
4020
|
disabled: !m || !m.id || !t || R || J || n.isEditing && c === n.isEditing.text,
|
|
@@ -4038,7 +4035,7 @@ const ve = "discussion_form_", qn = ({
|
|
|
4038
4035
|
tn,
|
|
4039
4036
|
{
|
|
4040
4037
|
member: m || "community",
|
|
4041
|
-
gtmContext:
|
|
4038
|
+
gtmContext: l,
|
|
4042
4039
|
gtmType: "profile-click"
|
|
4043
4040
|
}
|
|
4044
4041
|
),
|
|
@@ -4060,7 +4057,7 @@ const ve = "discussion_form_", qn = ({
|
|
|
4060
4057
|
maxLength: i,
|
|
4061
4058
|
"aria-invalid": !!p,
|
|
4062
4059
|
"aria-errormessage": "error-message",
|
|
4063
|
-
minRows:
|
|
4060
|
+
minRows: d,
|
|
4064
4061
|
autoFocus: !!n.isEditing
|
|
4065
4062
|
}
|
|
4066
4063
|
),
|
|
@@ -4071,7 +4068,7 @@ const ve = "discussion_form_", qn = ({
|
|
|
4071
4068
|
href: "https://about.apolitical.co/q-and-a-community-guidelines",
|
|
4072
4069
|
target: "_blank",
|
|
4073
4070
|
className: "gtm-trackable",
|
|
4074
|
-
"data-gtm-event-context":
|
|
4071
|
+
"data-gtm-event-context": l,
|
|
4075
4072
|
"data-gtm-event-type": "community-guidelines-link",
|
|
4076
4073
|
rel: "noreferrer",
|
|
4077
4074
|
children: x
|
|
@@ -4095,14 +4092,14 @@ const ve = "discussion_form_", qn = ({
|
|
|
4095
4092
|
}, nn = ({
|
|
4096
4093
|
contentType: e,
|
|
4097
4094
|
createPost: t,
|
|
4098
|
-
membershipRequiredToPost: { isMember: n, required: r, join: i, leave:
|
|
4095
|
+
membershipRequiredToPost: { isMember: n, required: r, join: i, leave: d, notMemberStateText: u }
|
|
4099
4096
|
}) => r && !n ? /* @__PURE__ */ s.jsx(
|
|
4100
4097
|
yt,
|
|
4101
4098
|
{
|
|
4102
4099
|
text: u,
|
|
4103
4100
|
button: {
|
|
4104
4101
|
breakpoints: { mobile: !0, 901: !1 },
|
|
4105
|
-
component: /* @__PURE__ */ s.jsx(Wn, { isShort: !0, functions: { join: i, leave:
|
|
4102
|
+
component: /* @__PURE__ */ s.jsx(Wn, { isShort: !0, functions: { join: i, leave: d } })
|
|
4106
4103
|
}
|
|
4107
4104
|
}
|
|
4108
4105
|
) : /* @__PURE__ */ s.jsx(
|
|
@@ -4140,10 +4137,10 @@ const Ht = () => {
|
|
|
4140
4137
|
peopleWhoLiked: n = !1,
|
|
4141
4138
|
isShort: r = !0,
|
|
4142
4139
|
userLiked: i = !1,
|
|
4143
|
-
content:
|
|
4140
|
+
content: d = { type: "reply", slugs: {} },
|
|
4144
4141
|
canLike: u = !0,
|
|
4145
4142
|
functions: { createLike: a = () => {
|
|
4146
|
-
}, deleteLike:
|
|
4143
|
+
}, deleteLike: l = () => {
|
|
4147
4144
|
} } = {}
|
|
4148
4145
|
}) => {
|
|
4149
4146
|
const o = D();
|
|
@@ -4162,9 +4159,9 @@ const Ht = () => {
|
|
|
4162
4159
|
let N = h ? m - 1 : m + 1;
|
|
4163
4160
|
N < 0 && (N = 0), b(!0), c(N), p(!h);
|
|
4164
4161
|
try {
|
|
4165
|
-
if (
|
|
4166
|
-
const R = Vr(
|
|
4167
|
-
h ? await
|
|
4162
|
+
if (d && d.slugs) {
|
|
4163
|
+
const R = Vr(d.slugs);
|
|
4164
|
+
h ? await l(R) : await a(R, { contentPath: window.location.pathname });
|
|
4168
4165
|
}
|
|
4169
4166
|
} catch {
|
|
4170
4167
|
c(t), p(i);
|
|
@@ -4199,13 +4196,13 @@ const Ht = () => {
|
|
|
4199
4196
|
className: S({ "do-animation": h && !i }),
|
|
4200
4197
|
screenreaderText: u ? o.formatMessage({
|
|
4201
4198
|
id: `discussion_likes_${h ? "unlike" : "like"}`
|
|
4202
|
-
}, { action: o.formatMessage({ id: `discussion_action_${
|
|
4199
|
+
}, { action: o.formatMessage({ id: `discussion_action_${d.type}` }) }) : !1,
|
|
4203
4200
|
onClick: _,
|
|
4204
4201
|
disabled: !u,
|
|
4205
4202
|
"aria-hidden": !u,
|
|
4206
4203
|
"data-testid": "like-button",
|
|
4207
4204
|
"data-gtm-event-context": "Likes",
|
|
4208
|
-
"data-gtm-event-type": `like-${
|
|
4205
|
+
"data-gtm-event-type": `like-${d.type}-click`
|
|
4209
4206
|
}
|
|
4210
4207
|
),
|
|
4211
4208
|
/* @__PURE__ */ s.jsx("span", { className: S("number-of-likes", { "no-likes": m === 0 }), "data-testid": "number-of-likes", children: o.formatMessage({ id: `discussion_likes${r ? "_short" : ""}` }, { number: m }) }),
|
|
@@ -4236,7 +4233,7 @@ const De = "discussion_", Jr = 280, St = ({
|
|
|
4236
4233
|
isLoading: r = !1,
|
|
4237
4234
|
originalAuthorId: i,
|
|
4238
4235
|
functions: {
|
|
4239
|
-
content: { createContent:
|
|
4236
|
+
content: { createContent: d, deleteContent: u, updateContent: a } = {
|
|
4240
4237
|
createContent: () => {
|
|
4241
4238
|
},
|
|
4242
4239
|
deleteContent: () => {
|
|
@@ -4244,7 +4241,7 @@ const De = "discussion_", Jr = 280, St = ({
|
|
|
4244
4241
|
updateContent: () => {
|
|
4245
4242
|
}
|
|
4246
4243
|
},
|
|
4247
|
-
likes: { createLike:
|
|
4244
|
+
likes: { createLike: l, deleteLike: o } = { createLike: () => {
|
|
4248
4245
|
}, deleteLike: () => {
|
|
4249
4246
|
} },
|
|
4250
4247
|
comments: { openComments: m } = { openComments: () => {
|
|
@@ -4378,7 +4375,7 @@ const De = "discussion_", Jr = 280, St = ({
|
|
|
4378
4375
|
) : !1
|
|
4379
4376
|
},
|
|
4380
4377
|
functions: {
|
|
4381
|
-
create:
|
|
4378
|
+
create: d,
|
|
4382
4379
|
handleSaveEdit: ae,
|
|
4383
4380
|
handleCancel: () => {
|
|
4384
4381
|
O(""), T({ ..._, isEditing: !1 });
|
|
@@ -4424,7 +4421,7 @@ const De = "discussion_", Jr = 280, St = ({
|
|
|
4424
4421
|
canLike: re,
|
|
4425
4422
|
peopleWhoLiked: t.peopleWhoLiked,
|
|
4426
4423
|
functions: {
|
|
4427
|
-
createLike:
|
|
4424
|
+
createLike: l,
|
|
4428
4425
|
deleteLike: o
|
|
4429
4426
|
}
|
|
4430
4427
|
}
|
|
@@ -4547,18 +4544,18 @@ const Wt = "discussion_responses_", co = ({ type: e = "answer", responses: t = 0
|
|
|
4547
4544
|
] });
|
|
4548
4545
|
};
|
|
4549
4546
|
const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
4550
|
-
const r = D(), i = de(null),
|
|
4547
|
+
const r = D(), i = de(null), d = je(Et), [u, a] = P(
|
|
4551
4548
|
"closed"
|
|
4552
4549
|
/* Closed */
|
|
4553
4550
|
);
|
|
4554
4551
|
G(() => {
|
|
4555
4552
|
const c = i.current;
|
|
4556
4553
|
if (c)
|
|
4557
|
-
return c.addEventListener("transitionend",
|
|
4558
|
-
c.removeEventListener("transitionend",
|
|
4554
|
+
return c.addEventListener("transitionend", l), () => {
|
|
4555
|
+
c.removeEventListener("transitionend", l);
|
|
4559
4556
|
};
|
|
4560
4557
|
}, []), He(() => {
|
|
4561
|
-
u === "closed" && !
|
|
4558
|
+
u === "closed" && !d.showThread || a(
|
|
4562
4559
|
[
|
|
4563
4560
|
"opening",
|
|
4564
4561
|
"open"
|
|
@@ -4566,13 +4563,13 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4566
4563
|
].includes(u) ? "ready-to-close" : "opening"
|
|
4567
4564
|
/* Opening */
|
|
4568
4565
|
);
|
|
4569
|
-
}, [
|
|
4566
|
+
}, [d.showThread]), G(() => {
|
|
4570
4567
|
u === "ready-to-close" && a(
|
|
4571
4568
|
"closing"
|
|
4572
4569
|
/* Closing */
|
|
4573
4570
|
);
|
|
4574
4571
|
}, [u]);
|
|
4575
|
-
const
|
|
4572
|
+
const l = ({ propertyName: c }) => {
|
|
4576
4573
|
c === "max-height" && a((h) => h === "opening" ? "open" : h === "closing" ? "closed" : h);
|
|
4577
4574
|
}, o = [
|
|
4578
4575
|
"opening",
|
|
@@ -4591,7 +4588,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4591
4588
|
icon: { icon: `arrow_corner-down_${o ? "left" : "right"}` },
|
|
4592
4589
|
onClick: () => {
|
|
4593
4590
|
var c;
|
|
4594
|
-
(c =
|
|
4591
|
+
(c = d.updateConversation) == null || c.call(d, (h) => ({
|
|
4595
4592
|
showThread: !h.showThread,
|
|
4596
4593
|
showForm: !1
|
|
4597
4594
|
}));
|
|
@@ -4607,7 +4604,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4607
4604
|
{
|
|
4608
4605
|
ref: i,
|
|
4609
4606
|
className: S("thread", u),
|
|
4610
|
-
hidden: !
|
|
4607
|
+
hidden: !d.showThread,
|
|
4611
4608
|
children: m
|
|
4612
4609
|
}
|
|
4613
4610
|
)
|
|
@@ -4641,11 +4638,11 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4641
4638
|
}) => ({ mutationFn: r, onMutate: async ({ content: a }) => {
|
|
4642
4639
|
if (!n)
|
|
4643
4640
|
return;
|
|
4644
|
-
const
|
|
4641
|
+
const l = Zr({ user: n, content: a, verb: "post" });
|
|
4645
4642
|
await e.cancelQueries({ queryKey: t });
|
|
4646
4643
|
const o = e.getQueryData(t);
|
|
4647
|
-
return e.setQueryData(t, (m) => [...m,
|
|
4648
|
-
}, onError: (a,
|
|
4644
|
+
return e.setQueryData(t, (m) => [...m, l]), { previousActivities: o };
|
|
4645
|
+
}, onError: (a, l, o) => {
|
|
4649
4646
|
e.setQueryData(t, o.previousActivities);
|
|
4650
4647
|
}, onSettled: () => {
|
|
4651
4648
|
e.invalidateQueries({ queryKey: t });
|
|
@@ -4662,11 +4659,11 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4662
4659
|
if (a.length === 0)
|
|
4663
4660
|
return;
|
|
4664
4661
|
await e.cancelQueries({ queryKey: t });
|
|
4665
|
-
const
|
|
4662
|
+
const l = e.getQueryData(t), o = l == null ? void 0 : l.map((m) => ((m == null ? void 0 : m.id) === (u == null ? void 0 : u.activityId) && (m.content = a), m));
|
|
4666
4663
|
return e.setQueryData(t, () => o && [...o]), { previousActivities: o };
|
|
4667
4664
|
},
|
|
4668
|
-
onError: (u, a,
|
|
4669
|
-
e.setQueryData(t,
|
|
4665
|
+
onError: (u, a, l) => {
|
|
4666
|
+
e.setQueryData(t, l.previousActivities);
|
|
4670
4667
|
},
|
|
4671
4668
|
onSettled: () => {
|
|
4672
4669
|
e.invalidateQueries({ queryKey: t });
|
|
@@ -4677,15 +4674,15 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4677
4674
|
mutationFn: n
|
|
4678
4675
|
}) => ({ mutationFn: n, onMutate: async ({ activityId: u }) => {
|
|
4679
4676
|
await e.cancelQueries({ queryKey: t });
|
|
4680
|
-
const a = e.getQueryData(t),
|
|
4677
|
+
const a = e.getQueryData(t), l = a == null ? void 0 : a.filter(
|
|
4681
4678
|
(o) => (o == null ? void 0 : o.id) !== u
|
|
4682
4679
|
);
|
|
4683
|
-
return e.setQueryData(t, () =>
|
|
4684
|
-
}, onError: (u, a,
|
|
4685
|
-
e.setQueryData(t,
|
|
4686
|
-
}, onSettled: (u, a,
|
|
4680
|
+
return e.setQueryData(t, () => l && [...l]), { previousActivities: l };
|
|
4681
|
+
}, onError: (u, a, l) => {
|
|
4682
|
+
e.setQueryData(t, l.previousActivities);
|
|
4683
|
+
}, onSettled: (u, a, l) => {
|
|
4687
4684
|
e.invalidateQueries({
|
|
4688
|
-
queryKey: [...t,
|
|
4685
|
+
queryKey: [...t, l.activityId]
|
|
4689
4686
|
});
|
|
4690
4687
|
} }), ta = ({
|
|
4691
4688
|
queryClient: e,
|
|
@@ -4693,20 +4690,20 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4693
4690
|
mutationFn: n
|
|
4694
4691
|
}) => ({ mutationFn: n, onMutate: async ({ activityId: a }) => {
|
|
4695
4692
|
await e.cancelQueries({ queryKey: t });
|
|
4696
|
-
const
|
|
4693
|
+
const l = e.getQueryData(t), o = l == null ? void 0 : l.map((m) => {
|
|
4697
4694
|
var c;
|
|
4698
4695
|
return (m == null ? void 0 : m.id) === a && ((c = m.reaction_counts) != null && c.like ? m.reaction_counts.like += 1 : m.reaction_counts.like = 1), m;
|
|
4699
4696
|
});
|
|
4700
4697
|
return e.setQueryData(t, () => o && [...o]), { previousActivities: o };
|
|
4701
|
-
}, onError: (a,
|
|
4698
|
+
}, onError: (a, l, o) => {
|
|
4702
4699
|
e.setQueryData(t, o.previousActivities);
|
|
4703
4700
|
}, onSuccess: (a) => {
|
|
4704
|
-
const
|
|
4701
|
+
const l = e.getQueryData(t), o = l == null ? void 0 : l.map((m) => {
|
|
4705
4702
|
var c, h;
|
|
4706
4703
|
return (m == null ? void 0 : m.id) === (a == null ? void 0 : a.activity_id) && ((c = m.own_reactions) != null && c.like ? m.own_reactions.like.push(a) : m.own_reactions.like = [a], (h = m.latest_reactions) != null && h.like ? m.latest_reactions.like.push(a) : m.own_reactions.like = [a]), m;
|
|
4707
4704
|
});
|
|
4708
|
-
return e.setQueryData(t, () => o && [...o]), { previousActivities:
|
|
4709
|
-
}, onSettled: (a,
|
|
4705
|
+
return e.setQueryData(t, () => o && [...o]), { previousActivities: l };
|
|
4706
|
+
}, onSettled: (a, l, o) => {
|
|
4710
4707
|
e.invalidateQueries({
|
|
4711
4708
|
queryKey: [...t, o.activityId]
|
|
4712
4709
|
});
|
|
@@ -4715,16 +4712,16 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4715
4712
|
queryKey: t,
|
|
4716
4713
|
user: n,
|
|
4717
4714
|
mutationFn: r
|
|
4718
|
-
}) => ({ mutationFn: r, onMutate: async ({ activityId:
|
|
4715
|
+
}) => ({ mutationFn: r, onMutate: async ({ activityId: l }) => {
|
|
4719
4716
|
await e.cancelQueries({ queryKey: t });
|
|
4720
4717
|
const o = e.getQueryData(t), m = o == null ? void 0 : o.map((c) => {
|
|
4721
4718
|
var h;
|
|
4722
|
-
return (c == null ? void 0 : c.id) ===
|
|
4719
|
+
return (c == null ? void 0 : c.id) === l && (h = c.reaction_counts) != null && h.like && (c.reaction_counts.like -= 1), c;
|
|
4723
4720
|
});
|
|
4724
4721
|
return e.setQueryData(t, () => m && [...m]), { previousActivities: m };
|
|
4725
|
-
}, onError: (
|
|
4722
|
+
}, onError: (l, o, m) => {
|
|
4726
4723
|
e.setQueryData(t, m.previousActivities);
|
|
4727
|
-
}, onSuccess: (
|
|
4724
|
+
}, onSuccess: (l, { activityId: o }) => {
|
|
4728
4725
|
const m = e.getQueryData(t), c = m == null ? void 0 : m.map((h) => {
|
|
4729
4726
|
var p, g, b, v, E;
|
|
4730
4727
|
if (h.id === o) {
|
|
@@ -4740,7 +4737,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4740
4737
|
return h;
|
|
4741
4738
|
});
|
|
4742
4739
|
return e.setQueryData(t, () => c && [...c]), { previousActivities: m };
|
|
4743
|
-
}, onSettled: (
|
|
4740
|
+
}, onSettled: (l, o, m) => {
|
|
4744
4741
|
e.invalidateQueries({
|
|
4745
4742
|
queryKey: [...t, m.activityId]
|
|
4746
4743
|
});
|
|
@@ -4748,7 +4745,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4748
4745
|
basePath: e,
|
|
4749
4746
|
parentId: t,
|
|
4750
4747
|
isMember: n,
|
|
4751
|
-
functions: { list: r, create: i, edit:
|
|
4748
|
+
functions: { list: r, create: i, edit: d, remove: u, like: a, unlike: l, join: o, leave: m }
|
|
4752
4749
|
}) => {
|
|
4753
4750
|
const c = D(), h = wt(), p = je($e), {
|
|
4754
4751
|
data: g,
|
|
@@ -4766,7 +4763,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4766
4763
|
}), { mutate: _ } = ie(j), T = qr({
|
|
4767
4764
|
queryClient: h,
|
|
4768
4765
|
queryKey: [e, t],
|
|
4769
|
-
mutationFn: async (w) => await
|
|
4766
|
+
mutationFn: async (w) => await d(w)
|
|
4770
4767
|
}), {
|
|
4771
4768
|
mutate: N
|
|
4772
4769
|
} = ie(T), R = ea({
|
|
@@ -4792,7 +4789,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4792
4789
|
)), Z = (ae = (re = (se = V == null ? void 0 : V.own_reactions) == null ? void 0 : se.like) == null ? void 0 : re.find(
|
|
4793
4790
|
(q) => q.user_id === (p == null ? void 0 : p.id)
|
|
4794
4791
|
)) == null ? void 0 : ae.id;
|
|
4795
|
-
await
|
|
4792
|
+
await l({ reactionId: Z || "", activityId: w });
|
|
4796
4793
|
}
|
|
4797
4794
|
}), {
|
|
4798
4795
|
mutate: x
|
|
@@ -4887,17 +4884,17 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4887
4884
|
mutationFn: n
|
|
4888
4885
|
}) => ({ mutationFn: n, onMutate: async () => {
|
|
4889
4886
|
await e.cancelQueries({ queryKey: t });
|
|
4890
|
-
}, onError: (a,
|
|
4887
|
+
}, onError: (a, l, o) => {
|
|
4891
4888
|
e.setQueryData(t, o.previousActivity);
|
|
4892
4889
|
}, onSuccess: (a) => {
|
|
4893
4890
|
var o;
|
|
4894
|
-
const
|
|
4895
|
-
if (
|
|
4896
|
-
return (o =
|
|
4897
|
-
reply:
|
|
4898
|
-
})) : (
|
|
4899
|
-
...
|
|
4900
|
-
})), { previousActivity:
|
|
4891
|
+
const l = e.getQueryData(t);
|
|
4892
|
+
if (l)
|
|
4893
|
+
return (o = l == null ? void 0 : l.latest_reactions) != null && o.reply ? (l.latest_reactions.reply.unshift(a), l && (l.reaction_counts = {
|
|
4894
|
+
reply: l.latest_reactions.reply.length
|
|
4895
|
+
})) : (l.latest_reactions = { reply: [a] }, l.reaction_counts = { reply: 1 }), e.setQueryData(t, () => ({
|
|
4896
|
+
...l
|
|
4897
|
+
})), { previousActivity: l };
|
|
4901
4898
|
}, onSettled: () => {
|
|
4902
4899
|
e.invalidateQueries({ queryKey: t });
|
|
4903
4900
|
} }), ra = ({
|
|
@@ -4907,7 +4904,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4907
4904
|
}) => ({
|
|
4908
4905
|
mutationFn: n,
|
|
4909
4906
|
onMutate: async ({
|
|
4910
|
-
replyInfo:
|
|
4907
|
+
replyInfo: d,
|
|
4911
4908
|
content: { body: u }
|
|
4912
4909
|
}) => {
|
|
4913
4910
|
var o, m, c;
|
|
@@ -4917,33 +4914,33 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4917
4914
|
const a = e.getQueryData(t);
|
|
4918
4915
|
if (!a || !((o = a == null ? void 0 : a.latest_reactions) != null && o.reply))
|
|
4919
4916
|
return;
|
|
4920
|
-
const
|
|
4917
|
+
const l = (c = (m = a == null ? void 0 : a.latest_reactions) == null ? void 0 : m.reply) == null ? void 0 : c.map((h) => (h.id === d.replySlug && (h.data.content = u), h));
|
|
4921
4918
|
return e.setQueryData(t, () => ({
|
|
4922
4919
|
...a,
|
|
4923
|
-
latest_reactions: { reply:
|
|
4920
|
+
latest_reactions: { reply: l }
|
|
4924
4921
|
})), { previousActivity: a };
|
|
4925
4922
|
},
|
|
4926
|
-
onError: (
|
|
4923
|
+
onError: (d, u, a) => {
|
|
4927
4924
|
e.setQueryData(t, a.previousActivity);
|
|
4928
4925
|
}
|
|
4929
4926
|
}), aa = ({
|
|
4930
4927
|
queryClient: e,
|
|
4931
4928
|
queryKey: t,
|
|
4932
4929
|
mutationFn: n
|
|
4933
|
-
}) => ({ mutationFn: n, onMutate: async ({ replyId:
|
|
4934
|
-
var
|
|
4930
|
+
}) => ({ mutationFn: n, onMutate: async ({ replyId: d }) => {
|
|
4931
|
+
var l, o, m;
|
|
4935
4932
|
await e.cancelQueries({ queryKey: t });
|
|
4936
4933
|
const u = e.getQueryData(t);
|
|
4937
|
-
if (!u || !((
|
|
4934
|
+
if (!u || !((l = u == null ? void 0 : u.latest_reactions) != null && l.reply))
|
|
4938
4935
|
return;
|
|
4939
4936
|
const a = (m = (o = u == null ? void 0 : u.latest_reactions) == null ? void 0 : o.reply) == null ? void 0 : m.filter(
|
|
4940
|
-
(c) => c.id !==
|
|
4937
|
+
(c) => c.id !== d
|
|
4941
4938
|
);
|
|
4942
4939
|
return e.setQueryData(t, () => ({
|
|
4943
4940
|
...u,
|
|
4944
4941
|
latest_reactions: { reply: a }
|
|
4945
4942
|
})), { previousActivity: u };
|
|
4946
|
-
}, onError: (
|
|
4943
|
+
}, onError: (d, u, a) => {
|
|
4947
4944
|
e.setQueryData(t, a.previousActivity);
|
|
4948
4945
|
} }), oa = ({
|
|
4949
4946
|
queryClient: e,
|
|
@@ -4952,25 +4949,25 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4952
4949
|
}) => ({ mutationFn: n, onMutate: async ({ replyId: u }) => {
|
|
4953
4950
|
var o, m;
|
|
4954
4951
|
await e.cancelQueries({ queryKey: t });
|
|
4955
|
-
const a = e.getQueryData(t),
|
|
4952
|
+
const a = e.getQueryData(t), l = (m = (o = a == null ? void 0 : a.latest_reactions) == null ? void 0 : o.reply) == null ? void 0 : m.map((c) => {
|
|
4956
4953
|
var h;
|
|
4957
4954
|
return c.id === u && ((h = c.children_counts) != null && h.like ? c.children_counts.like += 1 : c.children_counts = { like: 1 }), c;
|
|
4958
4955
|
});
|
|
4959
4956
|
return e.setQueryData(t, () => ({
|
|
4960
4957
|
...a,
|
|
4961
|
-
latest_reactions: { reply:
|
|
4958
|
+
latest_reactions: { reply: l }
|
|
4962
4959
|
})), { previousActivity: a };
|
|
4963
|
-
}, onError: (u, a,
|
|
4964
|
-
e.setQueryData(t,
|
|
4960
|
+
}, onError: (u, a, l) => {
|
|
4961
|
+
e.setQueryData(t, l.previousActivity);
|
|
4965
4962
|
}, onSuccess: (u) => {
|
|
4966
4963
|
var o;
|
|
4967
|
-
const a = e.getQueryData(t),
|
|
4964
|
+
const a = e.getQueryData(t), l = (o = a == null ? void 0 : a.latest_reactions.reply) == null ? void 0 : o.map((m) => {
|
|
4968
4965
|
var c, h;
|
|
4969
4966
|
return m.id === u.id && ((c = m.own_children) != null && c.like ? m.own_children.like.push(u) : m.own_children = { like: [u] }, (h = m.latest_children) != null && h.like ? m.latest_children.like.push(u) : m.latest_children = { like: [u] }), m;
|
|
4970
4967
|
});
|
|
4971
4968
|
return e.setQueryData(t, () => ({
|
|
4972
4969
|
...a,
|
|
4973
|
-
latest_reactions: { reply:
|
|
4970
|
+
latest_reactions: { reply: l }
|
|
4974
4971
|
})), { previousActivity: a };
|
|
4975
4972
|
} }), ia = ({
|
|
4976
4973
|
queryClient: e,
|
|
@@ -4980,24 +4977,24 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
4980
4977
|
}) => ({ mutationFn: r, onMutate: async ({ replyId: a }) => {
|
|
4981
4978
|
var m;
|
|
4982
4979
|
await e.cancelQueries({ queryKey: t });
|
|
4983
|
-
const
|
|
4984
|
-
if (!
|
|
4980
|
+
const l = e.getQueryData(t);
|
|
4981
|
+
if (!l)
|
|
4985
4982
|
return;
|
|
4986
|
-
const o = (m =
|
|
4983
|
+
const o = (m = l.latest_reactions.reply) == null ? void 0 : m.map((c) => (c.id === a && c.children_counts.like && (c.children_counts.like -= 1), c));
|
|
4987
4984
|
return e.setQueryData(t, () => ({
|
|
4988
|
-
...
|
|
4985
|
+
...l,
|
|
4989
4986
|
latest_reactions: { reply: o }
|
|
4990
|
-
})), { previousActivity:
|
|
4991
|
-
}, onError: (a,
|
|
4987
|
+
})), { previousActivity: l };
|
|
4988
|
+
}, onError: (a, l, o) => {
|
|
4992
4989
|
e.setQueryData(t, o.previousActivity);
|
|
4993
|
-
}, onSuccess: (a, { replyId:
|
|
4990
|
+
}, onSuccess: (a, { replyId: l }) => {
|
|
4994
4991
|
var c;
|
|
4995
4992
|
const o = e.getQueryData(t);
|
|
4996
4993
|
if (!o)
|
|
4997
4994
|
return;
|
|
4998
4995
|
const m = (c = o.latest_reactions.reply) == null ? void 0 : c.map((h) => {
|
|
4999
4996
|
var p, g, b;
|
|
5000
|
-
if (h.id ===
|
|
4997
|
+
if (h.id === l) {
|
|
5001
4998
|
let v = (p = h.latest_children.reply) == null ? void 0 : p.filter(
|
|
5002
4999
|
(E) => E.user_id !== (n == null ? void 0 : n.id)
|
|
5003
5000
|
);
|
|
@@ -5022,13 +5019,13 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5022
5019
|
},
|
|
5023
5020
|
onSuccess: (a) => {
|
|
5024
5021
|
var m;
|
|
5025
|
-
const
|
|
5022
|
+
const l = e.getQueryData(t), o = (m = l == null ? void 0 : l.latest_reactions.reply) == null ? void 0 : m.map((c) => (c.id === a.parent && (c.latest_children.reply && c.children_counts.reply ? (c.latest_children.reply.push(a), c.children_counts.reply += 1) : (c.latest_children.reply = [a], c.children_counts.reply = 1)), c));
|
|
5026
5023
|
return e.setQueryData(t, () => ({
|
|
5027
|
-
...
|
|
5024
|
+
...l,
|
|
5028
5025
|
latest_reactions: { reply: o }
|
|
5029
|
-
})), { previousActivity:
|
|
5026
|
+
})), { previousActivity: l };
|
|
5030
5027
|
},
|
|
5031
|
-
onError: (a,
|
|
5028
|
+
onError: (a, l, o) => {
|
|
5032
5029
|
e.setQueryData(t, o.previousActivity);
|
|
5033
5030
|
},
|
|
5034
5031
|
onSettled: () => {
|
|
@@ -5038,10 +5035,10 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5038
5035
|
queryClient: e,
|
|
5039
5036
|
queryKey: t,
|
|
5040
5037
|
mutationFn: n
|
|
5041
|
-
}) => ({ mutationFn: n, onError: (
|
|
5038
|
+
}) => ({ mutationFn: n, onError: (d, u, a) => {
|
|
5042
5039
|
e.setQueryData(t, a.previousActivity);
|
|
5043
5040
|
}, onMutate: async ({
|
|
5044
|
-
replyInfo:
|
|
5041
|
+
replyInfo: d,
|
|
5045
5042
|
content: { body: u }
|
|
5046
5043
|
}) => {
|
|
5047
5044
|
var o, m, c;
|
|
@@ -5051,22 +5048,22 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5051
5048
|
const a = e.getQueryData(t);
|
|
5052
5049
|
if (!a || !((o = a == null ? void 0 : a.latest_reactions) != null && o.reply))
|
|
5053
5050
|
return;
|
|
5054
|
-
const
|
|
5051
|
+
const l = (c = (m = a == null ? void 0 : a.latest_reactions) == null ? void 0 : m.reply) == null ? void 0 : c.map((h) => {
|
|
5055
5052
|
var p;
|
|
5056
|
-
return h.id ===
|
|
5053
|
+
return h.id === d.replyParentId && ((p = h.latest_children.reply) == null || p.map((g) => (g.id === d.replySlug && (g.data.content = u), g))), h;
|
|
5057
5054
|
});
|
|
5058
5055
|
return e.setQueryData(t, () => ({
|
|
5059
5056
|
...a,
|
|
5060
|
-
latest_reactions: { reply:
|
|
5057
|
+
latest_reactions: { reply: l }
|
|
5061
5058
|
})), { previousActivity: a };
|
|
5062
5059
|
} }), da = ({
|
|
5063
5060
|
queryClient: e,
|
|
5064
5061
|
queryKey: t,
|
|
5065
5062
|
mutationFn: n
|
|
5066
|
-
}) => ({ mutationFn: n, onError: (
|
|
5063
|
+
}) => ({ mutationFn: n, onError: (d, u, a) => {
|
|
5067
5064
|
e.setQueryData(t, a.previousActivity);
|
|
5068
5065
|
}, onMutate: async ({
|
|
5069
|
-
replyId:
|
|
5066
|
+
replyId: d,
|
|
5070
5067
|
replyParentId: u
|
|
5071
5068
|
}) => {
|
|
5072
5069
|
var o, m, c;
|
|
@@ -5074,15 +5071,15 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5074
5071
|
const a = e.getQueryData(t);
|
|
5075
5072
|
if (!a || !((o = a == null ? void 0 : a.latest_reactions) != null && o.reply))
|
|
5076
5073
|
return;
|
|
5077
|
-
const
|
|
5074
|
+
const l = (c = (m = a == null ? void 0 : a.latest_reactions) == null ? void 0 : m.reply) == null ? void 0 : c.map((h) => {
|
|
5078
5075
|
var p, g;
|
|
5079
5076
|
return h.id === u && (h.latest_children.reply = (p = h.latest_children.reply) == null ? void 0 : p.filter(
|
|
5080
|
-
(b) => b.id !==
|
|
5077
|
+
(b) => b.id !== d
|
|
5081
5078
|
), (g = h.children_counts) != null && g.reply && (h.children_counts.reply -= 1)), h;
|
|
5082
5079
|
});
|
|
5083
5080
|
return e.setQueryData(t, () => ({
|
|
5084
5081
|
...a,
|
|
5085
|
-
latest_reactions: { reply:
|
|
5082
|
+
latest_reactions: { reply: l }
|
|
5086
5083
|
})), { previousActivity: a };
|
|
5087
5084
|
} }), ua = ({
|
|
5088
5085
|
queryClient: e,
|
|
@@ -5094,7 +5091,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5094
5091
|
}) => {
|
|
5095
5092
|
var m;
|
|
5096
5093
|
await e.cancelQueries({ queryKey: t });
|
|
5097
|
-
const
|
|
5094
|
+
const l = e.getQueryData(t), o = (m = l == null ? void 0 : l.latest_reactions.reply) == null ? void 0 : m.map((c) => {
|
|
5098
5095
|
var h;
|
|
5099
5096
|
return c.id === a && ((h = c.latest_children.reply) == null || h.map((p) => {
|
|
5100
5097
|
var g;
|
|
@@ -5102,21 +5099,21 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5102
5099
|
})), c;
|
|
5103
5100
|
});
|
|
5104
5101
|
return e.setQueryData(t, () => ({
|
|
5105
|
-
...
|
|
5102
|
+
...l,
|
|
5106
5103
|
latest_reactions: { reply: o }
|
|
5107
|
-
})), { previousActivity:
|
|
5108
|
-
}, onError: (u, a,
|
|
5109
|
-
e.setQueryData(t,
|
|
5104
|
+
})), { previousActivity: l };
|
|
5105
|
+
}, onError: (u, a, l) => {
|
|
5106
|
+
e.setQueryData(t, l.previousActivity);
|
|
5110
5107
|
}, onSuccess: (u, a) => {
|
|
5111
5108
|
var m;
|
|
5112
|
-
const
|
|
5109
|
+
const l = e.getQueryData(t), o = (m = l == null ? void 0 : l.latest_reactions.reply) == null ? void 0 : m.map((c) => {
|
|
5113
5110
|
var h;
|
|
5114
5111
|
return c.id === a.replyParentId && ((h = c.latest_children.reply) == null || h.map((p) => (p.id === a.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(u), p.own_children.like.push(u)), p))), c;
|
|
5115
5112
|
});
|
|
5116
5113
|
return e.setQueryData(t, () => ({
|
|
5117
|
-
...
|
|
5114
|
+
...l,
|
|
5118
5115
|
latest_reactions: { reply: o }
|
|
5119
|
-
})), { previousActivity:
|
|
5116
|
+
})), { previousActivity: l };
|
|
5120
5117
|
} }), ma = ({
|
|
5121
5118
|
queryClient: e,
|
|
5122
5119
|
queryKey: t,
|
|
@@ -5124,13 +5121,13 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5124
5121
|
user: r
|
|
5125
5122
|
}) => ({ mutationFn: n, onMutate: async ({
|
|
5126
5123
|
replyId: a,
|
|
5127
|
-
replyParentId:
|
|
5124
|
+
replyParentId: l
|
|
5128
5125
|
}) => {
|
|
5129
5126
|
var c;
|
|
5130
5127
|
await e.cancelQueries({ queryKey: t });
|
|
5131
5128
|
const o = e.getQueryData(t), m = (c = o == null ? void 0 : o.latest_reactions.reply) == null ? void 0 : c.map((h) => {
|
|
5132
5129
|
var p;
|
|
5133
|
-
return h.id ===
|
|
5130
|
+
return h.id === l && ((p = h.latest_children.reply) == null || p.map((g) => {
|
|
5134
5131
|
var b;
|
|
5135
5132
|
return g.id === a && ((b = g.children_counts) != null && b.like ? g.children_counts.like -= 1 : g.children_counts = { like: 0 }), g;
|
|
5136
5133
|
})), h;
|
|
@@ -5139,15 +5136,15 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5139
5136
|
...o,
|
|
5140
5137
|
latest_reactions: { reply: m }
|
|
5141
5138
|
})), { previousActivity: o };
|
|
5142
|
-
}, onError: (a,
|
|
5139
|
+
}, onError: (a, l, o) => {
|
|
5143
5140
|
e.setQueryData(t, o.previousActivity);
|
|
5144
|
-
}, onSuccess: (a,
|
|
5141
|
+
}, onSuccess: (a, l) => {
|
|
5145
5142
|
var c;
|
|
5146
5143
|
const o = e.getQueryData(t), m = (c = o == null ? void 0 : o.latest_reactions.reply) == null ? void 0 : c.map((h) => {
|
|
5147
5144
|
var p;
|
|
5148
|
-
return h.id ===
|
|
5145
|
+
return h.id === l.replyParentId && ((p = h.latest_children.reply) == null || p.map((g) => {
|
|
5149
5146
|
var b, v;
|
|
5150
|
-
return g.id ===
|
|
5147
|
+
return g.id === l.replyId && ((b = g.own_children) != null && b.like && (g.own_children.like = g.own_children.like.filter(
|
|
5151
5148
|
(E) => E.user_id !== (r == null ? void 0 : r.id)
|
|
5152
5149
|
)), (v = g.latest_children) != null && v.like && (g.latest_children.like = g.latest_children.like.filter(
|
|
5153
5150
|
(E) => E.user_id !== (r == null ? void 0 : r.id)
|
|
@@ -5164,8 +5161,8 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5164
5161
|
replyParentId: n,
|
|
5165
5162
|
activityId: r,
|
|
5166
5163
|
replyCount: i,
|
|
5167
|
-
replies:
|
|
5168
|
-
functions: { create: u, edit: a, remove:
|
|
5164
|
+
replies: d,
|
|
5165
|
+
functions: { create: u, edit: a, remove: l, join: o, leave: m, like: c, unlike: h }
|
|
5169
5166
|
}) => {
|
|
5170
5167
|
const p = D(), g = wt(), b = je($e), v = je(Et), E = ca({
|
|
5171
5168
|
queryClient: g,
|
|
@@ -5180,7 +5177,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5180
5177
|
} = ie(_), N = da({
|
|
5181
5178
|
queryClient: g,
|
|
5182
5179
|
queryKey: [e, t, r],
|
|
5183
|
-
mutationFn: async ({ replyId: k }) =>
|
|
5180
|
+
mutationFn: async ({ replyId: k }) => l({ replyId: k })
|
|
5184
5181
|
}), {
|
|
5185
5182
|
mutate: R
|
|
5186
5183
|
} = ie(N), J = ua({
|
|
@@ -5223,7 +5220,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5223
5220
|
}
|
|
5224
5221
|
}
|
|
5225
5222
|
),
|
|
5226
|
-
(
|
|
5223
|
+
(d == null ? void 0 : d.length) === 0 || (d == null ? void 0 : d.map((k) => {
|
|
5227
5224
|
var w, V, Z, se, re, ae, q, fe, ue, L, oe, he, ce, xe, pe, be, ge;
|
|
5228
5225
|
return /* @__PURE__ */ s.jsx(
|
|
5229
5226
|
St,
|
|
@@ -5295,12 +5292,12 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5295
5292
|
activityId: n,
|
|
5296
5293
|
repliesList: r,
|
|
5297
5294
|
isMember: i,
|
|
5298
|
-
functions: { create:
|
|
5295
|
+
functions: { create: d, edit: u, remove: a, like: l, unlike: o, join: m, leave: c }
|
|
5299
5296
|
}) => {
|
|
5300
5297
|
const h = D(), p = wt(), g = je($e), b = sa({
|
|
5301
5298
|
queryClient: p,
|
|
5302
5299
|
queryKey: [e, t, n],
|
|
5303
|
-
mutationFn: async (x) =>
|
|
5300
|
+
mutationFn: async (x) => d({ activityId: n, content: x.body })
|
|
5304
5301
|
}), { mutate: v } = ie(b), E = ra({
|
|
5305
5302
|
queryClient: p,
|
|
5306
5303
|
queryKey: [e, t, n],
|
|
@@ -5316,7 +5313,7 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5316
5313
|
} = ie(_), N = oa({
|
|
5317
5314
|
queryClient: p,
|
|
5318
5315
|
queryKey: [e, t, n],
|
|
5319
|
-
mutationFn:
|
|
5316
|
+
mutationFn: l
|
|
5320
5317
|
}), {
|
|
5321
5318
|
mutate: R
|
|
5322
5319
|
} = ie(N), J = ia({
|
|
@@ -5414,10 +5411,10 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5414
5411
|
replies: (le = x == null ? void 0 : x.latest_children) == null ? void 0 : le.reply,
|
|
5415
5412
|
isMember: i,
|
|
5416
5413
|
functions: {
|
|
5417
|
-
create:
|
|
5414
|
+
create: d,
|
|
5418
5415
|
edit: u,
|
|
5419
5416
|
remove: a,
|
|
5420
|
-
like:
|
|
5417
|
+
like: l,
|
|
5421
5418
|
unlike: o,
|
|
5422
5419
|
join: m,
|
|
5423
5420
|
leave: c
|
|
@@ -5442,13 +5439,13 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5442
5439
|
if (a.length === 0)
|
|
5443
5440
|
return;
|
|
5444
5441
|
await e.cancelQueries({ queryKey: t });
|
|
5445
|
-
const
|
|
5446
|
-
return
|
|
5447
|
-
...
|
|
5448
|
-
})), { previousActivity:
|
|
5442
|
+
const l = e.getQueryData(t);
|
|
5443
|
+
return l && l.id === (u == null ? void 0 : u.activityId) && (l.content = a), e.setQueryData(t, () => ({
|
|
5444
|
+
...l
|
|
5445
|
+
})), { previousActivity: l };
|
|
5449
5446
|
},
|
|
5450
|
-
onError: (u, a,
|
|
5451
|
-
e.setQueryData(t,
|
|
5447
|
+
onError: (u, a, l) => {
|
|
5448
|
+
e.setQueryData(t, l.previousActivity);
|
|
5452
5449
|
},
|
|
5453
5450
|
onSettled: () => {
|
|
5454
5451
|
e.invalidateQueries({ queryKey: t });
|
|
@@ -5465,19 +5462,19 @@ const Xr = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5465
5462
|
queryKey: t,
|
|
5466
5463
|
mutationFn: n
|
|
5467
5464
|
}) => ({ mutationFn: n, onMutate: async () => {
|
|
5468
|
-
var
|
|
5465
|
+
var l;
|
|
5469
5466
|
await e.cancelQueries({ queryKey: t });
|
|
5470
5467
|
const a = e.getQueryData(t);
|
|
5471
|
-
return (
|
|
5468
|
+
return (l = a == null ? void 0 : a.reaction_counts) != null && l.like ? a.reaction_counts.like += 1 : a && (a.reaction_counts = { like: 1 }), e.setQueryData(t, () => ({
|
|
5472
5469
|
...a
|
|
5473
5470
|
})), { previousActivity: a };
|
|
5474
|
-
}, onError: (a,
|
|
5471
|
+
}, onError: (a, l, o) => {
|
|
5475
5472
|
e.setQueryData(t, o.previousActivity);
|
|
5476
5473
|
}, onSuccess: (a) => {
|
|
5477
|
-
const
|
|
5478
|
-
return
|
|
5479
|
-
...
|
|
5480
|
-
})), { previousActivity:
|
|
5474
|
+
const l = e.getQueryData(t);
|
|
5475
|
+
return l != null && l.own_reactions.like ? l.own_reactions.like.push(a) : l && (l.own_reactions = { like: [a] }), l != null && l.latest_reactions.like ? l.latest_reactions.like.push(a) : l && (l.own_reactions = { like: [a] }), e.setQueryData(t, () => ({
|
|
5476
|
+
...l
|
|
5477
|
+
})), { previousActivity: l };
|
|
5481
5478
|
}, onSettled: () => {
|
|
5482
5479
|
e.invalidateQueries({ queryKey: t });
|
|
5483
5480
|
} }), xa = ({
|
|
@@ -5520,10 +5517,10 @@ const uo = ({
|
|
|
5520
5517
|
isMember: r,
|
|
5521
5518
|
functions: {
|
|
5522
5519
|
get: i,
|
|
5523
|
-
editActivity:
|
|
5520
|
+
editActivity: d,
|
|
5524
5521
|
removeActivity: u,
|
|
5525
5522
|
likeActivity: a,
|
|
5526
|
-
unlikeActivity:
|
|
5523
|
+
unlikeActivity: l,
|
|
5527
5524
|
createReply: o,
|
|
5528
5525
|
editReply: m,
|
|
5529
5526
|
removeReply: c,
|
|
@@ -5544,7 +5541,7 @@ const uo = ({
|
|
|
5544
5541
|
}), R = pa({
|
|
5545
5542
|
queryClient: j,
|
|
5546
5543
|
queryKey: [e, t, n],
|
|
5547
|
-
mutationFn: async (te) => await
|
|
5544
|
+
mutationFn: async (te) => await d(te)
|
|
5548
5545
|
}), {
|
|
5549
5546
|
mutate: J
|
|
5550
5547
|
} = ie(R), O = ga({
|
|
@@ -5567,7 +5564,7 @@ const uo = ({
|
|
|
5567
5564
|
const te = (tt = (Le = (Ee = _ == null ? void 0 : _.own_reactions) == null ? void 0 : Ee.like) == null ? void 0 : Le.find(
|
|
5568
5565
|
(nt) => nt.user_id === (E == null ? void 0 : E.id)
|
|
5569
5566
|
)) == null ? void 0 : tt.id;
|
|
5570
|
-
await
|
|
5567
|
+
await l({ activityId: n, reactionId: te });
|
|
5571
5568
|
},
|
|
5572
5569
|
activity: _
|
|
5573
5570
|
}), {
|
|
@@ -5680,10 +5677,10 @@ const uo = ({
|
|
|
5680
5677
|
const n = D(), {
|
|
5681
5678
|
answers: r,
|
|
5682
5679
|
createdAt: i,
|
|
5683
|
-
dateHasPassed:
|
|
5680
|
+
dateHasPassed: d,
|
|
5684
5681
|
isOngoingEvent: u,
|
|
5685
5682
|
pill: a,
|
|
5686
|
-
readingTime:
|
|
5683
|
+
readingTime: l,
|
|
5687
5684
|
publishedDate: o,
|
|
5688
5685
|
startDate: m
|
|
5689
5686
|
} = t;
|
|
@@ -5707,7 +5704,7 @@ const uo = ({
|
|
|
5707
5704
|
] })
|
|
5708
5705
|
] });
|
|
5709
5706
|
}
|
|
5710
|
-
if (m && !
|
|
5707
|
+
if (m && !d || u)
|
|
5711
5708
|
return /* @__PURE__ */ s.jsx("p", { className: "details", children: u ? n.formatMessage({ id: "card_bootcamp" }) : Rn(m) });
|
|
5712
5709
|
if (a)
|
|
5713
5710
|
return /* @__PURE__ */ s.jsx(
|
|
@@ -5719,10 +5716,10 @@ const uo = ({
|
|
|
5719
5716
|
children: a
|
|
5720
5717
|
}
|
|
5721
5718
|
);
|
|
5722
|
-
if (
|
|
5719
|
+
if (l || o) {
|
|
5723
5720
|
const c = o && Gt(o);
|
|
5724
5721
|
return /* @__PURE__ */ s.jsxs("ul", { className: "details", children: [
|
|
5725
|
-
|
|
5722
|
+
l && /* @__PURE__ */ s.jsx("li", { "data-testid": "reading-time", children: n.formatMessage({ id: "card_time_read" }, { time: l }) }),
|
|
5726
5723
|
o && /* @__PURE__ */ s.jsx("li", { "data-testid": "published-date", children: n.formatMessage(
|
|
5727
5724
|
{ id: "card_time_ago" },
|
|
5728
5725
|
{
|
|
@@ -5794,16 +5791,16 @@ const uo = ({
|
|
|
5794
5791
|
}
|
|
5795
5792
|
}, wa = ({ data: e, cta: t, link: n, gtmContext: r }) => {
|
|
5796
5793
|
var g;
|
|
5797
|
-
const i = D(), [
|
|
5794
|
+
const i = D(), [d, u] = P({
|
|
5798
5795
|
loading: !1,
|
|
5799
5796
|
registered: e.registered || !1
|
|
5800
5797
|
});
|
|
5801
5798
|
G(() => {
|
|
5802
5799
|
e.registered && u((b) => ({ ...b, registered: !0 }));
|
|
5803
5800
|
}, [e.registered]);
|
|
5804
|
-
const { startDate: a, dateHasPassed:
|
|
5801
|
+
const { startDate: a, dateHasPassed: l, pill: o, slug: m } = e, c = e.contentType;
|
|
5805
5802
|
let h = "";
|
|
5806
|
-
if ((g = _t[c]) != null && g.gtmEvent && (h = _t[c].gtmEvent), a &&
|
|
5803
|
+
if ((g = _t[c]) != null && g.gtmEvent && (h = _t[c].gtmEvent), a && l)
|
|
5807
5804
|
return /* @__PURE__ */ s.jsx(
|
|
5808
5805
|
"a",
|
|
5809
5806
|
{
|
|
@@ -5829,7 +5826,7 @@ const uo = ({
|
|
|
5829
5826
|
);
|
|
5830
5827
|
const p = ["microcourse", "event"];
|
|
5831
5828
|
if (t && t.onClick && p.includes(c) && o !== "premium") {
|
|
5832
|
-
const b =
|
|
5829
|
+
const b = d.loading || d.registered, v = async (E) => {
|
|
5833
5830
|
if (E.preventDefault(), E.stopPropagation(), !(b || !t || !t.onClick)) {
|
|
5834
5831
|
u((j) => ({ ...j, loading: !0 }));
|
|
5835
5832
|
try {
|
|
@@ -5852,7 +5849,7 @@ const uo = ({
|
|
|
5852
5849
|
"data-gtm-event-type": `${r}-${c}-register-click`,
|
|
5853
5850
|
"data-testid": "in-card-button",
|
|
5854
5851
|
children: i.formatMessage({
|
|
5855
|
-
id: `card_cta_${c}${b ? `_${
|
|
5852
|
+
id: `card_cta_${c}${b ? `_${d.loading ? "loading" : "done"}` : ""}`
|
|
5856
5853
|
})
|
|
5857
5854
|
}
|
|
5858
5855
|
);
|
|
@@ -5879,13 +5876,13 @@ const ka = {
|
|
|
5879
5876
|
buildCardData: n,
|
|
5880
5877
|
cta: r,
|
|
5881
5878
|
gtmContext: i = "Carousel",
|
|
5882
|
-
className:
|
|
5879
|
+
className: d = ""
|
|
5883
5880
|
}) => {
|
|
5884
|
-
const u = D(), a = je($e),
|
|
5881
|
+
const u = D(), a = je($e), l = a && typeof a.id == "string", [o, m] = P({
|
|
5885
5882
|
data: null,
|
|
5886
5883
|
isLoading: !0
|
|
5887
5884
|
}), { data: c, isLoading: h } = o, p = Me(() => {
|
|
5888
|
-
n(t,
|
|
5885
|
+
n(t, l).then((O) => {
|
|
5889
5886
|
m(() => ({ data: O, isLoading: !1 }));
|
|
5890
5887
|
}).catch(() => m((O) => ({ ...O, isLoading: !1 })));
|
|
5891
5888
|
}, [e]);
|
|
@@ -5921,7 +5918,7 @@ const ka = {
|
|
|
5921
5918
|
return /* @__PURE__ */ s.jsx(
|
|
5922
5919
|
"li",
|
|
5923
5920
|
{
|
|
5924
|
-
className: S("card-wrapper text-medium", v,
|
|
5921
|
+
className: S("card-wrapper text-medium", v, d, {
|
|
5925
5922
|
"has-link": T,
|
|
5926
5923
|
"no-link": !T,
|
|
5927
5924
|
"has-custom-icon": c.customIcon,
|
|
@@ -5982,13 +5979,13 @@ const ka = {
|
|
|
5982
5979
|
}
|
|
5983
5980
|
);
|
|
5984
5981
|
};
|
|
5985
|
-
const ya = ({ cards: e, cardTypes: t, className: n = "", ...r }) => /* @__PURE__ */ s.jsx("ul", { className: S("card-block", n), children: e.map((i,
|
|
5986
|
-
const u = i.slug ? `${i.slug}-${t[
|
|
5982
|
+
const ya = ({ cards: e, cardTypes: t, className: n = "", ...r }) => /* @__PURE__ */ s.jsx("ul", { className: S("card-block", n), children: e.map((i, d) => {
|
|
5983
|
+
const u = i.slug ? `${i.slug}-${t[d]}` : `${t[d]}-${d}`;
|
|
5987
5984
|
return /* @__PURE__ */ s.jsx(
|
|
5988
5985
|
ja,
|
|
5989
5986
|
{
|
|
5990
5987
|
id: u,
|
|
5991
|
-
card: { ...i, contentType: t[
|
|
5988
|
+
card: { ...i, contentType: t[d] },
|
|
5992
5989
|
...r
|
|
5993
5990
|
},
|
|
5994
5991
|
u
|