@talkjs/core 1.4.2 → 1.5.1
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/README.md +11 -0
- package/dist/talkSession.cjs +1 -1
- package/dist/talkSession.d.ts +162 -13
- package/dist/talkSession.js +352 -295
- package/package.json +1 -1
package/dist/talkSession.js
CHANGED
|
@@ -496,14 +496,14 @@ class x {
|
|
|
496
496
|
this.sent = true;
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
class
|
|
499
|
+
class I extends x {
|
|
500
500
|
constructor(e2, t2) {
|
|
501
501
|
super(t2, () => {
|
|
502
502
|
this.sendSubscribe(), this.sendGet();
|
|
503
503
|
}), this.connection = e2, this.getCalls = [], this.subscribeCalls = [];
|
|
504
504
|
}
|
|
505
505
|
canPush(e2, t2) {
|
|
506
|
-
return
|
|
506
|
+
return I.isCorrectBatchTypeFor(e2, t2);
|
|
507
507
|
}
|
|
508
508
|
static isCorrectBatchTypeFor(e2, t2) {
|
|
509
509
|
return s(t2, ["users", "*"]) && ("GET" === e2 || "SUBSCRIBE" === e2);
|
|
@@ -529,12 +529,12 @@ class T extends x {
|
|
|
529
529
|
this.connection.call("SUBSCRIBE", ["users"], { ids: e2 }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
class
|
|
532
|
+
class T extends x {
|
|
533
533
|
constructor(e2, t2, s2) {
|
|
534
534
|
super(s2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
|
|
535
535
|
}
|
|
536
536
|
canPush(e2, t2) {
|
|
537
|
-
return !!
|
|
537
|
+
return !!T.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
|
|
538
538
|
}
|
|
539
539
|
static isCorrectBatchTypeFor(e2, t2) {
|
|
540
540
|
return s(t2, ["conversations", "*", "participants", "*"]) && ("PUT" === e2 || "POST" === e2 || "PATCH" === e2);
|
|
@@ -576,10 +576,10 @@ class S {
|
|
|
576
576
|
return this.connection.isConnected();
|
|
577
577
|
}
|
|
578
578
|
createEmptyBatchFor(e2, t2) {
|
|
579
|
-
if (
|
|
580
|
-
if (
|
|
579
|
+
if (I.isCorrectBatchTypeFor(e2, t2)) return new I(this.connection, () => this.pendingBatch = null);
|
|
580
|
+
if (T.isCorrectBatchTypeFor(e2, t2)) {
|
|
581
581
|
const e3 = t2[1];
|
|
582
|
-
return new
|
|
582
|
+
return new T(e3, this.connection, () => this.pendingBatch = null);
|
|
583
583
|
}
|
|
584
584
|
return null;
|
|
585
585
|
}
|
|
@@ -636,7 +636,7 @@ class F {
|
|
|
636
636
|
function B(e2) {
|
|
637
637
|
return e2.map((e3) => encodeURIComponent(e3)).join();
|
|
638
638
|
}
|
|
639
|
-
class
|
|
639
|
+
class R {
|
|
640
640
|
constructor() {
|
|
641
641
|
this.paths = {};
|
|
642
642
|
}
|
|
@@ -656,9 +656,9 @@ class N {
|
|
|
656
656
|
Object.values(this.paths).forEach((t2) => e2(t2));
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
class
|
|
659
|
+
class N {
|
|
660
660
|
constructor(e2, t2, s2) {
|
|
661
|
-
this.handlers = s2, this.targetSubscriptions = new
|
|
661
|
+
this.handlers = s2, this.targetSubscriptions = new R(), this.connection = new M(e2, t2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onSubscriptionsLost: () => {
|
|
662
662
|
this.targetSubscriptions.forEach((e3) => {
|
|
663
663
|
this.resubscribe(e3);
|
|
664
664
|
}), this.handlers.onResubscribeSent();
|
|
@@ -1096,7 +1096,7 @@ class ne extends W {
|
|
|
1096
1096
|
if (!e3.ok) return e3;
|
|
1097
1097
|
t2 = e3.value.data;
|
|
1098
1098
|
}
|
|
1099
|
-
return c({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: t2.custom, createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext: te(t2.content, {}), content: t2.content } });
|
|
1099
|
+
return c({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: t2.custom, createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext: te(t2.content, {}), content: t2.content, reactions: ie(t2.reactions) } });
|
|
1100
1100
|
});
|
|
1101
1101
|
}
|
|
1102
1102
|
refetch(e2) {
|
|
@@ -1123,17 +1123,17 @@ class ne extends W {
|
|
|
1123
1123
|
if (false === (s2 == null ? void 0 : s2.ok)) return s2;
|
|
1124
1124
|
if (null === t2.data) return c({ snapshot: null });
|
|
1125
1125
|
const n2 = s2 == null ? void 0 : s2.value;
|
|
1126
|
-
return c({ snapshot: { sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: t2.data.custom, createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: te(t2.data.content, {}), content: t2.data.content, referencedMessageId: t2.data.referencedMessageId } });
|
|
1126
|
+
return c({ snapshot: { sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: t2.data.custom, createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: te(t2.data.content, {}), content: t2.data.content, referencedMessageId: t2.data.referencedMessageId, reactions: t2.data.reactions } });
|
|
1127
1127
|
});
|
|
1128
1128
|
}
|
|
1129
1129
|
messageEdited(e2, t2) {
|
|
1130
1130
|
this.mutate(e2, (s2) => {
|
|
1131
1131
|
if (null === s2.value.data) return s2;
|
|
1132
|
-
return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt: _(s2.value.data.editedAt, t2.diff.editedAt), custom: P(s2.value.data.custom, t2.diff.custom), content: _(s2.value.data.content, t2.diff.content) } });
|
|
1132
|
+
return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt: _(s2.value.data.editedAt, t2.diff.editedAt), custom: P(s2.value.data.custom, t2.diff.custom), content: _(s2.value.data.content, t2.diff.content), reactions: re(s2.value.data.reactions, t2.diff.reactions) } });
|
|
1133
1133
|
});
|
|
1134
1134
|
}
|
|
1135
1135
|
messageDeleted(e2, t2) {
|
|
1136
|
-
this.mutate(e2, (s2) => null === s2.value.data ? s2 : this.messageId === t2.messageId ? (this.teardownNested(s2.value), c({ lastChanged: e2, sender: null, data: null })) : s2.value.data.referencedMessageId === t2.messageId ? c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: null, editedAt: s2.value.data.editedAt, custom: s2.value.data.custom, content: s2.value.data.content } }) : s2);
|
|
1136
|
+
this.mutate(e2, (s2) => null === s2.value.data ? s2 : this.messageId === t2.messageId ? (this.teardownNested(s2.value), c({ lastChanged: e2, sender: null, data: null })) : s2.value.data.referencedMessageId === t2.messageId ? c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: null, editedAt: s2.value.data.editedAt, custom: s2.value.data.custom, content: s2.value.data.content, reactions: s2.value.data.reactions } }) : s2);
|
|
1137
1137
|
}
|
|
1138
1138
|
getFromCache() {
|
|
1139
1139
|
return __async(this, null, function* () {
|
|
@@ -1143,12 +1143,30 @@ class ne extends W {
|
|
|
1143
1143
|
if (null === e2.value.data) {
|
|
1144
1144
|
return h({ status: 404, errorCode: "MESSAGE_NOT_FOUND", reasons: ["No message with that ID exists"] });
|
|
1145
1145
|
}
|
|
1146
|
-
const _a2 = e2.value, { sender: t2 } = _a2, s2 = __objRest(_a2, ["sender"]);
|
|
1147
|
-
return
|
|
1146
|
+
const _a2 = e2.value, { sender: t2 } = _a2, s2 = __objRest(_a2, ["sender"]), n2 = {};
|
|
1147
|
+
return s2.data.reactions.forEach((e3) => {
|
|
1148
|
+
n2[e3.emoji] = { count: e3.count, currentUserReacted: e3.currentUserReacted };
|
|
1149
|
+
}), c({ status: 200, data: __spreadProps(__spreadValues({}, s2.data), { senderId: (_b = t2 == null ? void 0 : t2.store.userId) != null ? _b : null, reactions: n2 }) });
|
|
1148
1150
|
});
|
|
1149
1151
|
}
|
|
1150
1152
|
}
|
|
1151
|
-
|
|
1153
|
+
function re(e2, t2) {
|
|
1154
|
+
if (void 0 === t2) return e2;
|
|
1155
|
+
const s2 = e2.map((e3) => {
|
|
1156
|
+
const s3 = t2[e3.emoji];
|
|
1157
|
+
return void 0 === s3 ? e3 : null === s3 ? __spreadProps(__spreadValues({}, e3), { count: 0 }) : { emoji: e3.emoji, count: _(e3.count, s3.count), currentUserReacted: _(e3.currentUserReacted, s3.currentUserReacted) };
|
|
1158
|
+
}).filter((e3) => e3.count > 0), n2 = new Set(s2.map((e3) => e3.emoji));
|
|
1159
|
+
for (const e3 in t2) {
|
|
1160
|
+
const r2 = t2[e3];
|
|
1161
|
+
r2 && !n2.has(e3) && s2.push({ emoji: e3, count: r2.count, currentUserReacted: r2.currentUserReacted });
|
|
1162
|
+
}
|
|
1163
|
+
return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), s2;
|
|
1164
|
+
}
|
|
1165
|
+
function ie(e2) {
|
|
1166
|
+
const t2 = Object.entries(e2).map(([e3, t3]) => ({ emoji: e3, count: t3.count, currentUserReacted: t3.currentUserReacted }));
|
|
1167
|
+
return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), t2;
|
|
1168
|
+
}
|
|
1169
|
+
class ae extends W {
|
|
1152
1170
|
constructor(e2, t2, s2, n2) {
|
|
1153
1171
|
super(e2), this.createdAt = t2, this.dataStore = s2, this.referencedDataStore = n2;
|
|
1154
1172
|
}
|
|
@@ -1184,11 +1202,11 @@ class re extends W {
|
|
|
1184
1202
|
const r2 = yield (_a2 = t2.referencedDataStore) == null ? void 0 : _a2.getDeep(e2);
|
|
1185
1203
|
if (r2 && !r2.ok) return r2;
|
|
1186
1204
|
const i2 = (_b = r2 == null ? void 0 : r2.value) != null ? _b : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
|
|
1187
|
-
return c({ snapshot: { id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: n2.snapshot.custom, createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: a2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content } });
|
|
1205
|
+
return c({ snapshot: { id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: n2.snapshot.custom, createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: a2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content, reactions: n2.snapshot.reactions } });
|
|
1188
1206
|
});
|
|
1189
1207
|
}
|
|
1190
1208
|
}
|
|
1191
|
-
class
|
|
1209
|
+
class oe extends q {
|
|
1192
1210
|
constructor(e2, t2, s2, n2, r2) {
|
|
1193
1211
|
super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1194
1212
|
}
|
|
@@ -1202,8 +1220,8 @@ class ie extends q {
|
|
|
1202
1220
|
}
|
|
1203
1221
|
fetchInitial(e2) {
|
|
1204
1222
|
return __async(this, null, function* () {
|
|
1205
|
-
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield
|
|
1206
|
-
return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) :
|
|
1223
|
+
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield ue({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
|
|
1224
|
+
return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) : ce({ seq: e2, messages: s2.value.messages, cursor: s2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : s2;
|
|
1207
1225
|
});
|
|
1208
1226
|
}
|
|
1209
1227
|
teardownNested(e2) {
|
|
@@ -1256,8 +1274,8 @@ class ie extends q {
|
|
|
1256
1274
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1257
1275
|
if (!t2.ok) return;
|
|
1258
1276
|
if (null === t2.value.windowEnd) return;
|
|
1259
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1260
|
-
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), e3) :
|
|
1277
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield ue({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient }), r2 = this.getLoadMoreSeq();
|
|
1278
|
+
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), e3) : ce({ seq: r2, prevState: e3.value, messages: n2.value.messages, cursor: n2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : n2), yield this.emitMutex.runExclusive(() => this.emit(r2));
|
|
1261
1279
|
});
|
|
1262
1280
|
}
|
|
1263
1281
|
messageCreated(e2, t2) {
|
|
@@ -1270,7 +1288,7 @@ class ie extends q {
|
|
|
1270
1288
|
const i2 = t2.state.referencedMessageId;
|
|
1271
1289
|
let a2;
|
|
1272
1290
|
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new ne(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
|
|
1273
|
-
const o2 = new
|
|
1291
|
+
const o2 = new ae(e2, t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
|
|
1274
1292
|
u2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1275
1293
|
const l2 = u2[0].messageId === t2.messageId ? e2 : s2.value.lastMessageChanged;
|
|
1276
1294
|
return c({ lastChanged: e2, lastMessageChanged: l2, stores: n2, inWindow: u2, windowEnd: s2.value.windowEnd });
|
|
@@ -1295,7 +1313,7 @@ class ie extends q {
|
|
|
1295
1313
|
const i3 = t2.newLastMessage.referencedMessageId;
|
|
1296
1314
|
let a2;
|
|
1297
1315
|
null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new ne(e2, this.conversationId, i3, this.realtimeClient), n2[i3] = a2);
|
|
1298
|
-
const o2 = new
|
|
1316
|
+
const o2 = new ae(e2, t2.newLastMessage.createdAt, s3, a2);
|
|
1299
1317
|
r2.push(o2);
|
|
1300
1318
|
}
|
|
1301
1319
|
const i2 = void 0 !== t2.newLastMessage ? e2 : s2.value.lastMessageChanged;
|
|
@@ -1327,7 +1345,7 @@ class ie extends q {
|
|
|
1327
1345
|
});
|
|
1328
1346
|
}
|
|
1329
1347
|
}
|
|
1330
|
-
function
|
|
1348
|
+
function ue(_0) {
|
|
1331
1349
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1332
1350
|
const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "messages"], r2, { bypassCache: true });
|
|
1333
1351
|
if (i2.ok) {
|
|
@@ -1337,7 +1355,7 @@ function ae(_0) {
|
|
|
1337
1355
|
return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 : c({ messages: null, nextCursor: null });
|
|
1338
1356
|
});
|
|
1339
1357
|
}
|
|
1340
|
-
function
|
|
1358
|
+
function ce({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
|
|
1341
1359
|
var _a2, _b, _c, _d;
|
|
1342
1360
|
const a2 = t2 ? __spreadValues({}, t2.stores) : {};
|
|
1343
1361
|
for (const t3 of s2) if (void 0 === a2[t3.id]) {
|
|
@@ -1352,13 +1370,13 @@ function oe({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId:
|
|
|
1352
1370
|
}
|
|
1353
1371
|
}
|
|
1354
1372
|
const o2 = t2 ? [...t2.inWindow] : [];
|
|
1355
|
-
for (const t3 of s2) o2.push(new
|
|
1373
|
+
for (const t3 of s2) o2.push(new ae(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
|
|
1356
1374
|
o2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1357
1375
|
const u2 = (_b = (_a2 = t2 == null ? void 0 : t2.inWindow) == null ? void 0 : _a2[0]) == null ? void 0 : _b.messageId, l2 = (_c = o2 == null ? void 0 : o2[0]) == null ? void 0 : _c.messageId, h2 = u2 === l2 ? (_d = t2 == null ? void 0 : t2.lastMessageChanged) != null ? _d : e2 : e2;
|
|
1358
1376
|
if (null === n2) return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: null });
|
|
1359
1377
|
return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: { cursor: n2, oldestMessageTs: s2[s2.length - 1].createdAt } });
|
|
1360
1378
|
}
|
|
1361
|
-
class
|
|
1379
|
+
class le extends q {
|
|
1362
1380
|
constructor(e2, t2, s2, n2, r2) {
|
|
1363
1381
|
super(e2, n2, r2), this.convDataStore = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 0;
|
|
1364
1382
|
}
|
|
@@ -1389,19 +1407,19 @@ class ue extends q {
|
|
|
1389
1407
|
});
|
|
1390
1408
|
}
|
|
1391
1409
|
}
|
|
1392
|
-
function
|
|
1410
|
+
function he(e2, t2) {
|
|
1393
1411
|
for (let s2 in e2) Object.prototype.hasOwnProperty.call(e2, s2) && t2(e2[s2], s2);
|
|
1394
1412
|
}
|
|
1395
|
-
function
|
|
1413
|
+
function de(e2, t2) {
|
|
1396
1414
|
return function(e3, t3) {
|
|
1397
1415
|
let s2 = {}, n2 = 0;
|
|
1398
|
-
return
|
|
1416
|
+
return he(e3, (e4, r2) => {
|
|
1399
1417
|
const [i2, a2] = t3([r2, e4], n2++);
|
|
1400
1418
|
s2[i2] = a2;
|
|
1401
1419
|
}), s2;
|
|
1402
1420
|
}(e2, ([e3, s2]) => [e3, t2(s2, e3)]);
|
|
1403
1421
|
}
|
|
1404
|
-
class
|
|
1422
|
+
class pe extends q {
|
|
1405
1423
|
constructor(e2, t2, s2, n2, r2) {
|
|
1406
1424
|
super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
|
|
1407
1425
|
}
|
|
@@ -1413,7 +1431,7 @@ class he extends q {
|
|
|
1413
1431
|
if (!t2.ok) return t2;
|
|
1414
1432
|
const s2 = t2.value.data;
|
|
1415
1433
|
if (s2.many) return c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1416
|
-
return c({ data: s2, userSubscriptions:
|
|
1434
|
+
return c({ data: s2, userSubscriptions: de(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
|
|
1417
1435
|
});
|
|
1418
1436
|
}
|
|
1419
1437
|
equal(e2, t2) {
|
|
@@ -1430,7 +1448,7 @@ class he extends q {
|
|
|
1430
1448
|
});
|
|
1431
1449
|
}
|
|
1432
1450
|
typingAvailable(e2, t2) {
|
|
1433
|
-
this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} :
|
|
1451
|
+
this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : de(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
|
|
1434
1452
|
}
|
|
1435
1453
|
typingChanged(e2, t2) {
|
|
1436
1454
|
this.mutate(e2, (s2) => {
|
|
@@ -1438,7 +1456,7 @@ class he extends q {
|
|
|
1438
1456
|
if (void 0 === t2.diff.many) {
|
|
1439
1457
|
if (true === s2.value.data.many) return s2;
|
|
1440
1458
|
const n2 = __spreadValues({}, s2.value.data.usersTyping), r2 = __spreadValues({}, s2.value.userSubscriptions);
|
|
1441
|
-
return
|
|
1459
|
+
return he(t2.diff.usersTyping, (e3, t3) => {
|
|
1442
1460
|
var _a2;
|
|
1443
1461
|
"number" == typeof e3 ? (n2[t3] = e3, r2[t3] = this.realtimeClient.internalSubscribe(["users", t3])) : null === e3 && (delete n2[t3], (_a2 = r2[t3]) == null ? void 0 : _a2.unsubscribe(), delete r2[t3]);
|
|
1444
1462
|
}), c({ data: { usersTyping: n2, many: false }, userSubscriptions: r2, lastChanged: e2 });
|
|
@@ -1446,7 +1464,7 @@ class he extends q {
|
|
|
1446
1464
|
if (true === t2.diff.many) return s2.value.data.many ? s2 : c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1447
1465
|
if (false === t2.diff.many) {
|
|
1448
1466
|
if (false === s2.value.data.many) return s2;
|
|
1449
|
-
const n2 =
|
|
1467
|
+
const n2 = de(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
|
|
1450
1468
|
return c({ data: t2.diff, userSubscriptions: n2, lastChanged: e2 });
|
|
1451
1469
|
}
|
|
1452
1470
|
throw t2.diff, "Unreachable";
|
|
@@ -1456,7 +1474,7 @@ class he extends q {
|
|
|
1456
1474
|
this.mutate(e2, (t3) => null === t3.value.data ? t3 : c({ data: null, lastChanged: e2 }));
|
|
1457
1475
|
}
|
|
1458
1476
|
teardownNested(e2) {
|
|
1459
|
-
e2.data &&
|
|
1477
|
+
e2.data && he(e2.userSubscriptions, (e3) => e3.unsubscribe());
|
|
1460
1478
|
}
|
|
1461
1479
|
anyChildChanged(e2, t2, s2) {
|
|
1462
1480
|
return __async(this, null, function* () {
|
|
@@ -1470,7 +1488,7 @@ class he extends q {
|
|
|
1470
1488
|
});
|
|
1471
1489
|
}
|
|
1472
1490
|
}
|
|
1473
|
-
class
|
|
1491
|
+
class fe extends W {
|
|
1474
1492
|
constructor(e2, t2, s2, n2) {
|
|
1475
1493
|
super(e2), this.conversationId = t2, this.participantData = s2, this.realtimeClient = n2;
|
|
1476
1494
|
}
|
|
@@ -1526,14 +1544,14 @@ class de extends W {
|
|
|
1526
1544
|
});
|
|
1527
1545
|
}
|
|
1528
1546
|
}
|
|
1529
|
-
class
|
|
1547
|
+
class me extends q {
|
|
1530
1548
|
constructor(e2, t2, s2, n2, r2) {
|
|
1531
1549
|
super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1532
1550
|
}
|
|
1533
1551
|
fetchInitial(e2) {
|
|
1534
1552
|
return __async(this, null, function* () {
|
|
1535
|
-
const t2 = yield
|
|
1536
|
-
return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) :
|
|
1553
|
+
const t2 = yield ge({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: 10 });
|
|
1554
|
+
return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : ve({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2;
|
|
1537
1555
|
});
|
|
1538
1556
|
}
|
|
1539
1557
|
teardownNested(e2) {
|
|
@@ -1575,8 +1593,8 @@ class pe extends q {
|
|
|
1575
1593
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1576
1594
|
if (!t2.ok) return;
|
|
1577
1595
|
if (null === t2.value.windowEnd) return;
|
|
1578
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1579
|
-
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), e3) :
|
|
1596
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield ge({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient }), r2 = this.getLoadMoreSeq();
|
|
1597
|
+
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), e3) : ve({ seq: r2, prevStores: e3.value.stores, participants: n2.value.participants, cursor: n2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : n2), yield this.emitMutex.runExclusive(() => this.emit(r2));
|
|
1580
1598
|
});
|
|
1581
1599
|
}
|
|
1582
1600
|
participantCreated(e2, t2) {
|
|
@@ -1584,7 +1602,7 @@ class pe extends q {
|
|
|
1584
1602
|
if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."), s2;
|
|
1585
1603
|
if (s2.value.windowEnd && t2.state.joinedAt < s2.value.windowEnd.oldestParticipantTs) return s2;
|
|
1586
1604
|
if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
|
|
1587
|
-
const n2 = __spreadValues({}, s2.value.stores), r2 = new
|
|
1605
|
+
const n2 = __spreadValues({}, s2.value.stores), r2 = new fe(e2, this.conversationId, t2.state, this.realtimeClient);
|
|
1588
1606
|
n2[t2.state.id] = r2;
|
|
1589
1607
|
return c({ lastChanged: e2, stores: n2, windowEnd: s2.value.windowEnd });
|
|
1590
1608
|
});
|
|
@@ -1624,7 +1642,7 @@ class pe extends q {
|
|
|
1624
1642
|
});
|
|
1625
1643
|
}
|
|
1626
1644
|
}
|
|
1627
|
-
function
|
|
1645
|
+
function ge(_0) {
|
|
1628
1646
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1629
1647
|
const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "participants"], r2, { bypassCache: true });
|
|
1630
1648
|
if (i2.ok) {
|
|
@@ -1634,23 +1652,23 @@ function fe(_0) {
|
|
|
1634
1652
|
return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 : c({ participants: null, nextCursor: null });
|
|
1635
1653
|
});
|
|
1636
1654
|
}
|
|
1637
|
-
function
|
|
1655
|
+
function ve({ seq: e2, prevStores: t2, participants: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
|
|
1638
1656
|
const a2 = t2 ? __spreadValues({}, t2) : {};
|
|
1639
1657
|
for (const t3 of s2) if (void 0 === a2[t3.id]) {
|
|
1640
|
-
const s3 = new
|
|
1658
|
+
const s3 = new fe(e2, r2, t3, i2);
|
|
1641
1659
|
a2[t3.id] = s3;
|
|
1642
1660
|
}
|
|
1643
1661
|
if (null === n2) return c({ lastChanged: e2, stores: a2, windowEnd: null });
|
|
1644
1662
|
return c({ lastChanged: e2, stores: a2, windowEnd: { cursor: n2, oldestParticipantTs: s2[s2.length - 1].joinedAt } });
|
|
1645
1663
|
}
|
|
1646
|
-
class
|
|
1664
|
+
class we extends q {
|
|
1647
1665
|
constructor(e2, t2, s2, n2, r2) {
|
|
1648
1666
|
super(e2, n2, r2), this.getConvDataStore = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1649
1667
|
}
|
|
1650
1668
|
fetchInitial(e2) {
|
|
1651
1669
|
return __async(this, null, function* () {
|
|
1652
|
-
const t2 = yield
|
|
1653
|
-
return t2.ok ? null === t2.value.conversations ? c({ lastChanged: e2, stores: null, windowEnd: null }) :
|
|
1670
|
+
const t2 = yield be({ realtimeClient: this.realtimeClient, count: 20 });
|
|
1671
|
+
return t2.ok ? null === t2.value.conversations ? c({ lastChanged: e2, stores: null, windowEnd: null }) : ye({ seq: e2, conversations: t2.value.conversations, cursor: t2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2;
|
|
1654
1672
|
});
|
|
1655
1673
|
}
|
|
1656
1674
|
teardownNested(e2) {
|
|
@@ -1694,8 +1712,8 @@ class ge extends q {
|
|
|
1694
1712
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1695
1713
|
if (!t2.ok) return;
|
|
1696
1714
|
if (null === t2.value.windowEnd) return;
|
|
1697
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1698
|
-
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), e3) :
|
|
1715
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield be({ count: e2, cursor: s2, realtimeClient: this.realtimeClient }), r2 = this.getLoadMoreSeq();
|
|
1716
|
+
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), e3) : ye({ seq: r2, prevStores: e3.value.stores, conversations: n2.value.conversations, cursor: n2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : n2), yield this.emitMutex.runExclusive(() => this.emit(r2));
|
|
1699
1717
|
});
|
|
1700
1718
|
}
|
|
1701
1719
|
getConvFromCache(e2) {
|
|
@@ -1741,7 +1759,7 @@ class ge extends q {
|
|
|
1741
1759
|
});
|
|
1742
1760
|
}
|
|
1743
1761
|
}
|
|
1744
|
-
function
|
|
1762
|
+
function be(_0) {
|
|
1745
1763
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, count: s2 }) {
|
|
1746
1764
|
const n2 = { limit: s2, cursor: e2 }, r2 = yield t2.call("GET", ["me", "conversations"], n2, { bypassCache: true });
|
|
1747
1765
|
if (r2.ok) {
|
|
@@ -1751,13 +1769,13 @@ function ve(_0) {
|
|
|
1751
1769
|
return r2.ok || "server" !== r2.where || 404 !== r2.value.status || "USER_NOT_FOUND" !== r2.value.errorCode ? r2 : c({ conversations: null, nextCursor: null });
|
|
1752
1770
|
});
|
|
1753
1771
|
}
|
|
1754
|
-
function
|
|
1772
|
+
function ye({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
|
|
1755
1773
|
const i2 = t2 ? __spreadValues({}, t2) : {};
|
|
1756
1774
|
for (const e3 of s2) void 0 === i2[e3.id] && (i2[e3.id] = r2(e3));
|
|
1757
1775
|
if (null === n2) return c({ lastChanged: e2, stores: i2, windowEnd: null });
|
|
1758
1776
|
return c({ lastChanged: e2, stores: i2, windowEnd: { cursor: n2, oldestMessageTs: Math.min(...s2.map((e3) => e3.lastMessageAt)) } });
|
|
1759
1777
|
}
|
|
1760
|
-
class
|
|
1778
|
+
class Ce extends q {
|
|
1761
1779
|
constructor(e2, t2, s2, n2, r2) {
|
|
1762
1780
|
super(e2, n2, r2), this.conversation = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 5e3;
|
|
1763
1781
|
}
|
|
@@ -1802,13 +1820,13 @@ class be extends q {
|
|
|
1802
1820
|
});
|
|
1803
1821
|
}
|
|
1804
1822
|
participantEdited(e2, t2) {
|
|
1805
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1823
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: Ae(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1806
1824
|
}
|
|
1807
1825
|
conversationEdited(e2, t2) {
|
|
1808
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1826
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: Ae(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1809
1827
|
}
|
|
1810
1828
|
sideEdited(e2, t2) {
|
|
1811
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1829
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: Ae(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1812
1830
|
}
|
|
1813
1831
|
sideCreated(e2, t2) {
|
|
1814
1832
|
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindowStore: s2.value.messageWindowStore }));
|
|
@@ -1823,11 +1841,11 @@ class be extends q {
|
|
|
1823
1841
|
});
|
|
1824
1842
|
}
|
|
1825
1843
|
}
|
|
1826
|
-
function
|
|
1844
|
+
function Ae(e2, t2) {
|
|
1827
1845
|
const s2 = t2;
|
|
1828
1846
|
return { id: e2.id, createdAt: e2.createdAt, subject: _(e2.subject, s2.subject), photoUrl: _(e2.photoUrl, s2.photoUrl), welcomeMessages: _(e2.welcomeMessages, s2.welcomeMessages), custom: P(e2.custom, s2.custom), lastMessageAt: _(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: _(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: _(e2.isUnread, s2.isUnread), access: _(e2.access, s2.access), notify: _(e2.notify, s2.notify), readUntil: _(e2.readUntil, s2.readUntil), everyoneReadUntil: _(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
|
|
1829
1847
|
}
|
|
1830
|
-
class
|
|
1848
|
+
class Ee extends q {
|
|
1831
1849
|
constructor(e2, t2, s2, n2, r2) {
|
|
1832
1850
|
super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e3;
|
|
1833
1851
|
}
|
|
@@ -1877,9 +1895,9 @@ class Ce extends q {
|
|
|
1877
1895
|
});
|
|
1878
1896
|
}
|
|
1879
1897
|
}
|
|
1880
|
-
class
|
|
1898
|
+
class ke {
|
|
1881
1899
|
constructor(e2, t2, s2) {
|
|
1882
|
-
this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new U(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new
|
|
1900
|
+
this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new U(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new N(e2, t2, { onUpstreamRestarting: () => {
|
|
1883
1901
|
this.refetchOnNextNetworkLoss = false;
|
|
1884
1902
|
}, onReady: () => {
|
|
1885
1903
|
this.refetchOnNextNetworkLoss = true;
|
|
@@ -1891,7 +1909,7 @@ class Ae {
|
|
|
1891
1909
|
}
|
|
1892
1910
|
}, onResubscribeError: (e3, t3) => {
|
|
1893
1911
|
var _a2;
|
|
1894
|
-
(_a2 = this.storeMap[
|
|
1912
|
+
(_a2 = this.storeMap[xe(e3)]) == null ? void 0 : _a2.setError(t3);
|
|
1895
1913
|
}, onPublish: (e3, t3) => {
|
|
1896
1914
|
this.seqInThisConnection = e3;
|
|
1897
1915
|
const s3 = this.seq;
|
|
@@ -1951,7 +1969,7 @@ class Ae {
|
|
|
1951
1969
|
call(e2, t2, n2, r2) {
|
|
1952
1970
|
return __async(this, null, function* () {
|
|
1953
1971
|
if (!r2.bypassCache && "GET" === e2) {
|
|
1954
|
-
const e3 =
|
|
1972
|
+
const e3 = xe(t2);
|
|
1955
1973
|
if (e3 in this.storeMap) {
|
|
1956
1974
|
const t3 = e3, s2 = this.storeMap[t3];
|
|
1957
1975
|
if (s2 && "getFromCache" in s2) {
|
|
@@ -2016,7 +2034,7 @@ class Ae {
|
|
|
2016
2034
|
}, a2;
|
|
2017
2035
|
}
|
|
2018
2036
|
getOrCreateStore(e2) {
|
|
2019
|
-
const t2 =
|
|
2037
|
+
const t2 = xe(e2);
|
|
2020
2038
|
if (t2 in this.storeMap) return this.storeMap[t2];
|
|
2021
2039
|
this.connection.subscribe(e2).then((e3) => {
|
|
2022
2040
|
e3.ok || s2.setError(e3);
|
|
@@ -2034,12 +2052,12 @@ class Ae {
|
|
|
2034
2052
|
}
|
|
2035
2053
|
instantiateStore(e2, t2) {
|
|
2036
2054
|
if (s(e2, ["users", "*"])) return new G(this.seq, e2[1], this.realtimeClient, this.emitMutex, t2);
|
|
2037
|
-
if (s(e2, ["me", "conversations", "*"])) return new
|
|
2038
|
-
if (s(e2, ["me", "conversations", "*", "messages"])) return new
|
|
2039
|
-
if (s(e2, ["me", "conversations", "*", "participants"])) return new
|
|
2040
|
-
if (s(e2, ["me", "conversations", "*", "typing"])) return new
|
|
2041
|
-
if (s(e2, ["me", "conversations"])) return new
|
|
2042
|
-
if (s(e2, ["users", "*", "online"])) return new
|
|
2055
|
+
if (s(e2, ["me", "conversations", "*"])) return new le(this.seq, this.subscribeConvData(e2[2]), this.realtimeClient, this.emitMutex, t2);
|
|
2056
|
+
if (s(e2, ["me", "conversations", "*", "messages"])) return new oe(this.seq, e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
2057
|
+
if (s(e2, ["me", "conversations", "*", "participants"])) return new me(this.seq, e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
2058
|
+
if (s(e2, ["me", "conversations", "*", "typing"])) return new pe(this.seq, e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
2059
|
+
if (s(e2, ["me", "conversations"])) return new we(this.seq, (e3) => this.subscribeConvData(e3), this.realtimeClient, this.emitMutex, t2);
|
|
2060
|
+
if (s(e2, ["users", "*", "online"])) return new Ee(this.seq, e2[1], this.realtimeClient, this.emitMutex, t2);
|
|
2043
2061
|
throw "Unreachable";
|
|
2044
2062
|
}
|
|
2045
2063
|
subscribeConvData(e2) {
|
|
@@ -2048,18 +2066,18 @@ class Ae {
|
|
|
2048
2066
|
const e3 = this.convDataStores[t2];
|
|
2049
2067
|
return { store: e3, unsubscribe: e3.registerInternalSubscription() };
|
|
2050
2068
|
}
|
|
2051
|
-
const s2 = new
|
|
2069
|
+
const s2 = new Ce(this.seq, e2, this.realtimeClient, this.emitMutex, () => {
|
|
2052
2070
|
delete this.convDataStores[t2];
|
|
2053
2071
|
});
|
|
2054
2072
|
return this.convDataStores[t2] = s2, { store: s2, unsubscribe: s2.registerInternalSubscription() };
|
|
2055
2073
|
}
|
|
2056
2074
|
}
|
|
2057
|
-
function
|
|
2075
|
+
function xe(e2) {
|
|
2058
2076
|
return `/${e2.join("/")}`;
|
|
2059
2077
|
}
|
|
2060
|
-
class
|
|
2078
|
+
class Ie {
|
|
2061
2079
|
constructor(e2, t2, s2) {
|
|
2062
|
-
this.userId = t2, this.alive = true, this.connection = new
|
|
2080
|
+
this.userId = t2, this.alive = true, this.connection = new ke(e2, s2, this), s2.onTokenRefreshFailed(() => {
|
|
2063
2081
|
this.destroy();
|
|
2064
2082
|
});
|
|
2065
2083
|
}
|
|
@@ -2084,7 +2102,7 @@ class ke {
|
|
|
2084
2102
|
listMessages(e2, t2) {
|
|
2085
2103
|
return __async(this, null, function* () {
|
|
2086
2104
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
|
|
2087
|
-
if (!s2.ok) return
|
|
2105
|
+
if (!s2.ok) return Te(s2, "Listing messages in " + e2);
|
|
2088
2106
|
const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.createMessageSnapshot(t3, e2))), i2 = r2.find((e3) => !e3.ok);
|
|
2089
2107
|
if (void 0 !== i2 && !i2.ok) return i2;
|
|
2090
2108
|
return c(r2.map(({ value: e3 }) => e3));
|
|
@@ -2113,7 +2131,7 @@ class ke {
|
|
|
2113
2131
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
|
|
2114
2132
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
|
|
2115
2133
|
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
|
|
2116
|
-
if (!s2.ok) return
|
|
2134
|
+
if (!s2.ok) return Te(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
|
|
2117
2135
|
const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
|
|
2118
2136
|
if (!r2.ok) return r2;
|
|
2119
2137
|
const i2 = r2.value;
|
|
@@ -2124,26 +2142,26 @@ class ke {
|
|
|
2124
2142
|
return __async(this, null, function* () {
|
|
2125
2143
|
const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
|
|
2126
2144
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
|
|
2127
|
-
if (!t2.ok) return
|
|
2145
|
+
if (!t2.ok) return Te(t2, "Get user " + e2);
|
|
2128
2146
|
return c(this.createUserSnapshot(t2.value.data));
|
|
2129
2147
|
});
|
|
2130
2148
|
}
|
|
2131
2149
|
createMessageSnapshotPreloaded(e2, t2, s2) {
|
|
2132
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext: te(e2.content, {}) };
|
|
2150
|
+
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, reactions: ie(e2.reactions), plaintext: te(e2.content, {}) };
|
|
2133
2151
|
}
|
|
2134
2152
|
createReferencedMessageSnapshotPreloaded(e2, t2) {
|
|
2135
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext: te(e2.content, {}) };
|
|
2153
|
+
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, reactions: ie(e2.reactions), plaintext: te(e2.content, {}) };
|
|
2136
2154
|
}
|
|
2137
2155
|
}
|
|
2138
|
-
function
|
|
2156
|
+
function Te(e2, t2) {
|
|
2139
2157
|
return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
|
|
2140
2158
|
}
|
|
2141
|
-
function
|
|
2159
|
+
function Se(e2, s2) {
|
|
2142
2160
|
var _a2;
|
|
2143
2161
|
if (s2.ok) return s2.value;
|
|
2144
2162
|
throw "SESSION_DESTROYED" === s2.value ? new Error(`${e2} failed because the session was destroyed`) : new Error(t((_a2 = s2.value.operation) != null ? _a2 : e2, s2.value));
|
|
2145
2163
|
}
|
|
2146
|
-
class
|
|
2164
|
+
class De {
|
|
2147
2165
|
constructor(e2, t2) {
|
|
2148
2166
|
this.id = e2, this._realtimeClient = t2;
|
|
2149
2167
|
}
|
|
@@ -2153,7 +2171,7 @@ class Ie {
|
|
|
2153
2171
|
get() {
|
|
2154
2172
|
return __async(this, null, function* () {
|
|
2155
2173
|
const e2 = yield this._realtimeClient.getUser(this.brandedId);
|
|
2156
|
-
return
|
|
2174
|
+
return Se("Get user " + this.id, e2);
|
|
2157
2175
|
});
|
|
2158
2176
|
}
|
|
2159
2177
|
set(t2) {
|
|
@@ -2177,7 +2195,7 @@ class Ie {
|
|
|
2177
2195
|
return this._realtimeClient.subscribe(["users", this.brandedId, "online"], e2);
|
|
2178
2196
|
}
|
|
2179
2197
|
}
|
|
2180
|
-
class
|
|
2198
|
+
class Me {
|
|
2181
2199
|
constructor(e2, t2, s2) {
|
|
2182
2200
|
this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
2183
2201
|
}
|
|
@@ -2221,7 +2239,7 @@ class Se {
|
|
|
2221
2239
|
});
|
|
2222
2240
|
}
|
|
2223
2241
|
}
|
|
2224
|
-
function
|
|
2242
|
+
function Fe(e2) {
|
|
2225
2243
|
const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
2226
2244
|
let s2 = 0;
|
|
2227
2245
|
const n2 = [], r2 = e2 === s2;
|
|
@@ -2239,7 +2257,7 @@ function De(e2) {
|
|
|
2239
2257
|
if (20 != a2.length) throw new Error("Length should be 20.");
|
|
2240
2258
|
return a2;
|
|
2241
2259
|
}
|
|
2242
|
-
const
|
|
2260
|
+
const Be = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
2243
2261
|
return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
|
|
2244
2262
|
}(e2, (e3) => {
|
|
2245
2263
|
if ("string" == typeof e3) return t2(e3, s2);
|
|
@@ -2252,14 +2270,14 @@ const Me = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
2252
2270
|
case "bulletList":
|
|
2253
2271
|
case "bulletpoint":
|
|
2254
2272
|
case "bulletPoint":
|
|
2255
|
-
return [{ type: e3.type, children:
|
|
2273
|
+
return [{ type: e3.type, children: Be(e3.children, t2, e3.type) }];
|
|
2256
2274
|
case "link":
|
|
2257
|
-
return [{ type: e3.type, url: e3.url, children:
|
|
2275
|
+
return [{ type: e3.type, url: e3.url, children: Be(e3.children, t2, e3.type) }];
|
|
2258
2276
|
case "actionlink":
|
|
2259
2277
|
case "actionLink":
|
|
2260
2278
|
case "actionbutton":
|
|
2261
2279
|
case "actionButton":
|
|
2262
|
-
return [{ type: e3.type, action: e3.action, params: e3.params, children:
|
|
2280
|
+
return [{ type: e3.type, action: e3.action, params: e3.params, children: Be(e3.children, t2, e3.type) }];
|
|
2263
2281
|
case "mention":
|
|
2264
2282
|
case "autolink":
|
|
2265
2283
|
case "autoLink":
|
|
@@ -2274,7 +2292,7 @@ const Me = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
2274
2292
|
return [e3];
|
|
2275
2293
|
}
|
|
2276
2294
|
});
|
|
2277
|
-
function
|
|
2295
|
+
function Re(e2, t2) {
|
|
2278
2296
|
return (s2) => {
|
|
2279
2297
|
const n2 = s2;
|
|
2280
2298
|
let r2 = 0;
|
|
@@ -2287,29 +2305,29 @@ function Fe(e2, t2) {
|
|
|
2287
2305
|
return r2 < s2.length && i2.push(s2.substring(r2)), i2;
|
|
2288
2306
|
};
|
|
2289
2307
|
}
|
|
2290
|
-
const
|
|
2291
|
-
var
|
|
2292
|
-
const
|
|
2308
|
+
const Ne = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
2309
|
+
var _e = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(_e || {});
|
|
2310
|
+
const Pe = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
|
|
2293
2311
|
const t2 = [];
|
|
2294
2312
|
return 1 & e2 || t2.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/), 2 & e2 || t2.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/), 4 & e2 || t2.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/), new RegExp(t2.map((e3) => e3.source).join("|"), "g");
|
|
2295
|
-
}),
|
|
2296
|
-
function
|
|
2297
|
-
return
|
|
2313
|
+
}), Oe = { _: 1, "*": 4, "~": 2 };
|
|
2314
|
+
function Ue(e2) {
|
|
2315
|
+
return je(e2, 0);
|
|
2298
2316
|
}
|
|
2299
|
-
function
|
|
2300
|
-
const s2 =
|
|
2301
|
-
const t3 =
|
|
2317
|
+
function je(e2, t2 = 0) {
|
|
2318
|
+
const s2 = Pe[t2], n2 = s2 ? function(e3) {
|
|
2319
|
+
const t3 = $e.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${Ne}])(?:${e3.source})(?=[\\s${Ne}]|$)`, "g")), s3 = Re(t3, (e4) => {
|
|
2302
2320
|
const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
|
|
2303
|
-
return [" ", { type:
|
|
2321
|
+
return [" ", { type: _e[Oe[t4]], children: [s4] }];
|
|
2304
2322
|
});
|
|
2305
2323
|
return (e4) => {
|
|
2306
2324
|
const [t4, ...n3] = s3(" " + e4);
|
|
2307
2325
|
return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
|
|
2308
2326
|
};
|
|
2309
2327
|
}(s2) : () => [e2];
|
|
2310
|
-
return
|
|
2328
|
+
return Be(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? je(e3, t2 | _e[s3]) : [e3]);
|
|
2311
2329
|
}
|
|
2312
|
-
const
|
|
2330
|
+
const $e = function() {
|
|
2313
2331
|
const e2 = function() {
|
|
2314
2332
|
try {
|
|
2315
2333
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -2325,18 +2343,18 @@ const Ue = function() {
|
|
|
2325
2343
|
return e2.set(t2, n2), n2;
|
|
2326
2344
|
} };
|
|
2327
2345
|
}();
|
|
2328
|
-
function
|
|
2346
|
+
function We(e2, t2) {
|
|
2329
2347
|
if (Array.prototype.indexOf) return e2.indexOf(t2);
|
|
2330
2348
|
for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
|
|
2331
2349
|
return -1;
|
|
2332
2350
|
}
|
|
2333
|
-
function
|
|
2351
|
+
function qe(e2, t2) {
|
|
2334
2352
|
for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
|
|
2335
2353
|
}
|
|
2336
|
-
function
|
|
2354
|
+
function He(e2) {
|
|
2337
2355
|
throw new Error("Unhandled case for value: '" + e2 + "'");
|
|
2338
2356
|
}
|
|
2339
|
-
var
|
|
2357
|
+
var Ge = function() {
|
|
2340
2358
|
function e2(e3) {
|
|
2341
2359
|
void 0 === e3 && (e3 = {}), this.tagName = "", this.attrs = {}, this.innerHTML = "", this.whitespaceRegex = /\s+/, this.tagName = e3.tagName || "", this.attrs = e3.attrs || {}, this.innerHTML = e3.innerHtml || e3.innerHTML || "";
|
|
2342
2360
|
}
|
|
@@ -2355,11 +2373,11 @@ var qe = function() {
|
|
|
2355
2373
|
}, e2.prototype.setClass = function(e3) {
|
|
2356
2374
|
return this.setAttr("class", e3);
|
|
2357
2375
|
}, e2.prototype.addClass = function(e3) {
|
|
2358
|
-
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 ===
|
|
2376
|
+
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === We(r2, t2) && r2.push(t2);
|
|
2359
2377
|
return this.getAttrs().class = r2.join(" "), this;
|
|
2360
2378
|
}, e2.prototype.removeClass = function(e3) {
|
|
2361
2379
|
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); r2.length && (t2 = i2.shift()); ) {
|
|
2362
|
-
var a2 =
|
|
2380
|
+
var a2 = We(r2, t2);
|
|
2363
2381
|
-1 !== a2 && r2.splice(a2, 1);
|
|
2364
2382
|
}
|
|
2365
2383
|
return this.getAttrs().class = r2.join(" "), this;
|
|
@@ -2385,12 +2403,12 @@ var qe = function() {
|
|
|
2385
2403
|
return t2.join(" ");
|
|
2386
2404
|
}, e2;
|
|
2387
2405
|
}();
|
|
2388
|
-
var
|
|
2406
|
+
var Le = function() {
|
|
2389
2407
|
function e2(e3) {
|
|
2390
2408
|
void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
|
|
2391
2409
|
}
|
|
2392
2410
|
return e2.prototype.build = function(e3) {
|
|
2393
|
-
return new
|
|
2411
|
+
return new Ge({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
|
|
2394
2412
|
}, e2.prototype.createAttrs = function(e3) {
|
|
2395
2413
|
var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
|
|
2396
2414
|
return s2 && (t2.class = s2), this.newWindow && (t2.target = "_blank", t2.rel = "noopener noreferrer"), this.truncate && this.truncate.length && this.truncate.length < e3.getAnchorText().length && (t2.title = e3.getAnchorHref()), t2;
|
|
@@ -2460,7 +2478,7 @@ var He = function() {
|
|
|
2460
2478
|
}(e4, t3, s3);
|
|
2461
2479
|
}(e3, s2);
|
|
2462
2480
|
}, e2;
|
|
2463
|
-
}(),
|
|
2481
|
+
}(), ze = function() {
|
|
2464
2482
|
function e2(e3) {
|
|
2465
2483
|
this.__jsduckDummyDocProp = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
|
|
2466
2484
|
}
|
|
@@ -2475,30 +2493,30 @@ var He = function() {
|
|
|
2475
2493
|
}, e2.prototype.buildTag = function() {
|
|
2476
2494
|
return this.tagBuilder.build(this);
|
|
2477
2495
|
}, e2;
|
|
2478
|
-
}(),
|
|
2479
|
-
return
|
|
2496
|
+
}(), Je = function(e2, t2) {
|
|
2497
|
+
return Je = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
|
|
2480
2498
|
e3.__proto__ = t3;
|
|
2481
2499
|
} || function(e3, t3) {
|
|
2482
2500
|
for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
|
|
2483
|
-
},
|
|
2501
|
+
}, Je(e2, t2);
|
|
2484
2502
|
};
|
|
2485
|
-
function
|
|
2503
|
+
function Ye(e2, t2) {
|
|
2486
2504
|
function s2() {
|
|
2487
2505
|
this.constructor = e2;
|
|
2488
2506
|
}
|
|
2489
|
-
|
|
2507
|
+
Je(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
|
|
2490
2508
|
}
|
|
2491
|
-
var
|
|
2492
|
-
return
|
|
2509
|
+
var Qe, Ve = function() {
|
|
2510
|
+
return Ve = Object.assign || function(e2) {
|
|
2493
2511
|
for (var t2, s2 = 1, n2 = arguments.length; s2 < n2; s2++) for (var r2 in t2 = arguments[s2]) Object.prototype.hasOwnProperty.call(t2, r2) && (e2[r2] = t2[r2]);
|
|
2494
2512
|
return e2;
|
|
2495
|
-
},
|
|
2496
|
-
},
|
|
2513
|
+
}, Ve.apply(this, arguments);
|
|
2514
|
+
}, Ze = function(e2) {
|
|
2497
2515
|
function t2(t3) {
|
|
2498
2516
|
var s2 = e2.call(this, t3) || this;
|
|
2499
2517
|
return s2.email = "", s2.email = t3.email, s2;
|
|
2500
2518
|
}
|
|
2501
|
-
return
|
|
2519
|
+
return Ye(t2, e2), t2.prototype.getType = function() {
|
|
2502
2520
|
return "email";
|
|
2503
2521
|
}, t2.prototype.getEmail = function() {
|
|
2504
2522
|
return this.email;
|
|
@@ -2507,12 +2525,12 @@ var Je, Ye = function() {
|
|
|
2507
2525
|
}, t2.prototype.getAnchorText = function() {
|
|
2508
2526
|
return this.email;
|
|
2509
2527
|
}, t2;
|
|
2510
|
-
}(
|
|
2528
|
+
}(ze), Ke = function(e2) {
|
|
2511
2529
|
function t2(t3) {
|
|
2512
2530
|
var s2 = e2.call(this, t3) || this;
|
|
2513
2531
|
return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
|
|
2514
2532
|
}
|
|
2515
|
-
return
|
|
2533
|
+
return Ye(t2, e2), t2.prototype.getType = function() {
|
|
2516
2534
|
return "hashtag";
|
|
2517
2535
|
}, t2.prototype.getServiceName = function() {
|
|
2518
2536
|
return this.serviceName;
|
|
@@ -2533,12 +2551,12 @@ var Je, Ye = function() {
|
|
|
2533
2551
|
}, t2.prototype.getAnchorText = function() {
|
|
2534
2552
|
return "#" + this.hashtag;
|
|
2535
2553
|
}, t2;
|
|
2536
|
-
}(
|
|
2554
|
+
}(ze), Xe = function(e2) {
|
|
2537
2555
|
function t2(t3) {
|
|
2538
2556
|
var s2 = e2.call(this, t3) || this;
|
|
2539
2557
|
return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
|
|
2540
2558
|
}
|
|
2541
|
-
return
|
|
2559
|
+
return Ye(t2, e2), t2.prototype.getType = function() {
|
|
2542
2560
|
return "mention";
|
|
2543
2561
|
}, t2.prototype.getMention = function() {
|
|
2544
2562
|
return this.mention;
|
|
@@ -2561,12 +2579,12 @@ var Je, Ye = function() {
|
|
|
2561
2579
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2562
2580
|
return s2 && t3.push(s2), t3;
|
|
2563
2581
|
}, t2;
|
|
2564
|
-
}(
|
|
2582
|
+
}(ze), et = function(e2) {
|
|
2565
2583
|
function t2(t3) {
|
|
2566
2584
|
var s2 = e2.call(this, t3) || this;
|
|
2567
2585
|
return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
|
|
2568
2586
|
}
|
|
2569
|
-
return
|
|
2587
|
+
return Ye(t2, e2), t2.prototype.getType = function() {
|
|
2570
2588
|
return "phone";
|
|
2571
2589
|
}, t2.prototype.getPhoneNumber = function() {
|
|
2572
2590
|
return this.number;
|
|
@@ -2577,12 +2595,12 @@ var Je, Ye = function() {
|
|
|
2577
2595
|
}, t2.prototype.getAnchorText = function() {
|
|
2578
2596
|
return this.matchedText;
|
|
2579
2597
|
}, t2;
|
|
2580
|
-
}(
|
|
2598
|
+
}(ze), tt = function(e2) {
|
|
2581
2599
|
function t2(t3) {
|
|
2582
2600
|
var s2 = e2.call(this, t3) || this;
|
|
2583
2601
|
return s2.url = "", s2.urlMatchType = "scheme", s2.protocolUrlMatch = false, s2.protocolRelativeMatch = false, s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.schemePrefixRegex = /^(https?:\/\/)?/i, s2.wwwPrefixRegex = /^(https?:\/\/)?(www\.)?/i, s2.protocolRelativeRegex = /^\/\//, s2.protocolPrepended = false, s2.urlMatchType = t3.urlMatchType, s2.url = t3.url, s2.protocolUrlMatch = t3.protocolUrlMatch, s2.protocolRelativeMatch = t3.protocolRelativeMatch, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2584
2602
|
}
|
|
2585
|
-
return
|
|
2603
|
+
return Ye(t2, e2), t2.prototype.getType = function() {
|
|
2586
2604
|
return "url";
|
|
2587
2605
|
}, t2.prototype.getUrlMatchType = function() {
|
|
2588
2606
|
return this.urlMatchType;
|
|
@@ -2610,19 +2628,19 @@ var Je, Ye = function() {
|
|
|
2610
2628
|
return t3;
|
|
2611
2629
|
}
|
|
2612
2630
|
}, t2;
|
|
2613
|
-
}(
|
|
2631
|
+
}(ze), st = function(e2) {
|
|
2614
2632
|
this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
|
|
2615
|
-
},
|
|
2616
|
-
return "(?=(" +
|
|
2617
|
-
},
|
|
2618
|
-
return "(?:" +
|
|
2619
|
-
}, gt = new RegExp("[" + ht + "]"), vt = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, wt = new RegExp("[" + ht + "!#$%&'*+/=?^_`{|}~-]"), bt = new RegExp("^" + vt.source + "$"), yt = function(e2) {
|
|
2633
|
+
}, nt = /[A-Za-z]/, rt = /[\d]/, it = /[\D]/, at = /\s/, ot = /['"]/, ut = /[\x00-\x1F\x7F]/, ct = /A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source, lt = ct + /\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source + /\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source, ht = /0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source, dt = lt + ht, pt = lt + ht, ft = "(?:[" + ht + "]{1,3}\\.){3}[" + ht + "]{1,3}", mt = "[" + pt + "](?:[" + pt + "\\-]{0,61}[" + pt + "])?", gt = function(e2) {
|
|
2634
|
+
return "(?=(" + mt + "))\\" + e2;
|
|
2635
|
+
}, vt = function(e2) {
|
|
2636
|
+
return "(?:" + gt(e2) + "(?:\\." + gt(e2 + 1) + "){0,126}|" + ft + ")";
|
|
2637
|
+
}, wt = new RegExp("[" + pt + "]"), bt = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, yt = new RegExp("[" + pt + "!#$%&'*+/=?^_`{|}~-]"), Ct = new RegExp("^" + bt.source + "$"), At = function(e2) {
|
|
2620
2638
|
function t2() {
|
|
2621
2639
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2622
|
-
return t3.localPartCharRegex =
|
|
2640
|
+
return t3.localPartCharRegex = yt, t3.strictTldRegex = Ct, t3;
|
|
2623
2641
|
}
|
|
2624
|
-
return
|
|
2625
|
-
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new
|
|
2642
|
+
return Ye(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2643
|
+
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new Et(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
|
|
2626
2644
|
var h2 = e3.charAt(u2);
|
|
2627
2645
|
switch (c2) {
|
|
2628
2646
|
case 0:
|
|
@@ -2650,7 +2668,7 @@ var Je, Ye = function() {
|
|
|
2650
2668
|
b2(h2);
|
|
2651
2669
|
break;
|
|
2652
2670
|
default:
|
|
2653
|
-
|
|
2671
|
+
He(c2);
|
|
2654
2672
|
}
|
|
2655
2673
|
u2++;
|
|
2656
2674
|
}
|
|
@@ -2659,7 +2677,7 @@ var Je, Ye = function() {
|
|
|
2659
2677
|
"m" === e4 ? y2(1) : s2.test(e4) && y2();
|
|
2660
2678
|
}
|
|
2661
2679
|
function p2(e4, t4) {
|
|
2662
|
-
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new
|
|
2680
|
+
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new Et(Ve(Ve({}, l2), { hasMailtoPrefix: true }))) : C2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : C2());
|
|
2663
2681
|
}
|
|
2664
2682
|
function f2(e4) {
|
|
2665
2683
|
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || C2();
|
|
@@ -2668,19 +2686,19 @@ var Je, Ye = function() {
|
|
|
2668
2686
|
"." === e4 || "@" === e4 ? C2() : s2.test(e4) ? c2 = 2 : C2();
|
|
2669
2687
|
}
|
|
2670
2688
|
function g2(e4) {
|
|
2671
|
-
|
|
2689
|
+
wt.test(e4) ? c2 = 5 : C2();
|
|
2672
2690
|
}
|
|
2673
2691
|
function v2(e4) {
|
|
2674
|
-
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 :
|
|
2692
|
+
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : wt.test(e4) || A2();
|
|
2675
2693
|
}
|
|
2676
2694
|
function w2(e4) {
|
|
2677
|
-
"-" === e4 || "." === e4 ? A2() :
|
|
2695
|
+
"-" === e4 || "." === e4 ? A2() : wt.test(e4) ? c2 = 5 : A2();
|
|
2678
2696
|
}
|
|
2679
2697
|
function b2(e4) {
|
|
2680
|
-
"." === e4 || "-" === e4 ? A2() :
|
|
2698
|
+
"." === e4 || "-" === e4 ? A2() : wt.test(e4) ? (c2 = 5, l2 = new Et(Ve(Ve({}, l2), { hasDomainDot: true }))) : A2();
|
|
2681
2699
|
}
|
|
2682
2700
|
function y2(e4) {
|
|
2683
|
-
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new
|
|
2701
|
+
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new Et({ idx: u2 });
|
|
2684
2702
|
}
|
|
2685
2703
|
function C2() {
|
|
2686
2704
|
c2 = 0, l2 = a2;
|
|
@@ -2693,14 +2711,14 @@ var Je, Ye = function() {
|
|
|
2693
2711
|
(function(e4) {
|
|
2694
2712
|
var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
|
|
2695
2713
|
return n2.test(s4);
|
|
2696
|
-
})(i3) && r2.push(new
|
|
2714
|
+
})(i3) && r2.push(new Ze({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
|
|
2697
2715
|
}
|
|
2698
2716
|
C2();
|
|
2699
2717
|
}
|
|
2700
2718
|
}, t2;
|
|
2701
|
-
}(
|
|
2719
|
+
}(st), Et = function(e2) {
|
|
2702
2720
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
|
|
2703
|
-
},
|
|
2721
|
+
}, kt = function() {
|
|
2704
2722
|
function e2() {
|
|
2705
2723
|
}
|
|
2706
2724
|
return e2.isValid = function(e3, t2) {
|
|
@@ -2718,16 +2736,16 @@ var Je, Ye = function() {
|
|
|
2718
2736
|
return !(!e3 || t2 && this.hasFullProtocolRegex.test(t2) || -1 !== e3.indexOf("."));
|
|
2719
2737
|
}, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
|
|
2720
2738
|
return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
|
|
2721
|
-
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" +
|
|
2722
|
-
}(),
|
|
2739
|
+
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + ct + "]"), e2.ipRegex = /[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/, e2;
|
|
2740
|
+
}(), xt = (Qe = new RegExp("[/?#](?:[" + pt + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + pt + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, vt(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, vt(6), ")", "|", "(", "(//)?", vt(10) + "\\.", bt.source, "(?![-" + dt + "])", ")", ")", "(?::[0-9]+)?", "(?:" + Qe.source + ")?"].join(""), "gi")), It = new RegExp("[" + pt + "]"), Tt = function(e2) {
|
|
2723
2741
|
function t2(t3) {
|
|
2724
2742
|
var s2 = e2.call(this, t3) || this;
|
|
2725
|
-
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex =
|
|
2743
|
+
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = xt, s2.wordCharRegExp = It, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2726
2744
|
}
|
|
2727
|
-
return
|
|
2745
|
+
return Ye(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2728
2746
|
for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
|
|
2729
2747
|
var s3 = t3[0], u3 = t3[1], l2 = t3[4], h2 = t3[5], d2 = t3[9], p2 = t3.index, f2 = h2 || d2, m2 = e3.charAt(p2 - 1);
|
|
2730
|
-
if (!
|
|
2748
|
+
if (!kt.isValid(s3, u3)) return "continue";
|
|
2731
2749
|
if (p2 > 0 && "@" === m2) return "continue";
|
|
2732
2750
|
if (p2 > 0 && f2 && c2.wordCharRegExp.test(m2)) return "continue";
|
|
2733
2751
|
if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
|
|
@@ -2743,7 +2761,7 @@ var Je, Ye = function() {
|
|
|
2743
2761
|
s3 = s3.substr(w2), u3 = u3.substr(w2), p2 += w2;
|
|
2744
2762
|
}
|
|
2745
2763
|
var b2 = u3 ? "scheme" : l2 ? "www" : "tld", y2 = !!u3;
|
|
2746
|
-
o2.push(new
|
|
2764
|
+
o2.push(new tt({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: b2, url: s3, protocolUrlMatch: y2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
|
|
2747
2765
|
}, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
|
|
2748
2766
|
return o2;
|
|
2749
2767
|
}, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
|
|
@@ -2763,58 +2781,58 @@ var Je, Ye = function() {
|
|
|
2763
2781
|
if (!e3) return -1;
|
|
2764
2782
|
var s2 = 0;
|
|
2765
2783
|
t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
|
|
2766
|
-
var n2 = new RegExp("^((.?//)?[-." +
|
|
2784
|
+
var n2 = new RegExp("^((.?//)?[-." + pt + "]*[-" + pt + "]\\.[-" + pt + "]+)").exec(e3);
|
|
2767
2785
|
return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
|
|
2768
2786
|
}, t2;
|
|
2769
|
-
}(
|
|
2787
|
+
}(st), St = new RegExp("#[_" + pt + "]{1,139}(?![_" + pt + "])", "g"), Dt = new RegExp("[^" + pt + "]"), Mt = function(e2) {
|
|
2770
2788
|
function t2(t3) {
|
|
2771
2789
|
var s2 = e2.call(this, t3) || this;
|
|
2772
|
-
return s2.serviceName = "twitter", s2.matcherRegex =
|
|
2790
|
+
return s2.serviceName = "twitter", s2.matcherRegex = St, s2.nonWordCharRegex = Dt, s2.serviceName = t3.serviceName, s2;
|
|
2773
2791
|
}
|
|
2774
|
-
return
|
|
2792
|
+
return Ye(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2775
2793
|
for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2776
2794
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2777
2795
|
if (0 === o2 || n2.test(u2)) {
|
|
2778
2796
|
var c2 = t3[0], l2 = t3[0].slice(1);
|
|
2779
|
-
a2.push(new
|
|
2797
|
+
a2.push(new Ke({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
|
|
2780
2798
|
}
|
|
2781
2799
|
}
|
|
2782
2800
|
return a2;
|
|
2783
2801
|
}, t2;
|
|
2784
|
-
}(
|
|
2802
|
+
}(st), Ft = new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source + "|" + /(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source, "g"), Bt = function(e2) {
|
|
2785
2803
|
function t2() {
|
|
2786
2804
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2787
|
-
return t3.matcherRegex =
|
|
2805
|
+
return t3.matcherRegex = Ft, t3;
|
|
2788
2806
|
}
|
|
2789
|
-
return
|
|
2807
|
+
return Ye(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2790
2808
|
for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2791
2809
|
var i2 = t3[0], a2 = i2.replace(/[^0-9,;#]/g, ""), o2 = !(!t3[1] && !t3[2]), u2 = 0 == t3.index ? "" : e3.substr(t3.index - 1, 1), c2 = e3.substr(t3.index + i2.length, 1), l2 = !u2.match(/\d/) && !c2.match(/\d/);
|
|
2792
|
-
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new
|
|
2810
|
+
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new et({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
|
|
2793
2811
|
}
|
|
2794
2812
|
return r2;
|
|
2795
2813
|
}, t2.prototype.testMatch = function(e3) {
|
|
2796
|
-
return
|
|
2814
|
+
return it.test(e3);
|
|
2797
2815
|
}, t2;
|
|
2798
|
-
}(
|
|
2816
|
+
}(st), Rt = new RegExp("@[_" + pt + "]{1,50}(?![_" + pt + "])", "g"), Nt = new RegExp("@[_." + pt + "]{1,30}(?![_" + pt + "])", "g"), _t = new RegExp("@[-_." + pt + "]{1,50}(?![-_" + pt + "])", "g"), Pt = new RegExp("[^" + pt + "]"), Ot = function(e2) {
|
|
2799
2817
|
function t2(t3) {
|
|
2800
2818
|
var s2 = e2.call(this, t3) || this;
|
|
2801
|
-
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter:
|
|
2819
|
+
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: Rt, instagram: Nt, soundcloud: _t }, s2.nonWordCharRegex = Pt, s2.serviceName = t3.serviceName, s2;
|
|
2802
2820
|
}
|
|
2803
|
-
return
|
|
2821
|
+
return Ye(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2804
2822
|
var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
|
|
2805
2823
|
if (!n2) return a2;
|
|
2806
2824
|
for (; null !== (t3 = n2.exec(e3)); ) {
|
|
2807
2825
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2808
2826
|
if (0 === o2 || r2.test(u2)) {
|
|
2809
2827
|
var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
|
|
2810
|
-
a2.push(new
|
|
2828
|
+
a2.push(new Xe({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
|
|
2811
2829
|
}
|
|
2812
2830
|
}
|
|
2813
2831
|
return a2;
|
|
2814
2832
|
}, t2;
|
|
2815
|
-
}(
|
|
2816
|
-
function
|
|
2817
|
-
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new
|
|
2833
|
+
}(st);
|
|
2834
|
+
function Ut(e2, t2) {
|
|
2835
|
+
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new jt(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
|
|
2818
2836
|
var f2 = e2.charAt(c2);
|
|
2819
2837
|
switch (h2) {
|
|
2820
2838
|
case 0:
|
|
@@ -2851,10 +2869,10 @@ function Pt(e2, t2) {
|
|
|
2851
2869
|
x2(f2);
|
|
2852
2870
|
break;
|
|
2853
2871
|
case 11:
|
|
2854
|
-
|
|
2872
|
+
I2(f2);
|
|
2855
2873
|
break;
|
|
2856
2874
|
case 12:
|
|
2857
|
-
|
|
2875
|
+
T2(f2);
|
|
2858
2876
|
break;
|
|
2859
2877
|
case 13:
|
|
2860
2878
|
S2();
|
|
@@ -2872,16 +2890,16 @@ function Pt(e2, t2) {
|
|
|
2872
2890
|
B2(f2);
|
|
2873
2891
|
break;
|
|
2874
2892
|
case 18:
|
|
2875
|
-
|
|
2893
|
+
R2(f2);
|
|
2876
2894
|
break;
|
|
2877
2895
|
case 19:
|
|
2878
|
-
|
|
2896
|
+
N2(f2);
|
|
2879
2897
|
break;
|
|
2880
2898
|
case 20:
|
|
2881
2899
|
_2(f2);
|
|
2882
2900
|
break;
|
|
2883
2901
|
default:
|
|
2884
|
-
|
|
2902
|
+
He(h2);
|
|
2885
2903
|
}
|
|
2886
2904
|
c2++;
|
|
2887
2905
|
}
|
|
@@ -2889,25 +2907,25 @@ function Pt(e2, t2) {
|
|
|
2889
2907
|
"<" === e3 && O2();
|
|
2890
2908
|
}
|
|
2891
2909
|
function g2(e3) {
|
|
2892
|
-
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new
|
|
2910
|
+
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new jt(Ve(Ve({}, p2), { isClosing: true }))) : "<" === e3 ? O2() : nt.test(e3) ? (h2 = 3, p2 = new jt(Ve(Ve({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
|
|
2893
2911
|
}
|
|
2894
2912
|
function v2(e3) {
|
|
2895
|
-
|
|
2913
|
+
at.test(e3) ? (p2 = new jt(Ve(Ve({}, p2), { name: j2() })), h2 = 4) : "<" === e3 ? O2() : "/" === e3 ? (p2 = new jt(Ve(Ve({}, p2), { name: j2() })), h2 = 12) : ">" === e3 ? (p2 = new jt(Ve(Ve({}, p2), { name: j2() })), U2()) : nt.test(e3) || rt.test(e3) || ":" === e3 || P2();
|
|
2896
2914
|
}
|
|
2897
2915
|
function w2(e3) {
|
|
2898
|
-
">" === e3 ? P2() :
|
|
2916
|
+
">" === e3 ? P2() : nt.test(e3) ? h2 = 3 : P2();
|
|
2899
2917
|
}
|
|
2900
2918
|
function b2(e3) {
|
|
2901
|
-
|
|
2919
|
+
at.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : "=" === e3 || ot.test(e3) || ut.test(e3) ? P2() : h2 = 5);
|
|
2902
2920
|
}
|
|
2903
2921
|
function y2(e3) {
|
|
2904
|
-
|
|
2922
|
+
at.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? O2() : ot.test(e3) && P2();
|
|
2905
2923
|
}
|
|
2906
2924
|
function C2(e3) {
|
|
2907
|
-
|
|
2925
|
+
at.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? O2() : ot.test(e3) ? P2() : h2 = 5);
|
|
2908
2926
|
}
|
|
2909
2927
|
function A2(e3) {
|
|
2910
|
-
|
|
2928
|
+
at.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? P2() : "<" === e3 ? O2() : h2 = 10);
|
|
2911
2929
|
}
|
|
2912
2930
|
function E2(e3) {
|
|
2913
2931
|
'"' === e3 && (h2 = 11);
|
|
@@ -2916,16 +2934,16 @@ function Pt(e2, t2) {
|
|
|
2916
2934
|
"'" === e3 && (h2 = 11);
|
|
2917
2935
|
}
|
|
2918
2936
|
function x2(e3) {
|
|
2919
|
-
|
|
2920
|
-
}
|
|
2921
|
-
function T2(e3) {
|
|
2922
|
-
rt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : (h2 = 4, c2--);
|
|
2937
|
+
at.test(e3) ? h2 = 4 : ">" === e3 ? U2() : "<" === e3 && O2();
|
|
2923
2938
|
}
|
|
2924
2939
|
function I2(e3) {
|
|
2925
|
-
"
|
|
2940
|
+
at.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : (h2 = 4, c2--);
|
|
2941
|
+
}
|
|
2942
|
+
function T2(e3) {
|
|
2943
|
+
">" === e3 ? (p2 = new jt(Ve(Ve({}, p2), { isClosing: true })), U2()) : h2 = 4;
|
|
2926
2944
|
}
|
|
2927
2945
|
function S2(t3) {
|
|
2928
|
-
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new
|
|
2946
|
+
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new jt(Ve(Ve({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new jt(Ve(Ve({}, p2), { type: "doctype" })), h2 = 20) : P2();
|
|
2929
2947
|
}
|
|
2930
2948
|
function D2(e3) {
|
|
2931
2949
|
"-" === e3 ? h2 = 15 : ">" === e3 ? P2() : h2 = 16;
|
|
@@ -2939,10 +2957,10 @@ function Pt(e2, t2) {
|
|
|
2939
2957
|
function B2(e3) {
|
|
2940
2958
|
h2 = "-" === e3 ? 18 : 16;
|
|
2941
2959
|
}
|
|
2942
|
-
function
|
|
2960
|
+
function R2(e3) {
|
|
2943
2961
|
">" === e3 ? U2() : "!" === e3 ? h2 = 19 : "-" === e3 || (h2 = 16);
|
|
2944
2962
|
}
|
|
2945
|
-
function
|
|
2963
|
+
function N2(e3) {
|
|
2946
2964
|
"-" === e3 ? h2 = 17 : ">" === e3 ? U2() : h2 = 16;
|
|
2947
2965
|
}
|
|
2948
2966
|
function _2(e3) {
|
|
@@ -2952,7 +2970,7 @@ function Pt(e2, t2) {
|
|
|
2952
2970
|
h2 = 0, p2 = u2;
|
|
2953
2971
|
}
|
|
2954
2972
|
function O2() {
|
|
2955
|
-
h2 = 1, p2 = new
|
|
2973
|
+
h2 = 1, p2 = new jt({ idx: c2 });
|
|
2956
2974
|
}
|
|
2957
2975
|
function U2() {
|
|
2958
2976
|
var t3 = e2.slice(d2, p2.idx);
|
|
@@ -2964,9 +2982,9 @@ function Pt(e2, t2) {
|
|
|
2964
2982
|
}
|
|
2965
2983
|
d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
|
|
2966
2984
|
}
|
|
2967
|
-
var
|
|
2985
|
+
var jt = function(e2) {
|
|
2968
2986
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.type = e2.type || "tag", this.name = e2.name || "", this.isOpening = !!e2.isOpening, this.isClosing = !!e2.isClosing;
|
|
2969
|
-
},
|
|
2987
|
+
}, $t = function() {
|
|
2970
2988
|
function e2(t2) {
|
|
2971
2989
|
void 0 === t2 && (t2 = {}), this.version = e2.version, this.urls = {}, this.email = true, this.phone = true, this.hashtag = false, this.mention = false, this.newWindow = true, this.stripPrefix = { scheme: true, www: true }, this.stripTrailingSlash = true, this.decodePercentEncoding = true, this.truncate = { length: 0, location: "end" }, this.className = "", this.replaceFn = null, this.context = void 0, this.sanitizeHtml = false, this.matchers = null, this.tagBuilder = null, this.urls = this.normalizeUrlsCfg(t2.urls), this.email = "boolean" == typeof t2.email ? t2.email : this.email, this.phone = "boolean" == typeof t2.phone ? t2.phone : this.phone, this.hashtag = t2.hashtag || this.hashtag, this.mention = t2.mention || this.mention, this.newWindow = "boolean" == typeof t2.newWindow ? t2.newWindow : this.newWindow, this.stripPrefix = this.normalizeStripPrefixCfg(t2.stripPrefix), this.stripTrailingSlash = "boolean" == typeof t2.stripTrailingSlash ? t2.stripTrailingSlash : this.stripTrailingSlash, this.decodePercentEncoding = "boolean" == typeof t2.decodePercentEncoding ? t2.decodePercentEncoding : this.decodePercentEncoding, this.sanitizeHtml = t2.sanitizeHtml || false;
|
|
2972
2990
|
var s2 = this.mention;
|
|
@@ -2990,7 +3008,7 @@ var Ot = function(e2) {
|
|
|
2990
3008
|
}(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
|
|
2991
3009
|
}, e2.prototype.parse = function(e3) {
|
|
2992
3010
|
var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
|
|
2993
|
-
return
|
|
3011
|
+
return Ut(e3, { onOpenTag: function(e4) {
|
|
2994
3012
|
s2.indexOf(e4) >= 0 && n2++;
|
|
2995
3013
|
}, onText: function(e4, s3) {
|
|
2996
3014
|
if (0 === n2) {
|
|
@@ -3029,19 +3047,19 @@ var Ot = function(e2) {
|
|
|
3029
3047
|
}
|
|
3030
3048
|
return e3;
|
|
3031
3049
|
}, e2.prototype.removeUnwantedMatches = function(e3) {
|
|
3032
|
-
return this.hashtag ||
|
|
3050
|
+
return this.hashtag || qe(e3, function(e4) {
|
|
3033
3051
|
return "hashtag" === e4.getType();
|
|
3034
|
-
}), this.email ||
|
|
3052
|
+
}), this.email || qe(e3, function(e4) {
|
|
3035
3053
|
return "email" === e4.getType();
|
|
3036
|
-
}), this.phone ||
|
|
3054
|
+
}), this.phone || qe(e3, function(e4) {
|
|
3037
3055
|
return "phone" === e4.getType();
|
|
3038
|
-
}), this.mention ||
|
|
3056
|
+
}), this.mention || qe(e3, function(e4) {
|
|
3039
3057
|
return "mention" === e4.getType();
|
|
3040
|
-
}), this.urls.schemeMatches ||
|
|
3058
|
+
}), this.urls.schemeMatches || qe(e3, function(e4) {
|
|
3041
3059
|
return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
|
|
3042
|
-
}), this.urls.wwwMatches ||
|
|
3060
|
+
}), this.urls.wwwMatches || qe(e3, function(e4) {
|
|
3043
3061
|
return "url" === e4.getType() && "www" === e4.getUrlMatchType();
|
|
3044
|
-
}), this.urls.tldMatches ||
|
|
3062
|
+
}), this.urls.tldMatches || qe(e3, function(e4) {
|
|
3045
3063
|
return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
|
|
3046
3064
|
}), e3;
|
|
3047
3065
|
}, e2.prototype.parseText = function(e3, t2) {
|
|
@@ -3061,99 +3079,122 @@ var Ot = function(e2) {
|
|
|
3061
3079
|
return s2.push(e3.substring(n2)), s2.join("");
|
|
3062
3080
|
}, e2.prototype.createMatchReturnVal = function(e3) {
|
|
3063
3081
|
var t2;
|
|
3064
|
-
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof
|
|
3082
|
+
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof Ge ? t2.toAnchorString() : e3.buildTag().toAnchorString();
|
|
3065
3083
|
}, e2.prototype.getMatchers = function() {
|
|
3066
3084
|
if (this.matchers) return this.matchers;
|
|
3067
|
-
var e3 = this.getTagBuilder(), t2 = [new
|
|
3085
|
+
var e3 = this.getTagBuilder(), t2 = [new Mt({ tagBuilder: e3, serviceName: this.hashtag }), new At({ tagBuilder: e3 }), new Bt({ tagBuilder: e3 }), new Ot({ tagBuilder: e3, serviceName: this.mention }), new Tt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
|
|
3068
3086
|
return this.matchers = t2;
|
|
3069
3087
|
}, e2.prototype.getTagBuilder = function() {
|
|
3070
3088
|
var e3 = this.tagBuilder;
|
|
3071
|
-
return e3 || (e3 = this.tagBuilder = new
|
|
3072
|
-
}, e2.version = "3.14.3", e2.AnchorTagBuilder =
|
|
3089
|
+
return e3 || (e3 = this.tagBuilder = new Le({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
|
|
3090
|
+
}, e2.version = "3.14.3", e2.AnchorTagBuilder = Le, e2.HtmlTag = Ge, e2.matcher = { Email: At, Hashtag: Mt, Matcher: st, Mention: Ot, Phone: Bt, Url: Tt }, e2.match = { Email: Ze, Hashtag: Ke, Match: ze, Mention: Xe, Phone: et, Url: tt }, e2;
|
|
3073
3091
|
}();
|
|
3074
|
-
function
|
|
3092
|
+
function Wt(e2, t2 = e2) {
|
|
3075
3093
|
return { type: "autolink", url: e2, text: t2 };
|
|
3076
3094
|
}
|
|
3077
|
-
const
|
|
3095
|
+
const qt = Re(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
3078
3096
|
return { type: "mention", id: e3, text: t3 };
|
|
3079
|
-
}(decodeURIComponent(t2), s2)),
|
|
3097
|
+
}(decodeURIComponent(t2), s2)), Ht = Re(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
|
|
3080
3098
|
return { type: "customemoji", text: e3 };
|
|
3081
|
-
}(t2)),
|
|
3099
|
+
}(t2)), Gt = Re(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
|
|
3082
3100
|
return { type: "link", url: e3, children: t3 };
|
|
3083
|
-
}(t2, [s2])),
|
|
3084
|
-
const { action: n2, params: r2 } =
|
|
3101
|
+
}(t2, [s2])), Lt = Re(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3102
|
+
const { action: n2, params: r2 } = Jt(t2);
|
|
3085
3103
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
3086
3104
|
return { type: "actionlink", action: e3, params: t3, children: s3 };
|
|
3087
3105
|
}(n2, r2, [s2]);
|
|
3088
|
-
}),
|
|
3089
|
-
const { action: n2, params: r2 } =
|
|
3106
|
+
}), zt = Re(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3107
|
+
const { action: n2, params: r2 } = Jt(t2);
|
|
3090
3108
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
3091
3109
|
return { type: "actionbutton", action: e3, params: t3, children: s3 };
|
|
3092
3110
|
}(n2, r2, [s2]);
|
|
3093
3111
|
});
|
|
3094
|
-
function
|
|
3112
|
+
function Jt(e2) {
|
|
3095
3113
|
const t2 = e2.indexOf("?");
|
|
3096
3114
|
if (-1 === t2) return { action: e2, params: {} };
|
|
3097
3115
|
return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
|
|
3098
3116
|
}
|
|
3099
|
-
const
|
|
3117
|
+
const Yt = Re(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
|
|
3100
3118
|
return { type: "bulletlist", children: e3 };
|
|
3101
|
-
}([e2.startsWith("\n") ? e2.slice(1) : e2])),
|
|
3119
|
+
}([e2.startsWith("\n") ? e2.slice(1) : e2])), Qt = Re(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), Vt = (e2) => {
|
|
3102
3120
|
const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
|
|
3103
3121
|
let s2 = 0;
|
|
3104
3122
|
const n2 = [];
|
|
3105
3123
|
for (const r2 of J(e2, t2)) {
|
|
3106
3124
|
const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
|
|
3107
3125
|
a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
|
|
3108
|
-
const o2 =
|
|
3126
|
+
const o2 = Wt("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
|
|
3109
3127
|
n2.push(o2), s2 = a2 + i2.length;
|
|
3110
3128
|
}
|
|
3111
3129
|
return s2 < e2.length && n2.push(e2.substring(s2)), n2;
|
|
3112
|
-
},
|
|
3113
|
-
const t2 =
|
|
3130
|
+
}, Zt = (e2) => Gt(e2).flatMap((e3) => "string" == typeof e3 ? Kt(e3) : ["<", ...Kt(e3.url), ...Kt("|" + e3.children[0] + ">")]), Kt = (e2) => {
|
|
3131
|
+
const t2 = $t.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
|
|
3114
3132
|
let n2 = 0;
|
|
3115
3133
|
for (const r2 of t2) {
|
|
3116
3134
|
const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
|
|
3117
3135
|
let o2 = i2;
|
|
3118
|
-
r2 instanceof
|
|
3136
|
+
r2 instanceof Ze ? o2 = "mailto:" + r2.getEmail() : r2 instanceof tt && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Wt(o2, i2)), n2 = t3 + a2;
|
|
3119
3137
|
}
|
|
3120
3138
|
return n2 < e2.length && s2.push(e2.substring(n2)), s2;
|
|
3121
|
-
},
|
|
3122
|
-
function
|
|
3139
|
+
}, Xt = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
|
|
3140
|
+
function es(e2 = { except: [] }) {
|
|
3123
3141
|
var _a2;
|
|
3124
|
-
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 :
|
|
3125
|
-
return s2.includes("BulletPoint") || t2.multilineSteps.push(
|
|
3142
|
+
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : Xt.filter((t3) => !e2.only.includes(t3));
|
|
3143
|
+
return s2.includes("BulletPoint") || t2.multilineSteps.push(Yt, Qt), s2.includes("Mention") || t2.singlelineSteps.push(qt), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Ht), s2.includes("Codespan") || t2.multilineSteps.push(Re(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3 }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Gt), s2.includes("Actions") || (t2.singlelineSteps.push(Lt), t2.singlelineSteps.push(zt)), s2.includes("Wikitext") || t2.singlelineSteps.push(Ue), s2.includes("Autolink") || t2.singlelineSteps.push(Zt, Vt), t2;
|
|
3126
3144
|
}
|
|
3127
|
-
const
|
|
3145
|
+
const ts = function(e2) {
|
|
3128
3146
|
const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
|
|
3129
3147
|
return (e3) => Array.from(e3.match(t2) || []);
|
|
3130
3148
|
}("\n");
|
|
3131
|
-
function
|
|
3149
|
+
function ss(e2, t2 = { except: [] }) {
|
|
3132
3150
|
let s2 = function(e3, t3) {
|
|
3133
3151
|
let s3 = [e3];
|
|
3134
|
-
return s3 =
|
|
3135
|
-
}(e2,
|
|
3136
|
-
return s2 =
|
|
3152
|
+
return s3 = ns(s3, t3.multilineSteps), s3 = ns(s3, [ts]), s3 = ns(s3, t3.singlelineSteps), s3 = rs(s3), s3;
|
|
3153
|
+
}(e2, es(t2));
|
|
3154
|
+
return s2 = is(s2, false), s2;
|
|
3137
3155
|
}
|
|
3138
|
-
function
|
|
3139
|
-
return t2.reduce((e3, t3) =>
|
|
3156
|
+
function ns(e2, t2) {
|
|
3157
|
+
return t2.reduce((e3, t3) => Be(e3, t3), e2);
|
|
3140
3158
|
}
|
|
3141
|
-
function
|
|
3159
|
+
function rs(e2) {
|
|
3142
3160
|
const t2 = [];
|
|
3143
3161
|
let s2 = -1;
|
|
3144
|
-
for (const n2 of e2) "string" == typeof n2 ? "string" == typeof t2[s2] ? t2[s2] += n2 : t2[++s2] = n2 : t2[++s2] = "children" in n2 ? __spreadProps(__spreadValues({}, n2), { children:
|
|
3162
|
+
for (const n2 of e2) "string" == typeof n2 ? "string" == typeof t2[s2] ? t2[s2] += n2 : t2[++s2] = n2 : t2[++s2] = "children" in n2 ? __spreadProps(__spreadValues({}, n2), { children: rs(n2.children) }) : n2;
|
|
3145
3163
|
return t2;
|
|
3146
3164
|
}
|
|
3147
|
-
function
|
|
3165
|
+
function is(e2, t2) {
|
|
3148
3166
|
const s2 = [];
|
|
3149
3167
|
let n2 = [];
|
|
3150
3168
|
for (let r2 = 0; r2 < e2.length; r2++) {
|
|
3151
3169
|
const i2 = e2[r2];
|
|
3152
|
-
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children =
|
|
3170
|
+
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children = is(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type), s2.push(i2)) : "autolink" === i2.type && t2 ? n2.push(i2.text) : (n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2.push(i2));
|
|
3153
3171
|
}
|
|
3154
3172
|
return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
|
|
3155
3173
|
}
|
|
3156
|
-
class
|
|
3174
|
+
class as {
|
|
3175
|
+
constructor(e2, t2, s2, n2) {
|
|
3176
|
+
this.emoji = e2, this.messageId = t2, this.conversationId = s2, this._realtimeClient = n2;
|
|
3177
|
+
}
|
|
3178
|
+
get brandedMessageId() {
|
|
3179
|
+
return this.messageId;
|
|
3180
|
+
}
|
|
3181
|
+
get brandedConversationId() {
|
|
3182
|
+
return this.conversationId;
|
|
3183
|
+
}
|
|
3184
|
+
add() {
|
|
3185
|
+
return __async(this, null, function* () {
|
|
3186
|
+
const t2 = yield this._realtimeClient.call("PUT", ["conversations", this.brandedConversationId, "messages", this.brandedMessageId, "reactions", this.emoji, this._realtimeClient.userId], {});
|
|
3187
|
+
e(`Add ${this.emoji} reaction on message ${this.messageId} in conversation ${this.conversationId}`, t2);
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3190
|
+
remove() {
|
|
3191
|
+
return __async(this, null, function* () {
|
|
3192
|
+
const t2 = yield this._realtimeClient.call("DELETE", ["conversations", this.brandedConversationId, "messages", this.brandedMessageId, "reactions", this.emoji, this._realtimeClient.userId], {});
|
|
3193
|
+
(t2.ok || "server" !== t2.where || 404 !== t2.value.status) && e(`Remove ${this.emoji} reaction from message ${this.messageId} in conversation ${this.conversationId}`, t2);
|
|
3194
|
+
});
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
class os {
|
|
3157
3198
|
constructor(e2, t2, s2) {
|
|
3158
3199
|
this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
3159
3200
|
}
|
|
@@ -3163,18 +3204,23 @@ class rs {
|
|
|
3163
3204
|
get brandedConversationId() {
|
|
3164
3205
|
return this.conversationId;
|
|
3165
3206
|
}
|
|
3207
|
+
reaction(e2) {
|
|
3208
|
+
if ("string" != typeof e2) throw new Error(`Creating ReactionRef failed because emoji "${e2}" is not a string`);
|
|
3209
|
+
if ("" === e2) throw new Error(`Creating ReactionRef failed because emoji "${e2}" is an empty string`);
|
|
3210
|
+
return new as(e2, this.brandedId, this.brandedConversationId, this._realtimeClient);
|
|
3211
|
+
}
|
|
3166
3212
|
get() {
|
|
3167
3213
|
return __async(this, null, function* () {
|
|
3168
3214
|
const t2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedConversationId, "messages", this.brandedId], {});
|
|
3169
3215
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
|
|
3170
3216
|
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
|
|
3171
3217
|
const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.createMessageSnapshot(s2, this.brandedConversationId);
|
|
3172
|
-
return
|
|
3218
|
+
return Se("Get message " + this.id, n2);
|
|
3173
3219
|
});
|
|
3174
3220
|
}
|
|
3175
3221
|
edit(t2) {
|
|
3176
3222
|
return __async(this, null, function* () {
|
|
3177
|
-
const s2 = { content:
|
|
3223
|
+
const s2 = { content: us(t2), custom: "string" == typeof t2 ? void 0 : t2.custom }, n2 = yield this._realtimeClient.call("PATCH", ["conversations", this.brandedConversationId, "messages", this.brandedId], s2);
|
|
3178
3224
|
e(`Edit message ${this.id} in conversation ${this.conversationId}`, n2);
|
|
3179
3225
|
});
|
|
3180
3226
|
}
|
|
@@ -3185,16 +3231,16 @@ class rs {
|
|
|
3185
3231
|
});
|
|
3186
3232
|
}
|
|
3187
3233
|
}
|
|
3188
|
-
function
|
|
3234
|
+
function us(e2) {
|
|
3189
3235
|
if ("string" == typeof e2) {
|
|
3190
|
-
return [{ type: "text", children:
|
|
3236
|
+
return [{ type: "text", children: ss(e2) }];
|
|
3191
3237
|
}
|
|
3192
3238
|
if ("text" in e2 && e2.text) {
|
|
3193
|
-
return [{ type: "text", children:
|
|
3239
|
+
return [{ type: "text", children: ss(e2.text) }];
|
|
3194
3240
|
}
|
|
3195
3241
|
if ("content" in e2 && e2.content) return e2.content;
|
|
3196
3242
|
}
|
|
3197
|
-
class
|
|
3243
|
+
class cs {
|
|
3198
3244
|
constructor(e2, t2) {
|
|
3199
3245
|
this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
|
|
3200
3246
|
}
|
|
@@ -3205,16 +3251,23 @@ class as {
|
|
|
3205
3251
|
return this._realtimeClient.userId;
|
|
3206
3252
|
}
|
|
3207
3253
|
participant(e2) {
|
|
3208
|
-
|
|
3254
|
+
if ("string" == typeof e2) {
|
|
3255
|
+
if ("" === e2) throw new Error(`Creating ParticipantRef failed because ID "${e2}" is an empty string`);
|
|
3256
|
+
return new Me(e2, this.id, this._realtimeClient);
|
|
3257
|
+
}
|
|
3258
|
+
if ("brandedId" in e2) return new Me(e2.id, this.id, this._realtimeClient);
|
|
3259
|
+
throw new Error(`Creating ParticipantRef failed because user "${e2}" is not a string or a UserRef`);
|
|
3209
3260
|
}
|
|
3210
3261
|
message(e2) {
|
|
3211
|
-
|
|
3262
|
+
if ("string" != typeof e2) throw new Error(`Creating MessageRef failed because ID "${e2}" is not a string`);
|
|
3263
|
+
if ("" === e2) throw new Error(`Creating MessageRef failed because ID "${e2}" is an empty string`);
|
|
3264
|
+
return new os(e2, this.brandedId, this._realtimeClient);
|
|
3212
3265
|
}
|
|
3213
3266
|
get() {
|
|
3214
3267
|
return __async(this, null, function* () {
|
|
3215
3268
|
const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
|
|
3216
3269
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
|
|
3217
|
-
const n2 = e("Get conversation " + this.id, s2), r2 =
|
|
3270
|
+
const n2 = e("Get conversation " + this.id, s2), r2 = Se("Get last message in conversation " + this.id, yield t2), i2 = 0 === r2.length ? null : r2[0];
|
|
3218
3271
|
return this._realtimeClient.createConversationSnapshotPreloaded(n2, i2);
|
|
3219
3272
|
});
|
|
3220
3273
|
}
|
|
@@ -3257,8 +3310,8 @@ class as {
|
|
|
3257
3310
|
}
|
|
3258
3311
|
send(t2) {
|
|
3259
3312
|
return __async(this, null, function* () {
|
|
3260
|
-
const s2 = { content:
|
|
3261
|
-
return new
|
|
3313
|
+
const s2 = { content: ls(t2), referencedMessageId: hs(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: Fe((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
|
|
3314
|
+
return new os(r2.id, this.brandedId, this._realtimeClient);
|
|
3262
3315
|
});
|
|
3263
3316
|
}
|
|
3264
3317
|
subscribeMessages(e2) {
|
|
@@ -3280,21 +3333,21 @@ class as {
|
|
|
3280
3333
|
});
|
|
3281
3334
|
}
|
|
3282
3335
|
}
|
|
3283
|
-
function
|
|
3336
|
+
function ls(e2) {
|
|
3284
3337
|
if ("string" == typeof e2) {
|
|
3285
|
-
return [{ type: "text", children:
|
|
3338
|
+
return [{ type: "text", children: ss(e2, { except: ["FormattedLink", "Actions"] }) }];
|
|
3286
3339
|
}
|
|
3287
3340
|
if ("text" in e2) {
|
|
3288
|
-
return [{ type: "text", children:
|
|
3341
|
+
return [{ type: "text", children: ss(e2.text, { except: ["FormattedLink", "Actions"] }) }];
|
|
3289
3342
|
}
|
|
3290
3343
|
return e2.content;
|
|
3291
3344
|
}
|
|
3292
|
-
function
|
|
3345
|
+
function hs(e2) {
|
|
3293
3346
|
if ("string" == typeof e2) return;
|
|
3294
3347
|
const t2 = e2.referencedMessage;
|
|
3295
3348
|
return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
|
|
3296
3349
|
}
|
|
3297
|
-
class
|
|
3350
|
+
class ds {
|
|
3298
3351
|
constructor(e2, t2, s2) {
|
|
3299
3352
|
this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
|
|
3300
3353
|
}
|
|
@@ -3306,23 +3359,23 @@ class cs {
|
|
|
3306
3359
|
return this.realtimeWsApiUrl + `/${e2}/realtime/${i2}?talkjs-client-build=${r2 != null ? r2 : "standalone"}&talkjs-core=${s2}&talkjs-client-id=${n2}`;
|
|
3307
3360
|
}
|
|
3308
3361
|
static fromHost(e2) {
|
|
3309
|
-
const t2 = new
|
|
3362
|
+
const t2 = new ds("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
|
|
3310
3363
|
if (!e2) return t2;
|
|
3311
3364
|
if (e2.endsWith("talkjs.com")) {
|
|
3312
3365
|
const s2 = e2.match(/\w+-(\w+)\.talkjs\.com/);
|
|
3313
3366
|
if (s2) {
|
|
3314
3367
|
const e3 = s2[1];
|
|
3315
|
-
return new
|
|
3368
|
+
return new ds(`wss://realtime-${e3}.talkjs.com/v1`, `https://app-${e3}.talkjs.com/api/v0`, `https://api-${e3}.talkjs.com/v1`);
|
|
3316
3369
|
}
|
|
3317
3370
|
return t2;
|
|
3318
3371
|
}
|
|
3319
|
-
return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new
|
|
3372
|
+
return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new ds(`ws://${e2}/public_api/v1`, `http://${e2}/api/v0`, `http://${e2}/public_api/v1`) : new ds(`wss://${e2}/public_api/v1`, `https://${e2}/api/v0`, `https://${e2}/public_api/v1`);
|
|
3320
3373
|
}
|
|
3321
3374
|
}
|
|
3322
|
-
function
|
|
3375
|
+
function ps({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2 }) {
|
|
3323
3376
|
var _a2;
|
|
3324
3377
|
(!r2 || r2 <= 0) && (r2 = 1);
|
|
3325
|
-
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-
|
|
3378
|
+
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-08-22T14:45:07.259Z" };
|
|
3326
3379
|
s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
3327
3380
|
return a(r2, () => __async(this, null, function* () {
|
|
3328
3381
|
if (o2) {
|
|
@@ -3334,19 +3387,19 @@ function ls({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
|
|
|
3334
3387
|
throw e3;
|
|
3335
3388
|
});
|
|
3336
3389
|
}), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
|
|
3337
|
-
return o2 && 401 === s3.status ? (
|
|
3390
|
+
return o2 && 401 === s3.status ? (Cs.log(`401 error from ${e2} ${t2}, ${yield o2.getToken()}`), o2.refreshToken(), true) : i2 ? i2(s3) : !("status" in s3 && s3.status >= 400 && s3.status < 500);
|
|
3338
3391
|
}) }).catch((s3) => {
|
|
3339
3392
|
if (Math.random() < 0.1 && !t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
3340
3393
|
const n3 = `Network Error for ${e2} ${t2}`;
|
|
3341
3394
|
if ("undefined" != typeof window) if (s3 instanceof Response) {
|
|
3342
|
-
s3.clone().text().then((e3) =>
|
|
3343
|
-
} else
|
|
3395
|
+
s3.clone().text().then((e3) => Cs.log(`${n3} ${s3.status} ${e3} (10% logged)`));
|
|
3396
|
+
} else Cs.log(`${n3} ${s3} (10% logged)`);
|
|
3344
3397
|
console.error("[TalkJS]", n3);
|
|
3345
3398
|
}
|
|
3346
3399
|
throw s3;
|
|
3347
3400
|
});
|
|
3348
3401
|
}
|
|
3349
|
-
const { cdnHost:
|
|
3402
|
+
const { cdnHost: fs, appHost: ms, restHost: gs, realtimeHost: vs, appProtocol: ws, appWsProtocol: bs } = function() {
|
|
3350
3403
|
if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
|
|
3351
3404
|
const e2 = function() {
|
|
3352
3405
|
if (document.currentScript) return document.currentScript.src;
|
|
@@ -3371,11 +3424,11 @@ const { cdnHost: hs, appHost: ds, restHost: ps, realtimeHost: fs, appProtocol: m
|
|
|
3371
3424
|
}(n2), a2 = t2.protocol;
|
|
3372
3425
|
return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
|
|
3373
3426
|
}();
|
|
3374
|
-
const
|
|
3375
|
-
const
|
|
3427
|
+
const ys = ms.startsWith("app.talkjs.com");
|
|
3428
|
+
const Cs = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
3376
3429
|
} } : new class {
|
|
3377
3430
|
constructor(e2) {
|
|
3378
|
-
this._timeCreated = Date.now(), this._enabled =
|
|
3431
|
+
this._timeCreated = Date.now(), this._enabled = ys, this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-08-22T14:45:07.259Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: window.location.href, referrer: document.referrer, userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: window.location.href, stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2025-08-22T14:45:07.259Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
3379
3432
|
}
|
|
3380
3433
|
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
3381
3434
|
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
@@ -3385,14 +3438,14 @@ const ws = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setD
|
|
|
3385
3438
|
try {
|
|
3386
3439
|
if (!this._enabled) return Promise.resolve();
|
|
3387
3440
|
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
3388
|
-
yield
|
|
3441
|
+
yield ps({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
3389
3442
|
} catch (e3) {
|
|
3390
3443
|
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
3391
3444
|
}
|
|
3392
3445
|
});
|
|
3393
3446
|
}
|
|
3394
3447
|
}("970cd0be0fb74630b75c8451051299dc");
|
|
3395
|
-
class
|
|
3448
|
+
class As {
|
|
3396
3449
|
constructor(e2, t2 = {}) {
|
|
3397
3450
|
this._onSubscription = t2, this._handlers = {};
|
|
3398
3451
|
for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
|
|
@@ -3437,9 +3490,9 @@ class bs {
|
|
|
3437
3490
|
return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
|
|
3438
3491
|
}
|
|
3439
3492
|
}
|
|
3440
|
-
class
|
|
3493
|
+
class Es {
|
|
3441
3494
|
constructor(e2, t2, s2, n2, r2, i2) {
|
|
3442
|
-
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new
|
|
3495
|
+
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new As({ tokenChanged(e3) {
|
|
3443
3496
|
}, tokenRefreshFailed(e3) {
|
|
3444
3497
|
}, tokenAccepted(e3) {
|
|
3445
3498
|
} }), this.sessionExpiryWarningTimeoutId = void 0, i2 && (n2 || r2)) throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");
|
|
@@ -3531,7 +3584,7 @@ class ys {
|
|
|
3531
3584
|
const e3 = function(e4) {
|
|
3532
3585
|
const t3 = e4.split(".");
|
|
3533
3586
|
if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
|
|
3534
|
-
return { header:
|
|
3587
|
+
return { header: ks(t3[0]), payload: ks(t3[1]) };
|
|
3535
3588
|
}(s2);
|
|
3536
3589
|
n2 = e3.header, r2 = e3.payload;
|
|
3537
3590
|
} catch (e3) {
|
|
@@ -3545,7 +3598,7 @@ class ys {
|
|
|
3545
3598
|
const e3 = this.checkJwtPayload(r2);
|
|
3546
3599
|
t2.push(...e3);
|
|
3547
3600
|
}
|
|
3548
|
-
if (t2.length) if (this.usingBokens)
|
|
3601
|
+
if (t2.length) if (this.usingBokens) Cs.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
|
|
3549
3602
|
else {
|
|
3550
3603
|
console.warn("[TalkJS] Authentication token appears to be generated incorrectly. Will still attempt to authenticate, but TalkJS may not work as expected. See below for a description of any problems and how to fix them.");
|
|
3551
3604
|
const s3 = t2.length > 1;
|
|
@@ -3574,7 +3627,7 @@ class ys {
|
|
|
3574
3627
|
sendBokenRequest(e2, t2) {
|
|
3575
3628
|
return __async(this, null, function* () {
|
|
3576
3629
|
let s2 = 0;
|
|
3577
|
-
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield
|
|
3630
|
+
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield ps({ method: "GET", url: n2, attempts: 1e4, shouldRetry: (e3) => {
|
|
3578
3631
|
if (e3 instanceof Error) return true;
|
|
3579
3632
|
if (401 === e3.status) throw "Check that you provided a valid signature.";
|
|
3580
3633
|
if (404 === e3.status) throw "Check that you specified the correct App ID.";
|
|
@@ -3587,7 +3640,7 @@ class ys {
|
|
|
3587
3640
|
});
|
|
3588
3641
|
}
|
|
3589
3642
|
}
|
|
3590
|
-
function
|
|
3643
|
+
function ks(e2) {
|
|
3591
3644
|
try {
|
|
3592
3645
|
const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
3593
3646
|
return JSON.parse(s2);
|
|
@@ -3595,7 +3648,7 @@ function Cs(e2) {
|
|
|
3595
3648
|
throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
|
|
3596
3649
|
}
|
|
3597
3650
|
}
|
|
3598
|
-
class
|
|
3651
|
+
class xs {
|
|
3599
3652
|
constructor(e2) {
|
|
3600
3653
|
this.target = e2;
|
|
3601
3654
|
}
|
|
@@ -3603,7 +3656,7 @@ class As {
|
|
|
3603
3656
|
return this.target;
|
|
3604
3657
|
}
|
|
3605
3658
|
}
|
|
3606
|
-
const
|
|
3659
|
+
const Is = new class {
|
|
3607
3660
|
constructor() {
|
|
3608
3661
|
this.registry = {};
|
|
3609
3662
|
}
|
|
@@ -3611,7 +3664,7 @@ const Es = new class {
|
|
|
3611
3664
|
var _a2;
|
|
3612
3665
|
const t2 = this.key(e2), s2 = (_a2 = this.registry[t2]) == null ? void 0 : _a2.deref();
|
|
3613
3666
|
if (s2) return s2;
|
|
3614
|
-
const n2 = new
|
|
3667
|
+
const n2 = new Ss(e2), r2 = globalThis.WeakRef ? new WeakRef(n2) : new xs(n2);
|
|
3615
3668
|
return this.registry[t2] = r2, n2;
|
|
3616
3669
|
}
|
|
3617
3670
|
deregister(e2, t2) {
|
|
@@ -3622,10 +3675,10 @@ const Es = new class {
|
|
|
3622
3675
|
return `${e2}:${t2}`;
|
|
3623
3676
|
}
|
|
3624
3677
|
}();
|
|
3625
|
-
function
|
|
3626
|
-
return e2.forceCreateNew ? new
|
|
3678
|
+
function Ts(e2) {
|
|
3679
|
+
return e2.forceCreateNew ? new Ss(e2) : Is.getOrCreate(e2);
|
|
3627
3680
|
}
|
|
3628
|
-
class
|
|
3681
|
+
class Ss {
|
|
3629
3682
|
constructor(e2) {
|
|
3630
3683
|
!function(e3) {
|
|
3631
3684
|
function t3(e4, t4) {
|
|
@@ -3635,13 +3688,13 @@ class xs {
|
|
|
3635
3688
|
void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of TalkSession#constructor must be a function.");
|
|
3636
3689
|
}(e2);
|
|
3637
3690
|
const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
|
|
3638
|
-
this._appId = t2, this._apiUrls = e2.apiUrls ? new
|
|
3691
|
+
this._appId = t2, this._apiUrls = e2.apiUrls ? new ds(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : ds.fromHost(e2.host), this._authProvider = new Es(this._apiUrls, t2, s2, n2, r2, i2);
|
|
3639
3692
|
const a2 = Math.random().toString().split(".")[1];
|
|
3640
|
-
this._realtimeClient = new
|
|
3693
|
+
this._realtimeClient = new Ie(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.5.0", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new De(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
|
|
3641
3694
|
console.error(`[TalkSession] ${e3}`);
|
|
3642
3695
|
}), function(e3, t3, s3) {
|
|
3643
3696
|
return __async(this, null, function* () {
|
|
3644
|
-
return
|
|
3697
|
+
return ps({ method: "GET", url: `${t3}/${e3}/app`, authProvider: s3 }).then((e4) => 200 === e4.status || 404 !== e4.status && (console.warn(`[TalkJS] Received unexpected ${e4.status} status code when validating app ID. Assuming that the app ID is valid.`), true)).catch((e4) => {
|
|
3645
3698
|
if ("string" != typeof e4 && "status" in e4) {
|
|
3646
3699
|
const t4 = e4;
|
|
3647
3700
|
return 200 === t4.status || 404 !== t4.status && (console.warn(`[TalkJS] Received unexpected ${t4.status} status code when validating app ID. Assuming that the app ID is valid.`), true);
|
|
@@ -3662,40 +3715,44 @@ class xs {
|
|
|
3662
3715
|
}), { unsubscribe: () => t2.resolve("UNSUBSCRIBED") };
|
|
3663
3716
|
}
|
|
3664
3717
|
user(e2) {
|
|
3665
|
-
|
|
3718
|
+
if ("string" != typeof e2) throw new Error(`Creating UserRef failed because ID "${e2}" is not a string`);
|
|
3719
|
+
if ("" === e2) throw new Error(`Creating UserRef failed because ID "${e2}" is an empty string`);
|
|
3720
|
+
return new De(e2, this._realtimeClient);
|
|
3666
3721
|
}
|
|
3667
3722
|
conversation(e2) {
|
|
3668
|
-
|
|
3723
|
+
if ("string" != typeof e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is not a string`);
|
|
3724
|
+
if ("" === e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is an empty string`);
|
|
3725
|
+
return new cs(e2, this._realtimeClient);
|
|
3669
3726
|
}
|
|
3670
3727
|
subscribeConversations(e2) {
|
|
3671
3728
|
return this._realtimeClient.subscribe(["me", "conversations"], e2);
|
|
3672
3729
|
}
|
|
3673
3730
|
terminate(e2) {
|
|
3674
|
-
|
|
3731
|
+
Is.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
|
|
3675
3732
|
}
|
|
3676
3733
|
_isConnected() {
|
|
3677
3734
|
return this._realtimeClient.isConnected();
|
|
3678
3735
|
}
|
|
3679
3736
|
uploadFile(e2, t2) {
|
|
3680
|
-
return
|
|
3737
|
+
return Ds(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
|
|
3681
3738
|
}
|
|
3682
3739
|
uploadImage(e2, t2) {
|
|
3683
|
-
return
|
|
3740
|
+
return Ds(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
|
|
3684
3741
|
}
|
|
3685
3742
|
uploadVideo(e2, t2) {
|
|
3686
|
-
return
|
|
3743
|
+
return Ds(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
|
|
3687
3744
|
}
|
|
3688
3745
|
uploadAudio(e2, t2) {
|
|
3689
|
-
return
|
|
3746
|
+
return Ds(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
|
|
3690
3747
|
}
|
|
3691
3748
|
uploadVoice(e2, t2) {
|
|
3692
|
-
return
|
|
3749
|
+
return Ds(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
|
|
3693
3750
|
}
|
|
3694
3751
|
}
|
|
3695
|
-
function
|
|
3752
|
+
function Ds(_0, _1, _2, _3) {
|
|
3696
3753
|
return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
|
|
3697
3754
|
const u2 = new FormData();
|
|
3698
|
-
return u2.set("file", s2, r2), void 0 !== n2 && u2.set("subtype", n2), void 0 !== i2 && u2.set("width", i2.toString()), void 0 !== a2 && u2.set("height", a2.toString()), void 0 !== o2 && u2.set("duration", o2.toString()),
|
|
3755
|
+
return u2.set("file", s2, r2), void 0 !== n2 && u2.set("subtype", n2), void 0 !== i2 && u2.set("width", i2.toString()), void 0 !== a2 && u2.set("height", a2.toString()), void 0 !== o2 && u2.set("duration", o2.toString()), ps({ method: "POST", url: e2, data: u2, authProvider: t2 }).then((e3) => e3.json()).then((e3) => e3.attachmentToken).catch((e3) => __async(this, null, function* () {
|
|
3699
3756
|
if (e3 instanceof Response) {
|
|
3700
3757
|
const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
|
|
3701
3758
|
throw new Error(s3);
|
|
@@ -3705,7 +3762,7 @@ function Ts(_0, _1, _2, _3) {
|
|
|
3705
3762
|
});
|
|
3706
3763
|
}
|
|
3707
3764
|
export {
|
|
3708
|
-
|
|
3765
|
+
Ts as getTalkSession,
|
|
3709
3766
|
f as registerPolyfills
|
|
3710
3767
|
};
|
|
3711
3768
|
//# sourceMappingURL=talkSession.js.map
|