@ethora/chat-component 26.7.6 → 26.7.7

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.
Files changed (47) hide show
  1. package/dist/ChatProfileModal-DehQM4Bo.js +2135 -0
  2. package/dist/FilePreviewModal-BcZLtVAy.js +743 -0
  3. package/dist/{ManageDataModal-CDPXcC93.js → ManageDataModal-DWabKhSC.js} +68 -49
  4. package/dist/{MarkdownBody-DBJGraWM.js → MarkdownBody-CSY3YKDh.js} +1 -1
  5. package/dist/{SideDrawer-Dr_lkaOW.js → SideDrawer-DewJ-iPn.js} +110 -66
  6. package/dist/UserProfileModal-BHZ0TULc.js +574 -0
  7. package/dist/{UserSettingsModal-OcAJao-d.js → UserSettingsModal-BxwVWNKo.js} +2 -2
  8. package/dist/{VideoCallOverlay-CC4sShdK.js → VideoCallOverlay-D5SuimGP.js} +1 -1
  9. package/dist/{VisibilityModal-DkMhx_2k.js → VisibilityModal-Bd67b4EM.js} +2 -2
  10. package/dist/components/MainComponents/ChatRoomOpeningPreview.d.ts +24 -0
  11. package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
  12. package/dist/components/MainComponents/ChooseChatMessage.d.ts +11 -1
  13. package/dist/components/Modals/Modal/Modal.d.ts +10 -0
  14. package/dist/components/Modals/Modal/ModalContent.d.ts +21 -0
  15. package/dist/components/Modals/ModalBox/ModalBox.d.ts +9 -0
  16. package/dist/components/Modals/ModalReportChat/ModalReportChat.d.ts +6 -1
  17. package/dist/components/Modals/ModalWrapper/ModalWrapper.d.ts +8 -0
  18. package/dist/components/Modals/SettingsModals/SharedStyledComponents.d.ts +12 -0
  19. package/dist/components/Modals/SideDrawer/DrawerProfileParts.d.ts +29 -0
  20. package/dist/components/Modals/SideDrawer/SideDrawer.d.ts +21 -1
  21. package/dist/components/Modals/SidePanel/SidePanel.d.ts +31 -0
  22. package/dist/components/Modals/UserProfileModal/EditUserModal.d.ts +5 -1
  23. package/dist/components/Modals/motionVariants.d.ts +37 -0
  24. package/dist/components/Modals/styledModalComponents.d.ts +0 -1
  25. package/dist/context/ModalTransitionContext.d.ts +2 -0
  26. package/dist/handleCopyClick-BoZWTBLC.js +108 -0
  27. package/dist/helpers/buildChatShareLink.d.ts +20 -0
  28. package/dist/helpers/cacheScope.d.ts +15 -1
  29. package/dist/helpers/constants/MODAL_TYPES.d.ts +6 -4
  30. package/dist/helpers/createRoomFromApi.d.ts +1 -1
  31. package/dist/helpers/formatNumberWithCommas.d.ts +1 -1
  32. package/dist/hooks/useChatOpenPhase.d.ts +21 -0
  33. package/dist/hooks/useDelayedAction.d.ts +22 -0
  34. package/dist/hooks/useExclusiveRightPane.d.ts +25 -0
  35. package/dist/hooks/useExitTransition.d.ts +24 -0
  36. package/dist/hooks/useGetNewArchRoom.d.ts +3 -1
  37. package/dist/hooks/useQRCodeChatHandler.d.ts +29 -1
  38. package/dist/{main-B-8IhwaP.js → main-C2FKeV6y.js} +8107 -7569
  39. package/dist/main.css +1 -1
  40. package/dist/main.js +5 -5
  41. package/dist/styles/motion.d.ts +27 -0
  42. package/dist/types/models/room.model.d.ts +28 -0
  43. package/package.json +1 -1
  44. package/dist/ChatProfileModal-hxsWI8cx.js +0 -2139
  45. package/dist/FilePreviewModal-CwWnHsB1.js +0 -736
  46. package/dist/UserProfileModal-Q_jhXpsX.js +0 -568
  47. package/dist/handleCopyClick-CpmPa6VI.js +0 -32
@@ -1,2139 +0,0 @@
1
- import { jsx as T, jsxs as k, Fragment as je } from "react/jsx-runtime";
2
- import Ue, { useEffect as jt, useRef as yt, useState as ee, useMemo as le } from "react";
3
- import { S as Nt, D as de, a as he, b as pe, e as ce, f as ve, g as Te, c as $t, h as We, i as Ut } from "./SideDrawer-Dr_lkaOW.js";
4
- import { h as qt, P as zt, a as Ft, c as Qt } from "./handleCopyClick-CpmPa6VI.js";
5
- import { m as Yt, x as Ee, b as bt, a3 as Ht, a4 as qe, a5 as Wt, B as ne, z as Gt, a6 as Kt, a as ze, u as fe, a7 as Fe, F as Et, n as Qe, w as Tt, a8 as Ct, a9 as Rt, aa as Xt, ab as Ne, ac as Jt, ad as Vt, a1 as Zt, J as wt, Z as er, ae as tr, af as $e, ag as rr, ah as be, ai as nr, P as Pt, aj as or, ak as ar, W as _t, v as ir, al as sr, am as lr, an as ur, ao as cr, ap as fr, aq as dr, o as Ge, ar as hr, as as pr, at as vr, au as mr, av as gr, aw as yr, X as br, ax as Er, ay as Tr, M as Cr, K as Rr, az as Ke } from "./main-B-8IhwaP.js";
6
- var ue = {}, me = { exports: {} }, ge = { exports: {} }, I = {};
7
- var Xe;
8
- function wr() {
9
- if (Xe) return I;
10
- Xe = 1;
11
- var o = typeof Symbol == "function" && Symbol.for, p = o ? /* @__PURE__ */ Symbol.for("react.element") : 60103, a = o ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, f = o ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, d = o ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, r = o ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, u = o ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, n = o ? /* @__PURE__ */ Symbol.for("react.context") : 60110, t = o ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, e = o ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, s = o ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, i = o ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, c = o ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, g = o ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, v = o ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, m = o ? /* @__PURE__ */ Symbol.for("react.block") : 60121, R = o ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, E = o ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, j = o ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
12
- function N(l) {
13
- if (typeof l == "object" && l !== null) {
14
- var z = l.$$typeof;
15
- switch (z) {
16
- case p:
17
- switch (l = l.type, l) {
18
- case t:
19
- case e:
20
- case f:
21
- case r:
22
- case d:
23
- case i:
24
- return l;
25
- default:
26
- switch (l = l && l.$$typeof, l) {
27
- case n:
28
- case s:
29
- case v:
30
- case g:
31
- case u:
32
- return l;
33
- default:
34
- return z;
35
- }
36
- }
37
- case a:
38
- return z;
39
- }
40
- }
41
- }
42
- function A(l) {
43
- return N(l) === e;
44
- }
45
- return I.AsyncMode = t, I.ConcurrentMode = e, I.ContextConsumer = n, I.ContextProvider = u, I.Element = p, I.ForwardRef = s, I.Fragment = f, I.Lazy = v, I.Memo = g, I.Portal = a, I.Profiler = r, I.StrictMode = d, I.Suspense = i, I.isAsyncMode = function(l) {
46
- return A(l) || N(l) === t;
47
- }, I.isConcurrentMode = A, I.isContextConsumer = function(l) {
48
- return N(l) === n;
49
- }, I.isContextProvider = function(l) {
50
- return N(l) === u;
51
- }, I.isElement = function(l) {
52
- return typeof l == "object" && l !== null && l.$$typeof === p;
53
- }, I.isForwardRef = function(l) {
54
- return N(l) === s;
55
- }, I.isFragment = function(l) {
56
- return N(l) === f;
57
- }, I.isLazy = function(l) {
58
- return N(l) === v;
59
- }, I.isMemo = function(l) {
60
- return N(l) === g;
61
- }, I.isPortal = function(l) {
62
- return N(l) === a;
63
- }, I.isProfiler = function(l) {
64
- return N(l) === r;
65
- }, I.isStrictMode = function(l) {
66
- return N(l) === d;
67
- }, I.isSuspense = function(l) {
68
- return N(l) === i;
69
- }, I.isValidElementType = function(l) {
70
- return typeof l == "string" || typeof l == "function" || l === f || l === e || l === r || l === d || l === i || l === c || typeof l == "object" && l !== null && (l.$$typeof === v || l.$$typeof === g || l.$$typeof === u || l.$$typeof === n || l.$$typeof === s || l.$$typeof === R || l.$$typeof === E || l.$$typeof === j || l.$$typeof === m);
71
- }, I.typeOf = N, I;
72
- }
73
- var B = {};
74
- var Je;
75
- function Pr() {
76
- return Je || (Je = 1, process.env.NODE_ENV !== "production" && (function() {
77
- var o = typeof Symbol == "function" && Symbol.for, p = o ? /* @__PURE__ */ Symbol.for("react.element") : 60103, a = o ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, f = o ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, d = o ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, r = o ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, u = o ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, n = o ? /* @__PURE__ */ Symbol.for("react.context") : 60110, t = o ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, e = o ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, s = o ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, i = o ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, c = o ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, g = o ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, v = o ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, m = o ? /* @__PURE__ */ Symbol.for("react.block") : 60121, R = o ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, E = o ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, j = o ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
78
- function N(y) {
79
- return typeof y == "string" || typeof y == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
80
- y === f || y === e || y === r || y === d || y === i || y === c || typeof y == "object" && y !== null && (y.$$typeof === v || y.$$typeof === g || y.$$typeof === u || y.$$typeof === n || y.$$typeof === s || y.$$typeof === R || y.$$typeof === E || y.$$typeof === j || y.$$typeof === m);
81
- }
82
- function A(y) {
83
- if (typeof y == "object" && y !== null) {
84
- var H = y.$$typeof;
85
- switch (H) {
86
- case p:
87
- var re = y.type;
88
- switch (re) {
89
- case t:
90
- case e:
91
- case f:
92
- case r:
93
- case d:
94
- case i:
95
- return re;
96
- default:
97
- var ie = re && re.$$typeof;
98
- switch (ie) {
99
- case n:
100
- case s:
101
- case v:
102
- case g:
103
- case u:
104
- return ie;
105
- default:
106
- return H;
107
- }
108
- }
109
- case a:
110
- return H;
111
- }
112
- }
113
- }
114
- var l = t, z = e, Q = n, G = u, oe = p, te = s, W = f, V = v, Y = g, F = a, K = r, U = d, Z = i, ae = !1;
115
- function X(y) {
116
- return ae || (ae = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), h(y) || A(y) === t;
117
- }
118
- function h(y) {
119
- return A(y) === e;
120
- }
121
- function b(y) {
122
- return A(y) === n;
123
- }
124
- function x(y) {
125
- return A(y) === u;
126
- }
127
- function _(y) {
128
- return typeof y == "object" && y !== null && y.$$typeof === p;
129
- }
130
- function w(y) {
131
- return A(y) === s;
132
- }
133
- function D(y) {
134
- return A(y) === f;
135
- }
136
- function P(y) {
137
- return A(y) === v;
138
- }
139
- function S(y) {
140
- return A(y) === g;
141
- }
142
- function O(y) {
143
- return A(y) === a;
144
- }
145
- function M(y) {
146
- return A(y) === r;
147
- }
148
- function L(y) {
149
- return A(y) === d;
150
- }
151
- function q(y) {
152
- return A(y) === i;
153
- }
154
- B.AsyncMode = l, B.ConcurrentMode = z, B.ContextConsumer = Q, B.ContextProvider = G, B.Element = oe, B.ForwardRef = te, B.Fragment = W, B.Lazy = V, B.Memo = Y, B.Portal = F, B.Profiler = K, B.StrictMode = U, B.Suspense = Z, B.isAsyncMode = X, B.isConcurrentMode = h, B.isContextConsumer = b, B.isContextProvider = x, B.isElement = _, B.isForwardRef = w, B.isFragment = D, B.isLazy = P, B.isMemo = S, B.isPortal = O, B.isProfiler = M, B.isStrictMode = L, B.isSuspense = q, B.isValidElementType = N, B.typeOf = A;
155
- })()), B;
156
- }
157
- var Ve;
158
- function St() {
159
- return Ve || (Ve = 1, process.env.NODE_ENV === "production" ? ge.exports = wr() : ge.exports = Pr()), ge.exports;
160
- }
161
- var Ce, Ze;
162
- function _r() {
163
- if (Ze) return Ce;
164
- Ze = 1;
165
- var o = Object.getOwnPropertySymbols, p = Object.prototype.hasOwnProperty, a = Object.prototype.propertyIsEnumerable;
166
- function f(r) {
167
- if (r == null)
168
- throw new TypeError("Object.assign cannot be called with null or undefined");
169
- return Object(r);
170
- }
171
- function d() {
172
- try {
173
- if (!Object.assign)
174
- return !1;
175
- var r = new String("abc");
176
- if (r[5] = "de", Object.getOwnPropertyNames(r)[0] === "5")
177
- return !1;
178
- for (var u = {}, n = 0; n < 10; n++)
179
- u["_" + String.fromCharCode(n)] = n;
180
- var t = Object.getOwnPropertyNames(u).map(function(s) {
181
- return u[s];
182
- });
183
- if (t.join("") !== "0123456789")
184
- return !1;
185
- var e = {};
186
- return "abcdefghijklmnopqrst".split("").forEach(function(s) {
187
- e[s] = s;
188
- }), Object.keys(Object.assign({}, e)).join("") === "abcdefghijklmnopqrst";
189
- } catch {
190
- return !1;
191
- }
192
- }
193
- return Ce = d() ? Object.assign : function(r, u) {
194
- for (var n, t = f(r), e, s = 1; s < arguments.length; s++) {
195
- n = Object(arguments[s]);
196
- for (var i in n)
197
- p.call(n, i) && (t[i] = n[i]);
198
- if (o) {
199
- e = o(n);
200
- for (var c = 0; c < e.length; c++)
201
- a.call(n, e[c]) && (t[e[c]] = n[e[c]]);
202
- }
203
- }
204
- return t;
205
- }, Ce;
206
- }
207
- var Re, et;
208
- function Ye() {
209
- if (et) return Re;
210
- et = 1;
211
- var o = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
212
- return Re = o, Re;
213
- }
214
- var we, tt;
215
- function xt() {
216
- return tt || (tt = 1, we = Function.call.bind(Object.prototype.hasOwnProperty)), we;
217
- }
218
- var Pe, rt;
219
- function Sr() {
220
- if (rt) return Pe;
221
- rt = 1;
222
- var o = function() {
223
- };
224
- if (process.env.NODE_ENV !== "production") {
225
- var p = /* @__PURE__ */ Ye(), a = {}, f = /* @__PURE__ */ xt();
226
- o = function(r) {
227
- var u = "Warning: " + r;
228
- typeof console < "u" && console.error(u);
229
- try {
230
- throw new Error(u);
231
- } catch {
232
- }
233
- };
234
- }
235
- function d(r, u, n, t, e) {
236
- if (process.env.NODE_ENV !== "production") {
237
- for (var s in r)
238
- if (f(r, s)) {
239
- var i;
240
- try {
241
- if (typeof r[s] != "function") {
242
- var c = Error(
243
- (t || "React class") + ": " + n + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
244
- );
245
- throw c.name = "Invariant Violation", c;
246
- }
247
- i = r[s](u, s, t, n, null, p);
248
- } catch (v) {
249
- i = v;
250
- }
251
- if (i && !(i instanceof Error) && o(
252
- (t || "React class") + ": type specification of " + n + " `" + s + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof i + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
253
- ), i instanceof Error && !(i.message in a)) {
254
- a[i.message] = !0;
255
- var g = e ? e() : "";
256
- o(
257
- "Failed " + n + " type: " + i.message + (g ?? "")
258
- );
259
- }
260
- }
261
- }
262
- }
263
- return d.resetWarningCache = function() {
264
- process.env.NODE_ENV !== "production" && (a = {});
265
- }, Pe = d, Pe;
266
- }
267
- var _e, nt;
268
- function xr() {
269
- if (nt) return _e;
270
- nt = 1;
271
- var o = St(), p = _r(), a = /* @__PURE__ */ Ye(), f = /* @__PURE__ */ xt(), d = /* @__PURE__ */ Sr(), r = function() {
272
- };
273
- process.env.NODE_ENV !== "production" && (r = function(n) {
274
- var t = "Warning: " + n;
275
- typeof console < "u" && console.error(t);
276
- try {
277
- throw new Error(t);
278
- } catch {
279
- }
280
- });
281
- function u() {
282
- return null;
283
- }
284
- return _e = function(n, t) {
285
- var e = typeof Symbol == "function" && Symbol.iterator, s = "@@iterator";
286
- function i(h) {
287
- var b = h && (e && h[e] || h[s]);
288
- if (typeof b == "function")
289
- return b;
290
- }
291
- var c = "<<anonymous>>", g = {
292
- array: E("array"),
293
- bigint: E("bigint"),
294
- bool: E("boolean"),
295
- func: E("function"),
296
- number: E("number"),
297
- object: E("object"),
298
- string: E("string"),
299
- symbol: E("symbol"),
300
- any: j(),
301
- arrayOf: N,
302
- element: A(),
303
- elementType: l(),
304
- instanceOf: z,
305
- node: te(),
306
- objectOf: G,
307
- oneOf: Q,
308
- oneOfType: oe,
309
- shape: V,
310
- exact: Y
311
- };
312
- function v(h, b) {
313
- return h === b ? h !== 0 || 1 / h === 1 / b : h !== h && b !== b;
314
- }
315
- function m(h, b) {
316
- this.message = h, this.data = b && typeof b == "object" ? b : {}, this.stack = "";
317
- }
318
- m.prototype = Error.prototype;
319
- function R(h) {
320
- if (process.env.NODE_ENV !== "production")
321
- var b = {}, x = 0;
322
- function _(D, P, S, O, M, L, q) {
323
- if (O = O || c, L = L || S, q !== a) {
324
- if (t) {
325
- var y = new Error(
326
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
327
- );
328
- throw y.name = "Invariant Violation", y;
329
- } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
330
- var H = O + ":" + S;
331
- !b[H] && // Avoid spamming the console because they are often not actionable except for lib authors
332
- x < 3 && (r(
333
- "You are manually calling a React.PropTypes validation function for the `" + L + "` prop on `" + O + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
334
- ), b[H] = !0, x++);
335
- }
336
- }
337
- return P[S] == null ? D ? P[S] === null ? new m("The " + M + " `" + L + "` is marked as required " + ("in `" + O + "`, but its value is `null`.")) : new m("The " + M + " `" + L + "` is marked as required in " + ("`" + O + "`, but its value is `undefined`.")) : null : h(P, S, O, M, L);
338
- }
339
- var w = _.bind(null, !1);
340
- return w.isRequired = _.bind(null, !0), w;
341
- }
342
- function E(h) {
343
- function b(x, _, w, D, P, S) {
344
- var O = x[_], M = U(O);
345
- if (M !== h) {
346
- var L = Z(O);
347
- return new m(
348
- "Invalid " + D + " `" + P + "` of type " + ("`" + L + "` supplied to `" + w + "`, expected ") + ("`" + h + "`."),
349
- { expectedType: h }
350
- );
351
- }
352
- return null;
353
- }
354
- return R(b);
355
- }
356
- function j() {
357
- return R(u);
358
- }
359
- function N(h) {
360
- function b(x, _, w, D, P) {
361
- if (typeof h != "function")
362
- return new m("Property `" + P + "` of component `" + w + "` has invalid PropType notation inside arrayOf.");
363
- var S = x[_];
364
- if (!Array.isArray(S)) {
365
- var O = U(S);
366
- return new m("Invalid " + D + " `" + P + "` of type " + ("`" + O + "` supplied to `" + w + "`, expected an array."));
367
- }
368
- for (var M = 0; M < S.length; M++) {
369
- var L = h(S, M, w, D, P + "[" + M + "]", a);
370
- if (L instanceof Error)
371
- return L;
372
- }
373
- return null;
374
- }
375
- return R(b);
376
- }
377
- function A() {
378
- function h(b, x, _, w, D) {
379
- var P = b[x];
380
- if (!n(P)) {
381
- var S = U(P);
382
- return new m("Invalid " + w + " `" + D + "` of type " + ("`" + S + "` supplied to `" + _ + "`, expected a single ReactElement."));
383
- }
384
- return null;
385
- }
386
- return R(h);
387
- }
388
- function l() {
389
- function h(b, x, _, w, D) {
390
- var P = b[x];
391
- if (!o.isValidElementType(P)) {
392
- var S = U(P);
393
- return new m("Invalid " + w + " `" + D + "` of type " + ("`" + S + "` supplied to `" + _ + "`, expected a single ReactElement type."));
394
- }
395
- return null;
396
- }
397
- return R(h);
398
- }
399
- function z(h) {
400
- function b(x, _, w, D, P) {
401
- if (!(x[_] instanceof h)) {
402
- var S = h.name || c, O = X(x[_]);
403
- return new m("Invalid " + D + " `" + P + "` of type " + ("`" + O + "` supplied to `" + w + "`, expected ") + ("instance of `" + S + "`."));
404
- }
405
- return null;
406
- }
407
- return R(b);
408
- }
409
- function Q(h) {
410
- if (!Array.isArray(h))
411
- return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? r(
412
- "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
413
- ) : r("Invalid argument supplied to oneOf, expected an array.")), u;
414
- function b(x, _, w, D, P) {
415
- for (var S = x[_], O = 0; O < h.length; O++)
416
- if (v(S, h[O]))
417
- return null;
418
- var M = JSON.stringify(h, function(q, y) {
419
- var H = Z(y);
420
- return H === "symbol" ? String(y) : y;
421
- });
422
- return new m("Invalid " + D + " `" + P + "` of value `" + String(S) + "` " + ("supplied to `" + w + "`, expected one of " + M + "."));
423
- }
424
- return R(b);
425
- }
426
- function G(h) {
427
- function b(x, _, w, D, P) {
428
- if (typeof h != "function")
429
- return new m("Property `" + P + "` of component `" + w + "` has invalid PropType notation inside objectOf.");
430
- var S = x[_], O = U(S);
431
- if (O !== "object")
432
- return new m("Invalid " + D + " `" + P + "` of type " + ("`" + O + "` supplied to `" + w + "`, expected an object."));
433
- for (var M in S)
434
- if (f(S, M)) {
435
- var L = h(S, M, w, D, P + "." + M, a);
436
- if (L instanceof Error)
437
- return L;
438
- }
439
- return null;
440
- }
441
- return R(b);
442
- }
443
- function oe(h) {
444
- if (!Array.isArray(h))
445
- return process.env.NODE_ENV !== "production" && r("Invalid argument supplied to oneOfType, expected an instance of array."), u;
446
- for (var b = 0; b < h.length; b++) {
447
- var x = h[b];
448
- if (typeof x != "function")
449
- return r(
450
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ae(x) + " at index " + b + "."
451
- ), u;
452
- }
453
- function _(w, D, P, S, O) {
454
- for (var M = [], L = 0; L < h.length; L++) {
455
- var q = h[L], y = q(w, D, P, S, O, a);
456
- if (y == null)
457
- return null;
458
- y.data && f(y.data, "expectedType") && M.push(y.data.expectedType);
459
- }
460
- var H = M.length > 0 ? ", expected one of type [" + M.join(", ") + "]" : "";
461
- return new m("Invalid " + S + " `" + O + "` supplied to " + ("`" + P + "`" + H + "."));
462
- }
463
- return R(_);
464
- }
465
- function te() {
466
- function h(b, x, _, w, D) {
467
- return F(b[x]) ? null : new m("Invalid " + w + " `" + D + "` supplied to " + ("`" + _ + "`, expected a ReactNode."));
468
- }
469
- return R(h);
470
- }
471
- function W(h, b, x, _, w) {
472
- return new m(
473
- (h || "React class") + ": " + b + " type `" + x + "." + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + w + "`."
474
- );
475
- }
476
- function V(h) {
477
- function b(x, _, w, D, P) {
478
- var S = x[_], O = U(S);
479
- if (O !== "object")
480
- return new m("Invalid " + D + " `" + P + "` of type `" + O + "` " + ("supplied to `" + w + "`, expected `object`."));
481
- for (var M in h) {
482
- var L = h[M];
483
- if (typeof L != "function")
484
- return W(w, D, P, M, Z(L));
485
- var q = L(S, M, w, D, P + "." + M, a);
486
- if (q)
487
- return q;
488
- }
489
- return null;
490
- }
491
- return R(b);
492
- }
493
- function Y(h) {
494
- function b(x, _, w, D, P) {
495
- var S = x[_], O = U(S);
496
- if (O !== "object")
497
- return new m("Invalid " + D + " `" + P + "` of type `" + O + "` " + ("supplied to `" + w + "`, expected `object`."));
498
- var M = p({}, x[_], h);
499
- for (var L in M) {
500
- var q = h[L];
501
- if (f(h, L) && typeof q != "function")
502
- return W(w, D, P, L, Z(q));
503
- if (!q)
504
- return new m(
505
- "Invalid " + D + " `" + P + "` key `" + L + "` supplied to `" + w + "`.\nBad object: " + JSON.stringify(x[_], null, " ") + `
506
- Valid keys: ` + JSON.stringify(Object.keys(h), null, " ")
507
- );
508
- var y = q(S, L, w, D, P + "." + L, a);
509
- if (y)
510
- return y;
511
- }
512
- return null;
513
- }
514
- return R(b);
515
- }
516
- function F(h) {
517
- switch (typeof h) {
518
- case "number":
519
- case "string":
520
- case "undefined":
521
- return !0;
522
- case "boolean":
523
- return !h;
524
- case "object":
525
- if (Array.isArray(h))
526
- return h.every(F);
527
- if (h === null || n(h))
528
- return !0;
529
- var b = i(h);
530
- if (b) {
531
- var x = b.call(h), _;
532
- if (b !== h.entries) {
533
- for (; !(_ = x.next()).done; )
534
- if (!F(_.value))
535
- return !1;
536
- } else
537
- for (; !(_ = x.next()).done; ) {
538
- var w = _.value;
539
- if (w && !F(w[1]))
540
- return !1;
541
- }
542
- } else
543
- return !1;
544
- return !0;
545
- default:
546
- return !1;
547
- }
548
- }
549
- function K(h, b) {
550
- return h === "symbol" ? !0 : b ? b["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && b instanceof Symbol : !1;
551
- }
552
- function U(h) {
553
- var b = typeof h;
554
- return Array.isArray(h) ? "array" : h instanceof RegExp ? "object" : K(b, h) ? "symbol" : b;
555
- }
556
- function Z(h) {
557
- if (typeof h > "u" || h === null)
558
- return "" + h;
559
- var b = U(h);
560
- if (b === "object") {
561
- if (h instanceof Date)
562
- return "date";
563
- if (h instanceof RegExp)
564
- return "regexp";
565
- }
566
- return b;
567
- }
568
- function ae(h) {
569
- var b = Z(h);
570
- switch (b) {
571
- case "array":
572
- case "object":
573
- return "an " + b;
574
- case "boolean":
575
- case "date":
576
- case "regexp":
577
- return "a " + b;
578
- default:
579
- return b;
580
- }
581
- }
582
- function X(h) {
583
- return !h.constructor || !h.constructor.name ? c : h.constructor.name;
584
- }
585
- return g.checkPropTypes = d, g.resetWarningCache = d.resetWarningCache, g.PropTypes = g, g;
586
- }, _e;
587
- }
588
- var Se, ot;
589
- function Mr() {
590
- if (ot) return Se;
591
- ot = 1;
592
- var o = /* @__PURE__ */ Ye();
593
- function p() {
594
- }
595
- function a() {
596
- }
597
- return a.resetWarningCache = p, Se = function() {
598
- function f(u, n, t, e, s, i) {
599
- if (i !== o) {
600
- var c = new Error(
601
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
602
- );
603
- throw c.name = "Invariant Violation", c;
604
- }
605
- }
606
- f.isRequired = f;
607
- function d() {
608
- return f;
609
- }
610
- var r = {
611
- array: f,
612
- bigint: f,
613
- bool: f,
614
- func: f,
615
- number: f,
616
- object: f,
617
- string: f,
618
- symbol: f,
619
- any: f,
620
- arrayOf: d,
621
- element: f,
622
- elementType: f,
623
- instanceOf: d,
624
- node: f,
625
- objectOf: d,
626
- oneOf: d,
627
- oneOfType: d,
628
- shape: d,
629
- exact: d,
630
- checkPropTypes: a,
631
- resetWarningCache: p
632
- };
633
- return r.PropTypes = r, r;
634
- }, Se;
635
- }
636
- var at;
637
- function Mt() {
638
- if (at) return me.exports;
639
- if (at = 1, process.env.NODE_ENV !== "production") {
640
- var o = St(), p = !0;
641
- me.exports = /* @__PURE__ */ xr()(o.isElement, p);
642
- } else
643
- me.exports = /* @__PURE__ */ Mr()();
644
- return me.exports;
645
- }
646
- var xe, it;
647
- function At() {
648
- return it || (it = 1, xe = {
649
- L: 1,
650
- M: 0,
651
- Q: 3,
652
- H: 2
653
- }), xe;
654
- }
655
- var Me, st;
656
- function Dt() {
657
- return st || (st = 1, Me = {
658
- MODE_NUMBER: 1,
659
- MODE_ALPHA_NUM: 2,
660
- MODE_8BIT_BYTE: 4,
661
- MODE_KANJI: 8
662
- }), Me;
663
- }
664
- var Ae, lt;
665
- function Ar() {
666
- if (lt) return Ae;
667
- lt = 1;
668
- var o = Dt();
669
- function p(a) {
670
- this.mode = o.MODE_8BIT_BYTE, this.data = a;
671
- }
672
- return p.prototype = {
673
- getLength: function(a) {
674
- return this.data.length;
675
- },
676
- write: function(a) {
677
- for (var f = 0; f < this.data.length; f++)
678
- a.put(this.data.charCodeAt(f), 8);
679
- }
680
- }, Ae = p, Ae;
681
- }
682
- var De, ut;
683
- function Dr() {
684
- if (ut) return De;
685
- ut = 1;
686
- var o = At();
687
- function p(a, f) {
688
- this.totalCount = a, this.dataCount = f;
689
- }
690
- return p.RS_BLOCK_TABLE = [
691
- // L
692
- // M
693
- // Q
694
- // H
695
- // 1
696
- [1, 26, 19],
697
- [1, 26, 16],
698
- [1, 26, 13],
699
- [1, 26, 9],
700
- // 2
701
- [1, 44, 34],
702
- [1, 44, 28],
703
- [1, 44, 22],
704
- [1, 44, 16],
705
- // 3
706
- [1, 70, 55],
707
- [1, 70, 44],
708
- [2, 35, 17],
709
- [2, 35, 13],
710
- // 4
711
- [1, 100, 80],
712
- [2, 50, 32],
713
- [2, 50, 24],
714
- [4, 25, 9],
715
- // 5
716
- [1, 134, 108],
717
- [2, 67, 43],
718
- [2, 33, 15, 2, 34, 16],
719
- [2, 33, 11, 2, 34, 12],
720
- // 6
721
- [2, 86, 68],
722
- [4, 43, 27],
723
- [4, 43, 19],
724
- [4, 43, 15],
725
- // 7
726
- [2, 98, 78],
727
- [4, 49, 31],
728
- [2, 32, 14, 4, 33, 15],
729
- [4, 39, 13, 1, 40, 14],
730
- // 8
731
- [2, 121, 97],
732
- [2, 60, 38, 2, 61, 39],
733
- [4, 40, 18, 2, 41, 19],
734
- [4, 40, 14, 2, 41, 15],
735
- // 9
736
- [2, 146, 116],
737
- [3, 58, 36, 2, 59, 37],
738
- [4, 36, 16, 4, 37, 17],
739
- [4, 36, 12, 4, 37, 13],
740
- // 10
741
- [2, 86, 68, 2, 87, 69],
742
- [4, 69, 43, 1, 70, 44],
743
- [6, 43, 19, 2, 44, 20],
744
- [6, 43, 15, 2, 44, 16],
745
- // 11
746
- [4, 101, 81],
747
- [1, 80, 50, 4, 81, 51],
748
- [4, 50, 22, 4, 51, 23],
749
- [3, 36, 12, 8, 37, 13],
750
- // 12
751
- [2, 116, 92, 2, 117, 93],
752
- [6, 58, 36, 2, 59, 37],
753
- [4, 46, 20, 6, 47, 21],
754
- [7, 42, 14, 4, 43, 15],
755
- // 13
756
- [4, 133, 107],
757
- [8, 59, 37, 1, 60, 38],
758
- [8, 44, 20, 4, 45, 21],
759
- [12, 33, 11, 4, 34, 12],
760
- // 14
761
- [3, 145, 115, 1, 146, 116],
762
- [4, 64, 40, 5, 65, 41],
763
- [11, 36, 16, 5, 37, 17],
764
- [11, 36, 12, 5, 37, 13],
765
- // 15
766
- [5, 109, 87, 1, 110, 88],
767
- [5, 65, 41, 5, 66, 42],
768
- [5, 54, 24, 7, 55, 25],
769
- [11, 36, 12],
770
- // 16
771
- [5, 122, 98, 1, 123, 99],
772
- [7, 73, 45, 3, 74, 46],
773
- [15, 43, 19, 2, 44, 20],
774
- [3, 45, 15, 13, 46, 16],
775
- // 17
776
- [1, 135, 107, 5, 136, 108],
777
- [10, 74, 46, 1, 75, 47],
778
- [1, 50, 22, 15, 51, 23],
779
- [2, 42, 14, 17, 43, 15],
780
- // 18
781
- [5, 150, 120, 1, 151, 121],
782
- [9, 69, 43, 4, 70, 44],
783
- [17, 50, 22, 1, 51, 23],
784
- [2, 42, 14, 19, 43, 15],
785
- // 19
786
- [3, 141, 113, 4, 142, 114],
787
- [3, 70, 44, 11, 71, 45],
788
- [17, 47, 21, 4, 48, 22],
789
- [9, 39, 13, 16, 40, 14],
790
- // 20
791
- [3, 135, 107, 5, 136, 108],
792
- [3, 67, 41, 13, 68, 42],
793
- [15, 54, 24, 5, 55, 25],
794
- [15, 43, 15, 10, 44, 16],
795
- // 21
796
- [4, 144, 116, 4, 145, 117],
797
- [17, 68, 42],
798
- [17, 50, 22, 6, 51, 23],
799
- [19, 46, 16, 6, 47, 17],
800
- // 22
801
- [2, 139, 111, 7, 140, 112],
802
- [17, 74, 46],
803
- [7, 54, 24, 16, 55, 25],
804
- [34, 37, 13],
805
- // 23
806
- [4, 151, 121, 5, 152, 122],
807
- [4, 75, 47, 14, 76, 48],
808
- [11, 54, 24, 14, 55, 25],
809
- [16, 45, 15, 14, 46, 16],
810
- // 24
811
- [6, 147, 117, 4, 148, 118],
812
- [6, 73, 45, 14, 74, 46],
813
- [11, 54, 24, 16, 55, 25],
814
- [30, 46, 16, 2, 47, 17],
815
- // 25
816
- [8, 132, 106, 4, 133, 107],
817
- [8, 75, 47, 13, 76, 48],
818
- [7, 54, 24, 22, 55, 25],
819
- [22, 45, 15, 13, 46, 16],
820
- // 26
821
- [10, 142, 114, 2, 143, 115],
822
- [19, 74, 46, 4, 75, 47],
823
- [28, 50, 22, 6, 51, 23],
824
- [33, 46, 16, 4, 47, 17],
825
- // 27
826
- [8, 152, 122, 4, 153, 123],
827
- [22, 73, 45, 3, 74, 46],
828
- [8, 53, 23, 26, 54, 24],
829
- [12, 45, 15, 28, 46, 16],
830
- // 28
831
- [3, 147, 117, 10, 148, 118],
832
- [3, 73, 45, 23, 74, 46],
833
- [4, 54, 24, 31, 55, 25],
834
- [11, 45, 15, 31, 46, 16],
835
- // 29
836
- [7, 146, 116, 7, 147, 117],
837
- [21, 73, 45, 7, 74, 46],
838
- [1, 53, 23, 37, 54, 24],
839
- [19, 45, 15, 26, 46, 16],
840
- // 30
841
- [5, 145, 115, 10, 146, 116],
842
- [19, 75, 47, 10, 76, 48],
843
- [15, 54, 24, 25, 55, 25],
844
- [23, 45, 15, 25, 46, 16],
845
- // 31
846
- [13, 145, 115, 3, 146, 116],
847
- [2, 74, 46, 29, 75, 47],
848
- [42, 54, 24, 1, 55, 25],
849
- [23, 45, 15, 28, 46, 16],
850
- // 32
851
- [17, 145, 115],
852
- [10, 74, 46, 23, 75, 47],
853
- [10, 54, 24, 35, 55, 25],
854
- [19, 45, 15, 35, 46, 16],
855
- // 33
856
- [17, 145, 115, 1, 146, 116],
857
- [14, 74, 46, 21, 75, 47],
858
- [29, 54, 24, 19, 55, 25],
859
- [11, 45, 15, 46, 46, 16],
860
- // 34
861
- [13, 145, 115, 6, 146, 116],
862
- [14, 74, 46, 23, 75, 47],
863
- [44, 54, 24, 7, 55, 25],
864
- [59, 46, 16, 1, 47, 17],
865
- // 35
866
- [12, 151, 121, 7, 152, 122],
867
- [12, 75, 47, 26, 76, 48],
868
- [39, 54, 24, 14, 55, 25],
869
- [22, 45, 15, 41, 46, 16],
870
- // 36
871
- [6, 151, 121, 14, 152, 122],
872
- [6, 75, 47, 34, 76, 48],
873
- [46, 54, 24, 10, 55, 25],
874
- [2, 45, 15, 64, 46, 16],
875
- // 37
876
- [17, 152, 122, 4, 153, 123],
877
- [29, 74, 46, 14, 75, 47],
878
- [49, 54, 24, 10, 55, 25],
879
- [24, 45, 15, 46, 46, 16],
880
- // 38
881
- [4, 152, 122, 18, 153, 123],
882
- [13, 74, 46, 32, 75, 47],
883
- [48, 54, 24, 14, 55, 25],
884
- [42, 45, 15, 32, 46, 16],
885
- // 39
886
- [20, 147, 117, 4, 148, 118],
887
- [40, 75, 47, 7, 76, 48],
888
- [43, 54, 24, 22, 55, 25],
889
- [10, 45, 15, 67, 46, 16],
890
- // 40
891
- [19, 148, 118, 6, 149, 119],
892
- [18, 75, 47, 31, 76, 48],
893
- [34, 54, 24, 34, 55, 25],
894
- [20, 45, 15, 61, 46, 16]
895
- ], p.getRSBlocks = function(a, f) {
896
- var d = p.getRsBlockTable(a, f);
897
- if (d == null)
898
- throw new Error("bad rs block @ typeNumber:" + a + "/errorCorrectLevel:" + f);
899
- for (var r = d.length / 3, u = new Array(), n = 0; n < r; n++)
900
- for (var t = d[n * 3 + 0], e = d[n * 3 + 1], s = d[n * 3 + 2], i = 0; i < t; i++)
901
- u.push(new p(e, s));
902
- return u;
903
- }, p.getRsBlockTable = function(a, f) {
904
- switch (f) {
905
- case o.L:
906
- return p.RS_BLOCK_TABLE[(a - 1) * 4 + 0];
907
- case o.M:
908
- return p.RS_BLOCK_TABLE[(a - 1) * 4 + 1];
909
- case o.Q:
910
- return p.RS_BLOCK_TABLE[(a - 1) * 4 + 2];
911
- case o.H:
912
- return p.RS_BLOCK_TABLE[(a - 1) * 4 + 3];
913
- default:
914
- return;
915
- }
916
- }, De = p, De;
917
- }
918
- var Oe, ct;
919
- function Or() {
920
- if (ct) return Oe;
921
- ct = 1;
922
- function o() {
923
- this.buffer = new Array(), this.length = 0;
924
- }
925
- return o.prototype = {
926
- get: function(p) {
927
- var a = Math.floor(p / 8);
928
- return (this.buffer[a] >>> 7 - p % 8 & 1) == 1;
929
- },
930
- put: function(p, a) {
931
- for (var f = 0; f < a; f++)
932
- this.putBit((p >>> a - f - 1 & 1) == 1);
933
- },
934
- getLengthInBits: function() {
935
- return this.length;
936
- },
937
- putBit: function(p) {
938
- var a = Math.floor(this.length / 8);
939
- this.buffer.length <= a && this.buffer.push(0), p && (this.buffer[a] |= 128 >>> this.length % 8), this.length++;
940
- }
941
- }, Oe = o, Oe;
942
- }
943
- var Le, ft;
944
- function Ot() {
945
- if (ft) return Le;
946
- ft = 1;
947
- for (var o = {
948
- glog: function(a) {
949
- if (a < 1)
950
- throw new Error("glog(" + a + ")");
951
- return o.LOG_TABLE[a];
952
- },
953
- gexp: function(a) {
954
- for (; a < 0; )
955
- a += 255;
956
- for (; a >= 256; )
957
- a -= 255;
958
- return o.EXP_TABLE[a];
959
- },
960
- EXP_TABLE: new Array(256),
961
- LOG_TABLE: new Array(256)
962
- }, p = 0; p < 8; p++)
963
- o.EXP_TABLE[p] = 1 << p;
964
- for (var p = 8; p < 256; p++)
965
- o.EXP_TABLE[p] = o.EXP_TABLE[p - 4] ^ o.EXP_TABLE[p - 5] ^ o.EXP_TABLE[p - 6] ^ o.EXP_TABLE[p - 8];
966
- for (var p = 0; p < 255; p++)
967
- o.LOG_TABLE[o.EXP_TABLE[p]] = p;
968
- return Le = o, Le;
969
- }
970
- var Ie, dt;
971
- function Lt() {
972
- if (dt) return Ie;
973
- dt = 1;
974
- var o = Ot();
975
- function p(a, f) {
976
- if (a.length == null)
977
- throw new Error(a.length + "/" + f);
978
- for (var d = 0; d < a.length && a[d] == 0; )
979
- d++;
980
- this.num = new Array(a.length - d + f);
981
- for (var r = 0; r < a.length - d; r++)
982
- this.num[r] = a[r + d];
983
- }
984
- return p.prototype = {
985
- get: function(a) {
986
- return this.num[a];
987
- },
988
- getLength: function() {
989
- return this.num.length;
990
- },
991
- multiply: function(a) {
992
- for (var f = new Array(this.getLength() + a.getLength() - 1), d = 0; d < this.getLength(); d++)
993
- for (var r = 0; r < a.getLength(); r++)
994
- f[d + r] ^= o.gexp(o.glog(this.get(d)) + o.glog(a.get(r)));
995
- return new p(f, 0);
996
- },
997
- mod: function(a) {
998
- if (this.getLength() - a.getLength() < 0)
999
- return this;
1000
- for (var f = o.glog(this.get(0)) - o.glog(a.get(0)), d = new Array(this.getLength()), r = 0; r < this.getLength(); r++)
1001
- d[r] = this.get(r);
1002
- for (var r = 0; r < a.getLength(); r++)
1003
- d[r] ^= o.gexp(o.glog(a.get(r)) + f);
1004
- return new p(d, 0).mod(a);
1005
- }
1006
- }, Ie = p, Ie;
1007
- }
1008
- var Be, ht;
1009
- function Lr() {
1010
- if (ht) return Be;
1011
- ht = 1;
1012
- var o = Dt(), p = Lt(), a = Ot(), f = {
1013
- PATTERN000: 0,
1014
- PATTERN001: 1,
1015
- PATTERN010: 2,
1016
- PATTERN011: 3,
1017
- PATTERN100: 4,
1018
- PATTERN101: 5,
1019
- PATTERN110: 6,
1020
- PATTERN111: 7
1021
- }, d = {
1022
- PATTERN_POSITION_TABLE: [
1023
- [],
1024
- [6, 18],
1025
- [6, 22],
1026
- [6, 26],
1027
- [6, 30],
1028
- [6, 34],
1029
- [6, 22, 38],
1030
- [6, 24, 42],
1031
- [6, 26, 46],
1032
- [6, 28, 50],
1033
- [6, 30, 54],
1034
- [6, 32, 58],
1035
- [6, 34, 62],
1036
- [6, 26, 46, 66],
1037
- [6, 26, 48, 70],
1038
- [6, 26, 50, 74],
1039
- [6, 30, 54, 78],
1040
- [6, 30, 56, 82],
1041
- [6, 30, 58, 86],
1042
- [6, 34, 62, 90],
1043
- [6, 28, 50, 72, 94],
1044
- [6, 26, 50, 74, 98],
1045
- [6, 30, 54, 78, 102],
1046
- [6, 28, 54, 80, 106],
1047
- [6, 32, 58, 84, 110],
1048
- [6, 30, 58, 86, 114],
1049
- [6, 34, 62, 90, 118],
1050
- [6, 26, 50, 74, 98, 122],
1051
- [6, 30, 54, 78, 102, 126],
1052
- [6, 26, 52, 78, 104, 130],
1053
- [6, 30, 56, 82, 108, 134],
1054
- [6, 34, 60, 86, 112, 138],
1055
- [6, 30, 58, 86, 114, 142],
1056
- [6, 34, 62, 90, 118, 146],
1057
- [6, 30, 54, 78, 102, 126, 150],
1058
- [6, 24, 50, 76, 102, 128, 154],
1059
- [6, 28, 54, 80, 106, 132, 158],
1060
- [6, 32, 58, 84, 110, 136, 162],
1061
- [6, 26, 54, 82, 110, 138, 166],
1062
- [6, 30, 58, 86, 114, 142, 170]
1063
- ],
1064
- G15: 1335,
1065
- G18: 7973,
1066
- G15_MASK: 21522,
1067
- getBCHTypeInfo: function(r) {
1068
- for (var u = r << 10; d.getBCHDigit(u) - d.getBCHDigit(d.G15) >= 0; )
1069
- u ^= d.G15 << d.getBCHDigit(u) - d.getBCHDigit(d.G15);
1070
- return (r << 10 | u) ^ d.G15_MASK;
1071
- },
1072
- getBCHTypeNumber: function(r) {
1073
- for (var u = r << 12; d.getBCHDigit(u) - d.getBCHDigit(d.G18) >= 0; )
1074
- u ^= d.G18 << d.getBCHDigit(u) - d.getBCHDigit(d.G18);
1075
- return r << 12 | u;
1076
- },
1077
- getBCHDigit: function(r) {
1078
- for (var u = 0; r != 0; )
1079
- u++, r >>>= 1;
1080
- return u;
1081
- },
1082
- getPatternPosition: function(r) {
1083
- return d.PATTERN_POSITION_TABLE[r - 1];
1084
- },
1085
- getMask: function(r, u, n) {
1086
- switch (r) {
1087
- case f.PATTERN000:
1088
- return (u + n) % 2 == 0;
1089
- case f.PATTERN001:
1090
- return u % 2 == 0;
1091
- case f.PATTERN010:
1092
- return n % 3 == 0;
1093
- case f.PATTERN011:
1094
- return (u + n) % 3 == 0;
1095
- case f.PATTERN100:
1096
- return (Math.floor(u / 2) + Math.floor(n / 3)) % 2 == 0;
1097
- case f.PATTERN101:
1098
- return u * n % 2 + u * n % 3 == 0;
1099
- case f.PATTERN110:
1100
- return (u * n % 2 + u * n % 3) % 2 == 0;
1101
- case f.PATTERN111:
1102
- return (u * n % 3 + (u + n) % 2) % 2 == 0;
1103
- default:
1104
- throw new Error("bad maskPattern:" + r);
1105
- }
1106
- },
1107
- getErrorCorrectPolynomial: function(r) {
1108
- for (var u = new p([1], 0), n = 0; n < r; n++)
1109
- u = u.multiply(new p([1, a.gexp(n)], 0));
1110
- return u;
1111
- },
1112
- getLengthInBits: function(r, u) {
1113
- if (1 <= u && u < 10)
1114
- switch (r) {
1115
- case o.MODE_NUMBER:
1116
- return 10;
1117
- case o.MODE_ALPHA_NUM:
1118
- return 9;
1119
- case o.MODE_8BIT_BYTE:
1120
- return 8;
1121
- case o.MODE_KANJI:
1122
- return 8;
1123
- default:
1124
- throw new Error("mode:" + r);
1125
- }
1126
- else if (u < 27)
1127
- switch (r) {
1128
- case o.MODE_NUMBER:
1129
- return 12;
1130
- case o.MODE_ALPHA_NUM:
1131
- return 11;
1132
- case o.MODE_8BIT_BYTE:
1133
- return 16;
1134
- case o.MODE_KANJI:
1135
- return 10;
1136
- default:
1137
- throw new Error("mode:" + r);
1138
- }
1139
- else if (u < 41)
1140
- switch (r) {
1141
- case o.MODE_NUMBER:
1142
- return 14;
1143
- case o.MODE_ALPHA_NUM:
1144
- return 13;
1145
- case o.MODE_8BIT_BYTE:
1146
- return 16;
1147
- case o.MODE_KANJI:
1148
- return 12;
1149
- default:
1150
- throw new Error("mode:" + r);
1151
- }
1152
- else
1153
- throw new Error("type:" + u);
1154
- },
1155
- getLostPoint: function(r) {
1156
- for (var u = r.getModuleCount(), n = 0, t = 0; t < u; t++)
1157
- for (var e = 0; e < u; e++) {
1158
- for (var s = 0, i = r.isDark(t, e), c = -1; c <= 1; c++)
1159
- if (!(t + c < 0 || u <= t + c))
1160
- for (var g = -1; g <= 1; g++)
1161
- e + g < 0 || u <= e + g || c == 0 && g == 0 || i == r.isDark(t + c, e + g) && s++;
1162
- s > 5 && (n += 3 + s - 5);
1163
- }
1164
- for (var t = 0; t < u - 1; t++)
1165
- for (var e = 0; e < u - 1; e++) {
1166
- var v = 0;
1167
- r.isDark(t, e) && v++, r.isDark(t + 1, e) && v++, r.isDark(t, e + 1) && v++, r.isDark(t + 1, e + 1) && v++, (v == 0 || v == 4) && (n += 3);
1168
- }
1169
- for (var t = 0; t < u; t++)
1170
- for (var e = 0; e < u - 6; e++)
1171
- r.isDark(t, e) && !r.isDark(t, e + 1) && r.isDark(t, e + 2) && r.isDark(t, e + 3) && r.isDark(t, e + 4) && !r.isDark(t, e + 5) && r.isDark(t, e + 6) && (n += 40);
1172
- for (var e = 0; e < u; e++)
1173
- for (var t = 0; t < u - 6; t++)
1174
- r.isDark(t, e) && !r.isDark(t + 1, e) && r.isDark(t + 2, e) && r.isDark(t + 3, e) && r.isDark(t + 4, e) && !r.isDark(t + 5, e) && r.isDark(t + 6, e) && (n += 40);
1175
- for (var m = 0, e = 0; e < u; e++)
1176
- for (var t = 0; t < u; t++)
1177
- r.isDark(t, e) && m++;
1178
- var R = Math.abs(100 * m / u / u - 50) / 5;
1179
- return n += R * 10, n;
1180
- }
1181
- };
1182
- return Be = d, Be;
1183
- }
1184
- var ke, pt;
1185
- function Ir() {
1186
- if (pt) return ke;
1187
- pt = 1;
1188
- var o = Ar(), p = Dr(), a = Or(), f = Lr(), d = Lt();
1189
- function r(n, t) {
1190
- this.typeNumber = n, this.errorCorrectLevel = t, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = [];
1191
- }
1192
- var u = r.prototype;
1193
- return u.addData = function(n) {
1194
- var t = new o(n);
1195
- this.dataList.push(t), this.dataCache = null;
1196
- }, u.isDark = function(n, t) {
1197
- if (n < 0 || this.moduleCount <= n || t < 0 || this.moduleCount <= t)
1198
- throw new Error(n + "," + t);
1199
- return this.modules[n][t];
1200
- }, u.getModuleCount = function() {
1201
- return this.moduleCount;
1202
- }, u.make = function() {
1203
- if (this.typeNumber < 1) {
1204
- var n = 1;
1205
- for (n = 1; n < 40; n++) {
1206
- for (var t = p.getRSBlocks(n, this.errorCorrectLevel), e = new a(), s = 0, i = 0; i < t.length; i++)
1207
- s += t[i].dataCount;
1208
- for (var i = 0; i < this.dataList.length; i++) {
1209
- var c = this.dataList[i];
1210
- e.put(c.mode, 4), e.put(c.getLength(), f.getLengthInBits(c.mode, n)), c.write(e);
1211
- }
1212
- if (e.getLengthInBits() <= s * 8)
1213
- break;
1214
- }
1215
- this.typeNumber = n;
1216
- }
1217
- this.makeImpl(!1, this.getBestMaskPattern());
1218
- }, u.makeImpl = function(n, t) {
1219
- this.moduleCount = this.typeNumber * 4 + 17, this.modules = new Array(this.moduleCount);
1220
- for (var e = 0; e < this.moduleCount; e++) {
1221
- this.modules[e] = new Array(this.moduleCount);
1222
- for (var s = 0; s < this.moduleCount; s++)
1223
- this.modules[e][s] = null;
1224
- }
1225
- this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(n, t), this.typeNumber >= 7 && this.setupTypeNumber(n), this.dataCache == null && (this.dataCache = r.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, t);
1226
- }, u.setupPositionProbePattern = function(n, t) {
1227
- for (var e = -1; e <= 7; e++)
1228
- if (!(n + e <= -1 || this.moduleCount <= n + e))
1229
- for (var s = -1; s <= 7; s++)
1230
- t + s <= -1 || this.moduleCount <= t + s || (0 <= e && e <= 6 && (s == 0 || s == 6) || 0 <= s && s <= 6 && (e == 0 || e == 6) || 2 <= e && e <= 4 && 2 <= s && s <= 4 ? this.modules[n + e][t + s] = !0 : this.modules[n + e][t + s] = !1);
1231
- }, u.getBestMaskPattern = function() {
1232
- for (var n = 0, t = 0, e = 0; e < 8; e++) {
1233
- this.makeImpl(!0, e);
1234
- var s = f.getLostPoint(this);
1235
- (e == 0 || n > s) && (n = s, t = e);
1236
- }
1237
- return t;
1238
- }, u.createMovieClip = function(n, t, e) {
1239
- var s = n.createEmptyMovieClip(t, e), i = 1;
1240
- this.make();
1241
- for (var c = 0; c < this.modules.length; c++)
1242
- for (var g = c * i, v = 0; v < this.modules[c].length; v++) {
1243
- var m = v * i, R = this.modules[c][v];
1244
- R && (s.beginFill(0, 100), s.moveTo(m, g), s.lineTo(m + i, g), s.lineTo(m + i, g + i), s.lineTo(m, g + i), s.endFill());
1245
- }
1246
- return s;
1247
- }, u.setupTimingPattern = function() {
1248
- for (var n = 8; n < this.moduleCount - 8; n++)
1249
- this.modules[n][6] == null && (this.modules[n][6] = n % 2 == 0);
1250
- for (var t = 8; t < this.moduleCount - 8; t++)
1251
- this.modules[6][t] == null && (this.modules[6][t] = t % 2 == 0);
1252
- }, u.setupPositionAdjustPattern = function() {
1253
- for (var n = f.getPatternPosition(this.typeNumber), t = 0; t < n.length; t++)
1254
- for (var e = 0; e < n.length; e++) {
1255
- var s = n[t], i = n[e];
1256
- if (this.modules[s][i] == null)
1257
- for (var c = -2; c <= 2; c++)
1258
- for (var g = -2; g <= 2; g++)
1259
- c == -2 || c == 2 || g == -2 || g == 2 || c == 0 && g == 0 ? this.modules[s + c][i + g] = !0 : this.modules[s + c][i + g] = !1;
1260
- }
1261
- }, u.setupTypeNumber = function(n) {
1262
- for (var t = f.getBCHTypeNumber(this.typeNumber), e = 0; e < 18; e++) {
1263
- var s = !n && (t >> e & 1) == 1;
1264
- this.modules[Math.floor(e / 3)][e % 3 + this.moduleCount - 8 - 3] = s;
1265
- }
1266
- for (var e = 0; e < 18; e++) {
1267
- var s = !n && (t >> e & 1) == 1;
1268
- this.modules[e % 3 + this.moduleCount - 8 - 3][Math.floor(e / 3)] = s;
1269
- }
1270
- }, u.setupTypeInfo = function(n, t) {
1271
- for (var e = this.errorCorrectLevel << 3 | t, s = f.getBCHTypeInfo(e), i = 0; i < 15; i++) {
1272
- var c = !n && (s >> i & 1) == 1;
1273
- i < 6 ? this.modules[i][8] = c : i < 8 ? this.modules[i + 1][8] = c : this.modules[this.moduleCount - 15 + i][8] = c;
1274
- }
1275
- for (var i = 0; i < 15; i++) {
1276
- var c = !n && (s >> i & 1) == 1;
1277
- i < 8 ? this.modules[8][this.moduleCount - i - 1] = c : i < 9 ? this.modules[8][15 - i - 1 + 1] = c : this.modules[8][15 - i - 1] = c;
1278
- }
1279
- this.modules[this.moduleCount - 8][8] = !n;
1280
- }, u.mapData = function(n, t) {
1281
- for (var e = -1, s = this.moduleCount - 1, i = 7, c = 0, g = this.moduleCount - 1; g > 0; g -= 2)
1282
- for (g == 6 && g--; ; ) {
1283
- for (var v = 0; v < 2; v++)
1284
- if (this.modules[s][g - v] == null) {
1285
- var m = !1;
1286
- c < n.length && (m = (n[c] >>> i & 1) == 1);
1287
- var R = f.getMask(t, s, g - v);
1288
- R && (m = !m), this.modules[s][g - v] = m, i--, i == -1 && (c++, i = 7);
1289
- }
1290
- if (s += e, s < 0 || this.moduleCount <= s) {
1291
- s -= e, e = -e;
1292
- break;
1293
- }
1294
- }
1295
- }, r.PAD0 = 236, r.PAD1 = 17, r.createData = function(n, t, e) {
1296
- for (var s = p.getRSBlocks(n, t), i = new a(), c = 0; c < e.length; c++) {
1297
- var g = e[c];
1298
- i.put(g.mode, 4), i.put(g.getLength(), f.getLengthInBits(g.mode, n)), g.write(i);
1299
- }
1300
- for (var v = 0, c = 0; c < s.length; c++)
1301
- v += s[c].dataCount;
1302
- if (i.getLengthInBits() > v * 8)
1303
- throw new Error("code length overflow. (" + i.getLengthInBits() + ">" + v * 8 + ")");
1304
- for (i.getLengthInBits() + 4 <= v * 8 && i.put(0, 4); i.getLengthInBits() % 8 != 0; )
1305
- i.putBit(!1);
1306
- for (; !(i.getLengthInBits() >= v * 8 || (i.put(r.PAD0, 8), i.getLengthInBits() >= v * 8)); )
1307
- i.put(r.PAD1, 8);
1308
- return r.createBytes(i, s);
1309
- }, r.createBytes = function(n, t) {
1310
- for (var e = 0, s = 0, i = 0, c = new Array(t.length), g = new Array(t.length), v = 0; v < t.length; v++) {
1311
- var m = t[v].dataCount, R = t[v].totalCount - m;
1312
- s = Math.max(s, m), i = Math.max(i, R), c[v] = new Array(m);
1313
- for (var E = 0; E < c[v].length; E++)
1314
- c[v][E] = 255 & n.buffer[E + e];
1315
- e += m;
1316
- var j = f.getErrorCorrectPolynomial(R), N = new d(c[v], j.getLength() - 1), A = N.mod(j);
1317
- g[v] = new Array(j.getLength() - 1);
1318
- for (var E = 0; E < g[v].length; E++) {
1319
- var l = E + A.getLength() - g[v].length;
1320
- g[v][E] = l >= 0 ? A.get(l) : 0;
1321
- }
1322
- }
1323
- for (var z = 0, E = 0; E < t.length; E++)
1324
- z += t[E].totalCount;
1325
- for (var Q = new Array(z), G = 0, E = 0; E < s; E++)
1326
- for (var v = 0; v < t.length; v++)
1327
- E < c[v].length && (Q[G++] = c[v][E]);
1328
- for (var E = 0; E < i; E++)
1329
- for (var v = 0; v < t.length; v++)
1330
- E < g[v].length && (Q[G++] = g[v][E]);
1331
- return Q;
1332
- }, ke = r, ke;
1333
- }
1334
- var ye = {}, vt;
1335
- function Br() {
1336
- if (vt) return ye;
1337
- vt = 1, Object.defineProperty(ye, "__esModule", {
1338
- value: !0
1339
- });
1340
- var o = Object.assign || function(e) {
1341
- for (var s = 1; s < arguments.length; s++) {
1342
- var i = arguments[s];
1343
- for (var c in i)
1344
- Object.prototype.hasOwnProperty.call(i, c) && (e[c] = i[c]);
1345
- }
1346
- return e;
1347
- }, p = /* @__PURE__ */ Mt(), a = r(p), f = Ue, d = r(f);
1348
- function r(e) {
1349
- return e && e.__esModule ? e : { default: e };
1350
- }
1351
- function u(e, s) {
1352
- var i = {};
1353
- for (var c in e)
1354
- s.indexOf(c) >= 0 || Object.prototype.hasOwnProperty.call(e, c) && (i[c] = e[c]);
1355
- return i;
1356
- }
1357
- var n = {
1358
- bgColor: a.default.oneOfType([a.default.object, a.default.string]).isRequired,
1359
- bgD: a.default.string.isRequired,
1360
- fgColor: a.default.oneOfType([a.default.object, a.default.string]).isRequired,
1361
- fgD: a.default.string.isRequired,
1362
- size: a.default.number.isRequired,
1363
- title: a.default.string,
1364
- viewBoxSize: a.default.number.isRequired,
1365
- xmlns: a.default.string
1366
- }, t = (0, f.forwardRef)(function(e, s) {
1367
- var i = e.bgColor, c = e.bgD, g = e.fgD, v = e.fgColor, m = e.size, R = e.title, E = e.viewBoxSize, j = e.xmlns, N = j === void 0 ? "http://www.w3.org/2000/svg" : j, A = u(e, ["bgColor", "bgD", "fgD", "fgColor", "size", "title", "viewBoxSize", "xmlns"]);
1368
- return d.default.createElement(
1369
- "svg",
1370
- o({}, A, { height: m, ref: s, viewBox: "0 0 " + E + " " + E, width: m, xmlns: N }),
1371
- R ? d.default.createElement(
1372
- "title",
1373
- null,
1374
- R
1375
- ) : null,
1376
- d.default.createElement("path", { d: c, fill: i }),
1377
- d.default.createElement("path", { d: g, fill: v })
1378
- );
1379
- });
1380
- return t.displayName = "QRCodeSvg", t.propTypes = n, ye.default = t, ye;
1381
- }
1382
- var mt;
1383
- function kr() {
1384
- if (mt) return ue;
1385
- mt = 1, Object.defineProperty(ue, "__esModule", {
1386
- value: !0
1387
- }), ue.QRCode = void 0;
1388
- var o = Object.assign || function(m) {
1389
- for (var R = 1; R < arguments.length; R++) {
1390
- var E = arguments[R];
1391
- for (var j in E)
1392
- Object.prototype.hasOwnProperty.call(E, j) && (m[j] = E[j]);
1393
- }
1394
- return m;
1395
- }, p = /* @__PURE__ */ Mt(), a = i(p), f = At(), d = i(f), r = Ir(), u = i(r), n = Ue, t = i(n), e = Br(), s = i(e);
1396
- function i(m) {
1397
- return m && m.__esModule ? m : { default: m };
1398
- }
1399
- function c(m, R) {
1400
- var E = {};
1401
- for (var j in m)
1402
- R.indexOf(j) >= 0 || Object.prototype.hasOwnProperty.call(m, j) && (E[j] = m[j]);
1403
- return E;
1404
- }
1405
- var g = {
1406
- bgColor: a.default.oneOfType([a.default.object, a.default.string]),
1407
- fgColor: a.default.oneOfType([a.default.object, a.default.string]),
1408
- level: a.default.string,
1409
- size: a.default.number,
1410
- value: a.default.string.isRequired
1411
- }, v = (0, n.forwardRef)(function(m, R) {
1412
- var E = m.bgColor, j = E === void 0 ? "#FFFFFF" : E, N = m.fgColor, A = N === void 0 ? "#000000" : N, l = m.level, z = l === void 0 ? "L" : l, Q = m.size, G = Q === void 0 ? 256 : Q, oe = m.value, te = c(m, ["bgColor", "fgColor", "level", "size", "value"]), W = new u.default(-1, d.default[z]);
1413
- W.addData(oe), W.make();
1414
- var V = W.modules;
1415
- return t.default.createElement(s.default, o({}, te, {
1416
- bgColor: j,
1417
- bgD: V.map(function(Y, F) {
1418
- return Y.map(function(K, U) {
1419
- return K ? "" : "M " + U + " " + F + " l 1 0 0 1 -1 0 Z";
1420
- }).join(" ");
1421
- }).join(" "),
1422
- fgColor: A,
1423
- fgD: V.map(function(Y, F) {
1424
- return Y.map(function(K, U) {
1425
- return K ? "M " + U + " " + F + " l 1 0 0 1 -1 0 Z" : "";
1426
- }).join(" ");
1427
- }).join(" "),
1428
- ref: R,
1429
- size: G,
1430
- viewBoxSize: V.length
1431
- }));
1432
- });
1433
- return ue.QRCode = v, v.displayName = "QRCode", v.propTypes = g, ue.default = v, ue;
1434
- }
1435
- var jr = kr();
1436
- const Nr = /* @__PURE__ */ Yt(jr), $r = Ee.div`
1437
- background-color: rgba(0, 0, 0, 0.75);
1438
- display: flex;
1439
- align-items: center;
1440
- justify-content: center;
1441
- position: fixed;
1442
- top: 0;
1443
- left: 0;
1444
- right: 0;
1445
- bottom: 0;
1446
- z-index: 999;
1447
- `, Ur = Ee.div`
1448
- display: flex;
1449
- align-items: center;
1450
- justify-content: center;
1451
- width: 70%;
1452
- height: 70%;
1453
- padding: 0;
1454
- position: absolute;
1455
- top: 50%;
1456
- left: 50%;
1457
- transform: translate(-50%, -50%);
1458
- background: white;
1459
- `, qr = Ee($r)`
1460
- background-color: rgba(16, 24, 40, 0.45);
1461
- ${Gt}
1462
- `, zr = Ee(Ur)`
1463
- border-radius: var(--ethora-radius-lg, 16px);
1464
- box-shadow: var(--ethora-shadow-lg, 0 12px 32px rgba(16, 24, 40, 0.18));
1465
- background: var(--ethora-color-bg, #fff);
1466
- ${Kt}
1467
- `, Fr = ({
1468
- isVisible: o,
1469
- chatJid: p,
1470
- setVisible: a
1471
- }) => {
1472
- const { config: f } = bt(), d = f?.qrUrl || (typeof window < "u" ? `${window.location.origin}/app/chat/?chatId=` : Ht);
1473
- return jt(() => {
1474
- const { overflow: r } = document.body.style;
1475
- return o && (document.body.style.overflow = "hidden"), () => {
1476
- document.body.style.overflow = r;
1477
- };
1478
- }, [o]), o && /* @__PURE__ */ T(
1479
- qr,
1480
- {
1481
- style: {
1482
- position: "fixed",
1483
- inset: 0,
1484
- zIndex: 1e3
1485
- },
1486
- children: /* @__PURE__ */ k(
1487
- zr,
1488
- {
1489
- style: {
1490
- width: "auto",
1491
- height: "auto",
1492
- padding: "32px 64px",
1493
- minWidth: "480px"
1494
- },
1495
- children: [
1496
- /* @__PURE__ */ T(
1497
- qe,
1498
- {
1499
- onClick: () => a(!1),
1500
- style: {
1501
- fontSize: 24,
1502
- width: "36px",
1503
- height: "36px",
1504
- display: "flex",
1505
- justifyContent: "center",
1506
- alignItems: "center"
1507
- },
1508
- children: "×"
1509
- }
1510
- ),
1511
- /* @__PURE__ */ k(
1512
- "div",
1513
- {
1514
- style: {
1515
- display: "flex",
1516
- flexDirection: "column",
1517
- gap: "16px",
1518
- alignItems: "center"
1519
- },
1520
- children: [
1521
- /* @__PURE__ */ T("div", { style: { width: "70%", position: "relative" }, children: /* @__PURE__ */ T(
1522
- Nr,
1523
- {
1524
- size: 256,
1525
- style: { width: "100%", height: "70%", maxWidth: "100%" },
1526
- value: `${d}${p.split("@")[0]}`,
1527
- viewBox: "0 0 256 256"
1528
- }
1529
- ) }),
1530
- /* @__PURE__ */ k(
1531
- "div",
1532
- {
1533
- style: {
1534
- display: "flex",
1535
- gap: "8px",
1536
- alignItems: "center",
1537
- minWidth: "400px"
1538
- },
1539
- children: [
1540
- /* @__PURE__ */ T(
1541
- Wt,
1542
- {
1543
- $colorBg: f?.colors?.colorInput,
1544
- value: `${d}${p.split("@")[0]}`,
1545
- disabled: !0,
1546
- style: { width: "80%" }
1547
- }
1548
- ),
1549
- /* @__PURE__ */ T(
1550
- ne,
1551
- {
1552
- text: "Copy",
1553
- onClick: () => qt(
1554
- `${d}${p.split("@")[0]}`
1555
- )
1556
- }
1557
- )
1558
- ]
1559
- }
1560
- )
1561
- ]
1562
- }
1563
- )
1564
- ]
1565
- }
1566
- )
1567
- }
1568
- );
1569
- }, Qr = ({
1570
- isModalOpen: o,
1571
- setIsModalOpen: p
1572
- }) => {
1573
- const a = ze(), f = fe((e) => Fe(e)), { client: d } = Et(), r = Qe(), u = () => p(!1), n = yt(null);
1574
- Tt({
1575
- enabled: o,
1576
- onClose: u,
1577
- containerRef: n
1578
- });
1579
- const t = async () => {
1580
- try {
1581
- await Jt(f.jid.split("@")[0]), d?.leaveTheRoomStanza?.(f.jid), a(Vt({ jid: f.jid })), a(Zt({ roomJID: null })), u();
1582
- } catch (e) {
1583
- console.error("Failed to delete chat:", e);
1584
- }
1585
- };
1586
- return o && /* @__PURE__ */ T(Ct, { children: /* @__PURE__ */ k(Rt, { ref: n, children: [
1587
- /* @__PURE__ */ T(
1588
- qe,
1589
- {
1590
- onClick: u,
1591
- style: { fontSize: 24 },
1592
- "aria-label": r("action.close"),
1593
- children: "×"
1594
- }
1595
- ),
1596
- /* @__PURE__ */ T(Xt, { children: r("modal.deleteChat.title") }),
1597
- /* @__PURE__ */ k(Ne, { children: [
1598
- /* @__PURE__ */ T(
1599
- ne,
1600
- {
1601
- onClick: u,
1602
- text: r("action.cancel"),
1603
- style: { width: "100%" },
1604
- unstyled: !0,
1605
- variant: "outlined"
1606
- }
1607
- ),
1608
- /* @__PURE__ */ T(
1609
- ne,
1610
- {
1611
- onClick: t,
1612
- text: r("action.delete"),
1613
- style: { width: "100%" },
1614
- unstyled: !0,
1615
- variant: "filled",
1616
- tone: "danger"
1617
- }
1618
- )
1619
- ] })
1620
- ] }) });
1621
- }, Yr = () => {
1622
- const { showToast: o } = wt(), p = ze(), a = Qe(), [f, d] = ee(!1), [r, u] = ee(!1), [n, t] = ee([]), e = fe((v) => Fe(v)), s = () => u(!0), i = () => {
1623
- u(!1), t([]);
1624
- }, c = yt(null);
1625
- Tt({
1626
- enabled: r,
1627
- onClose: i,
1628
- containerRef: c
1629
- });
1630
- const g = async () => {
1631
- d(!0);
1632
- const v = Array.isArray(e?.members) ? e.members : [], m = v.map(
1633
- (E) => E.xmppUsername
1634
- ), R = n.filter((E) => !m.includes(E.xmppUsername)).map((E) => E.xmppUsername);
1635
- try {
1636
- const E = await rr({
1637
- chatName: e.jid.split("@")[0],
1638
- members: R
1639
- });
1640
- p(
1641
- be({
1642
- jid: e.jid,
1643
- updates: {
1644
- members: [...E, ...v],
1645
- usersCnt: v.length + E.length
1646
- }
1647
- })
1648
- ), o({
1649
- id: Date.now().toString(),
1650
- title: a("toast.success"),
1651
- // This is the "add users to an existing room" flow, not room
1652
- // creation - the old copy here literally said "Room created
1653
- // succusfully!" (typo and all), copy-pasted from NewChatModal.
1654
- message: a("toast.usersAddedSuccess"),
1655
- type: "success",
1656
- duration: 3e3
1657
- });
1658
- } catch (E) {
1659
- console.error("Error adding users:", E), d(!1);
1660
- }
1661
- i(), d(!1);
1662
- };
1663
- return /* @__PURE__ */ k(je, { children: [
1664
- /* @__PURE__ */ T(er, { variant: "filled", unstyled: !0, onClick: s, children: a("action.addMoreUsers") }),
1665
- r && /* @__PURE__ */ T(Ct, { children: /* @__PURE__ */ k(Rt, { ref: c, children: [
1666
- /* @__PURE__ */ T(
1667
- qe,
1668
- {
1669
- onClick: i,
1670
- style: { fontSize: 24 },
1671
- "aria-label": a("action.close"),
1672
- children: "×"
1673
- }
1674
- ),
1675
- /* @__PURE__ */ T(
1676
- Ne,
1677
- {
1678
- style: {
1679
- flexDirection: "column",
1680
- position: "relative",
1681
- boxSizing: "border-box",
1682
- width: "100%",
1683
- minHeight: "400px"
1684
- },
1685
- children: /* @__PURE__ */ T(
1686
- tr,
1687
- {
1688
- selectedUsers: n,
1689
- setSelectedUsers: t,
1690
- style: {
1691
- minWidth: "100%",
1692
- width: "100%",
1693
- maxHeight: "340px"
1694
- },
1695
- headerElement: !1
1696
- }
1697
- )
1698
- }
1699
- ),
1700
- /* @__PURE__ */ k(Ne, { children: [
1701
- /* @__PURE__ */ T(
1702
- ne,
1703
- {
1704
- onClick: i,
1705
- text: a("action.cancel"),
1706
- style: { width: "100%" },
1707
- unstyled: !0,
1708
- variant: "outlined"
1709
- }
1710
- ),
1711
- f ? /* @__PURE__ */ T($e, {}) : /* @__PURE__ */ T(
1712
- ne,
1713
- {
1714
- onClick: g,
1715
- text: a("action.add"),
1716
- style: { width: "100%" },
1717
- unstyled: !0,
1718
- variant: "filled"
1719
- }
1720
- )
1721
- ] })
1722
- ] }) })
1723
- ] });
1724
- }, Hr = ({
1725
- member: o,
1726
- isLast: p,
1727
- disableClick: a,
1728
- online: f,
1729
- showMenu: d,
1730
- menuOptions: r,
1731
- moreOptionsLabel: u,
1732
- onAvatarClick: n
1733
- }) => {
1734
- const t = String(o?.xmppUsername || ""), e = t.split("@")[0], s = fe(
1735
- (m) => m.rooms.usersSet?.[t] ?? m.rooms.usersSet?.[e]
1736
- ), i = o.firstName || s?.firstName || "", c = o.lastName || s?.lastName || "", g = o.profileImage || s?.profileImage || s?.photoURL || "", v = {
1737
- ...o,
1738
- firstName: i,
1739
- lastName: c,
1740
- profileImage: g
1741
- };
1742
- return /* @__PURE__ */ k(
1743
- "div",
1744
- {
1745
- style: {
1746
- display: "flex",
1747
- flexDirection: "column",
1748
- alignItems: "start",
1749
- boxSizing: "border-box"
1750
- },
1751
- children: [
1752
- /* @__PURE__ */ k(
1753
- nr,
1754
- {
1755
- style: {
1756
- justifyContent: "space-between",
1757
- width: "100%"
1758
- },
1759
- children: [
1760
- /* @__PURE__ */ k(
1761
- "div",
1762
- {
1763
- style: {
1764
- display: "flex",
1765
- gap: "8px",
1766
- cursor: a ? "default" : "pointer"
1767
- },
1768
- onClick: a ? void 0 : () => n(v),
1769
- children: [
1770
- /* @__PURE__ */ T(
1771
- Pt,
1772
- {
1773
- name: `${i} ${c}`,
1774
- icon: g,
1775
- size: 40,
1776
- online: f
1777
- }
1778
- ),
1779
- /* @__PURE__ */ k(
1780
- "div",
1781
- {
1782
- style: {
1783
- display: "flex",
1784
- flexDirection: "column",
1785
- gap: "2px",
1786
- alignItems: "start",
1787
- justifyContent: "center"
1788
- },
1789
- children: [
1790
- /* @__PURE__ */ k(or, { style: { fontSize: "16px", fontWeight: 600 }, children: [
1791
- i,
1792
- " ",
1793
- c
1794
- ] }),
1795
- o.last_active && /* @__PURE__ */ T(ar, { children: new Date(o.last_active * 1e3).toLocaleString() })
1796
- ]
1797
- }
1798
- )
1799
- ]
1800
- }
1801
- ),
1802
- o.role && o.role !== "none" && /* @__PURE__ */ T(
1803
- "div",
1804
- {
1805
- style: {
1806
- backgroundColor: o.ban_status !== "banned" ? "var(--ethora-color-primary-soft, #E7EDF9)" : "rgba(217, 45, 32, 0.1)",
1807
- color: o.ban_status !== "banned" ? "var(--ethora-color-primary, #0052CD)" : "var(--ethora-color-danger, #D92D20)",
1808
- padding: "5px 8px",
1809
- borderRadius: "var(--ethora-radius-lg, 16px)",
1810
- fontSize: "12px"
1811
- },
1812
- children: o.role
1813
- }
1814
- ),
1815
- d && /* @__PURE__ */ T(
1816
- _t,
1817
- {
1818
- options: r,
1819
- openButton: /* @__PURE__ */ T(
1820
- ne,
1821
- {
1822
- onClick: (m) => {
1823
- m.preventDefault();
1824
- },
1825
- children: u
1826
- }
1827
- ),
1828
- onClose: () => ir.log("Dropdown closed")
1829
- }
1830
- )
1831
- ]
1832
- }
1833
- ),
1834
- !p && /* @__PURE__ */ T(sr, {})
1835
- ]
1836
- }
1837
- );
1838
- }, Wr = Ue.memo(Hr), gt = 150, Gr = 150, en = ({
1839
- handleCloseModal: o
1840
- }) => {
1841
- const [p, a] = ee(!1), [f, d] = ee(!1), [r, u] = ee(!1), { showToast: n } = wt(), t = Qe(), e = le(
1842
- () => [
1843
- {
1844
- label: t("action.deleteChat"),
1845
- icon: /* @__PURE__ */ T(lr, {}),
1846
- onClick: () => {
1847
- u(!0);
1848
- },
1849
- styles: { color: "var(--ethora-color-danger, #D92D20)" }
1850
- }
1851
- ],
1852
- [t]
1853
- ), [s, i] = ee(!1), [c, g] = ee(
1854
- gt
1855
- ), [v, m] = ee(""), R = ze(), E = ur(), { client: j } = Et(), { user: N, config: A } = bt(), l = fe((C) => Fe(C)), {
1856
- muted: z,
1857
- isSupported: Q,
1858
- setMuted: G
1859
- } = cr(l?.jid), oe = Q && !A?.disableRoomMute, te = fr(l?.jid), W = fe(
1860
- (C) => C.chatSettingStore.user?.fileToken || ""
1861
- ), V = le(() => new Set(te), [te]), Y = le(() => Array.isArray(l?.members) ? l.members : [], [l?.members]), F = le(() => {
1862
- const C = v.trim().toLowerCase();
1863
- if (!C) return Y;
1864
- const $ = E.getState().rooms.usersSet;
1865
- return Y.filter((J) => {
1866
- const se = String(J?.xmppUsername || ""), It = se.split("@")[0], He = $?.[se] || $?.[It], Bt = J.firstName || He?.firstName || "", kt = J.lastName || He?.lastName || "";
1867
- return `${Bt} ${kt}`.toLowerCase().includes(C);
1868
- });
1869
- }, [Y, v, E]), K = le(
1870
- () => F.slice(0, c),
1871
- [F, c]
1872
- ), U = c < F.length, Z = (C) => {
1873
- m(C.target.value), g(gt);
1874
- }, ae = l?.jid ? l.jid.split("@")[0] : void 0, {
1875
- items: X,
1876
- loading: h,
1877
- error: b,
1878
- remove: x
1879
- } = dr({ roomName: ae }), _ = s ? X : X.slice(0, 6), w = (C) => {
1880
- const $ = Ke(C.location);
1881
- $ && typeof window < "u" && window.open($, "_blank", "noopener,noreferrer");
1882
- }, D = (C) => {
1883
- const $ = Ke(C.location);
1884
- if (!$ || typeof document > "u") return;
1885
- const J = document.createElement("a");
1886
- J.href = $, J.download = C.originalname || "file", document.body.appendChild(J), J.click(), J.remove();
1887
- }, P = (C) => {
1888
- x(C._id).catch(() => {
1889
- });
1890
- }, S = async (C) => {
1891
- try {
1892
- let $ = new FormData();
1893
- $.append("files", C);
1894
- const se = (await Tr($, l.jid))?.data?.results?.[0]?.location;
1895
- se && (j.setRoomImageStanza(l.jid, se, "icon", "none"), R(
1896
- be({ jid: l.jid, updates: { icon: se } })
1897
- ));
1898
- } catch ($) {
1899
- console.error("File upload failed or location is missing:", $);
1900
- }
1901
- }, O = async (C) => {
1902
- try {
1903
- await Er({
1904
- roomId: l.jid.split("@")[0],
1905
- members: [C]
1906
- }), R(
1907
- be({
1908
- jid: l.jid,
1909
- updates: {
1910
- members: (Array.isArray(l.members) ? l.members : []).filter(($) => $.xmppUsername !== C)
1911
- }
1912
- })
1913
- ), n({
1914
- id: Date.now().toString(),
1915
- title: t("toast.success"),
1916
- message: t("toast.userRemovedFromRoom", { userId: C }),
1917
- type: "success"
1918
- });
1919
- } catch ($) {
1920
- console.error("Failed to delete user:", $), n({
1921
- id: Date.now().toString(),
1922
- title: t("toast.error"),
1923
- message: t("toast.failedToDeleteUser"),
1924
- type: "error"
1925
- });
1926
- }
1927
- }, M = A?.disableRoomConfig === !0, L = async () => {
1928
- j.setRoomImageStanza(l.jid, null, "icon", "none"), R(be({ jid: l.jid, updates: { icon: null } }));
1929
- }, q = (C) => {
1930
- R(Ge(Cr.PROFILE)), R(
1931
- Rr({
1932
- id: C._id,
1933
- firstName: C.firstName,
1934
- lastName: C.lastName,
1935
- name: `${C.firstName} ${C.lastName}`,
1936
- userJID: C?.xmppUsername
1937
- })
1938
- );
1939
- }, y = le(
1940
- () => (C) => [
1941
- {
1942
- label: t("action.delete"),
1943
- icon: null,
1944
- onClick: ($) => {
1945
- $?.preventDefault(), O(C);
1946
- }
1947
- }
1948
- ],
1949
- [t]
1950
- );
1951
- if (!l)
1952
- return R(Ge()), null;
1953
- const H = (() => {
1954
- const C = Array.isArray(l.members) && l.members.length > 0 ? l.members.length : typeof l.usersCnt == "number" && l.usersCnt > 0 ? l.usersCnt : 0;
1955
- return C === 1 ? t("modal.chatProfile.memberCountSingular", { count: C }) : t("modal.chatProfile.memberCountPlural", { count: C });
1956
- })(), re = !A?.disableChatInfo?.disableDescription, ie = !A?.disableChatInfo?.disableType;
1957
- return /* @__PURE__ */ k(
1958
- Nt,
1959
- {
1960
- title: t("modal.chatProfile.title"),
1961
- onClose: o,
1962
- headerActions: /* @__PURE__ */ k(je, { children: [
1963
- l?.type === "public" && /* @__PURE__ */ T(
1964
- ne,
1965
- {
1966
- EndIcon: /* @__PURE__ */ T(yr, {}),
1967
- onClick: () => d(!0),
1968
- "aria-label": t("action.showQr")
1969
- }
1970
- ),
1971
- l.role === "moderator" && l.type !== "private" && !M && !A?.disableChatInfo?.disableChatHeaderMenu && /* @__PURE__ */ T(
1972
- _t,
1973
- {
1974
- position: "left",
1975
- options: e,
1976
- openButton: /* @__PURE__ */ T(
1977
- ne,
1978
- {
1979
- style: { padding: 8, maxHeight: "40px" },
1980
- EndIcon: /* @__PURE__ */ T(br, {}),
1981
- unstyled: !0,
1982
- "aria-label": t("action.moreOptions")
1983
- }
1984
- )
1985
- }
1986
- )
1987
- ] }),
1988
- children: [
1989
- /* @__PURE__ */ k(zt, { children: [
1990
- /* @__PURE__ */ T(
1991
- Pt,
1992
- {
1993
- name: l.name,
1994
- icon: hr(l.icon, W),
1995
- upload: {
1996
- onUpload: S,
1997
- active: !M && l?.role !== "participant"
1998
- },
1999
- remove: M ? void 0 : { enabled: !0, onRemoveClick: L },
2000
- role: l?.role,
2001
- size: 96
2002
- }
2003
- ),
2004
- /* @__PURE__ */ k("div", { children: [
2005
- /* @__PURE__ */ T(Ft, { children: l.name }),
2006
- /* @__PURE__ */ T(Qt, { children: H })
2007
- ] })
2008
- ] }),
2009
- l.role === "moderator" && l.type === "group" && !M && /* @__PURE__ */ T(Yr, {}),
2010
- (re || ie) && /* @__PURE__ */ k(de, { children: [
2011
- /* @__PURE__ */ T(he, { children: t("modal.chatProfile.aboutSection") }),
2012
- /* @__PURE__ */ k(pe, { children: [
2013
- re && /* @__PURE__ */ k(ce, { children: [
2014
- /* @__PURE__ */ T(ve, { children: t("modal.chatProfile.description") }),
2015
- /* @__PURE__ */ T(Te, { children: l?.description || t("modal.profile.noDescription") })
2016
- ] }),
2017
- re && ie && /* @__PURE__ */ T($t, {}),
2018
- ie && /* @__PURE__ */ k(ce, { children: [
2019
- /* @__PURE__ */ T(ve, { children: t("modal.chatProfile.chatType") }),
2020
- /* @__PURE__ */ T(Te, { children: l.type })
2021
- ] })
2022
- ] })
2023
- ] }),
2024
- oe && /* @__PURE__ */ k(de, { children: [
2025
- /* @__PURE__ */ T(he, { children: t("modal.chatProfile.notifications") }),
2026
- /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ k(
2027
- ce,
2028
- {
2029
- style: {
2030
- flexDirection: "row",
2031
- justifyContent: "space-between",
2032
- alignItems: "center"
2033
- },
2034
- children: [
2035
- /* @__PURE__ */ T(Te, { children: t(z ? "action.unmute" : "action.mute") }),
2036
- /* @__PURE__ */ T(
2037
- pr,
2038
- {
2039
- checked: z,
2040
- onToggle: (C) => {
2041
- G(C);
2042
- },
2043
- bgColor: A?.colors?.primary
2044
- }
2045
- )
2046
- ]
2047
- }
2048
- ) })
2049
- ] }),
2050
- !A?.disableChatInfo?.hideMembers && /* @__PURE__ */ k(de, { children: [
2051
- /* @__PURE__ */ T(he, { children: t("modal.chatProfile.membersSection") }),
2052
- /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ k(ce, { children: [
2053
- Y.length > 0 && /* @__PURE__ */ T(
2054
- vr,
2055
- {
2056
- icon: /* @__PURE__ */ T(mr, { height: "20px" }),
2057
- value: v,
2058
- onChange: Z,
2059
- placeholder: t("modal.chatProfile.searchMembers"),
2060
- "aria-label": t("modal.chatProfile.searchMembers")
2061
- }
2062
- ),
2063
- p ? /* @__PURE__ */ T($e, {}) : /* @__PURE__ */ k(je, { children: [
2064
- K.map((C, $) => /* @__PURE__ */ T(
2065
- Wr,
2066
- {
2067
- member: C,
2068
- isLast: $ === K.length - 1 && !U,
2069
- disableClick: !!A?.disableChatInfo?.disableMembers,
2070
- online: V.has(C.xmppUsername),
2071
- showMenu: N.xmppUsername !== C.xmppUsername && l.role === "moderator" && l.type !== "private" && !M,
2072
- menuOptions: y(C.xmppUsername),
2073
- moreOptionsLabel: t("action.moreOptions"),
2074
- onAvatarClick: q
2075
- },
2076
- C.xmppUsername
2077
- )),
2078
- U && /* @__PURE__ */ T(
2079
- We,
2080
- {
2081
- type: "button",
2082
- onClick: () => g(
2083
- (C) => C + Gr
2084
- ),
2085
- children: t("modal.chatProfile.membersShowMore", {
2086
- count: F.length - c
2087
- })
2088
- }
2089
- )
2090
- ] })
2091
- ] }) })
2092
- ] }),
2093
- /* @__PURE__ */ k(de, { children: [
2094
- /* @__PURE__ */ k(Ut, { children: [
2095
- /* @__PURE__ */ T(he, { children: t("modal.chatProfile.filesTitle") }),
2096
- X.length > 6 && /* @__PURE__ */ T(
2097
- We,
2098
- {
2099
- type: "button",
2100
- onClick: () => i((C) => !C),
2101
- "aria-expanded": s,
2102
- children: t(s ? "modal.chatProfile.filesShowLess" : "modal.chatProfile.filesShowAll")
2103
- }
2104
- )
2105
- ] }),
2106
- /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(ce, { children: h && X.length === 0 ? /* @__PURE__ */ T($e, {}) : b && X.length === 0 ? /* @__PURE__ */ T(ve, { children: t("files.error.title") }) : X.length === 0 ? /* @__PURE__ */ T(ve, { children: t("modal.chatProfile.filesEmpty") }) : /* @__PURE__ */ T(
2107
- gr,
2108
- {
2109
- items: _,
2110
- fileToken: W,
2111
- onPreview: w,
2112
- onDownload: D,
2113
- onDelete: P,
2114
- compact: !0
2115
- }
2116
- ) }) })
2117
- ] }),
2118
- /* @__PURE__ */ T(
2119
- Fr,
2120
- {
2121
- isVisible: f,
2122
- setVisible: d,
2123
- chatJid: l.jid
2124
- }
2125
- ),
2126
- /* @__PURE__ */ T(
2127
- Qr,
2128
- {
2129
- isModalOpen: r,
2130
- setIsModalOpen: u
2131
- }
2132
- )
2133
- ]
2134
- }
2135
- );
2136
- };
2137
- export {
2138
- en as default
2139
- };