@apolitical/component-library 5.5.4-beta.0 → 5.5.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.js +8 -8
- package/index.mjs +90 -90
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import Eh from "lodash.set";
|
|
|
5
5
|
import Ic from "react-dom";
|
|
6
6
|
import tn from "markdown-to-jsx";
|
|
7
7
|
import dr from "truncate";
|
|
8
|
-
import { QueryClient as _h, QueryClientProvider as kh, useMutation as
|
|
8
|
+
import { QueryClient as _h, QueryClientProvider as kh, useMutation as ct, useQueryClient as ro, useInfiniteQuery as io, useQuery as Fh } from "@tanstack/react-query";
|
|
9
9
|
import { ReactQueryDevtools as Ah } from "@tanstack/react-query-devtools";
|
|
10
10
|
import Oi from "posthog-js";
|
|
11
11
|
import { CookiesProvider as Bh, useCookies as Lc } from "react-cookie";
|
|
@@ -466,7 +466,7 @@ function Mh() {
|
|
|
466
466
|
__source: !0
|
|
467
467
|
}, _e, Xe, et;
|
|
468
468
|
et = {};
|
|
469
|
-
function
|
|
469
|
+
function dt(R) {
|
|
470
470
|
if (Se.call(R, "ref")) {
|
|
471
471
|
var se = Object.getOwnPropertyDescriptor(R, "ref").get;
|
|
472
472
|
if (se && se.isReactWarning)
|
|
@@ -510,7 +510,7 @@ function Mh() {
|
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
var
|
|
513
|
+
var ft = function(R, se, fe, Ce, $e, Ve, Pe) {
|
|
514
514
|
var Oe = {
|
|
515
515
|
// This tag allows us to uniquely identify this as a React Element
|
|
516
516
|
$$typeof: t,
|
|
@@ -542,7 +542,7 @@ function Mh() {
|
|
|
542
542
|
function Gn(R, se, fe, Ce, $e) {
|
|
543
543
|
{
|
|
544
544
|
var Ve, Pe = {}, Oe = null, vt = null;
|
|
545
|
-
fe !== void 0 && (ae(fe), Oe = "" + fe), Nt(se) && (ae(se.key), Oe = "" + se.key),
|
|
545
|
+
fe !== void 0 && (ae(fe), Oe = "" + fe), Nt(se) && (ae(se.key), Oe = "" + se.key), dt(se) && (vt = se.ref, Ct(se, $e));
|
|
546
546
|
for (Ve in se)
|
|
547
547
|
Se.call(se, Ve) && !be.hasOwnProperty(Ve) && (Pe[Ve] = se[Ve]);
|
|
548
548
|
if (R && R.defaultProps) {
|
|
@@ -554,7 +554,7 @@ function Mh() {
|
|
|
554
554
|
var at = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
|
|
555
555
|
Oe && it(Pe, at), vt && Tt(Pe, at);
|
|
556
556
|
}
|
|
557
|
-
return
|
|
557
|
+
return ft(R, Oe, vt, $e, Ce, pe.current, Pe);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
var bn = b.ReactCurrentOwner, Sn = b.ReactDebugCurrentFrame;
|
|
@@ -2341,7 +2341,7 @@ const K_ = ({
|
|
|
2341
2341
|
] }, `dl-${u}`) : /* @__PURE__ */ c.jsx("li", { style: h, children: typeof l.text == "string" ? /* @__PURE__ */ c.jsx(tn, { options: d, children: l.text }) : l.text }, u);
|
|
2342
2342
|
})
|
|
2343
2343
|
});
|
|
2344
|
-
},
|
|
2344
|
+
}, ht = () => ne.Fragment, fm = ({ children: e }) => /* @__PURE__ */ c.jsx(Vt, { variant: "secondary", children: e }), hm = ({ children: e }) => typeof e == "object" && Object.keys(e || {}).length === 1 ? /* @__PURE__ */ c.jsx("p", { className: "center", children: e }) : /* @__PURE__ */ c.jsx("div", { className: "center", children: e }), mm = ["span", "strong", "h1", "h2", "h3", "h4", "h5", "h6", "p"], pm = ({ children: e }) => {
|
|
2345
2345
|
const t = ce();
|
|
2346
2346
|
if (!e)
|
|
2347
2347
|
return null;
|
|
@@ -2463,28 +2463,28 @@ const ym = {
|
|
|
2463
2463
|
CaseStudy: fm,
|
|
2464
2464
|
// Override embedded HTML
|
|
2465
2465
|
// Our content team previously used real HTML, which we need to tear out and replace with React components
|
|
2466
|
-
style:
|
|
2466
|
+
style: ht,
|
|
2467
2467
|
details: pm,
|
|
2468
2468
|
div: gm,
|
|
2469
2469
|
iframe: vm,
|
|
2470
2470
|
center: hm
|
|
2471
2471
|
},
|
|
2472
2472
|
"text-only": {
|
|
2473
|
-
h1:
|
|
2474
|
-
h2:
|
|
2475
|
-
h3:
|
|
2476
|
-
h4:
|
|
2477
|
-
h5:
|
|
2478
|
-
h6:
|
|
2479
|
-
style:
|
|
2480
|
-
details:
|
|
2481
|
-
div:
|
|
2482
|
-
TextBox:
|
|
2483
|
-
CollapsibleSection:
|
|
2484
|
-
CaseStudy:
|
|
2485
|
-
blockquote:
|
|
2486
|
-
iframe:
|
|
2487
|
-
button:
|
|
2473
|
+
h1: ht,
|
|
2474
|
+
h2: ht,
|
|
2475
|
+
h3: ht,
|
|
2476
|
+
h4: ht,
|
|
2477
|
+
h5: ht,
|
|
2478
|
+
h6: ht,
|
|
2479
|
+
style: ht,
|
|
2480
|
+
details: ht,
|
|
2481
|
+
div: ht,
|
|
2482
|
+
TextBox: ht,
|
|
2483
|
+
CollapsibleSection: ht,
|
|
2484
|
+
CaseStudy: ht,
|
|
2485
|
+
blockquote: ht,
|
|
2486
|
+
iframe: ht,
|
|
2487
|
+
button: ht
|
|
2488
2488
|
}
|
|
2489
2489
|
}, fr = ({
|
|
2490
2490
|
element: e = "div",
|
|
@@ -7086,7 +7086,7 @@ function Ev(e, t) {
|
|
|
7086
7086
|
function Iu(e) {
|
|
7087
7087
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
7088
7088
|
}
|
|
7089
|
-
function
|
|
7089
|
+
function lt(e) {
|
|
7090
7090
|
var t, n;
|
|
7091
7091
|
return Iu(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (n = t.prototype, !(Iu(n) === !1 || n.hasOwnProperty("isPrototypeOf") === !1)));
|
|
7092
7092
|
}
|
|
@@ -7972,19 +7972,19 @@ var zv = (e, t, n) => {
|
|
|
7972
7972
|
} = n;
|
|
7973
7973
|
if (be.length === 0)
|
|
7974
7974
|
throw new Error('Cannot apply a "split_node" operation at path ['.concat(be, "] because the root node cannot be split."));
|
|
7975
|
-
var et = oe.get(e, be),
|
|
7975
|
+
var et = oe.get(e, be), dt = oe.parent(e, be), Nt = be[be.length - 1], Ct;
|
|
7976
7976
|
if (me.isText(et)) {
|
|
7977
7977
|
var it = et.text.slice(0, _e), Tt = et.text.slice(_e);
|
|
7978
7978
|
et.text = it, Ct = Or(Or({}, Xe), {}, {
|
|
7979
7979
|
text: Tt
|
|
7980
7980
|
});
|
|
7981
7981
|
} else {
|
|
7982
|
-
var
|
|
7983
|
-
et.children =
|
|
7982
|
+
var ft = et.children.slice(0, _e), Gn = et.children.slice(_e);
|
|
7983
|
+
et.children = ft, Ct = Or(Or({}, Xe), {}, {
|
|
7984
7984
|
children: Gn
|
|
7985
7985
|
});
|
|
7986
7986
|
}
|
|
7987
|
-
if (
|
|
7987
|
+
if (dt.children.splice(Nt + 1, 0, Ct), t)
|
|
7988
7988
|
for (var [bn, Sn] of G.points(t))
|
|
7989
7989
|
t[Sn] = Fe.transform(bn, n);
|
|
7990
7990
|
break;
|
|
@@ -8054,7 +8054,7 @@ var zv = (e, t, n) => {
|
|
|
8054
8054
|
}, zd = (e, t) => {
|
|
8055
8055
|
for (var n in e) {
|
|
8056
8056
|
var r = e[n], i = t[n];
|
|
8057
|
-
if (
|
|
8057
|
+
if (lt(r) && lt(i)) {
|
|
8058
8058
|
if (!zd(r, i))
|
|
8059
8059
|
return !1;
|
|
8060
8060
|
} else if (Array.isArray(r) && Array.isArray(i)) {
|
|
@@ -8167,7 +8167,7 @@ var G = {
|
|
|
8167
8167
|
return !G.isBackward(e);
|
|
8168
8168
|
},
|
|
8169
8169
|
isRange(e) {
|
|
8170
|
-
return
|
|
8170
|
+
return lt(e) && Fe.isPoint(e.anchor) && Fe.isPoint(e.focus);
|
|
8171
8171
|
},
|
|
8172
8172
|
*points(e) {
|
|
8173
8173
|
yield [e.anchor, "anchor"], yield [e.focus, "focus"];
|
|
@@ -8199,9 +8199,9 @@ var G = {
|
|
|
8199
8199
|
r.anchor = l, r.focus = u;
|
|
8200
8200
|
});
|
|
8201
8201
|
}
|
|
8202
|
-
}, Ju = (e) =>
|
|
8202
|
+
}, Ju = (e) => lt(e) && oe.isNodeList(e.children) && !y.isEditor(e), he = {
|
|
8203
8203
|
isAncestor(e) {
|
|
8204
|
-
return
|
|
8204
|
+
return lt(e) && oe.isNodeList(e.children);
|
|
8205
8205
|
},
|
|
8206
8206
|
isElement: Ju,
|
|
8207
8207
|
isElementList(e) {
|
|
@@ -8458,7 +8458,7 @@ var En = {
|
|
|
8458
8458
|
return En.isOperation(e) && e.type.endsWith("_node");
|
|
8459
8459
|
},
|
|
8460
8460
|
isOperation(e) {
|
|
8461
|
-
if (!
|
|
8461
|
+
if (!lt(e))
|
|
8462
8462
|
return !1;
|
|
8463
8463
|
switch (e.type) {
|
|
8464
8464
|
case "insert_node":
|
|
@@ -8466,7 +8466,7 @@ var En = {
|
|
|
8466
8466
|
case "insert_text":
|
|
8467
8467
|
return typeof e.offset == "number" && typeof e.text == "string" && $.isPath(e.path);
|
|
8468
8468
|
case "merge_node":
|
|
8469
|
-
return typeof e.position == "number" && $.isPath(e.path) &&
|
|
8469
|
+
return typeof e.position == "number" && $.isPath(e.path) && lt(e.properties);
|
|
8470
8470
|
case "move_node":
|
|
8471
8471
|
return $.isPath(e.path) && $.isPath(e.newPath);
|
|
8472
8472
|
case "remove_node":
|
|
@@ -8474,11 +8474,11 @@ var En = {
|
|
|
8474
8474
|
case "remove_text":
|
|
8475
8475
|
return typeof e.offset == "number" && typeof e.text == "string" && $.isPath(e.path);
|
|
8476
8476
|
case "set_node":
|
|
8477
|
-
return $.isPath(e.path) &&
|
|
8477
|
+
return $.isPath(e.path) && lt(e.properties) && lt(e.newProperties);
|
|
8478
8478
|
case "set_selection":
|
|
8479
|
-
return e.properties === null && G.isRange(e.newProperties) || e.newProperties === null && G.isRange(e.properties) ||
|
|
8479
|
+
return e.properties === null && G.isRange(e.newProperties) || e.newProperties === null && G.isRange(e.properties) || lt(e.properties) && lt(e.newProperties);
|
|
8480
8480
|
case "split_node":
|
|
8481
|
-
return $.isPath(e.path) && typeof e.position == "number" &&
|
|
8481
|
+
return $.isPath(e.path) && typeof e.position == "number" && lt(e.properties);
|
|
8482
8482
|
default:
|
|
8483
8483
|
return !1;
|
|
8484
8484
|
}
|
|
@@ -8570,9 +8570,9 @@ var En = {
|
|
|
8570
8570
|
var t = tl.get(e);
|
|
8571
8571
|
if (t !== void 0)
|
|
8572
8572
|
return t;
|
|
8573
|
-
if (!
|
|
8573
|
+
if (!lt(e))
|
|
8574
8574
|
return !1;
|
|
8575
|
-
var n = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null ||
|
|
8575
|
+
var n = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null || lt(e.marks)) && (e.selection === null || G.isRange(e.selection)) && oe.isNodeList(e.children) && En.isOperationList(e.operations);
|
|
8576
8576
|
return tl.set(e, n), n;
|
|
8577
8577
|
}, y = {
|
|
8578
8578
|
above(e, t) {
|
|
@@ -8800,7 +8800,7 @@ var Fe = {
|
|
|
8800
8800
|
return e.offset === t.offset && $.equals(e.path, t.path);
|
|
8801
8801
|
},
|
|
8802
8802
|
isPoint(e) {
|
|
8803
|
-
return
|
|
8803
|
+
return lt(e) && typeof e.offset == "number" && $.isPath(e.path);
|
|
8804
8804
|
},
|
|
8805
8805
|
transform(e, t) {
|
|
8806
8806
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
@@ -8892,7 +8892,7 @@ var me = {
|
|
|
8892
8892
|
return zd(r ? i(e) : e, r ? i(t) : t);
|
|
8893
8893
|
},
|
|
8894
8894
|
isText(e) {
|
|
8895
|
-
return
|
|
8895
|
+
return lt(e) && typeof e.text == "string";
|
|
8896
8896
|
},
|
|
8897
8897
|
isTextList(e) {
|
|
8898
8898
|
return Array.isArray(e) && e.every((t) => me.isText(t));
|
|
@@ -18373,7 +18373,7 @@ function Ew(e) {
|
|
|
18373
18373
|
return ae;
|
|
18374
18374
|
}
|
|
18375
18375
|
function i(W, ae, pe) {
|
|
18376
|
-
let be = ae - 1, _e = -1, Xe = !1, et,
|
|
18376
|
+
let be = ae - 1, _e = -1, Xe = !1, et, dt, Nt, Ct;
|
|
18377
18377
|
for (; ++be <= pe; ) {
|
|
18378
18378
|
const it = W[be];
|
|
18379
18379
|
switch (it[1].type) {
|
|
@@ -18399,19 +18399,19 @@ function Ew(e) {
|
|
|
18399
18399
|
if (!_e && it[0] === "enter" && it[1].type === "listItemPrefix" || _e === -1 && it[0] === "exit" && (it[1].type === "listUnordered" || it[1].type === "listOrdered")) {
|
|
18400
18400
|
if (et) {
|
|
18401
18401
|
let Tt = be;
|
|
18402
|
-
for (
|
|
18403
|
-
const
|
|
18404
|
-
if (
|
|
18405
|
-
if (
|
|
18402
|
+
for (dt = void 0; Tt--; ) {
|
|
18403
|
+
const ft = W[Tt];
|
|
18404
|
+
if (ft[1].type === "lineEnding" || ft[1].type === "lineEndingBlank") {
|
|
18405
|
+
if (ft[0] === "exit")
|
|
18406
18406
|
continue;
|
|
18407
|
-
|
|
18408
|
-
} else if (!(
|
|
18407
|
+
dt && (W[dt][1].type = "lineEndingBlank", Xe = !0), ft[1].type = "lineEnding", dt = Tt;
|
|
18408
|
+
} else if (!(ft[1].type === "linePrefix" || ft[1].type === "blockQuotePrefix" || ft[1].type === "blockQuotePrefixWhitespace" || ft[1].type === "blockQuoteMarker" || ft[1].type === "listItemIndent"))
|
|
18409
18409
|
break;
|
|
18410
18410
|
}
|
|
18411
|
-
Nt && (!
|
|
18411
|
+
Nt && (!dt || Nt < dt) && (et._spread = !0), et.end = Object.assign(
|
|
18412
18412
|
{},
|
|
18413
|
-
|
|
18414
|
-
), W.splice(
|
|
18413
|
+
dt ? W[dt][1].start : it[1].end
|
|
18414
|
+
), W.splice(dt || be, 0, ["exit", et, it[2]]), be++, pe++;
|
|
18415
18415
|
}
|
|
18416
18416
|
if (it[1].type === "listItemPrefix") {
|
|
18417
18417
|
const Tt = {
|
|
@@ -20384,7 +20384,7 @@ var bC = {
|
|
|
20384
20384
|
* Check if a value is a `History` object.
|
|
20385
20385
|
*/
|
|
20386
20386
|
isHistory(e) {
|
|
20387
|
-
return
|
|
20387
|
+
return lt(e) && Array.isArray(e.redos) && Array.isArray(e.undos) && (e.redos.length === 0 || En.isOperationList(e.redos[0].operations)) && (e.undos.length === 0 || En.isOperationList(e.undos[0].operations));
|
|
20388
20388
|
}
|
|
20389
20389
|
}, us = /* @__PURE__ */ new WeakMap(), ls = /* @__PURE__ */ new WeakMap(), or = {
|
|
20390
20390
|
/**
|
|
@@ -21451,7 +21451,7 @@ const MC = ({ hooks: e, functions: t, meta: n = {}, gtm: r }) => {
|
|
|
21451
21451
|
);
|
|
21452
21452
|
};
|
|
21453
21453
|
let ds = null;
|
|
21454
|
-
const
|
|
21454
|
+
const ut = "publishArticleForm_", Fc = {}, Ac = 10, rk = ({
|
|
21455
21455
|
id: e = "publish-article-form",
|
|
21456
21456
|
values: t = Fc,
|
|
21457
21457
|
functions: n,
|
|
@@ -21465,27 +21465,27 @@ const ht = "publishArticleForm_", Fc = {}, Ac = 10, rk = ({
|
|
|
21465
21465
|
qi(t, Fc) || Vi(t.body) && t.body !== p && t.body !== void 0 && g(t.body);
|
|
21466
21466
|
}, [t.body]);
|
|
21467
21467
|
const _ = () => {
|
|
21468
|
-
!s || !s.id ? v(a.formatMessage({ id: `${
|
|
21468
|
+
!s || !s.id ? v(a.formatMessage({ id: `${ut}error_loggedOut` })) : f && v(!1);
|
|
21469
21469
|
}, B = (I) => ({
|
|
21470
21470
|
condition: (N) => {
|
|
21471
21471
|
const z = N[I];
|
|
21472
21472
|
return !z || typeof z != "string" ? !0 : z.length < Ac;
|
|
21473
21473
|
},
|
|
21474
21474
|
error: a.formatMessage(
|
|
21475
|
-
{ id: `${
|
|
21475
|
+
{ id: `${ut}error_underMinLength` },
|
|
21476
21476
|
{ length: Ac }
|
|
21477
21477
|
)
|
|
21478
21478
|
}), x = !p || !Vi(p), w = () => /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
21479
21479
|
/* @__PURE__ */ c.jsx(nn, {}),
|
|
21480
|
-
/* @__PURE__ */ c.jsx("p", { className: "text-medium", children: a.formatMessage({ id: `${
|
|
21480
|
+
/* @__PURE__ */ c.jsx("p", { className: "text-medium", children: a.formatMessage({ id: `${ut}disclaimer` }) })
|
|
21481
21481
|
] }), T = [
|
|
21482
21482
|
{
|
|
21483
21483
|
id: "title",
|
|
21484
21484
|
type: "text",
|
|
21485
21485
|
value: t.title || "",
|
|
21486
21486
|
limit: 65,
|
|
21487
|
-
label: a.formatMessage({ id: `${
|
|
21488
|
-
placeholder: a.formatMessage({ id: `${
|
|
21487
|
+
label: a.formatMessage({ id: `${ut}title_label` }),
|
|
21488
|
+
placeholder: a.formatMessage({ id: `${ut}title_placeholder` }),
|
|
21489
21489
|
functions: {
|
|
21490
21490
|
onChange: _
|
|
21491
21491
|
},
|
|
@@ -21496,7 +21496,7 @@ const ht = "publishArticleForm_", Fc = {}, Ac = 10, rk = ({
|
|
|
21496
21496
|
// We do a check for the rich text editor value here as well, to make sure we can't
|
|
21497
21497
|
// submit an article without a body
|
|
21498
21498
|
condition: () => x,
|
|
21499
|
-
error: a.formatMessage({ id: `${
|
|
21499
|
+
error: a.formatMessage({ id: `${ut}title_error` })
|
|
21500
21500
|
}
|
|
21501
21501
|
]
|
|
21502
21502
|
},
|
|
@@ -21505,8 +21505,8 @@ const ht = "publishArticleForm_", Fc = {}, Ac = 10, rk = ({
|
|
|
21505
21505
|
type: "text",
|
|
21506
21506
|
value: t.subtitle,
|
|
21507
21507
|
limit: 115,
|
|
21508
|
-
label: a.formatMessage({ id: `${
|
|
21509
|
-
placeholder: a.formatMessage({ id: `${
|
|
21508
|
+
label: a.formatMessage({ id: `${ut}subtitle_label` }),
|
|
21509
|
+
placeholder: a.formatMessage({ id: `${ut}subtitle_placeholder` }),
|
|
21510
21510
|
functions: {
|
|
21511
21511
|
onChange: _
|
|
21512
21512
|
},
|
|
@@ -21517,7 +21517,7 @@ const ht = "publishArticleForm_", Fc = {}, Ac = 10, rk = ({
|
|
|
21517
21517
|
props: {
|
|
21518
21518
|
formID: e,
|
|
21519
21519
|
label: {
|
|
21520
|
-
visible: a.formatMessage({ id: `${
|
|
21520
|
+
visible: a.formatMessage({ id: `${ut}body_label` })
|
|
21521
21521
|
},
|
|
21522
21522
|
showLabel: !0
|
|
21523
21523
|
}
|
|
@@ -21527,7 +21527,7 @@ const ht = "publishArticleForm_", Fc = {}, Ac = 10, rk = ({
|
|
|
21527
21527
|
props: {
|
|
21528
21528
|
id: `${e}-input`,
|
|
21529
21529
|
value: p,
|
|
21530
|
-
placeholder: a.formatMessage({ id: `${
|
|
21530
|
+
placeholder: a.formatMessage({ id: `${ut}body_placeholder` }),
|
|
21531
21531
|
meta: { isInOverlay: d },
|
|
21532
21532
|
autoFocus: !1,
|
|
21533
21533
|
functions: {
|
|
@@ -21558,16 +21558,16 @@ const ht = "publishArticleForm_", Fc = {}, Ac = 10, rk = ({
|
|
|
21558
21558
|
const N = { ...I, body: p };
|
|
21559
21559
|
try {
|
|
21560
21560
|
o && await o(N), ds = setTimeout(() => {
|
|
21561
|
-
C(a.formatMessage({ id: `${
|
|
21561
|
+
C(a.formatMessage({ id: `${ut}aria_success` })), l(N);
|
|
21562
21562
|
}, 500);
|
|
21563
21563
|
} catch {
|
|
21564
|
-
v(
|
|
21564
|
+
v(a.formatMessage({ id: `${ut}error` })), C(""), u();
|
|
21565
21565
|
}
|
|
21566
21566
|
},
|
|
21567
21567
|
onFailure: u
|
|
21568
21568
|
},
|
|
21569
21569
|
fields: T,
|
|
21570
|
-
intlPath:
|
|
21570
|
+
intlPath: ut,
|
|
21571
21571
|
button: {
|
|
21572
21572
|
variant: "primary",
|
|
21573
21573
|
size: { mobile: "small", 600: "medium" },
|
|
@@ -21575,20 +21575,20 @@ const ht = "publishArticleForm_", Fc = {}, Ac = 10, rk = ({
|
|
|
21575
21575
|
"data-gtm-event-type": "publish-article-click",
|
|
21576
21576
|
disabled: !s || !s.id || x,
|
|
21577
21577
|
text: {
|
|
21578
|
-
default: a.formatMessage({ id: `${
|
|
21578
|
+
default: a.formatMessage({ id: `${ut}cta_submit` }),
|
|
21579
21579
|
submitting: a.formatMessage({
|
|
21580
|
-
id: `${
|
|
21580
|
+
id: `${ut}cta_submitting`
|
|
21581
21581
|
}),
|
|
21582
21582
|
submitted: a.formatMessage({
|
|
21583
|
-
id: `${
|
|
21583
|
+
id: `${ut}cta_submitted`
|
|
21584
21584
|
})
|
|
21585
21585
|
},
|
|
21586
|
-
customOnSubmit: /* @__PURE__ */ c.jsx(RC, {})
|
|
21586
|
+
customOnSubmit: f ? /* @__PURE__ */ c.jsx(c.Fragment, {}) : /* @__PURE__ */ c.jsx(RC, {})
|
|
21587
21587
|
},
|
|
21588
21588
|
gtm: i
|
|
21589
21589
|
}
|
|
21590
21590
|
),
|
|
21591
|
-
f && /* @__PURE__ */ c.jsx(Zr, { id: "error-message", className: "error", children: typeof f == "string" && f.includes(" ") ? f : a.formatMessage({ id: `${
|
|
21591
|
+
f && /* @__PURE__ */ c.jsx(Zr, { id: "error-message", className: "error", children: typeof f == "string" && f.includes(" ") ? f : a.formatMessage({ id: `${ut}error` }) }),
|
|
21592
21592
|
b && /* @__PURE__ */ c.jsx(qe, { "aria-live": "polite", showOnFocus: !1, children: b })
|
|
21593
21593
|
] });
|
|
21594
21594
|
};
|
|
@@ -24566,7 +24566,7 @@ function wE({
|
|
|
24566
24566
|
queryKey: i,
|
|
24567
24567
|
user: a
|
|
24568
24568
|
}) {
|
|
24569
|
-
const { mutate: s } =
|
|
24569
|
+
const { mutate: s } = ct({
|
|
24570
24570
|
mutationFn: e,
|
|
24571
24571
|
onMutate: (o) => t((l) => {
|
|
24572
24572
|
const u = Oc({ activity: hE(o), user: a });
|
|
@@ -24589,7 +24589,7 @@ function CE({
|
|
|
24589
24589
|
mutationFn: e,
|
|
24590
24590
|
mutationHandlers: { mutate: t, error: n }
|
|
24591
24591
|
}) {
|
|
24592
|
-
const { mutate: r } =
|
|
24592
|
+
const { mutate: r } = ct({
|
|
24593
24593
|
mutationFn: e,
|
|
24594
24594
|
onMutate: ({ activityId: i, content: a }) => t((s) => {
|
|
24595
24595
|
const o = Zt(i, s);
|
|
@@ -24637,7 +24637,7 @@ function _E({
|
|
|
24637
24637
|
queryClient: r,
|
|
24638
24638
|
queryKey: i
|
|
24639
24639
|
}) {
|
|
24640
|
-
const { mutate: a } =
|
|
24640
|
+
const { mutate: a } = ct({
|
|
24641
24641
|
mutationFn: e,
|
|
24642
24642
|
onMutate: ({ activityId: s }) => t((o) => {
|
|
24643
24643
|
const l = Zt(s, o);
|
|
@@ -24676,7 +24676,7 @@ function FE({
|
|
|
24676
24676
|
queryClient: r,
|
|
24677
24677
|
queryKey: i
|
|
24678
24678
|
}) {
|
|
24679
|
-
const { mutate: a } =
|
|
24679
|
+
const { mutate: a } = ct({
|
|
24680
24680
|
mutationFn: e,
|
|
24681
24681
|
onMutate: ({ activityId: s }) => t((o) => {
|
|
24682
24682
|
const l = Zt(s, o);
|
|
@@ -24694,7 +24694,7 @@ function AE({
|
|
|
24694
24694
|
mutationFn: e,
|
|
24695
24695
|
mutationHandlers: { mutate: t, error: n }
|
|
24696
24696
|
}) {
|
|
24697
|
-
const { mutate: r } =
|
|
24697
|
+
const { mutate: r } = ct({
|
|
24698
24698
|
mutationFn: e,
|
|
24699
24699
|
onMutate: ({ activityId: i }) => t((a) => sh(i, a)),
|
|
24700
24700
|
onError: n
|
|
@@ -24706,7 +24706,7 @@ function BE({
|
|
|
24706
24706
|
mutationHandlers: { mutate: t, error: n },
|
|
24707
24707
|
user: r
|
|
24708
24708
|
}) {
|
|
24709
|
-
const { mutate: i } =
|
|
24709
|
+
const { mutate: i } = ct({
|
|
24710
24710
|
mutationFn: e,
|
|
24711
24711
|
onMutate: ({ activityId: a }) => t((s) => {
|
|
24712
24712
|
const o = Zt(a, s);
|
|
@@ -24721,7 +24721,7 @@ function TE({
|
|
|
24721
24721
|
mutationHandlers: { mutate: t, error: n },
|
|
24722
24722
|
user: r
|
|
24723
24723
|
}) {
|
|
24724
|
-
const { mutate: i } =
|
|
24724
|
+
const { mutate: i } = ct({
|
|
24725
24725
|
mutationFn: e,
|
|
24726
24726
|
onMutate: ({ activityId: a }) => t((s) => {
|
|
24727
24727
|
const o = Zt(a, s);
|
|
@@ -25537,7 +25537,7 @@ function SE({
|
|
|
25537
25537
|
queryKey: i,
|
|
25538
25538
|
user: a
|
|
25539
25539
|
}) {
|
|
25540
|
-
const { mutate: s } =
|
|
25540
|
+
const { mutate: s } = ct({
|
|
25541
25541
|
mutationFn: e,
|
|
25542
25542
|
onMutate: (o) => t((l) => {
|
|
25543
25543
|
const u = Pc({ reply: mE(o), user: a });
|
|
@@ -25563,7 +25563,7 @@ function jE({
|
|
|
25563
25563
|
mutationFn: e,
|
|
25564
25564
|
mutationHandlers: { mutate: t, error: n }
|
|
25565
25565
|
}) {
|
|
25566
|
-
const { mutate: r } =
|
|
25566
|
+
const { mutate: r } = ct({
|
|
25567
25567
|
mutationFn: e,
|
|
25568
25568
|
onMutate: ({ replyId: i, content: a }) => t((s) => {
|
|
25569
25569
|
const o = Zt(i, s);
|
|
@@ -25604,7 +25604,7 @@ function OE({
|
|
|
25604
25604
|
queryClient: r,
|
|
25605
25605
|
queryKey: i
|
|
25606
25606
|
}) {
|
|
25607
|
-
const { mutate: a } =
|
|
25607
|
+
const { mutate: a } = ct({
|
|
25608
25608
|
mutationFn: e,
|
|
25609
25609
|
onMutate: ({ replyId: s }) => t((o) => {
|
|
25610
25610
|
const l = Zt(s, o);
|
|
@@ -25637,7 +25637,7 @@ function NE({
|
|
|
25637
25637
|
mutationFn: e,
|
|
25638
25638
|
mutationHandlers: { mutate: t, error: n }
|
|
25639
25639
|
}) {
|
|
25640
|
-
const { mutate: r } =
|
|
25640
|
+
const { mutate: r } = ct({
|
|
25641
25641
|
mutationFn: e,
|
|
25642
25642
|
onMutate: ({ replyId: i }) => t((a) => sh(i, a)),
|
|
25643
25643
|
onError: n
|
|
@@ -25649,7 +25649,7 @@ function ME({
|
|
|
25649
25649
|
mutationHandlers: { mutate: t, error: n },
|
|
25650
25650
|
user: r
|
|
25651
25651
|
}) {
|
|
25652
|
-
const { mutate: i } =
|
|
25652
|
+
const { mutate: i } = ct({
|
|
25653
25653
|
mutationFn: e,
|
|
25654
25654
|
onMutate: ({ replyId: a }) => t((s) => {
|
|
25655
25655
|
const o = Zt(a, s);
|
|
@@ -26184,7 +26184,7 @@ const Ea = ({
|
|
|
26184
26184
|
basePath: _,
|
|
26185
26185
|
parentId: B
|
|
26186
26186
|
}) => {
|
|
26187
|
-
var Ze, xe, W, ae, pe, be, _e, Xe, et,
|
|
26187
|
+
var Ze, xe, W, ae, pe, be, _e, Xe, et, dt, Nt, Ct, it, Tt, ft, Gn, bn, Sn;
|
|
26188
26188
|
const x = ce(), w = Me(pt), T = Me(qo), {
|
|
26189
26189
|
createContent: I = async () => {
|
|
26190
26190
|
},
|
|
@@ -26395,7 +26395,7 @@ const Ea = ({
|
|
|
26395
26395
|
},
|
|
26396
26396
|
className: typeof H != "string" && H.id === a ? "highlighted" : "",
|
|
26397
26397
|
styling: {
|
|
26398
|
-
additionalContentNewLine: !!((_e = t.componentProps) != null && _e.member.additionalContent && ((
|
|
26398
|
+
additionalContentNewLine: !!((_e = t.componentProps) != null && _e.member.additionalContent && ((dt = (et = (Xe = t.componentProps) == null ? void 0 : Xe.member) == null ? void 0 : et.additionalContent) != null && dt.customMessage))
|
|
26399
26399
|
},
|
|
26400
26400
|
gtmContext: d,
|
|
26401
26401
|
gtmType: "profile-click",
|
|
@@ -26544,7 +26544,7 @@ const Ea = ({
|
|
|
26544
26544
|
p && /* @__PURE__ */ c.jsx(
|
|
26545
26545
|
VE,
|
|
26546
26546
|
{
|
|
26547
|
-
url: (it = t.slugs) != null && it.reply ? `${window.location.origin}${(Tt = t.slugs) == null ? void 0 : Tt.question}/${(
|
|
26547
|
+
url: (it = t.slugs) != null && it.reply ? `${window.location.origin}${(Tt = t.slugs) == null ? void 0 : Tt.question}/${(ft = t.slugs) == null ? void 0 : ft.answer}#${(Gn = t.slugs) == null ? void 0 : Gn.reply}` : `${window.location.origin}${(bn = t.slugs) == null ? void 0 : bn.question}/${(Sn = t.slugs) == null ? void 0 : Sn.answer}`,
|
|
26548
26548
|
gtm: { context: d, event: `copy-link-${t.type}-click` }
|
|
26549
26549
|
}
|
|
26550
26550
|
),
|
|
@@ -26915,7 +26915,7 @@ function e_({
|
|
|
26915
26915
|
mutationFn: e,
|
|
26916
26916
|
mutationHandlers: { mutate: t, error: n }
|
|
26917
26917
|
}) {
|
|
26918
|
-
const { mutate: r } =
|
|
26918
|
+
const { mutate: r } = ct({
|
|
26919
26919
|
mutationFn: e,
|
|
26920
26920
|
onMutate: ({ content: i, title: a }) => t((s) => (s && (i != null && (s.content = i), a != null && (s.title = a)), s)),
|
|
26921
26921
|
onError: n
|
|
@@ -26973,7 +26973,7 @@ function r_({
|
|
|
26973
26973
|
queryClient: r,
|
|
26974
26974
|
queryKey: i
|
|
26975
26975
|
}) {
|
|
26976
|
-
const { mutate: a } =
|
|
26976
|
+
const { mutate: a } = ct({
|
|
26977
26977
|
mutationFn: e,
|
|
26978
26978
|
onMutate: (s) => t((o) => (o && ca({ activity: o }), o)),
|
|
26979
26979
|
onError: n,
|
|
@@ -26991,7 +26991,7 @@ function i_({
|
|
|
26991
26991
|
},
|
|
26992
26992
|
user: r
|
|
26993
26993
|
}) {
|
|
26994
|
-
const { mutate: i } =
|
|
26994
|
+
const { mutate: i } = ct({
|
|
26995
26995
|
mutationFn: e,
|
|
26996
26996
|
onMutate: (a) => t((s) => (s && ih({ activity: s, user: r }), s)),
|
|
26997
26997
|
onError: n
|
|
@@ -27004,7 +27004,7 @@ function a_({
|
|
|
27004
27004
|
queryClient: r,
|
|
27005
27005
|
queryKey: i
|
|
27006
27006
|
}) {
|
|
27007
|
-
const { mutate: a } =
|
|
27007
|
+
const { mutate: a } = ct({
|
|
27008
27008
|
mutationFn: e,
|
|
27009
27009
|
onMutate: (s) => t((o) => (o && da({ activity: o }), o)),
|
|
27010
27010
|
onError: n,
|
|
@@ -27019,7 +27019,7 @@ function s_({
|
|
|
27019
27019
|
mutationHandlers: { mutate: t, error: n },
|
|
27020
27020
|
user: r
|
|
27021
27021
|
}) {
|
|
27022
|
-
const { mutate: i } =
|
|
27022
|
+
const { mutate: i } = ct({
|
|
27023
27023
|
mutationFn: e,
|
|
27024
27024
|
onMutate: (a) => (console.log("unpin"), t((s) => (s && ah({ activity: s, user: r }), s))),
|
|
27025
27025
|
onError: n
|