@talkjs/core 1.7.0 → 1.8.0
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 +5 -0
- package/dist/talkSession.cjs +1 -1
- package/dist/talkSession.d.ts +73 -0
- package/dist/talkSession.js +645 -609
- package/package.json +1 -1
package/dist/talkSession.js
CHANGED
|
@@ -452,7 +452,7 @@ class I {
|
|
|
452
452
|
logTrace(e2, t2, s2) {
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
class
|
|
455
|
+
class S {
|
|
456
456
|
constructor(e2, t2, s2) {
|
|
457
457
|
this.handlers = s2, this.stateMachine = new i("QueuedConnection", ["NOT_READY", "PROCESSING_QUEUE", "READY", "TERMINATED"], { processQueue: { from: ["NOT_READY"], to: "PROCESSING_QUEUE", afterTransition: () => {
|
|
458
458
|
this.sendQueuedCalls();
|
|
@@ -523,11 +523,11 @@ class x {
|
|
|
523
523
|
return "READY" === this.stateMachine.state || "PROCESSING_QUEUE" === this.stateMachine.state;
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function x(e2) {
|
|
527
527
|
return Object.freeze(e2);
|
|
528
528
|
}
|
|
529
529
|
function E(e2) {
|
|
530
|
-
return
|
|
530
|
+
return x(e2.map((e3) => (function(e4) {
|
|
531
531
|
switch (e4.type) {
|
|
532
532
|
case "text":
|
|
533
533
|
return Object.freeze({ type: "text", children: M(e4.children) });
|
|
@@ -538,7 +538,7 @@ function E(e2) {
|
|
|
538
538
|
})(e3)));
|
|
539
539
|
}
|
|
540
540
|
function M(e2) {
|
|
541
|
-
return
|
|
541
|
+
return x(e2.map((e3) => (function(e4) {
|
|
542
542
|
if ("string" == typeof e4) return e4;
|
|
543
543
|
switch (e4.type) {
|
|
544
544
|
case "bold":
|
|
@@ -562,40 +562,40 @@ function A(e2, t2) {
|
|
|
562
562
|
return void 0 === t2 ? e2 : t2;
|
|
563
563
|
}
|
|
564
564
|
function N(e2, t2) {
|
|
565
|
-
return void 0 === t2 ? e2 :
|
|
565
|
+
return void 0 === t2 ? e2 : x(t2);
|
|
566
566
|
}
|
|
567
567
|
function R(e2, t2) {
|
|
568
568
|
if (void 0 === t2) return e2;
|
|
569
|
-
if (null === t2) return
|
|
569
|
+
if (null === t2) return x({});
|
|
570
570
|
const s2 = __spreadValues({}, e2);
|
|
571
571
|
for (const e3 in t2) {
|
|
572
572
|
const n2 = t2[e3];
|
|
573
573
|
null === n2 ? delete s2[e3] : s2[e3] = n2;
|
|
574
574
|
}
|
|
575
|
-
return
|
|
575
|
+
return x(s2);
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function D(e2, t2) {
|
|
578
578
|
if (e2 === t2) return true;
|
|
579
579
|
if (!e2 || !t2) return false;
|
|
580
580
|
if ("object" != typeof e2 || "object" != typeof t2) return false;
|
|
581
581
|
if (e2.constructor !== t2.constructor) return false;
|
|
582
582
|
if (Array.isArray(e2) && Array.isArray(t2)) {
|
|
583
583
|
if (e2.length !== t2.length) return false;
|
|
584
|
-
for (let s2 = 0; s2 < e2.length; s2++) if (!
|
|
584
|
+
for (let s2 = 0; s2 < e2.length; s2++) if (!D(e2[s2], t2[s2])) return false;
|
|
585
585
|
} else {
|
|
586
586
|
const s2 = Object.keys(e2);
|
|
587
587
|
if (s2.length !== Object.keys(t2).length) return false;
|
|
588
588
|
for (const n2 of s2) {
|
|
589
589
|
if (!Object.hasOwnProperty.call(t2, n2)) return false;
|
|
590
|
-
if (!
|
|
590
|
+
if (!D(e2[n2], t2[n2])) return false;
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
593
|
return true;
|
|
594
594
|
}
|
|
595
|
-
const
|
|
595
|
+
const _ = "undefined" != typeof window ? (_b = window.queueMicrotask) != null ? _b : setTimeout : setTimeout;
|
|
596
596
|
class O {
|
|
597
597
|
constructor(e2, t2, s2) {
|
|
598
|
-
this.headers = e2, this.clearPendingBatch = t2, this.sendCalls = s2, this.sent = false,
|
|
598
|
+
this.headers = e2, this.clearPendingBatch = t2, this.sendCalls = s2, this.sent = false, _(() => this.send());
|
|
599
599
|
}
|
|
600
600
|
send() {
|
|
601
601
|
this.sent || (this.sent = true, this.clearPendingBatch(), this.sendCalls());
|
|
@@ -611,7 +611,7 @@ class P extends O {
|
|
|
611
611
|
}), this.connection = e2, this.getCalls = [], this.subscribeCalls = [];
|
|
612
612
|
}
|
|
613
613
|
canPush(e2) {
|
|
614
|
-
return P.isCorrectBatchTypeFor(e2) &&
|
|
614
|
+
return P.isCorrectBatchTypeFor(e2) && D(this.headers, e2.headers);
|
|
615
615
|
}
|
|
616
616
|
static isCorrectBatchTypeFor(t2) {
|
|
617
617
|
const s2 = e(t2.path, ["users", "*"]), n2 = "GET" === t2.method || "SUBSCRIBE" === t2.method;
|
|
@@ -638,12 +638,12 @@ class P extends O {
|
|
|
638
638
|
this.connection.call({ method: "SUBSCRIBE", path: ["users"], data: { ids: e2 }, headers: this.headers }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
class
|
|
641
|
+
class j extends O {
|
|
642
642
|
constructor(e2, t2, s2, n2) {
|
|
643
643
|
super(s2, n2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
|
|
644
644
|
}
|
|
645
645
|
canPush(e2) {
|
|
646
|
-
return !(
|
|
646
|
+
return !(!j.isCorrectBatchTypeFor(e2) || e2.path[1] !== this.conversationId || !D(this.headers, e2.headers));
|
|
647
647
|
}
|
|
648
648
|
static isCorrectBatchTypeFor(t2) {
|
|
649
649
|
if (e(t2.path, ["conversations", "*", "participants", "*"])) {
|
|
@@ -667,9 +667,9 @@ class $ extends O {
|
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
class
|
|
670
|
+
class $ {
|
|
671
671
|
constructor(e2, t2, s2) {
|
|
672
|
-
this.pendingBatch = null, this.connection = new
|
|
672
|
+
this.pendingBatch = null, this.connection = new S(e2, t2, s2);
|
|
673
673
|
}
|
|
674
674
|
sync() {
|
|
675
675
|
return __async(this, null, function* () {
|
|
@@ -695,17 +695,17 @@ class U {
|
|
|
695
695
|
createEmptyBatchFor(e2) {
|
|
696
696
|
var _a2, _b2;
|
|
697
697
|
if (P.isCorrectBatchTypeFor(e2)) return new P(this.connection, (_a2 = e2.headers) != null ? _a2 : {}, () => this.pendingBatch = null);
|
|
698
|
-
if (
|
|
698
|
+
if (j.isCorrectBatchTypeFor(e2)) {
|
|
699
699
|
const t2 = e2.path[1];
|
|
700
|
-
return new
|
|
700
|
+
return new j(t2, this.connection, (_b2 = e2.headers) != null ? _b2 : {}, () => this.pendingBatch = null);
|
|
701
701
|
}
|
|
702
702
|
return null;
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
const
|
|
705
|
+
const U = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
|
|
706
706
|
class W {
|
|
707
707
|
constructor(e2, t2, s2) {
|
|
708
|
-
this.throttler = new q(), this.alive = true, this.connection = new
|
|
708
|
+
this.throttler = new q(), this.alive = true, this.connection = new $(e2, t2, s2);
|
|
709
709
|
}
|
|
710
710
|
sync() {
|
|
711
711
|
return __async(this, null, function* () {
|
|
@@ -719,7 +719,7 @@ class W {
|
|
|
719
719
|
const s2 = yield this.connection.call(e2);
|
|
720
720
|
if ((s2.ok || "client" !== s2.where || "SOCKET_NOT_READY" !== s2.value) && (s2.ok || "server" !== s2.where || 500 !== s2.value.status) || t2++, 10 === t2) return s2;
|
|
721
721
|
if (s2.ok || "client" !== s2.where) {
|
|
722
|
-
const e3 = s2.value, t3 = e3.status, n2 =
|
|
722
|
+
const e3 = s2.value, t3 = e3.status, n2 = U[t3];
|
|
723
723
|
if ("RESOLVE" === n2) return this.throttler.resetDelay(), s2;
|
|
724
724
|
if ("RETRY" === n2) continue;
|
|
725
725
|
if ("DELAY" === n2) {
|
|
@@ -1145,14 +1145,14 @@ function oe(e2, t2) {
|
|
|
1145
1145
|
}).join("");
|
|
1146
1146
|
}
|
|
1147
1147
|
function ce(e2) {
|
|
1148
|
-
return
|
|
1148
|
+
return x({ id: e2.id, name: e2.name, custom: x(e2.custom), locale: e2.locale, photoUrl: e2.photoUrl, role: e2.role, welcomeMessage: e2.welcomeMessage });
|
|
1149
1149
|
}
|
|
1150
1150
|
function le(e2, t2) {
|
|
1151
|
-
return
|
|
1151
|
+
return x({ user: t2, access: e2.access, notify: e2.notify, joinedAt: e2.joinedAt });
|
|
1152
1152
|
}
|
|
1153
1153
|
function he(e2) {
|
|
1154
|
-
const t2 = Object.entries(e2).map(([e3, t3]) =>
|
|
1155
|
-
return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)),
|
|
1154
|
+
const t2 = Object.entries(e2).map(([e3, t3]) => x({ emoji: e3, count: t3.count, currentUserReacted: t3.currentUserReacted }));
|
|
1155
|
+
return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), x(t2);
|
|
1156
1156
|
}
|
|
1157
1157
|
class ue extends Y {
|
|
1158
1158
|
constructor(e2, t2, s2, n2, a2) {
|
|
@@ -1165,7 +1165,7 @@ class ue extends Y {
|
|
|
1165
1165
|
});
|
|
1166
1166
|
}
|
|
1167
1167
|
equal(e2, t2) {
|
|
1168
|
-
return
|
|
1168
|
+
return D(e2.snapshot, t2.snapshot);
|
|
1169
1169
|
}
|
|
1170
1170
|
loadNested(e2, t2) {
|
|
1171
1171
|
return __async(this, null, function* () {
|
|
@@ -1212,14 +1212,14 @@ class de extends z {
|
|
|
1212
1212
|
if (!e3.ok) return e3;
|
|
1213
1213
|
t2 = e3.value.data;
|
|
1214
1214
|
}
|
|
1215
|
-
return o({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom:
|
|
1215
|
+
return o({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: x(t2.custom), createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext: ie(t2.content, {}), content: E(t2.content), reactions: he(t2.reactions) } });
|
|
1216
1216
|
});
|
|
1217
1217
|
}
|
|
1218
1218
|
refetch(e2) {
|
|
1219
1219
|
throw "Do not call refetch on message data stores, it can return outdated data. Destroy and remake them instead";
|
|
1220
1220
|
}
|
|
1221
1221
|
equal(e2, t2) {
|
|
1222
|
-
return
|
|
1222
|
+
return D(e2.data, t2.data);
|
|
1223
1223
|
}
|
|
1224
1224
|
teardownNested(e2) {
|
|
1225
1225
|
var _a2;
|
|
@@ -1239,7 +1239,7 @@ class de extends z {
|
|
|
1239
1239
|
if (false === (s2 == null ? void 0 : s2.ok)) return s2;
|
|
1240
1240
|
if (null === t2.data) return o({ snapshot: null });
|
|
1241
1241
|
const n2 = s2 == null ? void 0 : s2.value;
|
|
1242
|
-
return o({ snapshot:
|
|
1242
|
+
return o({ snapshot: x({ sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: x(t2.data.custom), createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: t2.data.plaintext, content: t2.data.content, referencedMessageId: t2.data.referencedMessageId, reactions: t2.data.reactions }) });
|
|
1243
1243
|
});
|
|
1244
1244
|
}
|
|
1245
1245
|
messageEdited(e2, t2) {
|
|
@@ -1273,13 +1273,13 @@ function pe(e2, t2) {
|
|
|
1273
1273
|
if (void 0 === t2) return e2;
|
|
1274
1274
|
const s2 = e2.map((e3) => {
|
|
1275
1275
|
const s3 = t2[e3.emoji];
|
|
1276
|
-
return void 0 === s3 ? e3 :
|
|
1276
|
+
return void 0 === s3 ? e3 : x(null === s3 ? __spreadProps(__spreadValues({}, e3), { count: 0 }) : { emoji: e3.emoji, count: A(e3.count, s3.count), currentUserReacted: A(e3.currentUserReacted, s3.currentUserReacted) });
|
|
1277
1277
|
}).filter((e3) => e3.count > 0), n2 = new Set(s2.map((e3) => e3.emoji));
|
|
1278
1278
|
for (const e3 in t2) {
|
|
1279
1279
|
const a2 = t2[e3];
|
|
1280
|
-
a2 && !n2.has(e3) && s2.push(
|
|
1280
|
+
a2 && !n2.has(e3) && s2.push(x({ emoji: e3, count: a2.count, currentUserReacted: a2.currentUserReacted }));
|
|
1281
1281
|
}
|
|
1282
|
-
return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)),
|
|
1282
|
+
return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), x(s2);
|
|
1283
1283
|
}
|
|
1284
1284
|
class me extends z {
|
|
1285
1285
|
constructor(e2, t2, s2, n2) {
|
|
@@ -1317,7 +1317,7 @@ class me extends z {
|
|
|
1317
1317
|
const a2 = yield (_a2 = t2.referencedDataStore) == null ? void 0 : _a2.getDeep(e2);
|
|
1318
1318
|
if (a2 && !a2.ok) return a2;
|
|
1319
1319
|
const r2 = (_b2 = a2 == null ? void 0 : a2.value) != null ? _b2 : null, i2 = (_c = r2 == null ? void 0 : r2.snapshot) != null ? _c : null;
|
|
1320
|
-
return o({ snapshot:
|
|
1320
|
+
return o({ snapshot: x({ id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: x(n2.snapshot.custom), createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: i2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content, reactions: n2.snapshot.reactions }) });
|
|
1321
1321
|
});
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
@@ -1367,14 +1367,14 @@ class fe extends Y {
|
|
|
1367
1367
|
});
|
|
1368
1368
|
}
|
|
1369
1369
|
equal(e2, t2) {
|
|
1370
|
-
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!
|
|
1370
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!D(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!D(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && D(e2.windowEnd, t2.windowEnd)));
|
|
1371
1371
|
}
|
|
1372
1372
|
loadNested(e2, t2) {
|
|
1373
1373
|
return __async(this, null, function* () {
|
|
1374
1374
|
if (null === t2.stores) return o({ snapshot: null, loadedAll: true });
|
|
1375
1375
|
const s2 = yield Promise.all(t2.inWindow.map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1376
1376
|
if (n2) return n2;
|
|
1377
|
-
return o({ snapshot:
|
|
1377
|
+
return o({ snapshot: x(s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot)), loadedAll: null === t2.windowEnd });
|
|
1378
1378
|
});
|
|
1379
1379
|
}
|
|
1380
1380
|
loadMore(e2) {
|
|
@@ -1553,16 +1553,16 @@ class ke extends Y {
|
|
|
1553
1553
|
});
|
|
1554
1554
|
}
|
|
1555
1555
|
equal(e2, t2) {
|
|
1556
|
-
return
|
|
1556
|
+
return D(e2.data, t2.data);
|
|
1557
1557
|
}
|
|
1558
1558
|
loadNested(e2, t2) {
|
|
1559
1559
|
return __async(this, null, function* () {
|
|
1560
1560
|
if (null === t2.data) return o({ snapshot: null, lastChanged: t2.lastChanged });
|
|
1561
|
-
if (t2.data.many) return o({ snapshot:
|
|
1561
|
+
if (t2.data.many) return o({ snapshot: x({ many: true }), lastChanged: t2.lastChanged });
|
|
1562
1562
|
const s2 = Object.entries(t2.data.usersTyping).sort(([e3, t3], [s3, n3]) => t3 - n3).map(([e3, t3]) => e3).map((s3) => t2.userSubscriptions[s3].store.getDeep(e2)), n2 = yield Promise.all(s2), a2 = n2.find((e3) => !e3.ok);
|
|
1563
1563
|
if (a2) return a2;
|
|
1564
1564
|
const r2 = n2.map((e3) => e3.value), i2 = r2.map((e3) => e3.snapshot), c2 = r2.map((e3) => e3.lastChanged), l2 = Math.max(t2.lastChanged, ...c2);
|
|
1565
|
-
return o({ snapshot:
|
|
1565
|
+
return o({ snapshot: x({ users: x(i2), many: false }), lastChanged: l2 });
|
|
1566
1566
|
});
|
|
1567
1567
|
}
|
|
1568
1568
|
typingAvailable(e2, t2) {
|
|
@@ -1606,13 +1606,19 @@ class ke extends Y {
|
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
1609
|
-
class Ce extends
|
|
1610
|
-
constructor(e2, t2, s2, n2) {
|
|
1611
|
-
super(e2,
|
|
1609
|
+
class Ce extends Y {
|
|
1610
|
+
constructor(e2, t2, s2, n2, a2, r2) {
|
|
1611
|
+
super(e2, a2, r2), this.conversationId = t2, this.participant = s2, this.realtimeClient = n2, this.unsubscribeDebounceMs = 0;
|
|
1612
|
+
}
|
|
1613
|
+
get userId() {
|
|
1614
|
+
return "string" == typeof this.participant ? this.participant : this.participant.id;
|
|
1612
1615
|
}
|
|
1613
1616
|
fetchInitial(e2) {
|
|
1614
1617
|
return __async(this, null, function* () {
|
|
1615
|
-
|
|
1618
|
+
const t2 = this.realtimeClient.internalSubscribe(["users", this.userId]);
|
|
1619
|
+
if ("object" == typeof this.participant) return o({ lastChanged: e2, user: t2, data: this.participant });
|
|
1620
|
+
const s2 = yield Te(this.conversationId, this.userId, this.realtimeClient);
|
|
1621
|
+
return s2.ok ? o({ lastChanged: e2, user: t2, data: s2.value }) : (t2.unsubscribe(), s2);
|
|
1616
1622
|
});
|
|
1617
1623
|
}
|
|
1618
1624
|
refetch(e2) {
|
|
@@ -1620,15 +1626,15 @@ class Ce extends z {
|
|
|
1620
1626
|
}
|
|
1621
1627
|
equal(e2, t2) {
|
|
1622
1628
|
var _a2, _b2, _c, _d;
|
|
1623
|
-
return ((_b2 = (_a2 = e2.user) == null ? void 0 : _a2.store) == null ? void 0 : _b2.userId) === ((_d = (_c = t2.user) == null ? void 0 : _c.store) == null ? void 0 : _d.userId) &&
|
|
1629
|
+
return ((_b2 = (_a2 = e2.user) == null ? void 0 : _a2.store) == null ? void 0 : _b2.userId) === ((_d = (_c = t2.user) == null ? void 0 : _c.store) == null ? void 0 : _d.userId) && D(e2.data, t2.data);
|
|
1624
1630
|
}
|
|
1625
1631
|
teardownNested(e2) {
|
|
1626
|
-
|
|
1627
|
-
(_a2 = e2.user) == null ? void 0 : _a2.unsubscribe();
|
|
1632
|
+
e2.user.unsubscribe();
|
|
1628
1633
|
}
|
|
1629
1634
|
anyChildChanged(e2, t2, s2) {
|
|
1630
1635
|
return __async(this, null, function* () {
|
|
1631
1636
|
var _a2;
|
|
1637
|
+
if (null === s2.data) return false;
|
|
1632
1638
|
const n2 = (_a2 = s2.user) == null ? void 0 : _a2.store;
|
|
1633
1639
|
return true === (yield n2 == null ? void 0 : n2.changedBetween(e2, t2));
|
|
1634
1640
|
});
|
|
@@ -1642,6 +1648,12 @@ class Ce extends z {
|
|
|
1642
1648
|
return o({ snapshot: le(t2.data, n2) });
|
|
1643
1649
|
});
|
|
1644
1650
|
}
|
|
1651
|
+
participantCreated(e2, t2) {
|
|
1652
|
+
this.mutate(e2, (s2) => {
|
|
1653
|
+
if (null !== s2.value.data) return s2;
|
|
1654
|
+
return o({ lastChanged: e2, user: s2.value.user, data: t2.state });
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1645
1657
|
participantEdited(e2, t2) {
|
|
1646
1658
|
this.mutate(e2, (s2) => {
|
|
1647
1659
|
if (null === s2.value.data) return s2;
|
|
@@ -1649,7 +1661,18 @@ class Ce extends z {
|
|
|
1649
1661
|
});
|
|
1650
1662
|
}
|
|
1651
1663
|
participantDeleted(e2, t2) {
|
|
1652
|
-
this.mutate(e2, (t3) => null === t3.value.data ? t3 :
|
|
1664
|
+
this.mutate(e2, (t3) => null === t3.value.data ? t3 : o({ lastChanged: e2, user: t3.value.user, data: null }));
|
|
1665
|
+
}
|
|
1666
|
+
sideCreated(e2, t2) {
|
|
1667
|
+
const s2 = Te(this.conversationId, this.userId, this.realtimeClient);
|
|
1668
|
+
this.mutate(e2, (t3) => __async(this, null, function* () {
|
|
1669
|
+
if (null !== t3.value.data) return t3;
|
|
1670
|
+
const n2 = yield s2;
|
|
1671
|
+
return n2.ok ? o({ lastChanged: e2, user: t3.value.user, data: n2.value }) : (this.teardownNested(t3.value), n2);
|
|
1672
|
+
}));
|
|
1673
|
+
}
|
|
1674
|
+
sideDeleted(e2, t2) {
|
|
1675
|
+
this.mutate(e2, (t3) => null === t3.value.data ? t3 : o({ lastChanged: e2, user: t3.value.user, data: null }));
|
|
1653
1676
|
}
|
|
1654
1677
|
getFromCache() {
|
|
1655
1678
|
return __async(this, null, function* () {
|
|
@@ -1662,41 +1685,45 @@ class Ce extends z {
|
|
|
1662
1685
|
});
|
|
1663
1686
|
}
|
|
1664
1687
|
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1688
|
+
function Te(e2, t2, s2) {
|
|
1689
|
+
return __async(this, null, function* () {
|
|
1690
|
+
const n2 = yield s2.call({ method: "GET", path: ["me", "conversations", e2, "participants", t2], data: {}, flags: { bypassCache: true } });
|
|
1691
|
+
return n2.ok ? o(n2.value.data) : "server" === n2.where && 404 === n2.value.status || "server" === n2.where && 403 === n2.value.status && "NOT_A_PARTICIPANT" === n2.value.errorCode ? o(null) : n2;
|
|
1692
|
+
});
|
|
1693
|
+
}
|
|
1694
|
+
class Ie extends Y {
|
|
1695
|
+
constructor(e2, t2, s2, n2, a2, r2) {
|
|
1696
|
+
super(e2, a2, r2), this.getParticipantDataStore = t2, this.conversationId = s2, this.realtimeClient = n2, this.handlers = r2, this.unsubscribeDebounceMs = 3e4, this.pendingLoadMore = void 0;
|
|
1668
1697
|
}
|
|
1669
1698
|
fetchInitial(e2) {
|
|
1670
1699
|
return __async(this, null, function* () {
|
|
1671
|
-
const t2 = yield
|
|
1672
|
-
return t2.ok ? null === t2.value.participants ? o({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : xe({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor,
|
|
1700
|
+
const t2 = yield Se({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: 10 });
|
|
1701
|
+
return t2.ok ? null === t2.value.participants ? o({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : xe({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor, getParticipantDataStore: this.getParticipantDataStore }) : t2;
|
|
1673
1702
|
});
|
|
1674
1703
|
}
|
|
1675
1704
|
teardownNested(e2) {
|
|
1676
|
-
|
|
1677
|
-
const t2 = c("TERMINATED");
|
|
1678
|
-
Object.values(e2.stores).forEach((e3) => e3.setError(t2));
|
|
1679
|
-
}
|
|
1705
|
+
null !== e2.stores && Object.values(e2.stores).forEach((e3) => e3.unsubscribe());
|
|
1680
1706
|
}
|
|
1681
1707
|
anyChildChanged(e2, t2, s2) {
|
|
1682
1708
|
return __async(this, null, function* () {
|
|
1709
|
+
var _a2;
|
|
1683
1710
|
for (const n2 in s2.stores) {
|
|
1684
1711
|
const a2 = s2.stores[n2];
|
|
1685
|
-
if (true === (yield a2 == null ? void 0 : a2.changedBetween(e2, t2))) return true;
|
|
1712
|
+
if (true === (yield (_a2 = a2 == null ? void 0 : a2.store) == null ? void 0 : _a2.changedBetween(e2, t2))) return true;
|
|
1686
1713
|
}
|
|
1687
1714
|
return false;
|
|
1688
1715
|
});
|
|
1689
1716
|
}
|
|
1690
1717
|
equal(e2, t2) {
|
|
1691
|
-
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!
|
|
1718
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!D(Object.keys(e2.stores), Object.keys(t2.stores)) && D(e2.windowEnd, t2.windowEnd));
|
|
1692
1719
|
}
|
|
1693
1720
|
loadNested(e2, t2) {
|
|
1694
1721
|
return __async(this, null, function* () {
|
|
1695
1722
|
if (null === t2.stores) return o({ snapshot: null, loadedAll: true });
|
|
1696
|
-
const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1723
|
+
const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.store.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1697
1724
|
if (n2) return n2;
|
|
1698
1725
|
const a2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
|
|
1699
|
-
return a2.sort((e3, t3) => t3.joinedAt - e3.joinedAt), o({ snapshot:
|
|
1726
|
+
return a2.sort((e3, t3) => t3.joinedAt - e3.joinedAt), o({ snapshot: x(a2), loadedAll: null === t2.windowEnd });
|
|
1700
1727
|
});
|
|
1701
1728
|
}
|
|
1702
1729
|
loadMore(e2) {
|
|
@@ -1711,37 +1738,26 @@ class Te extends Y {
|
|
|
1711
1738
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1712
1739
|
if (!t2.ok) return;
|
|
1713
1740
|
if (null === t2.value.windowEnd) return;
|
|
1714
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1741
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield Se({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
|
|
1715
1742
|
yield this.handlers.onLoadedMore({ type: "virtual.participants.loadedmore", conversationId: this.conversationId, data: n2 });
|
|
1716
1743
|
});
|
|
1717
1744
|
}
|
|
1718
1745
|
loadedMore(e2, t2) {
|
|
1719
|
-
this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), s2) : xe({ seq: e2, prevStores: s2.value.stores, participants: t2.data.value.participants, cursor: t2.data.value.nextCursor,
|
|
1746
|
+
this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), s2) : xe({ seq: e2, prevStores: s2.value.stores, participants: t2.data.value.participants, cursor: t2.data.value.nextCursor, getParticipantDataStore: this.getParticipantDataStore }) : t2.data);
|
|
1720
1747
|
}
|
|
1721
1748
|
participantCreated(e2, t2) {
|
|
1722
|
-
this.
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
const n2 = __spreadValues({}, s2.value.stores), a2 = new Ce(e2, this.conversationId, t2.state, this.realtimeClient);
|
|
1727
|
-
n2[t2.state.id] = a2;
|
|
1728
|
-
return o({ lastChanged: e2, stores: n2, windowEnd: s2.value.windowEnd });
|
|
1729
|
-
});
|
|
1730
|
-
}
|
|
1731
|
-
participantEdited(e2, t2) {
|
|
1732
|
-
this.mutate(e2, (s2) => {
|
|
1733
|
-
var _a2;
|
|
1734
|
-
return null === s2.value.stores ? (console.warn("[TalkJS] Received a 'participant.edited' event for a nonexistent conversation."), s2) : ((_a2 = s2.value.stores[t2.userId]) == null ? void 0 : _a2.participantEdited(e2, t2), s2);
|
|
1749
|
+
const s2 = this.getParticipantDataStore(t2.state);
|
|
1750
|
+
this.mutate(e2, (n2) => {
|
|
1751
|
+
let a2 = n2.value.stores;
|
|
1752
|
+
return null === a2 && (console.warn("[TalkJS] Received a 'participant.created' event when we thought the conversation didn't exist."), a2 = {}), Object.hasOwnProperty.call(a2, t2.userId) ? (s2.unsubscribe(), n2) : o({ lastChanged: e2, stores: __spreadProps(__spreadValues({}, a2), { [t2.userId]: s2 }), windowEnd: n2.value.windowEnd });
|
|
1735
1753
|
});
|
|
1736
1754
|
}
|
|
1737
1755
|
participantDeleted(e2, t2) {
|
|
1738
1756
|
this.mutate(e2, (s2) => {
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
n2.
|
|
1743
|
-
const a2 = __spreadValues({}, s2.value.stores);
|
|
1744
|
-
return delete a2[t2.userId], o({ lastChanged: e2, stores: a2, windowEnd: s2.value.windowEnd });
|
|
1757
|
+
var _a2;
|
|
1758
|
+
if (!Object.hasOwnProperty.call(s2.value.stores, t2.conversationId)) return s2;
|
|
1759
|
+
const n2 = __spreadValues({}, s2.value.stores);
|
|
1760
|
+
return (_a2 = n2[t2.userId]) == null ? void 0 : _a2.unsubscribe(), delete n2[t2.userId], o({ lastChanged: e2, stores: n2, windowEnd: s2.value.windowEnd });
|
|
1745
1761
|
});
|
|
1746
1762
|
}
|
|
1747
1763
|
sideCreated(e2, t2) {
|
|
@@ -1753,17 +1769,8 @@ class Te extends Y {
|
|
|
1753
1769
|
sideDeleted(e2, t2) {
|
|
1754
1770
|
this.mutate(e2, (t3) => null === t3.value.stores ? t3 : (this.teardownNested(t3.value), o({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null })));
|
|
1755
1771
|
}
|
|
1756
|
-
getParticipantFromCache(e2) {
|
|
1757
|
-
return __async(this, null, function* () {
|
|
1758
|
-
const t2 = yield this.mostRecentState.resultPromise;
|
|
1759
|
-
if (!t2.ok) return c("NOT_IN_CACHE");
|
|
1760
|
-
if (null === t2.value.stores) return c("NOT_IN_CACHE");
|
|
1761
|
-
const s2 = t2.value.stores[e2];
|
|
1762
|
-
return void 0 === s2 ? c("NOT_IN_CACHE") : s2.getFromCache();
|
|
1763
|
-
});
|
|
1764
|
-
}
|
|
1765
1772
|
}
|
|
1766
|
-
function
|
|
1773
|
+
function Se(_0) {
|
|
1767
1774
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1768
1775
|
const a2 = { limit: n2, cursor: e2 }, r2 = yield t2.call({ method: "GET", path: ["me", "conversations", s2, "participants"], data: a2, flags: { bypassCache: true } });
|
|
1769
1776
|
if (r2.ok) {
|
|
@@ -1773,23 +1780,20 @@ function Ie(_0) {
|
|
|
1773
1780
|
return (r2.ok || "server" !== r2.where || 404 !== r2.value.status) && (r2.ok || "server" !== r2.where || 403 !== r2.value.status || "NOT_A_PARTICIPANT" !== r2.value.errorCode) ? r2 : o({ participants: null, nextCursor: null });
|
|
1774
1781
|
});
|
|
1775
1782
|
}
|
|
1776
|
-
function xe({ seq: e2, prevStores: t2, participants: s2, cursor: n2,
|
|
1777
|
-
const
|
|
1778
|
-
for (const
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
}
|
|
1782
|
-
if (null === n2) return o({ lastChanged: e2, stores: i2, windowEnd: null });
|
|
1783
|
-
return o({ lastChanged: e2, stores: i2, windowEnd: { cursor: n2, oldestParticipantTs: s2[s2.length - 1].joinedAt } });
|
|
1783
|
+
function xe({ seq: e2, prevStores: t2, participants: s2, cursor: n2, getParticipantDataStore: a2 }) {
|
|
1784
|
+
const r2 = t2 ? __spreadValues({}, t2) : {};
|
|
1785
|
+
for (const e3 of s2) void 0 === r2[e3.id] && (r2[e3.id] = a2(e3));
|
|
1786
|
+
if (null === n2) return o({ lastChanged: e2, stores: r2, windowEnd: null });
|
|
1787
|
+
return o({ lastChanged: e2, stores: r2, windowEnd: { cursor: n2, oldestParticipantTs: s2[s2.length - 1].joinedAt } });
|
|
1784
1788
|
}
|
|
1785
|
-
class
|
|
1789
|
+
class Ee extends Y {
|
|
1786
1790
|
constructor(e2, t2, s2, n2, a2) {
|
|
1787
1791
|
super(e2, n2, a2), this.getConvDataStore = t2, this.realtimeClient = s2, this.handlers = a2, this.unsubscribeDebounceMs = 1e4, this.pendingLoadMore = void 0;
|
|
1788
1792
|
}
|
|
1789
1793
|
fetchInitial(e2) {
|
|
1790
1794
|
return __async(this, null, function* () {
|
|
1791
|
-
const t2 = yield
|
|
1792
|
-
return t2.ok ? null === t2.value.conversations ? o({ lastChanged: e2, stores: null, windowEnd: null }) :
|
|
1795
|
+
const t2 = yield Me({ realtimeClient: this.realtimeClient, count: 20 });
|
|
1796
|
+
return t2.ok ? null === t2.value.conversations ? o({ lastChanged: e2, stores: null, windowEnd: null }) : Ae({ seq: e2, conversations: t2.value.conversations, cursor: t2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2;
|
|
1793
1797
|
});
|
|
1794
1798
|
}
|
|
1795
1799
|
teardownNested(e2) {
|
|
@@ -1806,11 +1810,11 @@ class Se extends Y {
|
|
|
1806
1810
|
});
|
|
1807
1811
|
}
|
|
1808
1812
|
equal(e2, t2) {
|
|
1809
|
-
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!
|
|
1813
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!D(Object.keys(e2.stores), Object.keys(t2.stores)) && D(e2.windowEnd, t2.windowEnd));
|
|
1810
1814
|
}
|
|
1811
1815
|
loadNested(e2, t2) {
|
|
1812
1816
|
return __async(this, null, function* () {
|
|
1813
|
-
if (null === t2.stores) return o({ snapshot:
|
|
1817
|
+
if (null === t2.stores) return o({ snapshot: x([]), loadedAll: true });
|
|
1814
1818
|
const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.store.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1815
1819
|
if (n2) return n2;
|
|
1816
1820
|
const a2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
|
|
@@ -1818,7 +1822,7 @@ class Se extends Y {
|
|
|
1818
1822
|
var _a2, _b2, _c, _d;
|
|
1819
1823
|
const s3 = (_b2 = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b2 : e3.joinedAt;
|
|
1820
1824
|
return ((_d = (_c = t3.lastMessage) == null ? void 0 : _c.createdAt) != null ? _d : t3.joinedAt) - s3;
|
|
1821
|
-
}), o({ snapshot:
|
|
1825
|
+
}), o({ snapshot: x(a2), loadedAll: null === t2.windowEnd });
|
|
1822
1826
|
});
|
|
1823
1827
|
}
|
|
1824
1828
|
loadMore(e2) {
|
|
@@ -1833,21 +1837,12 @@ class Se extends Y {
|
|
|
1833
1837
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1834
1838
|
if (!t2.ok) return;
|
|
1835
1839
|
if (null === t2.value.windowEnd) return;
|
|
1836
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1840
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield Me({ count: e2, cursor: s2, realtimeClient: this.realtimeClient });
|
|
1837
1841
|
yield this.handlers.onLoadedMore({ type: "virtual.conversations.loadedmore", data: n2 });
|
|
1838
1842
|
});
|
|
1839
1843
|
}
|
|
1840
|
-
getConvFromCache(e2) {
|
|
1841
|
-
return __async(this, null, function* () {
|
|
1842
|
-
const t2 = yield this.mostRecentState.resultPromise;
|
|
1843
|
-
if (!t2.ok) return c("NOT_IN_CACHE");
|
|
1844
|
-
if (null === t2.value.stores) return l({ status: 404, errorCode: "USER_NOT_FOUND", reasons: ["No user with that ID exists"] });
|
|
1845
|
-
const s2 = t2.value.stores[e2];
|
|
1846
|
-
return void 0 === s2 ? c("NOT_IN_CACHE") : s2.store.getFromCache();
|
|
1847
|
-
});
|
|
1848
|
-
}
|
|
1849
1844
|
loadedMore(e2, t2) {
|
|
1850
|
-
this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), s2) :
|
|
1845
|
+
this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), s2) : Ae({ seq: e2, prevStores: s2.value.stores, conversations: t2.data.value.conversations, cursor: t2.data.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2.data);
|
|
1851
1846
|
}
|
|
1852
1847
|
userCreated(e2, t2) {
|
|
1853
1848
|
this.mutate(e2, (e3) => null !== e3.value.stores ? e3 : o({ lastChanged: e3.value.lastChanged, stores: {}, windowEnd: null }));
|
|
@@ -1886,7 +1881,7 @@ class Se extends Y {
|
|
|
1886
1881
|
});
|
|
1887
1882
|
}
|
|
1888
1883
|
}
|
|
1889
|
-
function
|
|
1884
|
+
function Me(_0) {
|
|
1890
1885
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, count: s2 }) {
|
|
1891
1886
|
const n2 = { limit: s2, cursor: e2 }, a2 = yield t2.call({ method: "GET", path: ["me", "conversations"], data: n2, flags: { bypassCache: true } });
|
|
1892
1887
|
if (a2.ok) {
|
|
@@ -1896,13 +1891,13 @@ function Ee(_0) {
|
|
|
1896
1891
|
return a2.ok || "server" !== a2.where || 404 !== a2.value.status || "USER_NOT_FOUND" !== a2.value.errorCode ? a2 : o({ conversations: null, nextCursor: null });
|
|
1897
1892
|
});
|
|
1898
1893
|
}
|
|
1899
|
-
function
|
|
1894
|
+
function Ae({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: a2 }) {
|
|
1900
1895
|
const r2 = t2 ? __spreadValues({}, t2) : {};
|
|
1901
1896
|
for (const e3 of s2) void 0 === r2[e3.id] && (r2[e3.id] = a2(e3));
|
|
1902
1897
|
if (null === n2) return o({ lastChanged: e2, stores: r2, windowEnd: null });
|
|
1903
1898
|
return o({ lastChanged: e2, stores: r2, windowEnd: { cursor: n2, oldestMessageTs: Math.min(...s2.map((e3) => e3.lastMessageAt)) } });
|
|
1904
1899
|
}
|
|
1905
|
-
class
|
|
1900
|
+
class Ne extends Y {
|
|
1906
1901
|
constructor(e2, t2, s2, n2, a2) {
|
|
1907
1902
|
super(e2, n2, a2), this.conversation = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 0;
|
|
1908
1903
|
}
|
|
@@ -1934,7 +1929,7 @@ class Ae extends Y {
|
|
|
1934
1929
|
});
|
|
1935
1930
|
}
|
|
1936
1931
|
equal(e2, t2) {
|
|
1937
|
-
return
|
|
1932
|
+
return D(e2.snapshot, t2.snapshot);
|
|
1938
1933
|
}
|
|
1939
1934
|
loadNested(e2, t2) {
|
|
1940
1935
|
return __async(this, null, function* () {
|
|
@@ -1943,17 +1938,17 @@ class Ae extends Y {
|
|
|
1943
1938
|
const s2 = yield t2.messageWindow.store.getDeep(e2);
|
|
1944
1939
|
if (!s2.ok) return s2;
|
|
1945
1940
|
const n2 = s2.value.snapshot, a2 = (_a2 = n2 == null ? void 0 : n2[0]) != null ? _a2 : null;
|
|
1946
|
-
return o({ snapshot:
|
|
1941
|
+
return o({ snapshot: x(__spreadProps(__spreadValues({}, t2.snapshot), { custom: x(t2.snapshot.custom), welcomeMessages: x(t2.snapshot.welcomeMessages), lastMessage: a2 })) });
|
|
1947
1942
|
});
|
|
1948
1943
|
}
|
|
1949
1944
|
participantEdited(e2, t2) {
|
|
1950
|
-
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) : o({ lastChanged: e2, snapshot:
|
|
1945
|
+
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) : o({ lastChanged: e2, snapshot: Re(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
|
|
1951
1946
|
}
|
|
1952
1947
|
conversationEdited(e2, t2) {
|
|
1953
|
-
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) : o({ lastChanged: e2, snapshot:
|
|
1948
|
+
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) : o({ lastChanged: e2, snapshot: Re(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
|
|
1954
1949
|
}
|
|
1955
1950
|
sideEdited(e2, t2) {
|
|
1956
|
-
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) : o({ lastChanged: e2, snapshot:
|
|
1951
|
+
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) : o({ lastChanged: e2, snapshot: Re(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
|
|
1957
1952
|
}
|
|
1958
1953
|
sideCreated(e2, t2) {
|
|
1959
1954
|
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : o({ lastChanged: e2, snapshot: t2.state, messageWindow: s2.value.messageWindow }));
|
|
@@ -1968,11 +1963,11 @@ class Ae extends Y {
|
|
|
1968
1963
|
});
|
|
1969
1964
|
}
|
|
1970
1965
|
}
|
|
1971
|
-
function
|
|
1966
|
+
function Re(e2, t2) {
|
|
1972
1967
|
const s2 = t2;
|
|
1973
1968
|
return { id: e2.id, createdAt: e2.createdAt, subject: A(e2.subject, s2.subject), photoUrl: A(e2.photoUrl, s2.photoUrl), welcomeMessages: N(e2.welcomeMessages, s2.welcomeMessages), custom: R(e2.custom, s2.custom), lastMessageAt: A(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: A(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: A(e2.isUnread, s2.isUnread), access: A(e2.access, s2.access), notify: A(e2.notify, s2.notify), readUntil: A(e2.readUntil, s2.readUntil), everyoneReadUntil: A(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
|
|
1974
1969
|
}
|
|
1975
|
-
class
|
|
1970
|
+
class De extends Y {
|
|
1976
1971
|
constructor(e2, t2, s2, n2, a2) {
|
|
1977
1972
|
super(e2, n2, a2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 3e4;
|
|
1978
1973
|
}
|
|
@@ -1983,7 +1978,7 @@ class Re extends Y {
|
|
|
1983
1978
|
});
|
|
1984
1979
|
}
|
|
1985
1980
|
equal(e2, t2) {
|
|
1986
|
-
return
|
|
1981
|
+
return D(e2.data, t2.data);
|
|
1987
1982
|
}
|
|
1988
1983
|
teardownNested(e2) {
|
|
1989
1984
|
e2.user.unsubscribe();
|
|
@@ -1998,7 +1993,7 @@ class Re extends Y {
|
|
|
1998
1993
|
const s2 = yield t2.user.store.getDeep(e2);
|
|
1999
1994
|
if (!s2.ok) return s2;
|
|
2000
1995
|
const n2 = s2.value.snapshot;
|
|
2001
|
-
return null === t2.data || null === n2 ? o({ snapshot: null }) : o({ snapshot:
|
|
1996
|
+
return null === t2.data || null === n2 ? o({ snapshot: null }) : o({ snapshot: x(__spreadProps(__spreadValues({}, t2.data), { user: n2 })) });
|
|
2002
1997
|
});
|
|
2003
1998
|
}
|
|
2004
1999
|
userCreated(e2, t2) {
|
|
@@ -2022,9 +2017,35 @@ class Re extends Y {
|
|
|
2022
2017
|
});
|
|
2023
2018
|
}
|
|
2024
2019
|
}
|
|
2025
|
-
class _e {
|
|
2020
|
+
class _e extends Y {
|
|
2021
|
+
constructor(e2, t2, s2, n2, a2) {
|
|
2022
|
+
super(e2, n2, a2), this.participantData = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 3e4;
|
|
2023
|
+
}
|
|
2024
|
+
fetchInitial(e2) {
|
|
2025
|
+
return __async(this, null, function* () {
|
|
2026
|
+
return o({ lastChanged: e2, participantData: this.participantData });
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
teardownNested(e2) {
|
|
2030
|
+
e2.participantData.unsubscribe();
|
|
2031
|
+
}
|
|
2032
|
+
anyChildChanged(e2, t2, s2) {
|
|
2033
|
+
return __async(this, null, function* () {
|
|
2034
|
+
return s2.participantData.store.changedBetween(e2, t2);
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2037
|
+
equal(e2, t2) {
|
|
2038
|
+
return true;
|
|
2039
|
+
}
|
|
2040
|
+
loadNested(e2, t2) {
|
|
2041
|
+
return __async(this, null, function* () {
|
|
2042
|
+
return t2.participantData.store.getDeep(e2);
|
|
2043
|
+
});
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
class Oe {
|
|
2026
2047
|
constructor(e2, t2, s2) {
|
|
2027
|
-
this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new F(), this.virtualSeqOffset = 0, this.realPublishSeq = 0, this.refetchOnNextNetworkLoss = true, this.connection = new G(e2, t2, { onUpstreamRestarting: () => {
|
|
2048
|
+
this.realtimeClient = s2, this.convDataStores = {}, this.participantDataStores = {}, this.storeMap = {}, this.emitMutex = new F(), this.virtualSeqOffset = 0, this.realPublishSeq = 0, this.refetchOnNextNetworkLoss = true, this.connection = new G(e2, t2, { onUpstreamRestarting: () => {
|
|
2028
2049
|
this.refetchOnNextNetworkLoss = false;
|
|
2029
2050
|
}, onReady: () => {
|
|
2030
2051
|
this.refetchOnNextNetworkLoss = true;
|
|
@@ -2036,7 +2057,7 @@ class _e {
|
|
|
2036
2057
|
}
|
|
2037
2058
|
}, onResubscribeError: (e3, t3) => {
|
|
2038
2059
|
var _a2;
|
|
2039
|
-
(_a2 = this.storeMap[
|
|
2060
|
+
(_a2 = this.storeMap[Pe(e3)]) == null ? void 0 : _a2.setError(t3);
|
|
2040
2061
|
}, onPublish: (e3, t3) => {
|
|
2041
2062
|
this.realPublishSeq = e3;
|
|
2042
2063
|
const s3 = this.virtualSeq;
|
|
@@ -2062,52 +2083,53 @@ class _e {
|
|
|
2062
2083
|
}));
|
|
2063
2084
|
}
|
|
2064
2085
|
handlePublish(e2, t2) {
|
|
2065
|
-
var _a2, _b2, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p, _q, _r, _s2, _t3, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
2086
|
+
var _a2, _b2, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p, _q, _r, _s2, _t3, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
|
|
2066
2087
|
switch (t2.type) {
|
|
2067
2088
|
case "user.created":
|
|
2068
2089
|
return (_a2 = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _a2.userCreated(e2, t2), (_b2 = this.storeMap["/me/conversations"]) == null ? void 0 : _b2.userCreated(e2, t2), void ((_c = this.storeMap[`/users/${t2.userId}/online`]) == null ? void 0 : _c.userCreated(e2, t2));
|
|
2069
2090
|
case "user.edited":
|
|
2070
2091
|
return void ((_d = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _d.userEdited(e2, t2));
|
|
2071
2092
|
case "side.created":
|
|
2072
|
-
return (_e3 = this.convDataStores[t2.conversationId]) == null ? void 0 : _e3.sideCreated(e2, t2), (_f = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 :
|
|
2093
|
+
return (_e3 = this.convDataStores[t2.conversationId]) == null ? void 0 : _e3.sideCreated(e2, t2), Object.values((_f = this.participantDataStores[t2.conversationId]) != null ? _f : {}).forEach((s2) => s2.sideCreated(e2, t2)), (_g = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _g.sideCreated(e2, t2), (_h = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _h.sideCreated(e2, t2), void ((_i = this.storeMap["/me/conversations"]) == null ? void 0 : _i.sideCreated(e2, t2));
|
|
2073
2094
|
case "side.edited":
|
|
2074
|
-
return (
|
|
2095
|
+
return (_j = this.convDataStores[t2.conversationId]) == null ? void 0 : _j.sideEdited(e2, t2), void ((_k = this.storeMap["/me/conversations"]) == null ? void 0 : _k.sideEdited(e2, t2));
|
|
2075
2096
|
case "side.deleted":
|
|
2076
|
-
return (
|
|
2097
|
+
return (_l = this.convDataStores[t2.conversationId]) == null ? void 0 : _l.sideDeleted(e2, t2), Object.values((_m = this.participantDataStores[t2.conversationId]) != null ? _m : {}).forEach((s2) => s2.sideDeleted(e2, t2)), (_n2 = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _n2.sideDeleted(e2, t2), (_o = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _o.sideDeleted(e2, t2), (_p = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _p.sideDeleted(e2, t2), void ((_q = this.storeMap["/me/conversations"]) == null ? void 0 : _q.sideDeleted(e2, t2));
|
|
2077
2098
|
case "conversation.edited":
|
|
2078
|
-
return void ((
|
|
2099
|
+
return void ((_r = this.convDataStores[t2.conversationId]) == null ? void 0 : _r.conversationEdited(e2, t2));
|
|
2079
2100
|
case "message.created":
|
|
2080
|
-
return void ((
|
|
2101
|
+
return void ((_s2 = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _s2.messageCreated(e2, t2));
|
|
2081
2102
|
case "message.edited":
|
|
2082
|
-
return void ((
|
|
2103
|
+
return void ((_t3 = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _t3.messageEdited(e2, t2));
|
|
2083
2104
|
case "message.deleted":
|
|
2084
|
-
return void ((
|
|
2105
|
+
return void ((_u = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _u.messageDeleted(e2, t2));
|
|
2085
2106
|
case "typing.available":
|
|
2086
|
-
return void ((
|
|
2107
|
+
return void ((_v = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _v.typingAvailable(e2, t2));
|
|
2087
2108
|
case "typing.changed":
|
|
2088
|
-
return void ((
|
|
2109
|
+
return void ((_w = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _w.typingChanged(e2, t2));
|
|
2089
2110
|
case "conversation.cleared":
|
|
2090
|
-
return void ((
|
|
2111
|
+
return void ((_x = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _x.conversationCleared(e2, t2));
|
|
2091
2112
|
case "participant.edited":
|
|
2092
|
-
return (
|
|
2113
|
+
return (_y = this.convDataStores[t2.conversationId]) == null ? void 0 : _y.participantEdited(e2, t2), void ((_A = (_z = this.participantDataStores[t2.conversationId]) == null ? void 0 : _z[t2.userId]) == null ? void 0 : _A.participantEdited(e2, t2));
|
|
2093
2114
|
case "participant.created":
|
|
2094
|
-
return void ((
|
|
2115
|
+
return (_C = (_B = this.participantDataStores[t2.conversationId]) == null ? void 0 : _B[t2.userId]) == null ? void 0 : _C.participantCreated(e2, t2), void ((_D = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _D.participantCreated(e2, t2));
|
|
2095
2116
|
case "participant.deleted":
|
|
2096
|
-
return void ((
|
|
2117
|
+
return (_F = (_E = this.participantDataStores[t2.conversationId]) == null ? void 0 : _E[t2.userId]) == null ? void 0 : _F.participantDeleted(e2, t2), void ((_G = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _G.participantDeleted(e2, t2));
|
|
2097
2118
|
case "user.online.changed":
|
|
2098
|
-
return void ((
|
|
2119
|
+
return void ((_H = this.storeMap[`/users/${t2.userId}/online`]) == null ? void 0 : _H.userOnlineChanged(e2, t2));
|
|
2099
2120
|
case "virtual.conversations.loadedmore":
|
|
2100
|
-
return void ((
|
|
2121
|
+
return void ((_I = this.storeMap["/me/conversations"]) == null ? void 0 : _I.loadedMore(e2, t2));
|
|
2101
2122
|
case "virtual.messages.loadedmore":
|
|
2102
|
-
return void ((
|
|
2123
|
+
return void ((_J = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _J.loadedMore(e2, t2));
|
|
2103
2124
|
case "virtual.participants.loadedmore":
|
|
2104
|
-
return void ((
|
|
2125
|
+
return void ((_K = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _K.loadedMore(e2, t2));
|
|
2105
2126
|
}
|
|
2106
2127
|
}
|
|
2107
2128
|
call(_0) {
|
|
2108
2129
|
return __async(this, arguments, function* ({ method: t2, path: s2, data: n2, headers: a2, flags: r2 }) {
|
|
2130
|
+
var _a2;
|
|
2109
2131
|
if (true !== (r2 == null ? void 0 : r2.bypassCache) && "GET" === t2) {
|
|
2110
|
-
const t3 =
|
|
2132
|
+
const t3 = Pe(s2);
|
|
2111
2133
|
if (t3 in this.storeMap) {
|
|
2112
2134
|
const e2 = t3, s3 = this.storeMap[e2];
|
|
2113
2135
|
if (s3 && "getFromCache" in s3) {
|
|
@@ -2123,17 +2145,17 @@ class _e {
|
|
|
2123
2145
|
if ("NOT_IN_CACHE" !== t4.value) return t4;
|
|
2124
2146
|
}
|
|
2125
2147
|
} else if (e(s2, ["me", "conversations", "*", "participants", "*"])) {
|
|
2126
|
-
const e2 = this.
|
|
2148
|
+
const e2 = (_a2 = this.participantDataStores[s2[2]]) == null ? void 0 : _a2[s2[4]];
|
|
2127
2149
|
if (e2) {
|
|
2128
2150
|
yield this.sync();
|
|
2129
|
-
const t4 = yield e2.
|
|
2151
|
+
const t4 = yield e2.getFromCache();
|
|
2130
2152
|
if ("NOT_IN_CACHE" !== t4.value) return t4;
|
|
2131
2153
|
}
|
|
2132
2154
|
} else if (e(s2, ["me", "conversations", "*"])) {
|
|
2133
|
-
const e2 = this.
|
|
2155
|
+
const e2 = this.convDataStores[s2[2]];
|
|
2134
2156
|
if (e2) {
|
|
2135
2157
|
yield this.sync();
|
|
2136
|
-
const t4 = yield e2.
|
|
2158
|
+
const t4 = yield e2.getFromCache();
|
|
2137
2159
|
if ("NOT_IN_CACHE" !== t4.value) return t4;
|
|
2138
2160
|
}
|
|
2139
2161
|
}
|
|
@@ -2183,7 +2205,7 @@ class _e {
|
|
|
2183
2205
|
});
|
|
2184
2206
|
}
|
|
2185
2207
|
getOrCreateStore(e2) {
|
|
2186
|
-
const t2 =
|
|
2208
|
+
const t2 = Pe(e2);
|
|
2187
2209
|
if (t2 in this.storeMap) return this.storeMap[t2];
|
|
2188
2210
|
this.connection.subscribe(e2).then((e3) => {
|
|
2189
2211
|
e3.ok || s2.setError(e3);
|
|
@@ -2194,7 +2216,7 @@ class _e {
|
|
|
2194
2216
|
return this.storeMap[t2] = s2, s2;
|
|
2195
2217
|
}
|
|
2196
2218
|
destroy() {
|
|
2197
|
-
this.storeMap = {}, this.convDataStores = {}, this.connection.destroy();
|
|
2219
|
+
this.storeMap = {}, this.convDataStores = {}, this.participantDataStores = {}, this.connection.destroy();
|
|
2198
2220
|
}
|
|
2199
2221
|
isConnected() {
|
|
2200
2222
|
return this.connection.isConnected();
|
|
@@ -2203,10 +2225,11 @@ class _e {
|
|
|
2203
2225
|
if (e(t2, ["users", "*"])) return new ue(this.virtualSeq, t2[1], this.realtimeClient, this.emitMutex, { onTeardown: s2 });
|
|
2204
2226
|
if (e(t2, ["me", "conversations", "*"])) return new be(this.virtualSeq, this.subscribeConvData(t2[2]), this.realtimeClient, this.emitMutex, { onTeardown: s2 });
|
|
2205
2227
|
if (e(t2, ["me", "conversations", "*", "messages"])) return new fe(this.virtualSeq, t2[2], this.realtimeClient, this.emitMutex, { onTeardown: s2, onLoadedMore: (e2) => this.onVirtualPublish(e2) });
|
|
2206
|
-
if (e(t2, ["me", "conversations", "*", "participants"])) return new
|
|
2228
|
+
if (e(t2, ["me", "conversations", "*", "participants"])) return new Ie(this.virtualSeq, (e2) => this.subscribeParticipantData(t2[2], e2), t2[2], this.realtimeClient, this.emitMutex, { onTeardown: s2, onLoadedMore: (e2) => this.onVirtualPublish(e2) });
|
|
2229
|
+
if (e(t2, ["me", "conversations", "*", "participants", "*"])) return new _e(this.virtualSeq, this.subscribeParticipantData(t2[2], t2[4]), this.realtimeClient, this.emitMutex, { onTeardown: s2 });
|
|
2207
2230
|
if (e(t2, ["me", "conversations", "*", "typing"])) return new ke(this.virtualSeq, t2[2], this.realtimeClient, this.emitMutex, { onTeardown: s2 });
|
|
2208
|
-
if (e(t2, ["me", "conversations"])) return new
|
|
2209
|
-
if (e(t2, ["users", "*", "online"])) return new
|
|
2231
|
+
if (e(t2, ["me", "conversations"])) return new Ee(this.virtualSeq, (e2) => this.subscribeConvData(e2), this.realtimeClient, this.emitMutex, { onTeardown: s2, onLoadedMore: (e2) => this.onVirtualPublish(e2) });
|
|
2232
|
+
if (e(t2, ["users", "*", "online"])) return new De(this.virtualSeq, t2[1], this.realtimeClient, this.emitMutex, { onTeardown: s2 });
|
|
2210
2233
|
throw "Unreachable";
|
|
2211
2234
|
}
|
|
2212
2235
|
subscribeConvData(e2) {
|
|
@@ -2215,16 +2238,25 @@ class _e {
|
|
|
2215
2238
|
const e3 = this.convDataStores[t2];
|
|
2216
2239
|
return { store: e3, unsubscribe: e3.registerInternalSubscription() };
|
|
2217
2240
|
}
|
|
2218
|
-
const s2 = new
|
|
2241
|
+
const s2 = new Ne(this.virtualSeq, e2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
|
|
2219
2242
|
delete this.convDataStores[t2];
|
|
2220
2243
|
} });
|
|
2221
2244
|
return this.convDataStores[t2] = s2, { store: s2, unsubscribe: s2.registerInternalSubscription() };
|
|
2222
2245
|
}
|
|
2246
|
+
subscribeParticipantData(e2, t2) {
|
|
2247
|
+
var _a2, _b2;
|
|
2248
|
+
const s2 = "string" == typeof t2 ? t2 : t2.id, n2 = (_a2 = this.participantDataStores[e2]) == null ? void 0 : _a2[s2];
|
|
2249
|
+
if (n2) return { store: n2, unsubscribe: n2.registerInternalSubscription() };
|
|
2250
|
+
const a2 = (_b2 = this.participantDataStores[e2]) != null ? _b2 : {}, r2 = new Ce(this.virtualSeq, e2, t2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
|
|
2251
|
+
delete a2[s2], 0 === Object.keys(a2).length && delete this.participantDataStores[e2];
|
|
2252
|
+
} });
|
|
2253
|
+
return a2[s2] = r2, this.participantDataStores[e2] = a2, { store: r2, unsubscribe: r2.registerInternalSubscription() };
|
|
2254
|
+
}
|
|
2223
2255
|
}
|
|
2224
|
-
function
|
|
2256
|
+
function Pe(e2) {
|
|
2225
2257
|
return `/${e2.join("/")}`;
|
|
2226
2258
|
}
|
|
2227
|
-
class
|
|
2259
|
+
class je {
|
|
2228
2260
|
constructor(e2, t2) {
|
|
2229
2261
|
this.id = e2, this._realtimeClient = t2;
|
|
2230
2262
|
}
|
|
@@ -2234,7 +2266,7 @@ class Oe {
|
|
|
2234
2266
|
get() {
|
|
2235
2267
|
return __async(this, null, function* () {
|
|
2236
2268
|
const e2 = yield this._realtimeClient.getUser(this.brandedId);
|
|
2237
|
-
return
|
|
2269
|
+
return ta("Get user " + this.id, e2);
|
|
2238
2270
|
});
|
|
2239
2271
|
}
|
|
2240
2272
|
set(e2) {
|
|
@@ -2258,7 +2290,7 @@ class Oe {
|
|
|
2258
2290
|
return this._realtimeClient.subscribe(["users", this.brandedId, "online"], e2);
|
|
2259
2291
|
}
|
|
2260
2292
|
}
|
|
2261
|
-
class
|
|
2293
|
+
class $e {
|
|
2262
2294
|
constructor(e2, t2, s2) {
|
|
2263
2295
|
this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
2264
2296
|
}
|
|
@@ -2300,8 +2332,11 @@ class Pe {
|
|
|
2300
2332
|
(e2.ok || "server" !== e2.where || 404 !== e2.value.status) && d(`Remove participant ${this.userId} from conversation ${this.conversationId}`, e2);
|
|
2301
2333
|
});
|
|
2302
2334
|
}
|
|
2335
|
+
subscribe(e2) {
|
|
2336
|
+
return this._realtimeClient.subscribe(["me", "conversations", this.brandedConversationId, "participants", this.brandedUserId], e2);
|
|
2337
|
+
}
|
|
2303
2338
|
}
|
|
2304
|
-
function
|
|
2339
|
+
function Ue(e2) {
|
|
2305
2340
|
const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
2306
2341
|
let s2 = 0;
|
|
2307
2342
|
const n2 = [], a2 = e2 === s2;
|
|
@@ -2319,7 +2354,7 @@ function $e(e2) {
|
|
|
2319
2354
|
if (20 != i2.length) throw new Error("Length should be 20.");
|
|
2320
2355
|
return i2;
|
|
2321
2356
|
}
|
|
2322
|
-
const
|
|
2357
|
+
const We = (e2, t2, s2 = void 0) => (function(e3, t3) {
|
|
2323
2358
|
return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
|
|
2324
2359
|
})(e2, (e3) => {
|
|
2325
2360
|
if ("string" == typeof e3) return t2(e3, s2);
|
|
@@ -2332,14 +2367,14 @@ const Ue = (e2, t2, s2 = void 0) => (function(e3, t3) {
|
|
|
2332
2367
|
case "bulletList":
|
|
2333
2368
|
case "bulletpoint":
|
|
2334
2369
|
case "bulletPoint":
|
|
2335
|
-
return [{ type: e3.type, children:
|
|
2370
|
+
return [{ type: e3.type, children: We(e3.children, t2, e3.type) }];
|
|
2336
2371
|
case "link":
|
|
2337
|
-
return [{ type: e3.type, url: e3.url, children:
|
|
2372
|
+
return [{ type: e3.type, url: e3.url, children: We(e3.children, t2, e3.type) }];
|
|
2338
2373
|
case "actionlink":
|
|
2339
2374
|
case "actionLink":
|
|
2340
2375
|
case "actionbutton":
|
|
2341
2376
|
case "actionButton":
|
|
2342
|
-
return [{ type: e3.type, action: e3.action, params: e3.params, children:
|
|
2377
|
+
return [{ type: e3.type, action: e3.action, params: e3.params, children: We(e3.children, t2, e3.type) }];
|
|
2343
2378
|
case "mention":
|
|
2344
2379
|
case "autolink":
|
|
2345
2380
|
case "autoLink":
|
|
@@ -2354,7 +2389,7 @@ const Ue = (e2, t2, s2 = void 0) => (function(e3, t3) {
|
|
|
2354
2389
|
return [e3];
|
|
2355
2390
|
}
|
|
2356
2391
|
});
|
|
2357
|
-
function
|
|
2392
|
+
function qe(e2, t2) {
|
|
2358
2393
|
return (s2) => {
|
|
2359
2394
|
const n2 = s2;
|
|
2360
2395
|
let a2 = 0;
|
|
@@ -2367,29 +2402,29 @@ function je(e2, t2) {
|
|
|
2367
2402
|
return a2 < s2.length && r2.push(s2.substring(a2)), r2;
|
|
2368
2403
|
};
|
|
2369
2404
|
}
|
|
2370
|
-
const
|
|
2371
|
-
var
|
|
2372
|
-
const
|
|
2405
|
+
const Be = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
2406
|
+
var Le = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(Le || {});
|
|
2407
|
+
const Ge = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
|
|
2373
2408
|
const t2 = [];
|
|
2374
2409
|
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");
|
|
2375
|
-
}),
|
|
2376
|
-
function
|
|
2377
|
-
return
|
|
2410
|
+
}), Fe = { _: 1, "*": 4, "~": 2 };
|
|
2411
|
+
function He(e2) {
|
|
2412
|
+
return Je(e2, 0);
|
|
2378
2413
|
}
|
|
2379
|
-
function
|
|
2380
|
-
const s2 =
|
|
2381
|
-
const t3 =
|
|
2414
|
+
function Je(e2, t2 = 0) {
|
|
2415
|
+
const s2 = Ge[t2], n2 = s2 ? (function(e3) {
|
|
2416
|
+
const t3 = ze.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${Be}])(?:${e3.source})(?=[\\s${Be}]|$)`, "g")), s3 = qe(t3, (e4) => {
|
|
2382
2417
|
const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
|
|
2383
|
-
return [" ", { type:
|
|
2418
|
+
return [" ", { type: Le[Fe[t4]], children: [s4] }];
|
|
2384
2419
|
});
|
|
2385
2420
|
return (e4) => {
|
|
2386
2421
|
const [t4, ...n3] = s3(" " + e4);
|
|
2387
2422
|
return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
|
|
2388
2423
|
};
|
|
2389
2424
|
})(s2) : () => [e2];
|
|
2390
|
-
return
|
|
2425
|
+
return We(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Je(e3, t2 | Le[s3]) : [e3]);
|
|
2391
2426
|
}
|
|
2392
|
-
const
|
|
2427
|
+
const ze = (function() {
|
|
2393
2428
|
const e2 = (function() {
|
|
2394
2429
|
try {
|
|
2395
2430
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -2405,38 +2440,38 @@ const He = (function() {
|
|
|
2405
2440
|
return e2.set(t2, n2), n2;
|
|
2406
2441
|
} };
|
|
2407
2442
|
})();
|
|
2408
|
-
var
|
|
2409
|
-
return
|
|
2443
|
+
var Ye = function(e2, t2) {
|
|
2444
|
+
return Ye = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
|
|
2410
2445
|
e3.__proto__ = t3;
|
|
2411
2446
|
} || function(e3, t3) {
|
|
2412
2447
|
for (var s2 in t3) Object.prototype.hasOwnProperty.call(t3, s2) && (e3[s2] = t3[s2]);
|
|
2413
|
-
},
|
|
2448
|
+
}, Ye(e2, t2);
|
|
2414
2449
|
};
|
|
2415
|
-
function
|
|
2450
|
+
function Qe(e2, t2) {
|
|
2416
2451
|
if ("function" != typeof t2 && null !== t2) throw new TypeError("Class extends value " + String(t2) + " is not a constructor or null");
|
|
2417
2452
|
function s2() {
|
|
2418
2453
|
this.constructor = e2;
|
|
2419
2454
|
}
|
|
2420
|
-
|
|
2455
|
+
Ye(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
|
|
2421
2456
|
}
|
|
2422
|
-
var
|
|
2423
|
-
return
|
|
2457
|
+
var Ve = function() {
|
|
2458
|
+
return Ve = Object.assign || function(e2) {
|
|
2424
2459
|
for (var t2, s2 = 1, n2 = arguments.length; s2 < n2; s2++) for (var a2 in t2 = arguments[s2]) Object.prototype.hasOwnProperty.call(t2, a2) && (e2[a2] = t2[a2]);
|
|
2425
2460
|
return e2;
|
|
2426
|
-
},
|
|
2461
|
+
}, Ve.apply(this, arguments);
|
|
2427
2462
|
};
|
|
2428
2463
|
"function" == typeof SuppressedError && SuppressedError;
|
|
2429
|
-
var
|
|
2430
|
-
function
|
|
2464
|
+
var Ke = Object.prototype.hasOwnProperty;
|
|
2465
|
+
function Ze(e2) {
|
|
2431
2466
|
return "boolean" == typeof e2;
|
|
2432
2467
|
}
|
|
2433
|
-
function
|
|
2468
|
+
function Xe(e2, t2) {
|
|
2434
2469
|
for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
|
|
2435
2470
|
}
|
|
2436
|
-
function
|
|
2471
|
+
function et(e2) {
|
|
2437
2472
|
throw new Error("Unhandled case for value: '".concat(e2, "'"));
|
|
2438
2473
|
}
|
|
2439
|
-
var
|
|
2474
|
+
var tt = /\s+/, st = (function() {
|
|
2440
2475
|
function e2(e3) {
|
|
2441
2476
|
void 0 === e3 && (e3 = {}), this.tagName = "", this.attrs = {}, this.innerHTML = "", this.tagName = e3.tagName || "", this.attrs = e3.attrs || {}, this.innerHTML = e3.innerHtml || e3.innerHTML || "";
|
|
2442
2477
|
}
|
|
@@ -2455,10 +2490,10 @@ var Xe = /\s+/, et = (function() {
|
|
|
2455
2490
|
}, e2.prototype.setClass = function(e3) {
|
|
2456
2491
|
return this.setAttr("class", e3);
|
|
2457
2492
|
}, e2.prototype.addClass = function(e3) {
|
|
2458
|
-
for (var t2, s2 = this.getClass(), n2 = s2 ? s2.split(
|
|
2493
|
+
for (var t2, s2 = this.getClass(), n2 = s2 ? s2.split(tt) : [], a2 = e3.split(tt); t2 = a2.shift(); ) -1 === n2.indexOf(t2) && n2.push(t2);
|
|
2459
2494
|
return this.getAttrs().class = n2.join(" "), this;
|
|
2460
2495
|
}, e2.prototype.removeClass = function(e3) {
|
|
2461
|
-
for (var t2, s2 = this.getClass(), n2 = s2 ? s2.split(
|
|
2496
|
+
for (var t2, s2 = this.getClass(), n2 = s2 ? s2.split(tt) : [], a2 = e3.split(tt); n2.length && (t2 = a2.shift()); ) {
|
|
2462
2497
|
var r2 = n2.indexOf(t2);
|
|
2463
2498
|
-1 !== r2 && n2.splice(r2, 1);
|
|
2464
2499
|
}
|
|
@@ -2480,24 +2515,24 @@ var Xe = /\s+/, et = (function() {
|
|
|
2480
2515
|
return ["<", e3, t2 = t2 ? " " + t2 : "", ">", this.getInnerHtml(), "</", e3, ">"].join("");
|
|
2481
2516
|
}, e2.prototype.buildAttrsStr = function() {
|
|
2482
2517
|
var e3 = this.getAttrs(), t2 = [];
|
|
2483
|
-
for (var s2 in e3)
|
|
2518
|
+
for (var s2 in e3) Ke.call(e3, s2) && t2.push(s2 + '="' + e3[s2] + '"');
|
|
2484
2519
|
return t2.join(" ");
|
|
2485
2520
|
}, e2;
|
|
2486
2521
|
})();
|
|
2487
|
-
function
|
|
2522
|
+
function nt(e2) {
|
|
2488
2523
|
var t2 = "";
|
|
2489
2524
|
return e2.scheme && e2.host && (t2 += e2.scheme + "://"), e2.host && (t2 += e2.host), e2.path && (t2 += "/" + e2.path), e2.query && (t2 += "?" + e2.query), e2.fragment && (t2 += "#" + e2.fragment), t2;
|
|
2490
2525
|
}
|
|
2491
|
-
function
|
|
2526
|
+
function at(e2, t2, s2) {
|
|
2492
2527
|
var n2 = t2 / 2, a2 = Math.ceil(n2), r2 = -1 * Math.floor(n2), i2 = "";
|
|
2493
2528
|
return r2 < 0 && (i2 = e2.substr(r2)), e2.substr(0, a2) + s2 + i2;
|
|
2494
2529
|
}
|
|
2495
|
-
var
|
|
2530
|
+
var rt = (function() {
|
|
2496
2531
|
function e2(e3) {
|
|
2497
2532
|
void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
|
|
2498
2533
|
}
|
|
2499
2534
|
return e2.prototype.build = function(e3) {
|
|
2500
|
-
return new
|
|
2535
|
+
return new st({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
|
|
2501
2536
|
}, e2.prototype.createAttrs = function(e3) {
|
|
2502
2537
|
var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
|
|
2503
2538
|
return s2 && (t2.class = s2), this.newWindow && (t2.target = "_blank", t2.rel = "noopener noreferrer"), this.truncate.length && this.truncate.length < e3.getAnchorText().length && (t2.title = e3.getAnchorHref()), t2;
|
|
@@ -2523,20 +2558,20 @@ var nt = (function() {
|
|
|
2523
2558
|
})(e4);
|
|
2524
2559
|
if (i2.query) {
|
|
2525
2560
|
var o2 = i2.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);
|
|
2526
|
-
o2 && (i2.query = i2.query.substr(0, o2[1].length), e4 =
|
|
2561
|
+
o2 && (i2.query = i2.query.substr(0, o2[1].length), e4 = nt(i2));
|
|
2527
2562
|
}
|
|
2528
2563
|
if (e4.length <= t3) return e4;
|
|
2529
|
-
if (i2.host && (i2.host = i2.host.replace(/^www\./, ""), e4 =
|
|
2564
|
+
if (i2.host && (i2.host = i2.host.replace(/^www\./, ""), e4 = nt(i2)), e4.length <= t3) return e4;
|
|
2530
2565
|
var c2 = "";
|
|
2531
|
-
if (i2.host && (c2 += i2.host), c2.length >= r2) return i2.host.length === t3 ? (i2.host.substr(0, t3 - a2) + s3).substr(0, r2 + n3) :
|
|
2566
|
+
if (i2.host && (c2 += i2.host), c2.length >= r2) return i2.host.length === t3 ? (i2.host.substr(0, t3 - a2) + s3).substr(0, r2 + n3) : at(c2, r2, s3).substr(0, r2 + n3);
|
|
2532
2567
|
var l2 = "";
|
|
2533
2568
|
if (i2.path && (l2 += "/" + i2.path), i2.query && (l2 += "?" + i2.query), l2) {
|
|
2534
|
-
if ((c2 + l2).length >= r2) return (c2 + l2).length == t3 ? (c2 + l2).substr(0, t3) : (c2 +
|
|
2569
|
+
if ((c2 + l2).length >= r2) return (c2 + l2).length == t3 ? (c2 + l2).substr(0, t3) : (c2 + at(l2, r2 - c2.length, s3)).substr(0, r2 + n3);
|
|
2535
2570
|
c2 += l2;
|
|
2536
2571
|
}
|
|
2537
2572
|
if (i2.fragment) {
|
|
2538
2573
|
var h2 = "#" + i2.fragment;
|
|
2539
|
-
if ((c2 + h2).length >= r2) return (c2 + h2).length == t3 ? (c2 + h2).substr(0, t3) : (c2 +
|
|
2574
|
+
if ((c2 + h2).length >= r2) return (c2 + h2).length == t3 ? (c2 + h2).substr(0, t3) : (c2 + at(h2, r2 - c2.length, s3)).substr(0, r2 + n3);
|
|
2540
2575
|
c2 += h2;
|
|
2541
2576
|
}
|
|
2542
2577
|
if (i2.scheme && i2.host) {
|
|
@@ -2559,7 +2594,7 @@ var nt = (function() {
|
|
|
2559
2594
|
})(e4, t3, s3);
|
|
2560
2595
|
})(e3, s2);
|
|
2561
2596
|
}, e2;
|
|
2562
|
-
})(),
|
|
2597
|
+
})(), it = (function() {
|
|
2563
2598
|
function e2(e3) {
|
|
2564
2599
|
this._ = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
|
|
2565
2600
|
}
|
|
@@ -2575,55 +2610,55 @@ var nt = (function() {
|
|
|
2575
2610
|
return this.tagBuilder.build(this);
|
|
2576
2611
|
}, e2;
|
|
2577
2612
|
})();
|
|
2578
|
-
function
|
|
2613
|
+
function ot(e2) {
|
|
2579
2614
|
return e2 >= 65 && e2 <= 90 || e2 >= 97 && e2 <= 122;
|
|
2580
2615
|
}
|
|
2581
|
-
function
|
|
2616
|
+
function ct(e2) {
|
|
2582
2617
|
return e2 >= 48 && e2 <= 57;
|
|
2583
2618
|
}
|
|
2584
|
-
function
|
|
2619
|
+
function lt(e2) {
|
|
2585
2620
|
return 34 == e2 || 39 == e2;
|
|
2586
2621
|
}
|
|
2587
|
-
function
|
|
2622
|
+
function ht(e2) {
|
|
2588
2623
|
return e2 < 8232 ? e2 < 160 ? e2 >= 9 && e2 <= 13 || 32 == e2 : e2 < 5760 ? 160 == e2 : 5760 == e2 || e2 >= 8192 && e2 <= 8202 : e2 < 8287 ? e2 >= 8232 && e2 <= 8233 || 8239 == e2 : e2 < 12288 ? 8287 == e2 : 12288 == e2 || 65279 == e2;
|
|
2589
2624
|
}
|
|
2590
|
-
function
|
|
2625
|
+
function ut(e2) {
|
|
2591
2626
|
return e2 < 4800 ? e2 < 2949 ? e2 < 2451 ? e2 < 1425 ? e2 < 768 ? e2 < 192 ? e2 < 169 ? e2 < 65 ? e2 >= 48 && e2 <= 57 : e2 >= 65 && e2 <= 90 || e2 >= 97 && e2 <= 122 : e2 < 181 ? e2 >= 169 && e2 <= 170 || 174 == e2 : 181 == e2 || 186 == e2 : e2 < 710 ? e2 < 216 ? e2 >= 192 && e2 <= 214 : e2 >= 216 && e2 <= 246 || e2 >= 248 && e2 <= 705 : e2 < 748 ? e2 >= 710 && e2 <= 721 || e2 >= 736 && e2 <= 740 : 748 == e2 || 750 == e2 : e2 < 910 ? e2 < 895 ? e2 < 886 ? e2 >= 768 && e2 <= 884 : e2 >= 886 && e2 <= 887 || e2 >= 890 && e2 <= 893 : e2 < 904 ? 895 == e2 || 902 == e2 : e2 >= 904 && e2 <= 906 || 908 == e2 : e2 < 1155 ? e2 < 931 ? e2 >= 910 && e2 <= 929 : e2 >= 931 && e2 <= 1013 || e2 >= 1015 && e2 <= 1153 : e2 < 1369 ? e2 >= 1155 && e2 <= 1327 || e2 >= 1329 && e2 <= 1366 : 1369 == e2 || e2 >= 1377 && e2 <= 1415 : e2 < 1808 ? e2 < 1552 ? e2 < 1476 ? e2 < 1471 ? e2 >= 1425 && e2 <= 1469 : 1471 == e2 || e2 >= 1473 && e2 <= 1474 : e2 < 1488 ? e2 >= 1476 && e2 <= 1477 || 1479 == e2 : e2 >= 1488 && e2 <= 1514 || e2 >= 1520 && e2 <= 1522 : e2 < 1749 ? e2 < 1568 ? e2 >= 1552 && e2 <= 1562 : e2 >= 1568 && e2 <= 1641 || e2 >= 1646 && e2 <= 1747 : e2 < 1770 ? e2 >= 1749 && e2 <= 1756 || e2 >= 1759 && e2 <= 1768 : e2 >= 1770 && e2 <= 1788 || 1791 == e2 : e2 < 2230 ? e2 < 2042 ? e2 < 1869 ? e2 >= 1808 && e2 <= 1866 : e2 >= 1869 && e2 <= 1969 || e2 >= 1984 && e2 <= 2037 : e2 < 2112 ? 2042 == e2 || e2 >= 2048 && e2 <= 2093 : e2 >= 2112 && e2 <= 2139 || e2 >= 2208 && e2 <= 2228 : e2 < 2406 ? e2 < 2260 ? e2 >= 2230 && e2 <= 2237 : e2 >= 2260 && e2 <= 2273 || e2 >= 2275 && e2 <= 2403 : e2 < 2437 ? e2 >= 2406 && e2 <= 2415 || e2 >= 2417 && e2 <= 2435 : e2 >= 2437 && e2 <= 2444 || e2 >= 2447 && e2 <= 2448 : e2 < 2693 ? e2 < 2579 ? e2 < 2519 ? e2 < 2486 ? e2 < 2474 ? e2 >= 2451 && e2 <= 2472 : e2 >= 2474 && e2 <= 2480 || 2482 == e2 : e2 < 2503 ? e2 >= 2486 && e2 <= 2489 || e2 >= 2492 && e2 <= 2500 : e2 >= 2503 && e2 <= 2504 || e2 >= 2507 && e2 <= 2510 : e2 < 2534 ? e2 < 2524 ? 2519 == e2 : e2 >= 2524 && e2 <= 2525 || e2 >= 2527 && e2 <= 2531 : e2 < 2565 ? e2 >= 2534 && e2 <= 2545 || e2 >= 2561 && e2 <= 2563 : e2 >= 2565 && e2 <= 2570 || e2 >= 2575 && e2 <= 2576 : e2 < 2631 ? e2 < 2613 ? e2 < 2602 ? e2 >= 2579 && e2 <= 2600 : e2 >= 2602 && e2 <= 2608 || e2 >= 2610 && e2 <= 2611 : e2 < 2620 ? e2 >= 2613 && e2 <= 2614 || e2 >= 2616 && e2 <= 2617 : 2620 == e2 || e2 >= 2622 && e2 <= 2626 : e2 < 2649 ? e2 < 2635 ? e2 >= 2631 && e2 <= 2632 : e2 >= 2635 && e2 <= 2637 || 2641 == e2 : e2 < 2662 ? e2 >= 2649 && e2 <= 2652 || 2654 == e2 : e2 >= 2662 && e2 <= 2677 || e2 >= 2689 && e2 <= 2691 : e2 < 2821 ? e2 < 2759 ? e2 < 2730 ? e2 < 2703 ? e2 >= 2693 && e2 <= 2701 : e2 >= 2703 && e2 <= 2705 || e2 >= 2707 && e2 <= 2728 : e2 < 2741 ? e2 >= 2730 && e2 <= 2736 || e2 >= 2738 && e2 <= 2739 : e2 >= 2741 && e2 <= 2745 || e2 >= 2748 && e2 <= 2757 : e2 < 2784 ? e2 < 2763 ? e2 >= 2759 && e2 <= 2761 : e2 >= 2763 && e2 <= 2765 || 2768 == e2 : e2 < 2809 ? e2 >= 2784 && e2 <= 2787 || e2 >= 2790 && e2 <= 2799 : 2809 == e2 || e2 >= 2817 && e2 <= 2819 : e2 < 2887 ? e2 < 2858 ? e2 < 2831 ? e2 >= 2821 && e2 <= 2828 : e2 >= 2831 && e2 <= 2832 || e2 >= 2835 && e2 <= 2856 : e2 < 2869 ? e2 >= 2858 && e2 <= 2864 || e2 >= 2866 && e2 <= 2867 : e2 >= 2869 && e2 <= 2873 || e2 >= 2876 && e2 <= 2884 : e2 < 2911 ? e2 < 2902 ? e2 >= 2887 && e2 <= 2888 || e2 >= 2891 && e2 <= 2893 : e2 >= 2902 && e2 <= 2903 || e2 >= 2908 && e2 <= 2909 : e2 < 2929 ? e2 >= 2911 && e2 <= 2915 || e2 >= 2918 && e2 <= 2927 : 2929 == e2 || e2 >= 2946 && e2 <= 2947 : e2 < 3517 ? e2 < 3205 ? e2 < 3046 ? e2 < 2984 ? e2 < 2969 ? e2 < 2958 ? e2 >= 2949 && e2 <= 2954 : e2 >= 2958 && e2 <= 2960 || e2 >= 2962 && e2 <= 2965 : e2 < 2974 ? e2 >= 2969 && e2 <= 2970 || 2972 == e2 : e2 >= 2974 && e2 <= 2975 || e2 >= 2979 && e2 <= 2980 : e2 < 3014 ? e2 < 2990 ? e2 >= 2984 && e2 <= 2986 : e2 >= 2990 && e2 <= 3001 || e2 >= 3006 && e2 <= 3010 : e2 < 3024 ? e2 >= 3014 && e2 <= 3016 || e2 >= 3018 && e2 <= 3021 : 3024 == e2 || 3031 == e2 : e2 < 3142 ? e2 < 3086 ? e2 < 3072 ? e2 >= 3046 && e2 <= 3055 : e2 >= 3072 && e2 <= 3075 || e2 >= 3077 && e2 <= 3084 : e2 < 3114 ? e2 >= 3086 && e2 <= 3088 || e2 >= 3090 && e2 <= 3112 : e2 >= 3114 && e2 <= 3129 || e2 >= 3133 && e2 <= 3140 : e2 < 3160 ? e2 < 3146 ? e2 >= 3142 && e2 <= 3144 : e2 >= 3146 && e2 <= 3149 || e2 >= 3157 && e2 <= 3158 : e2 < 3174 ? e2 >= 3160 && e2 <= 3162 || e2 >= 3168 && e2 <= 3171 : e2 >= 3174 && e2 <= 3183 || e2 >= 3200 && e2 <= 3203 : e2 < 3333 ? e2 < 3274 ? e2 < 3242 ? e2 < 3214 ? e2 >= 3205 && e2 <= 3212 : e2 >= 3214 && e2 <= 3216 || e2 >= 3218 && e2 <= 3240 : e2 < 3260 ? e2 >= 3242 && e2 <= 3251 || e2 >= 3253 && e2 <= 3257 : e2 >= 3260 && e2 <= 3268 || e2 >= 3270 && e2 <= 3272 : e2 < 3296 ? e2 < 3285 ? e2 >= 3274 && e2 <= 3277 : e2 >= 3285 && e2 <= 3286 || 3294 == e2 : e2 < 3313 ? e2 >= 3296 && e2 <= 3299 || e2 >= 3302 && e2 <= 3311 : e2 >= 3313 && e2 <= 3314 || e2 >= 3329 && e2 <= 3331 : e2 < 3423 ? e2 < 3389 ? e2 < 3342 ? e2 >= 3333 && e2 <= 3340 : e2 >= 3342 && e2 <= 3344 || e2 >= 3346 && e2 <= 3386 : e2 < 3402 ? e2 >= 3389 && e2 <= 3396 || e2 >= 3398 && e2 <= 3400 : e2 >= 3402 && e2 <= 3406 || e2 >= 3412 && e2 <= 3415 : e2 < 3458 ? e2 < 3430 ? e2 >= 3423 && e2 <= 3427 : e2 >= 3430 && e2 <= 3439 || e2 >= 3450 && e2 <= 3455 : e2 < 3482 ? e2 >= 3458 && e2 <= 3459 || e2 >= 3461 && e2 <= 3478 : e2 >= 3482 && e2 <= 3505 || e2 >= 3507 && e2 <= 3515 : e2 < 3804 ? e2 < 3722 ? e2 < 3570 ? e2 < 3535 ? e2 < 3520 ? 3517 == e2 : e2 >= 3520 && e2 <= 3526 || 3530 == e2 : e2 < 3544 ? e2 >= 3535 && e2 <= 3540 || 3542 == e2 : e2 >= 3544 && e2 <= 3551 || e2 >= 3558 && e2 <= 3567 : e2 < 3664 ? e2 < 3585 ? e2 >= 3570 && e2 <= 3571 : e2 >= 3585 && e2 <= 3642 || e2 >= 3648 && e2 <= 3662 : e2 < 3716 ? e2 >= 3664 && e2 <= 3673 || e2 >= 3713 && e2 <= 3714 : 3716 == e2 || e2 >= 3719 && e2 <= 3720 : e2 < 3754 ? e2 < 3737 ? e2 < 3725 ? 3722 == e2 : 3725 == e2 || e2 >= 3732 && e2 <= 3735 : e2 < 3749 ? e2 >= 3737 && e2 <= 3743 || e2 >= 3745 && e2 <= 3747 : 3749 == e2 || 3751 == e2 : e2 < 3776 ? e2 < 3757 ? e2 >= 3754 && e2 <= 3755 : e2 >= 3757 && e2 <= 3769 || e2 >= 3771 && e2 <= 3773 : e2 < 3784 ? e2 >= 3776 && e2 <= 3780 || 3782 == e2 : e2 >= 3784 && e2 <= 3789 || e2 >= 3792 && e2 <= 3801 : e2 < 4176 ? e2 < 3902 ? e2 < 3872 ? e2 < 3840 ? e2 >= 3804 && e2 <= 3807 : 3840 == e2 || e2 >= 3864 && e2 <= 3865 : e2 < 3895 ? e2 >= 3872 && e2 <= 3881 || 3893 == e2 : 3895 == e2 || 3897 == e2 : e2 < 3974 ? e2 < 3913 ? e2 >= 3902 && e2 <= 3911 : e2 >= 3913 && e2 <= 3948 || e2 >= 3953 && e2 <= 3972 : e2 < 4038 ? e2 >= 3974 && e2 <= 3991 || e2 >= 3993 && e2 <= 4028 : 4038 == e2 || e2 >= 4096 && e2 <= 4169 : e2 < 4688 ? e2 < 4301 ? e2 < 4256 ? e2 >= 4176 && e2 <= 4253 : e2 >= 4256 && e2 <= 4293 || 4295 == e2 : e2 < 4348 ? 4301 == e2 || e2 >= 4304 && e2 <= 4346 : e2 >= 4348 && e2 <= 4680 || e2 >= 4682 && e2 <= 4685 : e2 < 4746 ? e2 < 4698 ? e2 >= 4688 && e2 <= 4694 || 4696 == e2 : e2 >= 4698 && e2 <= 4701 || e2 >= 4704 && e2 <= 4744 : e2 < 4786 ? e2 >= 4746 && e2 <= 4749 || e2 >= 4752 && e2 <= 4784 : e2 >= 4786 && e2 <= 4789 || e2 >= 4792 && e2 <= 4798 : e2 < 11035 ? e2 < 7416 ? e2 < 6176 ? e2 < 5873 ? e2 < 4992 ? e2 < 4824 ? e2 < 4802 ? 4800 == e2 : e2 >= 4802 && e2 <= 4805 || e2 >= 4808 && e2 <= 4822 : e2 < 4888 ? e2 >= 4824 && e2 <= 4880 || e2 >= 4882 && e2 <= 4885 : e2 >= 4888 && e2 <= 4954 || e2 >= 4957 && e2 <= 4959 : e2 < 5121 ? e2 < 5024 ? e2 >= 4992 && e2 <= 5007 : e2 >= 5024 && e2 <= 5109 || e2 >= 5112 && e2 <= 5117 : e2 < 5761 ? e2 >= 5121 && e2 <= 5740 || e2 >= 5743 && e2 <= 5759 : e2 >= 5761 && e2 <= 5786 || e2 >= 5792 && e2 <= 5866 : e2 < 6002 ? e2 < 5920 ? e2 < 5888 ? e2 >= 5873 && e2 <= 5880 : e2 >= 5888 && e2 <= 5900 || e2 >= 5902 && e2 <= 5908 : e2 < 5984 ? e2 >= 5920 && e2 <= 5940 || e2 >= 5952 && e2 <= 5971 : e2 >= 5984 && e2 <= 5996 || e2 >= 5998 && e2 <= 6e3 : e2 < 6108 ? e2 < 6016 ? e2 >= 6002 && e2 <= 6003 : e2 >= 6016 && e2 <= 6099 || 6103 == e2 : e2 < 6155 ? e2 >= 6108 && e2 <= 6109 || e2 >= 6112 && e2 <= 6121 : e2 >= 6155 && e2 <= 6157 || e2 >= 6160 && e2 <= 6169 : e2 < 6783 ? e2 < 6512 ? e2 < 6400 ? e2 < 6272 ? e2 >= 6176 && e2 <= 6263 : e2 >= 6272 && e2 <= 6314 || e2 >= 6320 && e2 <= 6389 : e2 < 6448 ? e2 >= 6400 && e2 <= 6430 || e2 >= 6432 && e2 <= 6443 : e2 >= 6448 && e2 <= 6459 || e2 >= 6470 && e2 <= 6509 : e2 < 6608 ? e2 < 6528 ? e2 >= 6512 && e2 <= 6516 : e2 >= 6528 && e2 <= 6571 || e2 >= 6576 && e2 <= 6601 : e2 < 6688 ? e2 >= 6608 && e2 <= 6617 || e2 >= 6656 && e2 <= 6683 : e2 >= 6688 && e2 <= 6750 || e2 >= 6752 && e2 <= 6780 : e2 < 7040 ? e2 < 6832 ? e2 < 6800 ? e2 >= 6783 && e2 <= 6793 : e2 >= 6800 && e2 <= 6809 || 6823 == e2 : e2 < 6992 ? e2 >= 6832 && e2 <= 6846 || e2 >= 6912 && e2 <= 6987 : e2 >= 6992 && e2 <= 7001 || e2 >= 7019 && e2 <= 7027 : e2 < 7245 ? e2 < 7168 ? e2 >= 7040 && e2 <= 7155 : e2 >= 7168 && e2 <= 7223 || e2 >= 7232 && e2 <= 7241 : e2 < 7376 ? e2 >= 7245 && e2 <= 7293 || e2 >= 7296 && e2 <= 7304 : e2 >= 7376 && e2 <= 7378 || e2 >= 7380 && e2 <= 7414 : e2 < 8450 ? e2 < 8130 ? e2 < 8025 ? e2 < 7960 ? e2 < 7424 ? e2 >= 7416 && e2 <= 7417 : e2 >= 7424 && e2 <= 7669 || e2 >= 7675 && e2 <= 7957 : e2 < 8008 ? e2 >= 7960 && e2 <= 7965 || e2 >= 7968 && e2 <= 8005 : e2 >= 8008 && e2 <= 8013 || e2 >= 8016 && e2 <= 8023 : e2 < 8031 ? e2 < 8027 ? 8025 == e2 : 8027 == e2 || 8029 == e2 : e2 < 8118 ? e2 >= 8031 && e2 <= 8061 || e2 >= 8064 && e2 <= 8116 : e2 >= 8118 && e2 <= 8124 || 8126 == e2 : e2 < 8205 ? e2 < 8150 ? e2 < 8134 ? e2 >= 8130 && e2 <= 8132 : e2 >= 8134 && e2 <= 8140 || e2 >= 8144 && e2 <= 8147 : e2 < 8178 ? e2 >= 8150 && e2 <= 8155 || e2 >= 8160 && e2 <= 8172 : e2 >= 8178 && e2 <= 8180 || e2 >= 8182 && e2 <= 8188 : e2 < 8305 ? e2 < 8252 ? 8205 == e2 : 8252 == e2 || 8265 == e2 : e2 < 8336 ? 8305 == e2 || 8319 == e2 : e2 >= 8336 && e2 <= 8348 || e2 >= 8400 && e2 <= 8432 : e2 < 8579 ? e2 < 8486 ? e2 < 8469 ? e2 < 8455 ? 8450 == e2 : 8455 == e2 || e2 >= 8458 && e2 <= 8467 : e2 < 8482 ? 8469 == e2 || e2 >= 8473 && e2 <= 8477 : 8482 == e2 || 8484 == e2 : e2 < 8495 ? e2 < 8488 ? 8486 == e2 : 8488 == e2 || e2 >= 8490 && e2 <= 8493 : e2 < 8517 ? e2 >= 8495 && e2 <= 8505 || e2 >= 8508 && e2 <= 8511 : e2 >= 8517 && e2 <= 8521 || 8526 == e2 : e2 < 9410 ? e2 < 9e3 ? e2 < 8592 ? e2 >= 8579 && e2 <= 8580 : e2 >= 8592 && e2 <= 8703 || e2 >= 8986 && e2 <= 8987 : e2 < 9193 ? 9e3 == e2 || 9167 == e2 : e2 >= 9193 && e2 <= 9203 || e2 >= 9208 && e2 <= 9210 : e2 < 9723 ? e2 < 9654 ? 9410 == e2 || e2 >= 9642 && e2 <= 9643 : 9654 == e2 || 9664 == e2 : e2 < 10548 ? e2 >= 9723 && e2 <= 9726 || e2 >= 9728 && e2 <= 10175 : e2 >= 10548 && e2 <= 10549 || e2 >= 11013 && e2 <= 11015 : e2 < 43259 ? e2 < 12445 ? e2 < 11688 ? e2 < 11520 ? e2 < 11264 ? e2 < 11088 ? e2 >= 11035 && e2 <= 11036 : 11088 == e2 || 11093 == e2 : e2 < 11360 ? e2 >= 11264 && e2 <= 11310 || e2 >= 11312 && e2 <= 11358 : e2 >= 11360 && e2 <= 11492 || e2 >= 11499 && e2 <= 11507 : e2 < 11568 ? e2 < 11559 ? e2 >= 11520 && e2 <= 11557 : 11559 == e2 || 11565 == e2 : e2 < 11647 ? e2 >= 11568 && e2 <= 11623 || 11631 == e2 : e2 >= 11647 && e2 <= 11670 || e2 >= 11680 && e2 <= 11686 : e2 < 11744 ? e2 < 11712 ? e2 < 11696 ? e2 >= 11688 && e2 <= 11694 : e2 >= 11696 && e2 <= 11702 || e2 >= 11704 && e2 <= 11710 : e2 < 11728 ? e2 >= 11712 && e2 <= 11718 || e2 >= 11720 && e2 <= 11726 : e2 >= 11728 && e2 <= 11734 || e2 >= 11736 && e2 <= 11742 : e2 < 12330 ? e2 < 11823 ? e2 >= 11744 && e2 <= 11775 : 11823 == e2 || e2 >= 12293 && e2 <= 12294 : e2 < 12353 ? e2 >= 12330 && e2 <= 12341 || e2 >= 12347 && e2 <= 12349 : e2 >= 12353 && e2 <= 12438 || e2 >= 12441 && e2 <= 12442 : e2 < 42512 ? e2 < 12951 ? e2 < 12549 ? e2 < 12449 ? e2 >= 12445 && e2 <= 12447 : e2 >= 12449 && e2 <= 12538 || e2 >= 12540 && e2 <= 12543 : e2 < 12704 ? e2 >= 12549 && e2 <= 12589 || e2 >= 12593 && e2 <= 12686 : e2 >= 12704 && e2 <= 12730 || e2 >= 12784 && e2 <= 12799 : e2 < 19968 ? e2 < 12953 ? 12951 == e2 : 12953 == e2 || e2 >= 13312 && e2 <= 19893 : e2 < 42192 ? e2 >= 19968 && e2 <= 40917 || e2 >= 40960 && e2 <= 42124 : e2 >= 42192 && e2 <= 42237 || e2 >= 42240 && e2 <= 42508 : e2 < 42891 ? e2 < 42623 ? e2 < 42560 ? e2 >= 42512 && e2 <= 42539 : e2 >= 42560 && e2 <= 42610 || e2 >= 42612 && e2 <= 42621 : e2 < 42775 ? e2 >= 42623 && e2 <= 42725 || e2 >= 42736 && e2 <= 42737 : e2 >= 42775 && e2 <= 42783 || e2 >= 42786 && e2 <= 42888 : e2 < 43072 ? e2 < 42928 ? e2 >= 42891 && e2 <= 42926 : e2 >= 42928 && e2 <= 42935 || e2 >= 42999 && e2 <= 43047 : e2 < 43216 ? e2 >= 43072 && e2 <= 43123 || e2 >= 43136 && e2 <= 43205 : e2 >= 43216 && e2 <= 43225 || e2 >= 43232 && e2 <= 43255 : e2 < 55243 ? e2 < 43744 ? e2 < 43488 ? e2 < 43312 ? e2 < 43261 ? 43259 == e2 : 43261 == e2 || e2 >= 43264 && e2 <= 43309 : e2 < 43392 ? e2 >= 43312 && e2 <= 43347 || e2 >= 43360 && e2 <= 43388 : e2 >= 43392 && e2 <= 43456 || e2 >= 43471 && e2 <= 43481 : e2 < 43600 ? e2 < 43520 ? e2 >= 43488 && e2 <= 43518 : e2 >= 43520 && e2 <= 43574 || e2 >= 43584 && e2 <= 43597 : e2 < 43642 ? e2 >= 43600 && e2 <= 43609 || e2 >= 43616 && e2 <= 43638 : e2 >= 43642 && e2 <= 43714 || e2 >= 43739 && e2 <= 43741 : e2 < 43824 ? e2 < 43785 ? e2 < 43762 ? e2 >= 43744 && e2 <= 43759 : e2 >= 43762 && e2 <= 43766 || e2 >= 43777 && e2 <= 43782 : e2 < 43808 ? e2 >= 43785 && e2 <= 43790 || e2 >= 43793 && e2 <= 43798 : e2 >= 43808 && e2 <= 43814 || e2 >= 43816 && e2 <= 43822 : e2 < 44012 ? e2 < 43868 ? e2 >= 43824 && e2 <= 43866 : e2 >= 43868 && e2 <= 43877 || e2 >= 43888 && e2 <= 44010 : e2 < 44032 ? e2 >= 44012 && e2 <= 44013 || e2 >= 44016 && e2 <= 44025 : e2 >= 44032 && e2 <= 55203 || e2 >= 55216 && e2 <= 55238 : e2 < 64848 ? e2 < 64298 ? e2 < 64112 ? e2 < 55296 ? e2 >= 55243 && e2 <= 55291 : e2 >= 55296 && e2 <= 57343 || e2 >= 63744 && e2 <= 64109 : e2 < 64275 ? e2 >= 64112 && e2 <= 64217 || e2 >= 64256 && e2 <= 64262 : e2 >= 64275 && e2 <= 64279 || e2 >= 64285 && e2 <= 64296 : e2 < 64320 ? e2 < 64312 ? e2 >= 64298 && e2 <= 64310 : e2 >= 64312 && e2 <= 64316 || 64318 == e2 : e2 < 64326 ? e2 >= 64320 && e2 <= 64321 || e2 >= 64323 && e2 <= 64324 : e2 >= 64326 && e2 <= 64433 || e2 >= 64467 && e2 <= 64829 : e2 < 65296 ? e2 < 65024 ? e2 < 64914 ? e2 >= 64848 && e2 <= 64911 : e2 >= 64914 && e2 <= 64967 || e2 >= 65008 && e2 <= 65019 : e2 < 65136 ? e2 >= 65024 && e2 <= 65039 || e2 >= 65056 && e2 <= 65071 : e2 >= 65136 && e2 <= 65140 || e2 >= 65142 && e2 <= 65276 : e2 < 65474 ? e2 < 65345 ? e2 >= 65296 && e2 <= 65305 || e2 >= 65313 && e2 <= 65338 : e2 >= 65345 && e2 <= 65370 || e2 >= 65382 && e2 <= 65470 : e2 < 65490 ? e2 >= 65474 && e2 <= 65479 || e2 >= 65482 && e2 <= 65487 : e2 >= 65490 && e2 <= 65495 || e2 >= 65498 && e2 <= 65500;
|
|
2592
2627
|
}
|
|
2593
|
-
function
|
|
2628
|
+
function dt(e2) {
|
|
2594
2629
|
return e2 < 58 ? e2 < 44 ? 33 == e2 : 44 == e2 || 46 == e2 : e2 < 63 ? e2 >= 58 && e2 <= 59 : 63 == e2 || 94 == e2;
|
|
2595
2630
|
}
|
|
2596
|
-
function
|
|
2631
|
+
function pt(e2) {
|
|
2597
2632
|
return e2 < 91 ? 40 == e2 : 91 == e2 || 123 == e2;
|
|
2598
2633
|
}
|
|
2599
|
-
function
|
|
2634
|
+
function mt(e2) {
|
|
2600
2635
|
return e2 < 93 ? 41 == e2 : 93 == e2 || 125 == e2;
|
|
2601
2636
|
}
|
|
2602
|
-
var pt = /^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|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|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|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--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--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|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|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|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--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|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--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|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|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|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|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|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|walter|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|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|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|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|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|dvag|erni|fage|fail|fans|farm|fast|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|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|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|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|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|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|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|gay|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|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|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|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|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|ss|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|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/, mt = /https?:\/\//i, ft = new RegExp("^" + mt.source, "i"), gt = /^(javascript|vbscript):/i, vt = /^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/, bt = /^(?:\/\/)?([^/#?:]+)/, yt = rt;
|
|
2603
|
-
function wt(e2) {
|
|
2604
|
-
return rt(e2) || it(e2) || 43 === e2 || 45 === e2 || 46 === e2;
|
|
2605
|
-
}
|
|
2606
|
-
var kt = lt;
|
|
2637
|
+
var ft = /^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|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|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|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--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--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|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|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|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--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|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--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|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|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|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|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|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|walter|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|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|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|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|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|dvag|erni|fage|fail|fans|farm|fast|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|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|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|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|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|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|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|gay|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|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|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|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|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|ss|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|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/, gt = /https?:\/\//i, vt = new RegExp("^" + gt.source, "i"), bt = /^(javascript|vbscript):/i, yt = /^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/, wt = /^(?:\/\/)?([^/#?:]+)/, kt = ot;
|
|
2607
2638
|
function Ct(e2) {
|
|
2608
|
-
return
|
|
2639
|
+
return ot(e2) || ct(e2) || 43 === e2 || 45 === e2 || 46 === e2;
|
|
2609
2640
|
}
|
|
2610
|
-
|
|
2611
|
-
|
|
2641
|
+
var Tt = ut;
|
|
2642
|
+
function It(e2) {
|
|
2643
|
+
return 95 === e2 || Tt(e2);
|
|
2644
|
+
}
|
|
2645
|
+
function St(e2) {
|
|
2646
|
+
return ut(e2) || ((t2 = e2) < 91 ? t2 < 47 ? t2 >= 35 && t2 <= 43 || 45 == t2 : t2 < 61 ? 47 == t2 : 61 == t2 || 64 == t2 : t2 < 95 ? 91 == t2 || 93 == t2 : t2 < 123 ? 95 == t2 : t2 >= 123 && t2 <= 126 || 10003 == t2) || dt(e2);
|
|
2612
2647
|
var t2;
|
|
2613
2648
|
}
|
|
2614
|
-
function
|
|
2649
|
+
function xt(e2) {
|
|
2615
2650
|
return 47 === e2 || 63 === e2 || 35 === e2;
|
|
2616
2651
|
}
|
|
2617
|
-
function
|
|
2618
|
-
return
|
|
2652
|
+
function Et(e2) {
|
|
2653
|
+
return ft.test(e2.toLowerCase());
|
|
2619
2654
|
}
|
|
2620
|
-
var
|
|
2621
|
-
var
|
|
2655
|
+
var Mt = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, At = /[:/?#]/;
|
|
2656
|
+
var Nt = /^(https?:\/\/)?(?:www\.)?/i, Rt = /^\/\//, Dt = (function(e2) {
|
|
2622
2657
|
function t2(t3) {
|
|
2623
2658
|
var s2 = e2.call(this, t3) || this;
|
|
2624
2659
|
return s2.type = "url", s2.url = "", s2.urlMatchType = "scheme", s2.protocolRelativeMatch = false, s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.protocolPrepended = false, s2.urlMatchType = t3.urlMatchType, s2.url = t3.url, s2.protocolRelativeMatch = t3.protocolRelativeMatch, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2625
2660
|
}
|
|
2626
|
-
return
|
|
2661
|
+
return Qe(t2, e2), t2.prototype.getType = function() {
|
|
2627
2662
|
return "url";
|
|
2628
2663
|
}, t2.prototype.getUrlMatchType = function() {
|
|
2629
2664
|
return this.urlMatchType;
|
|
@@ -2634,8 +2669,8 @@ var Mt = /^(https?:\/\/)?(?:www\.)?/i, At = /^\/\//, Nt = (function(e2) {
|
|
|
2634
2669
|
return this.getUrl().replace(/&/g, "&");
|
|
2635
2670
|
}, t2.prototype.getAnchorText = function() {
|
|
2636
2671
|
var e3 = this.getMatchedText();
|
|
2637
|
-
return this.protocolRelativeMatch && (e3 = e3.replace(
|
|
2638
|
-
return e4.includes("www.") ? e4.replace(
|
|
2672
|
+
return this.protocolRelativeMatch && (e3 = e3.replace(Rt, "")), this.stripPrefix.scheme && (e3 = e3.replace(vt, "")), this.stripPrefix.www && (e3 = (function(e4) {
|
|
2673
|
+
return e4.includes("www.") ? e4.replace(Nt, "$1") : e4;
|
|
2639
2674
|
})(e3)), this.stripTrailingSlash && (e3 = (function(e4) {
|
|
2640
2675
|
"/" === e4.charAt(e4.length - 1) && (e4 = e4.slice(0, -1));
|
|
2641
2676
|
return e4;
|
|
@@ -2650,18 +2685,18 @@ var Mt = /^(https?:\/\/)?(?:www\.)?/i, At = /^\/\//, Nt = (function(e2) {
|
|
|
2650
2685
|
return t3;
|
|
2651
2686
|
})(e3)), e3;
|
|
2652
2687
|
}, t2;
|
|
2653
|
-
})(
|
|
2654
|
-
var
|
|
2655
|
-
function
|
|
2656
|
-
return
|
|
2688
|
+
})(it);
|
|
2689
|
+
var _t = /^mailto:/i, Ot = ut;
|
|
2690
|
+
function Pt(e2) {
|
|
2691
|
+
return Ot(e2) || ((t2 = e2) < 47 ? t2 < 42 ? 33 == t2 || t2 >= 35 && t2 <= 39 : t2 >= 42 && t2 <= 43 || 45 == t2 : t2 < 63 ? 47 == t2 || 61 == t2 : t2 < 94 ? 63 == t2 : t2 >= 94 && t2 <= 96 || t2 >= 123 && t2 <= 126);
|
|
2657
2692
|
var t2;
|
|
2658
2693
|
}
|
|
2659
|
-
var
|
|
2694
|
+
var jt = (function(e2) {
|
|
2660
2695
|
function t2(t3) {
|
|
2661
2696
|
var s2 = e2.call(this, t3) || this;
|
|
2662
2697
|
return s2.type = "email", s2.email = "", s2.email = t3.email, s2;
|
|
2663
2698
|
}
|
|
2664
|
-
return
|
|
2699
|
+
return Qe(t2, e2), t2.prototype.getType = function() {
|
|
2665
2700
|
return "email";
|
|
2666
2701
|
}, t2.prototype.getEmail = function() {
|
|
2667
2702
|
return this.email;
|
|
@@ -2670,16 +2705,16 @@ var Ot = (function(e2) {
|
|
|
2670
2705
|
}, t2.prototype.getAnchorText = function() {
|
|
2671
2706
|
return this.email;
|
|
2672
2707
|
}, t2;
|
|
2673
|
-
})(
|
|
2674
|
-
function
|
|
2675
|
-
return 95 === e2 ||
|
|
2708
|
+
})(it);
|
|
2709
|
+
function $t(e2) {
|
|
2710
|
+
return 95 === e2 || ut(e2);
|
|
2676
2711
|
}
|
|
2677
|
-
var
|
|
2712
|
+
var Ut = ["twitter", "facebook", "instagram", "tiktok", "youtube"], Wt = (function(e2) {
|
|
2678
2713
|
function t2(t3) {
|
|
2679
2714
|
var s2 = e2.call(this, t3) || this;
|
|
2680
2715
|
return s2.type = "hashtag", s2.serviceName = "twitter", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
|
|
2681
2716
|
}
|
|
2682
|
-
return
|
|
2717
|
+
return Qe(t2, e2), t2.prototype.getType = function() {
|
|
2683
2718
|
return "hashtag";
|
|
2684
2719
|
}, t2.prototype.getServiceName = function() {
|
|
2685
2720
|
return this.serviceName;
|
|
@@ -2699,7 +2734,7 @@ var $t = ["twitter", "facebook", "instagram", "tiktok", "youtube"], Ut = (functi
|
|
|
2699
2734
|
case "youtube":
|
|
2700
2735
|
return "https://youtube.com/hashtag/" + t3;
|
|
2701
2736
|
default:
|
|
2702
|
-
|
|
2737
|
+
et(e3);
|
|
2703
2738
|
}
|
|
2704
2739
|
}, t2.prototype.getAnchorText = function() {
|
|
2705
2740
|
return "#" + this.hashtag;
|
|
@@ -2707,16 +2742,16 @@ var $t = ["twitter", "facebook", "instagram", "tiktok", "youtube"], Ut = (functi
|
|
|
2707
2742
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2708
2743
|
return s2 && t3.push(s2), t3;
|
|
2709
2744
|
}, t2;
|
|
2710
|
-
})(
|
|
2711
|
-
function
|
|
2712
|
-
return 45 === e2 || 46 === e2 || 95 === e2 ||
|
|
2745
|
+
})(it), qt = { twitter: /^@\w{1,15}$/, instagram: /^@[_\w]{1,30}$/, soundcloud: /^@[-a-z0-9_]{3,25}$/, tiktok: /^@[.\w]{1,23}[\w]$/, youtube: /^@[-.·\w]{3,30}$/ };
|
|
2746
|
+
function Bt(e2) {
|
|
2747
|
+
return 45 === e2 || 46 === e2 || 95 === e2 || ot(e2) || ct(e2);
|
|
2713
2748
|
}
|
|
2714
|
-
var
|
|
2749
|
+
var Lt = ["twitter", "instagram", "soundcloud", "tiktok", "youtube"], Gt = (function(e2) {
|
|
2715
2750
|
function t2(t3) {
|
|
2716
2751
|
var s2 = e2.call(this, t3) || this;
|
|
2717
2752
|
return s2.type = "mention", s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
|
|
2718
2753
|
}
|
|
2719
|
-
return
|
|
2754
|
+
return Qe(t2, e2), t2.prototype.getType = function() {
|
|
2720
2755
|
return "mention";
|
|
2721
2756
|
}, t2.prototype.getMention = function() {
|
|
2722
2757
|
return this.mention;
|
|
@@ -2735,7 +2770,7 @@ var qt = ["twitter", "instagram", "soundcloud", "tiktok", "youtube"], Bt = (func
|
|
|
2735
2770
|
case "youtube":
|
|
2736
2771
|
return "https://youtube.com/@" + this.mention;
|
|
2737
2772
|
default:
|
|
2738
|
-
|
|
2773
|
+
et(this.serviceName);
|
|
2739
2774
|
}
|
|
2740
2775
|
}, t2.prototype.getAnchorText = function() {
|
|
2741
2776
|
return "@" + this.mention;
|
|
@@ -2743,19 +2778,19 @@ var qt = ["twitter", "instagram", "soundcloud", "tiktok", "youtube"], Bt = (func
|
|
|
2743
2778
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2744
2779
|
return s2 && t3.push(s2), t3;
|
|
2745
2780
|
}, t2;
|
|
2746
|
-
})(
|
|
2747
|
-
function
|
|
2781
|
+
})(it), Ft = /[-. ()]/, Ht = new RegExp("^".concat(/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\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)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/.source, "|").concat(/(0([1-9]-?[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, "$"));
|
|
2782
|
+
function Jt(e2) {
|
|
2748
2783
|
return 45 === e2 || 46 === e2 || 32 === e2;
|
|
2749
2784
|
}
|
|
2750
|
-
function
|
|
2785
|
+
function zt(e2) {
|
|
2751
2786
|
return 44 === e2 || 59 === e2;
|
|
2752
2787
|
}
|
|
2753
|
-
var
|
|
2788
|
+
var Yt = (function(e2) {
|
|
2754
2789
|
function t2(t3) {
|
|
2755
2790
|
var s2 = e2.call(this, t3) || this;
|
|
2756
2791
|
return s2.type = "phone", s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
|
|
2757
2792
|
}
|
|
2758
|
-
return
|
|
2793
|
+
return Qe(t2, e2), t2.prototype.getType = function() {
|
|
2759
2794
|
return "phone";
|
|
2760
2795
|
}, t2.prototype.getPhoneNumber = function() {
|
|
2761
2796
|
return this.number;
|
|
@@ -2766,191 +2801,191 @@ var Jt = (function(e2) {
|
|
|
2766
2801
|
}, t2.prototype.getAnchorText = function() {
|
|
2767
2802
|
return this.matchedText;
|
|
2768
2803
|
}, t2;
|
|
2769
|
-
})(
|
|
2804
|
+
})(it), Qt = (function() {
|
|
2770
2805
|
function e2(e3, t2) {
|
|
2771
2806
|
this.charIdx = 0, this.matches = [], this._stateMachines = [], this.schemeUrlMachinesCount = 0, this.text = e3, this.tagBuilder = t2.tagBuilder, this.stripPrefix = t2.stripPrefix, this.stripTrailingSlash = t2.stripTrailingSlash, this.decodePercentEncoding = t2.decodePercentEncoding, this.hashtagServiceName = t2.hashtagServiceName, this.mentionServiceName = t2.mentionServiceName;
|
|
2772
2807
|
}
|
|
2773
2808
|
return Object.defineProperty(e2.prototype, "stateMachines", { get: function() {
|
|
2774
2809
|
return this._stateMachines;
|
|
2775
2810
|
}, enumerable: false, configurable: true }), e2.prototype.addMachine = function(e3) {
|
|
2776
|
-
this._stateMachines.push(e3),
|
|
2811
|
+
this._stateMachines.push(e3), Hs(e3) && this.schemeUrlMachinesCount++;
|
|
2777
2812
|
}, e2.prototype.removeMachine = function(e3) {
|
|
2778
2813
|
this._stateMachines = this._stateMachines.filter(function(t2) {
|
|
2779
2814
|
return t2 !== e3;
|
|
2780
|
-
}),
|
|
2815
|
+
}), Hs(e3) && this.schemeUrlMachinesCount--;
|
|
2781
2816
|
}, e2.prototype.hasSchemeUrlMachine = function() {
|
|
2782
2817
|
return this.schemeUrlMachinesCount > 0;
|
|
2783
2818
|
}, e2;
|
|
2784
2819
|
})();
|
|
2785
|
-
function
|
|
2820
|
+
function Vt(e2, t2, s2) {
|
|
2786
2821
|
var n2 = e2.charIdx;
|
|
2787
2822
|
if (35 === s2) e2.addMachine({ type: 2, startIdx: n2, state: 28, acceptStateReached: false });
|
|
2788
2823
|
else if (64 === s2) e2.addMachine(/* @__PURE__ */ (function(e3, t3) {
|
|
2789
2824
|
return { type: 3, startIdx: e3, state: t3, acceptStateReached: false };
|
|
2790
2825
|
})(n2, 30));
|
|
2791
|
-
else if (47 === s2) e2.addMachine(
|
|
2792
|
-
else if (43 === s2) e2.addMachine(
|
|
2793
|
-
else if (40 === s2) e2.addMachine(
|
|
2826
|
+
else if (47 === s2) e2.addMachine(Gs(n2, 11));
|
|
2827
|
+
else if (43 === s2) e2.addMachine(Fs(n2, 37));
|
|
2828
|
+
else if (40 === s2) e2.addMachine(Fs(n2, 32));
|
|
2794
2829
|
else {
|
|
2795
|
-
if (
|
|
2830
|
+
if (ct(s2) && (e2.addMachine(Fs(n2, 38)), e2.addMachine(/* @__PURE__ */ (function(e3, t3) {
|
|
2796
2831
|
return { type: 0, startIdx: e3, state: t3, acceptStateReached: false, matchType: 2, octetsEncountered: 1 };
|
|
2797
|
-
})(n2, 13))),
|
|
2832
|
+
})(n2, 13))), Ot(s2)) {
|
|
2798
2833
|
var a2 = "m" === t2.toLowerCase() ? 15 : 22;
|
|
2799
2834
|
e2.addMachine(/* @__PURE__ */ (function(e3, t3) {
|
|
2800
2835
|
return { type: 1, startIdx: e3, state: t3, acceptStateReached: false };
|
|
2801
2836
|
})(n2, a2));
|
|
2802
2837
|
}
|
|
2803
|
-
|
|
2838
|
+
kt(s2) && e2.addMachine(Ls(n2, 0)), ut(s2) && e2.addMachine(Gs(n2, 5));
|
|
2804
2839
|
}
|
|
2805
2840
|
}
|
|
2806
|
-
function Qt(e2, t2, s2) {
|
|
2807
|
-
58 === s2 ? t2.state = 2 : 45 === s2 ? t2.state = 1 : wt(s2) || e2.removeMachine(t2);
|
|
2808
|
-
}
|
|
2809
|
-
function Vt(e2, t2, s2) {
|
|
2810
|
-
var n2 = e2.charIdx;
|
|
2811
|
-
45 === s2 || (47 === s2 ? (e2.removeMachine(t2), e2.addMachine(Bs(n2, 11))) : wt(s2) ? t2.state = 0 : e2.removeMachine(t2));
|
|
2812
|
-
}
|
|
2813
2841
|
function Kt(e2, t2, s2) {
|
|
2814
|
-
|
|
2815
|
-
47 === s2 ? t2.state = 3 : 46 === s2 ? e2.removeMachine(t2) : kt(s2) ? (t2.state = 5, yt(s2) && e2.addMachine(qs(n2, 0))) : e2.removeMachine(t2);
|
|
2842
|
+
58 === s2 ? t2.state = 2 : 45 === s2 ? t2.state = 1 : Ct(s2) || e2.removeMachine(t2);
|
|
2816
2843
|
}
|
|
2817
2844
|
function Zt(e2, t2, s2) {
|
|
2818
|
-
|
|
2845
|
+
var n2 = e2.charIdx;
|
|
2846
|
+
45 === s2 || (47 === s2 ? (e2.removeMachine(t2), e2.addMachine(Gs(n2, 11))) : Ct(s2) ? t2.state = 0 : e2.removeMachine(t2));
|
|
2819
2847
|
}
|
|
2820
|
-
function Xt(e2, t2, s2
|
|
2821
|
-
|
|
2848
|
+
function Xt(e2, t2, s2) {
|
|
2849
|
+
var n2 = e2.charIdx;
|
|
2850
|
+
47 === s2 ? t2.state = 3 : 46 === s2 ? e2.removeMachine(t2) : Tt(s2) ? (t2.state = 5, kt(s2) && e2.addMachine(Ls(n2, 0))) : e2.removeMachine(t2);
|
|
2822
2851
|
}
|
|
2823
2852
|
function es(e2, t2, s2) {
|
|
2824
|
-
47 === s2 ? t2.state =
|
|
2853
|
+
47 === s2 ? t2.state = 4 : St(s2) ? (t2.state = 10, t2.acceptStateReached = true) : Ws(e2, t2);
|
|
2825
2854
|
}
|
|
2826
|
-
function ts(e2, t2, s2) {
|
|
2827
|
-
|
|
2855
|
+
function ts(e2, t2, s2, n2) {
|
|
2856
|
+
47 === n2 ? (t2.state = 10, t2.acceptStateReached = true) : Tt(n2) ? (t2.state = 5, t2.acceptStateReached = true) : e2.removeMachine(t2);
|
|
2828
2857
|
}
|
|
2829
2858
|
function ss(e2, t2, s2) {
|
|
2830
|
-
|
|
2859
|
+
47 === s2 ? t2.state = 12 : e2.removeMachine(t2);
|
|
2831
2860
|
}
|
|
2832
|
-
function ns(e2, t2, s2
|
|
2833
|
-
|
|
2861
|
+
function ns(e2, t2, s2) {
|
|
2862
|
+
Tt(s2) ? t2.state = 5 : e2.removeMachine(t2);
|
|
2834
2863
|
}
|
|
2835
|
-
function as(e2, t2, s2
|
|
2836
|
-
46 ===
|
|
2864
|
+
function as(e2, t2, s2) {
|
|
2865
|
+
46 === s2 ? t2.state = 7 : 45 === s2 ? t2.state = 6 : 58 === s2 ? t2.state = 8 : xt(s2) ? t2.state = 10 : It(s2) || Ws(e2, t2);
|
|
2837
2866
|
}
|
|
2838
|
-
function rs(e2, t2, s2) {
|
|
2839
|
-
|
|
2867
|
+
function rs(e2, t2, s2, n2) {
|
|
2868
|
+
45 === n2 || (46 === n2 ? Ws(e2, t2) : Tt(n2) ? t2.state = 5 : Ws(e2, t2));
|
|
2840
2869
|
}
|
|
2841
|
-
function is(e2, t2, s2) {
|
|
2842
|
-
|
|
2870
|
+
function is(e2, t2, s2, n2) {
|
|
2871
|
+
46 === n2 ? Ws(e2, t2) : Tt(n2) ? (t2.state = 5, t2.acceptStateReached = true) : Ws(e2, t2);
|
|
2843
2872
|
}
|
|
2844
2873
|
function os(e2, t2, s2) {
|
|
2845
|
-
|
|
2874
|
+
46 === s2 ? t2.state = 14 : 58 === s2 ? t2.state = 8 : ct(s2) || (xt(s2) ? t2.state = 10 : ut(s2) ? e2.removeMachine(t2) : Ws(e2, t2));
|
|
2846
2875
|
}
|
|
2847
2876
|
function cs(e2, t2, s2) {
|
|
2848
|
-
|
|
2877
|
+
ct(s2) ? (t2.octetsEncountered++, 4 === t2.octetsEncountered && (t2.acceptStateReached = true), t2.state = 13) : Ws(e2, t2);
|
|
2849
2878
|
}
|
|
2850
2879
|
function ls(e2, t2, s2) {
|
|
2851
|
-
|
|
2880
|
+
ct(s2) ? t2.state = 9 : Ws(e2, t2);
|
|
2852
2881
|
}
|
|
2853
|
-
function hs(e2, t2, s2
|
|
2854
|
-
|
|
2882
|
+
function hs(e2, t2, s2) {
|
|
2883
|
+
ct(s2) || (xt(s2) ? t2.state = 10 : Ws(e2, t2));
|
|
2855
2884
|
}
|
|
2856
|
-
function us(e2, t2, s2
|
|
2857
|
-
|
|
2885
|
+
function us(e2, t2, s2) {
|
|
2886
|
+
St(s2) || Ws(e2, t2);
|
|
2858
2887
|
}
|
|
2859
2888
|
function ds(e2, t2, s2, n2) {
|
|
2860
|
-
"
|
|
2889
|
+
"a" === s2.toLowerCase() ? t2.state = 16 : ys(e2, t2, n2);
|
|
2861
2890
|
}
|
|
2862
2891
|
function ps(e2, t2, s2, n2) {
|
|
2863
|
-
"
|
|
2892
|
+
"i" === s2.toLowerCase() ? t2.state = 17 : ys(e2, t2, n2);
|
|
2864
2893
|
}
|
|
2865
2894
|
function ms(e2, t2, s2, n2) {
|
|
2866
|
-
"
|
|
2895
|
+
"l" === s2.toLowerCase() ? t2.state = 18 : ys(e2, t2, n2);
|
|
2867
2896
|
}
|
|
2868
|
-
function fs(e2, t2, s2) {
|
|
2869
|
-
|
|
2897
|
+
function fs(e2, t2, s2, n2) {
|
|
2898
|
+
"t" === s2.toLowerCase() ? t2.state = 19 : ys(e2, t2, n2);
|
|
2870
2899
|
}
|
|
2871
|
-
function gs(e2, t2, s2) {
|
|
2872
|
-
|
|
2900
|
+
function gs(e2, t2, s2, n2) {
|
|
2901
|
+
"o" === s2.toLowerCase() ? t2.state = 20 : ys(e2, t2, n2);
|
|
2873
2902
|
}
|
|
2874
2903
|
function vs(e2, t2, s2) {
|
|
2875
|
-
|
|
2904
|
+
58 === s2 ? t2.state = 21 : ys(e2, t2, s2);
|
|
2876
2905
|
}
|
|
2877
2906
|
function bs(e2, t2, s2) {
|
|
2878
|
-
|
|
2907
|
+
Pt(s2) ? t2.state = 22 : e2.removeMachine(t2);
|
|
2879
2908
|
}
|
|
2880
2909
|
function ys(e2, t2, s2) {
|
|
2881
|
-
|
|
2910
|
+
46 === s2 ? t2.state = 23 : 64 === s2 ? t2.state = 24 : Pt(s2) ? t2.state = 22 : e2.removeMachine(t2);
|
|
2882
2911
|
}
|
|
2883
2912
|
function ws(e2, t2, s2) {
|
|
2884
|
-
46 === s2
|
|
2913
|
+
46 === s2 || 64 === s2 ? e2.removeMachine(t2) : Pt(s2) ? t2.state = 22 : e2.removeMachine(t2);
|
|
2885
2914
|
}
|
|
2886
2915
|
function ks(e2, t2, s2) {
|
|
2887
|
-
|
|
2916
|
+
Tt(s2) ? t2.state = 25 : e2.removeMachine(t2);
|
|
2888
2917
|
}
|
|
2889
2918
|
function Cs(e2, t2, s2) {
|
|
2890
|
-
46 === s2
|
|
2919
|
+
46 === s2 ? t2.state = 27 : 45 === s2 ? t2.state = 26 : It(s2) || Ws(e2, t2);
|
|
2891
2920
|
}
|
|
2892
2921
|
function Ts(e2, t2, s2) {
|
|
2893
|
-
|
|
2922
|
+
45 === s2 || 46 === s2 ? Ws(e2, t2) : It(s2) ? t2.state = 25 : Ws(e2, t2);
|
|
2894
2923
|
}
|
|
2895
2924
|
function Is(e2, t2, s2) {
|
|
2896
|
-
|
|
2897
|
-
}
|
|
2898
|
-
function xs(e2, t2, s2) {
|
|
2899
|
-
Wt(s2) ? (t2.state = 31, t2.acceptStateReached = true) : e2.removeMachine(t2);
|
|
2925
|
+
46 === s2 || 45 === s2 ? Ws(e2, t2) : Tt(s2) ? (t2.state = 25, t2.acceptStateReached = true) : Ws(e2, t2);
|
|
2900
2926
|
}
|
|
2901
2927
|
function Ss(e2, t2, s2) {
|
|
2902
|
-
|
|
2928
|
+
$t(s2) ? (t2.state = 29, t2.acceptStateReached = true) : e2.removeMachine(t2);
|
|
2929
|
+
}
|
|
2930
|
+
function xs(e2, t2, s2) {
|
|
2931
|
+
$t(s2) || Ws(e2, t2);
|
|
2903
2932
|
}
|
|
2904
|
-
function Es(e2, t2, s2
|
|
2905
|
-
|
|
2933
|
+
function Es(e2, t2, s2) {
|
|
2934
|
+
Bt(s2) ? (t2.state = 31, t2.acceptStateReached = true) : e2.removeMachine(t2);
|
|
2906
2935
|
}
|
|
2907
|
-
function Ms(e2, t2, s2
|
|
2908
|
-
|
|
2936
|
+
function Ms(e2, t2, s2) {
|
|
2937
|
+
Bt(s2) || (ut(s2) ? e2.removeMachine(t2) : Ws(e2, t2));
|
|
2909
2938
|
}
|
|
2910
|
-
function As(e2, t2, s2) {
|
|
2911
|
-
|
|
2939
|
+
function As(e2, t2, s2, n2) {
|
|
2940
|
+
ct(n2) ? t2.state = 38 : (e2.removeMachine(t2), Vt(e2, s2, n2));
|
|
2912
2941
|
}
|
|
2913
|
-
function Ns(e2, t2, s2) {
|
|
2914
|
-
|
|
2942
|
+
function Ns(e2, t2, s2, n2) {
|
|
2943
|
+
ct(n2) ? t2.state = 33 : e2.removeMachine(t2), Vt(e2, s2, n2);
|
|
2915
2944
|
}
|
|
2916
2945
|
function Rs(e2, t2, s2) {
|
|
2917
|
-
|
|
2946
|
+
ct(s2) ? t2.state = 34 : e2.removeMachine(t2);
|
|
2918
2947
|
}
|
|
2919
|
-
function
|
|
2920
|
-
|
|
2948
|
+
function Ds(e2, t2, s2) {
|
|
2949
|
+
ct(s2) ? t2.state = 35 : e2.removeMachine(t2);
|
|
2921
2950
|
}
|
|
2922
|
-
function
|
|
2923
|
-
|
|
2924
|
-
t2.acceptStateReached = true, Ht(n2) ? t2.state = 40 : 35 === n2 ? t2.state = 41 : it(n2) || (40 === n2 ? t2.state = 32 : Ft(n2) ? t2.state = 39 : (Us(e2, t2), yt(n2) && e2.addMachine(qs(a2, 0))));
|
|
2951
|
+
function _s(e2, t2, s2) {
|
|
2952
|
+
41 === s2 ? t2.state = 36 : e2.removeMachine(t2);
|
|
2925
2953
|
}
|
|
2926
2954
|
function Os(e2, t2, s2, n2) {
|
|
2927
|
-
|
|
2955
|
+
ct(n2) ? t2.state = 38 : Jt(n2) ? t2.state = 39 : e2.removeMachine(t2);
|
|
2956
|
+
}
|
|
2957
|
+
function Ps(e2, t2, s2, n2) {
|
|
2958
|
+
var a2 = e2.charIdx;
|
|
2959
|
+
t2.acceptStateReached = true, zt(n2) ? t2.state = 40 : 35 === n2 ? t2.state = 41 : ct(n2) || (40 === n2 ? t2.state = 32 : Jt(n2) ? t2.state = 39 : (Ws(e2, t2), kt(n2) && e2.addMachine(Ls(a2, 0))));
|
|
2928
2960
|
}
|
|
2929
|
-
function
|
|
2930
|
-
|
|
2961
|
+
function js(e2, t2, s2, n2) {
|
|
2962
|
+
ct(n2) ? t2.state = 38 : 40 === n2 ? t2.state = 32 : (Ws(e2, t2), Vt(e2, s2, n2));
|
|
2931
2963
|
}
|
|
2932
2964
|
function $s(e2, t2, s2) {
|
|
2933
|
-
|
|
2965
|
+
zt(s2) || (35 === s2 ? t2.state = 41 : ct(s2) ? t2.state = 38 : Ws(e2, t2));
|
|
2934
2966
|
}
|
|
2935
|
-
function Us(e2, t2) {
|
|
2967
|
+
function Us(e2, t2, s2) {
|
|
2968
|
+
zt(s2) ? t2.state = 40 : ct(s2) ? e2.removeMachine(t2) : Ws(e2, t2);
|
|
2969
|
+
}
|
|
2970
|
+
function Ws(e2, t2) {
|
|
2936
2971
|
var s2 = e2.matches, n2 = e2.text, a2 = e2.charIdx, r2 = e2.tagBuilder, i2 = e2.stripPrefix, o2 = e2.stripTrailingSlash, c2 = e2.decodePercentEncoding, l2 = e2.hashtagServiceName, h2 = e2.mentionServiceName;
|
|
2937
2972
|
if (e2.removeMachine(t2), t2.acceptStateReached) {
|
|
2938
2973
|
var u2, d2, p2 = t2.startIdx, m2 = n2.slice(t2.startIdx, a2);
|
|
2939
2974
|
switch (m2 = (function(e3) {
|
|
2940
2975
|
for (var t3 = { "(": 0, "{": 0, "[": 0 }, s3 = 0; s3 < e3.length; s3++) {
|
|
2941
2976
|
var n3 = e3.charAt(s3);
|
|
2942
|
-
|
|
2977
|
+
pt(r3 = e3.charCodeAt(s3)) ? t3[n3]++ : mt(r3) && t3[Bs[n3]]--;
|
|
2943
2978
|
}
|
|
2944
2979
|
var a3 = e3.length - 1;
|
|
2945
2980
|
for (; a3 >= 0; ) {
|
|
2946
2981
|
var r3;
|
|
2947
2982
|
n3 = e3.charAt(a3);
|
|
2948
|
-
if (
|
|
2949
|
-
var i3 =
|
|
2983
|
+
if (mt(r3 = e3.charCodeAt(a3))) {
|
|
2984
|
+
var i3 = Bs[n3];
|
|
2950
2985
|
if (!(t3[i3] < 0)) break;
|
|
2951
2986
|
t3[i3]++, a3--;
|
|
2952
2987
|
} else {
|
|
2953
|
-
if (!
|
|
2988
|
+
if (!dt(r3)) break;
|
|
2954
2989
|
a3--;
|
|
2955
2990
|
}
|
|
2956
2991
|
}
|
|
@@ -2960,10 +2995,10 @@ function Us(e2, t2) {
|
|
|
2960
2995
|
if (64 === n2.charCodeAt(t2.startIdx - 1)) return;
|
|
2961
2996
|
switch (t2.matchType) {
|
|
2962
2997
|
case 0:
|
|
2963
|
-
var f2 =
|
|
2998
|
+
var f2 = gt.exec(m2);
|
|
2964
2999
|
if (f2 && (p2 += f2.index, m2 = m2.slice(f2.index)), !(function(e3) {
|
|
2965
|
-
if (
|
|
2966
|
-
var t3 = e3.match(
|
|
3000
|
+
if (bt.test(e3)) return false;
|
|
3001
|
+
var t3 = e3.match(yt);
|
|
2967
3002
|
if (!t3) return false;
|
|
2968
3003
|
var s3 = !!t3[1], n3 = t3[2];
|
|
2969
3004
|
return !!s3 || !(-1 === n3.indexOf(".") || !/[A-Za-z]/.test(n3));
|
|
@@ -2971,43 +3006,43 @@ function Us(e2, t2) {
|
|
|
2971
3006
|
break;
|
|
2972
3007
|
case 1:
|
|
2973
3008
|
if (!(function(e3) {
|
|
2974
|
-
var t3 = e3.match(
|
|
3009
|
+
var t3 = e3.match(wt);
|
|
2975
3010
|
if (!t3) return false;
|
|
2976
3011
|
var s3 = t3[0].split(".");
|
|
2977
|
-
return !(s3.length < 2 || !
|
|
3012
|
+
return !(s3.length < 2 || !Et(s3[s3.length - 1]));
|
|
2978
3013
|
})(m2)) return;
|
|
2979
3014
|
break;
|
|
2980
3015
|
case 2:
|
|
2981
|
-
if (d2 = m2.split(
|
|
3016
|
+
if (d2 = m2.split(At, 1)[0], !Mt.test(d2)) return;
|
|
2982
3017
|
break;
|
|
2983
3018
|
default:
|
|
2984
|
-
|
|
3019
|
+
et(t2);
|
|
2985
3020
|
}
|
|
2986
|
-
s2.push(new
|
|
3021
|
+
s2.push(new Dt({ tagBuilder: r2, matchedText: m2, offset: p2, urlMatchType: qs(t2.matchType), url: m2, protocolRelativeMatch: "//" === m2.slice(0, 2), stripPrefix: i2, stripTrailingSlash: o2, decodePercentEncoding: c2 }));
|
|
2987
3022
|
break;
|
|
2988
3023
|
case 1:
|
|
2989
|
-
|
|
3024
|
+
Et(m2.split(".").pop()) && s2.push(new jt({ tagBuilder: r2, matchedText: m2, offset: p2, email: m2.replace(_t, "") }));
|
|
2990
3025
|
break;
|
|
2991
3026
|
case 2:
|
|
2992
|
-
m2.length <= 140 && s2.push(new
|
|
3027
|
+
m2.length <= 140 && s2.push(new Wt({ tagBuilder: r2, matchedText: m2, offset: p2, serviceName: l2, hashtag: m2.slice(1) }));
|
|
2993
3028
|
break;
|
|
2994
3029
|
case 3:
|
|
2995
3030
|
(function(e3, t3) {
|
|
2996
|
-
return
|
|
2997
|
-
})(m2, h2) && s2.push(new
|
|
3031
|
+
return qt[t3].test(e3);
|
|
3032
|
+
})(m2, h2) && s2.push(new Gt({ tagBuilder: r2, matchedText: m2, offset: p2, serviceName: h2, mention: m2.slice(1) }));
|
|
2998
3033
|
break;
|
|
2999
3034
|
case 4:
|
|
3000
|
-
if (m2 = m2.replace(/ +$/g, ""), ("+" === (u2 = m2).charAt(0) ||
|
|
3035
|
+
if (m2 = m2.replace(/ +$/g, ""), ("+" === (u2 = m2).charAt(0) || Ft.test(u2)) && Ht.test(u2)) {
|
|
3001
3036
|
var g2 = m2.replace(/[^0-9,;#]/g, "");
|
|
3002
|
-
s2.push(new
|
|
3037
|
+
s2.push(new Yt({ tagBuilder: r2, matchedText: m2, offset: p2, number: g2, plusSign: "+" === m2.charAt(0) }));
|
|
3003
3038
|
}
|
|
3004
3039
|
break;
|
|
3005
3040
|
default:
|
|
3006
|
-
|
|
3041
|
+
et(t2);
|
|
3007
3042
|
}
|
|
3008
3043
|
}
|
|
3009
3044
|
}
|
|
3010
|
-
function
|
|
3045
|
+
function qs(e2) {
|
|
3011
3046
|
switch (e2) {
|
|
3012
3047
|
case 0:
|
|
3013
3048
|
return "scheme";
|
|
@@ -3016,124 +3051,124 @@ function js(e2) {
|
|
|
3016
3051
|
case 2:
|
|
3017
3052
|
return "ipV4";
|
|
3018
3053
|
default:
|
|
3019
|
-
|
|
3054
|
+
et(e2);
|
|
3020
3055
|
}
|
|
3021
3056
|
}
|
|
3022
|
-
var
|
|
3023
|
-
function
|
|
3057
|
+
var Bs = { ")": "(", "}": "{", "]": "[" };
|
|
3058
|
+
function Ls(e2, t2) {
|
|
3024
3059
|
return { type: 0, startIdx: e2, state: t2, acceptStateReached: false, matchType: 0 };
|
|
3025
3060
|
}
|
|
3026
|
-
function
|
|
3061
|
+
function Gs(e2, t2) {
|
|
3027
3062
|
return { type: 0, startIdx: e2, state: t2, acceptStateReached: false, matchType: 1 };
|
|
3028
3063
|
}
|
|
3029
|
-
function
|
|
3064
|
+
function Fs(e2, t2) {
|
|
3030
3065
|
return { type: 4, startIdx: e2, state: t2, acceptStateReached: false };
|
|
3031
3066
|
}
|
|
3032
|
-
function
|
|
3067
|
+
function Hs(e2) {
|
|
3033
3068
|
return 0 === e2.type && 0 === e2.matchType;
|
|
3034
3069
|
}
|
|
3035
|
-
var
|
|
3070
|
+
var Js = function(e2) {
|
|
3036
3071
|
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;
|
|
3037
|
-
},
|
|
3038
|
-
this.charIdx = 0, this.state = 0, this.currentDataIdx = 0, this.currentTag =
|
|
3072
|
+
}, zs = new Js(), Ys = function(e2, t2) {
|
|
3073
|
+
this.charIdx = 0, this.state = 0, this.currentDataIdx = 0, this.currentTag = zs, this.html = e2, this.callbacks = t2;
|
|
3039
3074
|
};
|
|
3040
|
-
function
|
|
3041
|
-
"<" === t2 &&
|
|
3042
|
-
}
|
|
3043
|
-
function Ys(e2, t2, s2) {
|
|
3044
|
-
"!" === t2 ? e2.state = 13 : "/" === t2 ? (e2.state = 2, e2.currentTag = new Fs(Ye(Ye({}, e2.currentTag), { isClosing: true }))) : "<" === t2 ? gn(e2) : rt(s2) ? (e2.state = 3, e2.currentTag = new Fs(Ye(Ye({}, e2.currentTag), { isOpening: true }))) : (e2.state = 0, e2.currentTag = Hs);
|
|
3045
|
-
}
|
|
3046
|
-
function Qs(e2, t2, s2) {
|
|
3047
|
-
ct(s2) ? (e2.currentTag = new Fs(Ye(Ye({}, e2.currentTag), { name: bn(e2) })), e2.state = 4) : "<" === t2 ? gn(e2) : "/" === t2 ? (e2.currentTag = new Fs(Ye(Ye({}, e2.currentTag), { name: bn(e2) })), e2.state = 12) : ">" === t2 ? (e2.currentTag = new Fs(Ye(Ye({}, e2.currentTag), { name: bn(e2) })), vn(e2)) : rt(s2) || it(s2) || ":" === t2 || fn(e2);
|
|
3075
|
+
function Qs(e2, t2) {
|
|
3076
|
+
"<" === t2 && bn(e2);
|
|
3048
3077
|
}
|
|
3049
3078
|
function Vs(e2, t2, s2) {
|
|
3050
|
-
"
|
|
3079
|
+
"!" === t2 ? e2.state = 13 : "/" === t2 ? (e2.state = 2, e2.currentTag = new Js(Ve(Ve({}, e2.currentTag), { isClosing: true }))) : "<" === t2 ? bn(e2) : ot(s2) ? (e2.state = 3, e2.currentTag = new Js(Ve(Ve({}, e2.currentTag), { isOpening: true }))) : (e2.state = 0, e2.currentTag = zs);
|
|
3051
3080
|
}
|
|
3052
3081
|
function Ks(e2, t2, s2) {
|
|
3053
|
-
|
|
3054
|
-
ct(s2) || ("/" === t2 ? e2.state = 12 : ">" === t2 ? vn(e2) : "<" === t2 ? gn(e2) : "=" === t2 || ot(s2) || ((n2 = s2) >= 0 && n2 <= 31 || 127 == n2) ? fn(e2) : e2.state = 5);
|
|
3082
|
+
ht(s2) ? (e2.currentTag = new Js(Ve(Ve({}, e2.currentTag), { name: wn(e2) })), e2.state = 4) : "<" === t2 ? bn(e2) : "/" === t2 ? (e2.currentTag = new Js(Ve(Ve({}, e2.currentTag), { name: wn(e2) })), e2.state = 12) : ">" === t2 ? (e2.currentTag = new Js(Ve(Ve({}, e2.currentTag), { name: wn(e2) })), yn(e2)) : ot(s2) || ct(s2) || ":" === t2 || vn(e2);
|
|
3055
3083
|
}
|
|
3056
3084
|
function Zs(e2, t2, s2) {
|
|
3057
|
-
|
|
3085
|
+
">" === t2 ? vn(e2) : ot(s2) ? e2.state = 3 : vn(e2);
|
|
3058
3086
|
}
|
|
3059
3087
|
function Xs(e2, t2, s2) {
|
|
3060
|
-
|
|
3088
|
+
var n2;
|
|
3089
|
+
ht(s2) || ("/" === t2 ? e2.state = 12 : ">" === t2 ? yn(e2) : "<" === t2 ? bn(e2) : "=" === t2 || lt(s2) || ((n2 = s2) >= 0 && n2 <= 31 || 127 == n2) ? vn(e2) : e2.state = 5);
|
|
3061
3090
|
}
|
|
3062
3091
|
function en(e2, t2, s2) {
|
|
3063
|
-
|
|
3092
|
+
ht(s2) ? e2.state = 6 : "/" === t2 ? e2.state = 12 : "=" === t2 ? e2.state = 7 : ">" === t2 ? yn(e2) : "<" === t2 ? bn(e2) : lt(s2) && vn(e2);
|
|
3064
3093
|
}
|
|
3065
|
-
function tn(e2, t2) {
|
|
3094
|
+
function tn(e2, t2, s2) {
|
|
3095
|
+
ht(s2) || ("/" === t2 ? e2.state = 12 : "=" === t2 ? e2.state = 7 : ">" === t2 ? yn(e2) : "<" === t2 ? bn(e2) : lt(s2) ? vn(e2) : e2.state = 5);
|
|
3096
|
+
}
|
|
3097
|
+
function sn(e2, t2, s2) {
|
|
3098
|
+
ht(s2) || ('"' === t2 ? e2.state = 8 : "'" === t2 ? e2.state = 9 : /[>=`]/.test(t2) ? vn(e2) : "<" === t2 ? bn(e2) : e2.state = 10);
|
|
3099
|
+
}
|
|
3100
|
+
function nn(e2, t2) {
|
|
3066
3101
|
'"' === t2 && (e2.state = 11);
|
|
3067
3102
|
}
|
|
3068
|
-
function
|
|
3103
|
+
function an(e2, t2) {
|
|
3069
3104
|
"'" === t2 && (e2.state = 11);
|
|
3070
3105
|
}
|
|
3071
|
-
function
|
|
3072
|
-
|
|
3106
|
+
function rn(e2, t2, s2) {
|
|
3107
|
+
ht(s2) ? e2.state = 4 : ">" === t2 ? yn(e2) : "<" === t2 && bn(e2);
|
|
3073
3108
|
}
|
|
3074
|
-
function
|
|
3075
|
-
|
|
3109
|
+
function on(e2, t2, s2) {
|
|
3110
|
+
ht(s2) ? e2.state = 4 : "/" === t2 ? e2.state = 12 : ">" === t2 ? yn(e2) : "<" === t2 ? bn(e2) : (e2.state = 4, (function(e3) {
|
|
3076
3111
|
e3.charIdx--;
|
|
3077
3112
|
})(e2));
|
|
3078
3113
|
}
|
|
3079
|
-
function rn(e2, t2) {
|
|
3080
|
-
">" === t2 ? (e2.currentTag = new Fs(Ye(Ye({}, e2.currentTag), { isClosing: true })), vn(e2)) : fn(e2);
|
|
3081
|
-
}
|
|
3082
|
-
function on(e2) {
|
|
3083
|
-
var t2 = e2.html, s2 = e2.charIdx;
|
|
3084
|
-
"--" === t2.slice(s2, s2 + 2) ? (e2.charIdx++, e2.currentTag = new Fs(Ye(Ye({}, e2.currentTag), { type: "comment" })), e2.state = 14) : "DOCTYPE" === t2.slice(s2, s2 + 7).toUpperCase() ? (e2.charIdx += 6, e2.currentTag = new Fs(Ye(Ye({}, e2.currentTag), { type: "doctype" })), e2.state = 20) : fn(e2);
|
|
3085
|
-
}
|
|
3086
3114
|
function cn(e2, t2) {
|
|
3087
|
-
"
|
|
3115
|
+
">" === t2 ? (e2.currentTag = new Js(Ve(Ve({}, e2.currentTag), { isClosing: true })), yn(e2)) : vn(e2);
|
|
3088
3116
|
}
|
|
3089
|
-
function ln(e2
|
|
3090
|
-
|
|
3117
|
+
function ln(e2) {
|
|
3118
|
+
var t2 = e2.html, s2 = e2.charIdx;
|
|
3119
|
+
"--" === t2.slice(s2, s2 + 2) ? (e2.charIdx++, e2.currentTag = new Js(Ve(Ve({}, e2.currentTag), { type: "comment" })), e2.state = 14) : "DOCTYPE" === t2.slice(s2, s2 + 7).toUpperCase() ? (e2.charIdx += 6, e2.currentTag = new Js(Ve(Ve({}, e2.currentTag), { type: "doctype" })), e2.state = 20) : vn(e2);
|
|
3091
3120
|
}
|
|
3092
3121
|
function hn(e2, t2) {
|
|
3093
|
-
"-" === t2
|
|
3122
|
+
"-" === t2 ? e2.state = 15 : ">" === t2 ? vn(e2) : e2.state = 16;
|
|
3094
3123
|
}
|
|
3095
3124
|
function un(e2, t2) {
|
|
3096
|
-
e2.state = "
|
|
3125
|
+
"-" === t2 ? e2.state = 18 : ">" === t2 ? vn(e2) : e2.state = 16;
|
|
3097
3126
|
}
|
|
3098
3127
|
function dn(e2, t2) {
|
|
3099
|
-
"
|
|
3128
|
+
"-" === t2 && (e2.state = 17);
|
|
3100
3129
|
}
|
|
3101
3130
|
function pn(e2, t2) {
|
|
3102
|
-
|
|
3131
|
+
e2.state = "-" === t2 ? 18 : 16;
|
|
3103
3132
|
}
|
|
3104
3133
|
function mn(e2, t2) {
|
|
3105
|
-
">" === t2 ?
|
|
3134
|
+
">" === t2 ? yn(e2) : "!" === t2 ? e2.state = 19 : "-" === t2 || (e2.state = 16);
|
|
3106
3135
|
}
|
|
3107
|
-
function fn(e2) {
|
|
3108
|
-
e2.state =
|
|
3136
|
+
function fn(e2, t2) {
|
|
3137
|
+
"-" === t2 ? e2.state = 17 : ">" === t2 ? yn(e2) : e2.state = 16;
|
|
3109
3138
|
}
|
|
3110
|
-
function gn(e2) {
|
|
3111
|
-
|
|
3139
|
+
function gn(e2, t2) {
|
|
3140
|
+
">" === t2 ? yn(e2) : "<" === t2 && bn(e2);
|
|
3112
3141
|
}
|
|
3113
3142
|
function vn(e2) {
|
|
3143
|
+
e2.state = 0, e2.currentTag = zs;
|
|
3144
|
+
}
|
|
3145
|
+
function bn(e2) {
|
|
3146
|
+
e2.state = 1, e2.currentTag = new Js({ idx: e2.charIdx });
|
|
3147
|
+
}
|
|
3148
|
+
function yn(e2) {
|
|
3114
3149
|
var t2 = e2.html.slice(e2.currentDataIdx, e2.currentTag.idx);
|
|
3115
3150
|
t2 && e2.callbacks.onText(t2, e2.currentDataIdx);
|
|
3116
3151
|
var s2 = e2.currentTag;
|
|
3117
|
-
"comment" === s2.type ? e2.callbacks.onComment(s2.idx) : "doctype" === s2.type ? e2.callbacks.onDoctype(s2.idx) : (s2.isOpening && e2.callbacks.onOpenTag(s2.name, s2.idx), s2.isClosing && e2.callbacks.onCloseTag(s2.name, s2.idx)),
|
|
3152
|
+
"comment" === s2.type ? e2.callbacks.onComment(s2.idx) : "doctype" === s2.type ? e2.callbacks.onDoctype(s2.idx) : (s2.isOpening && e2.callbacks.onOpenTag(s2.name, s2.idx), s2.isClosing && e2.callbacks.onCloseTag(s2.name, s2.idx)), vn(e2), e2.currentDataIdx = e2.charIdx + 1;
|
|
3118
3153
|
}
|
|
3119
|
-
function
|
|
3154
|
+
function wn(e2) {
|
|
3120
3155
|
var t2 = e2.currentTag.idx + (e2.currentTag.isClosing ? 2 : 1);
|
|
3121
3156
|
return e2.html.slice(t2, e2.charIdx).toLowerCase();
|
|
3122
3157
|
}
|
|
3123
|
-
var
|
|
3158
|
+
var kn = (function() {
|
|
3124
3159
|
function e2(t2) {
|
|
3125
3160
|
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.tagBuilder = null, this.urls = (function(e3) {
|
|
3126
3161
|
null == e3 && (e3 = true);
|
|
3127
|
-
return
|
|
3128
|
-
})(t2.urls), this.email =
|
|
3162
|
+
return Ze(e3) ? { schemeMatches: e3, tldMatches: e3, ipV4Matches: e3 } : { schemeMatches: !Ze(e3.schemeMatches) || e3.schemeMatches, tldMatches: !Ze(e3.tldMatches) || e3.tldMatches, ipV4Matches: !Ze(e3.ipV4Matches) || e3.ipV4Matches };
|
|
3163
|
+
})(t2.urls), this.email = Ze(t2.email) ? t2.email : this.email, this.phone = Ze(t2.phone) ? t2.phone : this.phone, this.hashtag = t2.hashtag || this.hashtag, this.mention = t2.mention || this.mention, this.newWindow = Ze(t2.newWindow) ? t2.newWindow : this.newWindow, this.stripPrefix = (function(e3) {
|
|
3129
3164
|
null == e3 && (e3 = true);
|
|
3130
|
-
return
|
|
3131
|
-
})(t2.stripPrefix), this.stripTrailingSlash =
|
|
3165
|
+
return Ze(e3) ? { scheme: e3, www: e3 } : { scheme: !Ze(e3.scheme) || e3.scheme, www: !Ze(e3.www) || e3.www };
|
|
3166
|
+
})(t2.stripPrefix), this.stripTrailingSlash = Ze(t2.stripTrailingSlash) ? t2.stripTrailingSlash : this.stripTrailingSlash, this.decodePercentEncoding = Ze(t2.decodePercentEncoding) ? t2.decodePercentEncoding : this.decodePercentEncoding, this.sanitizeHtml = t2.sanitizeHtml || false;
|
|
3132
3167
|
var s2 = this.mention;
|
|
3133
|
-
if (false !== s2 && -1 ===
|
|
3168
|
+
if (false !== s2 && -1 === Lt.indexOf(s2)) throw new Error("invalid `mention` cfg '".concat(s2, "' - see docs"));
|
|
3134
3169
|
var n2, a2 = this.hashtag;
|
|
3135
|
-
if (false !== a2 && -1 ===
|
|
3136
|
-
this.truncate = "number" == typeof (n2 = t2.truncate) ? { length: n2, location: "end" } :
|
|
3170
|
+
if (false !== a2 && -1 === Ut.indexOf(a2)) throw new Error("invalid `hashtag` cfg '".concat(a2, "' - see docs"));
|
|
3171
|
+
this.truncate = "number" == typeof (n2 = t2.truncate) ? { length: n2, location: "end" } : Ve({ length: Number.POSITIVE_INFINITY, location: "end" }, n2), this.className = t2.className || this.className, this.replaceFn = t2.replaceFn || this.replaceFn, this.context = t2.context || this;
|
|
3137
3172
|
}
|
|
3138
3173
|
return e2.link = function(t2, s2) {
|
|
3139
3174
|
return new e2(s2).link(t2);
|
|
@@ -3142,74 +3177,74 @@ var yn = (function() {
|
|
|
3142
3177
|
}, e2.prototype.parse = function(e3) {
|
|
3143
3178
|
var t2 = this, s2 = ["a", "style", "script"], n2 = 0, a2 = [];
|
|
3144
3179
|
return (function(e4, t3) {
|
|
3145
|
-
for (var s3 = new
|
|
3180
|
+
for (var s3 = new Ys(e4, t3), n3 = e4.length; s3.charIdx < n3; ) {
|
|
3146
3181
|
var a3 = e4.charAt(s3.charIdx), r2 = e4.charCodeAt(s3.charIdx);
|
|
3147
3182
|
switch (s3.state) {
|
|
3148
3183
|
case 0:
|
|
3149
|
-
|
|
3184
|
+
Qs(s3, a3);
|
|
3150
3185
|
break;
|
|
3151
3186
|
case 1:
|
|
3152
|
-
|
|
3187
|
+
Vs(s3, a3, r2);
|
|
3153
3188
|
break;
|
|
3154
3189
|
case 2:
|
|
3155
|
-
|
|
3190
|
+
Zs(s3, a3, r2);
|
|
3156
3191
|
break;
|
|
3157
3192
|
case 3:
|
|
3158
|
-
|
|
3193
|
+
Ks(s3, a3, r2);
|
|
3159
3194
|
break;
|
|
3160
3195
|
case 4:
|
|
3161
|
-
|
|
3196
|
+
Xs(s3, a3, r2);
|
|
3162
3197
|
break;
|
|
3163
3198
|
case 5:
|
|
3164
|
-
|
|
3199
|
+
en(s3, a3, r2);
|
|
3165
3200
|
break;
|
|
3166
3201
|
case 6:
|
|
3167
|
-
|
|
3202
|
+
tn(s3, a3, r2);
|
|
3168
3203
|
break;
|
|
3169
3204
|
case 7:
|
|
3170
|
-
|
|
3205
|
+
sn(s3, a3, r2);
|
|
3171
3206
|
break;
|
|
3172
3207
|
case 8:
|
|
3173
|
-
|
|
3208
|
+
nn(s3, a3);
|
|
3174
3209
|
break;
|
|
3175
3210
|
case 9:
|
|
3176
|
-
|
|
3211
|
+
an(s3, a3);
|
|
3177
3212
|
break;
|
|
3178
3213
|
case 10:
|
|
3179
|
-
|
|
3214
|
+
rn(s3, a3, r2);
|
|
3180
3215
|
break;
|
|
3181
3216
|
case 11:
|
|
3182
|
-
|
|
3217
|
+
on(s3, a3, r2);
|
|
3183
3218
|
break;
|
|
3184
3219
|
case 12:
|
|
3185
|
-
|
|
3220
|
+
cn(s3, a3);
|
|
3186
3221
|
break;
|
|
3187
3222
|
case 13:
|
|
3188
|
-
|
|
3223
|
+
ln(s3);
|
|
3189
3224
|
break;
|
|
3190
3225
|
case 14:
|
|
3191
|
-
|
|
3226
|
+
hn(s3, a3);
|
|
3192
3227
|
break;
|
|
3193
3228
|
case 15:
|
|
3194
|
-
|
|
3229
|
+
un(s3, a3);
|
|
3195
3230
|
break;
|
|
3196
3231
|
case 16:
|
|
3197
|
-
|
|
3232
|
+
dn(s3, a3);
|
|
3198
3233
|
break;
|
|
3199
3234
|
case 17:
|
|
3200
|
-
|
|
3235
|
+
pn(s3, a3);
|
|
3201
3236
|
break;
|
|
3202
3237
|
case 18:
|
|
3203
|
-
|
|
3238
|
+
mn(s3, a3);
|
|
3204
3239
|
break;
|
|
3205
3240
|
case 19:
|
|
3206
|
-
|
|
3241
|
+
fn(s3, a3);
|
|
3207
3242
|
break;
|
|
3208
3243
|
case 20:
|
|
3209
|
-
|
|
3244
|
+
gn(s3, a3);
|
|
3210
3245
|
break;
|
|
3211
3246
|
default:
|
|
3212
|
-
|
|
3247
|
+
et(s3.state);
|
|
3213
3248
|
}
|
|
3214
3249
|
s3.charIdx++;
|
|
3215
3250
|
}
|
|
@@ -3255,7 +3290,7 @@ var yn = (function() {
|
|
|
3255
3290
|
}, onDoctype: function() {
|
|
3256
3291
|
} }), a2 = this.compactMatches(a2), a2 = this.removeUnwantedMatches(a2);
|
|
3257
3292
|
}, e2.prototype.compactMatches = function(e3) {
|
|
3258
|
-
e3.sort(
|
|
3293
|
+
e3.sort(Cn);
|
|
3259
3294
|
for (var t2 = 0; t2 < e3.length - 1; ) {
|
|
3260
3295
|
var s2 = e3[t2], n2 = s2.getOffset(), a2 = s2.getMatchedText().length;
|
|
3261
3296
|
if (t2 + 1 < e3.length && e3[t2 + 1].getOffset() === n2) {
|
|
@@ -3265,169 +3300,169 @@ var yn = (function() {
|
|
|
3265
3300
|
}
|
|
3266
3301
|
return e3;
|
|
3267
3302
|
}, e2.prototype.removeUnwantedMatches = function(e3) {
|
|
3268
|
-
return this.hashtag ||
|
|
3303
|
+
return this.hashtag || Xe(e3, function(e4) {
|
|
3269
3304
|
return "hashtag" === e4.getType();
|
|
3270
|
-
}), this.email ||
|
|
3305
|
+
}), this.email || Xe(e3, function(e4) {
|
|
3271
3306
|
return "email" === e4.getType();
|
|
3272
|
-
}), this.phone ||
|
|
3307
|
+
}), this.phone || Xe(e3, function(e4) {
|
|
3273
3308
|
return "phone" === e4.getType();
|
|
3274
|
-
}), this.mention ||
|
|
3309
|
+
}), this.mention || Xe(e3, function(e4) {
|
|
3275
3310
|
return "mention" === e4.getType();
|
|
3276
|
-
}), this.urls.schemeMatches ||
|
|
3311
|
+
}), this.urls.schemeMatches || Xe(e3, function(e4) {
|
|
3277
3312
|
return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
|
|
3278
|
-
}), this.urls.tldMatches ||
|
|
3313
|
+
}), this.urls.tldMatches || Xe(e3, function(e4) {
|
|
3279
3314
|
return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
|
|
3280
|
-
}), this.urls.ipV4Matches ||
|
|
3315
|
+
}), this.urls.ipV4Matches || Xe(e3, function(e4) {
|
|
3281
3316
|
return "url" === e4.getType() && "ipV4" === e4.getUrlMatchType();
|
|
3282
3317
|
}), e3;
|
|
3283
3318
|
}, e2.prototype.parseText = function(e3, t2) {
|
|
3284
3319
|
t2 = t2 || 0;
|
|
3285
3320
|
for (var s2 = (function(e4, t3) {
|
|
3286
|
-
for (var s3 = new
|
|
3321
|
+
for (var s3 = new Qt(e4, t3); s3.charIdx < s3.text.length; s3.charIdx++) {
|
|
3287
3322
|
var n3 = e4.charAt(s3.charIdx), a3 = e4.charCodeAt(s3.charIdx);
|
|
3288
|
-
if (0 === s3.stateMachines.length)
|
|
3323
|
+
if (0 === s3.stateMachines.length) Vt(s3, n3, a3);
|
|
3289
3324
|
else {
|
|
3290
3325
|
for (var r2 = s3.stateMachines.length - 1; r2 >= 0; r2--) {
|
|
3291
3326
|
var i2 = s3.stateMachines[r2];
|
|
3292
3327
|
switch (i2.state) {
|
|
3293
3328
|
case 11:
|
|
3294
|
-
|
|
3329
|
+
ss(s3, i2, a3);
|
|
3295
3330
|
break;
|
|
3296
3331
|
case 12:
|
|
3297
|
-
|
|
3332
|
+
ns(s3, i2, a3);
|
|
3298
3333
|
break;
|
|
3299
3334
|
case 0:
|
|
3300
|
-
|
|
3335
|
+
Kt(s3, i2, a3);
|
|
3301
3336
|
break;
|
|
3302
3337
|
case 1:
|
|
3303
|
-
|
|
3338
|
+
Zt(s3, i2, a3);
|
|
3304
3339
|
break;
|
|
3305
3340
|
case 2:
|
|
3306
|
-
|
|
3341
|
+
Xt(s3, i2, a3);
|
|
3307
3342
|
break;
|
|
3308
3343
|
case 3:
|
|
3309
|
-
|
|
3344
|
+
es(s3, i2, a3);
|
|
3310
3345
|
break;
|
|
3311
3346
|
case 4:
|
|
3312
|
-
|
|
3347
|
+
ts(s3, i2, 0, a3);
|
|
3313
3348
|
break;
|
|
3314
3349
|
case 5:
|
|
3315
|
-
|
|
3350
|
+
as(s3, i2, a3);
|
|
3316
3351
|
break;
|
|
3317
3352
|
case 6:
|
|
3318
|
-
|
|
3353
|
+
rs(s3, i2, 0, a3);
|
|
3319
3354
|
break;
|
|
3320
3355
|
case 7:
|
|
3321
|
-
|
|
3356
|
+
is(s3, i2, 0, a3);
|
|
3322
3357
|
break;
|
|
3323
3358
|
case 13:
|
|
3324
|
-
|
|
3359
|
+
os(s3, i2, a3);
|
|
3325
3360
|
break;
|
|
3326
3361
|
case 14:
|
|
3327
|
-
|
|
3362
|
+
cs(s3, i2, a3);
|
|
3328
3363
|
break;
|
|
3329
3364
|
case 8:
|
|
3330
|
-
|
|
3365
|
+
ls(s3, i2, a3);
|
|
3331
3366
|
break;
|
|
3332
3367
|
case 9:
|
|
3333
|
-
|
|
3368
|
+
hs(s3, i2, a3);
|
|
3334
3369
|
break;
|
|
3335
3370
|
case 10:
|
|
3336
|
-
|
|
3371
|
+
us(s3, i2, a3);
|
|
3337
3372
|
break;
|
|
3338
3373
|
case 15:
|
|
3339
|
-
|
|
3374
|
+
ds(s3, i2, n3, a3);
|
|
3340
3375
|
break;
|
|
3341
3376
|
case 16:
|
|
3342
|
-
|
|
3377
|
+
ps(s3, i2, n3, a3);
|
|
3343
3378
|
break;
|
|
3344
3379
|
case 17:
|
|
3345
|
-
|
|
3380
|
+
ms(s3, i2, n3, a3);
|
|
3346
3381
|
break;
|
|
3347
3382
|
case 18:
|
|
3348
|
-
|
|
3383
|
+
fs(s3, i2, n3, a3);
|
|
3349
3384
|
break;
|
|
3350
3385
|
case 19:
|
|
3351
|
-
|
|
3386
|
+
gs(s3, i2, n3, a3);
|
|
3352
3387
|
break;
|
|
3353
3388
|
case 20:
|
|
3354
|
-
|
|
3389
|
+
vs(s3, i2, a3);
|
|
3355
3390
|
break;
|
|
3356
3391
|
case 21:
|
|
3357
|
-
|
|
3392
|
+
bs(s3, i2, a3);
|
|
3358
3393
|
break;
|
|
3359
3394
|
case 22:
|
|
3360
|
-
|
|
3395
|
+
ys(s3, i2, a3);
|
|
3361
3396
|
break;
|
|
3362
3397
|
case 23:
|
|
3363
|
-
|
|
3398
|
+
ws(s3, i2, a3);
|
|
3364
3399
|
break;
|
|
3365
3400
|
case 24:
|
|
3366
|
-
|
|
3401
|
+
ks(s3, i2, a3);
|
|
3367
3402
|
break;
|
|
3368
3403
|
case 25:
|
|
3369
|
-
|
|
3404
|
+
Cs(s3, i2, a3);
|
|
3370
3405
|
break;
|
|
3371
3406
|
case 26:
|
|
3372
|
-
|
|
3407
|
+
Ts(s3, i2, a3);
|
|
3373
3408
|
break;
|
|
3374
3409
|
case 27:
|
|
3375
|
-
|
|
3410
|
+
Is(s3, i2, a3);
|
|
3376
3411
|
break;
|
|
3377
3412
|
case 28:
|
|
3378
|
-
|
|
3413
|
+
Ss(s3, i2, a3);
|
|
3379
3414
|
break;
|
|
3380
3415
|
case 29:
|
|
3381
|
-
|
|
3416
|
+
xs(s3, i2, a3);
|
|
3382
3417
|
break;
|
|
3383
3418
|
case 30:
|
|
3384
|
-
|
|
3419
|
+
Es(s3, i2, a3);
|
|
3385
3420
|
break;
|
|
3386
3421
|
case 31:
|
|
3387
|
-
|
|
3422
|
+
Ms(s3, i2, a3);
|
|
3388
3423
|
break;
|
|
3389
3424
|
case 32:
|
|
3390
|
-
|
|
3425
|
+
Ns(s3, i2, n3, a3);
|
|
3391
3426
|
break;
|
|
3392
3427
|
case 33:
|
|
3393
|
-
|
|
3428
|
+
Rs(s3, i2, a3);
|
|
3394
3429
|
break;
|
|
3395
3430
|
case 34:
|
|
3396
|
-
|
|
3431
|
+
Ds(s3, i2, a3);
|
|
3397
3432
|
break;
|
|
3398
3433
|
case 35:
|
|
3399
|
-
|
|
3434
|
+
_s(s3, i2, a3);
|
|
3400
3435
|
break;
|
|
3401
3436
|
case 36:
|
|
3402
|
-
|
|
3437
|
+
Os(s3, i2, 0, a3);
|
|
3403
3438
|
break;
|
|
3404
3439
|
case 37:
|
|
3405
|
-
|
|
3440
|
+
As(s3, i2, n3, a3);
|
|
3406
3441
|
break;
|
|
3407
3442
|
case 38:
|
|
3408
|
-
|
|
3443
|
+
Ps(s3, i2, 0, a3);
|
|
3409
3444
|
break;
|
|
3410
3445
|
case 39:
|
|
3411
|
-
|
|
3446
|
+
js(s3, i2, n3, a3);
|
|
3412
3447
|
break;
|
|
3413
3448
|
case 40:
|
|
3414
|
-
|
|
3449
|
+
$s(s3, i2, a3);
|
|
3415
3450
|
break;
|
|
3416
3451
|
case 41:
|
|
3417
|
-
|
|
3452
|
+
Us(s3, i2, a3);
|
|
3418
3453
|
break;
|
|
3419
3454
|
default:
|
|
3420
|
-
|
|
3455
|
+
et(i2.state);
|
|
3421
3456
|
}
|
|
3422
3457
|
}
|
|
3423
|
-
if (!s3.hasSchemeUrlMachine() && s3.charIdx > 0 &&
|
|
3458
|
+
if (!s3.hasSchemeUrlMachine() && s3.charIdx > 0 && kt(a3)) {
|
|
3424
3459
|
var o2 = s3.text.charCodeAt(s3.charIdx - 1);
|
|
3425
|
-
|
|
3460
|
+
kt(o2) || s3.addMachine(Ls(s3.charIdx, 0));
|
|
3426
3461
|
}
|
|
3427
3462
|
}
|
|
3428
3463
|
}
|
|
3429
3464
|
for (var c2 = s3.stateMachines.length - 1; c2 >= 0; c2--) s3.stateMachines.forEach(function(e5) {
|
|
3430
|
-
return
|
|
3465
|
+
return Ws(s3, e5);
|
|
3431
3466
|
});
|
|
3432
3467
|
return s3.matches;
|
|
3433
3468
|
})(e3, { tagBuilder: this.getTagBuilder(), stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding, hashtagServiceName: this.hashtag, mentionServiceName: this.mention || "twitter" }), n2 = 0, a2 = s2.length; n2 < a2; n2++) s2[n2].setOffset(t2 + s2[n2].getOffset());
|
|
@@ -3442,92 +3477,92 @@ var yn = (function() {
|
|
|
3442
3477
|
return s2.push(e3.substring(n2)), s2.join("");
|
|
3443
3478
|
}, e2.prototype.createMatchReturnVal = function(e3) {
|
|
3444
3479
|
var t2;
|
|
3445
|
-
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof
|
|
3480
|
+
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof st ? t2.toAnchorString() : e3.buildTag().toAnchorString();
|
|
3446
3481
|
}, e2.prototype.getTagBuilder = function() {
|
|
3447
3482
|
var e3 = this.tagBuilder;
|
|
3448
|
-
return e3 || (e3 = this.tagBuilder = new
|
|
3483
|
+
return e3 || (e3 = this.tagBuilder = new rt({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
|
|
3449
3484
|
}, e2.version = "4.1.5", e2;
|
|
3450
3485
|
})();
|
|
3451
|
-
function
|
|
3486
|
+
function Cn(e2, t2) {
|
|
3452
3487
|
return e2.getOffset() - t2.getOffset();
|
|
3453
3488
|
}
|
|
3454
|
-
function
|
|
3489
|
+
function Tn(e2, t2 = e2) {
|
|
3455
3490
|
return { type: "autolink", url: e2, text: t2 };
|
|
3456
3491
|
}
|
|
3457
|
-
const
|
|
3492
|
+
const In = qe(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ (function(e3, t3) {
|
|
3458
3493
|
return { type: "mention", id: e3, text: t3 };
|
|
3459
|
-
})(decodeURIComponent(t2), s2)),
|
|
3494
|
+
})(decodeURIComponent(t2), s2)), Sn = qe(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ (function(e3) {
|
|
3460
3495
|
return { type: "customemoji", text: e3 };
|
|
3461
|
-
})(t2)),
|
|
3496
|
+
})(t2)), xn = qe(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ (function(e3, t3 = []) {
|
|
3462
3497
|
return { type: "link", url: e3, children: t3 };
|
|
3463
|
-
})(t2, [s2])),
|
|
3464
|
-
const { action: n2, params: a2 } =
|
|
3498
|
+
})(t2, [s2])), En = qe(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3499
|
+
const { action: n2, params: a2 } = An(t2);
|
|
3465
3500
|
return /* @__PURE__ */ (function(e3, t3, s3 = []) {
|
|
3466
3501
|
return { type: "actionlink", action: e3, params: t3, children: s3 };
|
|
3467
3502
|
})(n2, a2, [s2]);
|
|
3468
|
-
}),
|
|
3469
|
-
const { action: n2, params: a2 } =
|
|
3503
|
+
}), Mn = qe(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3504
|
+
const { action: n2, params: a2 } = An(t2);
|
|
3470
3505
|
return /* @__PURE__ */ (function(e3, t3, s3 = []) {
|
|
3471
3506
|
return { type: "actionbutton", action: e3, params: t3, children: s3 };
|
|
3472
3507
|
})(n2, a2, [s2]);
|
|
3473
3508
|
});
|
|
3474
|
-
function
|
|
3509
|
+
function An(e2) {
|
|
3475
3510
|
const t2 = e2.indexOf("?");
|
|
3476
3511
|
if (-1 === t2) return { action: e2, params: {} };
|
|
3477
3512
|
return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
|
|
3478
3513
|
}
|
|
3479
|
-
const
|
|
3514
|
+
const Nn = qe(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ (function(e3 = []) {
|
|
3480
3515
|
return { type: "bulletlist", children: e3 };
|
|
3481
|
-
})([e2.startsWith("\n") ? e2.slice(1) : e2])),
|
|
3516
|
+
})([e2.startsWith("\n") ? e2.slice(1) : e2])), Rn = qe(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), Dn = (e2) => {
|
|
3482
3517
|
const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
|
|
3483
3518
|
let s2 = 0;
|
|
3484
3519
|
const n2 = [];
|
|
3485
3520
|
for (const a2 of Z(e2, t2)) {
|
|
3486
3521
|
const t3 = a2[0], r2 = a2[1], i2 = t3.startsWith(r2) ? a2.index : a2.index + 1;
|
|
3487
3522
|
i2 - s2 > 0 && n2.push(e2.substring(s2, i2));
|
|
3488
|
-
const o2 =
|
|
3523
|
+
const o2 = Tn("tel:" + r2.replace(/[^0-9+]/g, ""), r2);
|
|
3489
3524
|
n2.push(o2), s2 = i2 + r2.length;
|
|
3490
3525
|
}
|
|
3491
3526
|
return s2 < e2.length && n2.push(e2.substring(s2)), n2;
|
|
3492
|
-
},
|
|
3493
|
-
const t2 =
|
|
3527
|
+
}, _n = (e2) => xn(e2).flatMap((e3) => "string" == typeof e3 ? On(e3) : ["<", ...On(e3.url), ...On("|" + e3.children[0] + ">")]), On = (e2) => {
|
|
3528
|
+
const t2 = kn.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
|
|
3494
3529
|
let n2 = 0;
|
|
3495
3530
|
for (const a2 of t2) {
|
|
3496
3531
|
const t3 = a2.getOffset(), r2 = a2.getMatchedText(), i2 = r2.length;
|
|
3497
3532
|
let o2 = r2;
|
|
3498
|
-
a2 instanceof
|
|
3533
|
+
a2 instanceof jt ? o2 = "mailto:" + a2.getEmail() : a2 instanceof Dt && (o2 = a2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Tn(o2, r2)), n2 = t3 + i2;
|
|
3499
3534
|
}
|
|
3500
3535
|
return n2 < e2.length && s2.push(e2.substring(n2)), s2;
|
|
3501
|
-
},
|
|
3502
|
-
function
|
|
3536
|
+
}, Pn = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
|
|
3537
|
+
function jn(e2 = { except: [] }) {
|
|
3503
3538
|
var _a2;
|
|
3504
|
-
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 :
|
|
3505
|
-
return s2.includes("BulletPoint") || t2.multilineSteps.push(
|
|
3539
|
+
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : Pn.filter((t3) => !e2.only.includes(t3));
|
|
3540
|
+
return s2.includes("BulletPoint") || t2.multilineSteps.push(Nn, Rn), s2.includes("Mention") || t2.singlelineSteps.push(In), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Sn), s2.includes("Codespan") || t2.multilineSteps.push(qe(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3.replace(/<!!mention:.*?\|([^>]*)>/gim, "@$1").replace(/<!!customemoji:(.*?)>/gim, "$1") }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(xn), s2.includes("Actions") || (t2.singlelineSteps.push(En), t2.singlelineSteps.push(Mn)), s2.includes("Wikitext") || t2.singlelineSteps.push(He), s2.includes("Autolink") || t2.singlelineSteps.push(_n, Dn), t2;
|
|
3506
3541
|
}
|
|
3507
|
-
const
|
|
3542
|
+
const $n = (function(e2) {
|
|
3508
3543
|
const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
|
|
3509
3544
|
return (e3) => Array.from(e3.match(t2) || []);
|
|
3510
3545
|
})("\n");
|
|
3511
|
-
function
|
|
3546
|
+
function Un(e2, t2 = { except: [] }) {
|
|
3512
3547
|
let s2 = (function(e3, t3) {
|
|
3513
3548
|
let s3 = [e3];
|
|
3514
|
-
return s3 =
|
|
3515
|
-
})(e2,
|
|
3516
|
-
return s2 =
|
|
3549
|
+
return s3 = qn(s3, t3.multilineSteps), s3 = qn(s3, [$n]), s3 = qn(s3, t3.singlelineSteps), s3 = Bn(s3), s3;
|
|
3550
|
+
})(e2, jn(t2));
|
|
3551
|
+
return s2 = Ln(s2, false), s2;
|
|
3517
3552
|
}
|
|
3518
|
-
function
|
|
3519
|
-
return
|
|
3553
|
+
function Wn(e2) {
|
|
3554
|
+
return Un(e2, { except: ["FormattedLink", "Actions"] });
|
|
3520
3555
|
}
|
|
3521
|
-
function
|
|
3522
|
-
return t2.reduce((e3, t3) =>
|
|
3556
|
+
function qn(e2, t2) {
|
|
3557
|
+
return t2.reduce((e3, t3) => We(e3, t3), e2);
|
|
3523
3558
|
}
|
|
3524
|
-
function
|
|
3559
|
+
function Bn(e2) {
|
|
3525
3560
|
const t2 = [];
|
|
3526
3561
|
let s2 = -1;
|
|
3527
|
-
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:
|
|
3562
|
+
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: Bn(n2.children) }) : n2;
|
|
3528
3563
|
return t2;
|
|
3529
3564
|
}
|
|
3530
|
-
function
|
|
3565
|
+
function Ln(e2, t2) {
|
|
3531
3566
|
const s2 = [];
|
|
3532
3567
|
let n2 = [];
|
|
3533
3568
|
for (let a2 = 0; a2 < e2.length; a2++) {
|
|
@@ -3535,13 +3570,13 @@ function qn(e2, t2) {
|
|
|
3535
3570
|
if ("string" == typeof r2) n2.push(r2);
|
|
3536
3571
|
else if ("children" in r2) {
|
|
3537
3572
|
n2.length > 0 && (s2.push(n2.join("")), n2 = []);
|
|
3538
|
-
const e3 =
|
|
3573
|
+
const e3 = Ln(r2.children, t2 || "link" === r2.type || "actionbutton" === r2.type || "actionlink" === r2.type);
|
|
3539
3574
|
s2.push(__spreadProps(__spreadValues({}, r2), { children: e3 }));
|
|
3540
3575
|
} else "autolink" === r2.type && t2 ? n2.push(r2.text) : (n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2.push(r2));
|
|
3541
3576
|
}
|
|
3542
3577
|
return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
|
|
3543
3578
|
}
|
|
3544
|
-
class
|
|
3579
|
+
class Gn {
|
|
3545
3580
|
constructor(e2, t2, s2, n2) {
|
|
3546
3581
|
this.emoji = e2, this.messageId = t2, this.conversationId = s2, this._realtimeClient = n2;
|
|
3547
3582
|
}
|
|
@@ -3564,7 +3599,7 @@ class Bn {
|
|
|
3564
3599
|
});
|
|
3565
3600
|
}
|
|
3566
3601
|
}
|
|
3567
|
-
class
|
|
3602
|
+
class Fn {
|
|
3568
3603
|
constructor(e2, t2, s2) {
|
|
3569
3604
|
this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
3570
3605
|
}
|
|
@@ -3585,12 +3620,12 @@ class Ln {
|
|
|
3585
3620
|
if (!e2.ok && "server" === e2.where && 404 === e2.value.status) return null;
|
|
3586
3621
|
if (!e2.ok && "server" === e2.where && 403 === e2.value.status && "NOT_A_PARTICIPANT" === e2.value.errorCode) return null;
|
|
3587
3622
|
const t2 = d("Get message " + this.id, e2), s2 = yield this._realtimeClient.hydrateMessageData(t2, this.brandedConversationId);
|
|
3588
|
-
return
|
|
3623
|
+
return ta("Get message " + this.id, s2);
|
|
3589
3624
|
});
|
|
3590
3625
|
}
|
|
3591
3626
|
edit(e2) {
|
|
3592
3627
|
return __async(this, null, function* () {
|
|
3593
|
-
const t2 = { content:
|
|
3628
|
+
const t2 = { content: Hn(e2), custom: "string" == typeof e2 ? void 0 : e2.custom }, s2 = yield this._realtimeClient.call({ method: "PATCH", path: ["conversations", this.brandedConversationId, "messages", this.brandedId], data: t2 });
|
|
3594
3629
|
d(`Edit message ${this.id} in conversation ${this.conversationId}`, s2);
|
|
3595
3630
|
});
|
|
3596
3631
|
}
|
|
@@ -3601,16 +3636,16 @@ class Ln {
|
|
|
3601
3636
|
});
|
|
3602
3637
|
}
|
|
3603
3638
|
}
|
|
3604
|
-
function
|
|
3639
|
+
function Hn(e2) {
|
|
3605
3640
|
if ("string" == typeof e2) {
|
|
3606
|
-
return [{ type: "text", children:
|
|
3641
|
+
return [{ type: "text", children: Un(e2) }];
|
|
3607
3642
|
}
|
|
3608
3643
|
if ("text" in e2 && e2.text) {
|
|
3609
|
-
return [{ type: "text", children:
|
|
3644
|
+
return [{ type: "text", children: Un(e2.text) }];
|
|
3610
3645
|
}
|
|
3611
3646
|
if ("content" in e2 && e2.content) return e2.content;
|
|
3612
3647
|
}
|
|
3613
|
-
class
|
|
3648
|
+
class Jn {
|
|
3614
3649
|
constructor(e2, t2) {
|
|
3615
3650
|
this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
|
|
3616
3651
|
}
|
|
@@ -3685,7 +3720,7 @@ class Fn {
|
|
|
3685
3720
|
}
|
|
3686
3721
|
send(e2) {
|
|
3687
3722
|
return __async(this, null, function* () {
|
|
3688
|
-
const t2 = { content:
|
|
3723
|
+
const t2 = { content: zn(e2), referencedMessageId: Yn(e2), custom: "string" == typeof e2 ? void 0 : e2.custom, idempotencyKey: Ue((/* @__PURE__ */ new Date()).getTime()) }, s2 = yield this._realtimeClient.call({ method: "POST", path: ["conversations", this.brandedId, "messages"], data: t2 }), n2 = d("Send message to conversation " + this.id, s2);
|
|
3689
3724
|
return this._realtimeClient.refs.message(this.brandedId, n2.id);
|
|
3690
3725
|
});
|
|
3691
3726
|
}
|
|
@@ -3708,28 +3743,28 @@ class Fn {
|
|
|
3708
3743
|
});
|
|
3709
3744
|
}
|
|
3710
3745
|
}
|
|
3711
|
-
function
|
|
3746
|
+
function zn(e2) {
|
|
3712
3747
|
if ("string" == typeof e2) {
|
|
3713
|
-
return [{ type: "text", children:
|
|
3748
|
+
return [{ type: "text", children: Wn(e2) }];
|
|
3714
3749
|
}
|
|
3715
3750
|
if ("text" in e2) {
|
|
3716
|
-
return [{ type: "text", children:
|
|
3751
|
+
return [{ type: "text", children: Wn(e2.text) }];
|
|
3717
3752
|
}
|
|
3718
3753
|
return e2.content;
|
|
3719
3754
|
}
|
|
3720
|
-
function
|
|
3755
|
+
function Yn(e2) {
|
|
3721
3756
|
if ("string" == typeof e2) return;
|
|
3722
3757
|
const t2 = e2.referencedMessage;
|
|
3723
3758
|
return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
|
|
3724
3759
|
}
|
|
3725
|
-
const
|
|
3760
|
+
const Qn = "undefined" != typeof WeakRef ? WeakRef : class {
|
|
3726
3761
|
constructor(e2) {
|
|
3727
3762
|
this.value = e2;
|
|
3728
3763
|
}
|
|
3729
3764
|
deref() {
|
|
3730
3765
|
return this.value;
|
|
3731
3766
|
}
|
|
3732
|
-
},
|
|
3767
|
+
}, Vn = globalThis.FinalizationRegistry, Kn = void 0 !== Vn ? Vn : class {
|
|
3733
3768
|
constructor(e2) {
|
|
3734
3769
|
}
|
|
3735
3770
|
register(e2, t2, s2) {
|
|
@@ -3737,9 +3772,9 @@ const zn = "undefined" != typeof WeakRef ? WeakRef : class {
|
|
|
3737
3772
|
unregister(e2) {
|
|
3738
3773
|
}
|
|
3739
3774
|
};
|
|
3740
|
-
class
|
|
3775
|
+
class Zn {
|
|
3741
3776
|
constructor(e2) {
|
|
3742
|
-
this.client = e2, this.users = /* @__PURE__ */ new Map(), this.conversations = /* @__PURE__ */ new Map(), this.participants = /* @__PURE__ */ new Map(), this.messages = /* @__PURE__ */ new Map(), this.reactions = /* @__PURE__ */ new Map(), this.registry = new
|
|
3777
|
+
this.client = e2, this.users = /* @__PURE__ */ new Map(), this.conversations = /* @__PURE__ */ new Map(), this.participants = /* @__PURE__ */ new Map(), this.messages = /* @__PURE__ */ new Map(), this.reactions = /* @__PURE__ */ new Map(), this.registry = new Kn(({ map: e3, key: t2 }) => {
|
|
3743
3778
|
e3.delete(t2);
|
|
3744
3779
|
});
|
|
3745
3780
|
}
|
|
@@ -3747,41 +3782,41 @@ class Vn {
|
|
|
3747
3782
|
var _a2;
|
|
3748
3783
|
const t2 = (_a2 = this.users.get(e2)) == null ? void 0 : _a2.deref();
|
|
3749
3784
|
if (t2) return t2;
|
|
3750
|
-
const s2 =
|
|
3751
|
-
return this.users.set(e2, new
|
|
3785
|
+
const s2 = x(new je(e2, this.client));
|
|
3786
|
+
return this.users.set(e2, new Qn(s2)), this.registry.register(s2, { map: this.users, key: e2 }), s2;
|
|
3752
3787
|
}
|
|
3753
3788
|
conversation(e2) {
|
|
3754
3789
|
var _a2;
|
|
3755
3790
|
const t2 = (_a2 = this.conversations.get(e2)) == null ? void 0 : _a2.deref();
|
|
3756
3791
|
if (t2) return t2;
|
|
3757
|
-
const s2 =
|
|
3758
|
-
return this.conversations.set(e2, new
|
|
3792
|
+
const s2 = x(new Jn(e2, this.client));
|
|
3793
|
+
return this.conversations.set(e2, new Qn(s2)), this.registry.register(s2, { map: this.conversations, key: e2 }), s2;
|
|
3759
3794
|
}
|
|
3760
3795
|
participant(e2, t2) {
|
|
3761
3796
|
var _a2;
|
|
3762
3797
|
const s2 = `[${e2}][${t2}]`, n2 = (_a2 = this.participants.get(s2)) == null ? void 0 : _a2.deref();
|
|
3763
3798
|
if (n2) return n2;
|
|
3764
|
-
const a2 =
|
|
3765
|
-
return this.participants.set(s2, new
|
|
3799
|
+
const a2 = x(new $e(t2, e2, this.client));
|
|
3800
|
+
return this.participants.set(s2, new Qn(a2)), this.registry.register(a2, { map: this.participants, key: s2 }), a2;
|
|
3766
3801
|
}
|
|
3767
3802
|
message(e2, t2) {
|
|
3768
3803
|
var _a2;
|
|
3769
3804
|
const s2 = `[${e2}][${t2}]`, n2 = (_a2 = this.messages.get(s2)) == null ? void 0 : _a2.deref();
|
|
3770
3805
|
if (n2) return n2;
|
|
3771
|
-
const a2 =
|
|
3772
|
-
return this.messages.set(s2, new
|
|
3806
|
+
const a2 = x(new Fn(t2, e2, this.client));
|
|
3807
|
+
return this.messages.set(s2, new Qn(a2)), this.registry.register(a2, { map: this.messages, key: s2 }), a2;
|
|
3773
3808
|
}
|
|
3774
3809
|
reaction(e2, t2, s2) {
|
|
3775
3810
|
var _a2;
|
|
3776
3811
|
const n2 = `[${e2}][${t2}][${s2}]`, a2 = (_a2 = this.reactions.get(n2)) == null ? void 0 : _a2.deref();
|
|
3777
3812
|
if (a2) return a2;
|
|
3778
|
-
const r2 =
|
|
3779
|
-
return this.reactions.set(n2, new
|
|
3813
|
+
const r2 = x(new Gn(s2, t2, e2, this.client));
|
|
3814
|
+
return this.reactions.set(n2, new Qn(r2)), this.registry.register(r2, { map: this.reactions, key: n2 }), r2;
|
|
3780
3815
|
}
|
|
3781
3816
|
}
|
|
3782
|
-
class
|
|
3817
|
+
class Xn {
|
|
3783
3818
|
constructor(e2, t2, s2) {
|
|
3784
|
-
this.userId = t2, this.refs = new
|
|
3819
|
+
this.userId = t2, this.refs = new Zn(this), this.alive = true, this.connection = new Oe(e2, s2, this), s2.onTokenRefreshFailed(() => {
|
|
3785
3820
|
this.destroy();
|
|
3786
3821
|
});
|
|
3787
3822
|
}
|
|
@@ -3815,7 +3850,7 @@ class Kn {
|
|
|
3815
3850
|
const r2 = yield n2;
|
|
3816
3851
|
if (!r2.ok) return r2;
|
|
3817
3852
|
const i2 = (function(e3, t3, s3) {
|
|
3818
|
-
return
|
|
3853
|
+
return x({ id: e3.id, type: e3.type, sender: t3, referencedMessage: s3, custom: x(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: he(e3.reactions), plaintext: ie(e3.content, {}) });
|
|
3819
3854
|
})(e2, a2.value, r2.value);
|
|
3820
3855
|
return o(i2);
|
|
3821
3856
|
});
|
|
@@ -3824,8 +3859,8 @@ class Kn {
|
|
|
3824
3859
|
return __async(this, null, function* () {
|
|
3825
3860
|
const s2 = this.listMessages(e2.id, { limit: 1 }, t2), n2 = yield this.call({ method: "GET", path: ["me", "conversations", e2.id], data: {}, headers: t2 });
|
|
3826
3861
|
if (!n2.ok && "server" === n2.where && 404 === n2.value.status) return o(null);
|
|
3827
|
-
const a2 = d("Get conversation " + e2.id, n2), r2 =
|
|
3828
|
-
return
|
|
3862
|
+
const a2 = d("Get conversation " + e2.id, n2), r2 = ta("Get last message in conversation " + e2.id, yield s2), i2 = (function(e3, t3) {
|
|
3863
|
+
return x({ id: e3.id, subject: e3.subject, photoUrl: e3.photoUrl, welcomeMessages: x(e3.welcomeMessages), custom: x(e3.custom), createdAt: e3.createdAt, joinedAt: e3.joinedAt, lastMessageAt: e3.lastMessageAt, unreadMessageCount: e3.unreadMessageCount, isUnread: e3.isUnread, access: e3.access, notify: e3.notify, lastMessage: t3, readUntil: e3.readUntil, everyoneReadUntil: e3.everyoneReadUntil });
|
|
3829
3864
|
})(a2, 0 === r2.length ? null : r2[0]);
|
|
3830
3865
|
return o(i2);
|
|
3831
3866
|
});
|
|
@@ -3833,7 +3868,7 @@ class Kn {
|
|
|
3833
3868
|
listMessages(e2, t2, s2) {
|
|
3834
3869
|
return __async(this, null, function* () {
|
|
3835
3870
|
const n2 = yield this.call({ method: "GET", path: ["me", "conversations", e2, "messages"], data: t2, headers: s2 });
|
|
3836
|
-
if (!n2.ok) return
|
|
3871
|
+
if (!n2.ok) return ea(n2, "Listing messages in " + e2);
|
|
3837
3872
|
const a2 = n2.value.data.data, r2 = yield Promise.all(a2.map((t3) => this.hydrateMessageData(t3, e2))), i2 = r2.find((e3) => !e3.ok);
|
|
3838
3873
|
if (void 0 !== i2 && !i2.ok) return i2;
|
|
3839
3874
|
return o(r2.map(({ value: e3 }) => e3));
|
|
@@ -3844,11 +3879,11 @@ class Kn {
|
|
|
3844
3879
|
const s2 = yield this.call({ method: "GET", path: ["me", "conversations", e2, "messages", t2], data: {} });
|
|
3845
3880
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return o(null);
|
|
3846
3881
|
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return o(null);
|
|
3847
|
-
if (!s2.ok) return
|
|
3882
|
+
if (!s2.ok) return ea(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
|
|
3848
3883
|
const n2 = s2.value.data, a2 = yield this.getUser(n2.senderId);
|
|
3849
3884
|
if (!a2.ok) return a2;
|
|
3850
3885
|
const r2 = (function(e3, t3) {
|
|
3851
|
-
return
|
|
3886
|
+
return x({ id: e3.id, type: e3.type, sender: t3, referencedMessageId: e3.referencedMessageId, custom: x(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: he(e3.reactions), plaintext: ie(e3.content, {}) });
|
|
3852
3887
|
})(n2, a2.value);
|
|
3853
3888
|
return o(r2);
|
|
3854
3889
|
});
|
|
@@ -3857,20 +3892,20 @@ class Kn {
|
|
|
3857
3892
|
return __async(this, null, function* () {
|
|
3858
3893
|
const t2 = yield this.call({ method: "GET", path: ["users", e2], data: { includePrivateFields: false } });
|
|
3859
3894
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return o(null);
|
|
3860
|
-
if (!t2.ok) return
|
|
3895
|
+
if (!t2.ok) return ea(t2, "Get user " + e2);
|
|
3861
3896
|
return o(ce(t2.value.data));
|
|
3862
3897
|
});
|
|
3863
3898
|
}
|
|
3864
3899
|
}
|
|
3865
|
-
function
|
|
3900
|
+
function ea(e2, t2) {
|
|
3866
3901
|
return "server" === e2.where ? l(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
|
|
3867
3902
|
}
|
|
3868
|
-
function
|
|
3903
|
+
function ta(e2, t2) {
|
|
3869
3904
|
var _a2;
|
|
3870
3905
|
if (t2.ok) return t2.value;
|
|
3871
3906
|
throw "SESSION_DESTROYED" === t2.value ? new Error(`${e2} failed because the session was destroyed`) : new Error(p((_a2 = t2.value.operation) != null ? _a2 : e2, t2.value));
|
|
3872
3907
|
}
|
|
3873
|
-
class
|
|
3908
|
+
class sa {
|
|
3874
3909
|
constructor(e2, t2, s2) {
|
|
3875
3910
|
this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
|
|
3876
3911
|
}
|
|
@@ -3883,7 +3918,7 @@ class ea {
|
|
|
3883
3918
|
}
|
|
3884
3919
|
static fromHost(e2) {
|
|
3885
3920
|
var _a2;
|
|
3886
|
-
const t2 = new
|
|
3921
|
+
const t2 = new sa("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
|
|
3887
3922
|
if (!e2) return t2;
|
|
3888
3923
|
if ("@currentHost" === e2) {
|
|
3889
3924
|
if ("undefined" == typeof location) throw new Error("You can only use @currentHost in a browser.");
|
|
@@ -3893,17 +3928,17 @@ class ea {
|
|
|
3893
3928
|
const s2 = e2.match(/^(?:\w+-)?([^.]+)\.talkjs\.com$/);
|
|
3894
3929
|
if (s2) {
|
|
3895
3930
|
const e3 = s2[1];
|
|
3896
|
-
return ["app", "cdn", "api", "realtime"].includes(e3) ? t2 : new
|
|
3931
|
+
return ["app", "cdn", "api", "realtime"].includes(e3) ? t2 : new sa(`wss://realtime-${e3}.talkjs.com/v1`, `https://app-${e3}.talkjs.com/api/v0`, `https://api-${e3}.talkjs.com/v1`);
|
|
3897
3932
|
}
|
|
3898
3933
|
return t2;
|
|
3899
3934
|
}
|
|
3900
|
-
return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new
|
|
3935
|
+
return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new sa(`ws://${e2}/public_api/v1`, `http://${e2}/api/v0`, `http://${e2}/public_api/v1`) : new sa(`wss://${e2}/public_api/v1`, `https://${e2}/api/v0`, `https://${e2}/public_api/v1`);
|
|
3901
3936
|
}
|
|
3902
3937
|
}
|
|
3903
|
-
function
|
|
3938
|
+
function na({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2, errorTracker: c2, abortSignal: l2 }) {
|
|
3904
3939
|
var _a2;
|
|
3905
3940
|
(!r2 || r2 <= 0) && (r2 = 1);
|
|
3906
|
-
const h2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2026-01-
|
|
3941
|
+
const h2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2026-01-30T10:38:13.969Z" };
|
|
3907
3942
|
s2 instanceof FormData || (h2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
3908
3943
|
return a(r2, () => __async(null, null, function* () {
|
|
3909
3944
|
if (o2) {
|
|
@@ -3927,12 +3962,12 @@ function ta({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
|
|
|
3927
3962
|
throw s3;
|
|
3928
3963
|
});
|
|
3929
3964
|
}
|
|
3930
|
-
class
|
|
3965
|
+
class aa {
|
|
3931
3966
|
constructor(e2) {
|
|
3932
3967
|
__privateAdd(this, _e2);
|
|
3933
3968
|
__privateAdd(this, _t2);
|
|
3934
3969
|
var _a2, _b2, _c, _d;
|
|
3935
|
-
this._timeCreated = Date.now(), __privateSet(this, _e2, (_b2 = (_a2 = globalThis.document) == null ? void 0 : _a2.referrer) != null ? _b2 : ""), __privateSet(this, _t2, ((_d = (_c = globalThis.location) == null ? void 0 : _c.href) != null ? _d : globalThis.HermesInternal) ? "React Native Hermes" : ""), this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2026-01-
|
|
3970
|
+
this._timeCreated = Date.now(), __privateSet(this, _e2, (_b2 = (_a2 = globalThis.document) == null ? void 0 : _a2.referrer) != null ? _b2 : ""), __privateSet(this, _t2, ((_d = (_c = globalThis.location) == null ? void 0 : _c.href) != null ? _d : globalThis.HermesInternal) ? "React Native Hermes" : ""), this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2026-01-30T10:38:13.969Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: __privateGet(this, _t2), referrer: __privateGet(this, _e2), userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: __privateGet(this, _t2), stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2026-01-30T10:38:13.969Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
3936
3971
|
}
|
|
3937
3972
|
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
3938
3973
|
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
@@ -3942,7 +3977,7 @@ class sa {
|
|
|
3942
3977
|
try {
|
|
3943
3978
|
0;
|
|
3944
3979
|
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
3945
|
-
yield
|
|
3980
|
+
yield na({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
3946
3981
|
} catch (e3) {
|
|
3947
3982
|
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
3948
3983
|
}
|
|
@@ -3951,9 +3986,9 @@ class sa {
|
|
|
3951
3986
|
}
|
|
3952
3987
|
_e2 = new WeakMap();
|
|
3953
3988
|
_t2 = new WeakMap();
|
|
3954
|
-
const
|
|
3989
|
+
const ra = { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
3955
3990
|
} };
|
|
3956
|
-
class
|
|
3991
|
+
class ia {
|
|
3957
3992
|
constructor(e2, t2 = {}) {
|
|
3958
3993
|
this._onSubscription = t2, this._handlers = {};
|
|
3959
3994
|
for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
|
|
@@ -3998,7 +4033,7 @@ class aa {
|
|
|
3998
4033
|
return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
|
|
3999
4034
|
}
|
|
4000
4035
|
}
|
|
4001
|
-
class
|
|
4036
|
+
class oa {
|
|
4002
4037
|
constructor(e2) {
|
|
4003
4038
|
this.handlers = e2, this.tokenResult = null, this.pendingToken = null;
|
|
4004
4039
|
}
|
|
@@ -4020,9 +4055,9 @@ class ra {
|
|
|
4020
4055
|
this.tokenResult = null, this.refreshToken();
|
|
4021
4056
|
}
|
|
4022
4057
|
}
|
|
4023
|
-
class
|
|
4058
|
+
class ca {
|
|
4024
4059
|
constructor(e2, t2, s2, n2) {
|
|
4025
|
-
this.apiUrls = e2, this.appId = t2, this.userId = s2, this.signature = n2, this.inner = new
|
|
4060
|
+
this.apiUrls = e2, this.appId = t2, this.userId = s2, this.signature = n2, this.inner = new oa({ onChange: (e3) => {
|
|
4026
4061
|
e3.ok ? this.eventEmitter.emit("tokenChanged", e3.value) : this.emitTokenRefreshFailed(e3.value);
|
|
4027
4062
|
}, onNeedToken: () => __async(this, null, function* () {
|
|
4028
4063
|
if (this._usingBokens && !this.signature && !this._calledBokens && (yield new Promise((e3) => setTimeout(e3, 1))), this._usingBokens) yield this.sendBokenRequest().then((e3) => this.inner.setTokenResult(o(e3))).catch((e3) => this.inner.setTokenResult(l(e3)));
|
|
@@ -4031,12 +4066,12 @@ class ia {
|
|
|
4031
4066
|
const e3 = c("Cannot refresh token, no `onNeedToken` provided.");
|
|
4032
4067
|
this.inner.setTokenResult(e3);
|
|
4033
4068
|
}
|
|
4034
|
-
}) }), this._usingBokens = true, this._calledBokens = false, this.onNeedToken = void 0, this.eventEmitter = new
|
|
4069
|
+
}) }), this._usingBokens = true, this._calledBokens = false, this.onNeedToken = void 0, this.eventEmitter = new ia({ tokenChanged(e3) {
|
|
4035
4070
|
}, tokenRefreshFailed(e3) {
|
|
4036
4071
|
}, tokenAccepted(e3) {
|
|
4037
4072
|
} }), this.sessionExpiryWarningTimeoutId = void 0;
|
|
4038
4073
|
const a2 = "undefined" != typeof window && e2.restApiHttpUrl.includes("api.talkjs.com");
|
|
4039
|
-
this.errorTracker = a2 ? new
|
|
4074
|
+
this.errorTracker = a2 ? new aa("970cd0be0fb74630b75c8451051299dc") : ra;
|
|
4040
4075
|
}
|
|
4041
4076
|
get usingBokens() {
|
|
4042
4077
|
return this._usingBokens;
|
|
@@ -4111,7 +4146,7 @@ class ia {
|
|
|
4111
4146
|
const e3 = (function(e4) {
|
|
4112
4147
|
const t3 = e4.split(".");
|
|
4113
4148
|
if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
|
|
4114
|
-
return { header:
|
|
4149
|
+
return { header: la(t3[0]), payload: la(t3[1]) };
|
|
4115
4150
|
})(s2);
|
|
4116
4151
|
n2 = e3.header, a2 = e3.payload;
|
|
4117
4152
|
} catch (e3) {
|
|
@@ -4155,7 +4190,7 @@ class ia {
|
|
|
4155
4190
|
return __async(this, null, function* () {
|
|
4156
4191
|
this._calledBokens = true;
|
|
4157
4192
|
let e2 = 0;
|
|
4158
|
-
const t2 = this.apiUrls.getBokensUrl(this.appId, this.userId, this.signature), s2 = yield
|
|
4193
|
+
const t2 = this.apiUrls.getBokensUrl(this.appId, this.userId, this.signature), s2 = yield na({ method: "GET", url: t2, attempts: 1e4, shouldRetry: (t3) => {
|
|
4159
4194
|
if (t3 instanceof Error) return true;
|
|
4160
4195
|
if (401 === t3.status) throw "Check that you provided a valid signature.";
|
|
4161
4196
|
if (404 === t3.status) throw "Check that you specified the correct App ID.";
|
|
@@ -4168,7 +4203,7 @@ class ia {
|
|
|
4168
4203
|
});
|
|
4169
4204
|
}
|
|
4170
4205
|
}
|
|
4171
|
-
function
|
|
4206
|
+
function la(e2) {
|
|
4172
4207
|
try {
|
|
4173
4208
|
const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
4174
4209
|
return JSON.parse(s2);
|
|
@@ -4176,14 +4211,14 @@ function oa(e2) {
|
|
|
4176
4211
|
throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
|
|
4177
4212
|
}
|
|
4178
4213
|
}
|
|
4179
|
-
const
|
|
4214
|
+
const ha = new class {
|
|
4180
4215
|
constructor() {
|
|
4181
4216
|
this.registry = {};
|
|
4182
4217
|
}
|
|
4183
4218
|
getOrCreate(e2) {
|
|
4184
4219
|
const t2 = this.key(e2), s2 = this.registry[t2];
|
|
4185
4220
|
if (s2) return s2;
|
|
4186
|
-
const n2 = new
|
|
4221
|
+
const n2 = new da(e2);
|
|
4187
4222
|
return this.registry[t2] = n2, n2;
|
|
4188
4223
|
}
|
|
4189
4224
|
deregister(e2, t2) {
|
|
@@ -4194,11 +4229,11 @@ const ca = new class {
|
|
|
4194
4229
|
return `${e2}:${t2}`;
|
|
4195
4230
|
}
|
|
4196
4231
|
}();
|
|
4197
|
-
function
|
|
4232
|
+
function ua(e2) {
|
|
4198
4233
|
if (!e2) throw new Error("[TalkJS] Must provide an options object to `getTalkSession`");
|
|
4199
|
-
return e2.forceCreateNew ? new
|
|
4234
|
+
return e2.forceCreateNew ? new da(e2) : ha.getOrCreate(e2);
|
|
4200
4235
|
}
|
|
4201
|
-
class
|
|
4236
|
+
class da {
|
|
4202
4237
|
constructor(e2) {
|
|
4203
4238
|
this._onNeedToken = void 0, (function(e3) {
|
|
4204
4239
|
function t3(e4, t4) {
|
|
@@ -4208,7 +4243,7 @@ class ha {
|
|
|
4208
4243
|
void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of the `getTalkSession` options must be a function.");
|
|
4209
4244
|
})(e2);
|
|
4210
4245
|
const { appId: t2, userId: s2, token: n2, tokenFetcher: a2, signature: i2 } = e2;
|
|
4211
|
-
this._appId = t2, this._apiUrls = e2.apiUrls ? new
|
|
4246
|
+
this._appId = t2, this._apiUrls = e2.apiUrls ? new sa(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : sa.fromHost(e2.host), this._authProvider = new ca(this._apiUrls, t2, s2, i2), n2 && this._authProvider.setToken(n2), a2 && this._authProvider.setOnNeedToken(() => __async(this, null, function* () {
|
|
4212
4247
|
try {
|
|
4213
4248
|
const e3 = yield a2();
|
|
4214
4249
|
this._authProvider.setToken(e3);
|
|
@@ -4217,11 +4252,11 @@ class ha {
|
|
|
4217
4252
|
}
|
|
4218
4253
|
}));
|
|
4219
4254
|
const o2 = Math.random().toString().split(".")[1];
|
|
4220
|
-
this._realtimeClient = new
|
|
4255
|
+
this._realtimeClient = new Xn(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.7.0", o2, e2.clientBuild), s2, this._authProvider), this.currentUser = this.user(s2), this._terminationReason = r(), this._terminationReason.promise.then((e3) => {
|
|
4221
4256
|
console.error(`[TalkJS] ${e3}`);
|
|
4222
4257
|
}), (function(e3, t3) {
|
|
4223
4258
|
return __async(this, null, function* () {
|
|
4224
|
-
return
|
|
4259
|
+
return na({ method: "GET", url: `${t3}/${e3}` }).then((e4) => __async(null, null, function* () {
|
|
4225
4260
|
return 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);
|
|
4226
4261
|
})).catch((e4) => {
|
|
4227
4262
|
if ("string" != typeof e4 && "status" in e4) {
|
|
@@ -4273,14 +4308,14 @@ class ha {
|
|
|
4273
4308
|
}
|
|
4274
4309
|
searchMessages(e2) {
|
|
4275
4310
|
let t2;
|
|
4276
|
-
return { setQuery: (s2) => t2 && t2.searchString === s2 ? t2.currentState : (t2 && t2.cancel(), s2 && "" !== s2 ? (t2 = new
|
|
4311
|
+
return { setQuery: (s2) => t2 && t2.searchString === s2 ? t2.currentState : (t2 && t2.cancel(), s2 && "" !== s2 ? (t2 = new ma(e2, s2, `${this._apiUrls.restApiHttpUrl}/${this._appId}/me/messages/search`, (e3) => __async(this, null, function* () {
|
|
4277
4312
|
const [t3, s3] = yield Promise.all([this.conversation(e3.conversationId).get(), this._realtimeClient.hydrateMessageData(e3, e3.conversationId)]);
|
|
4278
4313
|
return null === t3 ? c("Message belongs to nonexistent conversation") : s3.ok ? o({ conversation: t3, message: s3.value }) : s3;
|
|
4279
4314
|
}), this._authProvider), t2.loadMore(3)) : (t2 = void 0, e2 == null ? void 0 : e2([], "loadedAll"), Promise.resolve({ results: [], loadedAll: true }))), loadMore: (e3) => t2 ? t2.loadMore(e3 != null ? e3 : 10) : Promise.resolve({ results: [], loadedAll: true }) };
|
|
4280
4315
|
}
|
|
4281
4316
|
searchConversations(e2) {
|
|
4282
4317
|
let t2;
|
|
4283
|
-
return { setQuery: (s2) => t2 && t2.searchString === s2 ? t2.currentState : (t2 && t2.cancel(), s2 && "" !== s2 ? (t2 = new
|
|
4318
|
+
return { setQuery: (s2) => t2 && t2.searchString === s2 ? t2.currentState : (t2 && t2.cancel(), s2 && "" !== s2 ? (t2 = new ma(e2, s2, `${this._apiUrls.restApiHttpUrl}/${this._appId}/me/conversations/search`, (e3) => __async(this, null, function* () {
|
|
4284
4319
|
const t3 = yield this._realtimeClient.hydrateConvData(e3);
|
|
4285
4320
|
if (!t3.ok) return t3;
|
|
4286
4321
|
const s3 = t3.value;
|
|
@@ -4288,31 +4323,32 @@ class ha {
|
|
|
4288
4323
|
}), this._authProvider), t2.loadMore(3)) : (t2 = void 0, e2 == null ? void 0 : e2([], "loadedAll"), Promise.resolve({ results: [], loadedAll: true }))), loadMore: (e3) => t2 ? t2.loadMore(e3 != null ? e3 : 10) : Promise.resolve({ results: [], loadedAll: true }) };
|
|
4289
4324
|
}
|
|
4290
4325
|
terminate(e2) {
|
|
4291
|
-
|
|
4326
|
+
ha.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
|
|
4292
4327
|
}
|
|
4293
4328
|
_isConnected() {
|
|
4294
4329
|
return this._realtimeClient.isConnected();
|
|
4295
4330
|
}
|
|
4296
4331
|
uploadFile(e2, t2) {
|
|
4297
|
-
return
|
|
4332
|
+
return pa(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, this._realtimeClient, e2, t2);
|
|
4298
4333
|
}
|
|
4299
4334
|
uploadImage(e2, t2) {
|
|
4300
|
-
return
|
|
4335
|
+
return pa(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, this._realtimeClient, e2, __spreadValues({ subtype: "image" }, t2));
|
|
4301
4336
|
}
|
|
4302
4337
|
uploadVideo(e2, t2) {
|
|
4303
|
-
return
|
|
4338
|
+
return pa(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, this._realtimeClient, e2, __spreadValues({ subtype: "video" }, t2));
|
|
4304
4339
|
}
|
|
4305
4340
|
uploadAudio(e2, t2) {
|
|
4306
|
-
return
|
|
4341
|
+
return pa(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, this._realtimeClient, e2, __spreadValues({ subtype: "audio" }, t2));
|
|
4307
4342
|
}
|
|
4308
4343
|
uploadVoice(e2, t2) {
|
|
4309
|
-
return
|
|
4344
|
+
return pa(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, this._realtimeClient, e2, __spreadValues({ subtype: "voice" }, t2));
|
|
4310
4345
|
}
|
|
4311
4346
|
}
|
|
4312
|
-
function
|
|
4313
|
-
return __async(this, arguments, function* (e2, t2, s2, { subtype:
|
|
4314
|
-
|
|
4315
|
-
|
|
4347
|
+
function pa(_0, _1, _2, _3, _4) {
|
|
4348
|
+
return __async(this, arguments, function* (e2, t2, s2, n2, { subtype: a2, filename: r2, width: i2, height: o2, duration: c2 }) {
|
|
4349
|
+
d("Upload file", yield s2.call({ method: "POST", path: ["files", "validate"], data: { filename: r2, filesize: n2.size } }));
|
|
4350
|
+
const l2 = new FormData();
|
|
4351
|
+
return l2.set("file", n2, r2), void 0 !== a2 && l2.set("subtype", a2), void 0 !== i2 && l2.set("width", i2.toString()), void 0 !== o2 && l2.set("height", o2.toString()), void 0 !== c2 && l2.set("duration", c2.toString()), na({ method: "POST", url: e2, data: l2, authProvider: t2, errorTracker: t2.errorTracker }).then((e3) => e3.json()).then((e3) => e3.fileToken).catch((e3) => __async(null, null, function* () {
|
|
4316
4352
|
if (e3 instanceof Response) {
|
|
4317
4353
|
const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
|
|
4318
4354
|
throw new Error(s3);
|
|
@@ -4321,7 +4357,7 @@ function ua(_0, _1, _2, _3) {
|
|
|
4321
4357
|
}));
|
|
4322
4358
|
});
|
|
4323
4359
|
}
|
|
4324
|
-
class
|
|
4360
|
+
class ma {
|
|
4325
4361
|
constructor(e2, t2, s2, n2, a2) {
|
|
4326
4362
|
this.onResults = e2, this.searchString = t2, this.baseUrl = s2, this.hydrateData = n2, this.authProvider = a2, this.error = void 0, this.lastCompletedQueryState = { results: [], loadedAll: false }, this.currentCursor = void 0, this.cancelQuery = () => {
|
|
4327
4363
|
}, e2 == null ? void 0 : e2([], "searching");
|
|
@@ -4351,14 +4387,14 @@ class da {
|
|
|
4351
4387
|
const s2 = this.buildUrl(e2), n2 = [], a2 = yield this._performSearch(s2, t2, (e3) => {
|
|
4352
4388
|
const t3 = this.hydrateData(e3);
|
|
4353
4389
|
n2.push(t3), void 0 !== this.onResults && Promise.all(n2).then((e4) => {
|
|
4354
|
-
const t4 = u(e4), s3 =
|
|
4390
|
+
const t4 = u(e4), s3 = x([...this.lastCompletedQueryState.results, ...t4]);
|
|
4355
4391
|
this.onResults(s3, "searching");
|
|
4356
4392
|
});
|
|
4357
4393
|
}), i2 = a2.ok ? a2.value : void 0;
|
|
4358
4394
|
if (yield Promise.all(n2).then((e3) => {
|
|
4359
4395
|
var _a3;
|
|
4360
|
-
const t3 = u(e3), s3 =
|
|
4361
|
-
this.lastCompletedQueryState =
|
|
4396
|
+
const t3 = u(e3), s3 = x([...this.lastCompletedQueryState.results, ...t3]), n3 = void 0 === i2;
|
|
4397
|
+
this.lastCompletedQueryState = x({ results: s3, loadedAll: n3 }), this.currentCursor = i2;
|
|
4362
4398
|
const a3 = n3 ? "loadedAll" : "canLoadMore";
|
|
4363
4399
|
(_a3 = this.onResults) == null ? void 0 : _a3.call(this, s3, a3);
|
|
4364
4400
|
}), a2.ok) return (_a2 = this.loadingDeferred) == null ? void 0 : _a2.resolve(this.lastCompletedQueryState), this.loadingDeferred = void 0, this.lastCompletedQueryState;
|
|
@@ -4368,7 +4404,7 @@ class da {
|
|
|
4368
4404
|
_performSearch(e2, t2, s2) {
|
|
4369
4405
|
return __async(this, null, function* () {
|
|
4370
4406
|
let n2;
|
|
4371
|
-
return
|
|
4407
|
+
return na({ method: "GET", url: e2, authProvider: this.authProvider, errorTracker: this.authProvider.errorTracker, abortSignal: t2.signal }).then((e3) => __async(this, null, function* () {
|
|
4372
4408
|
if (!e3.body) return l("Search response was missing body");
|
|
4373
4409
|
const t3 = e3.body.getReader(), a2 = new TextDecoder();
|
|
4374
4410
|
let r2 = "", i2 = true;
|
|
@@ -4409,7 +4445,7 @@ class da {
|
|
|
4409
4445
|
}
|
|
4410
4446
|
}
|
|
4411
4447
|
export {
|
|
4412
|
-
|
|
4448
|
+
ua as getTalkSession,
|
|
4413
4449
|
f as registerPolyfills
|
|
4414
4450
|
};
|
|
4415
4451
|
//# sourceMappingURL=talkSession.js.map
|