@epam/statgpt-conversation-list 0.2.0-rc.2 → 0.2.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -0
- package/index.js +3 -3
- package/index.mjs +1116 -969
- package/package.json +6 -6
package/index.mjs
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { cloneDeep as
|
|
5
|
-
import { Popup as
|
|
6
|
-
import { IconCheck as
|
|
1
|
+
import { jsxs as x, jsx as f, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
+
import j from "classnames";
|
|
3
|
+
import S, { useState as y, useMemo as q, useEffect as te, useCallback as k, useRef as ze } from "react";
|
|
4
|
+
import { cloneDeep as _e, omit as $e, uniqBy as He } from "lodash";
|
|
5
|
+
import { Popup as se, PopUpSize as de, Button as V, Loader as Ce, InputWithIcon as we, Input as Ye, PopUpState as Y, Dropdown as Re, HighlightText as je, IconButton as Qe } from "@epam/statgpt-ui-components";
|
|
6
|
+
import { IconCheck as Ge, IconCopy as Ve, IconDotsVertical as Xe, IconCaretRightFilled as We, IconX as Ke, IconSearch as Ze } from "@tabler/icons-react";
|
|
7
7
|
import Je from "jszip";
|
|
8
|
-
import { InvitationType as qe, getSharedConversationsRequest as
|
|
9
|
-
import { getClearedConversationName as
|
|
10
|
-
var
|
|
11
|
-
const
|
|
12
|
-
var
|
|
13
|
-
return ((
|
|
14
|
-
var h,
|
|
15
|
-
const
|
|
8
|
+
import { InvitationType as qe, getSharedConversationsRequest as ae, ShareTarget as le } from "@epam/statgpt-dial-toolkit";
|
|
9
|
+
import { SHARE_CONVERSATION_ROUTE as Ne, getClearedConversationName as fe, ONBOARDING_MODEL_POSTFIX as ve, cleanConversationNames as Z } from "@epam/statgpt-shared-toolkit";
|
|
10
|
+
var _ = /* @__PURE__ */ ((e) => (e.DELETE = "delete", e.EXPORT = "export", e.SHARE = "share", e.RENAME = "rename", e))(_ || {}), U = /* @__PURE__ */ ((e) => (e.SHARED = "shared", e.TODAY = "today", e.YESTERDAY = "yesterday", e.WEEK = "week", e.EARLIER = "earlier", e))(U || {});
|
|
11
|
+
const he = (e, o) => {
|
|
12
|
+
var r, s;
|
|
13
|
+
return ((s = (r = e == null ? void 0 : e.resources) == null ? void 0 : r.filter((l) => (l == null ? void 0 : l.parentPath) === o)) == null ? void 0 : s.map((l) => {
|
|
14
|
+
var h, t, n;
|
|
15
|
+
const c = `${l == null ? void 0 : l.bucket}/${o}`, m = (n = (t = (h = l == null ? void 0 : l.url) == null ? void 0 : h.split("/")) == null ? void 0 : t.slice(1)) == null ? void 0 : n.join("/");
|
|
16
16
|
return {
|
|
17
|
-
...
|
|
18
|
-
folderId:
|
|
19
|
-
id:
|
|
17
|
+
...l,
|
|
18
|
+
folderId: c,
|
|
19
|
+
id: m,
|
|
20
20
|
isShared: !0
|
|
21
21
|
};
|
|
22
22
|
})) || [];
|
|
23
|
-
},
|
|
24
|
-
[U.SHARED]:
|
|
25
|
-
}),
|
|
23
|
+
}, et = (e) => ({
|
|
24
|
+
[U.SHARED]: e
|
|
25
|
+
}), tt = {
|
|
26
26
|
[U.TODAY]: [],
|
|
27
27
|
[U.YESTERDAY]: [],
|
|
28
28
|
[U.WEEK]: [],
|
|
29
29
|
[U.EARLIER]: []
|
|
30
|
-
},
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
}, Me = (e, o) => e.toDateString() === o.toDateString(), nt = (e, o) => {
|
|
31
|
+
const r = new Date(
|
|
32
|
+
e.getFullYear(),
|
|
33
|
+
e.getMonth(),
|
|
34
|
+
e.getDate() - 1
|
|
35
35
|
);
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
const
|
|
39
|
-
return Math.floor(
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
for (const
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
(
|
|
48
|
-
) ||
|
|
36
|
+
return Me(o, r);
|
|
37
|
+
}, rt = (e, o) => {
|
|
38
|
+
const r = e.getTime() - o.getTime();
|
|
39
|
+
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
40
|
+
}, ot = (e) => {
|
|
41
|
+
const o = /* @__PURE__ */ new Date(), r = _e(tt);
|
|
42
|
+
for (const s of e)
|
|
43
|
+
if (s.updatedAt) {
|
|
44
|
+
const l = new Date(s.updatedAt);
|
|
45
|
+
let c;
|
|
46
|
+
Me(o, l) ? c = r[U.TODAY] : nt(o, l) ? c = r[U.YESTERDAY] : rt(o, l) <= 7 ? c = r[U.WEEK] : c = r[U.EARLIER], c != null && c.some(
|
|
47
|
+
(m) => m.id === s.id
|
|
48
|
+
) || c.push(s);
|
|
49
49
|
}
|
|
50
|
-
return
|
|
51
|
-
},
|
|
52
|
-
(
|
|
53
|
-
),
|
|
54
|
-
onCloseModal:
|
|
55
|
-
disableModalDividers:
|
|
56
|
-
deleteConversation:
|
|
57
|
-
isSmallButton:
|
|
58
|
-
titles:
|
|
59
|
-
locale:
|
|
60
|
-
}) => /* @__PURE__ */
|
|
61
|
-
|
|
50
|
+
return r;
|
|
51
|
+
}, be = (e) => e == null ? void 0 : e.sort(
|
|
52
|
+
(o, r) => ((r == null ? void 0 : r.updatedAt) || 0) - ((o == null ? void 0 : o.updatedAt) || 0)
|
|
53
|
+
), it = (e, o) => e === U.SHARED ? (o == null ? void 0 : o.shared) || "Shared" : e === U.TODAY ? (o == null ? void 0 : o.today) || "Today" : e === U.YESTERDAY ? (o == null ? void 0 : o.yesterday) || "Yesterday" : e === U.WEEK ? (o == null ? void 0 : o.lastWeek) || "Last week" : (o == null ? void 0 : o.earlier) || "Earlier", at = ({
|
|
54
|
+
onCloseModal: e,
|
|
55
|
+
disableModalDividers: o,
|
|
56
|
+
deleteConversation: r,
|
|
57
|
+
isSmallButton: s,
|
|
58
|
+
titles: l,
|
|
59
|
+
locale: c
|
|
60
|
+
}) => /* @__PURE__ */ x(
|
|
61
|
+
se,
|
|
62
62
|
{
|
|
63
|
-
heading: (
|
|
63
|
+
heading: (l == null ? void 0 : l.deleteTitle) ?? "Delete conversation",
|
|
64
64
|
portalId: "delete-conversation",
|
|
65
65
|
containerClassName: "delete-conversation-popup",
|
|
66
|
-
size:
|
|
67
|
-
dividers: !
|
|
68
|
-
onClose:
|
|
69
|
-
closeButtonTitle: (
|
|
66
|
+
size: de.SM,
|
|
67
|
+
dividers: !o,
|
|
68
|
+
onClose: e,
|
|
69
|
+
closeButtonTitle: (l == null ? void 0 : l.close) ?? "Cancel",
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
71
|
+
/* @__PURE__ */ f("div", { className: "py-4 px-6 sm:px-0", lang: c, children: (l == null ? void 0 : l.deleteMessage) ?? "Are you sure you want to delete this conversation? This action cannot be undone." }),
|
|
72
|
+
/* @__PURE__ */ x("div", { className: "flex justify-end gap-x-2 py-3 px-6 delete-conversation-popup-footer", children: [
|
|
73
|
+
/* @__PURE__ */ f(
|
|
74
|
+
V,
|
|
75
75
|
{
|
|
76
76
|
buttonClassName: "cancel-button",
|
|
77
|
-
title: (
|
|
78
|
-
isSmallButton:
|
|
79
|
-
onClick: (
|
|
80
|
-
|
|
77
|
+
title: (l == null ? void 0 : l.cancel) ?? "Cancel",
|
|
78
|
+
isSmallButton: s,
|
|
79
|
+
onClick: (m) => {
|
|
80
|
+
m.stopPropagation(), e();
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
84
|
+
/* @__PURE__ */ f(
|
|
85
|
+
V,
|
|
86
86
|
{
|
|
87
87
|
buttonClassName: "text-button-primary text-button-primary-error",
|
|
88
|
-
title: (
|
|
89
|
-
isSmallButton:
|
|
90
|
-
onClick: (
|
|
91
|
-
|
|
88
|
+
title: (l == null ? void 0 : l.delete) ?? "Delete",
|
|
89
|
+
isSmallButton: s,
|
|
90
|
+
onClick: (m) => {
|
|
91
|
+
m.stopPropagation(), r();
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
)
|
|
95
95
|
] })
|
|
96
96
|
]
|
|
97
97
|
}
|
|
98
|
-
),
|
|
99
|
-
const
|
|
100
|
-
var
|
|
101
|
-
const
|
|
98
|
+
), lt = (e) => {
|
|
99
|
+
const o = e.messages.flatMap((s) => {
|
|
100
|
+
var m, h, t;
|
|
101
|
+
const l = ((m = s.custom_content) == null ? void 0 : m.attachments) || [], c = ((t = (h = s.custom_content) == null ? void 0 : h.stages) == null ? void 0 : t.flatMap(
|
|
102
102
|
({ attachments: n }) => n ?? []
|
|
103
103
|
)) || [];
|
|
104
|
-
return [...
|
|
105
|
-
}) || [],
|
|
106
|
-
(
|
|
107
|
-
...
|
|
104
|
+
return [...l, ...c];
|
|
105
|
+
}) || [], r = ut(o).map(
|
|
106
|
+
(s) => ({
|
|
107
|
+
...s,
|
|
108
108
|
relativePath: "",
|
|
109
109
|
contentLength: 0
|
|
110
110
|
})
|
|
111
111
|
);
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
(
|
|
112
|
+
return He(
|
|
113
|
+
r,
|
|
114
|
+
(s) => ne(s.relativePath, s.name)
|
|
115
115
|
);
|
|
116
|
-
},
|
|
117
|
-
const
|
|
116
|
+
}, ct = (e) => e.endsWith("/"), st = (e) => {
|
|
117
|
+
const o = e.toLowerCase();
|
|
118
118
|
return [
|
|
119
119
|
"data:",
|
|
120
120
|
"//",
|
|
@@ -125,99 +125,99 @@ const ce = (t, r) => {
|
|
|
125
125
|
"mailto:",
|
|
126
126
|
"telnet://",
|
|
127
127
|
"api/files"
|
|
128
|
-
].some((
|
|
129
|
-
},
|
|
130
|
-
const
|
|
131
|
-
...
|
|
132
|
-
),
|
|
128
|
+
].some((r) => o.startsWith(r));
|
|
129
|
+
}, dt = (e) => {
|
|
130
|
+
const o = ne(
|
|
131
|
+
...e.split("/").map((s) => decodeURIComponent(s))
|
|
132
|
+
), r = o.lastIndexOf("/");
|
|
133
133
|
return {
|
|
134
|
-
absolutePath:
|
|
135
|
-
name:
|
|
134
|
+
absolutePath: o.slice(0, r),
|
|
135
|
+
name: o.slice(r + 1)
|
|
136
136
|
};
|
|
137
|
-
}, ut = (
|
|
138
|
-
if (!
|
|
137
|
+
}, ut = (e) => e ? e.map((o) => {
|
|
138
|
+
if (!o.url || st(o.url) || ct(o.url))
|
|
139
139
|
return null;
|
|
140
|
-
const { absolutePath:
|
|
140
|
+
const { absolutePath: r, name: s } = dt(o.url);
|
|
141
141
|
return {
|
|
142
|
-
id:
|
|
143
|
-
name:
|
|
144
|
-
contentType:
|
|
145
|
-
folderId:
|
|
146
|
-
absolutePath:
|
|
142
|
+
id: o.url,
|
|
143
|
+
name: s,
|
|
144
|
+
contentType: o.type,
|
|
145
|
+
folderId: r,
|
|
146
|
+
absolutePath: r
|
|
147
147
|
};
|
|
148
148
|
}).filter(Boolean) : [];
|
|
149
|
-
async function
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
149
|
+
async function ht(e, o) {
|
|
150
|
+
const r = lt(e), s = new Je();
|
|
151
|
+
r.forEach((h) => {
|
|
152
|
+
const t = encodeURI(ne(h.absolutePath, h.name)), n = o(`${t}`.replace("files/", "")), i = mt(h.folderId), a = ne("res", i, h.name);
|
|
153
|
+
s.file(a, n);
|
|
154
154
|
});
|
|
155
|
-
const
|
|
155
|
+
const l = {
|
|
156
156
|
version: 5,
|
|
157
|
-
history: [
|
|
157
|
+
history: [e].map(pt) || [],
|
|
158
158
|
folders: []
|
|
159
|
-
},
|
|
160
|
-
return
|
|
159
|
+
}, c = JSON.stringify(l, null, 2);
|
|
160
|
+
return s.file("conversations/conversations_history.json", c), await s.generateAsync({ type: "base64" });
|
|
161
161
|
}
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
},
|
|
166
|
-
function
|
|
167
|
-
const
|
|
168
|
-
|
|
162
|
+
const mt = (e) => {
|
|
163
|
+
const o = e.split("/");
|
|
164
|
+
return o.length > 2 ? ne(...o.slice(2)) : void 0;
|
|
165
|
+
}, pt = (e) => $e(e, ["publicationInfo"]), ne = (...e) => e.filter(Boolean).join("/");
|
|
166
|
+
function ft(e, o) {
|
|
167
|
+
const r = document.createElement("a");
|
|
168
|
+
r.download = o, r.href = e, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(e);
|
|
169
169
|
}
|
|
170
|
-
var
|
|
171
|
-
for (var
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
for (var
|
|
175
|
-
Ie.call(
|
|
176
|
-
return
|
|
177
|
-
},
|
|
178
|
-
var
|
|
179
|
-
for (var
|
|
180
|
-
|
|
181
|
-
if (
|
|
182
|
-
for (var
|
|
183
|
-
|
|
184
|
-
return
|
|
170
|
+
var gt = Object.defineProperty, ce = Object.getOwnPropertySymbols, Ae = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable, Ee = (e, o, r) => o in e ? gt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[o] = r, me = (e, o) => {
|
|
171
|
+
for (var r in o || (o = {}))
|
|
172
|
+
Ae.call(o, r) && Ee(e, r, o[r]);
|
|
173
|
+
if (ce)
|
|
174
|
+
for (var r of ce(o))
|
|
175
|
+
Ie.call(o, r) && Ee(e, r, o[r]);
|
|
176
|
+
return e;
|
|
177
|
+
}, pe = (e, o) => {
|
|
178
|
+
var r = {};
|
|
179
|
+
for (var s in e)
|
|
180
|
+
Ae.call(e, s) && o.indexOf(s) < 0 && (r[s] = e[s]);
|
|
181
|
+
if (e != null && ce)
|
|
182
|
+
for (var s of ce(e))
|
|
183
|
+
o.indexOf(s) < 0 && Ie.call(e, s) && (r[s] = e[s]);
|
|
184
|
+
return r;
|
|
185
185
|
};
|
|
186
186
|
/**
|
|
187
187
|
* @license QR Code generator library (TypeScript)
|
|
188
188
|
* Copyright (c) Project Nayuki.
|
|
189
189
|
* SPDX-License-Identifier: MIT
|
|
190
190
|
*/
|
|
191
|
-
var
|
|
192
|
-
((
|
|
193
|
-
const
|
|
191
|
+
var K;
|
|
192
|
+
((e) => {
|
|
193
|
+
const o = class R {
|
|
194
194
|
/*-- Constructor (low level) and fields --*/
|
|
195
195
|
// Creates a new QR Code with the given version number,
|
|
196
196
|
// error correction level, data codeword bytes, and mask number.
|
|
197
197
|
// This is a low-level API that most users should not use directly.
|
|
198
198
|
// A mid-level API is the encodeSegments() function.
|
|
199
|
-
constructor(
|
|
200
|
-
if (this.version =
|
|
199
|
+
constructor(t, n, i, a) {
|
|
200
|
+
if (this.version = t, this.errorCorrectionLevel = n, this.modules = [], this.isFunction = [], t < R.MIN_VERSION || t > R.MAX_VERSION)
|
|
201
201
|
throw new RangeError("Version value out of range");
|
|
202
|
-
if (
|
|
202
|
+
if (a < -1 || a > 7)
|
|
203
203
|
throw new RangeError("Mask value out of range");
|
|
204
|
-
this.size =
|
|
205
|
-
let
|
|
206
|
-
for (let
|
|
207
|
-
|
|
208
|
-
for (let
|
|
209
|
-
this.modules.push(
|
|
204
|
+
this.size = t * 4 + 17;
|
|
205
|
+
let d = [];
|
|
206
|
+
for (let u = 0; u < this.size; u++)
|
|
207
|
+
d.push(!1);
|
|
208
|
+
for (let u = 0; u < this.size; u++)
|
|
209
|
+
this.modules.push(d.slice()), this.isFunction.push(d.slice());
|
|
210
210
|
this.drawFunctionPatterns();
|
|
211
|
-
const
|
|
212
|
-
if (this.drawCodewords(
|
|
213
|
-
let
|
|
211
|
+
const p = this.addEccAndInterleave(i);
|
|
212
|
+
if (this.drawCodewords(p), a == -1) {
|
|
213
|
+
let u = 1e9;
|
|
214
214
|
for (let C = 0; C < 8; C++) {
|
|
215
215
|
this.applyMask(C), this.drawFormatBits(C);
|
|
216
|
-
const
|
|
217
|
-
|
|
216
|
+
const g = this.getPenaltyScore();
|
|
217
|
+
g < u && (a = C, u = g), this.applyMask(C);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
|
|
220
|
+
l(0 <= a && a <= 7), this.mask = a, this.applyMask(a), this.drawFormatBits(a), this.isFunction = [];
|
|
221
221
|
}
|
|
222
222
|
/*-- Static factory functions (high level) --*/
|
|
223
223
|
// Returns a QR Code representing the given Unicode text string at the given error correction level.
|
|
@@ -225,17 +225,17 @@ var W;
|
|
|
225
225
|
// Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
|
|
226
226
|
// QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
|
|
227
227
|
// ecl argument if it can be done without increasing the version.
|
|
228
|
-
static encodeText(
|
|
229
|
-
const
|
|
230
|
-
return R.encodeSegments(
|
|
228
|
+
static encodeText(t, n) {
|
|
229
|
+
const i = e.QrSegment.makeSegments(t);
|
|
230
|
+
return R.encodeSegments(i, n);
|
|
231
231
|
}
|
|
232
232
|
// Returns a QR Code representing the given binary data at the given error correction level.
|
|
233
233
|
// This function always encodes using the binary segment mode, not any text mode. The maximum number of
|
|
234
234
|
// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
|
|
235
235
|
// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
|
|
236
|
-
static encodeBinary(
|
|
237
|
-
const
|
|
238
|
-
return R.encodeSegments([
|
|
236
|
+
static encodeBinary(t, n) {
|
|
237
|
+
const i = e.QrSegment.makeBytes(t);
|
|
238
|
+
return R.encodeSegments([i], n);
|
|
239
239
|
}
|
|
240
240
|
/*-- Static factory functions (mid level) --*/
|
|
241
241
|
// Returns a QR Code representing the given segments with the given encoding parameters.
|
|
@@ -247,43 +247,43 @@ var W;
|
|
|
247
247
|
// This function allows the user to create a custom sequence of segments that switches
|
|
248
248
|
// between modes (such as alphanumeric and byte) to encode text in less space.
|
|
249
249
|
// This is a mid-level API; the high-level API is encodeText() and encodeBinary().
|
|
250
|
-
static encodeSegments(
|
|
251
|
-
if (!(R.MIN_VERSION <=
|
|
250
|
+
static encodeSegments(t, n, i = 1, a = 40, d = -1, p = !0) {
|
|
251
|
+
if (!(R.MIN_VERSION <= i && i <= a && a <= R.MAX_VERSION) || d < -1 || d > 7)
|
|
252
252
|
throw new RangeError("Invalid value");
|
|
253
|
-
let
|
|
254
|
-
for (
|
|
255
|
-
const E = R.getNumDataCodewords(
|
|
253
|
+
let u, C;
|
|
254
|
+
for (u = i; ; u++) {
|
|
255
|
+
const E = R.getNumDataCodewords(u, n) * 8, N = m.getTotalBits(t, u);
|
|
256
256
|
if (N <= E) {
|
|
257
257
|
C = N;
|
|
258
258
|
break;
|
|
259
259
|
}
|
|
260
|
-
if (
|
|
260
|
+
if (u >= a)
|
|
261
261
|
throw new RangeError("Data too long");
|
|
262
262
|
}
|
|
263
263
|
for (const E of [R.Ecc.MEDIUM, R.Ecc.QUARTILE, R.Ecc.HIGH])
|
|
264
|
-
|
|
265
|
-
let
|
|
266
|
-
for (const E of
|
|
267
|
-
|
|
264
|
+
p && C <= R.getNumDataCodewords(u, E) * 8 && (n = E);
|
|
265
|
+
let g = [];
|
|
266
|
+
for (const E of t) {
|
|
267
|
+
r(E.mode.modeBits, 4, g), r(E.numChars, E.mode.numCharCountBits(u), g);
|
|
268
268
|
for (const N of E.getData())
|
|
269
|
-
|
|
269
|
+
g.push(N);
|
|
270
270
|
}
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
for (let E = 236;
|
|
275
|
-
|
|
271
|
+
l(g.length == C);
|
|
272
|
+
const b = R.getNumDataCodewords(u, n) * 8;
|
|
273
|
+
l(g.length <= b), r(0, Math.min(4, b - g.length), g), r(0, (8 - g.length % 8) % 8, g), l(g.length % 8 == 0);
|
|
274
|
+
for (let E = 236; g.length < b; E ^= 253)
|
|
275
|
+
r(E, 8, g);
|
|
276
276
|
let w = [];
|
|
277
|
-
for (; w.length * 8 <
|
|
277
|
+
for (; w.length * 8 < g.length; )
|
|
278
278
|
w.push(0);
|
|
279
|
-
return
|
|
279
|
+
return g.forEach((E, N) => w[N >>> 3] |= E << 7 - (N & 7)), new R(u, n, w, d);
|
|
280
280
|
}
|
|
281
281
|
/*-- Accessor methods --*/
|
|
282
282
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
283
283
|
// for light or true for dark. The top left corner has the coordinates (x=0, y=0).
|
|
284
284
|
// If the given coordinates are out of bounds, then false (light) is returned.
|
|
285
|
-
getModule(
|
|
286
|
-
return 0 <=
|
|
285
|
+
getModule(t, n) {
|
|
286
|
+
return 0 <= t && t < this.size && 0 <= n && n < this.size && this.modules[n][t];
|
|
287
287
|
}
|
|
288
288
|
// Modified to expose modules for easy access
|
|
289
289
|
getModules() {
|
|
@@ -292,33 +292,33 @@ var W;
|
|
|
292
292
|
/*-- Private helper methods for constructor: Drawing function modules --*/
|
|
293
293
|
// Reads this object's version field, and draws and marks all function modules.
|
|
294
294
|
drawFunctionPatterns() {
|
|
295
|
-
for (let
|
|
296
|
-
this.setFunctionModule(6,
|
|
295
|
+
for (let i = 0; i < this.size; i++)
|
|
296
|
+
this.setFunctionModule(6, i, i % 2 == 0), this.setFunctionModule(i, 6, i % 2 == 0);
|
|
297
297
|
this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
|
|
298
|
-
const
|
|
299
|
-
for (let
|
|
300
|
-
for (let
|
|
301
|
-
|
|
298
|
+
const t = this.getAlignmentPatternPositions(), n = t.length;
|
|
299
|
+
for (let i = 0; i < n; i++)
|
|
300
|
+
for (let a = 0; a < n; a++)
|
|
301
|
+
i == 0 && a == 0 || i == 0 && a == n - 1 || i == n - 1 && a == 0 || this.drawAlignmentPattern(t[i], t[a]);
|
|
302
302
|
this.drawFormatBits(0), this.drawVersion();
|
|
303
303
|
}
|
|
304
304
|
// Draws two copies of the format bits (with its own error correction code)
|
|
305
305
|
// based on the given mask and this object's error correction level field.
|
|
306
|
-
drawFormatBits(
|
|
307
|
-
const n = this.errorCorrectionLevel.formatBits << 3 |
|
|
308
|
-
let
|
|
309
|
-
for (let
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
for (let
|
|
314
|
-
this.setFunctionModule(8,
|
|
315
|
-
this.setFunctionModule(8, 7,
|
|
316
|
-
for (let
|
|
317
|
-
this.setFunctionModule(14 -
|
|
318
|
-
for (let
|
|
319
|
-
this.setFunctionModule(this.size - 1 -
|
|
320
|
-
for (let
|
|
321
|
-
this.setFunctionModule(8, this.size - 15 +
|
|
306
|
+
drawFormatBits(t) {
|
|
307
|
+
const n = this.errorCorrectionLevel.formatBits << 3 | t;
|
|
308
|
+
let i = n;
|
|
309
|
+
for (let d = 0; d < 10; d++)
|
|
310
|
+
i = i << 1 ^ (i >>> 9) * 1335;
|
|
311
|
+
const a = (n << 10 | i) ^ 21522;
|
|
312
|
+
l(a >>> 15 == 0);
|
|
313
|
+
for (let d = 0; d <= 5; d++)
|
|
314
|
+
this.setFunctionModule(8, d, s(a, d));
|
|
315
|
+
this.setFunctionModule(8, 7, s(a, 6)), this.setFunctionModule(8, 8, s(a, 7)), this.setFunctionModule(7, 8, s(a, 8));
|
|
316
|
+
for (let d = 9; d < 15; d++)
|
|
317
|
+
this.setFunctionModule(14 - d, 8, s(a, d));
|
|
318
|
+
for (let d = 0; d < 8; d++)
|
|
319
|
+
this.setFunctionModule(this.size - 1 - d, 8, s(a, d));
|
|
320
|
+
for (let d = 8; d < 15; d++)
|
|
321
|
+
this.setFunctionModule(8, this.size - 15 + d, s(a, d));
|
|
322
322
|
this.setFunctionModule(8, this.size - 8, !0);
|
|
323
323
|
}
|
|
324
324
|
// Draws two copies of the version bits (with its own error correction code),
|
|
@@ -326,144 +326,144 @@ var W;
|
|
|
326
326
|
drawVersion() {
|
|
327
327
|
if (this.version < 7)
|
|
328
328
|
return;
|
|
329
|
-
let
|
|
330
|
-
for (let
|
|
331
|
-
|
|
332
|
-
const n = this.version << 12 |
|
|
333
|
-
|
|
334
|
-
for (let
|
|
335
|
-
const
|
|
336
|
-
this.setFunctionModule(
|
|
329
|
+
let t = this.version;
|
|
330
|
+
for (let i = 0; i < 12; i++)
|
|
331
|
+
t = t << 1 ^ (t >>> 11) * 7973;
|
|
332
|
+
const n = this.version << 12 | t;
|
|
333
|
+
l(n >>> 18 == 0);
|
|
334
|
+
for (let i = 0; i < 18; i++) {
|
|
335
|
+
const a = s(n, i), d = this.size - 11 + i % 3, p = Math.floor(i / 3);
|
|
336
|
+
this.setFunctionModule(d, p, a), this.setFunctionModule(p, d, a);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
// Draws a 9*9 finder pattern including the border separator,
|
|
340
340
|
// with the center module at (x, y). Modules can be out of bounds.
|
|
341
|
-
drawFinderPattern(
|
|
342
|
-
for (let
|
|
343
|
-
for (let
|
|
344
|
-
const
|
|
345
|
-
0 <=
|
|
341
|
+
drawFinderPattern(t, n) {
|
|
342
|
+
for (let i = -4; i <= 4; i++)
|
|
343
|
+
for (let a = -4; a <= 4; a++) {
|
|
344
|
+
const d = Math.max(Math.abs(a), Math.abs(i)), p = t + a, u = n + i;
|
|
345
|
+
0 <= p && p < this.size && 0 <= u && u < this.size && this.setFunctionModule(p, u, d != 2 && d != 4);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
// Draws a 5*5 alignment pattern, with the center module
|
|
349
349
|
// at (x, y). All modules must be in bounds.
|
|
350
|
-
drawAlignmentPattern(
|
|
351
|
-
for (let
|
|
352
|
-
for (let
|
|
353
|
-
this.setFunctionModule(
|
|
350
|
+
drawAlignmentPattern(t, n) {
|
|
351
|
+
for (let i = -2; i <= 2; i++)
|
|
352
|
+
for (let a = -2; a <= 2; a++)
|
|
353
|
+
this.setFunctionModule(t + a, n + i, Math.max(Math.abs(a), Math.abs(i)) != 1);
|
|
354
354
|
}
|
|
355
355
|
// Sets the color of a module and marks it as a function module.
|
|
356
356
|
// Only used by the constructor. Coordinates must be in bounds.
|
|
357
|
-
setFunctionModule(
|
|
358
|
-
this.modules[n][
|
|
357
|
+
setFunctionModule(t, n, i) {
|
|
358
|
+
this.modules[n][t] = i, this.isFunction[n][t] = !0;
|
|
359
359
|
}
|
|
360
360
|
/*-- Private helper methods for constructor: Codewords and masking --*/
|
|
361
361
|
// Returns a new byte string representing the given data with the appropriate error correction
|
|
362
362
|
// codewords appended to it, based on this object's version and error correction level.
|
|
363
|
-
addEccAndInterleave(
|
|
364
|
-
const n = this.version,
|
|
365
|
-
if (
|
|
363
|
+
addEccAndInterleave(t) {
|
|
364
|
+
const n = this.version, i = this.errorCorrectionLevel;
|
|
365
|
+
if (t.length != R.getNumDataCodewords(n, i))
|
|
366
366
|
throw new RangeError("Invalid argument");
|
|
367
|
-
const
|
|
368
|
-
let
|
|
369
|
-
const
|
|
370
|
-
for (let E = 0, N = 0; E <
|
|
371
|
-
let
|
|
372
|
-
N +=
|
|
373
|
-
const P = R.reedSolomonComputeRemainder(
|
|
374
|
-
E <
|
|
367
|
+
const a = R.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][n], d = R.ECC_CODEWORDS_PER_BLOCK[i.ordinal][n], p = Math.floor(R.getNumRawDataModules(n) / 8), u = a - p % a, C = Math.floor(p / a);
|
|
368
|
+
let g = [];
|
|
369
|
+
const b = R.reedSolomonComputeDivisor(d);
|
|
370
|
+
for (let E = 0, N = 0; E < a; E++) {
|
|
371
|
+
let I = t.slice(N, N + C - d + (E < u ? 0 : 1));
|
|
372
|
+
N += I.length;
|
|
373
|
+
const P = R.reedSolomonComputeRemainder(I, b);
|
|
374
|
+
E < u && I.push(0), g.push(I.concat(P));
|
|
375
375
|
}
|
|
376
376
|
let w = [];
|
|
377
|
-
for (let E = 0; E <
|
|
378
|
-
|
|
379
|
-
(E != C -
|
|
377
|
+
for (let E = 0; E < g[0].length; E++)
|
|
378
|
+
g.forEach((N, I) => {
|
|
379
|
+
(E != C - d || I >= u) && w.push(N[E]);
|
|
380
380
|
});
|
|
381
|
-
return
|
|
381
|
+
return l(w.length == p), w;
|
|
382
382
|
}
|
|
383
383
|
// Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
|
|
384
384
|
// data area of this QR Code. Function modules need to be marked off before this is called.
|
|
385
|
-
drawCodewords(
|
|
386
|
-
if (
|
|
385
|
+
drawCodewords(t) {
|
|
386
|
+
if (t.length != Math.floor(R.getNumRawDataModules(this.version) / 8))
|
|
387
387
|
throw new RangeError("Invalid argument");
|
|
388
388
|
let n = 0;
|
|
389
|
-
for (let
|
|
390
|
-
|
|
391
|
-
for (let
|
|
392
|
-
for (let
|
|
393
|
-
const
|
|
394
|
-
!this.isFunction[C][
|
|
389
|
+
for (let i = this.size - 1; i >= 1; i -= 2) {
|
|
390
|
+
i == 6 && (i = 5);
|
|
391
|
+
for (let a = 0; a < this.size; a++)
|
|
392
|
+
for (let d = 0; d < 2; d++) {
|
|
393
|
+
const p = i - d, C = (i + 1 & 2) == 0 ? this.size - 1 - a : a;
|
|
394
|
+
!this.isFunction[C][p] && n < t.length * 8 && (this.modules[C][p] = s(t[n >>> 3], 7 - (n & 7)), n++);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
l(n == t.length * 8);
|
|
398
398
|
}
|
|
399
399
|
// XORs the codeword modules in this QR Code with the given mask pattern.
|
|
400
400
|
// The function modules must be marked and the codeword bits must be drawn
|
|
401
401
|
// before masking. Due to the arithmetic of XOR, calling applyMask() with
|
|
402
402
|
// the same mask value a second time will undo the mask. A final well-formed
|
|
403
403
|
// QR Code needs exactly one (not zero, two, etc.) mask applied.
|
|
404
|
-
applyMask(
|
|
405
|
-
if (
|
|
404
|
+
applyMask(t) {
|
|
405
|
+
if (t < 0 || t > 7)
|
|
406
406
|
throw new RangeError("Mask value out of range");
|
|
407
407
|
for (let n = 0; n < this.size; n++)
|
|
408
|
-
for (let
|
|
409
|
-
let
|
|
410
|
-
switch (
|
|
408
|
+
for (let i = 0; i < this.size; i++) {
|
|
409
|
+
let a;
|
|
410
|
+
switch (t) {
|
|
411
411
|
case 0:
|
|
412
|
-
|
|
412
|
+
a = (i + n) % 2 == 0;
|
|
413
413
|
break;
|
|
414
414
|
case 1:
|
|
415
|
-
|
|
415
|
+
a = n % 2 == 0;
|
|
416
416
|
break;
|
|
417
417
|
case 2:
|
|
418
|
-
|
|
418
|
+
a = i % 3 == 0;
|
|
419
419
|
break;
|
|
420
420
|
case 3:
|
|
421
|
-
|
|
421
|
+
a = (i + n) % 3 == 0;
|
|
422
422
|
break;
|
|
423
423
|
case 4:
|
|
424
|
-
|
|
424
|
+
a = (Math.floor(i / 3) + Math.floor(n / 2)) % 2 == 0;
|
|
425
425
|
break;
|
|
426
426
|
case 5:
|
|
427
|
-
|
|
427
|
+
a = i * n % 2 + i * n % 3 == 0;
|
|
428
428
|
break;
|
|
429
429
|
case 6:
|
|
430
|
-
|
|
430
|
+
a = (i * n % 2 + i * n % 3) % 2 == 0;
|
|
431
431
|
break;
|
|
432
432
|
case 7:
|
|
433
|
-
|
|
433
|
+
a = ((i + n) % 2 + i * n % 3) % 2 == 0;
|
|
434
434
|
break;
|
|
435
435
|
default:
|
|
436
436
|
throw new Error("Unreachable");
|
|
437
437
|
}
|
|
438
|
-
!this.isFunction[n][
|
|
438
|
+
!this.isFunction[n][i] && a && (this.modules[n][i] = !this.modules[n][i]);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
// Calculates and returns the penalty score based on state of this QR Code's current modules.
|
|
442
442
|
// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
|
|
443
443
|
getPenaltyScore() {
|
|
444
|
-
let
|
|
445
|
-
for (let
|
|
446
|
-
let
|
|
447
|
-
for (let
|
|
448
|
-
this.modules[
|
|
449
|
-
|
|
444
|
+
let t = 0;
|
|
445
|
+
for (let d = 0; d < this.size; d++) {
|
|
446
|
+
let p = !1, u = 0, C = [0, 0, 0, 0, 0, 0, 0];
|
|
447
|
+
for (let g = 0; g < this.size; g++)
|
|
448
|
+
this.modules[d][g] == p ? (u++, u == 5 ? t += R.PENALTY_N1 : u > 5 && t++) : (this.finderPenaltyAddHistory(u, C), p || (t += this.finderPenaltyCountPatterns(C) * R.PENALTY_N3), p = this.modules[d][g], u = 1);
|
|
449
|
+
t += this.finderPenaltyTerminateAndCount(p, u, C) * R.PENALTY_N3;
|
|
450
450
|
}
|
|
451
|
-
for (let
|
|
452
|
-
let
|
|
453
|
-
for (let
|
|
454
|
-
this.modules[
|
|
455
|
-
|
|
451
|
+
for (let d = 0; d < this.size; d++) {
|
|
452
|
+
let p = !1, u = 0, C = [0, 0, 0, 0, 0, 0, 0];
|
|
453
|
+
for (let g = 0; g < this.size; g++)
|
|
454
|
+
this.modules[g][d] == p ? (u++, u == 5 ? t += R.PENALTY_N1 : u > 5 && t++) : (this.finderPenaltyAddHistory(u, C), p || (t += this.finderPenaltyCountPatterns(C) * R.PENALTY_N3), p = this.modules[g][d], u = 1);
|
|
455
|
+
t += this.finderPenaltyTerminateAndCount(p, u, C) * R.PENALTY_N3;
|
|
456
456
|
}
|
|
457
|
-
for (let
|
|
458
|
-
for (let
|
|
459
|
-
const
|
|
460
|
-
|
|
457
|
+
for (let d = 0; d < this.size - 1; d++)
|
|
458
|
+
for (let p = 0; p < this.size - 1; p++) {
|
|
459
|
+
const u = this.modules[d][p];
|
|
460
|
+
u == this.modules[d][p + 1] && u == this.modules[d + 1][p] && u == this.modules[d + 1][p + 1] && (t += R.PENALTY_N2);
|
|
461
461
|
}
|
|
462
462
|
let n = 0;
|
|
463
|
-
for (const
|
|
464
|
-
n =
|
|
465
|
-
const
|
|
466
|
-
return
|
|
463
|
+
for (const d of this.modules)
|
|
464
|
+
n = d.reduce((p, u) => p + (u ? 1 : 0), n);
|
|
465
|
+
const i = this.size * this.size, a = Math.ceil(Math.abs(n * 20 - i * 10) / i) - 1;
|
|
466
|
+
return l(0 <= a && a <= 9), t += a * R.PENALTY_N4, l(0 <= t && t <= 2568888), t;
|
|
467
467
|
}
|
|
468
468
|
/*-- Private helper functions --*/
|
|
469
469
|
// Returns an ascending list of positions of alignment patterns for this version number.
|
|
@@ -473,86 +473,86 @@ var W;
|
|
|
473
473
|
if (this.version == 1)
|
|
474
474
|
return [];
|
|
475
475
|
{
|
|
476
|
-
const
|
|
477
|
-
let
|
|
478
|
-
for (let
|
|
479
|
-
|
|
480
|
-
return
|
|
476
|
+
const t = Math.floor(this.version / 7) + 2, n = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (t * 2 - 2)) * 2;
|
|
477
|
+
let i = [6];
|
|
478
|
+
for (let a = this.size - 7; i.length < t; a -= n)
|
|
479
|
+
i.splice(1, 0, a);
|
|
480
|
+
return i;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
// Returns the number of data bits that can be stored in a QR Code of the given version number, after
|
|
484
484
|
// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
|
|
485
485
|
// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
|
|
486
|
-
static getNumRawDataModules(
|
|
487
|
-
if (
|
|
486
|
+
static getNumRawDataModules(t) {
|
|
487
|
+
if (t < R.MIN_VERSION || t > R.MAX_VERSION)
|
|
488
488
|
throw new RangeError("Version number out of range");
|
|
489
|
-
let n = (16 *
|
|
490
|
-
if (
|
|
491
|
-
const
|
|
492
|
-
n -= (25 *
|
|
489
|
+
let n = (16 * t + 128) * t + 64;
|
|
490
|
+
if (t >= 2) {
|
|
491
|
+
const i = Math.floor(t / 7) + 2;
|
|
492
|
+
n -= (25 * i - 10) * i - 55, t >= 7 && (n -= 36);
|
|
493
493
|
}
|
|
494
|
-
return
|
|
494
|
+
return l(208 <= n && n <= 29648), n;
|
|
495
495
|
}
|
|
496
496
|
// Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
|
|
497
497
|
// QR Code of the given version number and error correction level, with remainder bits discarded.
|
|
498
498
|
// This stateless pure function could be implemented as a (40*4)-cell lookup table.
|
|
499
|
-
static getNumDataCodewords(
|
|
500
|
-
return Math.floor(R.getNumRawDataModules(
|
|
499
|
+
static getNumDataCodewords(t, n) {
|
|
500
|
+
return Math.floor(R.getNumRawDataModules(t) / 8) - R.ECC_CODEWORDS_PER_BLOCK[n.ordinal][t] * R.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][t];
|
|
501
501
|
}
|
|
502
502
|
// Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
|
|
503
503
|
// implemented as a lookup table over all possible parameter values, instead of as an algorithm.
|
|
504
|
-
static reedSolomonComputeDivisor(
|
|
505
|
-
if (
|
|
504
|
+
static reedSolomonComputeDivisor(t) {
|
|
505
|
+
if (t < 1 || t > 255)
|
|
506
506
|
throw new RangeError("Degree out of range");
|
|
507
507
|
let n = [];
|
|
508
|
-
for (let
|
|
508
|
+
for (let a = 0; a < t - 1; a++)
|
|
509
509
|
n.push(0);
|
|
510
510
|
n.push(1);
|
|
511
|
-
let
|
|
512
|
-
for (let
|
|
513
|
-
for (let
|
|
514
|
-
n[
|
|
515
|
-
|
|
511
|
+
let i = 1;
|
|
512
|
+
for (let a = 0; a < t; a++) {
|
|
513
|
+
for (let d = 0; d < n.length; d++)
|
|
514
|
+
n[d] = R.reedSolomonMultiply(n[d], i), d + 1 < n.length && (n[d] ^= n[d + 1]);
|
|
515
|
+
i = R.reedSolomonMultiply(i, 2);
|
|
516
516
|
}
|
|
517
517
|
return n;
|
|
518
518
|
}
|
|
519
519
|
// Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
|
|
520
|
-
static reedSolomonComputeRemainder(
|
|
521
|
-
let
|
|
522
|
-
for (const
|
|
523
|
-
const
|
|
524
|
-
|
|
520
|
+
static reedSolomonComputeRemainder(t, n) {
|
|
521
|
+
let i = n.map((a) => 0);
|
|
522
|
+
for (const a of t) {
|
|
523
|
+
const d = a ^ i.shift();
|
|
524
|
+
i.push(0), n.forEach((p, u) => i[u] ^= R.reedSolomonMultiply(p, d));
|
|
525
525
|
}
|
|
526
|
-
return
|
|
526
|
+
return i;
|
|
527
527
|
}
|
|
528
528
|
// Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
|
|
529
529
|
// are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
|
|
530
|
-
static reedSolomonMultiply(
|
|
531
|
-
if (
|
|
530
|
+
static reedSolomonMultiply(t, n) {
|
|
531
|
+
if (t >>> 8 || n >>> 8)
|
|
532
532
|
throw new RangeError("Byte out of range");
|
|
533
|
-
let
|
|
534
|
-
for (let
|
|
535
|
-
|
|
536
|
-
return
|
|
533
|
+
let i = 0;
|
|
534
|
+
for (let a = 7; a >= 0; a--)
|
|
535
|
+
i = i << 1 ^ (i >>> 7) * 285, i ^= (n >>> a & 1) * t;
|
|
536
|
+
return l(i >>> 8 == 0), i;
|
|
537
537
|
}
|
|
538
538
|
// Can only be called immediately after a light run is added, and
|
|
539
539
|
// returns either 0, 1, or 2. A helper function for getPenaltyScore().
|
|
540
|
-
finderPenaltyCountPatterns(
|
|
541
|
-
const n =
|
|
542
|
-
|
|
543
|
-
const
|
|
544
|
-
return (
|
|
540
|
+
finderPenaltyCountPatterns(t) {
|
|
541
|
+
const n = t[1];
|
|
542
|
+
l(n <= this.size * 3);
|
|
543
|
+
const i = n > 0 && t[2] == n && t[3] == n * 3 && t[4] == n && t[5] == n;
|
|
544
|
+
return (i && t[0] >= n * 4 && t[6] >= n ? 1 : 0) + (i && t[6] >= n * 4 && t[0] >= n ? 1 : 0);
|
|
545
545
|
}
|
|
546
546
|
// Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
|
|
547
|
-
finderPenaltyTerminateAndCount(
|
|
548
|
-
return
|
|
547
|
+
finderPenaltyTerminateAndCount(t, n, i) {
|
|
548
|
+
return t && (this.finderPenaltyAddHistory(n, i), n = 0), n += this.size, this.finderPenaltyAddHistory(n, i), this.finderPenaltyCountPatterns(i);
|
|
549
549
|
}
|
|
550
550
|
// Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
|
|
551
|
-
finderPenaltyAddHistory(
|
|
552
|
-
n[0] == 0 && (
|
|
551
|
+
finderPenaltyAddHistory(t, n) {
|
|
552
|
+
n[0] == 0 && (t += this.size), n.pop(), n.unshift(t);
|
|
553
553
|
}
|
|
554
554
|
};
|
|
555
|
-
|
|
555
|
+
o.MIN_VERSION = 1, o.MAX_VERSION = 40, o.PENALTY_N1 = 3, o.PENALTY_N2 = 3, o.PENALTY_N3 = 40, o.PENALTY_N4 = 10, o.ECC_CODEWORDS_PER_BLOCK = [
|
|
556
556
|
// Version: (note that index 0 is for padding, and is set to an illegal value)
|
|
557
557
|
//0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
|
|
558
558
|
[-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
|
|
@@ -563,7 +563,7 @@ var W;
|
|
|
563
563
|
// Quartile
|
|
564
564
|
[-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
|
|
565
565
|
// High
|
|
566
|
-
],
|
|
566
|
+
], o.NUM_ERROR_CORRECTION_BLOCKS = [
|
|
567
567
|
// Version: (note that index 0 is for padding, and is set to an illegal value)
|
|
568
568
|
//0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
|
|
569
569
|
[-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
|
|
@@ -574,95 +574,95 @@ var W;
|
|
|
574
574
|
// Quartile
|
|
575
575
|
[-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
|
|
576
576
|
// High
|
|
577
|
-
],
|
|
578
|
-
function
|
|
579
|
-
if (
|
|
577
|
+
], e.QrCode = o;
|
|
578
|
+
function r(h, t, n) {
|
|
579
|
+
if (t < 0 || t > 31 || h >>> t)
|
|
580
580
|
throw new RangeError("Value out of range");
|
|
581
|
-
for (let
|
|
582
|
-
n.push(h >>>
|
|
581
|
+
for (let i = t - 1; i >= 0; i--)
|
|
582
|
+
n.push(h >>> i & 1);
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
return (h >>>
|
|
584
|
+
function s(h, t) {
|
|
585
|
+
return (h >>> t & 1) != 0;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function l(h) {
|
|
588
588
|
if (!h)
|
|
589
589
|
throw new Error("Assertion error");
|
|
590
590
|
}
|
|
591
|
-
const
|
|
591
|
+
const c = class D {
|
|
592
592
|
/*-- Constructor (low level) and fields --*/
|
|
593
593
|
// Creates a new QR Code segment with the given attributes and data.
|
|
594
594
|
// The character count (numChars) must agree with the mode and the bit buffer length,
|
|
595
595
|
// but the constraint isn't checked. The given bit buffer is cloned and stored.
|
|
596
|
-
constructor(
|
|
597
|
-
if (this.mode =
|
|
596
|
+
constructor(t, n, i) {
|
|
597
|
+
if (this.mode = t, this.numChars = n, this.bitData = i, n < 0)
|
|
598
598
|
throw new RangeError("Invalid argument");
|
|
599
|
-
this.bitData =
|
|
599
|
+
this.bitData = i.slice();
|
|
600
600
|
}
|
|
601
601
|
/*-- Static factory functions (mid level) --*/
|
|
602
602
|
// Returns a segment representing the given binary data encoded in
|
|
603
603
|
// byte mode. All input byte arrays are acceptable. Any text string
|
|
604
604
|
// can be converted to UTF-8 bytes and encoded as a byte mode segment.
|
|
605
|
-
static makeBytes(
|
|
605
|
+
static makeBytes(t) {
|
|
606
606
|
let n = [];
|
|
607
|
-
for (const
|
|
608
|
-
|
|
609
|
-
return new
|
|
607
|
+
for (const i of t)
|
|
608
|
+
r(i, 8, n);
|
|
609
|
+
return new D(D.Mode.BYTE, t.length, n);
|
|
610
610
|
}
|
|
611
611
|
// Returns a segment representing the given string of decimal digits encoded in numeric mode.
|
|
612
|
-
static makeNumeric(
|
|
613
|
-
if (!
|
|
612
|
+
static makeNumeric(t) {
|
|
613
|
+
if (!D.isNumeric(t))
|
|
614
614
|
throw new RangeError("String contains non-numeric characters");
|
|
615
615
|
let n = [];
|
|
616
|
-
for (let
|
|
617
|
-
const
|
|
618
|
-
|
|
616
|
+
for (let i = 0; i < t.length; ) {
|
|
617
|
+
const a = Math.min(t.length - i, 3);
|
|
618
|
+
r(parseInt(t.substring(i, i + a), 10), a * 3 + 1, n), i += a;
|
|
619
619
|
}
|
|
620
|
-
return new
|
|
620
|
+
return new D(D.Mode.NUMERIC, t.length, n);
|
|
621
621
|
}
|
|
622
622
|
// Returns a segment representing the given text string encoded in alphanumeric mode.
|
|
623
623
|
// The characters allowed are: 0 to 9, A to Z (uppercase only), space,
|
|
624
624
|
// dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
625
|
-
static makeAlphanumeric(
|
|
626
|
-
if (!
|
|
625
|
+
static makeAlphanumeric(t) {
|
|
626
|
+
if (!D.isAlphanumeric(t))
|
|
627
627
|
throw new RangeError("String contains unencodable characters in alphanumeric mode");
|
|
628
|
-
let n = [],
|
|
629
|
-
for (
|
|
630
|
-
let
|
|
631
|
-
|
|
628
|
+
let n = [], i;
|
|
629
|
+
for (i = 0; i + 2 <= t.length; i += 2) {
|
|
630
|
+
let a = D.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)) * 45;
|
|
631
|
+
a += D.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i + 1)), r(a, 11, n);
|
|
632
632
|
}
|
|
633
|
-
return
|
|
633
|
+
return i < t.length && r(D.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)), 6, n), new D(D.Mode.ALPHANUMERIC, t.length, n);
|
|
634
634
|
}
|
|
635
635
|
// Returns a new mutable list of zero or more segments to represent the given Unicode text string.
|
|
636
636
|
// The result may use various segment modes and switch modes to optimize the length of the bit stream.
|
|
637
|
-
static makeSegments(
|
|
638
|
-
return
|
|
637
|
+
static makeSegments(t) {
|
|
638
|
+
return t == "" ? [] : D.isNumeric(t) ? [D.makeNumeric(t)] : D.isAlphanumeric(t) ? [D.makeAlphanumeric(t)] : [D.makeBytes(D.toUtf8ByteArray(t))];
|
|
639
639
|
}
|
|
640
640
|
// Returns a segment representing an Extended Channel Interpretation
|
|
641
641
|
// (ECI) designator with the given assignment value.
|
|
642
|
-
static makeEci(
|
|
642
|
+
static makeEci(t) {
|
|
643
643
|
let n = [];
|
|
644
|
-
if (
|
|
644
|
+
if (t < 0)
|
|
645
645
|
throw new RangeError("ECI assignment value out of range");
|
|
646
|
-
if (
|
|
647
|
-
|
|
648
|
-
else if (
|
|
649
|
-
|
|
650
|
-
else if (
|
|
651
|
-
|
|
646
|
+
if (t < 128)
|
|
647
|
+
r(t, 8, n);
|
|
648
|
+
else if (t < 16384)
|
|
649
|
+
r(2, 2, n), r(t, 14, n);
|
|
650
|
+
else if (t < 1e6)
|
|
651
|
+
r(6, 3, n), r(t, 21, n);
|
|
652
652
|
else
|
|
653
653
|
throw new RangeError("ECI assignment value out of range");
|
|
654
|
-
return new
|
|
654
|
+
return new D(D.Mode.ECI, 0, n);
|
|
655
655
|
}
|
|
656
656
|
// Tests whether the given string can be encoded as a segment in numeric mode.
|
|
657
657
|
// A string is encodable iff each character is in the range 0 to 9.
|
|
658
|
-
static isNumeric(
|
|
659
|
-
return
|
|
658
|
+
static isNumeric(t) {
|
|
659
|
+
return D.NUMERIC_REGEX.test(t);
|
|
660
660
|
}
|
|
661
661
|
// Tests whether the given string can be encoded as a segment in alphanumeric mode.
|
|
662
662
|
// A string is encodable iff each character is in the following set: 0 to 9, A to Z
|
|
663
663
|
// (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
664
|
-
static isAlphanumeric(
|
|
665
|
-
return
|
|
664
|
+
static isAlphanumeric(t) {
|
|
665
|
+
return D.ALPHANUMERIC_REGEX.test(t);
|
|
666
666
|
}
|
|
667
667
|
/*-- Methods --*/
|
|
668
668
|
// Returns a new copy of the data bits of this segment.
|
|
@@ -671,176 +671,176 @@ var W;
|
|
|
671
671
|
}
|
|
672
672
|
// (Package-private) Calculates and returns the number of bits needed to encode the given segments at
|
|
673
673
|
// the given version. The result is infinity if a segment has too many characters to fit its length field.
|
|
674
|
-
static getTotalBits(
|
|
675
|
-
let
|
|
676
|
-
for (const
|
|
677
|
-
const
|
|
678
|
-
if (
|
|
674
|
+
static getTotalBits(t, n) {
|
|
675
|
+
let i = 0;
|
|
676
|
+
for (const a of t) {
|
|
677
|
+
const d = a.mode.numCharCountBits(n);
|
|
678
|
+
if (a.numChars >= 1 << d)
|
|
679
679
|
return 1 / 0;
|
|
680
|
-
|
|
680
|
+
i += 4 + d + a.bitData.length;
|
|
681
681
|
}
|
|
682
|
-
return
|
|
682
|
+
return i;
|
|
683
683
|
}
|
|
684
684
|
// Returns a new array of bytes representing the given string encoded in UTF-8.
|
|
685
|
-
static toUtf8ByteArray(
|
|
686
|
-
|
|
685
|
+
static toUtf8ByteArray(t) {
|
|
686
|
+
t = encodeURI(t);
|
|
687
687
|
let n = [];
|
|
688
|
-
for (let
|
|
689
|
-
|
|
688
|
+
for (let i = 0; i < t.length; i++)
|
|
689
|
+
t.charAt(i) != "%" ? n.push(t.charCodeAt(i)) : (n.push(parseInt(t.substring(i + 1, i + 3), 16)), i += 2);
|
|
690
690
|
return n;
|
|
691
691
|
}
|
|
692
692
|
};
|
|
693
|
-
|
|
694
|
-
let
|
|
695
|
-
|
|
696
|
-
})(
|
|
697
|
-
((
|
|
698
|
-
((
|
|
699
|
-
const
|
|
693
|
+
c.NUMERIC_REGEX = /^[0-9]*$/, c.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, c.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
694
|
+
let m = c;
|
|
695
|
+
e.QrSegment = c;
|
|
696
|
+
})(K || (K = {}));
|
|
697
|
+
((e) => {
|
|
698
|
+
((o) => {
|
|
699
|
+
const r = class {
|
|
700
700
|
// The QR Code can tolerate about 30% erroneous codewords
|
|
701
701
|
/*-- Constructor and fields --*/
|
|
702
|
-
constructor(
|
|
703
|
-
this.ordinal =
|
|
702
|
+
constructor(l, c) {
|
|
703
|
+
this.ordinal = l, this.formatBits = c;
|
|
704
704
|
}
|
|
705
705
|
};
|
|
706
|
-
|
|
707
|
-
})(
|
|
708
|
-
})(
|
|
709
|
-
((
|
|
710
|
-
((
|
|
711
|
-
const
|
|
706
|
+
r.LOW = new r(0, 1), r.MEDIUM = new r(1, 0), r.QUARTILE = new r(2, 3), r.HIGH = new r(3, 2), o.Ecc = r;
|
|
707
|
+
})(e.QrCode || (e.QrCode = {}));
|
|
708
|
+
})(K || (K = {}));
|
|
709
|
+
((e) => {
|
|
710
|
+
((o) => {
|
|
711
|
+
const r = class {
|
|
712
712
|
/*-- Constructor and fields --*/
|
|
713
|
-
constructor(
|
|
714
|
-
this.modeBits =
|
|
713
|
+
constructor(l, c) {
|
|
714
|
+
this.modeBits = l, this.numBitsCharCount = c;
|
|
715
715
|
}
|
|
716
716
|
/*-- Method --*/
|
|
717
717
|
// (Package-private) Returns the bit width of the character count field for a segment in
|
|
718
718
|
// this mode in a QR Code at the given version number. The result is in the range [0, 16].
|
|
719
|
-
numCharCountBits(
|
|
720
|
-
return this.numBitsCharCount[Math.floor((
|
|
719
|
+
numCharCountBits(l) {
|
|
720
|
+
return this.numBitsCharCount[Math.floor((l + 7) / 17)];
|
|
721
721
|
}
|
|
722
722
|
};
|
|
723
|
-
|
|
724
|
-
})(
|
|
725
|
-
})(
|
|
726
|
-
var
|
|
723
|
+
r.NUMERIC = new r(1, [10, 12, 14]), r.ALPHANUMERIC = new r(2, [9, 11, 13]), r.BYTE = new r(4, [8, 16, 16]), r.KANJI = new r(8, [8, 10, 12]), r.ECI = new r(7, [0, 0, 0]), o.Mode = r;
|
|
724
|
+
})(e.QrSegment || (e.QrSegment = {}));
|
|
725
|
+
})(K || (K = {}));
|
|
726
|
+
var J = K;
|
|
727
727
|
/**
|
|
728
728
|
* @license qrcode.react
|
|
729
729
|
* Copyright (c) Paul O'Shannessy
|
|
730
730
|
* SPDX-License-Identifier: ISC
|
|
731
731
|
*/
|
|
732
|
-
var
|
|
733
|
-
L:
|
|
734
|
-
M:
|
|
735
|
-
Q:
|
|
736
|
-
H:
|
|
737
|
-
},
|
|
738
|
-
function
|
|
739
|
-
const
|
|
740
|
-
return
|
|
741
|
-
let
|
|
742
|
-
|
|
743
|
-
if (!
|
|
744
|
-
|
|
745
|
-
`M${
|
|
746
|
-
),
|
|
732
|
+
var Et = {
|
|
733
|
+
L: J.QrCode.Ecc.LOW,
|
|
734
|
+
M: J.QrCode.Ecc.MEDIUM,
|
|
735
|
+
Q: J.QrCode.Ecc.QUARTILE,
|
|
736
|
+
H: J.QrCode.Ecc.HIGH
|
|
737
|
+
}, xe = 128, Pe = "L", De = "#FFFFFF", Te = "#000000", Oe = !1, Se = 1, Ct = 4, wt = 0, Rt = 0.1;
|
|
738
|
+
function Le(e, o = 0) {
|
|
739
|
+
const r = [];
|
|
740
|
+
return e.forEach(function(s, l) {
|
|
741
|
+
let c = null;
|
|
742
|
+
s.forEach(function(m, h) {
|
|
743
|
+
if (!m && c !== null) {
|
|
744
|
+
r.push(
|
|
745
|
+
`M${c + o} ${l + o}h${h - c}v1H${c + o}z`
|
|
746
|
+
), c = null;
|
|
747
747
|
return;
|
|
748
748
|
}
|
|
749
|
-
if (h ===
|
|
750
|
-
if (!
|
|
749
|
+
if (h === s.length - 1) {
|
|
750
|
+
if (!m)
|
|
751
751
|
return;
|
|
752
|
-
|
|
753
|
-
`M${
|
|
752
|
+
c === null ? r.push(`M${h + o},${l + o} h1v1H${h + o}z`) : r.push(
|
|
753
|
+
`M${c + o},${l + o} h${h + 1 - c}v1H${c + o}z`
|
|
754
754
|
);
|
|
755
755
|
return;
|
|
756
756
|
}
|
|
757
|
-
|
|
757
|
+
m && c === null && (c = h);
|
|
758
758
|
});
|
|
759
|
-
}),
|
|
759
|
+
}), r.join("");
|
|
760
760
|
}
|
|
761
|
-
function
|
|
762
|
-
return
|
|
761
|
+
function Be(e, o) {
|
|
762
|
+
return e.slice().map((r, s) => s < o.y || s >= o.y + o.h ? r : r.map((l, c) => c < o.x || c >= o.x + o.w ? l : !1));
|
|
763
763
|
}
|
|
764
|
-
function
|
|
765
|
-
if (
|
|
764
|
+
function Nt(e, o, r, s) {
|
|
765
|
+
if (s == null)
|
|
766
766
|
return null;
|
|
767
|
-
const
|
|
768
|
-
let
|
|
769
|
-
if (
|
|
770
|
-
let
|
|
771
|
-
|
|
767
|
+
const l = e.length + r * 2, c = Math.floor(o * Rt), m = l / o, h = (s.width || c) * m, t = (s.height || c) * m, n = s.x == null ? e.length / 2 - h / 2 : s.x * m, i = s.y == null ? e.length / 2 - t / 2 : s.y * m, a = s.opacity == null ? 1 : s.opacity;
|
|
768
|
+
let d = null;
|
|
769
|
+
if (s.excavate) {
|
|
770
|
+
let u = Math.floor(n), C = Math.floor(i), g = Math.ceil(h + n - u), b = Math.ceil(t + i - C);
|
|
771
|
+
d = { x: u, y: C, w: g, h: b };
|
|
772
772
|
}
|
|
773
|
-
const
|
|
774
|
-
return { x: n, y:
|
|
773
|
+
const p = s.crossOrigin;
|
|
774
|
+
return { x: n, y: i, h: t, w: h, excavation: d, opacity: a, crossOrigin: p };
|
|
775
775
|
}
|
|
776
|
-
function Mt(
|
|
777
|
-
return
|
|
776
|
+
function Mt(e, o) {
|
|
777
|
+
return o != null ? Math.max(Math.floor(o), 0) : e ? Ct : wt;
|
|
778
778
|
}
|
|
779
|
-
function
|
|
780
|
-
value:
|
|
781
|
-
level:
|
|
782
|
-
minVersion:
|
|
783
|
-
includeMargin:
|
|
784
|
-
marginSize:
|
|
785
|
-
imageSettings:
|
|
786
|
-
size:
|
|
779
|
+
function ye({
|
|
780
|
+
value: e,
|
|
781
|
+
level: o,
|
|
782
|
+
minVersion: r,
|
|
783
|
+
includeMargin: s,
|
|
784
|
+
marginSize: l,
|
|
785
|
+
imageSettings: c,
|
|
786
|
+
size: m,
|
|
787
787
|
boostLevel: h
|
|
788
788
|
}) {
|
|
789
|
-
let
|
|
790
|
-
const
|
|
791
|
-
return
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
789
|
+
let t = S.useMemo(() => {
|
|
790
|
+
const u = (Array.isArray(e) ? e : [e]).reduce((C, g) => (C.push(...J.QrSegment.makeSegments(g)), C), []);
|
|
791
|
+
return J.QrCode.encodeSegments(
|
|
792
|
+
u,
|
|
793
|
+
Et[o],
|
|
794
|
+
r,
|
|
795
795
|
void 0,
|
|
796
796
|
void 0,
|
|
797
797
|
h
|
|
798
798
|
);
|
|
799
|
-
}, [
|
|
800
|
-
const { cells: n, margin:
|
|
801
|
-
let
|
|
802
|
-
const
|
|
803
|
-
f,
|
|
799
|
+
}, [e, o, r, h]);
|
|
800
|
+
const { cells: n, margin: i, numCells: a, calculatedImageSettings: d } = S.useMemo(() => {
|
|
801
|
+
let p = t.getModules();
|
|
802
|
+
const u = Mt(s, l), C = p.length + u * 2, g = Nt(
|
|
804
803
|
p,
|
|
805
|
-
|
|
806
|
-
|
|
804
|
+
m,
|
|
805
|
+
u,
|
|
806
|
+
c
|
|
807
807
|
);
|
|
808
808
|
return {
|
|
809
|
-
cells:
|
|
810
|
-
margin:
|
|
809
|
+
cells: p,
|
|
810
|
+
margin: u,
|
|
811
811
|
numCells: C,
|
|
812
|
-
calculatedImageSettings:
|
|
812
|
+
calculatedImageSettings: g
|
|
813
813
|
};
|
|
814
|
-
}, [
|
|
814
|
+
}, [t, m, c, s, l]);
|
|
815
815
|
return {
|
|
816
|
-
qrcode:
|
|
817
|
-
margin:
|
|
816
|
+
qrcode: t,
|
|
817
|
+
margin: i,
|
|
818
818
|
cells: n,
|
|
819
|
-
numCells:
|
|
820
|
-
calculatedImageSettings:
|
|
819
|
+
numCells: a,
|
|
820
|
+
calculatedImageSettings: d
|
|
821
821
|
};
|
|
822
822
|
}
|
|
823
|
-
var
|
|
823
|
+
var bt = (function() {
|
|
824
824
|
try {
|
|
825
825
|
new Path2D().addPath(new Path2D());
|
|
826
826
|
} catch {
|
|
827
827
|
return !1;
|
|
828
828
|
}
|
|
829
829
|
return !0;
|
|
830
|
-
})(),
|
|
831
|
-
function(
|
|
832
|
-
const
|
|
833
|
-
value:
|
|
834
|
-
size:
|
|
835
|
-
level:
|
|
836
|
-
bgColor: h =
|
|
837
|
-
fgColor:
|
|
838
|
-
includeMargin: n =
|
|
839
|
-
minVersion:
|
|
840
|
-
boostLevel:
|
|
841
|
-
marginSize:
|
|
842
|
-
imageSettings:
|
|
843
|
-
} =
|
|
830
|
+
})(), At = S.forwardRef(
|
|
831
|
+
function(o, r) {
|
|
832
|
+
const s = o, {
|
|
833
|
+
value: l,
|
|
834
|
+
size: c = xe,
|
|
835
|
+
level: m = Pe,
|
|
836
|
+
bgColor: h = De,
|
|
837
|
+
fgColor: t = Te,
|
|
838
|
+
includeMargin: n = Oe,
|
|
839
|
+
minVersion: i = Se,
|
|
840
|
+
boostLevel: a,
|
|
841
|
+
marginSize: d,
|
|
842
|
+
imageSettings: p
|
|
843
|
+
} = s, C = pe(s, [
|
|
844
844
|
"value",
|
|
845
845
|
"size",
|
|
846
846
|
"level",
|
|
@@ -851,92 +851,92 @@ var Nt = (function() {
|
|
|
851
851
|
"boostLevel",
|
|
852
852
|
"marginSize",
|
|
853
853
|
"imageSettings"
|
|
854
|
-
]), { style:
|
|
855
|
-
(
|
|
856
|
-
E.current =
|
|
854
|
+
]), { style: g } = C, b = pe(C, ["style"]), w = p == null ? void 0 : p.src, E = S.useRef(null), N = S.useRef(null), I = S.useCallback(
|
|
855
|
+
(F) => {
|
|
856
|
+
E.current = F, typeof r == "function" ? r(F) : r && (r.current = F);
|
|
857
857
|
},
|
|
858
|
-
[
|
|
859
|
-
), [P,
|
|
860
|
-
value:
|
|
861
|
-
level:
|
|
862
|
-
minVersion:
|
|
863
|
-
boostLevel:
|
|
858
|
+
[r]
|
|
859
|
+
), [P, L] = S.useState(!1), { margin: O, cells: z, numCells: $, calculatedImageSettings: T } = ye({
|
|
860
|
+
value: l,
|
|
861
|
+
level: m,
|
|
862
|
+
minVersion: i,
|
|
863
|
+
boostLevel: a,
|
|
864
864
|
includeMargin: n,
|
|
865
|
-
marginSize:
|
|
866
|
-
imageSettings:
|
|
867
|
-
size:
|
|
865
|
+
marginSize: d,
|
|
866
|
+
imageSettings: p,
|
|
867
|
+
size: c
|
|
868
868
|
});
|
|
869
|
-
|
|
869
|
+
S.useEffect(() => {
|
|
870
870
|
if (E.current != null) {
|
|
871
|
-
const
|
|
871
|
+
const F = E.current, M = F.getContext("2d");
|
|
872
872
|
if (!M)
|
|
873
873
|
return;
|
|
874
874
|
let A = z;
|
|
875
|
-
const
|
|
876
|
-
|
|
875
|
+
const B = N.current, X = T != null && B !== null && B.complete && B.naturalHeight !== 0 && B.naturalWidth !== 0;
|
|
876
|
+
X && T.excavation != null && (A = Be(
|
|
877
877
|
z,
|
|
878
|
-
|
|
878
|
+
T.excavation
|
|
879
879
|
));
|
|
880
|
-
const
|
|
881
|
-
|
|
882
|
-
const
|
|
883
|
-
M.scale(
|
|
884
|
-
|
|
885
|
-
|
|
880
|
+
const re = window.devicePixelRatio || 1;
|
|
881
|
+
F.height = F.width = c * re;
|
|
882
|
+
const oe = c / $ * re;
|
|
883
|
+
M.scale(oe, oe), M.fillStyle = h, M.fillRect(0, 0, $, $), M.fillStyle = t, bt ? M.fill(new Path2D(Le(A, O))) : z.forEach(function(W, G) {
|
|
884
|
+
W.forEach(function(v, ue) {
|
|
885
|
+
v && M.fillRect(ue + O, G + O, 1, 1);
|
|
886
886
|
});
|
|
887
|
-
}),
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
887
|
+
}), T && (M.globalAlpha = T.opacity), X && M.drawImage(
|
|
888
|
+
B,
|
|
889
|
+
T.x + O,
|
|
890
|
+
T.y + O,
|
|
891
|
+
T.w,
|
|
892
|
+
T.h
|
|
893
893
|
);
|
|
894
894
|
}
|
|
895
|
-
}),
|
|
896
|
-
|
|
895
|
+
}), S.useEffect(() => {
|
|
896
|
+
L(!1);
|
|
897
897
|
}, [w]);
|
|
898
|
-
const H =
|
|
898
|
+
const H = me({ height: c, width: c }, g);
|
|
899
899
|
let Q = null;
|
|
900
|
-
return w != null && (Q = /* @__PURE__ */
|
|
900
|
+
return w != null && (Q = /* @__PURE__ */ S.createElement(
|
|
901
901
|
"img",
|
|
902
902
|
{
|
|
903
903
|
src: w,
|
|
904
904
|
key: w,
|
|
905
905
|
style: { display: "none" },
|
|
906
906
|
onLoad: () => {
|
|
907
|
-
|
|
907
|
+
L(!0);
|
|
908
908
|
},
|
|
909
909
|
ref: N,
|
|
910
|
-
crossOrigin:
|
|
910
|
+
crossOrigin: T == null ? void 0 : T.crossOrigin
|
|
911
911
|
}
|
|
912
|
-
)), /* @__PURE__ */
|
|
912
|
+
)), /* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement(
|
|
913
913
|
"canvas",
|
|
914
|
-
|
|
914
|
+
me({
|
|
915
915
|
style: H,
|
|
916
|
-
height:
|
|
917
|
-
width:
|
|
918
|
-
ref:
|
|
916
|
+
height: c,
|
|
917
|
+
width: c,
|
|
918
|
+
ref: I,
|
|
919
919
|
role: "img"
|
|
920
|
-
},
|
|
920
|
+
}, b)
|
|
921
921
|
), Q);
|
|
922
922
|
}
|
|
923
923
|
);
|
|
924
|
-
|
|
925
|
-
var
|
|
926
|
-
function(
|
|
927
|
-
const
|
|
928
|
-
value:
|
|
929
|
-
size:
|
|
930
|
-
level:
|
|
931
|
-
bgColor: h =
|
|
932
|
-
fgColor:
|
|
933
|
-
includeMargin: n =
|
|
934
|
-
minVersion:
|
|
935
|
-
boostLevel:
|
|
936
|
-
title:
|
|
937
|
-
marginSize:
|
|
938
|
-
imageSettings:
|
|
939
|
-
} =
|
|
924
|
+
At.displayName = "QRCodeCanvas";
|
|
925
|
+
var Fe = S.forwardRef(
|
|
926
|
+
function(o, r) {
|
|
927
|
+
const s = o, {
|
|
928
|
+
value: l,
|
|
929
|
+
size: c = xe,
|
|
930
|
+
level: m = Pe,
|
|
931
|
+
bgColor: h = De,
|
|
932
|
+
fgColor: t = Te,
|
|
933
|
+
includeMargin: n = Oe,
|
|
934
|
+
minVersion: i = Se,
|
|
935
|
+
boostLevel: a,
|
|
936
|
+
title: d,
|
|
937
|
+
marginSize: p,
|
|
938
|
+
imageSettings: u
|
|
939
|
+
} = s, C = pe(s, [
|
|
940
940
|
"value",
|
|
941
941
|
"size",
|
|
942
942
|
"level",
|
|
@@ -948,45 +948,45 @@ var Be = O.forwardRef(
|
|
|
948
948
|
"title",
|
|
949
949
|
"marginSize",
|
|
950
950
|
"imageSettings"
|
|
951
|
-
]), { margin:
|
|
952
|
-
value:
|
|
953
|
-
level:
|
|
954
|
-
minVersion:
|
|
955
|
-
boostLevel:
|
|
951
|
+
]), { margin: g, cells: b, numCells: w, calculatedImageSettings: E } = ye({
|
|
952
|
+
value: l,
|
|
953
|
+
level: m,
|
|
954
|
+
minVersion: i,
|
|
955
|
+
boostLevel: a,
|
|
956
956
|
includeMargin: n,
|
|
957
|
-
marginSize:
|
|
958
|
-
imageSettings:
|
|
959
|
-
size:
|
|
957
|
+
marginSize: p,
|
|
958
|
+
imageSettings: u,
|
|
959
|
+
size: c
|
|
960
960
|
});
|
|
961
|
-
let N =
|
|
962
|
-
|
|
963
|
-
|
|
961
|
+
let N = b, I = null;
|
|
962
|
+
u != null && E != null && (E.excavation != null && (N = Be(
|
|
963
|
+
b,
|
|
964
964
|
E.excavation
|
|
965
|
-
)),
|
|
965
|
+
)), I = /* @__PURE__ */ S.createElement(
|
|
966
966
|
"image",
|
|
967
967
|
{
|
|
968
|
-
href:
|
|
968
|
+
href: u.src,
|
|
969
969
|
height: E.h,
|
|
970
970
|
width: E.w,
|
|
971
|
-
x: E.x +
|
|
972
|
-
y: E.y +
|
|
971
|
+
x: E.x + g,
|
|
972
|
+
y: E.y + g,
|
|
973
973
|
preserveAspectRatio: "none",
|
|
974
974
|
opacity: E.opacity,
|
|
975
975
|
crossOrigin: E.crossOrigin
|
|
976
976
|
}
|
|
977
977
|
));
|
|
978
|
-
const P =
|
|
979
|
-
return /* @__PURE__ */
|
|
978
|
+
const P = Le(N, g);
|
|
979
|
+
return /* @__PURE__ */ S.createElement(
|
|
980
980
|
"svg",
|
|
981
|
-
|
|
982
|
-
height:
|
|
983
|
-
width:
|
|
981
|
+
me({
|
|
982
|
+
height: c,
|
|
983
|
+
width: c,
|
|
984
984
|
viewBox: `0 0 ${w} ${w}`,
|
|
985
|
-
ref:
|
|
985
|
+
ref: r,
|
|
986
986
|
role: "img"
|
|
987
987
|
}, C),
|
|
988
|
-
!!
|
|
989
|
-
/* @__PURE__ */
|
|
988
|
+
!!d && /* @__PURE__ */ S.createElement("title", null, d),
|
|
989
|
+
/* @__PURE__ */ S.createElement(
|
|
990
990
|
"path",
|
|
991
991
|
{
|
|
992
992
|
fill: h,
|
|
@@ -994,162 +994,162 @@ var Be = O.forwardRef(
|
|
|
994
994
|
shapeRendering: "crispEdges"
|
|
995
995
|
}
|
|
996
996
|
),
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
|
|
997
|
+
/* @__PURE__ */ S.createElement("path", { fill: t, d: P, shapeRendering: "crispEdges" }),
|
|
998
|
+
I
|
|
999
999
|
);
|
|
1000
1000
|
}
|
|
1001
1001
|
);
|
|
1002
|
-
|
|
1003
|
-
const
|
|
1002
|
+
Fe.displayName = "QRCodeSVG";
|
|
1003
|
+
const It = (e, o) => ({
|
|
1004
1004
|
invitationType: qe.LINK,
|
|
1005
1005
|
resources: [
|
|
1006
1006
|
{
|
|
1007
|
-
url: `conversations/${encodeURI(
|
|
1007
|
+
url: `conversations/${encodeURI(e)}`
|
|
1008
1008
|
},
|
|
1009
|
-
...
|
|
1009
|
+
...o
|
|
1010
1010
|
]
|
|
1011
|
-
}),
|
|
1012
|
-
var
|
|
1013
|
-
const
|
|
1014
|
-
return `/${
|
|
1015
|
-
}, Pt = (
|
|
1016
|
-
var
|
|
1017
|
-
const
|
|
1018
|
-
return
|
|
1019
|
-
}), Dt = (
|
|
1020
|
-
var
|
|
1021
|
-
const
|
|
1022
|
-
(
|
|
1023
|
-
var
|
|
1024
|
-
return !!((
|
|
1011
|
+
}), xt = (e) => {
|
|
1012
|
+
var r;
|
|
1013
|
+
const o = ((r = e == null ? void 0 : e.invitationLink) == null ? void 0 : r.split("/").at(-1)) || "";
|
|
1014
|
+
return `/${Ne}/${o}`;
|
|
1015
|
+
}, Pt = (e, o) => o == null ? void 0 : o.find((r) => {
|
|
1016
|
+
var c, m, h, t;
|
|
1017
|
+
const s = (m = (c = e == null ? void 0 : e.id) == null ? void 0 : c.split("/")) == null ? void 0 : m.pop(), l = ((t = (h = r == null ? void 0 : r.url) == null ? void 0 : h.split("/")) == null ? void 0 : t.pop()) || "";
|
|
1018
|
+
return l === s || decodeURI(l) === s;
|
|
1019
|
+
}), Dt = (e) => {
|
|
1020
|
+
var r, s;
|
|
1021
|
+
const o = (r = e == null ? void 0 : e.messages) == null ? void 0 : r.filter(
|
|
1022
|
+
(l) => {
|
|
1023
|
+
var c;
|
|
1024
|
+
return !!((c = l == null ? void 0 : l.custom_content) != null && c.attachments);
|
|
1025
1025
|
}
|
|
1026
1026
|
);
|
|
1027
|
-
return ((
|
|
1028
|
-
var
|
|
1029
|
-
return ((
|
|
1027
|
+
return ((s = o == null ? void 0 : o.flatMap((l) => {
|
|
1028
|
+
var c, m;
|
|
1029
|
+
return ((m = (c = l == null ? void 0 : l.custom_content) == null ? void 0 : c.attachments) == null ? void 0 : m.map((h) => ({
|
|
1030
1030
|
url: (h == null ? void 0 : h.url) || ""
|
|
1031
1031
|
}))) || [];
|
|
1032
|
-
})) == null ? void 0 :
|
|
1032
|
+
})) == null ? void 0 : s.filter((l) => !!(l != null && l.url))) || [];
|
|
1033
1033
|
}, Tt = ({
|
|
1034
|
-
conversation:
|
|
1035
|
-
locale:
|
|
1036
|
-
onCloseModal:
|
|
1037
|
-
modalDividers:
|
|
1038
|
-
getConversation:
|
|
1039
|
-
generateConversationLink:
|
|
1040
|
-
chatExpiration:
|
|
1034
|
+
conversation: e,
|
|
1035
|
+
locale: o,
|
|
1036
|
+
onCloseModal: r,
|
|
1037
|
+
modalDividers: s,
|
|
1038
|
+
getConversation: l,
|
|
1039
|
+
generateConversationLink: c,
|
|
1040
|
+
chatExpiration: m,
|
|
1041
1041
|
chatExpirationDays: h,
|
|
1042
|
-
close:
|
|
1042
|
+
close: t,
|
|
1043
1043
|
chatWarning: n,
|
|
1044
|
-
shareLink:
|
|
1045
|
-
shareCopyLink:
|
|
1046
|
-
shareCopiedLink:
|
|
1047
|
-
shareDescription:
|
|
1048
|
-
shareRemoveAccessToUsers:
|
|
1044
|
+
shareLink: i,
|
|
1045
|
+
shareCopyLink: a,
|
|
1046
|
+
shareCopiedLink: d,
|
|
1047
|
+
shareDescription: p,
|
|
1048
|
+
shareRemoveAccessToUsers: u,
|
|
1049
1049
|
chatName: C,
|
|
1050
|
-
getSharedConversations:
|
|
1051
|
-
revokeSharedConversations:
|
|
1050
|
+
getSharedConversations: g,
|
|
1051
|
+
revokeSharedConversations: b,
|
|
1052
1052
|
baseUrl: w,
|
|
1053
1053
|
id: E,
|
|
1054
1054
|
clientSharedPage: N,
|
|
1055
|
-
clientSharedProp:
|
|
1055
|
+
clientSharedProp: I
|
|
1056
1056
|
}) => {
|
|
1057
|
-
const [P,
|
|
1057
|
+
const [P, L] = y(null), [O, z] = y(), [$, T] = y(!1), [H, Q] = y(!1), [F, M] = y(), A = q(() => {
|
|
1058
1058
|
var G;
|
|
1059
|
-
const
|
|
1060
|
-
if (w && w !== window.location.origin && N &&
|
|
1061
|
-
const
|
|
1062
|
-
return `${
|
|
1059
|
+
const W = w || window.location.origin;
|
|
1060
|
+
if (w && w !== window.location.origin && N && I) {
|
|
1061
|
+
const v = (G = P == null ? void 0 : P.split(`/${Ne}/`)) == null ? void 0 : G[1];
|
|
1062
|
+
return `${W}/${N}?${I}=${v}`;
|
|
1063
1063
|
}
|
|
1064
|
-
return `${
|
|
1065
|
-
}, [w, P,
|
|
1066
|
-
|
|
1064
|
+
return `${W}/${o}${P}`;
|
|
1065
|
+
}, [w, P, o, N, I]);
|
|
1066
|
+
te(() => {
|
|
1067
1067
|
(async () => {
|
|
1068
1068
|
try {
|
|
1069
|
-
const G = decodeURI(
|
|
1069
|
+
const G = decodeURI(e ? e == null ? void 0 : e.id : `${E == null ? void 0 : E[0]}/${o}/${E == null ? void 0 : E[1]}`), v = `${decodeURI(G)}`, ue = await (l == null ? void 0 : l(v)), Ue = It(
|
|
1070
1070
|
G,
|
|
1071
|
-
Dt(
|
|
1072
|
-
), ge = await (
|
|
1073
|
-
le
|
|
1071
|
+
Dt(ue)
|
|
1072
|
+
), ge = await (c == null ? void 0 : c(Ue)), ie = await (g == null ? void 0 : g(
|
|
1073
|
+
ae(le.OTHERS)
|
|
1074
1074
|
));
|
|
1075
|
-
ge &&
|
|
1075
|
+
ge && ie && (T(!0), L(xt(ge)), z(
|
|
1076
1076
|
Pt(
|
|
1077
|
-
|
|
1078
|
-
|
|
1077
|
+
e,
|
|
1078
|
+
ie == null ? void 0 : ie.resources
|
|
1079
1079
|
)
|
|
1080
1080
|
));
|
|
1081
1081
|
} catch (G) {
|
|
1082
|
-
|
|
1082
|
+
T(!1), console.error("Error sharing conversation", G);
|
|
1083
1083
|
}
|
|
1084
1084
|
})();
|
|
1085
1085
|
}, [
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1086
|
+
e,
|
|
1087
|
+
c,
|
|
1088
|
+
l,
|
|
1089
|
+
g,
|
|
1090
1090
|
E,
|
|
1091
|
-
|
|
1091
|
+
o
|
|
1092
1092
|
]);
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
}, [
|
|
1093
|
+
const B = k(() => {
|
|
1094
|
+
r(), L(null), T(!1), Q(!1);
|
|
1095
|
+
}, [r]), X = k(() => {
|
|
1096
1096
|
Q(!0), navigator.clipboard.writeText(A || "");
|
|
1097
|
-
}, [A]),
|
|
1097
|
+
}, [A]), re = async () => {
|
|
1098
1098
|
try {
|
|
1099
|
-
M(!0),
|
|
1100
|
-
} catch (
|
|
1101
|
-
M(!1), console.error("Error revoking shared conversation",
|
|
1099
|
+
M(!0), O && await (b == null ? void 0 : b({ resources: [O] }));
|
|
1100
|
+
} catch (W) {
|
|
1101
|
+
M(!1), console.error("Error revoking shared conversation", W);
|
|
1102
1102
|
}
|
|
1103
|
-
},
|
|
1104
|
-
|
|
1103
|
+
}, oe = k(() => /* @__PURE__ */ f(
|
|
1104
|
+
V,
|
|
1105
1105
|
{
|
|
1106
1106
|
buttonClassName: H ? "text-button-secondary" : "text-button-primary",
|
|
1107
|
-
iconBefore: H ? /* @__PURE__ */
|
|
1108
|
-
title: H ?
|
|
1107
|
+
iconBefore: H ? /* @__PURE__ */ f(Ge, { width: 20, height: 20 }) : /* @__PURE__ */ f(Ve, { width: 20, height: 20 }),
|
|
1108
|
+
title: H ? d ?? "Copied" : a ?? "Copy link",
|
|
1109
1109
|
disabled: H,
|
|
1110
|
-
onClick:
|
|
1110
|
+
onClick: X
|
|
1111
1111
|
}
|
|
1112
|
-
), [H,
|
|
1113
|
-
return /* @__PURE__ */
|
|
1114
|
-
|
|
1112
|
+
), [H, X, d, a]);
|
|
1113
|
+
return /* @__PURE__ */ x(
|
|
1114
|
+
se,
|
|
1115
1115
|
{
|
|
1116
|
-
heading:
|
|
1116
|
+
heading: i ?? "Share link",
|
|
1117
1117
|
portalId: "share",
|
|
1118
|
-
size:
|
|
1119
|
-
dividers:
|
|
1120
|
-
onClose:
|
|
1121
|
-
closeButtonTitle:
|
|
1118
|
+
size: de.SM,
|
|
1119
|
+
dividers: s,
|
|
1120
|
+
onClose: B,
|
|
1121
|
+
closeButtonTitle: t ?? "Close",
|
|
1122
1122
|
children: [
|
|
1123
|
-
$ ? /* @__PURE__ */
|
|
1124
|
-
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
1123
|
+
$ ? /* @__PURE__ */ x("div", { className: "share flex flex-col gap-y-4 px-6 pb-6 overflow-auto sm:p-0", children: [
|
|
1124
|
+
e != null && e.name ? /* @__PURE__ */ x("div", { className: "flex share-info w-full", children: [
|
|
1125
|
+
/* @__PURE__ */ f("p", { className: "share-info-title text-neutrals-800 mr-1 body-1", children: C ?? "Chat name:" }),
|
|
1126
|
+
/* @__PURE__ */ f(
|
|
1127
1127
|
"h3",
|
|
1128
1128
|
{
|
|
1129
1129
|
className: "flex-1 min-w-0 truncate",
|
|
1130
|
-
title:
|
|
1131
|
-
children:
|
|
1130
|
+
title: e == null ? void 0 : e.name,
|
|
1131
|
+
children: e == null ? void 0 : e.name
|
|
1132
1132
|
}
|
|
1133
1133
|
)
|
|
1134
1134
|
] }) : null,
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ x("div", { className: "flex share-info", children: [
|
|
1136
|
+
/* @__PURE__ */ f("p", { className: "share-info-title text-neutrals-800 mr-1 body-1", children: m ?? "Link expiration date:" }),
|
|
1137
|
+
/* @__PURE__ */ x("h3", { children: [
|
|
1138
1138
|
"3 ",
|
|
1139
1139
|
h ?? "days"
|
|
1140
1140
|
] })
|
|
1141
1141
|
] }),
|
|
1142
|
-
/* @__PURE__ */
|
|
1143
|
-
|
|
1142
|
+
/* @__PURE__ */ f(
|
|
1143
|
+
Fe,
|
|
1144
1144
|
{
|
|
1145
1145
|
className: "self-center border border-neutrals-600 p-2 rounded min-h-[200px]",
|
|
1146
1146
|
value: A,
|
|
1147
1147
|
size: 200
|
|
1148
1148
|
}
|
|
1149
1149
|
),
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
|
|
1150
|
+
/* @__PURE__ */ f("p", { className: "body-2 text-neutrals-1000", children: p ?? "Your name, special instructions, and any messages you add after sharing remain confidential." }),
|
|
1151
|
+
/* @__PURE__ */ f(
|
|
1152
|
+
we,
|
|
1153
1153
|
{
|
|
1154
1154
|
containerClasses: "share-input-container",
|
|
1155
1155
|
cssClass: "share-input",
|
|
@@ -1157,54 +1157,54 @@ const Se = "share", At = "onboarding", bt = (t, r) => ({
|
|
|
1157
1157
|
placeholder: A,
|
|
1158
1158
|
value: A,
|
|
1159
1159
|
inputId: "conversationLink",
|
|
1160
|
-
iconAfterInput:
|
|
1160
|
+
iconAfterInput: oe()
|
|
1161
1161
|
}
|
|
1162
1162
|
)
|
|
1163
|
-
] }) : /* @__PURE__ */
|
|
1164
|
-
$ ?
|
|
1165
|
-
|
|
1163
|
+
] }) : /* @__PURE__ */ f("div", { className: "flex justify-center items-center py-6 px-6", children: /* @__PURE__ */ f(Ce, {}) }),
|
|
1164
|
+
$ ? e && O ? /* @__PURE__ */ f("div", { className: "remove-access", children: /* @__PURE__ */ f(
|
|
1165
|
+
V,
|
|
1166
1166
|
{
|
|
1167
|
-
title:
|
|
1167
|
+
title: u ?? "Remove access to all users",
|
|
1168
1168
|
buttonClassName: "remove-access-button py-3 px-4",
|
|
1169
1169
|
isSmallButton: !0,
|
|
1170
|
-
disabled:
|
|
1171
|
-
onClick:
|
|
1170
|
+
disabled: F,
|
|
1171
|
+
onClick: re
|
|
1172
1172
|
}
|
|
1173
|
-
) }) : /* @__PURE__ */
|
|
1173
|
+
) }) : /* @__PURE__ */ f("p", { className: "body-2 text-neutrals-800 share-footer", children: n ?? "This chat has not been shared with anyone yet." }) : /* @__PURE__ */ f("div", {})
|
|
1174
1174
|
]
|
|
1175
1175
|
}
|
|
1176
1176
|
);
|
|
1177
1177
|
}, Ot = ({
|
|
1178
|
-
conversation:
|
|
1179
|
-
onCloseModal:
|
|
1180
|
-
renameConversation:
|
|
1181
|
-
locale:
|
|
1182
|
-
disableModalDividers:
|
|
1183
|
-
titles:
|
|
1184
|
-
isSmallButton:
|
|
1178
|
+
conversation: e,
|
|
1179
|
+
onCloseModal: o,
|
|
1180
|
+
renameConversation: r,
|
|
1181
|
+
locale: s,
|
|
1182
|
+
disableModalDividers: l,
|
|
1183
|
+
titles: c,
|
|
1184
|
+
isSmallButton: m
|
|
1185
1185
|
}) => {
|
|
1186
|
-
const [h,
|
|
1187
|
-
|
|
1188
|
-
},
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
`conversations/${
|
|
1192
|
-
`conversations/${
|
|
1186
|
+
const [h, t] = y((e == null ? void 0 : e.name) || ""), n = (a) => {
|
|
1187
|
+
t(a);
|
|
1188
|
+
}, i = () => {
|
|
1189
|
+
const a = `${e == null ? void 0 : e.folderId}/${encodeURIComponent(fe(h))}-${(/* @__PURE__ */ new Date()).getTime()}`;
|
|
1190
|
+
r(
|
|
1191
|
+
`conversations/${e.id}`,
|
|
1192
|
+
`conversations/${a}`
|
|
1193
1193
|
);
|
|
1194
1194
|
};
|
|
1195
|
-
return /* @__PURE__ */
|
|
1196
|
-
|
|
1195
|
+
return /* @__PURE__ */ x(
|
|
1196
|
+
se,
|
|
1197
1197
|
{
|
|
1198
|
-
heading: (
|
|
1198
|
+
heading: (c == null ? void 0 : c.renameTitle) ?? "Rename conversation",
|
|
1199
1199
|
portalId: "rename-conversation",
|
|
1200
1200
|
containerClassName: "rename-conversation-popup",
|
|
1201
|
-
size:
|
|
1202
|
-
dividers: !
|
|
1203
|
-
onClose:
|
|
1204
|
-
closeButtonTitle: (
|
|
1201
|
+
size: de.SM,
|
|
1202
|
+
dividers: !l,
|
|
1203
|
+
onClose: o,
|
|
1204
|
+
closeButtonTitle: (c == null ? void 0 : c.close) ?? "Cancel",
|
|
1205
1205
|
children: [
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
|
|
1206
|
+
/* @__PURE__ */ f("div", { className: "py-4 px-6 sm:px-0", lang: s, children: /* @__PURE__ */ f(
|
|
1207
|
+
Ye,
|
|
1208
1208
|
{
|
|
1209
1209
|
inputId: "rename",
|
|
1210
1210
|
value: h,
|
|
@@ -1212,27 +1212,27 @@ const Se = "share", At = "onboarding", bt = (t, r) => ({
|
|
|
1212
1212
|
cssClass: "w-full"
|
|
1213
1213
|
}
|
|
1214
1214
|
) }),
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
|
|
1215
|
+
/* @__PURE__ */ x("div", { className: "flex justify-end gap-x-2 py-3 px-6 delete-conversation-popup-footer", children: [
|
|
1216
|
+
/* @__PURE__ */ f(
|
|
1217
|
+
V,
|
|
1218
1218
|
{
|
|
1219
1219
|
buttonClassName: "cancel-button",
|
|
1220
|
-
title: (
|
|
1221
|
-
isSmallButton:
|
|
1222
|
-
onClick: (
|
|
1223
|
-
|
|
1220
|
+
title: (c == null ? void 0 : c.cancel) ?? "Cancel",
|
|
1221
|
+
isSmallButton: m,
|
|
1222
|
+
onClick: (a) => {
|
|
1223
|
+
a.stopPropagation(), o();
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
1226
|
),
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
|
|
1227
|
+
/* @__PURE__ */ f(
|
|
1228
|
+
V,
|
|
1229
1229
|
{
|
|
1230
1230
|
buttonClassName: "text-button-primary text-button-primary",
|
|
1231
|
-
title: (
|
|
1232
|
-
isSmallButton:
|
|
1231
|
+
title: (c == null ? void 0 : c.save) ?? "Rename",
|
|
1232
|
+
isSmallButton: m,
|
|
1233
1233
|
disabled: !h,
|
|
1234
|
-
onClick: (
|
|
1235
|
-
|
|
1234
|
+
onClick: (a) => {
|
|
1235
|
+
a.stopPropagation(), i();
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
1238
|
)
|
|
@@ -1240,78 +1240,78 @@ const Se = "share", At = "onboarding", bt = (t, r) => ({
|
|
|
1240
1240
|
]
|
|
1241
1241
|
}
|
|
1242
1242
|
);
|
|
1243
|
-
},
|
|
1244
|
-
conversation:
|
|
1245
|
-
conversationStyles:
|
|
1246
|
-
shareConversationProps:
|
|
1247
|
-
onConversationDelete:
|
|
1248
|
-
getConversation:
|
|
1249
|
-
getFileBlob:
|
|
1250
|
-
renameConversation:
|
|
1243
|
+
}, St = ({
|
|
1244
|
+
conversation: e,
|
|
1245
|
+
conversationStyles: o,
|
|
1246
|
+
shareConversationProps: r,
|
|
1247
|
+
onConversationDelete: s,
|
|
1248
|
+
getConversation: l,
|
|
1249
|
+
getFileBlob: c,
|
|
1250
|
+
renameConversation: m,
|
|
1251
1251
|
triggerButton: h,
|
|
1252
|
-
locale:
|
|
1252
|
+
locale: t
|
|
1253
1253
|
}) => {
|
|
1254
1254
|
var P;
|
|
1255
|
-
const n =
|
|
1256
|
-
var
|
|
1257
|
-
const
|
|
1255
|
+
const n = q(() => {
|
|
1256
|
+
var O, z, $, T, H, Q, F, M, A, B;
|
|
1257
|
+
const L = [
|
|
1258
1258
|
{
|
|
1259
|
-
key:
|
|
1260
|
-
title: ((
|
|
1261
|
-
icon: (z =
|
|
1259
|
+
key: _.DELETE,
|
|
1260
|
+
title: ((O = o == null ? void 0 : o.titles) == null ? void 0 : O.delete) ?? "Delete",
|
|
1261
|
+
icon: (z = o.actionsIcons) == null ? void 0 : z[_.DELETE]
|
|
1262
1262
|
}
|
|
1263
1263
|
];
|
|
1264
|
-
return (
|
|
1265
|
-
...
|
|
1264
|
+
return (T = ($ = e == null ? void 0 : e.model) == null ? void 0 : $.id) != null && T.endsWith(ve) ? L : [
|
|
1265
|
+
...e.isShared ? [] : [
|
|
1266
1266
|
{
|
|
1267
|
-
key:
|
|
1268
|
-
title: ((H =
|
|
1269
|
-
icon: (Q =
|
|
1267
|
+
key: _.SHARE,
|
|
1268
|
+
title: ((H = o == null ? void 0 : o.titles) == null ? void 0 : H.share) ?? "Share",
|
|
1269
|
+
icon: (Q = o.actionsIcons) == null ? void 0 : Q[_.SHARE]
|
|
1270
1270
|
},
|
|
1271
1271
|
{
|
|
1272
|
-
key:
|
|
1273
|
-
title: ((
|
|
1274
|
-
icon: (M =
|
|
1272
|
+
key: _.RENAME,
|
|
1273
|
+
title: ((F = o == null ? void 0 : o.titles) == null ? void 0 : F.rename) ?? "Rename",
|
|
1274
|
+
icon: (M = o.actionsIcons) == null ? void 0 : M[_.RENAME]
|
|
1275
1275
|
}
|
|
1276
1276
|
],
|
|
1277
1277
|
{
|
|
1278
|
-
key:
|
|
1279
|
-
title: ((A =
|
|
1280
|
-
icon: (
|
|
1278
|
+
key: _.EXPORT,
|
|
1279
|
+
title: ((A = o == null ? void 0 : o.titles) == null ? void 0 : A.export) ?? "Export",
|
|
1280
|
+
icon: (B = o.actionsIcons) == null ? void 0 : B[_.EXPORT]
|
|
1281
1281
|
},
|
|
1282
|
-
...
|
|
1282
|
+
...L
|
|
1283
1283
|
];
|
|
1284
1284
|
}, [
|
|
1285
|
-
|
|
1286
|
-
(P =
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
]), [
|
|
1290
|
-
|
|
1291
|
-
}, [
|
|
1292
|
-
|
|
1293
|
-
}, [
|
|
1285
|
+
e.isShared,
|
|
1286
|
+
(P = e == null ? void 0 : e.model) == null ? void 0 : P.id,
|
|
1287
|
+
o.titles,
|
|
1288
|
+
o.actionsIcons
|
|
1289
|
+
]), [i, a] = y(Y.Closed), [d, p] = y(Y.Closed), [u, C] = y(Y.Closed), g = k(() => {
|
|
1290
|
+
a(Y.Closed);
|
|
1291
|
+
}, [a]), b = k(() => {
|
|
1292
|
+
p(Y.Closed);
|
|
1293
|
+
}, [p]), w = k(() => {
|
|
1294
1294
|
C(Y.Closed);
|
|
1295
|
-
}, [C]), E =
|
|
1296
|
-
|
|
1297
|
-
}, [
|
|
1298
|
-
(
|
|
1299
|
-
|
|
1295
|
+
}, [C]), E = k(() => {
|
|
1296
|
+
s(e), g();
|
|
1297
|
+
}, [e, s, g]), N = k(
|
|
1298
|
+
(L, O) => {
|
|
1299
|
+
m(L, O), w();
|
|
1300
1300
|
},
|
|
1301
|
-
[
|
|
1301
|
+
[m, w]
|
|
1302
1302
|
);
|
|
1303
|
-
return /* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1305
|
-
|
|
1303
|
+
return /* @__PURE__ */ x(ee, { children: [
|
|
1304
|
+
/* @__PURE__ */ f(
|
|
1305
|
+
Re,
|
|
1306
1306
|
{
|
|
1307
|
-
containerClassName: "
|
|
1308
|
-
triggerButton: h ?? /* @__PURE__ */
|
|
1307
|
+
containerClassName: "ml-3 group-hover:visible",
|
|
1308
|
+
triggerButton: h ?? /* @__PURE__ */ f(Lt, {}),
|
|
1309
1309
|
options: n,
|
|
1310
1310
|
openedClassName: "action-menu-opened",
|
|
1311
|
-
onOptionSelect: (
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1311
|
+
onOptionSelect: (L) => {
|
|
1312
|
+
L === _.DELETE && a(Y.Opened), L === _.SHARE && p(Y.Opened), L === _.RENAME && C(Y.Opened), L === _.EXPORT && l(decodeURI(e.id)).then((O) => {
|
|
1313
|
+
ht(O, c).then((z) => {
|
|
1314
|
+
ft(
|
|
1315
1315
|
`data:application/zip;base64,${z}`,
|
|
1316
1316
|
`chat_with_attachments_${(/* @__PURE__ */ new Date()).toLocaleDateString()}.dial`
|
|
1317
1317
|
);
|
|
@@ -1320,40 +1320,40 @@ const Se = "share", At = "onboarding", bt = (t, r) => ({
|
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
),
|
|
1323
|
-
|
|
1324
|
-
|
|
1323
|
+
i === Y.Opened && /* @__PURE__ */ f(
|
|
1324
|
+
at,
|
|
1325
1325
|
{
|
|
1326
|
-
titles:
|
|
1327
|
-
locale:
|
|
1328
|
-
disableModalDividers:
|
|
1329
|
-
isSmallButton:
|
|
1326
|
+
titles: o.titles,
|
|
1327
|
+
locale: t,
|
|
1328
|
+
disableModalDividers: o.disableModalDividers,
|
|
1329
|
+
isSmallButton: o.isSmallModalButton,
|
|
1330
1330
|
deleteConversation: E,
|
|
1331
|
-
onCloseModal:
|
|
1331
|
+
onCloseModal: g
|
|
1332
1332
|
}
|
|
1333
1333
|
),
|
|
1334
|
-
|
|
1334
|
+
d === Y.Opened && /* @__PURE__ */ f(
|
|
1335
1335
|
Tt,
|
|
1336
1336
|
{
|
|
1337
|
-
conversation:
|
|
1338
|
-
locale:
|
|
1339
|
-
onCloseModal:
|
|
1340
|
-
...
|
|
1337
|
+
conversation: e,
|
|
1338
|
+
locale: t,
|
|
1339
|
+
onCloseModal: b,
|
|
1340
|
+
...r
|
|
1341
1341
|
}
|
|
1342
1342
|
),
|
|
1343
|
-
|
|
1343
|
+
u === Y.Opened && /* @__PURE__ */ f(
|
|
1344
1344
|
Ot,
|
|
1345
1345
|
{
|
|
1346
|
-
conversation:
|
|
1347
|
-
locale:
|
|
1348
|
-
titles:
|
|
1346
|
+
conversation: e,
|
|
1347
|
+
locale: t,
|
|
1348
|
+
titles: o.titles,
|
|
1349
1349
|
renameConversation: N,
|
|
1350
1350
|
onCloseModal: w,
|
|
1351
|
-
disableModalDividers:
|
|
1352
|
-
isSmallButton:
|
|
1351
|
+
disableModalDividers: o.disableModalDividers,
|
|
1352
|
+
isSmallButton: o.isSmallModalButton
|
|
1353
1353
|
}
|
|
1354
1354
|
)
|
|
1355
1355
|
] });
|
|
1356
|
-
}, Lt = () => /* @__PURE__ */
|
|
1356
|
+
}, Lt = () => /* @__PURE__ */ f("div", { className: "cursor-pointer flex items-center justify-center w-[24px]", children: /* @__PURE__ */ f(
|
|
1357
1357
|
Xe,
|
|
1358
1358
|
{
|
|
1359
1359
|
width: 20,
|
|
@@ -1361,72 +1361,72 @@ const Se = "share", At = "onboarding", bt = (t, r) => ({
|
|
|
1361
1361
|
stroke: 2,
|
|
1362
1362
|
className: "text-primary"
|
|
1363
1363
|
}
|
|
1364
|
-
) }),
|
|
1365
|
-
conversation:
|
|
1366
|
-
selectedConversationId:
|
|
1367
|
-
searchQuery:
|
|
1368
|
-
onConversationClick:
|
|
1369
|
-
actions:
|
|
1370
|
-
locale:
|
|
1371
|
-
conversationStyles:
|
|
1364
|
+
) }), ke = ({
|
|
1365
|
+
conversation: e,
|
|
1366
|
+
selectedConversationId: o,
|
|
1367
|
+
searchQuery: r,
|
|
1368
|
+
onConversationClick: s,
|
|
1369
|
+
actions: l,
|
|
1370
|
+
locale: c,
|
|
1371
|
+
conversationStyles: m,
|
|
1372
1372
|
shareConversationProps: h
|
|
1373
1373
|
}) => {
|
|
1374
|
-
const
|
|
1375
|
-
return
|
|
1376
|
-
var
|
|
1377
|
-
if ((
|
|
1378
|
-
const
|
|
1379
|
-
if (
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1374
|
+
const t = ze(null), n = fe(e == null ? void 0 : e.name);
|
|
1375
|
+
return te(() => {
|
|
1376
|
+
var i, a;
|
|
1377
|
+
if ((e == null ? void 0 : e.id) === o && t != null && t.current) {
|
|
1378
|
+
const d = (a = (i = t.current.parentElement) == null ? void 0 : i.parentElement) == null ? void 0 : a.parentElement;
|
|
1379
|
+
if (d) {
|
|
1380
|
+
const p = t.current.getBoundingClientRect(), u = d.getBoundingClientRect(), C = p.height, g = u.height, w = p.top - u.top + d.scrollTop - (g / 2 - C / 2);
|
|
1381
|
+
d.scrollTo({
|
|
1382
1382
|
top: w,
|
|
1383
1383
|
behavior: "smooth"
|
|
1384
1384
|
});
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
|
-
}, [
|
|
1387
|
+
}, [e, o]), /* @__PURE__ */ x(
|
|
1388
1388
|
"div",
|
|
1389
1389
|
{
|
|
1390
|
-
ref:
|
|
1391
|
-
className:
|
|
1390
|
+
ref: t,
|
|
1391
|
+
className: j(
|
|
1392
1392
|
"flex justify-between items-center py-2 px-3 border-transparent relative group cursor-pointer border hover:border-hues-600",
|
|
1393
1393
|
"conversation-item",
|
|
1394
|
-
|
|
1394
|
+
o === (e == null ? void 0 : e.id) && "bg-hues-100 conversation-item-active"
|
|
1395
1395
|
),
|
|
1396
|
-
onClick: () =>
|
|
1396
|
+
onClick: () => s(e.folderId, e == null ? void 0 : e.id),
|
|
1397
1397
|
title: n,
|
|
1398
1398
|
children: [
|
|
1399
|
-
/* @__PURE__ */
|
|
1400
|
-
|
|
1401
|
-
/* @__PURE__ */
|
|
1399
|
+
/* @__PURE__ */ x("div", { className: "flex flex-1 min-w-0 items-center", children: [
|
|
1400
|
+
m.conversationItemIcon ? m.conversationItemIcon : null,
|
|
1401
|
+
/* @__PURE__ */ f(
|
|
1402
1402
|
"h3",
|
|
1403
1403
|
{
|
|
1404
|
-
className:
|
|
1404
|
+
className: j(
|
|
1405
1405
|
"truncate font-semibold text-neutrals-1000 sm:body-2",
|
|
1406
1406
|
"conversation-item-text",
|
|
1407
|
-
|
|
1407
|
+
o === (e == null ? void 0 : e.id) ? "conversation-item-text-active" : ""
|
|
1408
1408
|
),
|
|
1409
1409
|
title: n,
|
|
1410
|
-
children:
|
|
1411
|
-
|
|
1410
|
+
children: r != null && r.length ? /* @__PURE__ */ f(
|
|
1411
|
+
je,
|
|
1412
1412
|
{
|
|
1413
1413
|
text: n,
|
|
1414
|
-
highlightText:
|
|
1414
|
+
highlightText: r
|
|
1415
1415
|
}
|
|
1416
1416
|
) : n
|
|
1417
1417
|
}
|
|
1418
1418
|
)
|
|
1419
1419
|
] }),
|
|
1420
|
-
/* @__PURE__ */
|
|
1421
|
-
|
|
1420
|
+
/* @__PURE__ */ f(
|
|
1421
|
+
St,
|
|
1422
1422
|
{
|
|
1423
|
-
locale:
|
|
1424
|
-
conversationStyles:
|
|
1425
|
-
conversation:
|
|
1426
|
-
onConversationDelete:
|
|
1427
|
-
getConversation:
|
|
1428
|
-
getFileBlob:
|
|
1429
|
-
renameConversation:
|
|
1423
|
+
locale: c,
|
|
1424
|
+
conversationStyles: m,
|
|
1425
|
+
conversation: e,
|
|
1426
|
+
onConversationDelete: l.deleteConversation,
|
|
1427
|
+
getConversation: l.getConversation,
|
|
1428
|
+
getFileBlob: l.getFileBlob,
|
|
1429
|
+
renameConversation: l.renameConversation,
|
|
1430
1430
|
shareConversationProps: h
|
|
1431
1431
|
}
|
|
1432
1432
|
)
|
|
@@ -1434,266 +1434,266 @@ const Se = "share", At = "onboarding", bt = (t, r) => ({
|
|
|
1434
1434
|
}
|
|
1435
1435
|
);
|
|
1436
1436
|
}, Bt = ({
|
|
1437
|
-
handleConversationClick:
|
|
1438
|
-
actions:
|
|
1439
|
-
selectedConversationId:
|
|
1440
|
-
groupLabel:
|
|
1441
|
-
conversationStyles:
|
|
1442
|
-
groupedConversations:
|
|
1443
|
-
shareConversationProps:
|
|
1437
|
+
handleConversationClick: e,
|
|
1438
|
+
actions: o,
|
|
1439
|
+
selectedConversationId: r,
|
|
1440
|
+
groupLabel: s,
|
|
1441
|
+
conversationStyles: l,
|
|
1442
|
+
groupedConversations: c,
|
|
1443
|
+
shareConversationProps: m,
|
|
1444
1444
|
locale: h
|
|
1445
1445
|
}) => {
|
|
1446
|
-
const [
|
|
1447
|
-
n((
|
|
1446
|
+
const [t, n] = y(!1), i = k(() => {
|
|
1447
|
+
n((a) => !a);
|
|
1448
1448
|
}, [n]);
|
|
1449
|
-
return /* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1449
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
1450
|
+
/* @__PURE__ */ x(
|
|
1451
1451
|
"div",
|
|
1452
1452
|
{
|
|
1453
1453
|
className: "inline-flex gap-1 items-center text-neutrals-700 mb-3 cursor-pointer conversation-group-items-title",
|
|
1454
|
-
onClick:
|
|
1454
|
+
onClick: i,
|
|
1455
1455
|
children: [
|
|
1456
|
-
/* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ f(
|
|
1457
1457
|
We,
|
|
1458
1458
|
{
|
|
1459
|
-
className:
|
|
1459
|
+
className: j(
|
|
1460
1460
|
"w-3 h-3 conversation-group-items-arrow",
|
|
1461
|
-
|
|
1461
|
+
t ? "rotate-[90deg]" : "rotate-0"
|
|
1462
1462
|
)
|
|
1463
1463
|
}
|
|
1464
1464
|
),
|
|
1465
|
-
/* @__PURE__ */
|
|
1465
|
+
/* @__PURE__ */ f("span", { className: "body-3 conversation-group-items-title-text", children: it(s, l == null ? void 0 : l.titles) })
|
|
1466
1466
|
]
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
|
-
!
|
|
1469
|
+
!t && /* @__PURE__ */ f(
|
|
1470
1470
|
"div",
|
|
1471
1471
|
{
|
|
1472
|
-
className:
|
|
1472
|
+
className: j(
|
|
1473
1473
|
"flex flex-col gap-y-3",
|
|
1474
1474
|
"conversation-group-items"
|
|
1475
1475
|
),
|
|
1476
|
-
children:
|
|
1477
|
-
(
|
|
1478
|
-
|
|
1476
|
+
children: be(c).map(
|
|
1477
|
+
(a) => /* @__PURE__ */ f(
|
|
1478
|
+
ke,
|
|
1479
1479
|
{
|
|
1480
1480
|
locale: h,
|
|
1481
|
-
conversationStyles:
|
|
1482
|
-
conversation:
|
|
1483
|
-
selectedConversationId:
|
|
1484
|
-
onConversationClick:
|
|
1485
|
-
actions:
|
|
1486
|
-
shareConversationProps:
|
|
1481
|
+
conversationStyles: l,
|
|
1482
|
+
conversation: a,
|
|
1483
|
+
selectedConversationId: r,
|
|
1484
|
+
onConversationClick: e,
|
|
1485
|
+
actions: o,
|
|
1486
|
+
shareConversationProps: m
|
|
1487
1487
|
},
|
|
1488
|
-
|
|
1488
|
+
a.id || a.name
|
|
1489
1489
|
)
|
|
1490
1490
|
)
|
|
1491
1491
|
}
|
|
1492
1492
|
)
|
|
1493
|
-
] },
|
|
1494
|
-
},
|
|
1495
|
-
searchQuery:
|
|
1496
|
-
isExpandedSearch:
|
|
1497
|
-
titles:
|
|
1498
|
-
searchIcon:
|
|
1499
|
-
onSearchConversations:
|
|
1500
|
-
toggleSearchField:
|
|
1501
|
-
}) => /* @__PURE__ */
|
|
1502
|
-
|
|
1493
|
+
] }, s);
|
|
1494
|
+
}, yt = ({
|
|
1495
|
+
searchQuery: e,
|
|
1496
|
+
isExpandedSearch: o,
|
|
1497
|
+
titles: r,
|
|
1498
|
+
searchIcon: s,
|
|
1499
|
+
onSearchConversations: l,
|
|
1500
|
+
toggleSearchField: c
|
|
1501
|
+
}) => /* @__PURE__ */ f(ee, { children: o ? /* @__PURE__ */ f(
|
|
1502
|
+
we,
|
|
1503
1503
|
{
|
|
1504
1504
|
inputId: "conversations-search",
|
|
1505
|
-
placeholder: (
|
|
1505
|
+
placeholder: (r == null ? void 0 : r.searchPlaceholder) ?? "Search",
|
|
1506
1506
|
containerClasses: "conversation-list-search-input h-[40px] bg-transparent px-4 py-2 rounded-full border-neutrals-400 shadow-none",
|
|
1507
1507
|
cssClass: "h-auto",
|
|
1508
|
-
value:
|
|
1509
|
-
iconAfterInput: /* @__PURE__ */
|
|
1510
|
-
|
|
1508
|
+
value: e,
|
|
1509
|
+
iconAfterInput: /* @__PURE__ */ f(
|
|
1510
|
+
Qe,
|
|
1511
1511
|
{
|
|
1512
1512
|
buttonClassName: "text-button-tertiary items-center p-0 ml-4 border-0 w-5 h-5",
|
|
1513
|
-
onClick:
|
|
1514
|
-
icon: /* @__PURE__ */
|
|
1513
|
+
onClick: c,
|
|
1514
|
+
icon: /* @__PURE__ */ f(Ke, {})
|
|
1515
1515
|
}
|
|
1516
1516
|
),
|
|
1517
|
-
onChange:
|
|
1517
|
+
onChange: l
|
|
1518
1518
|
}
|
|
1519
|
-
) : /* @__PURE__ */
|
|
1520
|
-
|
|
1519
|
+
) : /* @__PURE__ */ f(
|
|
1520
|
+
V,
|
|
1521
1521
|
{
|
|
1522
1522
|
buttonClassName: "text-button-tertiary p-0 search-button",
|
|
1523
|
-
iconBefore:
|
|
1524
|
-
onClick:
|
|
1523
|
+
iconBefore: s || /* @__PURE__ */ f(Ze, { className: "w-5 h-5" }),
|
|
1524
|
+
onClick: c
|
|
1525
1525
|
}
|
|
1526
1526
|
) }), Ft = ({
|
|
1527
|
-
conversations:
|
|
1528
|
-
selectedConversationId:
|
|
1529
|
-
searchQuery:
|
|
1530
|
-
conversationStyles:
|
|
1531
|
-
handleConversationClick:
|
|
1532
|
-
actions:
|
|
1533
|
-
locale:
|
|
1527
|
+
conversations: e,
|
|
1528
|
+
selectedConversationId: o,
|
|
1529
|
+
searchQuery: r,
|
|
1530
|
+
conversationStyles: s,
|
|
1531
|
+
handleConversationClick: l,
|
|
1532
|
+
actions: c,
|
|
1533
|
+
locale: m,
|
|
1534
1534
|
shareConversationProps: h
|
|
1535
1535
|
}) => {
|
|
1536
|
-
var
|
|
1537
|
-
const [
|
|
1538
|
-
return
|
|
1536
|
+
var i;
|
|
1537
|
+
const [t, n] = y([]);
|
|
1538
|
+
return te(() => {
|
|
1539
1539
|
n(
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
(
|
|
1543
|
-
var
|
|
1544
|
-
return (
|
|
1545
|
-
|
|
1540
|
+
be(
|
|
1541
|
+
e == null ? void 0 : e.filter(
|
|
1542
|
+
(a) => {
|
|
1543
|
+
var d;
|
|
1544
|
+
return (d = fe(a == null ? void 0 : a.name)) == null ? void 0 : d.includes(
|
|
1545
|
+
r || ""
|
|
1546
1546
|
);
|
|
1547
1547
|
}
|
|
1548
1548
|
)
|
|
1549
1549
|
)
|
|
1550
1550
|
);
|
|
1551
|
-
}, [
|
|
1552
|
-
|
|
1551
|
+
}, [e, r]), /* @__PURE__ */ f(ee, { children: t != null && t.length ? t.map((a) => /* @__PURE__ */ f(
|
|
1552
|
+
ke,
|
|
1553
1553
|
{
|
|
1554
|
-
locale:
|
|
1555
|
-
conversationStyles:
|
|
1556
|
-
conversation:
|
|
1557
|
-
searchQuery:
|
|
1558
|
-
selectedConversationId:
|
|
1559
|
-
onConversationClick:
|
|
1560
|
-
actions:
|
|
1554
|
+
locale: m,
|
|
1555
|
+
conversationStyles: s,
|
|
1556
|
+
conversation: a,
|
|
1557
|
+
searchQuery: r,
|
|
1558
|
+
selectedConversationId: o,
|
|
1559
|
+
onConversationClick: l,
|
|
1560
|
+
actions: c,
|
|
1561
1561
|
shareConversationProps: h
|
|
1562
1562
|
},
|
|
1563
|
-
|
|
1564
|
-
)) : /* @__PURE__ */
|
|
1565
|
-
},
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
] }),
|
|
1569
|
-
handleConversationClick:
|
|
1570
|
-
selectedConversationId:
|
|
1571
|
-
actions:
|
|
1572
|
-
children:
|
|
1573
|
-
isCollapsed:
|
|
1574
|
-
conversationStyles:
|
|
1575
|
-
conversations:
|
|
1563
|
+
a.id
|
|
1564
|
+
)) : /* @__PURE__ */ f("h3", { className: "text-neutrals-800", children: ((i = s == null ? void 0 : s.titles) == null ? void 0 : i.noConversation) ?? "No conversations yet" }) });
|
|
1565
|
+
}, kt = ({ titles: e }) => /* @__PURE__ */ x("div", { className: "p-8 text-center flex flex-col", children: [
|
|
1566
|
+
/* @__PURE__ */ f("p", { className: "text-neutrals-800", children: (e == null ? void 0 : e.noConversation) ?? "No conversations yet" }),
|
|
1567
|
+
/* @__PURE__ */ f("p", { className: "text-sm text-neutrals-800 mt-2", children: (e == null ? void 0 : e.clickNewChat) ?? 'Click "New Chat" to start a conversation' })
|
|
1568
|
+
] }), Kt = ({
|
|
1569
|
+
handleConversationClick: e,
|
|
1570
|
+
selectedConversationId: o,
|
|
1571
|
+
actions: r,
|
|
1572
|
+
children: s,
|
|
1573
|
+
isCollapsed: l,
|
|
1574
|
+
conversationStyles: c,
|
|
1575
|
+
conversations: m,
|
|
1576
1576
|
locale: h,
|
|
1577
|
-
sharedConversations:
|
|
1577
|
+
sharedConversations: t,
|
|
1578
1578
|
setConversations: n,
|
|
1579
|
-
setSharedConversations:
|
|
1580
|
-
shareConversationProps:
|
|
1581
|
-
handleSelectedConversationRemove:
|
|
1579
|
+
setSharedConversations: i,
|
|
1580
|
+
shareConversationProps: a,
|
|
1581
|
+
handleSelectedConversationRemove: d
|
|
1582
1582
|
}) => {
|
|
1583
|
-
var
|
|
1584
|
-
const [
|
|
1585
|
-
getConversations:
|
|
1583
|
+
var F;
|
|
1584
|
+
const [p, u] = y({}), [C, g] = y(!0), [b, w] = y(""), [E, N] = y(!1), {
|
|
1585
|
+
getConversations: I,
|
|
1586
1586
|
getSharedConversations: P,
|
|
1587
|
-
deleteConversation:
|
|
1588
|
-
renameConversation:
|
|
1589
|
-
} =
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
...
|
|
1593
|
-
...
|
|
1587
|
+
deleteConversation: L,
|
|
1588
|
+
renameConversation: O
|
|
1589
|
+
} = r, z = q(() => !!(b != null && b.length), [b]);
|
|
1590
|
+
te(() => {
|
|
1591
|
+
u({
|
|
1592
|
+
...et(t),
|
|
1593
|
+
...ot(m)
|
|
1594
1594
|
});
|
|
1595
|
-
}, [
|
|
1595
|
+
}, [m, t]), te(() => {
|
|
1596
1596
|
async function M() {
|
|
1597
1597
|
try {
|
|
1598
|
-
|
|
1599
|
-
const A = await
|
|
1600
|
-
le
|
|
1598
|
+
g(!0);
|
|
1599
|
+
const A = await I(h), B = await P(
|
|
1600
|
+
ae(le.ME)
|
|
1601
1601
|
);
|
|
1602
|
-
n(
|
|
1603
|
-
|
|
1604
|
-
|
|
1602
|
+
n(Z(A)), i(
|
|
1603
|
+
Z(
|
|
1604
|
+
he(B, h)
|
|
1605
1605
|
)
|
|
1606
1606
|
);
|
|
1607
1607
|
} catch (A) {
|
|
1608
1608
|
console.error("Error loading conversation", A);
|
|
1609
1609
|
} finally {
|
|
1610
|
-
|
|
1610
|
+
g(!1);
|
|
1611
1611
|
}
|
|
1612
1612
|
}
|
|
1613
1613
|
M();
|
|
1614
1614
|
}, [
|
|
1615
|
-
|
|
1615
|
+
I,
|
|
1616
1616
|
n,
|
|
1617
1617
|
h,
|
|
1618
1618
|
P,
|
|
1619
|
-
|
|
1619
|
+
i
|
|
1620
1620
|
]);
|
|
1621
|
-
const $ =
|
|
1621
|
+
const $ = k(
|
|
1622
1622
|
async (M) => {
|
|
1623
1623
|
try {
|
|
1624
|
-
await
|
|
1625
|
-
const A = await
|
|
1626
|
-
le
|
|
1624
|
+
await L(M);
|
|
1625
|
+
const A = await I(h), B = await P(
|
|
1626
|
+
ae(le.ME)
|
|
1627
1627
|
);
|
|
1628
|
-
n(
|
|
1629
|
-
|
|
1630
|
-
|
|
1628
|
+
n(Z(A)), i(
|
|
1629
|
+
Z(
|
|
1630
|
+
he(B, h)
|
|
1631
1631
|
)
|
|
1632
|
-
),
|
|
1632
|
+
), o === (M == null ? void 0 : M.id) && d();
|
|
1633
1633
|
} catch (A) {
|
|
1634
1634
|
console.error("Error deleting conversation", A);
|
|
1635
1635
|
}
|
|
1636
1636
|
},
|
|
1637
1637
|
[
|
|
1638
|
-
|
|
1639
|
-
|
|
1638
|
+
L,
|
|
1639
|
+
I,
|
|
1640
1640
|
h,
|
|
1641
1641
|
P,
|
|
1642
1642
|
n,
|
|
1643
|
+
i,
|
|
1643
1644
|
o,
|
|
1644
|
-
|
|
1645
|
-
u
|
|
1645
|
+
d
|
|
1646
1646
|
]
|
|
1647
|
-
),
|
|
1647
|
+
), T = k(
|
|
1648
1648
|
async (M, A) => {
|
|
1649
1649
|
try {
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1652
|
-
le
|
|
1650
|
+
g(!0), await O(M, A);
|
|
1651
|
+
const B = await I(h), X = await P(
|
|
1652
|
+
ae(le.ME)
|
|
1653
1653
|
);
|
|
1654
|
-
n(
|
|
1655
|
-
|
|
1656
|
-
|
|
1654
|
+
n(Z(B)), i(
|
|
1655
|
+
Z(
|
|
1656
|
+
he(X, h)
|
|
1657
1657
|
)
|
|
1658
1658
|
);
|
|
1659
|
-
} catch (
|
|
1660
|
-
console.error("Error renaming conversation",
|
|
1659
|
+
} catch (B) {
|
|
1660
|
+
console.error("Error renaming conversation", B);
|
|
1661
1661
|
} finally {
|
|
1662
|
-
|
|
1662
|
+
g(!1);
|
|
1663
1663
|
}
|
|
1664
1664
|
},
|
|
1665
1665
|
[
|
|
1666
|
-
|
|
1666
|
+
I,
|
|
1667
1667
|
h,
|
|
1668
1668
|
P,
|
|
1669
1669
|
n,
|
|
1670
|
-
|
|
1671
|
-
|
|
1670
|
+
i,
|
|
1671
|
+
O
|
|
1672
1672
|
]
|
|
1673
|
-
), H =
|
|
1673
|
+
), H = k(
|
|
1674
1674
|
(M) => {
|
|
1675
1675
|
w(M);
|
|
1676
1676
|
},
|
|
1677
1677
|
[w]
|
|
1678
|
-
), Q =
|
|
1678
|
+
), Q = k(() => {
|
|
1679
1679
|
N((M) => !M), w("");
|
|
1680
1680
|
}, [N]);
|
|
1681
|
-
return C ? /* @__PURE__ */
|
|
1682
|
-
!
|
|
1681
|
+
return C ? /* @__PURE__ */ f(Ce, {}) : /* @__PURE__ */ x(ee, { children: [
|
|
1682
|
+
!l && /* @__PURE__ */ x(
|
|
1683
1683
|
"div",
|
|
1684
1684
|
{
|
|
1685
|
-
className:
|
|
1685
|
+
className: j(
|
|
1686
1686
|
"flex justify-between items-center",
|
|
1687
1687
|
E ? " pt-4 pb-0 sm:pt-10" : " pt-6 pb-2 sm:pt-10"
|
|
1688
1688
|
),
|
|
1689
1689
|
children: [
|
|
1690
|
-
!E && /* @__PURE__ */
|
|
1691
|
-
/* @__PURE__ */
|
|
1692
|
-
|
|
1690
|
+
!E && /* @__PURE__ */ f("h3", { className: "text-neutrals-700 sm:body-2", children: ((F = c == null ? void 0 : c.titles) == null ? void 0 : F.allChats) ?? "All Chats" }),
|
|
1691
|
+
/* @__PURE__ */ f(
|
|
1692
|
+
yt,
|
|
1693
1693
|
{
|
|
1694
|
-
searchQuery:
|
|
1695
|
-
searchIcon:
|
|
1696
|
-
titles:
|
|
1694
|
+
searchQuery: b,
|
|
1695
|
+
searchIcon: c.searchIcon,
|
|
1696
|
+
titles: c.titles,
|
|
1697
1697
|
isExpandedSearch: E,
|
|
1698
1698
|
onSearchConversations: H,
|
|
1699
1699
|
toggleSearchField: Q
|
|
@@ -1702,57 +1702,204 @@ const Se = "share", At = "onboarding", bt = (t, r) => ({
|
|
|
1702
1702
|
]
|
|
1703
1703
|
}
|
|
1704
1704
|
),
|
|
1705
|
-
/* @__PURE__ */
|
|
1705
|
+
/* @__PURE__ */ f(
|
|
1706
1706
|
"div",
|
|
1707
1707
|
{
|
|
1708
|
-
className:
|
|
1708
|
+
className: j(
|
|
1709
1709
|
"overflow-y-auto flex flex-col mt-4 flex-1 min-h-0 pr-2",
|
|
1710
1710
|
z ? "gap-y-1" : "gap-y-6"
|
|
1711
1711
|
),
|
|
1712
|
-
children:
|
|
1712
|
+
children: l ? null : /* @__PURE__ */ f(ee, { children: (m == null ? void 0 : m.length) === 0 && (t == null ? void 0 : t.length) === 0 ? /* @__PURE__ */ f(kt, { titles: c.titles }) : z ? /* @__PURE__ */ f(
|
|
1713
1713
|
Ft,
|
|
1714
1714
|
{
|
|
1715
1715
|
locale: h,
|
|
1716
|
-
conversationStyles:
|
|
1717
|
-
conversations: [...
|
|
1718
|
-
searchQuery:
|
|
1719
|
-
selectedConversationId:
|
|
1720
|
-
handleConversationClick:
|
|
1721
|
-
shareConversationProps:
|
|
1716
|
+
conversationStyles: c,
|
|
1717
|
+
conversations: [...t, ...m],
|
|
1718
|
+
searchQuery: b,
|
|
1719
|
+
selectedConversationId: o,
|
|
1720
|
+
handleConversationClick: e,
|
|
1721
|
+
shareConversationProps: a,
|
|
1722
1722
|
actions: {
|
|
1723
|
-
...
|
|
1723
|
+
...r,
|
|
1724
1724
|
deleteConversation: $
|
|
1725
1725
|
}
|
|
1726
1726
|
}
|
|
1727
|
-
) : Object.entries(
|
|
1728
|
-
([M, A]) => (A == null ? void 0 : A.length) > 0 && /* @__PURE__ */
|
|
1727
|
+
) : Object.entries(p).map(
|
|
1728
|
+
([M, A]) => (A == null ? void 0 : A.length) > 0 && /* @__PURE__ */ f(
|
|
1729
1729
|
Bt,
|
|
1730
1730
|
{
|
|
1731
1731
|
locale: h,
|
|
1732
1732
|
groupLabel: M,
|
|
1733
|
-
conversationStyles:
|
|
1733
|
+
conversationStyles: c,
|
|
1734
1734
|
groupedConversations: A,
|
|
1735
|
-
handleConversationClick:
|
|
1735
|
+
handleConversationClick: e,
|
|
1736
1736
|
actions: {
|
|
1737
|
-
...
|
|
1737
|
+
...r,
|
|
1738
1738
|
deleteConversation: $,
|
|
1739
|
-
renameConversation:
|
|
1739
|
+
renameConversation: T
|
|
1740
1740
|
},
|
|
1741
|
-
shareConversationProps:
|
|
1742
|
-
selectedConversationId:
|
|
1741
|
+
shareConversationProps: a,
|
|
1742
|
+
selectedConversationId: o
|
|
1743
1743
|
},
|
|
1744
1744
|
M
|
|
1745
1745
|
)
|
|
1746
1746
|
) })
|
|
1747
1747
|
}
|
|
1748
1748
|
),
|
|
1749
|
-
|
|
1749
|
+
s
|
|
1750
1750
|
] });
|
|
1751
|
+
}, Ut = ({
|
|
1752
|
+
onCloseModal: e,
|
|
1753
|
+
disableModalDividers: o,
|
|
1754
|
+
signOut: r,
|
|
1755
|
+
isSmallButton: s,
|
|
1756
|
+
locale: l,
|
|
1757
|
+
titles: c
|
|
1758
|
+
}) => /* @__PURE__ */ x(
|
|
1759
|
+
se,
|
|
1760
|
+
{
|
|
1761
|
+
heading: (c == null ? void 0 : c.popupTitle) || "Log out?",
|
|
1762
|
+
portalId: "sign-out",
|
|
1763
|
+
containerClassName: "sign-out-popup",
|
|
1764
|
+
size: de.SM,
|
|
1765
|
+
dividers: !o,
|
|
1766
|
+
onClose: e,
|
|
1767
|
+
closeButtonTitle: "Cancel",
|
|
1768
|
+
children: [
|
|
1769
|
+
/* @__PURE__ */ f("div", { className: "py-4 px-6 sm:px-0", lang: l, children: c == null ? void 0 : c.popupText }),
|
|
1770
|
+
/* @__PURE__ */ x("div", { className: "flex justify-end gap-x-2 py-3 px-6 delete-conversation-popup-footer", children: [
|
|
1771
|
+
/* @__PURE__ */ f(
|
|
1772
|
+
V,
|
|
1773
|
+
{
|
|
1774
|
+
buttonClassName: "cancel-button",
|
|
1775
|
+
title: (c == null ? void 0 : c.popupCancel) || "Cancel",
|
|
1776
|
+
isSmallButton: s,
|
|
1777
|
+
onClick: (m) => {
|
|
1778
|
+
m.stopPropagation(), e();
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
),
|
|
1782
|
+
/* @__PURE__ */ f(
|
|
1783
|
+
V,
|
|
1784
|
+
{
|
|
1785
|
+
buttonClassName: "text-button-primary",
|
|
1786
|
+
title: (c == null ? void 0 : c.popupApply) || "Sign Out",
|
|
1787
|
+
isSmallButton: s,
|
|
1788
|
+
onClick: (m) => {
|
|
1789
|
+
m.stopPropagation(), r == null || r();
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
)
|
|
1793
|
+
] })
|
|
1794
|
+
]
|
|
1795
|
+
}
|
|
1796
|
+
), Zt = ({
|
|
1797
|
+
userInfo: e,
|
|
1798
|
+
signOutAction: o,
|
|
1799
|
+
styles: r,
|
|
1800
|
+
locale: s,
|
|
1801
|
+
titles: l
|
|
1802
|
+
}) => {
|
|
1803
|
+
var C, g, b;
|
|
1804
|
+
const c = (w) => {
|
|
1805
|
+
var E, N;
|
|
1806
|
+
return ((N = (E = w == null ? void 0 : w.split(" ")) == null ? void 0 : E.map((I, P) => P < 2 ? I[0].toUpperCase() : "")) == null ? void 0 : N.join("")) ?? "";
|
|
1807
|
+
}, m = q(
|
|
1808
|
+
() => {
|
|
1809
|
+
var w;
|
|
1810
|
+
return e != null && e.name ? c(e == null ? void 0 : e.name) : ((w = e == null ? void 0 : e.email) == null ? void 0 : w[0].toUpperCase()) ?? "";
|
|
1811
|
+
},
|
|
1812
|
+
[e]
|
|
1813
|
+
), [h, t] = y(!1), n = (C = e == null ? void 0 : e.name) == null ? void 0 : C.split(" "), i = n ? `${(n == null ? void 0 : n[0]) ?? ""} ${(g = n == null ? void 0 : n[1]) != null && g[0] ? ((b = n == null ? void 0 : n[1]) == null ? void 0 : b[0]) + "." : ""}` : (e == null ? void 0 : e.email) ?? "", a = k(() => {
|
|
1814
|
+
t(!0);
|
|
1815
|
+
}, []), d = k(() => {
|
|
1816
|
+
t(!1);
|
|
1817
|
+
}, []), p = q(() => /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
1818
|
+
/* @__PURE__ */ f(
|
|
1819
|
+
"div",
|
|
1820
|
+
{
|
|
1821
|
+
className: j(
|
|
1822
|
+
"cursor-pointer flex items-center justify-center h-[44px] w-[44px] rounded-[100px] p-[10px] sm:h-[32px] sm:w-[32px]",
|
|
1823
|
+
r == null ? void 0 : r.initialStyles
|
|
1824
|
+
),
|
|
1825
|
+
children: m
|
|
1826
|
+
}
|
|
1827
|
+
),
|
|
1828
|
+
/* @__PURE__ */ f("p", { className: j("h3 cursor-pointer", r == null ? void 0 : r.userNameStyles), children: (r != null && r.showShortName ? i : e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.email) ?? "" })
|
|
1829
|
+
] }), [m, i, r, e]), u = q(() => /* @__PURE__ */ x("div", { className: j("py-1", r == null ? void 0 : r.dropDownStyles), children: [
|
|
1830
|
+
(r == null ? void 0 : r.settingsIcon) && /* @__PURE__ */ x(
|
|
1831
|
+
"button",
|
|
1832
|
+
{
|
|
1833
|
+
className: j(
|
|
1834
|
+
"p-2 items-center flex gap-1 text-primary fill-primary body-1",
|
|
1835
|
+
r == null ? void 0 : r.dropdownButtonStyles
|
|
1836
|
+
),
|
|
1837
|
+
title: l == null ? void 0 : l.settings,
|
|
1838
|
+
children: [
|
|
1839
|
+
r == null ? void 0 : r.settingsIcon,
|
|
1840
|
+
(l == null ? void 0 : l.settings) || "Settings"
|
|
1841
|
+
]
|
|
1842
|
+
}
|
|
1843
|
+
),
|
|
1844
|
+
/* @__PURE__ */ f(
|
|
1845
|
+
"div",
|
|
1846
|
+
{
|
|
1847
|
+
className: j(
|
|
1848
|
+
"h-0 border-t border-neutrals-600 my-2",
|
|
1849
|
+
r != null && r.showSeparator ? "block" : "hidden"
|
|
1850
|
+
)
|
|
1851
|
+
}
|
|
1852
|
+
),
|
|
1853
|
+
/* @__PURE__ */ x(
|
|
1854
|
+
"button",
|
|
1855
|
+
{
|
|
1856
|
+
className: j(
|
|
1857
|
+
"p-2 items-center flex gap-1 text-primary fill-primary body-1",
|
|
1858
|
+
r == null ? void 0 : r.dropdownButtonStyles
|
|
1859
|
+
),
|
|
1860
|
+
title: l == null ? void 0 : l.signOut,
|
|
1861
|
+
onClick: a,
|
|
1862
|
+
children: [
|
|
1863
|
+
r == null ? void 0 : r.signOutIcon,
|
|
1864
|
+
(l == null ? void 0 : l.signOut) || "Sign out",
|
|
1865
|
+
h && /* @__PURE__ */ f(
|
|
1866
|
+
Ut,
|
|
1867
|
+
{
|
|
1868
|
+
onCloseModal: d,
|
|
1869
|
+
signOut: () => o == null ? void 0 : o(),
|
|
1870
|
+
locale: s,
|
|
1871
|
+
disableModalDividers: r == null ? void 0 : r.disableModalDividers,
|
|
1872
|
+
titles: l
|
|
1873
|
+
}
|
|
1874
|
+
)
|
|
1875
|
+
]
|
|
1876
|
+
}
|
|
1877
|
+
)
|
|
1878
|
+
] }), [
|
|
1879
|
+
r,
|
|
1880
|
+
l,
|
|
1881
|
+
a,
|
|
1882
|
+
h,
|
|
1883
|
+
d,
|
|
1884
|
+
s,
|
|
1885
|
+
o
|
|
1886
|
+
]);
|
|
1887
|
+
if (e)
|
|
1888
|
+
return /* @__PURE__ */ f(
|
|
1889
|
+
Re,
|
|
1890
|
+
{
|
|
1891
|
+
containerClassName: "transition-opacity ml-3 group-hover:opacity-100 shrink",
|
|
1892
|
+
triggerButton: p,
|
|
1893
|
+
content: u,
|
|
1894
|
+
openedClassName: "action-menu-opened"
|
|
1895
|
+
}
|
|
1896
|
+
);
|
|
1751
1897
|
};
|
|
1752
1898
|
export {
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1899
|
+
St as ActionMenu,
|
|
1900
|
+
_ as ActionMenuItem,
|
|
1901
|
+
Kt as ConversationList,
|
|
1902
|
+
Zt as User,
|
|
1903
|
+
et as getSharedConversationsGroup,
|
|
1904
|
+
he as transformSharedConversations
|
|
1758
1905
|
};
|