@logora/debate 0.4.103 → 0.4.105

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.
@@ -1,139 +1,171 @@
1
- import { jsxs as C, jsx as s } from "react/jsx-runtime";
2
- import { useRef as ke, useState as u, useEffect as p, Suspense as je, lazy as ze } from "react";
3
- import { useIntl as Oe, FormattedMessage as he } from "react-intl";
4
- import { useLocation as Je } from "react-router";
5
- import x from "classnames";
1
+ import { jsxs as S, jsx as s } from "react/jsx-runtime";
2
+ import { storePendingReply as Qe } from "../../util/pending_reply/pendingReply.js";
3
+ import { useRef as be, useState as d, useEffect as M, Suspense as Xe, lazy as Ze } from "react";
4
+ import { useIntl as et, FormattedMessage as ve } from "react-intl";
5
+ import { useLocation as tt } from "react-router";
6
+ import I from "classnames";
6
7
  import n from "./ArgumentInput.module.scss.js";
7
- import { useDataProvider as Ke } from "../../data/data_provider/useDataProvider.js";
8
- import { useList as Re } from "../../list/list_provider/useList.js";
9
- import { useConfig as Ge } from "../../data/config_provider/useConfig.js";
10
- import { useInput as He } from "../input_provider/useInput.js";
11
- import { useAuth as Qe } from "../../auth/use_auth/useAuth.js";
12
- import { useFormValidation as Xe } from "../../forms/use_form_validation/useFormValidation.js";
13
- import { useResponsive as Ze } from "../../hooks/use_responsive/useResponsive.js";
14
- import { useScrollToEditor as et } from "../use_scroll_to_editor/useScrollToEditor.js";
15
- import { useSessionStorageState as tt } from "../../hooks/use_session_storage_state/useSessionStorageState.js";
16
- import { useAuthRequired as nt } from "../../hooks/use_auth_required/useAuthRequired.js";
17
- import { useModal as at } from "../../dialog/modal/useModal.js";
18
- import { useToast as st } from "../../dialog/toast_provider/useToast.js";
19
- import { TogglePosition as it } from "../toggle_position/TogglePosition.js";
20
- import { Avatar as ot } from "../../user/avatar/Avatar.js";
21
- import { AuthorBox as rt } from "../../user/author_box/AuthorBox.js";
22
- import { TextEditor as ut } from "../text_editor/TextEditor.js";
23
- import { Icon as dt } from "../../icons/icon/Icon.js";
24
- const lt = ze(() => import("../../modal/side_modal/index.js").then((N) => ({ default: N.SideModal }))), Et = ({
25
- argumentListId: N,
26
- avatarSize: pe = 48,
27
- disabled: J = !1,
8
+ import { useDataProvider as nt } from "../../data/data_provider/useDataProvider.js";
9
+ import { useList as at } from "../../list/list_provider/useList.js";
10
+ import { useConfig as st } from "../../data/config_provider/useConfig.js";
11
+ import { useInput as it } from "../input_provider/useInput.js";
12
+ import { useAuth as ot } from "../../auth/use_auth/useAuth.js";
13
+ import { useFormValidation as rt } from "../../forms/use_form_validation/useFormValidation.js";
14
+ import { useResponsive as ut } from "../../hooks/use_responsive/useResponsive.js";
15
+ import { useScrollToEditor as dt } from "../use_scroll_to_editor/useScrollToEditor.js";
16
+ import { useSessionStorageState as lt } from "../../hooks/use_session_storage_state/useSessionStorageState.js";
17
+ import { useAuthRequired as ct } from "../../hooks/use_auth_required/useAuthRequired.js";
18
+ import { useModal as mt } from "../../dialog/modal/useModal.js";
19
+ import { useToast as ft } from "../../dialog/toast_provider/useToast.js";
20
+ import { TogglePosition as gt } from "../toggle_position/TogglePosition.js";
21
+ import { Avatar as ht } from "../../user/avatar/Avatar.js";
22
+ import { AuthorBox as pt } from "../../user/author_box/AuthorBox.js";
23
+ import { TextEditor as _t } from "../text_editor/TextEditor.js";
24
+ import { Icon as Mt } from "../../icons/icon/Icon.js";
25
+ const bt = Ze(() => import("../../modal/side_modal/index.js").then((x) => ({ default: x.SideModal }))), Ae = 2e4, Rt = ({
26
+ argumentListId: x,
27
+ avatarSize: Se = 48,
28
+ disabled: K = !1,
28
29
  positions: a = [],
29
- disabledPositions: T = [],
30
- groupId: _,
31
- groupName: _e,
32
- groupType: K,
33
- hideSourceAction: Me = !1,
34
- isReply: i = !1,
35
- onSubmit: R,
36
- onUpdate: G,
37
- parentId: M,
38
- placeholder: ve,
30
+ disabledPositions: N = [],
31
+ groupId: f,
32
+ groupName: we,
33
+ groupType: G,
34
+ hideSourceAction: Ce = !1,
35
+ isReply: o = !1,
36
+ onSubmit: H,
37
+ onUpdate: Q,
38
+ parentId: m,
39
+ ancestorIds: ye = [],
40
+ placeholder: Ie,
39
41
  positionId: w,
40
- focusOnInit: be = !1,
41
- activeOnInit: P = !1,
42
- userGuideUrl: H,
43
- hideUserGuideLink: Ae = !1,
44
- hideCharCount: Ce = !1,
45
- disableAutoActivate: we = !1,
46
- autoFocus: Q = !1
42
+ focusOnInit: xe = !1,
43
+ activeOnInit: Y = !1,
44
+ userGuideUrl: X,
45
+ hideUserGuideLink: Ne = !1,
46
+ hideCharCount: Te = !1,
47
+ disableAutoActivate: Le = !1,
48
+ autoFocus: Z = !1
47
49
  }) => {
48
- const r = Oe(), X = Ke(), L = Re(), v = Ge(), {
49
- focus: Z,
50
- setFocus: ee,
51
- inputContent: B,
52
- setInputContent: te,
53
- setInputRichContent: Se
54
- } = He(), { isLoggedIn: S, currentUser: d } = Qe(), { errors: E, validate: $ } = Xe(), { isMobile: m } = Ze(), Ie = Je(), ne = ke(null), y = et(ne), [V, q] = u([]), [D, U] = u(""), [ae, W] = u(null), [l, b] = u(null), [se, ie] = u(null), [oe, re] = u(!1), [I, ue] = u(!1), [A, de] = u({}), [xe, Y] = u(!1), [Ne, Te] = u(0), [f, Le] = tt(
50
+ const r = et(), ee = nt(), T = at(), b = st(), {
51
+ focus: te,
52
+ setFocus: ne,
53
+ inputContent: $,
54
+ setInputContent: ae,
55
+ setInputRichContent: Pe
56
+ } = it(), { isLoggedIn: C, currentUser: l } = ot(), { errors: U, validate: q } = rt(), { isMobile: g } = ut(), Fe = tt(), se = be(null), L = dt(se), [V, D] = d([]), [W, k] = d(""), [ie, O] = d(null), [c, v] = d(null), [oe, re] = d(null), [ue, de] = d(!1), [y, le] = d(!1), [A, ce] = d({}), [Ee, R] = d(!1), [Be, Ye] = d(0), P = be(!1), [$e, me] = d(!1), [h, Ue] = lt(
55
57
  "userSide",
56
58
  {}
57
- ), [g, ye] = u(
58
- !S && v?.actions?.disableInputForVisitor
59
- ), k = nt(), { showModal: Fe } = at(), { toast: j } = st() || {}, le = new URLSearchParams(
60
- typeof window < "u" ? window.location.search : Ie.search
59
+ ), [p, qe] = d(
60
+ !C && b?.actions?.disableInputForVisitor
61
+ ), j = ct(), { showModal: Ve } = mt(), { toast: F } = ft() || {}, fe = new URLSearchParams(
62
+ typeof window < "u" ? window.location.search : Fe.search
61
63
  );
62
- p(() => {
63
- ye(
64
- !S && v?.actions?.disableInputForVisitor
64
+ M(() => {
65
+ qe(
66
+ !C && b?.actions?.disableInputForVisitor
65
67
  );
66
- }, [S, v]);
67
- const z = d?.role === "editor" || d?.role === "moderator", ce = d?.moderation_status === "banned";
68
- p(() => {
68
+ }, [C, b]);
69
+ const z = l?.role === "editor" || l?.role === "moderator", ge = l?.moderation_status === "banned";
70
+ M(() => {
69
71
  let e = null;
70
- typeof window < "u" && (e = le.get("positionId")), w && w != a[2]?.id && a?.find((t) => t.id === w) ? b(w) : e && e != a[2]?.id ? b(e) : f && f.groupId == _ && f.positionId != a[2]?.id && b(f.positionId);
71
- }, [w]), p(() => {
72
- Q && Y(!0);
73
- }, [Q]), p(() => {
74
- P && (O(), Y(!0), y());
75
- }, [P]), p(() => {
72
+ typeof window < "u" && (e = fe.get("positionId")), w && w != a[2]?.id && a?.find((t) => t.id === w) ? v(w) : e && e != a[2]?.id ? v(e) : h && h.groupId == f && h.positionId != a[2]?.id && v(h.positionId);
73
+ }, [w]), M(() => {
74
+ Z && R(!0);
75
+ }, [Z]), M(() => {
76
+ Y && (J(), R(!0), L());
77
+ }, [Y]), M(() => {
76
78
  if (typeof window < "u") {
77
- const e = be || le.get("initArgument");
78
- (e === !0 || e === "true") && (Y(!0), y(), Ue());
79
+ const e = xe || fe.get("initArgument");
80
+ (e === !0 || e === "true") && (R(!0), L(), Ke());
79
81
  }
80
- }, []), p(() => {
81
- Z && !i && (y(), ee(!1));
82
- }, [Z]), p(() => {
83
- B?.id && !i && (Pe(B), ee(!0));
84
- }, [B]);
85
- const Pe = (e) => {
86
- de(e), ue(!0), q(e.sources), U(e.content), W(e.rich_content), ie(e.id), y(), b(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Se(e.rich_content) : te(e.content);
87
- }, me = () => {
88
- U(""), W(null), de({}), ie(null), q([]), Te((e) => e + 1), te(null);
89
- }, Be = (e) => {
90
- b(e), ge(e);
91
- }, Ee = () => {
92
- Fe(
93
- /* @__PURE__ */ s(je, { fallback: null, children: /* @__PURE__ */ s(
94
- lt,
82
+ }, []), M(() => {
83
+ te && !o && (L(), ne(!1));
84
+ }, [te]), M(() => {
85
+ $?.id && !o && (De($), ne(!0));
86
+ }, [$]);
87
+ const De = (e) => {
88
+ ce(e), le(!0), D(e.sources), k(e.content), O(e.rich_content), re(e.id), L(), v(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Pe(e.rich_content) : ae(e.content);
89
+ }, he = () => {
90
+ k(""), O(null), ce({}), re(null), D([]), Ye((e) => e + 1), ae(null);
91
+ }, We = {
92
+ create: {
93
+ id: "alert.argument_create_error",
94
+ defaultMessage: "Your contribution could not be sent. Please try again."
95
+ },
96
+ update: {
97
+ id: "alert.argument_modify_error",
98
+ defaultMessage: "Your contribution could not be saved. Please try again."
99
+ },
100
+ rateLimited: {
101
+ id: "alert.argument_rate_limited",
102
+ defaultMessage: "Your contribution could not be sent. Please try again in a few moments."
103
+ }
104
+ }, E = (e, t) => {
105
+ t && console.error("[ArgumentInput] submission failed", t);
106
+ const { id: u, defaultMessage: i } = We[t?.response?.status === 429 ? "rateLimited" : e];
107
+ F?.(r.formatMessage({ id: u, defaultMessage: i }), { type: "error" });
108
+ }, pe = async (e) => {
109
+ P.current = !0, me(!0);
110
+ try {
111
+ return await e();
112
+ } finally {
113
+ P.current = !1, me(!1);
114
+ }
115
+ }, ke = (e) => {
116
+ v(e), Me(e);
117
+ }, Oe = () => {
118
+ Ve(
119
+ /* @__PURE__ */ s(Xe, { fallback: null, children: /* @__PURE__ */ s(
120
+ bt,
95
121
  {
96
122
  modalTitle: r.formatMessage({
97
123
  id: "modal.side_modal.modal_title",
98
124
  defaultMessage: "Choose your side"
99
125
  }),
100
- onChooseSide: Be,
126
+ onChooseSide: ke,
101
127
  positions: a,
102
- title: _e,
103
- disabledPositions: !i && T,
104
- isNeutral: f && f.groupId == _ && f.positionId === a[2]?.id
128
+ title: we,
129
+ disabledPositions: !o && N,
130
+ isNeutral: h && h.groupId == f && h.positionId === a[2]?.id
105
131
  }
106
132
  ) })
107
133
  );
108
- }, $e = () => {
109
- S ? se ? De() : !a || a?.length === 0 || !T?.find((e) => e?.id === l) && l || z && i ? ge(i && z && a[0]?.id) : Ee() : k({ loginAction: "argument" });
110
- }, Ve = (e, t) => {
111
- g ? k({ loginAction: "argument" }) : (U(e), W(t), $({ content: e }, [{ content: ["url", null] }]));
112
- }, qe = (e) => {
113
- q(e);
114
- }, fe = [
134
+ }, Re = () => {
135
+ C ? oe ? Je() : !a || a?.length === 0 || !N?.find((e) => e?.id === c) && c || z && o ? Me(o && z && a[0]?.id) : Oe() : (m && Qe({ groupId: f, parentId: m, ancestorIds: ye }), j({ loginAction: "argument" }));
136
+ }, je = (e, t) => {
137
+ p ? j({ loginAction: "argument" }) : (k(e), O(t), q({ content: e }, [{ content: ["url", null] }]));
138
+ }, ze = (e) => {
139
+ D(e);
140
+ }, _e = [
115
141
  { content: ["length", 3] },
116
142
  { content: ["required", null] },
117
143
  { content: ["url", null] },
118
144
  ...!a || a?.length === 0 ? [] : [{ position_id: ["required", null] }]
119
- ], ge = (e) => {
120
- const t = e || l, c = {
121
- content: D,
122
- rich_content: ae,
123
- group_id: _,
124
- ...K && { group_type: K },
145
+ ], Me = (e) => {
146
+ if (P.current)
147
+ return;
148
+ const t = e || c, u = {
149
+ content: W,
150
+ rich_content: ie,
151
+ group_id: f,
152
+ ...G && { group_type: G },
125
153
  ...t && { position_id: t },
126
- is_reply: !!M,
127
- message_id: M || null,
128
- source_ids: V?.map((o) => o.id)
154
+ is_reply: !!m,
155
+ message_id: m || null,
156
+ source_ids: V?.map((i) => i.id)
129
157
  };
130
- $(c, fe) && (t && a && a.map((o) => o.id).includes(t) && Le({
131
- groupId: _,
158
+ q(u, _e) && (t && a && a.map((i) => i.id).includes(t) && Ue({
159
+ groupId: f,
132
160
  positionId: t
133
- }), me(), X.create("messages", c).then((o) => {
134
- if (o.data.success) {
135
- if (M)
136
- R(o.data.data.resource), j(
161
+ }), pe(
162
+ () => ee.create("messages", u, {}, !0, {
163
+ timeout: Ae
164
+ })
165
+ ).then((i) => {
166
+ if (i?.data?.success) {
167
+ if (m)
168
+ H(i.data.data.resource), F(
137
169
  r.formatMessage({
138
170
  id: "alert.argument_create",
139
171
  defaultMessage: "Your contribution has been sent !"
@@ -147,12 +179,12 @@ const lt = ze(() => import("../../modal/side_modal/index.js").then((N) => ({ def
147
179
  }
148
180
  );
149
181
  else {
150
- const h = o.data.data.resource;
151
- let F = N;
152
- t && !m && (F = `argumentList${h.position.id}`), R?.(
153
- D,
154
- a.find((Ye) => Ye.id === t) || null
155
- ), L.add(F, [h]), j(
182
+ const _ = i.data.data.resource;
183
+ let B = x;
184
+ t && !g && (B = `argumentList${_.position.id}`), H?.(
185
+ W,
186
+ a.find((He) => He.id === t) || null
187
+ ), T.add(B, [_]), F(
156
188
  r.formatMessage({
157
189
  id: "alert.argument_create",
158
190
  defaultMessage: "Your contribution has been sent !"
@@ -164,57 +196,68 @@ const lt = ze(() => import("../../modal/side_modal/index.js").then((N) => ({ def
164
196
  defaultMessage: "Up to 10 eloquence points"
165
197
  }),
166
198
  category: "ARGUMENT",
167
- contentKey: d.messages_count === 2 ? "alert.third_argument" : "alert.first_argument"
199
+ contentKey: l.messages_count === 2 ? "alert.third_argument" : "alert.first_argument"
168
200
  }
169
201
  );
170
202
  }
171
203
  typeof window < "u" && window.dispatchEvent(
172
204
  new CustomEvent("logora:user_content:created", {
173
205
  detail: {
174
- content: o.data.data?.resource
206
+ content: i.data.data?.resource
175
207
  }
176
208
  })
177
- );
178
- }
179
- }));
180
- }, De = () => {
209
+ ), he();
210
+ } else
211
+ E("create");
212
+ }, (i) => E("create", i)));
213
+ }, Je = () => {
214
+ if (P.current)
215
+ return;
181
216
  const e = {
182
- content: D,
183
- rich_content: ae,
217
+ content: W,
218
+ rich_content: ie,
184
219
  source_ids: V?.map((t) => t.id),
185
- ...l && { position_id: l }
220
+ ...c && { position_id: c }
186
221
  };
187
- $(e, fe) && X.update("messages", se, e).then((t) => {
188
- if (t.data.success) {
189
- const c = t.data.data.resource;
190
- let o = N;
191
- if (A?.is_reply || i) {
192
- const h = A?.message_id || A?.reply_to_id || M;
193
- h && (o = `argument_${h}_reply_list`);
194
- } else l && !m && (o = `argumentList${c.position?.id}`);
195
- if (!A?.is_reply && A?.position?.id != c.position?.id && !m) {
196
- const h = `argumentList${A.position.id}`, F = `argumentList${c.position.id}`;
197
- L.remove(h, [c]), L.add(F, [c]);
222
+ q(e, _e) && pe(
223
+ () => ee.update("messages", oe, e, {}, !0, {
224
+ timeout: Ae
225
+ })
226
+ ).then(
227
+ (t) => {
228
+ if (t?.data?.success) {
229
+ const u = t.data.data.resource;
230
+ let i = x;
231
+ if (A?.is_reply || o) {
232
+ const _ = A?.message_id || A?.reply_to_id || m;
233
+ _ && (i = `argument_${_}_reply_list`);
234
+ } else c && !g && (i = `argumentList${u.position?.id}`);
235
+ if (!A?.is_reply && A?.position?.id != u.position?.id && !g) {
236
+ const _ = `argumentList${A.position.id}`, B = `argumentList${u.position.id}`;
237
+ T.remove(_, [u]), T.add(B, [u]);
238
+ } else
239
+ T.update(i, [u]);
240
+ Q && Q(u), F(r.formatMessage({ id: "alert.argument_modify" }), {
241
+ type: "success"
242
+ }), he();
198
243
  } else
199
- L.update(o, [c]);
200
- G && G(c), j(r.formatMessage({ id: "alert.argument_modify" }), {
201
- type: "success"
202
- }), me();
203
- }
204
- });
205
- }, Ue = () => {
206
- if (!oe) {
207
- re(!0);
244
+ E("update");
245
+ },
246
+ (t) => E("update", t)
247
+ );
248
+ }, Ke = () => {
249
+ if (!ue) {
250
+ de(!0);
208
251
  const e = setTimeout(() => {
209
- re(!1);
252
+ de(!1);
210
253
  }, 2e3);
211
254
  return () => clearTimeout(e);
212
255
  }
213
- }, O = () => {
214
- g ? k({ loginAction: "argument" }) : ue(!0);
215
- }, We = () => {
216
- const e = T.find(
217
- (t) => t.id === l
256
+ }, J = () => {
257
+ p ? j({ loginAction: "argument" }) : le(!0);
258
+ }, Ge = () => {
259
+ const e = N.find(
260
+ (t) => t.id === c
218
261
  );
219
262
  if (e)
220
263
  return r.formatMessage(
@@ -225,8 +268,8 @@ const lt = ze(() => import("../../modal/side_modal/index.js").then((N) => ({ def
225
268
  { position: e.name }
226
269
  );
227
270
  };
228
- return /* @__PURE__ */ C("div", { className: n.inputContainer, children: [
229
- J && /* @__PURE__ */ s("div", { className: n.disabledInputMask, children: ce ? r.formatMessage({
271
+ return /* @__PURE__ */ S("div", { className: n.inputContainer, children: [
272
+ K && /* @__PURE__ */ s("div", { className: n.disabledInputMask, children: ge ? r.formatMessage({
230
273
  id: "input.argument_input.user_banned",
231
274
  defaultMessage: "You are banned from the debate space."
232
275
  }) : r.formatMessage({
@@ -236,115 +279,116 @@ const lt = ze(() => import("../../modal/side_modal/index.js").then((N) => ({ def
236
279
  /* @__PURE__ */ s(
237
280
  "div",
238
281
  {
239
- className: x(n.argumentInput, {
240
- [n.flash]: oe,
241
- [n.replyInputContainer]: i
282
+ className: I(n.argumentInput, {
283
+ [n.flash]: ue,
284
+ [n.replyInputContainer]: o
242
285
  }),
243
- children: /* @__PURE__ */ s("div", { "data-tid": "action_add_argument", ref: ne, children: /* @__PURE__ */ C("div", { className: n.argumentInputBox, children: [
244
- a.length > 0 && S && (!i || !z) && /* @__PURE__ */ C("div", { className: n.userPosition, children: [
286
+ children: /* @__PURE__ */ s("div", { "data-tid": "action_add_argument", ref: se, children: /* @__PURE__ */ S("div", { className: n.argumentInputBox, children: [
287
+ a.length > 0 && C && (!o || !z) && /* @__PURE__ */ S("div", { className: n.userPosition, children: [
245
288
  /* @__PURE__ */ s("div", { children: r.formatMessage({
246
289
  id: "input.position",
247
290
  defaultMessage: "Your position"
248
291
  }) }),
249
292
  /* @__PURE__ */ s(
250
- it,
293
+ gt,
251
294
  {
252
- activeLabel: l === a[0].id ? 0 : l === a[1].id ? 1 : null,
295
+ activeLabel: c === a[0].id ? 0 : c === a[1].id ? 1 : null,
253
296
  firstLabel: a[0],
254
297
  secondLabel: a[1],
255
- onChange: (e) => b(a[e].id)
298
+ onChange: (e) => v(a[e].id)
256
299
  }
257
300
  )
258
301
  ] }),
259
- /* @__PURE__ */ C(
302
+ /* @__PURE__ */ S(
260
303
  "div",
261
304
  {
262
- className: x(n.argumentTextInputBox, {
263
- [n.argumentTextInputBoxisTablet]: !m,
264
- [n.replyEditorRow]: i
305
+ className: I(n.argumentTextInputBox, {
306
+ [n.argumentTextInputBoxisTablet]: !g,
307
+ [n.replyEditorRow]: o
265
308
  }),
266
309
  children: [
267
310
  /* @__PURE__ */ s(
268
311
  "div",
269
312
  {
270
- className: x(n.argumentAuthorContainer, {
271
- [n.argumentAuthorContainerMobile]: m,
272
- [n.argumentAuthorContainerActivated]: !m && I || i
313
+ className: I(n.argumentAuthorContainer, {
314
+ [n.argumentAuthorContainerMobile]: g,
315
+ [n.argumentAuthorContainerActivated]: !g && y || o
273
316
  }),
274
- children: !m && I || i ? /* @__PURE__ */ s(
275
- ot,
317
+ children: !g && y || o ? /* @__PURE__ */ s(
318
+ ht,
276
319
  {
277
- avatarUrl: d.image_url,
278
- userName: d.full_name,
279
- size: pe
320
+ avatarUrl: l.image_url,
321
+ userName: l.full_name,
322
+ size: Se
280
323
  }
281
324
  ) : /* @__PURE__ */ s(
282
- rt,
325
+ pt,
283
326
  {
284
- fullName: d?.full_name || r.formatMessage({ id: "default_author.full_name" }),
285
- avatarUrl: d?.image_url,
286
- points: d?.points || 0,
287
- slug: d?.hash_id
327
+ fullName: l?.full_name || r.formatMessage({ id: "default_author.full_name" }),
328
+ avatarUrl: l?.image_url,
329
+ points: l?.points || 0,
330
+ slug: l?.hash_id
288
331
  }
289
332
  )
290
333
  }
291
334
  ),
292
- /* @__PURE__ */ C(
335
+ /* @__PURE__ */ S(
293
336
  "div",
294
337
  {
295
- onClick: O,
338
+ onClick: J,
296
339
  "data-testid": "argument-input",
297
- className: x(n.textEditorBox, {
298
- [n.replyTextEditorBox]: i
340
+ className: I(n.textEditorBox, {
341
+ [n.replyTextEditorBox]: o
299
342
  }),
300
343
  children: [
301
344
  /* @__PURE__ */ s(
302
- ut,
345
+ _t,
303
346
  {
304
347
  handleChange: (e, t) => {
305
- Ve(e, t);
348
+ je(e, t);
306
349
  },
307
350
  handleSourcesChange: (e) => {
308
- qe(e);
351
+ ze(e);
309
352
  },
310
- placeholder: ve,
353
+ placeholder: Ie,
311
354
  "aria-label": r.formatMessage({
312
355
  id: "input.argument_input.aria_label",
313
356
  defaultMessage: "Message input field"
314
357
  }),
315
- onSubmit: $e,
358
+ onSubmit: Re,
316
359
  sources: V,
317
- hideSourceAction: Me || g,
318
- uid: M ? `Reply${_}_${M}` : `Argument${_}`,
319
- onActivation: O,
320
- showStylesControls: I,
321
- disabled: J || g || ce,
322
- maxLength: g ? !1 : v?.actions?.argumentMaxLength,
323
- disableRichText: v?.actions?.disableRichText || g,
324
- shortBar: i,
325
- isReply: i,
326
- resetSignal: Ne,
327
- hideSubmit: g,
328
- allowedDomains: v?.allowed_sources,
329
- active: P,
330
- autoFocus: xe,
331
- hideCharCount: Ce,
332
- disableAutoActivate: we
360
+ hideSourceAction: Ce || p,
361
+ uid: m ? `Reply${f}_${m}` : `Argument${f}`,
362
+ onActivation: J,
363
+ showStylesControls: y,
364
+ disabled: K || p || ge,
365
+ maxLength: p ? !1 : b?.actions?.argumentMaxLength,
366
+ disableRichText: b?.actions?.disableRichText || p,
367
+ shortBar: o,
368
+ isReply: o,
369
+ resetSignal: Be,
370
+ hideSubmit: p,
371
+ allowedDomains: b?.allowed_sources,
372
+ active: Y,
373
+ autoFocus: Ee,
374
+ hideCharCount: Te,
375
+ disableAutoActivate: Le,
376
+ submitting: $e
333
377
  }
334
378
  ),
335
- E?.content && /* @__PURE__ */ s("div", { className: n.argumentInputWarning, children: E && Object.values(E).map((e, t) => /* @__PURE__ */ s("div", { children: e }, t)) }),
336
- I && T?.find(
337
- (e) => e.id === l
338
- ) && /* @__PURE__ */ C(
379
+ U?.content && /* @__PURE__ */ s("div", { className: n.argumentInputWarning, children: U && Object.values(U).map((e, t) => /* @__PURE__ */ s("div", { children: e }, t)) }),
380
+ y && N?.find(
381
+ (e) => e.id === c
382
+ ) && /* @__PURE__ */ S(
339
383
  "div",
340
384
  {
341
- className: x(
385
+ className: I(
342
386
  n.argumentInputWarning,
343
387
  n.disabledPositionWarning
344
388
  ),
345
389
  children: [
346
390
  /* @__PURE__ */ s(
347
- dt,
391
+ Mt,
348
392
  {
349
393
  name: "announcement",
350
394
  className: n.warningIcon,
@@ -352,12 +396,12 @@ const lt = ze(() => import("../../modal/side_modal/index.js").then((N) => ({ def
352
396
  width: 20
353
397
  }
354
398
  ),
355
- /* @__PURE__ */ s("div", { className: n.argumentInputWarningText, children: We() })
399
+ /* @__PURE__ */ s("div", { className: n.argumentInputWarningText, children: Ge() })
356
400
  ]
357
401
  }
358
402
  ),
359
- I && H && !Ae && /* @__PURE__ */ s("div", { className: n.guideMessage, children: /* @__PURE__ */ s(
360
- he,
403
+ y && X && !Ne && /* @__PURE__ */ s("div", { className: n.guideMessage, children: /* @__PURE__ */ s(
404
+ ve,
361
405
  {
362
406
  id: "alert.guide_message",
363
407
  defaultMessage: "Contributions must comply with our {userCharter}.",
@@ -366,11 +410,11 @@ const lt = ze(() => import("../../modal/side_modal/index.js").then((N) => ({ def
366
410
  "a",
367
411
  {
368
412
  className: n.guideMessage,
369
- href: H,
413
+ href: X,
370
414
  target: "_blank",
371
415
  rel: "noreferrer",
372
416
  children: /* @__PURE__ */ s(
373
- he,
417
+ ve,
374
418
  {
375
419
  id: "alert.user_charter",
376
420
  defaultMessage: "user charter"
@@ -393,5 +437,5 @@ const lt = ze(() => import("../../modal/side_modal/index.js").then((N) => ({ def
393
437
  ] });
394
438
  };
395
439
  export {
396
- Et as ArgumentInput
440
+ Rt as ArgumentInput
397
441
  };