@apolitical/component-library 1.17.3 → 1.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { useIntl as P, IntlProvider as Ts, createIntl as Ms, FormattedMessage as
|
|
|
5
5
|
import Qe from "truncate";
|
|
6
6
|
import { QueryClient as Cs, QueryClientProvider as Ns, useMutation as se, useQueryClient as jt, useInfiniteQuery as Ps, useQuery as Ds } from "@tanstack/react-query";
|
|
7
7
|
import { ReactQueryDevtools as Rs } from "@tanstack/react-query-devtools";
|
|
8
|
-
import
|
|
8
|
+
import ht from "posthog-js";
|
|
9
9
|
import { CookiesProvider as As, useCookies as Fs } from "react-cookie";
|
|
10
10
|
import yt from "markdown-to-jsx";
|
|
11
11
|
import { ReactMultiEmail as Ls } from "react-multi-email";
|
|
@@ -380,7 +380,7 @@ function Vs() {
|
|
|
380
380
|
} else
|
|
381
381
|
ze.setExtraStackFrame(null);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function st(f, j, S, C, H) {
|
|
384
384
|
{
|
|
385
385
|
var W = Function.call.bind(ve);
|
|
386
386
|
for (var B in f)
|
|
@@ -409,19 +409,19 @@ function Vs() {
|
|
|
409
409
|
return S;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function rt(f) {
|
|
413
413
|
try {
|
|
414
|
-
return
|
|
414
|
+
return at(f), !1;
|
|
415
415
|
} catch {
|
|
416
416
|
return !0;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function at(f) {
|
|
420
420
|
return "" + f;
|
|
421
421
|
}
|
|
422
422
|
function cn(f) {
|
|
423
|
-
if (
|
|
424
|
-
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ie(f)),
|
|
423
|
+
if (rt(f))
|
|
424
|
+
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ie(f)), at(f);
|
|
425
425
|
}
|
|
426
426
|
var Ve = y.ReactCurrentOwner, cs = {
|
|
427
427
|
key: !0,
|
|
@@ -618,7 +618,7 @@ Check the top-level render call using <` + S + ">.");
|
|
|
618
618
|
return;
|
|
619
619
|
if (S) {
|
|
620
620
|
var C = k(j);
|
|
621
|
-
|
|
621
|
+
st(S, f.props, "prop", C, f);
|
|
622
622
|
} else if (j.PropTypes !== void 0 && !Dt) {
|
|
623
623
|
Dt = !0;
|
|
624
624
|
var H = k(j);
|
|
@@ -756,7 +756,7 @@ function Ln(e, t, n) {
|
|
|
756
756
|
return Gs(e, t, { maxWait: t, leading: o === void 0 || o, trailing: i === void 0 || i });
|
|
757
757
|
}
|
|
758
758
|
let At;
|
|
759
|
-
const
|
|
759
|
+
const tt = (e = !0, t = !1, n = "window") => {
|
|
760
760
|
if (!e)
|
|
761
761
|
return;
|
|
762
762
|
const [r, o] = D.useState(0) || [!1, () => {
|
|
@@ -1227,7 +1227,7 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1227
1227
|
return t.forEach(({ type: r, value: o }) => {
|
|
1228
1228
|
Ss(n, r, o);
|
|
1229
1229
|
}), n;
|
|
1230
|
-
}, ir = (e) => new Promise((t) => setTimeout(t, e)),
|
|
1230
|
+
}, ir = (e) => new Promise((t) => setTimeout(t, e)), pt = (e, t) => D.Children.map(e, (n) => D.cloneElement(n, {
|
|
1231
1231
|
...t
|
|
1232
1232
|
})), Q = ({
|
|
1233
1233
|
variant: e = "primary",
|
|
@@ -1243,7 +1243,7 @@ Thank you for helping to protect the Apolitical community from abusive content.`
|
|
|
1243
1243
|
children: m = !1,
|
|
1244
1244
|
...d
|
|
1245
1245
|
}) => {
|
|
1246
|
-
const h =
|
|
1246
|
+
const h = tt(typeof t == "object");
|
|
1247
1247
|
if (typeof t == "object" && typeof h == "number") {
|
|
1248
1248
|
const v = Object.assign({}, t), y = In(Object.keys(v));
|
|
1249
1249
|
t = On(h, y, v);
|
|
@@ -1668,10 +1668,10 @@ const lo = ({
|
|
|
1668
1668
|
e && /* @__PURE__ */ s.jsx(Rs, { initialIsOpen: !1 })
|
|
1669
1669
|
] });
|
|
1670
1670
|
};
|
|
1671
|
-
var hr = nn({ client:
|
|
1671
|
+
var hr = nn({ client: ht });
|
|
1672
1672
|
function pr(e) {
|
|
1673
1673
|
var t = e.children, n = e.client, r = e.apiKey, o = e.options, i = kt(function() {
|
|
1674
|
-
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 && o && 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 && (
|
|
1674
|
+
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 && o && 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 && (ht.__loaded && console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."), ht.init(r, o)), ht);
|
|
1675
1675
|
}, [n, r]);
|
|
1676
1676
|
return D.createElement(hr.Provider, { value: { client: i } }, t);
|
|
1677
1677
|
}
|
|
@@ -1711,7 +1711,7 @@ const br = ({ children: e, user: t }) => /* @__PURE__ */ s.jsx(Se.Provider, { va
|
|
|
1711
1711
|
o({ ...i, isLoading: !1 }), rr(5e3);
|
|
1712
1712
|
}).catch(() => o({ isLoading: !1 }));
|
|
1713
1713
|
}, []), /* @__PURE__ */ s.jsx(_r, { locale: n == null ? void 0 : n.locale, messages: n == null ? void 0 : n.messages, children: /* @__PURE__ */ s.jsx(As, { children: /* @__PURE__ */ s.jsx(br, { user: r, children: /* @__PURE__ */ s.jsx(fr, { children: /* @__PURE__ */ s.jsx(gr, { user: r, children: t }) }) }) }) });
|
|
1714
|
-
},
|
|
1714
|
+
}, et = "https://storage.googleapis.com/apolitical-assets/", Ze = {
|
|
1715
1715
|
general: "hello@apolitical.co",
|
|
1716
1716
|
support: "concierge@apolitical.co",
|
|
1717
1717
|
"data-protection": {
|
|
@@ -1726,7 +1726,26 @@ const Un = ({ label: e = !1, className: t = "", children: n }) => {
|
|
|
1726
1726
|
/* @__PURE__ */ s.jsx("div", { className: "content", children: n })
|
|
1727
1727
|
] });
|
|
1728
1728
|
};
|
|
1729
|
-
const Re = ({
|
|
1729
|
+
const Re = ({
|
|
1730
|
+
variant: e = "primary",
|
|
1731
|
+
icon: t,
|
|
1732
|
+
className: n = "",
|
|
1733
|
+
children: r,
|
|
1734
|
+
...o
|
|
1735
|
+
}) => {
|
|
1736
|
+
const i = t ? { "--icon": `url(${et}icons/${t}.svg)` } : {};
|
|
1737
|
+
return /* @__PURE__ */ s.jsx(
|
|
1738
|
+
"div",
|
|
1739
|
+
{
|
|
1740
|
+
className: E("highlighted-text-box", e, n, {
|
|
1741
|
+
"has-icon": t
|
|
1742
|
+
}),
|
|
1743
|
+
style: i,
|
|
1744
|
+
...o,
|
|
1745
|
+
children: r
|
|
1746
|
+
}
|
|
1747
|
+
);
|
|
1748
|
+
};
|
|
1730
1749
|
const Tt = ({
|
|
1731
1750
|
variant: e = "empty",
|
|
1732
1751
|
text: t = !1,
|
|
@@ -1734,7 +1753,7 @@ const Tt = ({
|
|
|
1734
1753
|
className: r = ""
|
|
1735
1754
|
}) => {
|
|
1736
1755
|
let o = n && !!Object.keys(n).length;
|
|
1737
|
-
const i = typeof n == "object" && "breakpoints" in n, l =
|
|
1756
|
+
const i = typeof n == "object" && "breakpoints" in n, l = tt(i);
|
|
1738
1757
|
if (i && typeof n == "object" && typeof l == "number") {
|
|
1739
1758
|
const d = Object.assign({}, n.breakpoints), p = In(Object.keys(d));
|
|
1740
1759
|
o = On(l, p, d);
|
|
@@ -1962,7 +1981,7 @@ const Lt = "loadingBlock_", Pr = ({ progress: e = 0, steps: t = !1, className: n
|
|
|
1962
1981
|
const i = Object.keys(t);
|
|
1963
1982
|
for (let a = 0; a < i.length && !(e < parseInt(i[a])); a++)
|
|
1964
1983
|
o = i[a];
|
|
1965
|
-
const l = o && t[o].icon ? { "--icon": `url(${
|
|
1984
|
+
const l = o && t[o].icon ? { "--icon": `url(${et}icons/${t[o].icon}.svg)` } : {};
|
|
1966
1985
|
return /* @__PURE__ */ s.jsxs(
|
|
1967
1986
|
Re,
|
|
1968
1987
|
{
|
|
@@ -1997,16 +2016,16 @@ const tn = {
|
|
|
1997
2016
|
}, zn = (e, t) => e in tn ? /* @__PURE__ */ s.jsx("div", { className: e, children: tn[e].map((n, r) => zn(n, r)) }, t) : /* @__PURE__ */ s.jsx($e, { className: e }, t), Vn = ({ layout: e = "overview-page", ...t }) => /* @__PURE__ */ s.jsx("div", { className: E("loading-state", e), ...t, children: tn[e].map((n, r) => zn(n, r)) }), Yn = (e) => {
|
|
1998
2017
|
const t = e && e.toUpperCase().split(" ");
|
|
1999
2018
|
return Array.isArray(t) && t.length > 1 && t[0] !== "" ? t[1] === "" ? t[0][0] : t[0][0] + t[t.length - 1][0] : e ? e.substr(0, 1) : "";
|
|
2000
|
-
},
|
|
2001
|
-
const t = Math.ceil(26 /
|
|
2019
|
+
}, ot = ["#5AB6A3", "#A2D7AF", "#806056", "#3962B3"], Dr = (e) => {
|
|
2020
|
+
const t = Math.ceil(26 / ot.length), n = Yn(e).toLowerCase();
|
|
2002
2021
|
if (n === "")
|
|
2003
|
-
return
|
|
2022
|
+
return ot[0];
|
|
2004
2023
|
const r = n.charCodeAt(0) - 96;
|
|
2005
|
-
for (let o = 0; o <
|
|
2024
|
+
for (let o = 0; o < ot.length; o++)
|
|
2006
2025
|
if (r <= t * (o + 1))
|
|
2007
|
-
return
|
|
2026
|
+
return ot[o];
|
|
2008
2027
|
};
|
|
2009
|
-
const yn = 256,
|
|
2028
|
+
const yn = 256, nt = ({
|
|
2010
2029
|
className: e = "",
|
|
2011
2030
|
src: t = "",
|
|
2012
2031
|
name: n,
|
|
@@ -2047,9 +2066,9 @@ const yn = 256, tt = ({
|
|
|
2047
2066
|
}
|
|
2048
2067
|
);
|
|
2049
2068
|
}, Gn = (e) => e === "apolitical" ? {
|
|
2050
|
-
image: `${
|
|
2069
|
+
image: `${et}logos/member_apolitical.svg`
|
|
2051
2070
|
} : e === "community" || typeof e == "object" && !e.name ? {
|
|
2052
|
-
image: `${
|
|
2071
|
+
image: `${et}logos/member_community.svg`
|
|
2053
2072
|
} : {
|
|
2054
2073
|
name: e.name,
|
|
2055
2074
|
role: e.jobTitle || "",
|
|
@@ -2093,7 +2112,7 @@ const rn = ({
|
|
|
2093
2112
|
g == null || g.stopPropagation();
|
|
2094
2113
|
},
|
|
2095
2114
|
children: [
|
|
2096
|
-
/* @__PURE__ */ s.jsx(
|
|
2115
|
+
/* @__PURE__ */ s.jsx(nt, { name: u, src: m }),
|
|
2097
2116
|
/* @__PURE__ */ s.jsxs("p", { className: "details", children: [
|
|
2098
2117
|
/* @__PURE__ */ s.jsx("strong", { children: u }),
|
|
2099
2118
|
n && /* @__PURE__ */ s.jsxs("span", { className: "additional-content", children: [
|
|
@@ -2135,7 +2154,7 @@ const En = {
|
|
|
2135
2154
|
if (l)
|
|
2136
2155
|
return /* @__PURE__ */ s.jsx($e, { element: "li", className: "contributor" }, p);
|
|
2137
2156
|
h = /* @__PURE__ */ s.jsx(
|
|
2138
|
-
|
|
2157
|
+
nt,
|
|
2139
2158
|
{
|
|
2140
2159
|
name: w,
|
|
2141
2160
|
src: v,
|
|
@@ -2351,7 +2370,7 @@ const En = {
|
|
|
2351
2370
|
star: "star_empty_thin"
|
|
2352
2371
|
}, Lr = (e) => {
|
|
2353
2372
|
let t = e;
|
|
2354
|
-
return Object.keys($n).includes(e) && (t = $n[e]), `url(${
|
|
2373
|
+
return Object.keys($n).includes(e) && (t = $n[e]), `url(${et}icons/${t}.svg)`;
|
|
2355
2374
|
};
|
|
2356
2375
|
const Ir = {
|
|
2357
2376
|
title: 66,
|
|
@@ -2432,7 +2451,7 @@ const Ir = {
|
|
|
2432
2451
|
d.registered && /* @__PURE__ */ s.jsx(gt, { size: "small", variant: "registered", children: l.formatMessage({ id: "card_registered" }) }),
|
|
2433
2452
|
/* @__PURE__ */ s.jsx(Qn, { image: d.banner })
|
|
2434
2453
|
] }) : v === "people" ? /* @__PURE__ */ s.jsx(
|
|
2435
|
-
|
|
2454
|
+
nt,
|
|
2436
2455
|
{
|
|
2437
2456
|
name: d.title || "",
|
|
2438
2457
|
src: d.profile,
|
|
@@ -2510,7 +2529,7 @@ const It = {
|
|
|
2510
2529
|
threeCards: 769,
|
|
2511
2530
|
twoCards: 480
|
|
2512
2531
|
};
|
|
2513
|
-
let
|
|
2532
|
+
let it = null;
|
|
2514
2533
|
const Qr = ({
|
|
2515
2534
|
id: e,
|
|
2516
2535
|
cards: t,
|
|
@@ -2527,7 +2546,7 @@ const Qr = ({
|
|
|
2527
2546
|
}), { cardsPerPage: m, isLoading: d } = u, [p, h] = A({
|
|
2528
2547
|
currentPage: 0,
|
|
2529
2548
|
loadedPages: [0]
|
|
2530
|
-
}), { currentPage: g, loadedPages: w } = p, v = t.length, y = Math.ceil(v / m), x = ne(null), _ =
|
|
2549
|
+
}), { currentPage: g, loadedPages: w } = p, v = t.length, y = Math.ceil(v / m), x = ne(null), _ = tt(!0, !0, x == null ? void 0 : x.current);
|
|
2531
2550
|
Y(() => {
|
|
2532
2551
|
let $ = 1;
|
|
2533
2552
|
_ && (_ >= It.fourCards ? $ = 4 : _ >= It.threeCards ? $ = 3 : _ >= It.twoCards && ($ = 2), $ > v && ($ = v)), c((M) => ({
|
|
@@ -2556,12 +2575,12 @@ const Qr = ({
|
|
|
2556
2575
|
loadedPages: [.../* @__PURE__ */ new Set([...w, M])]
|
|
2557
2576
|
}));
|
|
2558
2577
|
}, N = ($) => {
|
|
2559
|
-
|
|
2578
|
+
it = $.touches[0].clientX;
|
|
2560
2579
|
}, R = ($) => {
|
|
2561
|
-
if (
|
|
2580
|
+
if (it === null)
|
|
2562
2581
|
return;
|
|
2563
|
-
const M = $.touches[0].clientX, b =
|
|
2564
|
-
b > 5 ? T("next") : b < -5 && T("previous"),
|
|
2582
|
+
const M = $.touches[0].clientX, b = it - M;
|
|
2583
|
+
b > 5 ? T("next") : b < -5 && T("previous"), it = null;
|
|
2565
2584
|
}, V = {
|
|
2566
2585
|
"--width": `${((F = x == null ? void 0 : x.current) == null ? void 0 : F.offsetWidth) || 0}px`,
|
|
2567
2586
|
"--total-cards": v,
|
|
@@ -2809,7 +2828,7 @@ const xo = ({
|
|
|
2809
2828
|
i === "before-lang" ? r += `/${o}` : (r.includes(`/${n}/`) || (r += `/${n}`), r += `/${o}`);
|
|
2810
2829
|
}), r.includes(`/${n}/`) || (r += `/${n}`), r;
|
|
2811
2830
|
};
|
|
2812
|
-
const Ht = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
2831
|
+
const Ht = { en: "English", es: "Español", fr: "Français", pt: "Português" }, ct = "languageSwitcher_", bo = ({
|
|
2813
2832
|
currentLanguage: e,
|
|
2814
2833
|
isOriginalLanguage: t = !1,
|
|
2815
2834
|
isHumanTranslation: n = !1,
|
|
@@ -2829,12 +2848,12 @@ const Ht = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2829
2848
|
const h = Object.keys(r), g = m !== e;
|
|
2830
2849
|
return /* @__PURE__ */ s.jsxs("div", { className: E("language-switcher text-small", l, u), children: [
|
|
2831
2850
|
/* @__PURE__ */ s.jsxs("nav", { children: [
|
|
2832
|
-
l !== "short" && /* @__PURE__ */ s.jsx("p", { children: a || c.formatMessage({ id: `${
|
|
2851
|
+
l !== "short" && /* @__PURE__ */ s.jsx("p", { children: a || c.formatMessage({ id: `${ct}label` }) }),
|
|
2833
2852
|
/* @__PURE__ */ s.jsx("ul", { children: h.map((w) => {
|
|
2834
2853
|
if (!Ht[w])
|
|
2835
2854
|
return null;
|
|
2836
2855
|
let v = { className: w };
|
|
2837
|
-
return m === w ? v["aria-label"] = c.formatMessage({ id: `${
|
|
2856
|
+
return m === w ? v["aria-label"] = c.formatMessage({ id: `${ct}selected` }, { language: Ht[w] }) : v = {
|
|
2838
2857
|
...v,
|
|
2839
2858
|
href: Ur(w, i),
|
|
2840
2859
|
onClick: (y) => {
|
|
@@ -2842,13 +2861,13 @@ const Ht = { en: "English", es: "Español", fr: "Français", pt: "Português" },
|
|
|
2842
2861
|
}
|
|
2843
2862
|
}, /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsx($t, { ...v, fallbackElement: "span", children: Ht[w] }) }, w);
|
|
2844
2863
|
}) }),
|
|
2845
|
-
l !== "short" && !g && /* @__PURE__ */ s.jsx("p", { children: c.formatMessage({ id: `${
|
|
2864
|
+
l !== "short" && !g && /* @__PURE__ */ s.jsx("p", { children: c.formatMessage({ id: `${ct}translation_${t ? "original" : n ? "human" : "machine"}` }) })
|
|
2846
2865
|
] }),
|
|
2847
2866
|
l !== "short" && !g && !t && !n && /* @__PURE__ */ s.jsx("small", {
|
|
2848
2867
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2849
2868
|
// @ts-ignore
|
|
2850
2869
|
// `values` are throwing a type error: https://github.com/formatjs/formatjs/issues/3633
|
|
2851
|
-
children: c.formatMessage({ id: `${
|
|
2870
|
+
children: c.formatMessage({ id: `${ct}disclaimer` }, {
|
|
2852
2871
|
email: Ze.support,
|
|
2853
2872
|
link: (w) => {
|
|
2854
2873
|
const v = `mailto:${w}`;
|
|
@@ -2893,7 +2912,7 @@ const Qt = Ms({ locale: "en", messages: sn }), qn = ({
|
|
|
2893
2912
|
) : !l || l != null && l.includes("Cannot read items") ? /* @__PURE__ */ s.jsx("p", { children: r.endOfFeed }) : /* @__PURE__ */ s.jsx("p", { className: "error", children: r.error }) });
|
|
2894
2913
|
};
|
|
2895
2914
|
const Kn = ({ variant: e = "default", version: t = "default", className: n = "", ...r }) => /* @__PURE__ */ s.jsx("p", { className: "logo-wrapper", children: /* @__PURE__ */ s.jsx("a", { href: "/home/", className: E("logo", e, t, n), ...r, children: /* @__PURE__ */ s.jsx(ce, { children: /* @__PURE__ */ s.jsx(De, { id: "apolitical" }) }) }) });
|
|
2896
|
-
let
|
|
2915
|
+
let lt = !1;
|
|
2897
2916
|
const Wr = ({ element: e = "div", id: t = "more-menu", options: n, className: r = "" }) => {
|
|
2898
2917
|
const o = P(), i = ne(null), [l, a] = A(!1), u = (c) => {
|
|
2899
2918
|
i.current && c.target instanceof HTMLElement && !i.current.contains(c.target) && a(!1);
|
|
@@ -2924,10 +2943,10 @@ const Wr = ({ element: e = "div", id: t = "more-menu", options: n, className: r
|
|
|
2924
2943
|
a(!1), typeof m == "function" && m(v);
|
|
2925
2944
|
},
|
|
2926
2945
|
onFocus: () => {
|
|
2927
|
-
|
|
2946
|
+
lt && (clearTimeout(lt), lt = !1);
|
|
2928
2947
|
},
|
|
2929
2948
|
onBlur: () => {
|
|
2930
|
-
|
|
2949
|
+
lt = setTimeout(() => {
|
|
2931
2950
|
a(!1);
|
|
2932
2951
|
}, 100);
|
|
2933
2952
|
}
|
|
@@ -2992,7 +3011,7 @@ const Vr = [
|
|
|
2992
3011
|
className: "gtm-trackable",
|
|
2993
3012
|
children: [
|
|
2994
3013
|
/* @__PURE__ */ s.jsx(
|
|
2995
|
-
|
|
3014
|
+
nt,
|
|
2996
3015
|
{
|
|
2997
3016
|
name: (n == null ? void 0 : n.name) || "",
|
|
2998
3017
|
src: n != null && n.image ? n.image.thumbnail : ""
|
|
@@ -3145,7 +3164,7 @@ const Xr = {
|
|
|
3145
3164
|
className: n = "",
|
|
3146
3165
|
children: r
|
|
3147
3166
|
}) => {
|
|
3148
|
-
const o =
|
|
3167
|
+
const o = tt(!0);
|
|
3149
3168
|
let i = r;
|
|
3150
3169
|
return D.Children.count(r) === 1 && (i = D.Children.toArray(r)[0], i.props && (i = i.props.children)), /* @__PURE__ */ s.jsx("section", { className: E("columns", `layout-${e}`, n), children: D.Children.map(i, (l, a) => t !== !1 && a === t && o && o < Xr[e] ? null : l) });
|
|
3151
3170
|
}, ko = ({ activeLink: e, ...t }) => /* @__PURE__ */ s.jsx(St, { children: /* @__PURE__ */ s.jsx(Zr, { layout: "1-3", children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
@@ -3365,13 +3384,13 @@ const He = "footer_", xt = "SiteFooter", Sn = ({ group: e }) => {
|
|
|
3365
3384
|
/* @__PURE__ */ s.jsx("small", { children: /* @__PURE__ */ s.jsx(De, { id: `${He}copyright`, values: { currentYear: (/* @__PURE__ */ new Date()).getFullYear() } }) })
|
|
3366
3385
|
] })
|
|
3367
3386
|
] }) });
|
|
3368
|
-
const
|
|
3369
|
-
const o = P(), [i, l] = A({ path: `${
|
|
3387
|
+
const dt = "emailHelperTextBox_", jo = ({ type: e, email: t, redirectPath: n, resendVerificationCode: r }) => {
|
|
3388
|
+
const o = P(), [i, l] = A({ path: `${dt}default`, type: "default", link: {}, mail: {}, error: "" }), [a, u] = A(!1), c = Ae(
|
|
3370
3389
|
(h) => {
|
|
3371
3390
|
h.preventDefault(), h.stopPropagation();
|
|
3372
3391
|
const g = (w) => {
|
|
3373
3392
|
l({
|
|
3374
|
-
path: `${
|
|
3393
|
+
path: `${dt}error_verificationFailedToSend`,
|
|
3375
3394
|
type: "error",
|
|
3376
3395
|
link: {
|
|
3377
3396
|
"data-gtm-event-context": "VerifyEmailBox",
|
|
@@ -3391,7 +3410,7 @@ const lt = "emailHelperTextBox_", jo = ({ type: e, email: t, redirectPath: n, re
|
|
|
3391
3410
|
});
|
|
3392
3411
|
};
|
|
3393
3412
|
if (typeof r != "function") {
|
|
3394
|
-
g(o.formatMessage({ id: `${
|
|
3413
|
+
g(o.formatMessage({ id: `${dt}error_noFunction` }));
|
|
3395
3414
|
return;
|
|
3396
3415
|
}
|
|
3397
3416
|
u(!0), r(t).then(() => {
|
|
@@ -3407,7 +3426,7 @@ const lt = "emailHelperTextBox_", jo = ({ type: e, email: t, redirectPath: n, re
|
|
|
3407
3426
|
);
|
|
3408
3427
|
Y(
|
|
3409
3428
|
() => {
|
|
3410
|
-
let h =
|
|
3429
|
+
let h = dt, g = "default", w = {}, v = {};
|
|
3411
3430
|
switch (e) {
|
|
3412
3431
|
case "gov":
|
|
3413
3432
|
h += "autoApproved", g = "success";
|
|
@@ -3487,24 +3506,24 @@ const lt = "emailHelperTextBox_", jo = ({ type: e, email: t, redirectPath: n, re
|
|
|
3487
3506
|
)
|
|
3488
3507
|
) });
|
|
3489
3508
|
};
|
|
3490
|
-
const
|
|
3509
|
+
const ut = "passwordRules_", ts = "isMoreThanEightCharacters", ns = "includesNumberAndSymbol", ss = "includesLowerAndUppercase", Kr = {
|
|
3491
3510
|
[ts]: "8Characters",
|
|
3492
3511
|
[ns]: "numberSymbol",
|
|
3493
3512
|
[ss]: "lowercaseUppercase"
|
|
3494
3513
|
}, ea = ({ matchingRules: e = { isMoreThanEightCharacters: !1, includesNumberAndSymbol: !1, includesLowerAndUppercase: !1 }, className: t = "" }) => {
|
|
3495
3514
|
const n = P();
|
|
3496
3515
|
return /* @__PURE__ */ s.jsxs("aside", { className: E("password-rules", t), children: [
|
|
3497
|
-
/* @__PURE__ */ s.jsx("small", { children: n.formatMessage({ id: `${
|
|
3516
|
+
/* @__PURE__ */ s.jsx("small", { children: n.formatMessage({ id: `${ut}intro` }) }),
|
|
3498
3517
|
/* @__PURE__ */ s.jsx("ul", { children: [ts, ns, ss].map((r) => /* @__PURE__ */ s.jsxs("li", { className: E({ matches: e[r] }), children: [
|
|
3499
3518
|
/* @__PURE__ */ s.jsxs(ce, { children: [
|
|
3500
|
-
n.formatMessage({ id: `${
|
|
3519
|
+
n.formatMessage({ id: `${ut}rule_label` }),
|
|
3501
3520
|
" "
|
|
3502
3521
|
] }),
|
|
3503
|
-
/* @__PURE__ */ s.jsx("span", { children: n.formatMessage({ id: `${
|
|
3522
|
+
/* @__PURE__ */ s.jsx("span", { children: n.formatMessage({ id: `${ut}rule_${Kr[r]}` }) }),
|
|
3504
3523
|
!e[r] && /* @__PURE__ */ s.jsxs(ce, { element: "strong", children: [
|
|
3505
3524
|
" ",
|
|
3506
3525
|
" ",
|
|
3507
|
-
n.formatMessage({ id: `${
|
|
3526
|
+
n.formatMessage({ id: `${ut}notMet` })
|
|
3508
3527
|
] })
|
|
3509
3528
|
] }, `rule-${r}`)) })
|
|
3510
3529
|
] });
|
|
@@ -3971,7 +3990,7 @@ const na = ({
|
|
|
3971
3990
|
] }, e);
|
|
3972
3991
|
};
|
|
3973
3992
|
const sa = { height: 67, height_desktop: 83 }, rs = ({ showNavigation: e = !0 }) => {
|
|
3974
|
-
const t = P(), n = we(Se), r =
|
|
3993
|
+
const t = P(), n = we(Se), r = tt(!0, !0), o = n && typeof n.id == "string", i = kt(
|
|
3975
3994
|
() => U.getIsDesktopVersion(o, r),
|
|
3976
3995
|
[o, r]
|
|
3977
3996
|
), [l, a] = ys(or, {
|
|
@@ -4122,7 +4141,7 @@ const sa = { height: 67, height_desktop: 83 }, rs = ({ showNavigation: e = !0 })
|
|
|
4122
4141
|
id: `header_account_${c.account ? "hide" : "show"}`
|
|
4123
4142
|
}) }),
|
|
4124
4143
|
/* @__PURE__ */ s.jsx(
|
|
4125
|
-
|
|
4144
|
+
nt,
|
|
4126
4145
|
{
|
|
4127
4146
|
name: n && n.name || "",
|
|
4128
4147
|
src: n && n.image && n.image.thumbnail || ""
|
|
@@ -4275,9 +4294,9 @@ const aa = () => {
|
|
|
4275
4294
|
Y(() => {
|
|
4276
4295
|
window.scrollTo(0, 0);
|
|
4277
4296
|
}, [h]);
|
|
4278
|
-
const g =
|
|
4297
|
+
const g = pt(e, { locale: a }), w = pt(t, {
|
|
4279
4298
|
locale: a
|
|
4280
|
-
}), v =
|
|
4299
|
+
}), v = pt(n, {
|
|
4281
4300
|
locale: a
|
|
4282
4301
|
}), y = {};
|
|
4283
4302
|
return m !== "default" && (y[m] = !0), d !== "default" && (y[d] = !0), p !== "default" && (y[p] = !0), /* @__PURE__ */ s.jsx(Is, { onError: r, fallback: /* @__PURE__ */ s.jsx(aa, {}), children: /* @__PURE__ */ s.jsx(Es, { fallback: null, children: /* @__PURE__ */ s.jsxs(
|
|
@@ -4393,7 +4412,7 @@ const To = ({
|
|
|
4393
4412
|
)
|
|
4394
4413
|
] });
|
|
4395
4414
|
};
|
|
4396
|
-
let
|
|
4415
|
+
let mt = null;
|
|
4397
4416
|
const ge = "discussion_form_", is = ({
|
|
4398
4417
|
content: e = { type: "response", slugs: {} },
|
|
4399
4418
|
userHasPermissions: t = !0,
|
|
@@ -4462,7 +4481,7 @@ const ge = "discussion_form_", is = ({
|
|
|
4462
4481
|
var k;
|
|
4463
4482
|
if (b.preventDefault(), b.stopPropagation(), !m || !m.id || !t || R)
|
|
4464
4483
|
return;
|
|
4465
|
-
|
|
4484
|
+
mt && clearTimeout(mt), v("submitting");
|
|
4466
4485
|
const z = window.location.pathname;
|
|
4467
4486
|
try {
|
|
4468
4487
|
let I;
|
|
@@ -4492,7 +4511,7 @@ const ge = "discussion_form_", is = ({
|
|
|
4492
4511
|
default:
|
|
4493
4512
|
break;
|
|
4494
4513
|
}
|
|
4495
|
-
await ir(1e3), a.callback && await a.callback(I),
|
|
4514
|
+
await ir(1e3), a.callback && await a.callback(I), mt = setTimeout(() => {
|
|
4496
4515
|
p(""), v("submitted"), N();
|
|
4497
4516
|
}, 500);
|
|
4498
4517
|
} catch (I) {
|
|
@@ -4511,7 +4530,7 @@ const ge = "discussion_form_", is = ({
|
|
|
4511
4530
|
) : J.message.includes("400") && (X = `${ge}error`), g(X), N();
|
|
4512
4531
|
}
|
|
4513
4532
|
}, N = () => {
|
|
4514
|
-
|
|
4533
|
+
mt = setTimeout(() => {
|
|
4515
4534
|
g(!1), v(!1);
|
|
4516
4535
|
}, 5e3);
|
|
4517
4536
|
}, R = !d || !ar(d), V = w === "submitting", F = [];
|
|
@@ -5098,7 +5117,7 @@ const ha = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
|
|
|
5098
5117
|
"opening",
|
|
5099
5118
|
"open"
|
|
5100
5119
|
/* Open */
|
|
5101
|
-
].includes(l), m =
|
|
5120
|
+
].includes(l), m = pt(n, {
|
|
5102
5121
|
element: "li"
|
|
5103
5122
|
});
|
|
5104
5123
|
return /* @__PURE__ */ s.jsxs("div", { className: "thread-wrapper", children: [
|
|
@@ -6136,7 +6155,7 @@ const No = ({
|
|
|
6136
6155
|
leave: w
|
|
6137
6156
|
}
|
|
6138
6157
|
}) => {
|
|
6139
|
-
var de, ue, G, re, oe, O, me, _e, fe, ke, xe, je, be, q, ae, he, K, ie, ve, Pe, ze, Le,
|
|
6158
|
+
var de, ue, G, re, oe, O, me, _e, fe, ke, xe, je, be, q, ae, he, K, ie, ve, Pe, ze, Le, st;
|
|
6140
6159
|
const v = P(), y = we(Se), x = jt(), {
|
|
6141
6160
|
data: _,
|
|
6142
6161
|
isLoading: T,
|
|
@@ -6166,10 +6185,10 @@ const No = ({
|
|
|
6166
6185
|
queryKey: [e, t, n],
|
|
6167
6186
|
user: y,
|
|
6168
6187
|
mutationFn: async () => {
|
|
6169
|
-
var Ee, Ie,
|
|
6170
|
-
const ee = (
|
|
6171
|
-
(
|
|
6172
|
-
)) == null ? void 0 :
|
|
6188
|
+
var Ee, Ie, rt;
|
|
6189
|
+
const ee = (rt = (Ie = (Ee = _ == null ? void 0 : _.own_reactions) == null ? void 0 : Ee.like) == null ? void 0 : Ie.find(
|
|
6190
|
+
(at) => at.user_id === (y == null ? void 0 : y.id)
|
|
6191
|
+
)) == null ? void 0 : rt.id;
|
|
6173
6192
|
await u({ activityId: n, reactionId: ee });
|
|
6174
6193
|
},
|
|
6175
6194
|
activity: _
|
|
@@ -6256,7 +6275,7 @@ const No = ({
|
|
|
6256
6275
|
basePath: e,
|
|
6257
6276
|
parentId: t,
|
|
6258
6277
|
activityId: n,
|
|
6259
|
-
repliesList: (
|
|
6278
|
+
repliesList: (st = _ == null ? void 0 : _.latest_reactions) == null ? void 0 : st.reply,
|
|
6260
6279
|
isMember: r,
|
|
6261
6280
|
functions: {
|
|
6262
6281
|
create: c,
|
|
@@ -6323,10 +6342,10 @@ const No = ({
|
|
|
6323
6342
|
contributors: ["community"]
|
|
6324
6343
|
}
|
|
6325
6344
|
];
|
|
6326
|
-
const
|
|
6345
|
+
const ft = "notFoundError_", Do = () => {
|
|
6327
6346
|
const e = P(), t = [];
|
|
6328
6347
|
return Dn.forEach((n, r) => {
|
|
6329
|
-
n.title = e.formatMessage({ id: `${
|
|
6348
|
+
n.title = e.formatMessage({ id: `${ft}post_${r + 1}` }), t.push("solutionArticle");
|
|
6330
6349
|
}), /* @__PURE__ */ s.jsxs(
|
|
6331
6350
|
oa,
|
|
6332
6351
|
{
|
|
@@ -6343,21 +6362,21 @@ const mt = "notFoundError_", Do = () => {
|
|
|
6343
6362
|
})
|
|
6344
6363
|
}
|
|
6345
6364
|
),
|
|
6346
|
-
/* @__PURE__ */ s.jsx(Q, { href: "/solution-articles/", children: e.formatMessage({ id: `${
|
|
6365
|
+
/* @__PURE__ */ s.jsx(Q, { href: "/solution-articles/", children: e.formatMessage({ id: `${ft}cta` }) })
|
|
6347
6366
|
] })
|
|
6348
6367
|
},
|
|
6349
6368
|
reportError: () => {
|
|
6350
6369
|
},
|
|
6351
6370
|
className: "not-found-error",
|
|
6352
6371
|
children: [
|
|
6353
|
-
/* @__PURE__ */ s.jsx("h1", { children: e.formatMessage({ id: `${
|
|
6354
|
-
/* @__PURE__ */ s.jsx("p", { children: e.formatMessage({ id: `${
|
|
6372
|
+
/* @__PURE__ */ s.jsx("h1", { children: e.formatMessage({ id: `${ft}title` }) }),
|
|
6373
|
+
/* @__PURE__ */ s.jsx("p", { children: e.formatMessage({ id: `${ft}text` }) })
|
|
6355
6374
|
]
|
|
6356
6375
|
}
|
|
6357
6376
|
);
|
|
6358
6377
|
};
|
|
6359
6378
|
export {
|
|
6360
|
-
|
|
6379
|
+
et as ASSETS_BUCKET,
|
|
6361
6380
|
Co as ActivitiesFeed,
|
|
6362
6381
|
No as ActivitySection,
|
|
6363
6382
|
an as AddPost,
|
|
@@ -6421,7 +6440,7 @@ export {
|
|
|
6421
6440
|
oa as PageLayout,
|
|
6422
6441
|
yo as PasswordRules,
|
|
6423
6442
|
gt as Pill,
|
|
6424
|
-
|
|
6443
|
+
nt as ProfilePicture,
|
|
6425
6444
|
Nr as ProgressBar,
|
|
6426
6445
|
Eo as Rating,
|
|
6427
6446
|
Ba as RepliesFeed,
|
|
@@ -6445,7 +6464,7 @@ export {
|
|
|
6445
6464
|
rr as pageReady,
|
|
6446
6465
|
Ys as useCurrentPath,
|
|
6447
6466
|
Ue as useEffectAfterMount,
|
|
6448
|
-
|
|
6467
|
+
tt as useElementWidth,
|
|
6449
6468
|
Js as useScrollListener,
|
|
6450
6469
|
Xs as useScrollToHash,
|
|
6451
6470
|
xr as useUser
|