@talkjs/core 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/dist/talkSession.cjs +1 -1
- package/dist/talkSession.d.ts +382 -54
- package/dist/talkSession.js +680 -501
- package/package.json +4 -3
package/dist/talkSession.js
CHANGED
|
@@ -130,70 +130,54 @@ function f({ WebSocket: e2 }) {
|
|
|
130
130
|
}
|
|
131
131
|
class g {
|
|
132
132
|
constructor(e2, t2) {
|
|
133
|
-
this.realtimeUrl = e2, this.handlers = t2, this.socket = null, this.
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
this.realtimeUrl = e2, this.handlers = t2, this.socket = null, this.stateMachine = new u("ReconnectingSocket", ["STOPPED", "CONNECTING", "READY", "DISCONNECTED", "TERMINATED"], { startWs: { from: ["STOPPED", "DISCONNECTED"], to: "CONNECTING", afterTransition: () => {
|
|
134
|
+
const e3 = new (function() {
|
|
135
|
+
if (p) return p;
|
|
136
|
+
if (globalThis.WebSocket) return globalThis.WebSocket;
|
|
137
|
+
throw new Error("Missing WebSocket implementation");
|
|
138
|
+
}())(this.realtimeUrl + "&talkjs-time=" + Date.now());
|
|
139
|
+
this.socket = e3, e3.addEventListener("open", () => {
|
|
140
|
+
this.socket === e3 && this.stateMachine.transition("onOpen");
|
|
141
|
+
}), e3.addEventListener("close", () => {
|
|
142
|
+
this.socket === e3 && this.stateMachine.transition("onClose");
|
|
143
|
+
}), e3.addEventListener("message", (t3) => {
|
|
144
|
+
this.socket === e3 && this.handlers.onMessage(t3);
|
|
136
145
|
});
|
|
137
|
-
} },
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
146
|
+
} }, onOpen: { from: ["CONNECTING"], to: "READY", afterTransition: () => {
|
|
147
|
+
this.handlers.onOpen();
|
|
148
|
+
} }, onClose: { from: ["CONNECTING", "READY"], to: "DISCONNECTED", afterTransition: (_0) => __async(this, [_0], function* ({ from: e3 }) {
|
|
149
|
+
"READY" === e3 && this.handlers.onClose(), this.socket = null;
|
|
150
|
+
const t3 = r(1e4, 0.5);
|
|
151
|
+
setTimeout(() => {
|
|
152
|
+
"DISCONNECTED" === this.stateMachine.state && this.stateMachine.transition("startWs");
|
|
153
|
+
}, t3);
|
|
154
|
+
}) }, stopWs: { from: ["CONNECTING", "DISCONNECTED", "READY"], to: "STOPPED", afterTransition: ({ from: e3 }) => {
|
|
155
|
+
"READY" === e3 && this.handlers.onClose();
|
|
156
|
+
const t3 = this.socket;
|
|
157
|
+
this.socket = null, t3 == null ? void 0 : t3.close(1e3);
|
|
142
158
|
} }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
|
|
143
|
-
|
|
144
|
-
|
|
159
|
+
const e3 = this.socket;
|
|
160
|
+
this.socket = null, e3 == null ? void 0 : e3.close(1e3);
|
|
145
161
|
} } });
|
|
146
162
|
}
|
|
147
163
|
stopWs() {
|
|
148
|
-
|
|
164
|
+
this.stateMachine.transition("stopWs");
|
|
149
165
|
}
|
|
150
166
|
startWs() {
|
|
151
|
-
this.stateMachine.
|
|
152
|
-
}
|
|
153
|
-
createWebSocket() {
|
|
154
|
-
var _a2;
|
|
155
|
-
(_a2 = this == null ? void 0 : this.socket) == null ? void 0 : _a2.close(1e3);
|
|
156
|
-
const e2 = new (function() {
|
|
157
|
-
if (p) return p;
|
|
158
|
-
if (globalThis.WebSocket) return globalThis.WebSocket;
|
|
159
|
-
throw new Error("Missing WebSocket implementation");
|
|
160
|
-
}())(this.realtimeUrl);
|
|
161
|
-
this.socket = e2;
|
|
162
|
-
const t2 = () => this.stateMachine.transition("ready");
|
|
163
|
-
e2.addEventListener("open", t2), e2.addEventListener("message", this.handlers.onMessage);
|
|
164
|
-
const s2 = () => {
|
|
165
|
-
e2.removeEventListener("open", t2), e2.removeEventListener("close", s2), e2.removeEventListener("message", this.handlers.onMessage), "TERMINATED" !== this.stateMachine.state && "STOPPED" !== this.stateMachine.state && this.stateMachine.transition("queueAutoReconnect");
|
|
166
|
-
};
|
|
167
|
-
e2.addEventListener("close", s2);
|
|
167
|
+
this.stateMachine.transition("startWs");
|
|
168
168
|
}
|
|
169
169
|
send(e2) {
|
|
170
170
|
return "READY" === this.stateMachine.state ? (this.socket.send(e2), c(void 0)) : l("SOCKET_NOT_READY");
|
|
171
171
|
}
|
|
172
172
|
terminate() {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
this.socket.close(1e3);
|
|
176
|
-
const e2 = new Event("close"), t2 = Object.assign(e2, { code: 1e3, reason: "", wasClean: true });
|
|
177
|
-
this.socket.dispatchEvent(t2);
|
|
178
|
-
} else this.socket.close(1e3);
|
|
173
|
+
const e2 = this.socket;
|
|
174
|
+
this.stateMachine.canTransition("onClose") && this.stateMachine.transition("onClose"), e2 && ("terminate" in e2 ? e2.terminate() : e2.close(1e3));
|
|
179
175
|
}
|
|
180
176
|
destroy() {
|
|
181
177
|
this.stateMachine.transition("destroy");
|
|
182
178
|
}
|
|
183
179
|
}
|
|
184
|
-
|
|
185
|
-
constructor() {
|
|
186
|
-
this.initialDelayMs = 200 + 200 * Math.random(), this.exponentialFactor = 1.2, this.maxDelayMs = 1e4, this.currentDelayMs = this.initialDelayMs;
|
|
187
|
-
}
|
|
188
|
-
request(e2) {
|
|
189
|
-
const t2 = r(this.currentDelayMs, 0.05);
|
|
190
|
-
n(this.currentDelayMs).then(() => e2()), this.currentDelayMs = Math.min(t2 * this.exponentialFactor, this.maxDelayMs);
|
|
191
|
-
}
|
|
192
|
-
resetDelay() {
|
|
193
|
-
this.currentDelayMs = this.initialDelayMs;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
class v {
|
|
180
|
+
class m {
|
|
197
181
|
constructor(e2, t2) {
|
|
198
182
|
this.handlers = t2, this.socket = new g(e2, { onOpen: () => this.handlers.onOpen(), onClose: () => this.handlers.onClose(), onMessage: (e3) => this.onWebSocketMessage(e3) });
|
|
199
183
|
}
|
|
@@ -232,7 +216,7 @@ class v {
|
|
|
232
216
|
else this.handlers.onAuthExpired();
|
|
233
217
|
}
|
|
234
218
|
}
|
|
235
|
-
class
|
|
219
|
+
class v {
|
|
236
220
|
constructor(e2) {
|
|
237
221
|
this.delayMs = e2, this.timeout = void 0;
|
|
238
222
|
}
|
|
@@ -245,7 +229,7 @@ class b {
|
|
|
245
229
|
void 0 !== this.timeout && (clearTimeout(this.timeout), this.timeout = void 0);
|
|
246
230
|
}
|
|
247
231
|
}
|
|
248
|
-
class
|
|
232
|
+
class b {
|
|
249
233
|
constructor() {
|
|
250
234
|
this.i = -1;
|
|
251
235
|
}
|
|
@@ -258,7 +242,7 @@ class w {
|
|
|
258
242
|
}
|
|
259
243
|
class y {
|
|
260
244
|
constructor(e2, t2) {
|
|
261
|
-
this.handlers = t2, this.seqCounter = new
|
|
245
|
+
this.handlers = t2, this.seqCounter = new b(), this.responseHandlers = {}, this.heartbeats = new w(this), this.socket = new m(e2, { onUpstreamRestarting: () => {
|
|
262
246
|
this.heartbeats.serverActive(), this.handlers.onUpstreamRestarting();
|
|
263
247
|
}, onOpen: () => {
|
|
264
248
|
this.heartbeats.clientActive(), this.heartbeats.serverActive(), this.handlers.onReady();
|
|
@@ -301,9 +285,9 @@ class y {
|
|
|
301
285
|
this.socket.terminate();
|
|
302
286
|
}
|
|
303
287
|
}
|
|
304
|
-
class
|
|
288
|
+
class w {
|
|
305
289
|
constructor(e2) {
|
|
306
|
-
this.connection = e2, this.clientInactivityTimer = new
|
|
290
|
+
this.connection = e2, this.clientInactivityTimer = new v(25e3), this.serverInactivityTimer = new v(1e4), this.serverTimeoutTimer = new v(5e3);
|
|
307
291
|
}
|
|
308
292
|
clientActive() {
|
|
309
293
|
this.clientInactivityTimer.schedule(() => {
|
|
@@ -325,7 +309,7 @@ class A {
|
|
|
325
309
|
});
|
|
326
310
|
}
|
|
327
311
|
}
|
|
328
|
-
class
|
|
312
|
+
class A {
|
|
329
313
|
constructor(e2, t2, s2) {
|
|
330
314
|
this.authProvider = t2, this.handlers = s2, this.stateMachine = new u("AuthenticatedConnection", ["WAITING_FOR_WS", "LOGGING_IN", "RENEWING_SESSION", "READY", "TERMINATED"], { logIn: { from: ["WAITING_FOR_WS"], to: "LOGGING_IN", afterTransition: () => __async(this, null, function* () {
|
|
331
315
|
yield this.renewSession();
|
|
@@ -388,7 +372,7 @@ class C {
|
|
|
388
372
|
});
|
|
389
373
|
}
|
|
390
374
|
}
|
|
391
|
-
class
|
|
375
|
+
class C {
|
|
392
376
|
constructor(e2, t2, s2) {
|
|
393
377
|
this.handlers = s2, this.stateMachine = new u("StopStartConnection", ["STOPPED", "WAITING_FOR_WS", "READY", "TERMINATED"], { unexpectedDisconnect: { from: ["READY"], to: "WAITING_FOR_WS", afterTransition: () => {
|
|
394
378
|
this.inactivityTimer.stop(), this.handlers.onNotReady();
|
|
@@ -402,7 +386,7 @@ class E {
|
|
|
402
386
|
}), this.handlers.onReady();
|
|
403
387
|
} }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
|
|
404
388
|
this.inactivityTimer.stop(), this.connection.destroy();
|
|
405
|
-
} } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new
|
|
389
|
+
} } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new v(3e3), this.connection = new A(e2, t2, { onUpstreamRestarting: () => {
|
|
406
390
|
this.handlers.onUpstreamRestarting();
|
|
407
391
|
}, onReady: () => {
|
|
408
392
|
this.stateMachine.transition("ready");
|
|
@@ -434,7 +418,7 @@ class E {
|
|
|
434
418
|
return "READY" === this.stateMachine.state;
|
|
435
419
|
}
|
|
436
420
|
}
|
|
437
|
-
class
|
|
421
|
+
class E {
|
|
438
422
|
constructor(e2, t2, s2) {
|
|
439
423
|
this.handlers = s2, this.stateMachine = new u("QueuedConnection", ["NOT_READY", "PROCESSING_QUEUE", "READY", "TERMINATED"], { processQueue: { from: ["NOT_READY"], to: "PROCESSING_QUEUE", afterTransition: () => {
|
|
440
424
|
this.sendQueuedCalls();
|
|
@@ -449,7 +433,7 @@ class k {
|
|
|
449
433
|
e3 == null ? void 0 : e3.clientErr("SESSION_DESTROYED");
|
|
450
434
|
}
|
|
451
435
|
this.connection.destroy();
|
|
452
|
-
} } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new
|
|
436
|
+
} } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new C(e2, t2, { onUpstreamRestarting: () => {
|
|
453
437
|
this.handlers.onUpstreamRestarting();
|
|
454
438
|
}, onReady: () => {
|
|
455
439
|
this.stateMachine.transition("processQueue");
|
|
@@ -498,10 +482,10 @@ class k {
|
|
|
498
482
|
return "READY" === this.stateMachine.state || "PROCESSING_QUEUE" === this.stateMachine.state;
|
|
499
483
|
}
|
|
500
484
|
}
|
|
501
|
-
const
|
|
502
|
-
class
|
|
485
|
+
const k = "undefined" != typeof window ? (_a = window.queueMicrotask) != null ? _a : setTimeout : setTimeout;
|
|
486
|
+
class x {
|
|
503
487
|
constructor(e2, t2) {
|
|
504
|
-
this.clearPendingBatch = e2, this.sendCalls = t2, this.sent = false,
|
|
488
|
+
this.clearPendingBatch = e2, this.sendCalls = t2, this.sent = false, k(() => this.send());
|
|
505
489
|
}
|
|
506
490
|
send() {
|
|
507
491
|
this.sent || (this.sent = true, this.clearPendingBatch(), this.sendCalls());
|
|
@@ -510,14 +494,14 @@ class S {
|
|
|
510
494
|
this.sent = true;
|
|
511
495
|
}
|
|
512
496
|
}
|
|
513
|
-
class
|
|
497
|
+
class S extends x {
|
|
514
498
|
constructor(e2, t2) {
|
|
515
499
|
super(t2, () => {
|
|
516
500
|
this.sendSubscribe(), this.sendGet();
|
|
517
501
|
}), this.connection = e2, this.getCalls = [], this.subscribeCalls = [];
|
|
518
502
|
}
|
|
519
503
|
canPush(e2, t2) {
|
|
520
|
-
return
|
|
504
|
+
return S.isCorrectBatchTypeFor(e2, t2);
|
|
521
505
|
}
|
|
522
506
|
static isCorrectBatchTypeFor(e2, t2) {
|
|
523
507
|
return s(t2, ["users", "*"]) && ("GET" === e2 || "SUBSCRIBE" === e2);
|
|
@@ -543,12 +527,12 @@ class T extends S {
|
|
|
543
527
|
this.connection.call("SUBSCRIBE", ["users"], { ids: e2 }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
|
|
544
528
|
}
|
|
545
529
|
}
|
|
546
|
-
class
|
|
530
|
+
class T extends x {
|
|
547
531
|
constructor(e2, t2, s2) {
|
|
548
532
|
super(s2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
|
|
549
533
|
}
|
|
550
534
|
canPush(e2, t2) {
|
|
551
|
-
return !!
|
|
535
|
+
return !!T.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
|
|
552
536
|
}
|
|
553
537
|
static isCorrectBatchTypeFor(e2, t2) {
|
|
554
538
|
return s(t2, ["conversations", "*", "participants", "*"]) && ("PUT" === e2 || "POST" === e2 || "PATCH" === e2);
|
|
@@ -569,9 +553,9 @@ class D extends S {
|
|
|
569
553
|
});
|
|
570
554
|
}
|
|
571
555
|
}
|
|
572
|
-
class
|
|
556
|
+
class D {
|
|
573
557
|
constructor(e2, t2, s2) {
|
|
574
|
-
this.pendingBatch = null, this.connection = new
|
|
558
|
+
this.pendingBatch = null, this.connection = new E(e2, t2, s2);
|
|
575
559
|
}
|
|
576
560
|
call(e2, t2, s2) {
|
|
577
561
|
return __async(this, null, function* () {
|
|
@@ -590,18 +574,18 @@ class I {
|
|
|
590
574
|
return this.connection.isConnected();
|
|
591
575
|
}
|
|
592
576
|
createEmptyBatchFor(e2, t2) {
|
|
593
|
-
if (
|
|
594
|
-
if (
|
|
577
|
+
if (S.isCorrectBatchTypeFor(e2, t2)) return new S(this.connection, () => this.pendingBatch = null);
|
|
578
|
+
if (T.isCorrectBatchTypeFor(e2, t2)) {
|
|
595
579
|
const e3 = t2[1];
|
|
596
|
-
return new
|
|
580
|
+
return new T(e3, this.connection, () => this.pendingBatch = null);
|
|
597
581
|
}
|
|
598
582
|
return null;
|
|
599
583
|
}
|
|
600
584
|
}
|
|
601
|
-
const
|
|
602
|
-
class
|
|
585
|
+
const I = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
|
|
586
|
+
class F {
|
|
603
587
|
constructor(e2, t2, s2) {
|
|
604
|
-
this.throttler = new
|
|
588
|
+
this.throttler = new B(), this.alive = true, this.connection = new D(e2, t2, s2);
|
|
605
589
|
}
|
|
606
590
|
call(e2, t2, s2) {
|
|
607
591
|
return __async(this, null, function* () {
|
|
@@ -610,7 +594,7 @@ class B {
|
|
|
610
594
|
const r2 = yield this.connection.call(e2, t2, s2);
|
|
611
595
|
if ((r2.ok || "client" !== r2.where || "SOCKET_NOT_READY" !== r2.value) && (r2.ok || "server" !== r2.where || 500 !== r2.value.status) || n2++, 10 === n2) return r2;
|
|
612
596
|
if (r2.ok || "client" !== r2.where) {
|
|
613
|
-
const e3 = r2.value, t3 = e3.status, s3 =
|
|
597
|
+
const e3 = r2.value, t3 = e3.status, s3 = I[t3];
|
|
614
598
|
if ("RESOLVE" === s3) return this.throttler.resetDelay(), r2;
|
|
615
599
|
if ("RETRY" === s3) continue;
|
|
616
600
|
if ("DELAY" === s3) {
|
|
@@ -632,7 +616,7 @@ class B {
|
|
|
632
616
|
return this.connection.isConnected();
|
|
633
617
|
}
|
|
634
618
|
}
|
|
635
|
-
class
|
|
619
|
+
class B {
|
|
636
620
|
constructor() {
|
|
637
621
|
this.initialDelayMs = 200, this.exponentialFactor = 1.2, this.maxDelayMs = 3e4, this.currentDelayMs = this.initialDelayMs, this.lastCall = 0;
|
|
638
622
|
}
|
|
@@ -647,21 +631,21 @@ class M {
|
|
|
647
631
|
this.currentDelayMs = this.initialDelayMs;
|
|
648
632
|
}
|
|
649
633
|
}
|
|
650
|
-
function
|
|
634
|
+
function M(e2) {
|
|
651
635
|
return e2.map((e3) => encodeURIComponent(e3)).join();
|
|
652
636
|
}
|
|
653
|
-
class
|
|
637
|
+
class R {
|
|
654
638
|
constructor() {
|
|
655
639
|
this.paths = {};
|
|
656
640
|
}
|
|
657
641
|
add(e2) {
|
|
658
|
-
this.paths[
|
|
642
|
+
this.paths[M(e2)] = e2;
|
|
659
643
|
}
|
|
660
644
|
delete(e2) {
|
|
661
|
-
delete this.paths[
|
|
645
|
+
delete this.paths[M(e2)];
|
|
662
646
|
}
|
|
663
647
|
has(e2) {
|
|
664
|
-
return Object.hasOwnProperty.call(this.paths,
|
|
648
|
+
return Object.hasOwnProperty.call(this.paths, M(e2));
|
|
665
649
|
}
|
|
666
650
|
clear() {
|
|
667
651
|
this.paths = {};
|
|
@@ -670,9 +654,9 @@ class N {
|
|
|
670
654
|
Object.values(this.paths).forEach((t2) => e2(t2));
|
|
671
655
|
}
|
|
672
656
|
}
|
|
673
|
-
class
|
|
657
|
+
class N {
|
|
674
658
|
constructor(e2, t2, s2) {
|
|
675
|
-
this.handlers = s2, this.targetSubscriptions = new
|
|
659
|
+
this.handlers = s2, this.targetSubscriptions = new R(), this.connection = new F(e2, t2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onSubscriptionsLost: () => {
|
|
676
660
|
this.targetSubscriptions.forEach((e3) => {
|
|
677
661
|
this.resubscribe(e3);
|
|
678
662
|
}), this.handlers.onResubscribeSent();
|
|
@@ -709,7 +693,7 @@ class _ {
|
|
|
709
693
|
function P(e2, t2) {
|
|
710
694
|
return void 0 === t2 ? e2 : t2;
|
|
711
695
|
}
|
|
712
|
-
function
|
|
696
|
+
function _(e2, t2) {
|
|
713
697
|
if (void 0 === t2) return e2;
|
|
714
698
|
if (null === t2) return {};
|
|
715
699
|
const s2 = __spreadValues({}, e2);
|
|
@@ -719,25 +703,25 @@ function O(e2, t2) {
|
|
|
719
703
|
}
|
|
720
704
|
return s2;
|
|
721
705
|
}
|
|
722
|
-
function
|
|
706
|
+
function O(e2, t2) {
|
|
723
707
|
if (e2 === t2) return true;
|
|
724
708
|
if (!e2 || !t2) return false;
|
|
725
709
|
if ("object" != typeof e2 || "object" != typeof t2) return false;
|
|
726
710
|
if (e2.constructor !== t2.constructor) return false;
|
|
727
711
|
if (Array.isArray(e2) && Array.isArray(t2)) {
|
|
728
712
|
if (e2.length !== t2.length) return false;
|
|
729
|
-
for (let s2 = 0; s2 < e2.length; s2++) if (!
|
|
713
|
+
for (let s2 = 0; s2 < e2.length; s2++) if (!O(e2[s2], t2[s2])) return false;
|
|
730
714
|
} else {
|
|
731
715
|
const s2 = Object.keys(e2);
|
|
732
716
|
if (s2.length !== Object.keys(t2).length) return false;
|
|
733
717
|
for (const n2 of s2) {
|
|
734
718
|
if (!Object.hasOwnProperty.call(t2, n2)) return false;
|
|
735
|
-
if (!
|
|
719
|
+
if (!O(e2[n2], t2[n2])) return false;
|
|
736
720
|
}
|
|
737
721
|
}
|
|
738
722
|
return true;
|
|
739
723
|
}
|
|
740
|
-
class
|
|
724
|
+
class U {
|
|
741
725
|
constructor() {
|
|
742
726
|
this.prev = Promise.resolve();
|
|
743
727
|
}
|
|
@@ -748,69 +732,118 @@ class j {
|
|
|
748
732
|
});
|
|
749
733
|
}
|
|
750
734
|
}
|
|
751
|
-
class
|
|
735
|
+
class j {
|
|
736
|
+
constructor(e2) {
|
|
737
|
+
this.initialised = false, this.getPointer = void 0, this.pendingStates = [e2], e2.resultPromise.then(() => this.initialised = true);
|
|
738
|
+
}
|
|
739
|
+
get pendingPointer() {
|
|
740
|
+
if (0 !== this.pendingStates.length) return this.pendingStates[this.pendingStates.length - 1];
|
|
741
|
+
}
|
|
742
|
+
get mostRecentState() {
|
|
743
|
+
var _a2;
|
|
744
|
+
return (_a2 = this.pendingPointer) != null ? _a2 : this.getPointer;
|
|
745
|
+
}
|
|
746
|
+
canAppendState(e2) {
|
|
747
|
+
var _a2, _b;
|
|
748
|
+
const t2 = (_a2 = this.getPointer) == null ? void 0 : _a2.seq;
|
|
749
|
+
if (void 0 !== t2 && e2 <= t2) return false;
|
|
750
|
+
const s2 = (_b = this.pendingPointer) == null ? void 0 : _b.seq;
|
|
751
|
+
return !(void 0 !== s2 && e2 < s2);
|
|
752
|
+
}
|
|
753
|
+
set(e2) {
|
|
754
|
+
if (!this.canAppendState(e2.seq)) throw "Appending in the past";
|
|
755
|
+
this.pendingStates.push(e2);
|
|
756
|
+
}
|
|
757
|
+
mutate(e2, t2) {
|
|
758
|
+
if (!this.initialised) return;
|
|
759
|
+
if (!this.canAppendState(e2)) throw "Mutating in the past";
|
|
760
|
+
const s2 = this.mostRecentState.resultPromise.then((e3) => e3.ok ? t2(e3) : e3);
|
|
761
|
+
this.pendingStates.push({ seq: e2, resultPromise: s2 });
|
|
762
|
+
}
|
|
763
|
+
get(e2) {
|
|
764
|
+
if (void 0 !== this.getPointer && e2 < this.getPointer.seq) throw `Trying to load state ${e2} when we have previously loaded ${this.getPointer.seq}`;
|
|
765
|
+
for (; this.pendingStates.length > 0 && this.pendingStates[0].seq <= e2; ) this.getPointer = this.pendingStates.shift();
|
|
766
|
+
return this.getPointer;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
class $ extends j {
|
|
752
770
|
constructor(e2, t2) {
|
|
753
|
-
this.onTeardown = t2, this.
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
771
|
+
super(e2), this.onTeardown = t2, this._error = null, this._lastGoodState = Promise.resolve(void 0);
|
|
772
|
+
}
|
|
773
|
+
get error() {
|
|
774
|
+
return this._error;
|
|
775
|
+
}
|
|
776
|
+
get lastGoodState() {
|
|
777
|
+
return this._lastGoodState;
|
|
778
|
+
}
|
|
779
|
+
mutate(e2, t2) {
|
|
780
|
+
super.mutate(e2, t2), this.registerNewState(this.mostRecentState.resultPromise);
|
|
781
|
+
}
|
|
782
|
+
set(e2) {
|
|
783
|
+
super.set(e2), this.registerNewState(this.mostRecentState.resultPromise);
|
|
784
|
+
}
|
|
785
|
+
registerNewState(e2) {
|
|
761
786
|
const t2 = this.lastGoodState;
|
|
762
|
-
this.
|
|
787
|
+
this._lastGoodState = e2.then((e3) => e3.ok ? e3.value : t2), e2.then((e3) => {
|
|
763
788
|
e3.ok || this.setError(e3);
|
|
764
|
-
})
|
|
789
|
+
});
|
|
765
790
|
}
|
|
766
|
-
|
|
767
|
-
|
|
791
|
+
setError(e2) {
|
|
792
|
+
var _a2;
|
|
793
|
+
this._error || (this._error = e2, (_a2 = this.onTeardown) == null ? void 0 : _a2.call(this, e2), this.lastGoodState.then((e3) => {
|
|
794
|
+
void 0 !== e3 && this.teardownNested(e3);
|
|
795
|
+
}));
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
class W extends $ {
|
|
799
|
+
constructor(e2) {
|
|
800
|
+
super({ seq: 0, resultPromise: new Promise((e3) => setTimeout(e3)).then(() => this.fetchInitial(0)) }, e2), this.getDeepMutex = new U(), this.lastDeep = void 0;
|
|
768
801
|
}
|
|
769
802
|
refetchInitial(e2) {
|
|
770
803
|
return __async(this, null, function* () {
|
|
771
|
-
const t2 = this.
|
|
772
|
-
if (void 0 === n2) return r2;
|
|
804
|
+
const t2 = this.mostRecentState.resultPromise, s2 = this.fetchInitial(e2), [n2, r2] = yield Promise.all([t2, s2]);
|
|
805
|
+
if (void 0 === n2 || !n2.ok) return r2;
|
|
773
806
|
if (!r2.ok) return r2;
|
|
774
|
-
return this.equal(n2, r2.value) ?
|
|
807
|
+
return this.equal(n2.value, r2.value) ? n2 : r2;
|
|
775
808
|
});
|
|
776
809
|
}
|
|
777
810
|
refetch(e2) {
|
|
778
|
-
if (this.error) return;
|
|
811
|
+
if (null !== this.error) return;
|
|
779
812
|
const t2 = { seq: e2, resultPromise: this.refetchInitial(e2) };
|
|
780
|
-
this.
|
|
813
|
+
this.set(t2);
|
|
781
814
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
815
|
+
changedBetween(e2, t2) {
|
|
816
|
+
return __async(this, null, function* () {
|
|
817
|
+
if (e2 >= t2) return false;
|
|
818
|
+
const s2 = this.get(t2), n2 = yield s2.resultPromise;
|
|
819
|
+
if (!n2.ok) return false;
|
|
820
|
+
if (n2.value.lastChanged > e2) return true;
|
|
821
|
+
return yield this.anyChildChanged(e2, t2, n2.value);
|
|
822
|
+
});
|
|
788
823
|
}
|
|
789
824
|
getDeep(e2) {
|
|
790
825
|
return __async(this, null, function* () {
|
|
791
826
|
return this.getDeepMutex.runExclusive(() => __async(this, null, function* () {
|
|
792
|
-
|
|
793
|
-
if (
|
|
794
|
-
|
|
795
|
-
if (
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
827
|
+
var _a2;
|
|
828
|
+
if (null !== this.error) return this.error;
|
|
829
|
+
const t2 = (_a2 = this.lastDeep) == null ? void 0 : _a2.seq;
|
|
830
|
+
if (e2 === t2) return this.lastDeep.deep;
|
|
831
|
+
if (void 0 !== t2) {
|
|
832
|
+
if (e2 < t2) throw `Trying to load seq ${e2} when we have previously loaded seq ${t2}`;
|
|
833
|
+
if (!(yield this.changedBetween(t2, e2))) return this.lastDeep.seq = e2, this.lastDeep.deep;
|
|
834
|
+
}
|
|
835
|
+
const s2 = this.get(e2).resultPromise, n2 = s2.then((t3) => t3.ok ? this.loadNested(e2, t3.value) : t3);
|
|
836
|
+
this.lastDeep = { seq: e2, shallow: s2, deep: n2 };
|
|
837
|
+
const r2 = yield n2;
|
|
838
|
+
return r2.ok || this.setError(r2), r2;
|
|
800
839
|
}));
|
|
801
840
|
});
|
|
802
841
|
}
|
|
803
|
-
setError(e2) {
|
|
804
|
-
var _a2;
|
|
805
|
-
this.error || (this.error = e2, (_a2 = this.onTeardown) == null ? void 0 : _a2.call(this, e2), this.lastGoodState.then((e3) => {
|
|
806
|
-
void 0 !== e3 && this.teardownNested(e3);
|
|
807
|
-
}));
|
|
808
|
-
}
|
|
809
842
|
}
|
|
810
|
-
class
|
|
811
|
-
constructor(e2, t2
|
|
812
|
-
super(
|
|
813
|
-
yield this.emit(
|
|
843
|
+
class q extends W {
|
|
844
|
+
constructor(e2, t2) {
|
|
845
|
+
super(t2), this.emitMutex = e2, this.unsubscribeTimer = new H(), this.referencedByOtherStores = 0, this.listeners = [], this.lastEmitSeq = void 0, this.lastEmitResult = void 0, e2.runExclusive(() => __async(this, null, function* () {
|
|
846
|
+
yield this.emit(0);
|
|
814
847
|
}));
|
|
815
848
|
}
|
|
816
849
|
registerInternalSubscription() {
|
|
@@ -836,16 +869,16 @@ class W extends $ {
|
|
|
836
869
|
emit(e2) {
|
|
837
870
|
return __async(this, null, function* () {
|
|
838
871
|
var _a2;
|
|
872
|
+
if (this.onlyUsedInternally) return;
|
|
839
873
|
if (this.lastEmitSeq && this.lastEmitSeq >= e2) return;
|
|
840
874
|
if (false === ((_a2 = this.lastEmitResult) == null ? void 0 : _a2.ok)) return;
|
|
841
|
-
const t2 = this.lastEmitSeq;
|
|
842
875
|
this.lastEmitSeq = e2;
|
|
843
|
-
const
|
|
844
|
-
this.lastEmitResult
|
|
876
|
+
const t2 = yield this.getDeep(e2);
|
|
877
|
+
t2 !== this.lastEmitResult && (this.lastEmitResult = t2, this.listeners.forEach((e3) => e3(t2)));
|
|
845
878
|
});
|
|
846
879
|
}
|
|
847
880
|
}
|
|
848
|
-
class
|
|
881
|
+
class H {
|
|
849
882
|
constructor() {
|
|
850
883
|
this.timerId = void 0;
|
|
851
884
|
}
|
|
@@ -856,9 +889,9 @@ class q {
|
|
|
856
889
|
clearTimeout(this.timerId);
|
|
857
890
|
}
|
|
858
891
|
}
|
|
859
|
-
class
|
|
860
|
-
constructor(e2, t2, s2, n2
|
|
861
|
-
super(
|
|
892
|
+
class G extends q {
|
|
893
|
+
constructor(e2, t2, s2, n2) {
|
|
894
|
+
super(s2, n2), this.userId = e2, this.realtimeClient = t2, this.unsubscribeDebounceMs = 1e4;
|
|
862
895
|
}
|
|
863
896
|
fetchInitial(e2) {
|
|
864
897
|
return __async(this, null, function* () {
|
|
@@ -867,7 +900,7 @@ class H extends W {
|
|
|
867
900
|
});
|
|
868
901
|
}
|
|
869
902
|
equal(e2, t2) {
|
|
870
|
-
return
|
|
903
|
+
return O(e2.snapshot, t2.snapshot);
|
|
871
904
|
}
|
|
872
905
|
loadNested(e2, t2) {
|
|
873
906
|
return __async(this, null, function* () {
|
|
@@ -875,72 +908,57 @@ class H extends W {
|
|
|
875
908
|
});
|
|
876
909
|
}
|
|
877
910
|
userCreated(e2, t2) {
|
|
878
|
-
this.mutate(e2, () => c({ snapshot: this.realtimeClient.createUserSnapshot(t2.state), lastChanged: e2 }));
|
|
911
|
+
this.mutate(e2, (s2) => null !== s2.value.snapshot ? s2 : c({ snapshot: this.realtimeClient.createUserSnapshot(t2.state), lastChanged: e2 }));
|
|
879
912
|
}
|
|
880
913
|
userEdited(e2, t2) {
|
|
881
914
|
this.mutate(e2, (s2) => {
|
|
882
915
|
const n2 = s2.value.snapshot;
|
|
883
916
|
if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
|
|
884
|
-
return c({ snapshot: { id: n2.id, name: P(n2.name, t2.diff.name), custom:
|
|
917
|
+
return c({ snapshot: { id: n2.id, name: P(n2.name, t2.diff.name), custom: _(n2.custom, t2.diff.custom), locale: P(n2.locale, t2.diff.locale), photoUrl: P(n2.photoUrl, t2.diff.photoUrl), role: P(n2.role, t2.diff.role), welcomeMessage: P(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
|
|
885
918
|
});
|
|
886
919
|
}
|
|
887
920
|
getFromCache() {
|
|
888
921
|
return __async(this, null, function* () {
|
|
889
|
-
const e2 = yield this.
|
|
922
|
+
const e2 = yield this.mostRecentState.resultPromise;
|
|
890
923
|
return e2.ok ? null === e2.value.snapshot ? h({ status: 404, errorCode: "USER_NOT_FOUND", reasons: ["That user does not exist yet"] }) : c({ status: 200, data: { id: e2.value.snapshot.id, name: e2.value.snapshot.name, custom: e2.value.snapshot.custom, locale: e2.value.snapshot.locale, photoUrl: e2.value.snapshot.photoUrl, role: e2.value.snapshot.role, welcomeMessage: e2.value.snapshot.welcomeMessage } }) : l("NOT_IN_CACHE");
|
|
891
924
|
});
|
|
892
925
|
}
|
|
893
926
|
teardownNested(e2) {
|
|
894
927
|
}
|
|
928
|
+
anyChildChanged(e2, t2, s2) {
|
|
929
|
+
return __async(this, null, function* () {
|
|
930
|
+
return false;
|
|
931
|
+
});
|
|
932
|
+
}
|
|
895
933
|
}
|
|
896
|
-
|
|
897
|
-
function
|
|
898
|
-
if (":arslan:" === e2.text) return ":arslan:";
|
|
899
|
-
const t2 = function({ text: e3, kind: t3 }) {
|
|
900
|
-
var _a2;
|
|
901
|
-
return "unicode" === t3 ? function(e4) {
|
|
902
|
-
const t4 = [];
|
|
903
|
-
let s3 = 0, n2 = 0, r2 = 0;
|
|
904
|
-
for (; r2 < e4.length; ) s3 = e4.charCodeAt(r2++), n2 ? (t4.push((65536 + (n2 - 55296 << 10) + (s3 - 56320)).toString(16)), n2 = 0) : 55296 <= s3 && s3 <= 56319 ? n2 = s3 : t4.push(s3.toString(16));
|
|
905
|
-
return t4.join("-");
|
|
906
|
-
}((s2 = e3).indexOf(L) < 0 ? s2.replace(G, "") : s2) : (_a2 = Y[e3]) != null ? _a2 : function(e4) {
|
|
907
|
-
if (/;-?\)/.test(e4)) return "1f609";
|
|
908
|
-
if (e4 = e4.replace(/;/g, ":"), /:-o/i.test(e4)) return "1f631";
|
|
909
|
-
return e4 = e4.replace(/-/g, "").toLowerCase(), J[e4];
|
|
910
|
-
}(e3);
|
|
911
|
-
var s2;
|
|
912
|
-
}(e2);
|
|
913
|
-
return t2 ? String.fromCodePoint(parseInt(t2, 16)) : e2.text;
|
|
914
|
-
}
|
|
915
|
-
const J = { ":)": "1f642", ":o": "1f62e", ":]": "1f60f", ":d": "1f600", xd: "1f61d", ":p": "1f61c", ":@": "1f621", ":[": "1f621", ":(": "1f626", ":'(": "1f62d", ":’(": "1f62d", ":*": "1f618", ":/": "1f614", ":s": "1f616", ":|": "1f633", ":$": "263a", ":x": "1f637", "<3": "2764", "</3": "1f494" }, Y = { ":thumbsup:": "1f44d", ":thumbsdown:": "1f44e", ":poop:": "1f4a9" };
|
|
916
|
-
var Q, V = {};
|
|
917
|
-
function Z(e2, t2) {
|
|
934
|
+
var L, z = {};
|
|
935
|
+
function J(e2, t2) {
|
|
918
936
|
const s2 = t2.lastIndex;
|
|
919
937
|
let n2;
|
|
920
938
|
const r2 = [];
|
|
921
939
|
for (; null !== (n2 = t2.exec(e2)); ) r2.push(n2);
|
|
922
940
|
return t2.lastIndex = s2, r2;
|
|
923
941
|
}
|
|
924
|
-
function
|
|
942
|
+
function Y(e2) {
|
|
925
943
|
const t2 = e2.replace(/%2F/g, "/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/, "$1");
|
|
926
944
|
return decodeURIComponent(t2);
|
|
927
945
|
}
|
|
928
|
-
function
|
|
946
|
+
function Q(e2, t2) {
|
|
929
947
|
if (!e2() && !t2) {
|
|
930
948
|
t2 = e2.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/, "`$1`") + " was not true";
|
|
931
949
|
}
|
|
932
950
|
}
|
|
933
951
|
!function() {
|
|
934
|
-
if (
|
|
952
|
+
if (L) return z;
|
|
935
953
|
function e2(e3) {
|
|
936
954
|
return String.fromCharCode(parseInt(e3.slice(1), 16));
|
|
937
955
|
}
|
|
938
956
|
function t2(e3) {
|
|
939
957
|
return `%${`00${e3.charCodeAt(0).toString(16)}`.slice(-2)}`;
|
|
940
958
|
}
|
|
941
|
-
|
|
959
|
+
L = 1, Object.defineProperty(z, "__esModule", { value: true }), z.encode = function(t3) {
|
|
942
960
|
return btoa(encodeURIComponent(t3).replace(/%[0-9A-F]{2}/g, e2));
|
|
943
|
-
},
|
|
961
|
+
}, z.decode = function(e3) {
|
|
944
962
|
return decodeURIComponent(Array.from(atob(e3), t2).join(""));
|
|
945
963
|
};
|
|
946
964
|
}(), ((e2) => {
|
|
@@ -974,51 +992,51 @@ function X(e2, t2) {
|
|
|
974
992
|
}, e2.falsy = function(e3) {
|
|
975
993
|
}, e2.never = function(e3) {
|
|
976
994
|
};
|
|
977
|
-
})(
|
|
978
|
-
const
|
|
979
|
-
function
|
|
980
|
-
if (!
|
|
981
|
-
return !
|
|
995
|
+
})(Q || (Q = {}));
|
|
996
|
+
const V = Q, Z = /^\/.*[^\\]\/[im]*$/;
|
|
997
|
+
function K(e2) {
|
|
998
|
+
if (!Z.test(e2)) return false;
|
|
999
|
+
return !X(e2).test("");
|
|
982
1000
|
}
|
|
983
|
-
function
|
|
1001
|
+
function X(e2) {
|
|
984
1002
|
const t2 = e2.match(/^\/(.*[^\\])\/(.*)$/);
|
|
985
1003
|
if (!t2) throw new Error(`Expected ${e2} to be a (non-empty) regex`);
|
|
986
1004
|
let s2 = t2[2] || "";
|
|
987
1005
|
return s2 = s2.replace(/[^im]/g, "") + "g", new RegExp(t2[1], s2);
|
|
988
1006
|
}
|
|
989
|
-
class
|
|
1007
|
+
class ee {
|
|
990
1008
|
constructor({ mode: e2, allowedHostnames: t2, allowedPhoneNrs: s2, allowedMatches: n2, forbiddenMatches: r2, suppressLinks: i2, suppressEmailAddresses: a2, suppressPhoneNumbers: o2, replacement: u2 }) {
|
|
991
|
-
|
|
1009
|
+
V.oneOf(e2, ["all", "otherOnly", "off"]), this.mode = e2, this.suppressLinks = false !== i2, this.suppressEmailAddresses = false !== a2, this.suppressPhoneNumbers = false !== o2, this.allowedHostnames = t2 || [], this.allowedPhoneNrs = (s2 || []).filter((e3) => e3).map((e3) => e3.replace(/[^0-9]/g, "")), this.allowedMatches = (n2 || []).filter(K).map((e3) => X(e3)), this.forbiddenMatches = (r2 || []).filter(K).map((e3) => X(e3)), V(() => this.allowedMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"), V(() => this.forbiddenMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"), u2 = u2 == null ? void 0 : u2.trim(), this.replacement = u2 && u2.length > 0 ? u2 : void 0;
|
|
992
1010
|
}
|
|
993
1011
|
shouldSuppress({ isContentBySender: e2 }) {
|
|
994
1012
|
return "all" === this.mode || "otherOnly" === this.mode && !e2;
|
|
995
1013
|
}
|
|
996
1014
|
}
|
|
997
|
-
function
|
|
1015
|
+
function te(e2, t2) {
|
|
998
1016
|
const s2 = e2.map((e3) => function(e4, t3) {
|
|
999
1017
|
if ("text" === e4.type) return function(e5, t4) {
|
|
1000
1018
|
const s3 = function(e6) {
|
|
1001
1019
|
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l;
|
|
1002
1020
|
let t5 = "";
|
|
1003
|
-
return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b = e6.markup) != null ? _b : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [],
|
|
1021
|
+
return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b = e6.markup) != null ? _b : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [], enableEmojiImageFallback: (_e2 = e6.enableEmojiImageFallback) != null ? _e2 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new ee({ mode: "off" }), contactInfoHiddenText: (_k = (_j = e6.contactInfoHiddenText) != null ? _j : (_i = e6.suppression) == null ? void 0 : _i.replacement) != null ? _k : t5, customEmojiUrls: (_l = e6.customEmojiUrls) != null ? _l : {} };
|
|
1004
1022
|
}(t4);
|
|
1005
|
-
return
|
|
1023
|
+
return se(e5, s3);
|
|
1006
1024
|
}(e4.children, t3);
|
|
1007
|
-
if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${
|
|
1008
|
-
if ("file" === e4.type && "image" === e4.subtype) return `📷 ${
|
|
1009
|
-
if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${
|
|
1025
|
+
if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${Y(e4.url)}`;
|
|
1026
|
+
if ("file" === e4.type && "image" === e4.subtype) return `📷 ${Y(e4.url)}`;
|
|
1027
|
+
if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${Y(e4.url)}`;
|
|
1010
1028
|
if ("file" === e4.type && "voice" === e4.subtype) {
|
|
1011
1029
|
const t4 = e4.duration;
|
|
1012
1030
|
if (void 0 === t4) return "🎙️";
|
|
1013
1031
|
return `🎙️ (${Math.floor(t4 / 60)}:${Math.floor(t4 % 60).toString().padStart(2, "0")})`;
|
|
1014
1032
|
}
|
|
1015
|
-
if ("file" === e4.type) return e4.subtype, `📎 ${
|
|
1033
|
+
if ("file" === e4.type) return e4.subtype, `📎 ${Y(e4.url)}`;
|
|
1016
1034
|
if ("location" === e4.type) return "📍";
|
|
1017
1035
|
return "";
|
|
1018
1036
|
}(e3, t2));
|
|
1019
1037
|
return s2.join("\n\n");
|
|
1020
1038
|
}
|
|
1021
|
-
function
|
|
1039
|
+
function se(e2, t2) {
|
|
1022
1040
|
return e2.flatMap((e3) => {
|
|
1023
1041
|
if ("string" == typeof e3) return e3;
|
|
1024
1042
|
switch (e3.type) {
|
|
@@ -1031,19 +1049,20 @@ function ae(e2, t2) {
|
|
|
1031
1049
|
case "actionLink":
|
|
1032
1050
|
case "actionbutton":
|
|
1033
1051
|
case "actionButton":
|
|
1034
|
-
return
|
|
1052
|
+
return se(e3.children, t2);
|
|
1035
1053
|
case "bulletlist":
|
|
1036
1054
|
case "bulletList":
|
|
1037
|
-
return "\n" +
|
|
1055
|
+
return "\n" + se(e3.children, t2);
|
|
1038
1056
|
case "bulletpoint":
|
|
1039
1057
|
case "bulletPoint":
|
|
1040
|
-
return "- " +
|
|
1058
|
+
return "- " + se(e3.children, t2) + "\n";
|
|
1041
1059
|
case "autolink":
|
|
1042
1060
|
case "autoLink":
|
|
1043
1061
|
case "codeblock":
|
|
1044
1062
|
case "codeBlock":
|
|
1045
1063
|
case "codespan":
|
|
1046
1064
|
case "codeSpan":
|
|
1065
|
+
case "emoji":
|
|
1047
1066
|
case "customemoji":
|
|
1048
1067
|
case "customEmoji":
|
|
1049
1068
|
return e3.text;
|
|
@@ -1051,14 +1070,12 @@ function ae(e2, t2) {
|
|
|
1051
1070
|
return t2.contactInfoHiddenText;
|
|
1052
1071
|
case "mention":
|
|
1053
1072
|
return `@${e3.text}`;
|
|
1054
|
-
case "emoji":
|
|
1055
|
-
return "images" === t2.emojis ? "" : "unicode" === t2.emojis ? z(e3) : e3.text;
|
|
1056
1073
|
}
|
|
1057
1074
|
}).join("");
|
|
1058
1075
|
}
|
|
1059
|
-
class
|
|
1060
|
-
constructor(e2, t2, s2
|
|
1061
|
-
super(
|
|
1076
|
+
class ne extends W {
|
|
1077
|
+
constructor(e2, t2, s2) {
|
|
1078
|
+
super(), this.conversationId = e2, this.message = t2, this.realtimeClient = s2;
|
|
1062
1079
|
}
|
|
1063
1080
|
get messageId() {
|
|
1064
1081
|
return "string" == typeof this.message ? this.message : this.message.id;
|
|
@@ -1072,33 +1089,40 @@ class oe extends $ {
|
|
|
1072
1089
|
if (!e3.ok) return e3;
|
|
1073
1090
|
t2 = e3.value.data;
|
|
1074
1091
|
}
|
|
1075
|
-
return c({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: t2.custom, createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext:
|
|
1092
|
+
return c({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: t2.custom, createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext: te(t2.content, {}), content: t2.content } });
|
|
1076
1093
|
});
|
|
1077
1094
|
}
|
|
1078
1095
|
refetch(e2) {
|
|
1079
1096
|
throw "Do not call refetch on message data stores, it can return outdated data. Destroy and remake them instead";
|
|
1080
1097
|
}
|
|
1081
1098
|
equal(e2, t2) {
|
|
1082
|
-
return
|
|
1099
|
+
return O(e2.data, t2.data);
|
|
1083
1100
|
}
|
|
1084
1101
|
teardownNested(e2) {
|
|
1085
1102
|
var _a2;
|
|
1086
1103
|
(_a2 = e2.sender) == null ? void 0 : _a2.unsubscribe();
|
|
1087
1104
|
}
|
|
1105
|
+
anyChildChanged(e2, t2, s2) {
|
|
1106
|
+
return __async(this, null, function* () {
|
|
1107
|
+
var _a2;
|
|
1108
|
+
const n2 = (_a2 = s2.sender) == null ? void 0 : _a2.store;
|
|
1109
|
+
return true === (yield n2 == null ? void 0 : n2.changedBetween(e2, t2));
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1088
1112
|
loadNested(e2, t2) {
|
|
1089
1113
|
return __async(this, null, function* () {
|
|
1090
|
-
var _a2, _b, _c
|
|
1114
|
+
var _a2, _b, _c;
|
|
1091
1115
|
const s2 = yield (_b = (_a2 = t2.sender) == null ? void 0 : _a2.store) == null ? void 0 : _b.getDeep(e2);
|
|
1092
1116
|
if (false === (s2 == null ? void 0 : s2.ok)) return s2;
|
|
1093
|
-
if (null === t2.data) return c({
|
|
1117
|
+
if (null === t2.data) return c({ snapshot: null });
|
|
1094
1118
|
const n2 = s2 == null ? void 0 : s2.value;
|
|
1095
|
-
return c({
|
|
1119
|
+
return c({ snapshot: { sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: t2.data.custom, createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: te(t2.data.content, {}), content: t2.data.content, referencedMessageId: t2.data.referencedMessageId } });
|
|
1096
1120
|
});
|
|
1097
1121
|
}
|
|
1098
1122
|
messageEdited(e2, t2) {
|
|
1099
1123
|
this.mutate(e2, (s2) => {
|
|
1100
1124
|
if (null === s2.value.data) return s2;
|
|
1101
|
-
return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt: P(s2.value.data.editedAt, t2.diff.editedAt), custom:
|
|
1125
|
+
return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt: P(s2.value.data.editedAt, t2.diff.editedAt), custom: _(s2.value.data.custom, t2.diff.custom), content: P(s2.value.data.content, t2.diff.content) } });
|
|
1102
1126
|
});
|
|
1103
1127
|
}
|
|
1104
1128
|
messageDeleted(e2, t2) {
|
|
@@ -1107,7 +1131,7 @@ class oe extends $ {
|
|
|
1107
1131
|
getFromCache() {
|
|
1108
1132
|
return __async(this, null, function* () {
|
|
1109
1133
|
var _b;
|
|
1110
|
-
const e2 = yield this.
|
|
1134
|
+
const e2 = yield this.mostRecentState.resultPromise;
|
|
1111
1135
|
if (!e2.ok) return l("NOT_IN_CACHE");
|
|
1112
1136
|
if (null === e2.value.data) {
|
|
1113
1137
|
return h({ status: 404, errorCode: "MESSAGE_NOT_FOUND", reasons: ["No message with that ID exists"] });
|
|
@@ -1117,9 +1141,9 @@ class oe extends $ {
|
|
|
1117
1141
|
});
|
|
1118
1142
|
}
|
|
1119
1143
|
}
|
|
1120
|
-
class
|
|
1121
|
-
constructor(e2, t2, s2
|
|
1122
|
-
super(
|
|
1144
|
+
class re extends W {
|
|
1145
|
+
constructor(e2, t2, s2) {
|
|
1146
|
+
super(), this.createdAt = e2, this.dataStore = t2, this.referencedDataStore = s2;
|
|
1123
1147
|
}
|
|
1124
1148
|
get messageId() {
|
|
1125
1149
|
return this.dataStore.messageId;
|
|
@@ -1137,26 +1161,32 @@ class ue extends $ {
|
|
|
1137
1161
|
}
|
|
1138
1162
|
teardownNested(e2) {
|
|
1139
1163
|
}
|
|
1164
|
+
anyChildChanged(_0, _1, _2) {
|
|
1165
|
+
return __async(this, arguments, function* (e2, t2, { dataStore: s2, referencedDataStore: n2 }) {
|
|
1166
|
+
if (true === (yield s2.changedBetween(e2, t2))) return true;
|
|
1167
|
+
return true === (yield n2 == null ? void 0 : n2.changedBetween(e2, t2));
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1140
1170
|
loadNested(e2, t2) {
|
|
1141
1171
|
return __async(this, null, function* () {
|
|
1142
|
-
var _a2, _b, _c
|
|
1172
|
+
var _a2, _b, _c;
|
|
1143
1173
|
const s2 = yield t2.dataStore.getDeep(e2);
|
|
1144
1174
|
if (!s2.ok) return s2;
|
|
1145
1175
|
const n2 = s2.value;
|
|
1146
|
-
if (null === n2.snapshot) return c({
|
|
1176
|
+
if (null === n2.snapshot) return c({ snapshot: null });
|
|
1147
1177
|
const r2 = yield (_a2 = t2.referencedDataStore) == null ? void 0 : _a2.getDeep(e2);
|
|
1148
1178
|
if (r2 && !r2.ok) return r2;
|
|
1149
1179
|
const i2 = (_b = r2 == null ? void 0 : r2.value) != null ? _b : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
|
|
1150
|
-
return c({
|
|
1180
|
+
return c({ snapshot: { id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: n2.snapshot.custom, createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: a2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content } });
|
|
1151
1181
|
});
|
|
1152
1182
|
}
|
|
1153
1183
|
}
|
|
1154
|
-
class
|
|
1155
|
-
constructor(e2, t2, s2, n2
|
|
1156
|
-
super(e2,
|
|
1184
|
+
class ie extends q {
|
|
1185
|
+
constructor(e2, t2, s2, n2) {
|
|
1186
|
+
super(e2, n2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1157
1187
|
}
|
|
1158
1188
|
listen(e2) {
|
|
1159
|
-
return this.onlyUsedInternally && this.
|
|
1189
|
+
return this.onlyUsedInternally && this.mostRecentState.resultPromise.then((e3) => {
|
|
1160
1190
|
if (e3.ok && null !== e3.value.inWindow) {
|
|
1161
1191
|
const t2 = 30 - e3.value.inWindow.length;
|
|
1162
1192
|
t2 > 0 && this._loadMoreMessages(t2);
|
|
@@ -1165,24 +1195,43 @@ class ce extends W {
|
|
|
1165
1195
|
}
|
|
1166
1196
|
fetchInitial(e2) {
|
|
1167
1197
|
return __async(this, null, function* () {
|
|
1168
|
-
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield
|
|
1169
|
-
return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) :
|
|
1198
|
+
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield ae({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
|
|
1199
|
+
return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) : oe({ seq: e2, messages: s2.value.messages, cursor: s2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : s2;
|
|
1170
1200
|
});
|
|
1171
1201
|
}
|
|
1172
1202
|
teardownNested(e2) {
|
|
1173
|
-
|
|
1203
|
+
ue(e2);
|
|
1204
|
+
}
|
|
1205
|
+
anyChildChanged(e2, t2, s2) {
|
|
1206
|
+
return __async(this, null, function* () {
|
|
1207
|
+
for (const n2 in s2.stores) {
|
|
1208
|
+
const r2 = s2.stores[n2];
|
|
1209
|
+
if (true === (yield r2 == null ? void 0 : r2.changedBetween(e2, t2))) return true;
|
|
1210
|
+
}
|
|
1211
|
+
return false;
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
lastMessageChangedBetween(e2, t2) {
|
|
1215
|
+
return __async(this, null, function* () {
|
|
1216
|
+
if (e2 >= t2) return false;
|
|
1217
|
+
const s2 = yield this.get(t2).resultPromise;
|
|
1218
|
+
if (!s2.ok) return false;
|
|
1219
|
+
if (s2.value.lastMessageChanged > e2) return true;
|
|
1220
|
+
if (null === s2.value.stores) return false;
|
|
1221
|
+
const n2 = s2.value.inWindow[0];
|
|
1222
|
+
if (void 0 === n2) return false;
|
|
1223
|
+
return true === (yield n2.changedBetween(e2, t2));
|
|
1224
|
+
});
|
|
1174
1225
|
}
|
|
1175
1226
|
equal(e2, t2) {
|
|
1176
|
-
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!
|
|
1227
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!O(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!O(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && O(e2.windowEnd, t2.windowEnd)));
|
|
1177
1228
|
}
|
|
1178
1229
|
loadNested(e2, t2) {
|
|
1179
1230
|
return __async(this, null, function* () {
|
|
1180
|
-
|
|
1181
|
-
if (null === t2.stores) return c({ snapshot: null, loadedAll: true, lastChanged: t2.lastChanged, lastMessageChanged: t2.lastMessageChanged });
|
|
1231
|
+
if (null === t2.stores) return c({ snapshot: null, loadedAll: true });
|
|
1182
1232
|
const s2 = yield Promise.all(t2.inWindow.map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1183
1233
|
if (n2) return n2;
|
|
1184
|
-
|
|
1185
|
-
return c({ snapshot: i2, loadedAll: null === t2.windowEnd, lastChanged: a2, lastMessageChanged: u2 });
|
|
1234
|
+
return c({ snapshot: s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot), loadedAll: null === t2.windowEnd });
|
|
1186
1235
|
});
|
|
1187
1236
|
}
|
|
1188
1237
|
loadMore(e2) {
|
|
@@ -1194,11 +1243,11 @@ class ce extends W {
|
|
|
1194
1243
|
}
|
|
1195
1244
|
_loadMoreMessages(e2 = 30) {
|
|
1196
1245
|
return __async(this, null, function* () {
|
|
1197
|
-
const t2 = yield this.
|
|
1246
|
+
const t2 = yield this.mostRecentState.resultPromise;
|
|
1198
1247
|
if (!t2.ok) return;
|
|
1199
1248
|
if (null === t2.value.windowEnd) return;
|
|
1200
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1201
|
-
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), e3) :
|
|
1249
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield ae({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient }), r2 = this.mostRecentState.seq + 1e-6;
|
|
1250
|
+
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), e3) : oe({ seq: r2, prevState: e3.value, messages: n2.value.messages, cursor: n2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : n2), yield this.emitMutex.runExclusive(() => this.emit(r2));
|
|
1202
1251
|
});
|
|
1203
1252
|
}
|
|
1204
1253
|
messageCreated(e2, t2) {
|
|
@@ -1206,12 +1255,12 @@ class ce extends W {
|
|
|
1206
1255
|
if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."), s2;
|
|
1207
1256
|
if (s2.value.windowEnd && t2.state.createdAt < s2.value.windowEnd.oldestMessageTs) return s2;
|
|
1208
1257
|
if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
|
|
1209
|
-
const n2 = __spreadValues({}, s2.value.stores), r2 = new
|
|
1258
|
+
const n2 = __spreadValues({}, s2.value.stores), r2 = new ne(this.conversationId, t2.state, this.realtimeClient);
|
|
1210
1259
|
n2[t2.state.id] = r2;
|
|
1211
1260
|
const i2 = t2.state.referencedMessageId;
|
|
1212
1261
|
let a2;
|
|
1213
|
-
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new
|
|
1214
|
-
const o2 = new
|
|
1262
|
+
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new ne(this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
|
|
1263
|
+
const o2 = new re(t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
|
|
1215
1264
|
u2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1216
1265
|
const l2 = u2[0].messageId === t2.messageId ? e2 : s2.value.lastMessageChanged;
|
|
1217
1266
|
return c({ lastChanged: e2, lastMessageChanged: l2, stores: n2, inWindow: u2, windowEnd: s2.value.windowEnd });
|
|
@@ -1231,13 +1280,13 @@ class ce extends W {
|
|
|
1231
1280
|
delete n2[t2.messageId];
|
|
1232
1281
|
const r2 = s2.value.inWindow.filter((e3) => e3.messageId !== t2.messageId);
|
|
1233
1282
|
if (t2.newLastMessage && 0 === r2.length) {
|
|
1234
|
-
const
|
|
1235
|
-
n2[
|
|
1236
|
-
const
|
|
1237
|
-
let
|
|
1238
|
-
null ===
|
|
1239
|
-
const
|
|
1240
|
-
r2.push(
|
|
1283
|
+
const e3 = new ne(this.conversationId, t2.newLastMessage, this.realtimeClient);
|
|
1284
|
+
n2[e3.messageId] = e3;
|
|
1285
|
+
const s3 = t2.newLastMessage.referencedMessageId;
|
|
1286
|
+
let i3;
|
|
1287
|
+
null === s3 ? i3 = null : s3 in n2 ? i3 = n2[s3] : (i3 = new ne(this.conversationId, s3, this.realtimeClient), n2[s3] = i3);
|
|
1288
|
+
const a2 = new re(t2.newLastMessage.createdAt, e3, i3);
|
|
1289
|
+
r2.push(a2);
|
|
1241
1290
|
}
|
|
1242
1291
|
const i2 = void 0 !== t2.newLastMessage ? e2 : s2.value.lastMessageChanged;
|
|
1243
1292
|
return c({ lastChanged: e2, lastMessageChanged: i2, stores: n2, inWindow: r2, windowEnd: s2.value.windowEnd });
|
|
@@ -1246,21 +1295,21 @@ class ce extends W {
|
|
|
1246
1295
|
conversationCleared(e2, t2) {
|
|
1247
1296
|
this.mutate(e2, (t3) => {
|
|
1248
1297
|
var _a2;
|
|
1249
|
-
return 0 === ((_a2 = t3.value.inWindow) == null ? void 0 : _a2.length) && null === t3.value.windowEnd ? t3 : (
|
|
1298
|
+
return 0 === ((_a2 = t3.value.inWindow) == null ? void 0 : _a2.length) && null === t3.value.windowEnd ? t3 : (ue(t3.value), c({ lastChanged: e2, lastMessageChanged: e2, stores: {}, inWindow: [], windowEnd: null }));
|
|
1250
1299
|
});
|
|
1251
1300
|
}
|
|
1252
1301
|
sideCreated(e2, t2) {
|
|
1253
1302
|
const s2 = this.fetchInitial(e2);
|
|
1254
1303
|
this.mutate(e2, (e3) => null !== e3.value.stores ? (s2.then((e4) => {
|
|
1255
|
-
e4.ok &&
|
|
1304
|
+
e4.ok && ue(e4.value);
|
|
1256
1305
|
}), e3) : s2);
|
|
1257
1306
|
}
|
|
1258
1307
|
sideDeleted(e2, t2) {
|
|
1259
|
-
this.mutate(e2, (t3) => null === t3.value.stores ? t3 : (
|
|
1308
|
+
this.mutate(e2, (t3) => null === t3.value.stores ? t3 : (ue(t3.value), c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null })));
|
|
1260
1309
|
}
|
|
1261
1310
|
getMessageFromCache(e2) {
|
|
1262
1311
|
return __async(this, null, function* () {
|
|
1263
|
-
const t2 = yield this.
|
|
1312
|
+
const t2 = yield this.mostRecentState.resultPromise;
|
|
1264
1313
|
if (!t2.ok) return l("NOT_IN_CACHE");
|
|
1265
1314
|
if (null === t2.value.stores) return l("NOT_IN_CACHE");
|
|
1266
1315
|
const s2 = t2.value.stores[e2];
|
|
@@ -1268,7 +1317,7 @@ class ce extends W {
|
|
|
1268
1317
|
});
|
|
1269
1318
|
}
|
|
1270
1319
|
}
|
|
1271
|
-
function
|
|
1320
|
+
function ae(_0) {
|
|
1272
1321
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1273
1322
|
const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "messages"], r2, { bypassCache: true });
|
|
1274
1323
|
if (i2.ok) {
|
|
@@ -1278,36 +1327,36 @@ function le(_0) {
|
|
|
1278
1327
|
return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 : c({ messages: null, nextCursor: null });
|
|
1279
1328
|
});
|
|
1280
1329
|
}
|
|
1281
|
-
function
|
|
1330
|
+
function oe({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
|
|
1282
1331
|
var _a2, _b, _c, _d;
|
|
1283
1332
|
const a2 = t2 ? __spreadValues({}, t2.stores) : {};
|
|
1284
|
-
for (const
|
|
1285
|
-
const
|
|
1286
|
-
a2[
|
|
1287
|
-
}
|
|
1288
|
-
for (const
|
|
1289
|
-
const
|
|
1290
|
-
if (
|
|
1291
|
-
const
|
|
1292
|
-
a2[
|
|
1333
|
+
for (const e3 of s2) if (void 0 === a2[e3.id]) {
|
|
1334
|
+
const t3 = new ne(r2, e3, i2);
|
|
1335
|
+
a2[t3.messageId] = t3;
|
|
1336
|
+
}
|
|
1337
|
+
for (const e3 of s2) {
|
|
1338
|
+
const t3 = e3.referencedMessageId;
|
|
1339
|
+
if (t3 && void 0 === a2[t3]) {
|
|
1340
|
+
const e4 = new ne(r2, t3, i2);
|
|
1341
|
+
a2[e4.messageId] = e4;
|
|
1293
1342
|
}
|
|
1294
1343
|
}
|
|
1295
1344
|
const o2 = t2 ? [...t2.inWindow] : [];
|
|
1296
|
-
for (const
|
|
1345
|
+
for (const e3 of s2) o2.push(new re(e3.createdAt, a2[e3.id], e3.referencedMessageId ? a2[e3.referencedMessageId] : null));
|
|
1297
1346
|
o2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1298
1347
|
const u2 = (_b = (_a2 = t2 == null ? void 0 : t2.inWindow) == null ? void 0 : _a2[0]) == null ? void 0 : _b.messageId, l2 = (_c = o2 == null ? void 0 : o2[0]) == null ? void 0 : _c.messageId, h2 = u2 === l2 ? (_d = t2 == null ? void 0 : t2.lastMessageChanged) != null ? _d : e2 : e2;
|
|
1299
1348
|
if (null === n2) return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: null });
|
|
1300
1349
|
return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: { cursor: n2, oldestMessageTs: s2[s2.length - 1].createdAt } });
|
|
1301
1350
|
}
|
|
1302
|
-
function
|
|
1351
|
+
function ue(e2) {
|
|
1303
1352
|
if (e2.stores) {
|
|
1304
1353
|
const t2 = l("TERMINATED");
|
|
1305
1354
|
Object.values(e2.stores).forEach((e3) => e3.setError(t2)), e2.inWindow.forEach((e3) => e3.setError(t2));
|
|
1306
1355
|
}
|
|
1307
1356
|
}
|
|
1308
|
-
class
|
|
1309
|
-
constructor(e2, t2, s2, n2
|
|
1310
|
-
super(e2,
|
|
1357
|
+
class ce extends q {
|
|
1358
|
+
constructor(e2, t2, s2, n2) {
|
|
1359
|
+
super(e2, n2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 5e3;
|
|
1311
1360
|
}
|
|
1312
1361
|
fetchInitial(e2) {
|
|
1313
1362
|
return __async(this, null, function* () {
|
|
@@ -1326,27 +1375,32 @@ class pe extends W {
|
|
|
1326
1375
|
var _a2;
|
|
1327
1376
|
(_a2 = e2.messageWindowStore) == null ? void 0 : _a2.unsubscribe();
|
|
1328
1377
|
}
|
|
1378
|
+
anyChildChanged(e2, t2, s2) {
|
|
1379
|
+
return __async(this, null, function* () {
|
|
1380
|
+
return true === (yield s2.messageWindowStore.store.lastMessageChangedBetween(e2, t2));
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1329
1383
|
equal(e2, t2) {
|
|
1330
|
-
return
|
|
1384
|
+
return O(e2.snapshot, t2.snapshot);
|
|
1331
1385
|
}
|
|
1332
1386
|
loadNested(e2, t2) {
|
|
1333
1387
|
return __async(this, null, function* () {
|
|
1334
1388
|
var _a2;
|
|
1335
|
-
if (!t2.snapshot) return c({
|
|
1389
|
+
if (!t2.snapshot) return c({ snapshot: null, loadedAll: true });
|
|
1336
1390
|
const s2 = yield t2.messageWindowStore.store.getDeep(e2);
|
|
1337
1391
|
if (!s2.ok) return s2;
|
|
1338
1392
|
const n2 = s2.value.snapshot, r2 = (_a2 = n2 == null ? void 0 : n2[0]) != null ? _a2 : null;
|
|
1339
|
-
return c({
|
|
1393
|
+
return c({ snapshot: __spreadProps(__spreadValues({}, t2.snapshot), { lastMessage: r2 }) });
|
|
1340
1394
|
});
|
|
1341
1395
|
}
|
|
1342
1396
|
participantEdited(e2, t2) {
|
|
1343
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1397
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: le(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1344
1398
|
}
|
|
1345
1399
|
conversationEdited(e2, t2) {
|
|
1346
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1400
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: le(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1347
1401
|
}
|
|
1348
1402
|
sideEdited(e2, t2) {
|
|
1349
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1403
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: le(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1350
1404
|
}
|
|
1351
1405
|
sideCreated(e2, t2) {
|
|
1352
1406
|
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindowStore: s2.value.messageWindowStore }));
|
|
@@ -1356,18 +1410,99 @@ class pe extends W {
|
|
|
1356
1410
|
}
|
|
1357
1411
|
getFromCache() {
|
|
1358
1412
|
return __async(this, null, function* () {
|
|
1359
|
-
const e2 = yield this.
|
|
1413
|
+
const e2 = yield this.mostRecentState.resultPromise;
|
|
1360
1414
|
return e2.ok && e2.value.snapshot ? c({ status: 200, data: e2.value.snapshot }) : l("NOT_IN_CACHE");
|
|
1361
1415
|
});
|
|
1362
1416
|
}
|
|
1363
1417
|
}
|
|
1364
|
-
function
|
|
1418
|
+
function le(e2, t2) {
|
|
1365
1419
|
const s2 = t2;
|
|
1366
|
-
return { id: e2.id, createdAt: e2.createdAt, subject: P(e2.subject, s2.subject), photoUrl: P(e2.photoUrl, s2.photoUrl), welcomeMessages: P(e2.welcomeMessages, s2.welcomeMessages), custom:
|
|
1420
|
+
return { id: e2.id, createdAt: e2.createdAt, subject: P(e2.subject, s2.subject), photoUrl: P(e2.photoUrl, s2.photoUrl), welcomeMessages: P(e2.welcomeMessages, s2.welcomeMessages), custom: _(e2.custom, s2.custom), lastMessageAt: P(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: P(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: P(e2.isUnread, s2.isUnread), access: P(e2.access, s2.access), notify: P(e2.notify, s2.notify), readUntil: P(e2.readUntil, s2.readUntil), everyoneReadUntil: P(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
|
|
1367
1421
|
}
|
|
1368
|
-
|
|
1422
|
+
function he(e2, t2) {
|
|
1423
|
+
for (let s2 in e2) Object.prototype.hasOwnProperty.call(e2, s2) && t2(e2[s2], s2);
|
|
1424
|
+
}
|
|
1425
|
+
function de(e2, t2) {
|
|
1426
|
+
return function(e3, t3) {
|
|
1427
|
+
let s2 = {}, n2 = 0;
|
|
1428
|
+
return he(e3, (e4, r2) => {
|
|
1429
|
+
const [i2, a2] = t3([r2, e4], n2++);
|
|
1430
|
+
s2[i2] = a2;
|
|
1431
|
+
}), s2;
|
|
1432
|
+
}(e2, ([e3, s2]) => [e3, t2(s2, e3)]);
|
|
1433
|
+
}
|
|
1434
|
+
class pe extends q {
|
|
1435
|
+
constructor(e2, t2, s2, n2) {
|
|
1436
|
+
super(s2, n2), this.conversationId = e2, this.realtimeClient = t2, this.unsubscribeDebounceMs = 1e4;
|
|
1437
|
+
}
|
|
1438
|
+
fetchInitial(e2) {
|
|
1439
|
+
return __async(this, null, function* () {
|
|
1440
|
+
const t2 = yield this.realtimeClient.call("GET", ["me", "conversations", this.conversationId, "typing"], {}, { bypassCache: true });
|
|
1441
|
+
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c({ data: null, lastChanged: e2 });
|
|
1442
|
+
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return c({ data: null, lastChanged: e2 });
|
|
1443
|
+
if (!t2.ok) return t2;
|
|
1444
|
+
const s2 = t2.value.data;
|
|
1445
|
+
if (s2.many) return c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1446
|
+
return c({ data: s2, userSubscriptions: de(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
equal(e2, t2) {
|
|
1450
|
+
return O(e2.data, t2.data);
|
|
1451
|
+
}
|
|
1452
|
+
loadNested(e2, t2) {
|
|
1453
|
+
return __async(this, null, function* () {
|
|
1454
|
+
if (null === t2.data) return c({ snapshot: null, lastChanged: t2.lastChanged });
|
|
1455
|
+
if (t2.data.many) return c({ snapshot: { many: true }, lastChanged: t2.lastChanged });
|
|
1456
|
+
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), r2 = n2.find((e3) => !e3.ok);
|
|
1457
|
+
if (r2) return r2;
|
|
1458
|
+
const i2 = n2.map((e3) => e3.value), a2 = i2.map((e3) => e3.snapshot), o2 = i2.map((e3) => e3.lastChanged);
|
|
1459
|
+
return c({ snapshot: { users: a2, many: false }, lastChanged: Math.max(t2.lastChanged, ...o2) });
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
typingAvailable(e2, t2) {
|
|
1463
|
+
this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : de(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
|
|
1464
|
+
}
|
|
1465
|
+
typingChanged(e2, t2) {
|
|
1466
|
+
this.mutate(e2, (s2) => {
|
|
1467
|
+
if (null === s2.value.data) return s2;
|
|
1468
|
+
if (void 0 === t2.diff.many) {
|
|
1469
|
+
if (true === s2.value.data.many) return s2;
|
|
1470
|
+
const n2 = __spreadValues({}, s2.value.data.usersTyping), r2 = __spreadValues({}, s2.value.userSubscriptions);
|
|
1471
|
+
return he(t2.diff.usersTyping, (e3, t3) => {
|
|
1472
|
+
var _a2;
|
|
1473
|
+
"number" == typeof e3 ? (n2[t3] = e3, r2[t3] = this.realtimeClient.internalSubscribe(["users", t3])) : null === e3 && (delete n2[t3], (_a2 = r2[t3]) == null ? void 0 : _a2.unsubscribe(), delete r2[t3]);
|
|
1474
|
+
}), c({ data: { usersTyping: n2, many: false }, userSubscriptions: r2, lastChanged: e2 });
|
|
1475
|
+
}
|
|
1476
|
+
if (true === t2.diff.many) return s2.value.data.many ? s2 : c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1477
|
+
if (false === t2.diff.many) {
|
|
1478
|
+
if (false === s2.value.data.many) return s2;
|
|
1479
|
+
const n2 = de(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
|
|
1480
|
+
return c({ data: t2.diff, userSubscriptions: n2, lastChanged: e2 });
|
|
1481
|
+
}
|
|
1482
|
+
throw t2.diff, "Unreachable";
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
sideDeleted(e2, t2) {
|
|
1486
|
+
this.mutate(e2, (t3) => null === t3.value.data ? t3 : c({ data: null, lastChanged: e2 }));
|
|
1487
|
+
}
|
|
1488
|
+
teardownNested(e2) {
|
|
1489
|
+
e2.data && he(e2.userSubscriptions, (e3) => e3.unsubscribe());
|
|
1490
|
+
}
|
|
1491
|
+
anyChildChanged(e2, t2, s2) {
|
|
1492
|
+
return __async(this, null, function* () {
|
|
1493
|
+
var _a2;
|
|
1494
|
+
if (null === s2.data) return false;
|
|
1495
|
+
for (const n2 in s2.userSubscriptions) {
|
|
1496
|
+
const r2 = s2.userSubscriptions[n2];
|
|
1497
|
+
if (true === (yield (_a2 = r2 == null ? void 0 : r2.store) == null ? void 0 : _a2.changedBetween(e2, t2))) return true;
|
|
1498
|
+
}
|
|
1499
|
+
return false;
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
class fe {
|
|
1369
1504
|
constructor(e2, t2, s2) {
|
|
1370
|
-
this.realtimeClient = s2, this.userStores = {}, this.messageWindowStores = {}, this.conversationStores = {}, this.emitMutex = new
|
|
1505
|
+
this.realtimeClient = s2, this.userStores = {}, this.messageWindowStores = {}, this.conversationStores = {}, this.typingStores = {}, this.emitMutex = new U(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new N(e2, t2, { onUpstreamRestarting: () => {
|
|
1371
1506
|
this.refetchOnNextNetworkLoss = false;
|
|
1372
1507
|
}, onReady: () => {
|
|
1373
1508
|
this.refetchOnNextNetworkLoss = true;
|
|
@@ -1394,10 +1529,11 @@ class ge {
|
|
|
1394
1529
|
for (const t2 of Object.values(this.userStores)) t2.refetch(e2);
|
|
1395
1530
|
for (const t2 of Object.values(this.messageWindowStores)) t2.refetch(e2);
|
|
1396
1531
|
for (const t2 of Object.values(this.conversationStores)) t2.refetch(e2);
|
|
1532
|
+
for (const t2 of Object.values(this.typingStores)) t2.refetch(e2);
|
|
1397
1533
|
}
|
|
1398
1534
|
emitAll(e2) {
|
|
1399
1535
|
return this.emitMutex.runExclusive(() => __async(this, null, function* () {
|
|
1400
|
-
yield Promise.all([...Object.values(this.userStores).map((t2) => t2.emit(e2)), ...Object.values(this.messageWindowStores).map((t2) => t2.emit(e2)), ...Object.values(this.conversationStores).map((t2) => t2.emit(e2))]);
|
|
1536
|
+
yield Promise.all([...Object.values(this.userStores).map((t2) => t2.emit(e2)), ...Object.values(this.messageWindowStores).map((t2) => t2.emit(e2)), ...Object.values(this.conversationStores).map((t2) => t2.emit(e2)), ...Object.values(this.typingStores).map((t2) => t2.emit(e2))]);
|
|
1401
1537
|
}));
|
|
1402
1538
|
}
|
|
1403
1539
|
handlePublish(e2, t2) {
|
|
@@ -1422,11 +1558,22 @@ class ge {
|
|
|
1422
1558
|
return this.handleMessageEdited(e2, t2);
|
|
1423
1559
|
case "message.deleted":
|
|
1424
1560
|
return this.handleMessageDeleted(e2, t2);
|
|
1425
|
-
case "
|
|
1561
|
+
case "typing.available":
|
|
1562
|
+
return this.handleTypingAvailable(e2, t2);
|
|
1563
|
+
case "typing.changed":
|
|
1564
|
+
return this.handleTypingChanged(e2, t2);
|
|
1426
1565
|
case "conversation.cleared":
|
|
1427
1566
|
return this.handleConversationCleared(e2, t2);
|
|
1428
1567
|
}
|
|
1429
1568
|
}
|
|
1569
|
+
handleTypingAvailable(e2, t2) {
|
|
1570
|
+
const s2 = this.typingStores[t2.conversationId];
|
|
1571
|
+
s2 && s2.typingAvailable(e2, t2);
|
|
1572
|
+
}
|
|
1573
|
+
handleTypingChanged(e2, t2) {
|
|
1574
|
+
const s2 = this.typingStores[t2.conversationId];
|
|
1575
|
+
s2 && s2.typingChanged(e2, t2);
|
|
1576
|
+
}
|
|
1430
1577
|
handleUserCreated(e2, t2) {
|
|
1431
1578
|
const s2 = this.userStores[t2.userId];
|
|
1432
1579
|
s2 && s2.userCreated(e2, t2);
|
|
@@ -1458,6 +1605,8 @@ class ge {
|
|
|
1458
1605
|
s2 && s2.sideDeleted(e2, t2);
|
|
1459
1606
|
const n2 = this.conversationStores[t2.conversationId];
|
|
1460
1607
|
n2 && n2.sideDeleted(e2, t2);
|
|
1608
|
+
const r2 = this.typingStores[t2.conversationId];
|
|
1609
|
+
r2 && r2.sideDeleted(e2, t2);
|
|
1461
1610
|
}
|
|
1462
1611
|
handleMessageCreated(e2, t2) {
|
|
1463
1612
|
const s2 = this.messageWindowStores[t2.conversationId];
|
|
@@ -1535,13 +1684,13 @@ class ge {
|
|
|
1535
1684
|
const t2 = e2[1];
|
|
1536
1685
|
if (Object.hasOwnProperty.call(this.userStores, t2)) return this.userStores[t2];
|
|
1537
1686
|
{
|
|
1538
|
-
this.connection.subscribe(["users", t2]).then((
|
|
1539
|
-
|
|
1687
|
+
this.connection.subscribe(["users", t2]).then((t3) => {
|
|
1688
|
+
t3.ok || e3.setError(t3);
|
|
1540
1689
|
});
|
|
1541
|
-
const e3 =
|
|
1690
|
+
const e3 = new G(t2, this.realtimeClient, this.emitMutex, () => {
|
|
1542
1691
|
delete this.userStores[t2], this.connection.unsubscribe(["users", t2]);
|
|
1543
1692
|
});
|
|
1544
|
-
return this.userStores[t2] =
|
|
1693
|
+
return this.userStores[t2] = e3, e3;
|
|
1545
1694
|
}
|
|
1546
1695
|
}
|
|
1547
1696
|
if (s(e2, ["me", "conversations", "*"])) {
|
|
@@ -1551,7 +1700,7 @@ class ge {
|
|
|
1551
1700
|
this.connection.subscribe(["me", "conversations", t2]).then((t3) => {
|
|
1552
1701
|
t3.ok || e3.setError(t3);
|
|
1553
1702
|
});
|
|
1554
|
-
const e3 = new
|
|
1703
|
+
const e3 = new ce(this.emitMutex, t2, this.realtimeClient, () => {
|
|
1555
1704
|
delete this.conversationStores[t2], this.connection.unsubscribe(["me", "conversations", t2]);
|
|
1556
1705
|
});
|
|
1557
1706
|
return this.conversationStores[t2] = e3, e3;
|
|
@@ -1564,16 +1713,29 @@ class ge {
|
|
|
1564
1713
|
this.connection.subscribe(["me", "conversations", t2, "messages"]).then((t3) => {
|
|
1565
1714
|
t3.ok || e3.setError(t3);
|
|
1566
1715
|
});
|
|
1567
|
-
const e3 = new
|
|
1716
|
+
const e3 = new ie(this.emitMutex, t2, this.realtimeClient, () => {
|
|
1568
1717
|
delete this.messageWindowStores[t2], this.connection.unsubscribe(["me", "conversations", t2, "messages"]);
|
|
1569
1718
|
});
|
|
1570
1719
|
return this.messageWindowStores[t2] = e3, e3;
|
|
1571
1720
|
}
|
|
1572
1721
|
}
|
|
1722
|
+
if (s(e2, ["me", "conversations", "*", "typing"])) {
|
|
1723
|
+
const t2 = e2[2];
|
|
1724
|
+
if (Object.hasOwnProperty.call(this.typingStores, t2)) return this.typingStores[t2];
|
|
1725
|
+
{
|
|
1726
|
+
this.connection.subscribe(["me", "conversations", t2, "typing"]).then((t3) => {
|
|
1727
|
+
t3.ok || e3.setError(t3);
|
|
1728
|
+
});
|
|
1729
|
+
const e3 = new pe(t2, this.realtimeClient, this.emitMutex, () => {
|
|
1730
|
+
delete this.typingStores[t2], this.connection.unsubscribe(["me", "conversations", t2, "typing"]);
|
|
1731
|
+
});
|
|
1732
|
+
return this.typingStores[t2] = e3, e3;
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1573
1735
|
throw new Error("Unrecognised subscribe path: " + e2);
|
|
1574
1736
|
}
|
|
1575
1737
|
getStoreIfExists(e2) {
|
|
1576
|
-
var _a2, _b;
|
|
1738
|
+
var _a2, _b, _c;
|
|
1577
1739
|
if (s(e2, ["users", "*"])) {
|
|
1578
1740
|
const t2 = e2[1];
|
|
1579
1741
|
return (_a2 = this.userStores[t2]) != null ? _a2 : null;
|
|
@@ -1582,6 +1744,10 @@ class ge {
|
|
|
1582
1744
|
const t2 = e2[2];
|
|
1583
1745
|
return (_b = this.messageWindowStores[t2]) != null ? _b : null;
|
|
1584
1746
|
}
|
|
1747
|
+
if (s(e2, ["me", "conversations", "*", "typing"])) {
|
|
1748
|
+
const t2 = e2[2];
|
|
1749
|
+
return (_c = this.typingStores[t2]) != null ? _c : null;
|
|
1750
|
+
}
|
|
1585
1751
|
throw new Error("Unrecognised subscribe path: " + e2);
|
|
1586
1752
|
}
|
|
1587
1753
|
destroy() {
|
|
@@ -1591,9 +1757,9 @@ class ge {
|
|
|
1591
1757
|
return this.connection.isConnected();
|
|
1592
1758
|
}
|
|
1593
1759
|
}
|
|
1594
|
-
class
|
|
1760
|
+
class ge {
|
|
1595
1761
|
constructor(e2, t2, s2) {
|
|
1596
|
-
this.userId = t2, this.alive = true, this.connection = new
|
|
1762
|
+
this.userId = t2, this.alive = true, this.connection = new fe(e2, s2, this), s2.onTokenRefreshFailed(() => {
|
|
1597
1763
|
this.destroy();
|
|
1598
1764
|
});
|
|
1599
1765
|
}
|
|
@@ -1618,14 +1784,14 @@ class me {
|
|
|
1618
1784
|
listMessages(e2, t2) {
|
|
1619
1785
|
return __async(this, null, function* () {
|
|
1620
1786
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
|
|
1621
|
-
if (!s2.ok) return
|
|
1787
|
+
if (!s2.ok) return me(s2, "Listing messages in " + e2);
|
|
1622
1788
|
const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.createMessageSnapshot(t3, e2))), i2 = r2.find((e3) => !e3.ok);
|
|
1623
1789
|
if (void 0 !== i2 && !i2.ok) return i2;
|
|
1624
1790
|
return c(r2.map(({ value: e3 }) => e3));
|
|
1625
1791
|
});
|
|
1626
1792
|
}
|
|
1627
1793
|
createConversationSnapshotPreloaded(e2, t2) {
|
|
1628
|
-
return { id: e2.id, subject: e2.subject, photoUrl: e2.photoUrl, welcomeMessages: e2.welcomeMessages, custom: e2.custom, createdAt: e2.createdAt, joinedAt: e2.joinedAt, lastMessageAt: e2.lastMessageAt, unreadMessageCount: e2.unreadMessageCount, isUnread: e2.isUnread, access: e2.access, notify: e2.notify, lastMessage: t2, readUntil: e2.readUntil };
|
|
1794
|
+
return { id: e2.id, subject: e2.subject, photoUrl: e2.photoUrl, welcomeMessages: e2.welcomeMessages, custom: e2.custom, createdAt: e2.createdAt, joinedAt: e2.joinedAt, lastMessageAt: e2.lastMessageAt, unreadMessageCount: e2.unreadMessageCount, isUnread: e2.isUnread, access: e2.access, notify: e2.notify, lastMessage: t2, readUntil: e2.readUntil, everyoneReadUntil: e2.everyoneReadUntil };
|
|
1629
1795
|
}
|
|
1630
1796
|
createUserSnapshot(e2) {
|
|
1631
1797
|
return { id: e2.id, name: e2.name, custom: e2.custom, locale: e2.locale, photoUrl: e2.photoUrl, role: e2.role, welcomeMessage: e2.welcomeMessage };
|
|
@@ -1647,7 +1813,7 @@ class me {
|
|
|
1647
1813
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
|
|
1648
1814
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
|
|
1649
1815
|
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
|
|
1650
|
-
if (!s2.ok) return
|
|
1816
|
+
if (!s2.ok) return me(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
|
|
1651
1817
|
const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
|
|
1652
1818
|
if (!r2.ok) return r2;
|
|
1653
1819
|
const i2 = r2.value;
|
|
@@ -1658,26 +1824,26 @@ class me {
|
|
|
1658
1824
|
return __async(this, null, function* () {
|
|
1659
1825
|
const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
|
|
1660
1826
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
|
|
1661
|
-
if (!t2.ok) return
|
|
1827
|
+
if (!t2.ok) return me(t2, "Get user " + e2);
|
|
1662
1828
|
return c(this.createUserSnapshot(t2.value.data));
|
|
1663
1829
|
});
|
|
1664
1830
|
}
|
|
1665
1831
|
createMessageSnapshotPreloaded(e2, t2, s2) {
|
|
1666
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext:
|
|
1832
|
+
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext: te(e2.content, {}) };
|
|
1667
1833
|
}
|
|
1668
1834
|
createReferencedMessageSnapshotPreloaded(e2, t2) {
|
|
1669
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext:
|
|
1835
|
+
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext: te(e2.content, {}) };
|
|
1670
1836
|
}
|
|
1671
1837
|
}
|
|
1672
|
-
function
|
|
1838
|
+
function me(e2, t2) {
|
|
1673
1839
|
return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
|
|
1674
1840
|
}
|
|
1675
|
-
function
|
|
1841
|
+
function ve(e2, s2) {
|
|
1676
1842
|
var _a2;
|
|
1677
1843
|
if (s2.ok) return s2.value;
|
|
1678
1844
|
throw "SESSION_DESTROYED" === s2.value ? new Error(`${e2} failed because the session was destroyed`) : new Error(t((_a2 = s2.value.operation) != null ? _a2 : e2, s2.value));
|
|
1679
1845
|
}
|
|
1680
|
-
class
|
|
1846
|
+
class be {
|
|
1681
1847
|
constructor(e2, t2) {
|
|
1682
1848
|
this.id = e2, this._realtimeClient = t2;
|
|
1683
1849
|
}
|
|
@@ -1687,7 +1853,7 @@ class we {
|
|
|
1687
1853
|
get() {
|
|
1688
1854
|
return __async(this, null, function* () {
|
|
1689
1855
|
const e2 = yield this._realtimeClient.getUser(this.brandedId);
|
|
1690
|
-
return
|
|
1856
|
+
return ve("Get user " + this.id, e2);
|
|
1691
1857
|
});
|
|
1692
1858
|
}
|
|
1693
1859
|
set(t2) {
|
|
@@ -1752,7 +1918,7 @@ class ye {
|
|
|
1752
1918
|
});
|
|
1753
1919
|
}
|
|
1754
1920
|
}
|
|
1755
|
-
function
|
|
1921
|
+
function we(e2) {
|
|
1756
1922
|
const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
1757
1923
|
let s2 = 0;
|
|
1758
1924
|
const n2 = [], r2 = e2 === s2;
|
|
@@ -1770,7 +1936,7 @@ function Ae(e2) {
|
|
|
1770
1936
|
if (20 != a2.length) throw new Error("Length should be 20.");
|
|
1771
1937
|
return a2;
|
|
1772
1938
|
}
|
|
1773
|
-
const
|
|
1939
|
+
const Ae = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
1774
1940
|
return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
|
|
1775
1941
|
}(e2, (e3) => {
|
|
1776
1942
|
if ("string" == typeof e3) return t2(e3, s2);
|
|
@@ -1783,14 +1949,14 @@ const Ce = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
1783
1949
|
case "bulletList":
|
|
1784
1950
|
case "bulletpoint":
|
|
1785
1951
|
case "bulletPoint":
|
|
1786
|
-
return [{ type: e3.type, children:
|
|
1952
|
+
return [{ type: e3.type, children: Ae(e3.children, t2, e3.type) }];
|
|
1787
1953
|
case "link":
|
|
1788
|
-
return [{ type: e3.type, url: e3.url, children:
|
|
1954
|
+
return [{ type: e3.type, url: e3.url, children: Ae(e3.children, t2, e3.type) }];
|
|
1789
1955
|
case "actionlink":
|
|
1790
1956
|
case "actionLink":
|
|
1791
1957
|
case "actionbutton":
|
|
1792
1958
|
case "actionButton":
|
|
1793
|
-
return [{ type: e3.type, action: e3.action, params: e3.params, children:
|
|
1959
|
+
return [{ type: e3.type, action: e3.action, params: e3.params, children: Ae(e3.children, t2, e3.type) }];
|
|
1794
1960
|
case "mention":
|
|
1795
1961
|
case "autolink":
|
|
1796
1962
|
case "autoLink":
|
|
@@ -1805,12 +1971,12 @@ const Ce = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
1805
1971
|
return [e3];
|
|
1806
1972
|
}
|
|
1807
1973
|
});
|
|
1808
|
-
function
|
|
1974
|
+
function Ce(e2, t2) {
|
|
1809
1975
|
return (s2) => {
|
|
1810
1976
|
const n2 = s2;
|
|
1811
1977
|
let r2 = 0;
|
|
1812
1978
|
const i2 = [];
|
|
1813
|
-
for (const a2 of
|
|
1979
|
+
for (const a2 of J(s2, e2)) {
|
|
1814
1980
|
a2.index - r2 > 0 && i2.push(n2.substring(r2, a2.index));
|
|
1815
1981
|
const e3 = t2(a2);
|
|
1816
1982
|
Array.isArray(e3) ? i2.push(...e3) : i2.push(e3), r2 = a2.index + a2[0].length;
|
|
@@ -1818,29 +1984,29 @@ function Ee(e2, t2) {
|
|
|
1818
1984
|
return r2 < s2.length && i2.push(s2.substring(r2)), i2;
|
|
1819
1985
|
};
|
|
1820
1986
|
}
|
|
1821
|
-
const
|
|
1822
|
-
var
|
|
1823
|
-
const
|
|
1987
|
+
const Ee = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1988
|
+
var ke = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(ke || {});
|
|
1989
|
+
const xe = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
|
|
1824
1990
|
const t2 = [];
|
|
1825
1991
|
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");
|
|
1826
|
-
}),
|
|
1827
|
-
function
|
|
1828
|
-
return
|
|
1992
|
+
}), Se = { _: 1, "*": 4, "~": 2 };
|
|
1993
|
+
function Te(e2) {
|
|
1994
|
+
return De(e2, 0);
|
|
1829
1995
|
}
|
|
1830
|
-
function
|
|
1831
|
-
const s2 =
|
|
1832
|
-
const t3 =
|
|
1996
|
+
function De(e2, t2 = 0) {
|
|
1997
|
+
const s2 = xe[t2], n2 = s2 ? function(e3) {
|
|
1998
|
+
const t3 = Ie.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${Ee}])(?:${e3.source})(?=[\\s${Ee}]|$)`, "g")), s3 = Ce(t3, (e4) => {
|
|
1833
1999
|
const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
|
|
1834
|
-
return [" ", { type:
|
|
2000
|
+
return [" ", { type: ke[Se[t4]], children: [s4] }];
|
|
1835
2001
|
});
|
|
1836
2002
|
return (e4) => {
|
|
1837
2003
|
const [t4, ...n3] = s3(" " + e4);
|
|
1838
2004
|
return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
|
|
1839
2005
|
};
|
|
1840
2006
|
}(s2) : () => [e2];
|
|
1841
|
-
return
|
|
2007
|
+
return Ae(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? De(e3, t2 | ke[s3]) : [e3]);
|
|
1842
2008
|
}
|
|
1843
|
-
const
|
|
2009
|
+
const Ie = function() {
|
|
1844
2010
|
const e2 = function() {
|
|
1845
2011
|
try {
|
|
1846
2012
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -1856,18 +2022,18 @@ const Fe = function() {
|
|
|
1856
2022
|
return e2.set(t2, n2), n2;
|
|
1857
2023
|
} };
|
|
1858
2024
|
}();
|
|
1859
|
-
function
|
|
2025
|
+
function Fe(e2, t2) {
|
|
1860
2026
|
if (Array.prototype.indexOf) return e2.indexOf(t2);
|
|
1861
2027
|
for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
|
|
1862
2028
|
return -1;
|
|
1863
2029
|
}
|
|
1864
|
-
function
|
|
2030
|
+
function Be(e2, t2) {
|
|
1865
2031
|
for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
|
|
1866
2032
|
}
|
|
1867
|
-
function
|
|
2033
|
+
function Me(e2) {
|
|
1868
2034
|
throw new Error("Unhandled case for value: '" + e2 + "'");
|
|
1869
2035
|
}
|
|
1870
|
-
var
|
|
2036
|
+
var Re = function() {
|
|
1871
2037
|
function e2(e3) {
|
|
1872
2038
|
void 0 === e3 && (e3 = {}), this.tagName = "", this.attrs = {}, this.innerHTML = "", this.whitespaceRegex = /\s+/, this.tagName = e3.tagName || "", this.attrs = e3.attrs || {}, this.innerHTML = e3.innerHtml || e3.innerHTML || "";
|
|
1873
2039
|
}
|
|
@@ -1886,11 +2052,11 @@ var Ne = function() {
|
|
|
1886
2052
|
}, e2.prototype.setClass = function(e3) {
|
|
1887
2053
|
return this.setAttr("class", e3);
|
|
1888
2054
|
}, e2.prototype.addClass = function(e3) {
|
|
1889
|
-
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 ===
|
|
2055
|
+
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Fe(r2, t2) && r2.push(t2);
|
|
1890
2056
|
return this.getAttrs().class = r2.join(" "), this;
|
|
1891
2057
|
}, e2.prototype.removeClass = function(e3) {
|
|
1892
2058
|
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); r2.length && (t2 = i2.shift()); ) {
|
|
1893
|
-
var a2 =
|
|
2059
|
+
var a2 = Fe(r2, t2);
|
|
1894
2060
|
-1 !== a2 && r2.splice(a2, 1);
|
|
1895
2061
|
}
|
|
1896
2062
|
return this.getAttrs().class = r2.join(" "), this;
|
|
@@ -1916,12 +2082,12 @@ var Ne = function() {
|
|
|
1916
2082
|
return t2.join(" ");
|
|
1917
2083
|
}, e2;
|
|
1918
2084
|
}();
|
|
1919
|
-
var
|
|
2085
|
+
var Ne = function() {
|
|
1920
2086
|
function e2(e3) {
|
|
1921
2087
|
void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
|
|
1922
2088
|
}
|
|
1923
2089
|
return e2.prototype.build = function(e3) {
|
|
1924
|
-
return new
|
|
2090
|
+
return new Re({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
|
|
1925
2091
|
}, e2.prototype.createAttrs = function(e3) {
|
|
1926
2092
|
var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
|
|
1927
2093
|
return s2 && (t2.class = s2), this.newWindow && (t2.target = "_blank", t2.rel = "noopener noreferrer"), this.truncate && this.truncate.length && this.truncate.length < e3.getAnchorText().length && (t2.title = e3.getAnchorHref()), t2;
|
|
@@ -2006,30 +2172,30 @@ var _e = function() {
|
|
|
2006
2172
|
}, e2.prototype.buildTag = function() {
|
|
2007
2173
|
return this.tagBuilder.build(this);
|
|
2008
2174
|
}, e2;
|
|
2009
|
-
}(),
|
|
2010
|
-
return
|
|
2175
|
+
}(), _e = function(e2, t2) {
|
|
2176
|
+
return _e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
|
|
2011
2177
|
e3.__proto__ = t3;
|
|
2012
2178
|
} || function(e3, t3) {
|
|
2013
2179
|
for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
|
|
2014
|
-
},
|
|
2180
|
+
}, _e(e2, t2);
|
|
2015
2181
|
};
|
|
2016
|
-
function
|
|
2182
|
+
function Oe(e2, t2) {
|
|
2017
2183
|
function s2() {
|
|
2018
2184
|
this.constructor = e2;
|
|
2019
2185
|
}
|
|
2020
|
-
|
|
2186
|
+
_e(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
|
|
2021
2187
|
}
|
|
2022
|
-
var
|
|
2023
|
-
return
|
|
2188
|
+
var Ue, je = function() {
|
|
2189
|
+
return je = Object.assign || function(e2) {
|
|
2024
2190
|
for (var t2, s2 = 1, n2 = arguments.length; s2 < n2; s2++) for (var r2 in t2 = arguments[s2]) Object.prototype.hasOwnProperty.call(t2, r2) && (e2[r2] = t2[r2]);
|
|
2025
2191
|
return e2;
|
|
2026
|
-
},
|
|
2027
|
-
},
|
|
2192
|
+
}, je.apply(this, arguments);
|
|
2193
|
+
}, $e = function(e2) {
|
|
2028
2194
|
function t2(t3) {
|
|
2029
2195
|
var s2 = e2.call(this, t3) || this;
|
|
2030
2196
|
return s2.email = "", s2.email = t3.email, s2;
|
|
2031
2197
|
}
|
|
2032
|
-
return
|
|
2198
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2033
2199
|
return "email";
|
|
2034
2200
|
}, t2.prototype.getEmail = function() {
|
|
2035
2201
|
return this.email;
|
|
@@ -2038,12 +2204,12 @@ var je, $e = function() {
|
|
|
2038
2204
|
}, t2.prototype.getAnchorText = function() {
|
|
2039
2205
|
return this.email;
|
|
2040
2206
|
}, t2;
|
|
2041
|
-
}(Pe),
|
|
2207
|
+
}(Pe), We = function(e2) {
|
|
2042
2208
|
function t2(t3) {
|
|
2043
2209
|
var s2 = e2.call(this, t3) || this;
|
|
2044
2210
|
return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
|
|
2045
2211
|
}
|
|
2046
|
-
return
|
|
2212
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2047
2213
|
return "hashtag";
|
|
2048
2214
|
}, t2.prototype.getServiceName = function() {
|
|
2049
2215
|
return this.serviceName;
|
|
@@ -2064,12 +2230,12 @@ var je, $e = function() {
|
|
|
2064
2230
|
}, t2.prototype.getAnchorText = function() {
|
|
2065
2231
|
return "#" + this.hashtag;
|
|
2066
2232
|
}, t2;
|
|
2067
|
-
}(Pe),
|
|
2233
|
+
}(Pe), qe = function(e2) {
|
|
2068
2234
|
function t2(t3) {
|
|
2069
2235
|
var s2 = e2.call(this, t3) || this;
|
|
2070
2236
|
return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
|
|
2071
2237
|
}
|
|
2072
|
-
return
|
|
2238
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2073
2239
|
return "mention";
|
|
2074
2240
|
}, t2.prototype.getMention = function() {
|
|
2075
2241
|
return this.mention;
|
|
@@ -2092,12 +2258,12 @@ var je, $e = function() {
|
|
|
2092
2258
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2093
2259
|
return s2 && t3.push(s2), t3;
|
|
2094
2260
|
}, t2;
|
|
2095
|
-
}(Pe),
|
|
2261
|
+
}(Pe), He = function(e2) {
|
|
2096
2262
|
function t2(t3) {
|
|
2097
2263
|
var s2 = e2.call(this, t3) || this;
|
|
2098
2264
|
return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
|
|
2099
2265
|
}
|
|
2100
|
-
return
|
|
2266
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2101
2267
|
return "phone";
|
|
2102
2268
|
}, t2.prototype.getPhoneNumber = function() {
|
|
2103
2269
|
return this.number;
|
|
@@ -2108,12 +2274,12 @@ var je, $e = function() {
|
|
|
2108
2274
|
}, t2.prototype.getAnchorText = function() {
|
|
2109
2275
|
return this.matchedText;
|
|
2110
2276
|
}, t2;
|
|
2111
|
-
}(Pe),
|
|
2277
|
+
}(Pe), Ge = function(e2) {
|
|
2112
2278
|
function t2(t3) {
|
|
2113
2279
|
var s2 = e2.call(this, t3) || this;
|
|
2114
2280
|
return s2.url = "", s2.urlMatchType = "scheme", s2.protocolUrlMatch = false, s2.protocolRelativeMatch = false, s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.schemePrefixRegex = /^(https?:\/\/)?/i, s2.wwwPrefixRegex = /^(https?:\/\/)?(www\.)?/i, s2.protocolRelativeRegex = /^\/\//, s2.protocolPrepended = false, s2.urlMatchType = t3.urlMatchType, s2.url = t3.url, s2.protocolUrlMatch = t3.protocolUrlMatch, s2.protocolRelativeMatch = t3.protocolRelativeMatch, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2115
2281
|
}
|
|
2116
|
-
return
|
|
2282
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2117
2283
|
return "url";
|
|
2118
2284
|
}, t2.prototype.getUrlMatchType = function() {
|
|
2119
2285
|
return this.urlMatchType;
|
|
@@ -2141,19 +2307,19 @@ var je, $e = function() {
|
|
|
2141
2307
|
return t3;
|
|
2142
2308
|
}
|
|
2143
2309
|
}, t2;
|
|
2144
|
-
}(Pe),
|
|
2310
|
+
}(Pe), Le = function(e2) {
|
|
2145
2311
|
this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
|
|
2146
|
-
},
|
|
2147
|
-
return "(?=(" +
|
|
2148
|
-
},
|
|
2149
|
-
return "(?:" +
|
|
2150
|
-
}, ut = new RegExp("[" + nt + "]"), ct = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, lt = new RegExp("[" + nt + "!#$%&'*+/=?^_`{|}~-]"), ht = new RegExp("^" + ct.source + "$"), dt = function(e2) {
|
|
2312
|
+
}, ze = /[A-Za-z]/, Je = /[\d]/, Ye = /[\D]/, Qe = /\s/, Ve = /['"]/, Ze = /[\x00-\x1F\x7F]/, Ke = /A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source, Xe = Ke + /\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source + /\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source, et = /0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source, tt = Xe + et, st = Xe + et, nt = "(?:[" + et + "]{1,3}\\.){3}[" + et + "]{1,3}", rt = "[" + st + "](?:[" + st + "\\-]{0,61}[" + st + "])?", it = function(e2) {
|
|
2313
|
+
return "(?=(" + rt + "))\\" + e2;
|
|
2314
|
+
}, at = function(e2) {
|
|
2315
|
+
return "(?:" + it(e2) + "(?:\\." + it(e2 + 1) + "){0,126}|" + nt + ")";
|
|
2316
|
+
}, ot = new RegExp("[" + st + "]"), ut = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, ct = new RegExp("[" + st + "!#$%&'*+/=?^_`{|}~-]"), lt = new RegExp("^" + ut.source + "$"), ht = function(e2) {
|
|
2151
2317
|
function t2() {
|
|
2152
2318
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2153
|
-
return t3.localPartCharRegex =
|
|
2319
|
+
return t3.localPartCharRegex = ct, t3.strictTldRegex = lt, t3;
|
|
2154
2320
|
}
|
|
2155
|
-
return
|
|
2156
|
-
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new
|
|
2321
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2322
|
+
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new dt(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
|
|
2157
2323
|
var h2 = e3.charAt(u2);
|
|
2158
2324
|
switch (c2) {
|
|
2159
2325
|
case 0:
|
|
@@ -2178,19 +2344,19 @@ var je, $e = function() {
|
|
|
2178
2344
|
b2(h2);
|
|
2179
2345
|
break;
|
|
2180
2346
|
case 7:
|
|
2181
|
-
|
|
2347
|
+
y2(h2);
|
|
2182
2348
|
break;
|
|
2183
2349
|
default:
|
|
2184
|
-
|
|
2350
|
+
Me(c2);
|
|
2185
2351
|
}
|
|
2186
2352
|
u2++;
|
|
2187
2353
|
}
|
|
2188
2354
|
return C2(), r2;
|
|
2189
2355
|
function d2(e4) {
|
|
2190
|
-
"m" === e4 ?
|
|
2356
|
+
"m" === e4 ? w2(1) : s2.test(e4) && w2();
|
|
2191
2357
|
}
|
|
2192
2358
|
function p2(e4, t4) {
|
|
2193
|
-
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new
|
|
2359
|
+
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new dt(je(je({}, l2), { hasMailtoPrefix: true }))) : A2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : A2());
|
|
2194
2360
|
}
|
|
2195
2361
|
function f2(e4) {
|
|
2196
2362
|
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || A2();
|
|
@@ -2199,19 +2365,19 @@ var je, $e = function() {
|
|
|
2199
2365
|
"." === e4 || "@" === e4 ? A2() : s2.test(e4) ? c2 = 2 : A2();
|
|
2200
2366
|
}
|
|
2201
2367
|
function m2(e4) {
|
|
2202
|
-
|
|
2368
|
+
ot.test(e4) ? c2 = 5 : A2();
|
|
2203
2369
|
}
|
|
2204
2370
|
function v2(e4) {
|
|
2205
|
-
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 :
|
|
2371
|
+
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : ot.test(e4) || C2();
|
|
2206
2372
|
}
|
|
2207
2373
|
function b2(e4) {
|
|
2208
|
-
"-" === e4 || "." === e4 ? C2() :
|
|
2209
|
-
}
|
|
2210
|
-
function w2(e4) {
|
|
2211
|
-
"." === e4 || "-" === e4 ? C2() : ut.test(e4) ? (c2 = 5, l2 = new pt($e($e({}, l2), { hasDomainDot: true }))) : C2();
|
|
2374
|
+
"-" === e4 || "." === e4 ? C2() : ot.test(e4) ? c2 = 5 : C2();
|
|
2212
2375
|
}
|
|
2213
2376
|
function y2(e4) {
|
|
2214
|
-
|
|
2377
|
+
"." === e4 || "-" === e4 ? C2() : ot.test(e4) ? (c2 = 5, l2 = new dt(je(je({}, l2), { hasDomainDot: true }))) : C2();
|
|
2378
|
+
}
|
|
2379
|
+
function w2(e4) {
|
|
2380
|
+
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new dt({ idx: u2 });
|
|
2215
2381
|
}
|
|
2216
2382
|
function A2() {
|
|
2217
2383
|
c2 = 0, l2 = a2;
|
|
@@ -2224,14 +2390,14 @@ var je, $e = function() {
|
|
|
2224
2390
|
(function(e4) {
|
|
2225
2391
|
var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
|
|
2226
2392
|
return n2.test(s4);
|
|
2227
|
-
})(i3) && r2.push(new
|
|
2393
|
+
})(i3) && r2.push(new $e({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
|
|
2228
2394
|
}
|
|
2229
2395
|
A2();
|
|
2230
2396
|
}
|
|
2231
2397
|
}, t2;
|
|
2232
|
-
}(
|
|
2398
|
+
}(Le), dt = function(e2) {
|
|
2233
2399
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
|
|
2234
|
-
},
|
|
2400
|
+
}, pt = function() {
|
|
2235
2401
|
function e2() {
|
|
2236
2402
|
}
|
|
2237
2403
|
return e2.isValid = function(e3, t2) {
|
|
@@ -2249,16 +2415,16 @@ var je, $e = function() {
|
|
|
2249
2415
|
return !(!e3 || t2 && this.hasFullProtocolRegex.test(t2) || -1 !== e3.indexOf("."));
|
|
2250
2416
|
}, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
|
|
2251
2417
|
return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
|
|
2252
|
-
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" +
|
|
2253
|
-
}(),
|
|
2418
|
+
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + Ke + "]"), e2.ipRegex = /[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/, e2;
|
|
2419
|
+
}(), ft = (Ue = new RegExp("[/?#](?:[" + st + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + st + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, at(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, at(6), ")", "|", "(", "(//)?", at(10) + "\\.", ut.source, "(?![-" + tt + "])", ")", ")", "(?::[0-9]+)?", "(?:" + Ue.source + ")?"].join(""), "gi")), gt = new RegExp("[" + st + "]"), mt = function(e2) {
|
|
2254
2420
|
function t2(t3) {
|
|
2255
2421
|
var s2 = e2.call(this, t3) || this;
|
|
2256
|
-
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex =
|
|
2422
|
+
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = ft, s2.wordCharRegExp = gt, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2257
2423
|
}
|
|
2258
|
-
return
|
|
2424
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2259
2425
|
for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
|
|
2260
2426
|
var s3 = t3[0], u3 = t3[1], l2 = t3[4], h2 = t3[5], d2 = t3[9], p2 = t3.index, f2 = h2 || d2, g2 = e3.charAt(p2 - 1);
|
|
2261
|
-
if (!
|
|
2427
|
+
if (!pt.isValid(s3, u3)) return "continue";
|
|
2262
2428
|
if (p2 > 0 && "@" === g2) return "continue";
|
|
2263
2429
|
if (p2 > 0 && f2 && c2.wordCharRegExp.test(g2)) return "continue";
|
|
2264
2430
|
if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
|
|
@@ -2273,8 +2439,8 @@ var je, $e = function() {
|
|
|
2273
2439
|
var b2 = s3.indexOf(v2);
|
|
2274
2440
|
s3 = s3.substr(b2), u3 = u3.substr(b2), p2 += b2;
|
|
2275
2441
|
}
|
|
2276
|
-
var
|
|
2277
|
-
o2.push(new
|
|
2442
|
+
var y2 = u3 ? "scheme" : l2 ? "www" : "tld", w2 = !!u3;
|
|
2443
|
+
o2.push(new Ge({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: y2, url: s3, protocolUrlMatch: w2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
|
|
2278
2444
|
}, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
|
|
2279
2445
|
return o2;
|
|
2280
2446
|
}, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
|
|
@@ -2294,58 +2460,58 @@ var je, $e = function() {
|
|
|
2294
2460
|
if (!e3) return -1;
|
|
2295
2461
|
var s2 = 0;
|
|
2296
2462
|
t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
|
|
2297
|
-
var n2 = new RegExp("^((.?//)?[-." +
|
|
2463
|
+
var n2 = new RegExp("^((.?//)?[-." + st + "]*[-" + st + "]\\.[-" + st + "]+)").exec(e3);
|
|
2298
2464
|
return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
|
|
2299
2465
|
}, t2;
|
|
2300
|
-
}(
|
|
2466
|
+
}(Le), vt = new RegExp("#[_" + st + "]{1,139}(?![_" + st + "])", "g"), bt = new RegExp("[^" + st + "]"), yt = function(e2) {
|
|
2301
2467
|
function t2(t3) {
|
|
2302
2468
|
var s2 = e2.call(this, t3) || this;
|
|
2303
|
-
return s2.serviceName = "twitter", s2.matcherRegex =
|
|
2469
|
+
return s2.serviceName = "twitter", s2.matcherRegex = vt, s2.nonWordCharRegex = bt, s2.serviceName = t3.serviceName, s2;
|
|
2304
2470
|
}
|
|
2305
|
-
return
|
|
2471
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2306
2472
|
for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2307
2473
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2308
2474
|
if (0 === o2 || n2.test(u2)) {
|
|
2309
2475
|
var c2 = t3[0], l2 = t3[0].slice(1);
|
|
2310
|
-
a2.push(new
|
|
2476
|
+
a2.push(new We({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
|
|
2311
2477
|
}
|
|
2312
2478
|
}
|
|
2313
2479
|
return a2;
|
|
2314
2480
|
}, t2;
|
|
2315
|
-
}(
|
|
2481
|
+
}(Le), wt = new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source + "|" + /(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source, "g"), At = function(e2) {
|
|
2316
2482
|
function t2() {
|
|
2317
2483
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2318
|
-
return t3.matcherRegex =
|
|
2484
|
+
return t3.matcherRegex = wt, t3;
|
|
2319
2485
|
}
|
|
2320
|
-
return
|
|
2486
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2321
2487
|
for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2322
2488
|
var i2 = t3[0], a2 = i2.replace(/[^0-9,;#]/g, ""), o2 = !(!t3[1] && !t3[2]), u2 = 0 == t3.index ? "" : e3.substr(t3.index - 1, 1), c2 = e3.substr(t3.index + i2.length, 1), l2 = !u2.match(/\d/) && !c2.match(/\d/);
|
|
2323
|
-
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new
|
|
2489
|
+
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new He({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
|
|
2324
2490
|
}
|
|
2325
2491
|
return r2;
|
|
2326
2492
|
}, t2.prototype.testMatch = function(e3) {
|
|
2327
|
-
return
|
|
2493
|
+
return Ye.test(e3);
|
|
2328
2494
|
}, t2;
|
|
2329
|
-
}(
|
|
2495
|
+
}(Le), Ct = new RegExp("@[_" + st + "]{1,50}(?![_" + st + "])", "g"), Et = new RegExp("@[_." + st + "]{1,30}(?![_" + st + "])", "g"), kt = new RegExp("@[-_." + st + "]{1,50}(?![-_" + st + "])", "g"), xt = new RegExp("[^" + st + "]"), St = function(e2) {
|
|
2330
2496
|
function t2(t3) {
|
|
2331
2497
|
var s2 = e2.call(this, t3) || this;
|
|
2332
|
-
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter:
|
|
2498
|
+
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: Ct, instagram: Et, soundcloud: kt }, s2.nonWordCharRegex = xt, s2.serviceName = t3.serviceName, s2;
|
|
2333
2499
|
}
|
|
2334
|
-
return
|
|
2500
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2335
2501
|
var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
|
|
2336
2502
|
if (!n2) return a2;
|
|
2337
2503
|
for (; null !== (t3 = n2.exec(e3)); ) {
|
|
2338
2504
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2339
2505
|
if (0 === o2 || r2.test(u2)) {
|
|
2340
2506
|
var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
|
|
2341
|
-
a2.push(new
|
|
2507
|
+
a2.push(new qe({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
|
|
2342
2508
|
}
|
|
2343
2509
|
}
|
|
2344
2510
|
return a2;
|
|
2345
2511
|
}, t2;
|
|
2346
|
-
}(
|
|
2347
|
-
function
|
|
2348
|
-
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new
|
|
2512
|
+
}(Le);
|
|
2513
|
+
function Tt(e2, t2) {
|
|
2514
|
+
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new Dt(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
|
|
2349
2515
|
var f2 = e2.charAt(c2);
|
|
2350
2516
|
switch (h2) {
|
|
2351
2517
|
case 0:
|
|
@@ -2361,10 +2527,10 @@ function Dt(e2, t2) {
|
|
|
2361
2527
|
v2(f2);
|
|
2362
2528
|
break;
|
|
2363
2529
|
case 4:
|
|
2364
|
-
|
|
2530
|
+
y2(f2);
|
|
2365
2531
|
break;
|
|
2366
2532
|
case 5:
|
|
2367
|
-
|
|
2533
|
+
w2(f2);
|
|
2368
2534
|
break;
|
|
2369
2535
|
case 6:
|
|
2370
2536
|
A2(f2);
|
|
@@ -2409,10 +2575,10 @@ function Dt(e2, t2) {
|
|
|
2409
2575
|
N2(f2);
|
|
2410
2576
|
break;
|
|
2411
2577
|
case 20:
|
|
2412
|
-
|
|
2578
|
+
P2(f2);
|
|
2413
2579
|
break;
|
|
2414
2580
|
default:
|
|
2415
|
-
|
|
2581
|
+
Me(h2);
|
|
2416
2582
|
}
|
|
2417
2583
|
c2++;
|
|
2418
2584
|
}
|
|
@@ -2420,25 +2586,25 @@ function Dt(e2, t2) {
|
|
|
2420
2586
|
"<" === e3 && O2();
|
|
2421
2587
|
}
|
|
2422
2588
|
function m2(e3) {
|
|
2423
|
-
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new
|
|
2589
|
+
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new Dt(je(je({}, p2), { isClosing: true }))) : "<" === e3 ? O2() : ze.test(e3) ? (h2 = 3, p2 = new Dt(je(je({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
|
|
2424
2590
|
}
|
|
2425
2591
|
function v2(e3) {
|
|
2426
|
-
|
|
2592
|
+
Qe.test(e3) ? (p2 = new Dt(je(je({}, p2), { name: j2() })), h2 = 4) : "<" === e3 ? O2() : "/" === e3 ? (p2 = new Dt(je(je({}, p2), { name: j2() })), h2 = 12) : ">" === e3 ? (p2 = new Dt(je(je({}, p2), { name: j2() })), U2()) : ze.test(e3) || Je.test(e3) || ":" === e3 || _2();
|
|
2427
2593
|
}
|
|
2428
2594
|
function b2(e3) {
|
|
2429
|
-
">" === e3 ?
|
|
2430
|
-
}
|
|
2431
|
-
function w2(e3) {
|
|
2432
|
-
Ve.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : "=" === e3 || Ze.test(e3) || Ke.test(e3) ? P2() : h2 = 5);
|
|
2595
|
+
">" === e3 ? _2() : ze.test(e3) ? h2 = 3 : _2();
|
|
2433
2596
|
}
|
|
2434
2597
|
function y2(e3) {
|
|
2435
|
-
|
|
2598
|
+
Qe.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : "=" === e3 || Ve.test(e3) || Ze.test(e3) ? _2() : h2 = 5);
|
|
2599
|
+
}
|
|
2600
|
+
function w2(e3) {
|
|
2601
|
+
Qe.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? O2() : Ve.test(e3) && _2();
|
|
2436
2602
|
}
|
|
2437
2603
|
function A2(e3) {
|
|
2438
|
-
|
|
2604
|
+
Qe.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? O2() : Ve.test(e3) ? _2() : h2 = 5);
|
|
2439
2605
|
}
|
|
2440
2606
|
function C2(e3) {
|
|
2441
|
-
|
|
2607
|
+
Qe.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? _2() : "<" === e3 ? O2() : h2 = 10);
|
|
2442
2608
|
}
|
|
2443
2609
|
function E2(e3) {
|
|
2444
2610
|
'"' === e3 && (h2 = 11);
|
|
@@ -2447,22 +2613,22 @@ function Dt(e2, t2) {
|
|
|
2447
2613
|
"'" === e3 && (h2 = 11);
|
|
2448
2614
|
}
|
|
2449
2615
|
function x2(e3) {
|
|
2450
|
-
|
|
2616
|
+
Qe.test(e3) ? h2 = 4 : ">" === e3 ? U2() : "<" === e3 && O2();
|
|
2451
2617
|
}
|
|
2452
2618
|
function S2(e3) {
|
|
2453
|
-
|
|
2619
|
+
Qe.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : (h2 = 4, c2--);
|
|
2454
2620
|
}
|
|
2455
2621
|
function T2(e3) {
|
|
2456
|
-
">" === e3 ? (p2 = new
|
|
2622
|
+
">" === e3 ? (p2 = new Dt(je(je({}, p2), { isClosing: true })), U2()) : h2 = 4;
|
|
2457
2623
|
}
|
|
2458
2624
|
function D2(t3) {
|
|
2459
|
-
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new
|
|
2625
|
+
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new Dt(je(je({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new Dt(je(je({}, p2), { type: "doctype" })), h2 = 20) : _2();
|
|
2460
2626
|
}
|
|
2461
2627
|
function I2(e3) {
|
|
2462
|
-
"-" === e3 ? h2 = 15 : ">" === e3 ?
|
|
2628
|
+
"-" === e3 ? h2 = 15 : ">" === e3 ? _2() : h2 = 16;
|
|
2463
2629
|
}
|
|
2464
2630
|
function F2(e3) {
|
|
2465
|
-
"-" === e3 ? h2 = 18 : ">" === e3 ?
|
|
2631
|
+
"-" === e3 ? h2 = 18 : ">" === e3 ? _2() : h2 = 16;
|
|
2466
2632
|
}
|
|
2467
2633
|
function B2(e3) {
|
|
2468
2634
|
"-" === e3 && (h2 = 17);
|
|
@@ -2476,18 +2642,18 @@ function Dt(e2, t2) {
|
|
|
2476
2642
|
function N2(e3) {
|
|
2477
2643
|
"-" === e3 ? h2 = 17 : ">" === e3 ? U2() : h2 = 16;
|
|
2478
2644
|
}
|
|
2479
|
-
function
|
|
2645
|
+
function P2(e3) {
|
|
2480
2646
|
">" === e3 ? U2() : "<" === e3 && O2();
|
|
2481
2647
|
}
|
|
2482
|
-
function
|
|
2648
|
+
function _2() {
|
|
2483
2649
|
h2 = 0, p2 = u2;
|
|
2484
2650
|
}
|
|
2485
2651
|
function O2() {
|
|
2486
|
-
h2 = 1, p2 = new
|
|
2652
|
+
h2 = 1, p2 = new Dt({ idx: c2 });
|
|
2487
2653
|
}
|
|
2488
2654
|
function U2() {
|
|
2489
2655
|
var t3 = e2.slice(d2, p2.idx);
|
|
2490
|
-
t3 && i2(t3, d2), "comment" === p2.type ? a2(p2.idx) : "doctype" === p2.type ? o2(p2.idx) : (p2.isOpening && n2(p2.name, p2.idx), p2.isClosing && r2(p2.name, p2.idx)),
|
|
2656
|
+
t3 && i2(t3, d2), "comment" === p2.type ? a2(p2.idx) : "doctype" === p2.type ? o2(p2.idx) : (p2.isOpening && n2(p2.name, p2.idx), p2.isClosing && r2(p2.name, p2.idx)), _2(), d2 = c2 + 1;
|
|
2491
2657
|
}
|
|
2492
2658
|
function j2() {
|
|
2493
2659
|
var t3 = p2.idx + (p2.isClosing ? 2 : 1);
|
|
@@ -2495,9 +2661,9 @@ function Dt(e2, t2) {
|
|
|
2495
2661
|
}
|
|
2496
2662
|
d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
|
|
2497
2663
|
}
|
|
2498
|
-
var
|
|
2664
|
+
var Dt = function(e2) {
|
|
2499
2665
|
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;
|
|
2500
|
-
},
|
|
2666
|
+
}, It = function() {
|
|
2501
2667
|
function e2(t2) {
|
|
2502
2668
|
void 0 === t2 && (t2 = {}), this.version = e2.version, this.urls = {}, this.email = true, this.phone = true, this.hashtag = false, this.mention = false, this.newWindow = true, this.stripPrefix = { scheme: true, www: true }, this.stripTrailingSlash = true, this.decodePercentEncoding = true, this.truncate = { length: 0, location: "end" }, this.className = "", this.replaceFn = null, this.context = void 0, this.sanitizeHtml = false, this.matchers = null, this.tagBuilder = null, this.urls = this.normalizeUrlsCfg(t2.urls), this.email = "boolean" == typeof t2.email ? t2.email : this.email, this.phone = "boolean" == typeof t2.phone ? t2.phone : this.phone, this.hashtag = t2.hashtag || this.hashtag, this.mention = t2.mention || this.mention, this.newWindow = "boolean" == typeof t2.newWindow ? t2.newWindow : this.newWindow, this.stripPrefix = this.normalizeStripPrefixCfg(t2.stripPrefix), this.stripTrailingSlash = "boolean" == typeof t2.stripTrailingSlash ? t2.stripTrailingSlash : this.stripTrailingSlash, this.decodePercentEncoding = "boolean" == typeof t2.decodePercentEncoding ? t2.decodePercentEncoding : this.decodePercentEncoding, this.sanitizeHtml = t2.sanitizeHtml || false;
|
|
2503
2669
|
var s2 = this.mention;
|
|
@@ -2521,7 +2687,7 @@ var It = function(e2) {
|
|
|
2521
2687
|
}(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
|
|
2522
2688
|
}, e2.prototype.parse = function(e3) {
|
|
2523
2689
|
var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
|
|
2524
|
-
return
|
|
2690
|
+
return Tt(e3, { onOpenTag: function(e4) {
|
|
2525
2691
|
s2.indexOf(e4) >= 0 && n2++;
|
|
2526
2692
|
}, onText: function(e4, s3) {
|
|
2527
2693
|
if (0 === n2) {
|
|
@@ -2560,19 +2726,19 @@ var It = function(e2) {
|
|
|
2560
2726
|
}
|
|
2561
2727
|
return e3;
|
|
2562
2728
|
}, e2.prototype.removeUnwantedMatches = function(e3) {
|
|
2563
|
-
return this.hashtag ||
|
|
2729
|
+
return this.hashtag || Be(e3, function(e4) {
|
|
2564
2730
|
return "hashtag" === e4.getType();
|
|
2565
|
-
}), this.email ||
|
|
2731
|
+
}), this.email || Be(e3, function(e4) {
|
|
2566
2732
|
return "email" === e4.getType();
|
|
2567
|
-
}), this.phone ||
|
|
2733
|
+
}), this.phone || Be(e3, function(e4) {
|
|
2568
2734
|
return "phone" === e4.getType();
|
|
2569
|
-
}), this.mention ||
|
|
2735
|
+
}), this.mention || Be(e3, function(e4) {
|
|
2570
2736
|
return "mention" === e4.getType();
|
|
2571
|
-
}), this.urls.schemeMatches ||
|
|
2737
|
+
}), this.urls.schemeMatches || Be(e3, function(e4) {
|
|
2572
2738
|
return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
|
|
2573
|
-
}), this.urls.wwwMatches ||
|
|
2739
|
+
}), this.urls.wwwMatches || Be(e3, function(e4) {
|
|
2574
2740
|
return "url" === e4.getType() && "www" === e4.getUrlMatchType();
|
|
2575
|
-
}), this.urls.tldMatches ||
|
|
2741
|
+
}), this.urls.tldMatches || Be(e3, function(e4) {
|
|
2576
2742
|
return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
|
|
2577
2743
|
}), e3;
|
|
2578
2744
|
}, e2.prototype.parseText = function(e3, t2) {
|
|
@@ -2592,102 +2758,99 @@ var It = function(e2) {
|
|
|
2592
2758
|
return s2.push(e3.substring(n2)), s2.join("");
|
|
2593
2759
|
}, e2.prototype.createMatchReturnVal = function(e3) {
|
|
2594
2760
|
var t2;
|
|
2595
|
-
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof
|
|
2761
|
+
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof Re ? t2.toAnchorString() : e3.buildTag().toAnchorString();
|
|
2596
2762
|
}, e2.prototype.getMatchers = function() {
|
|
2597
2763
|
if (this.matchers) return this.matchers;
|
|
2598
|
-
var e3 = this.getTagBuilder(), t2 = [new yt({ tagBuilder: e3, serviceName: this.hashtag }), new
|
|
2764
|
+
var e3 = this.getTagBuilder(), t2 = [new yt({ tagBuilder: e3, serviceName: this.hashtag }), new ht({ tagBuilder: e3 }), new At({ tagBuilder: e3 }), new St({ tagBuilder: e3, serviceName: this.mention }), new mt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
|
|
2599
2765
|
return this.matchers = t2;
|
|
2600
2766
|
}, e2.prototype.getTagBuilder = function() {
|
|
2601
2767
|
var e3 = this.tagBuilder;
|
|
2602
|
-
return e3 || (e3 = this.tagBuilder = new
|
|
2603
|
-
}, e2.version = "3.14.3", e2.AnchorTagBuilder =
|
|
2768
|
+
return e3 || (e3 = this.tagBuilder = new Ne({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
|
|
2769
|
+
}, e2.version = "3.14.3", e2.AnchorTagBuilder = Ne, e2.HtmlTag = Re, e2.matcher = { Email: ht, Hashtag: yt, Matcher: Le, Mention: St, Phone: At, Url: mt }, e2.match = { Email: $e, Hashtag: We, Match: Pe, Mention: qe, Phone: He, Url: Ge }, e2;
|
|
2604
2770
|
}();
|
|
2605
|
-
function
|
|
2771
|
+
function Ft(e2, t2 = e2) {
|
|
2606
2772
|
return { type: "autolink", url: e2, text: t2 };
|
|
2607
2773
|
}
|
|
2608
|
-
|
|
2609
|
-
return { type: "emoji", kind: e2, text: t2 };
|
|
2610
|
-
}, { emoticon: (e2) => ({ type: "emoji", kind: "emoticon", text: e2 }), unicode: (e2) => ({ type: "emoji", kind: "unicode", text: e2 }) });
|
|
2611
|
-
const Mt = Ee(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
2774
|
+
const Bt = Ce(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
2612
2775
|
return { type: "mention", id: e3, text: t3 };
|
|
2613
|
-
}(decodeURIComponent(t2), s2)),
|
|
2776
|
+
}(decodeURIComponent(t2), s2)), Mt = Ce(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
|
|
2614
2777
|
return { type: "customemoji", text: e3 };
|
|
2615
|
-
}(t2)),
|
|
2778
|
+
}(t2)), Rt = Ce(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
|
|
2616
2779
|
return { type: "link", url: e3, children: t3 };
|
|
2617
|
-
}(t2, [s2])),
|
|
2618
|
-
const { action: n2, params: r2 } =
|
|
2780
|
+
}(t2, [s2])), Nt = Ce(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
2781
|
+
const { action: n2, params: r2 } = _t(t2);
|
|
2619
2782
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2620
2783
|
return { type: "actionlink", action: e3, params: t3, children: s3 };
|
|
2621
2784
|
}(n2, r2, [s2]);
|
|
2622
|
-
}), Pt =
|
|
2623
|
-
const { action: n2, params: r2 } =
|
|
2785
|
+
}), Pt = Ce(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
2786
|
+
const { action: n2, params: r2 } = _t(t2);
|
|
2624
2787
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2625
2788
|
return { type: "actionbutton", action: e3, params: t3, children: s3 };
|
|
2626
2789
|
}(n2, r2, [s2]);
|
|
2627
2790
|
});
|
|
2628
|
-
function
|
|
2791
|
+
function _t(e2) {
|
|
2629
2792
|
const t2 = e2.indexOf("?");
|
|
2630
2793
|
if (-1 === t2) return { action: e2, params: {} };
|
|
2631
2794
|
return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
|
|
2632
2795
|
}
|
|
2633
|
-
const
|
|
2796
|
+
const Ot = Ce(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
|
|
2634
2797
|
return { type: "bulletlist", children: e3 };
|
|
2635
|
-
}([e2.startsWith("\n") ? e2.slice(1) : e2])),
|
|
2798
|
+
}([e2.startsWith("\n") ? e2.slice(1) : e2])), Ut = Ce(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), jt = (e2) => {
|
|
2636
2799
|
const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
|
|
2637
2800
|
let s2 = 0;
|
|
2638
2801
|
const n2 = [];
|
|
2639
|
-
for (const r2 of
|
|
2802
|
+
for (const r2 of J(e2, t2)) {
|
|
2640
2803
|
const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
|
|
2641
2804
|
a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
|
|
2642
|
-
const o2 =
|
|
2805
|
+
const o2 = Ft("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
|
|
2643
2806
|
n2.push(o2), s2 = a2 + i2.length;
|
|
2644
2807
|
}
|
|
2645
2808
|
return s2 < e2.length && n2.push(e2.substring(s2)), n2;
|
|
2646
|
-
},
|
|
2647
|
-
const t2 =
|
|
2809
|
+
}, $t = (e2) => Rt(e2).flatMap((e3) => "string" == typeof e3 ? Wt(e3) : ["<", ...Wt(e3.url), ...Wt("|" + e3.children[0] + ">")]), Wt = (e2) => {
|
|
2810
|
+
const t2 = It.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
|
|
2648
2811
|
let n2 = 0;
|
|
2649
2812
|
for (const r2 of t2) {
|
|
2650
2813
|
const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
|
|
2651
2814
|
let o2 = i2;
|
|
2652
|
-
r2 instanceof
|
|
2815
|
+
r2 instanceof $e ? o2 = "mailto:" + r2.getEmail() : r2 instanceof Ge && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Ft(o2, i2)), n2 = t3 + a2;
|
|
2653
2816
|
}
|
|
2654
2817
|
return n2 < e2.length && s2.push(e2.substring(n2)), s2;
|
|
2655
|
-
},
|
|
2656
|
-
function
|
|
2818
|
+
}, qt = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
|
|
2819
|
+
function Ht(e2 = { except: [] }) {
|
|
2657
2820
|
var _a2;
|
|
2658
|
-
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 :
|
|
2659
|
-
return s2.includes("BulletPoint") || t2.multilineSteps.push(
|
|
2821
|
+
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : qt.filter((t3) => !e2.only.includes(t3));
|
|
2822
|
+
return s2.includes("BulletPoint") || t2.multilineSteps.push(Ot, Ut), s2.includes("Mention") || t2.singlelineSteps.push(Bt), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Mt), s2.includes("Codespan") || t2.multilineSteps.push(Ce(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3 }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Rt), s2.includes("Actions") || (t2.singlelineSteps.push(Nt), t2.singlelineSteps.push(Pt)), s2.includes("Wikitext") || t2.singlelineSteps.push(Te), s2.includes("Autolink") || t2.singlelineSteps.push($t, jt), t2;
|
|
2660
2823
|
}
|
|
2661
|
-
const
|
|
2824
|
+
const Gt = function(e2) {
|
|
2662
2825
|
const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
|
|
2663
2826
|
return (e3) => Array.from(e3.match(t2) || []);
|
|
2664
2827
|
}("\n");
|
|
2665
|
-
function
|
|
2828
|
+
function Lt(e2, t2 = { except: [] }) {
|
|
2666
2829
|
let s2 = function(e3, t3) {
|
|
2667
2830
|
let s3 = [e3];
|
|
2668
|
-
return s3 =
|
|
2669
|
-
}(e2,
|
|
2670
|
-
return s2 =
|
|
2831
|
+
return s3 = zt(s3, t3.multilineSteps), s3 = zt(s3, [Gt]), s3 = zt(s3, t3.singlelineSteps), s3 = Jt(s3), s3;
|
|
2832
|
+
}(e2, Ht(t2));
|
|
2833
|
+
return s2 = Yt(s2, false), s2;
|
|
2671
2834
|
}
|
|
2672
|
-
function
|
|
2673
|
-
return t2.reduce((e3, t3) =>
|
|
2835
|
+
function zt(e2, t2) {
|
|
2836
|
+
return t2.reduce((e3, t3) => Ae(e3, t3), e2);
|
|
2674
2837
|
}
|
|
2675
|
-
function
|
|
2838
|
+
function Jt(e2) {
|
|
2676
2839
|
const t2 = [];
|
|
2677
2840
|
let s2 = -1;
|
|
2678
|
-
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:
|
|
2841
|
+
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: Jt(n2.children) }) : n2;
|
|
2679
2842
|
return t2;
|
|
2680
2843
|
}
|
|
2681
|
-
function
|
|
2844
|
+
function Yt(e2, t2) {
|
|
2682
2845
|
const s2 = [];
|
|
2683
2846
|
let n2 = [];
|
|
2684
2847
|
for (let r2 = 0; r2 < e2.length; r2++) {
|
|
2685
2848
|
const i2 = e2[r2];
|
|
2686
|
-
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children =
|
|
2849
|
+
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children = Yt(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type), s2.push(i2)) : "autolink" === i2.type && t2 ? n2.push(i2.text) : (n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2.push(i2));
|
|
2687
2850
|
}
|
|
2688
2851
|
return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
|
|
2689
2852
|
}
|
|
2690
|
-
class
|
|
2853
|
+
class Qt {
|
|
2691
2854
|
constructor(e2, t2, s2) {
|
|
2692
2855
|
this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
2693
2856
|
}
|
|
@@ -2703,12 +2866,12 @@ class Vt {
|
|
|
2703
2866
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
|
|
2704
2867
|
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
|
|
2705
2868
|
const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.createMessageSnapshot(s2, this.brandedConversationId);
|
|
2706
|
-
return
|
|
2869
|
+
return ve("Get message " + this.id, n2);
|
|
2707
2870
|
});
|
|
2708
2871
|
}
|
|
2709
2872
|
edit(t2) {
|
|
2710
2873
|
return __async(this, null, function* () {
|
|
2711
|
-
const s2 = { content:
|
|
2874
|
+
const s2 = { content: Vt(t2), custom: "string" == typeof t2 ? void 0 : t2.custom }, n2 = yield this._realtimeClient.call("PATCH", ["conversations", this.brandedConversationId, "messages", this.brandedId], s2);
|
|
2712
2875
|
e(`Edit message ${this.id} in conversation ${this.conversationId}`, n2);
|
|
2713
2876
|
});
|
|
2714
2877
|
}
|
|
@@ -2719,18 +2882,18 @@ class Vt {
|
|
|
2719
2882
|
});
|
|
2720
2883
|
}
|
|
2721
2884
|
}
|
|
2722
|
-
function
|
|
2885
|
+
function Vt(e2) {
|
|
2723
2886
|
if ("string" == typeof e2) {
|
|
2724
|
-
return [{ type: "text", children:
|
|
2887
|
+
return [{ type: "text", children: Lt(e2) }];
|
|
2725
2888
|
}
|
|
2726
2889
|
if ("text" in e2 && e2.text) {
|
|
2727
|
-
return [{ type: "text", children:
|
|
2890
|
+
return [{ type: "text", children: Lt(e2.text) }];
|
|
2728
2891
|
}
|
|
2729
2892
|
if ("content" in e2 && e2.content) return e2.content;
|
|
2730
2893
|
}
|
|
2731
|
-
class
|
|
2894
|
+
class Zt {
|
|
2732
2895
|
constructor(e2, t2) {
|
|
2733
|
-
this.id = e2, this._realtimeClient = t2;
|
|
2896
|
+
this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
|
|
2734
2897
|
}
|
|
2735
2898
|
get brandedId() {
|
|
2736
2899
|
return this.id;
|
|
@@ -2742,13 +2905,13 @@ class Kt {
|
|
|
2742
2905
|
return new ye("string" == typeof e2 ? e2 : e2.id, this.id, this._realtimeClient);
|
|
2743
2906
|
}
|
|
2744
2907
|
message(e2) {
|
|
2745
|
-
return new
|
|
2908
|
+
return new Qt(e2, this.brandedId, this._realtimeClient);
|
|
2746
2909
|
}
|
|
2747
2910
|
get() {
|
|
2748
2911
|
return __async(this, null, function* () {
|
|
2749
2912
|
const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
|
|
2750
2913
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
|
|
2751
|
-
const n2 = e("Get conversation " + this.id, s2), r2 =
|
|
2914
|
+
const n2 = e("Get conversation " + this.id, s2), r2 = ve("Get last message in conversation " + this.id, yield t2), i2 = 0 === r2.length ? null : r2[0];
|
|
2752
2915
|
return this._realtimeClient.createConversationSnapshotPreloaded(n2, i2);
|
|
2753
2916
|
});
|
|
2754
2917
|
}
|
|
@@ -2791,8 +2954,8 @@ class Kt {
|
|
|
2791
2954
|
}
|
|
2792
2955
|
send(t2) {
|
|
2793
2956
|
return __async(this, null, function* () {
|
|
2794
|
-
const s2 = { content:
|
|
2795
|
-
return new
|
|
2957
|
+
const s2 = { content: Kt(t2), referencedMessageId: Xt(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: we((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
|
|
2958
|
+
return new Qt(r2.id, this.brandedId, this._realtimeClient);
|
|
2796
2959
|
});
|
|
2797
2960
|
}
|
|
2798
2961
|
subscribeMessages(e2) {
|
|
@@ -2801,37 +2964,46 @@ class Kt {
|
|
|
2801
2964
|
subscribe(e2) {
|
|
2802
2965
|
return this._realtimeClient.subscribe(["me", "conversations", this.brandedId], e2);
|
|
2803
2966
|
}
|
|
2967
|
+
subscribeTyping(e2) {
|
|
2968
|
+
return this._realtimeClient.subscribe(["me", "conversations", this.brandedId, "typing"], e2);
|
|
2969
|
+
}
|
|
2970
|
+
markAsTyping() {
|
|
2971
|
+
return __async(this, null, function* () {
|
|
2972
|
+
const t2 = yield this._realtimeClient.call("POST", ["me", "conversations", this.brandedId, "typing"], {});
|
|
2973
|
+
e(`Set user as typing in ${this.id}`, t2);
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2804
2976
|
}
|
|
2805
|
-
function
|
|
2977
|
+
function Kt(e2) {
|
|
2806
2978
|
if ("string" == typeof e2) {
|
|
2807
|
-
return [{ type: "text", children:
|
|
2979
|
+
return [{ type: "text", children: Lt(e2) }];
|
|
2808
2980
|
}
|
|
2809
2981
|
if ("text" in e2) {
|
|
2810
|
-
return [{ type: "text", children:
|
|
2982
|
+
return [{ type: "text", children: Lt(e2.text) }];
|
|
2811
2983
|
}
|
|
2812
2984
|
return e2.content;
|
|
2813
2985
|
}
|
|
2814
|
-
function
|
|
2986
|
+
function Xt(e2) {
|
|
2815
2987
|
if ("string" == typeof e2) return;
|
|
2816
2988
|
const t2 = e2.referencedMessage;
|
|
2817
2989
|
return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
|
|
2818
2990
|
}
|
|
2819
|
-
class
|
|
2991
|
+
class es {
|
|
2820
2992
|
constructor(e2, t2, s2) {
|
|
2821
2993
|
this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
|
|
2822
2994
|
}
|
|
2823
2995
|
getBokensUrl(e2, t2, s2) {
|
|
2824
2996
|
return this.internalHttpApiUrl + `/${e2}/bokens/${encodeURIComponent(t2)}?signature=${encodeURIComponent(s2 != null ? s2 : "")}`;
|
|
2825
2997
|
}
|
|
2826
|
-
getRealtimeWsUrl(e2, t2, s2, n2) {
|
|
2827
|
-
const
|
|
2828
|
-
return this.realtimeWsApiUrl + `/${e2}/realtime/${
|
|
2998
|
+
getRealtimeWsUrl(e2, t2, s2, n2, r2) {
|
|
2999
|
+
const i2 = encodeURIComponent(t2);
|
|
3000
|
+
return this.realtimeWsApiUrl + `/${e2}/realtime/${i2}?talkjs-client-build=${r2 != null ? r2 : "standalone"}&talkjs-core=${s2}&talkjs-client-id=${n2}`;
|
|
2829
3001
|
}
|
|
2830
3002
|
}
|
|
2831
|
-
function
|
|
3003
|
+
function ts({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2 }) {
|
|
2832
3004
|
var _a2;
|
|
2833
3005
|
(!r2 || r2 <= 0) && (r2 = 1);
|
|
2834
|
-
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-
|
|
3006
|
+
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-06-03T07:34:52.410Z" };
|
|
2835
3007
|
s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
2836
3008
|
return a(r2, () => __async(this, null, function* () {
|
|
2837
3009
|
if (o2) {
|
|
@@ -2843,19 +3015,19 @@ function ss({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
|
|
|
2843
3015
|
throw e3;
|
|
2844
3016
|
});
|
|
2845
3017
|
}), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
|
|
2846
|
-
return o2 && 401 === s3.status ? (
|
|
3018
|
+
return o2 && 401 === s3.status ? (cs.log(`401 error from ${e2} ${t2}, ${yield o2.getToken()}`), o2.refreshToken(), true) : i2 ? i2(s3) : !("status" in s3 && s3.status >= 400 && s3.status < 500);
|
|
2847
3019
|
}) }).catch((s3) => {
|
|
2848
|
-
if (!t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
3020
|
+
if (Math.random() < 0.1 && !t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
2849
3021
|
const n3 = `Network Error for ${e2} ${t2}`;
|
|
2850
3022
|
if ("undefined" != typeof window) if (s3 instanceof Response) {
|
|
2851
|
-
s3.clone().text().then((e3) =>
|
|
2852
|
-
} else
|
|
3023
|
+
s3.clone().text().then((e3) => cs.log(`${n3} ${s3.status} ${e3} (10% logged)`));
|
|
3024
|
+
} else cs.log(`${n3} ${s3} (10% logged)`);
|
|
2853
3025
|
console.error("[TalkJS]", n3);
|
|
2854
3026
|
}
|
|
2855
3027
|
throw s3;
|
|
2856
3028
|
});
|
|
2857
3029
|
}
|
|
2858
|
-
const { cdnHost:
|
|
3030
|
+
const { cdnHost: ss, appHost: ns, restHost: rs, realtimeHost: is, appProtocol: as, appWsProtocol: os } = function() {
|
|
2859
3031
|
if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
|
|
2860
3032
|
const e2 = function() {
|
|
2861
3033
|
if (document.currentScript) return document.currentScript.src;
|
|
@@ -2880,11 +3052,11 @@ const { cdnHost: ns, appHost: rs, restHost: is, realtimeHost: as, appProtocol: o
|
|
|
2880
3052
|
}(n2), a2 = t2.protocol;
|
|
2881
3053
|
return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
|
|
2882
3054
|
}();
|
|
2883
|
-
const
|
|
2884
|
-
const
|
|
3055
|
+
const us = ns.startsWith("app.talkjs.com");
|
|
3056
|
+
const cs = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
2885
3057
|
} } : new class {
|
|
2886
3058
|
constructor(e2) {
|
|
2887
|
-
this._timeCreated = Date.now(), this._enabled =
|
|
3059
|
+
this._timeCreated = Date.now(), this._enabled = us, this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-06-03T07:34:52.410Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: window.location.href, referrer: document.referrer, userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: window.location.href, stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2025-06-03T07:34:52.410Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
2888
3060
|
}
|
|
2889
3061
|
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
2890
3062
|
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
@@ -2894,14 +3066,14 @@ const ls = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setD
|
|
|
2894
3066
|
try {
|
|
2895
3067
|
if (!this._enabled) return Promise.resolve();
|
|
2896
3068
|
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
2897
|
-
yield
|
|
3069
|
+
yield ts({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
2898
3070
|
} catch (e3) {
|
|
2899
3071
|
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
2900
3072
|
}
|
|
2901
3073
|
});
|
|
2902
3074
|
}
|
|
2903
3075
|
}("970cd0be0fb74630b75c8451051299dc");
|
|
2904
|
-
class
|
|
3076
|
+
class ls {
|
|
2905
3077
|
constructor(e2, t2 = {}) {
|
|
2906
3078
|
this._onSubscription = t2, this._handlers = {};
|
|
2907
3079
|
for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
|
|
@@ -2946,9 +3118,9 @@ class hs {
|
|
|
2946
3118
|
return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
|
|
2947
3119
|
}
|
|
2948
3120
|
}
|
|
2949
|
-
class
|
|
3121
|
+
class hs {
|
|
2950
3122
|
constructor(e2, t2, s2, n2, r2, i2) {
|
|
2951
|
-
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new
|
|
3123
|
+
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new ls({ tokenChanged(e3) {
|
|
2952
3124
|
}, tokenRefreshFailed(e3) {
|
|
2953
3125
|
}, tokenAccepted(e3) {
|
|
2954
3126
|
} }), this.sessionExpiryWarningTimeoutId = void 0, i2 && (n2 || r2)) throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");
|
|
@@ -3029,13 +3201,18 @@ class ds {
|
|
|
3029
3201
|
});
|
|
3030
3202
|
}
|
|
3031
3203
|
checkJwt(e2) {
|
|
3204
|
+
!function(e3) {
|
|
3205
|
+
if ("string" == typeof e3 || e3 instanceof String) return;
|
|
3206
|
+
if (void 0 === e3) throw "Token was undefined";
|
|
3207
|
+
throw "Token must be a string, got: " + e3;
|
|
3208
|
+
}(e2);
|
|
3032
3209
|
const t2 = [];
|
|
3033
3210
|
let s2, n2, r2;
|
|
3034
3211
|
if ("string" == typeof e2 ? s2 = e2 : t2.push(`Token type is ${typeof e2} instead of a string.`), s2) try {
|
|
3035
3212
|
const e3 = function(e4) {
|
|
3036
3213
|
const t3 = e4.split(".");
|
|
3037
3214
|
if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
|
|
3038
|
-
return { header:
|
|
3215
|
+
return { header: ds(t3[0]), payload: ds(t3[1]) };
|
|
3039
3216
|
}(s2);
|
|
3040
3217
|
n2 = e3.header, r2 = e3.payload;
|
|
3041
3218
|
} catch (e3) {
|
|
@@ -3049,7 +3226,7 @@ class ds {
|
|
|
3049
3226
|
const e3 = this.checkJwtPayload(r2);
|
|
3050
3227
|
t2.push(...e3);
|
|
3051
3228
|
}
|
|
3052
|
-
if (t2.length) if (this.usingBokens)
|
|
3229
|
+
if (t2.length) if (this.usingBokens) cs.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
|
|
3053
3230
|
else {
|
|
3054
3231
|
console.warn("[TalkJS] Authentication token appears to be generated incorrectly. Will still attempt to authenticate, but TalkJS may not work as expected. See below for a description of any problems and how to fix them.");
|
|
3055
3232
|
const s3 = t2.length > 1;
|
|
@@ -3078,7 +3255,7 @@ class ds {
|
|
|
3078
3255
|
sendBokenRequest(e2, t2) {
|
|
3079
3256
|
return __async(this, null, function* () {
|
|
3080
3257
|
let s2 = 0;
|
|
3081
|
-
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield
|
|
3258
|
+
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield ts({ method: "GET", url: n2, attempts: 1e4, shouldRetry: (e3) => {
|
|
3082
3259
|
if (e3 instanceof Error) return true;
|
|
3083
3260
|
if (401 === e3.status) throw "Check that you provided a valid signature.";
|
|
3084
3261
|
if (404 === e3.status) throw "Check that you specified the correct App ID.";
|
|
@@ -3091,7 +3268,7 @@ class ds {
|
|
|
3091
3268
|
});
|
|
3092
3269
|
}
|
|
3093
3270
|
}
|
|
3094
|
-
function
|
|
3271
|
+
function ds(e2) {
|
|
3095
3272
|
try {
|
|
3096
3273
|
const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
3097
3274
|
return JSON.parse(s2);
|
|
@@ -3099,8 +3276,8 @@ function ps(e2) {
|
|
|
3099
3276
|
throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
|
|
3100
3277
|
}
|
|
3101
3278
|
}
|
|
3102
|
-
const
|
|
3103
|
-
class
|
|
3279
|
+
const ps = new es("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
|
|
3280
|
+
class fs {
|
|
3104
3281
|
constructor(e2) {
|
|
3105
3282
|
this.target = e2;
|
|
3106
3283
|
}
|
|
@@ -3108,7 +3285,7 @@ class gs {
|
|
|
3108
3285
|
return this.target;
|
|
3109
3286
|
}
|
|
3110
3287
|
}
|
|
3111
|
-
const
|
|
3288
|
+
const gs = new class {
|
|
3112
3289
|
constructor() {
|
|
3113
3290
|
this.registry = {};
|
|
3114
3291
|
}
|
|
@@ -3116,7 +3293,7 @@ const ms = new class {
|
|
|
3116
3293
|
var _a2;
|
|
3117
3294
|
const t2 = this.key(e2), s2 = (_a2 = this.registry[t2]) == null ? void 0 : _a2.deref();
|
|
3118
3295
|
if (s2) return s2;
|
|
3119
|
-
const n2 = new
|
|
3296
|
+
const n2 = new vs(e2), r2 = globalThis.WeakRef ? new WeakRef(n2) : new fs(n2);
|
|
3120
3297
|
return this.registry[t2] = r2, n2;
|
|
3121
3298
|
}
|
|
3122
3299
|
deregister(e2, t2) {
|
|
@@ -3127,10 +3304,10 @@ const ms = new class {
|
|
|
3127
3304
|
return `${e2}:${t2}`;
|
|
3128
3305
|
}
|
|
3129
3306
|
}();
|
|
3130
|
-
function
|
|
3131
|
-
return e2.forceCreateNew ? new
|
|
3307
|
+
function ms(e2) {
|
|
3308
|
+
return e2.forceCreateNew ? new vs(e2) : gs.getOrCreate(e2);
|
|
3132
3309
|
}
|
|
3133
|
-
class
|
|
3310
|
+
class vs {
|
|
3134
3311
|
constructor(e2) {
|
|
3135
3312
|
!function(e3) {
|
|
3136
3313
|
function t3(e4, t4) {
|
|
@@ -3140,11 +3317,13 @@ class bs {
|
|
|
3140
3317
|
void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of TalkSession#constructor must be a function.");
|
|
3141
3318
|
}(e2);
|
|
3142
3319
|
const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
|
|
3143
|
-
this._appId = t2, this._apiUrls = e2.apiUrls ? new
|
|
3320
|
+
this._appId = t2, this._apiUrls = e2.apiUrls ? new es(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : ps, this._authProvider = new hs(this._apiUrls, t2, s2, n2, r2, i2);
|
|
3321
|
+
const a2 = Math.random().toString().split(".")[1];
|
|
3322
|
+
this._realtimeClient = new ge(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.1.1", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new be(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
|
|
3144
3323
|
console.error(`[TalkSession] ${e3}`);
|
|
3145
3324
|
}), function(e3, t3, s3) {
|
|
3146
3325
|
return __async(this, null, function* () {
|
|
3147
|
-
return
|
|
3326
|
+
return ts({ method: "GET", url: `${t3}/${e3}/app`, authProvider: s3 }).then((e4) => 200 === e4.status || 404 !== e4.status && (console.warn(`[TalkJS] Received unexpected ${e4.status} status code when validating app ID. Assuming that the app ID is valid.`), true)).catch((e4) => {
|
|
3148
3327
|
if ("string" != typeof e4 && "status" in e4) {
|
|
3149
3328
|
const t4 = e4;
|
|
3150
3329
|
return 200 === t4.status || 404 !== t4.status && (console.warn(`[TalkJS] Received unexpected ${t4.status} status code when validating app ID. Assuming that the app ID is valid.`), true);
|
|
@@ -3165,37 +3344,37 @@ class bs {
|
|
|
3165
3344
|
}), { unsubscribe: () => t2.resolve("UNSUBSCRIBED") };
|
|
3166
3345
|
}
|
|
3167
3346
|
user(e2) {
|
|
3168
|
-
return new
|
|
3347
|
+
return new be(e2, this._realtimeClient);
|
|
3169
3348
|
}
|
|
3170
3349
|
conversation(e2) {
|
|
3171
|
-
return new
|
|
3350
|
+
return new Zt(e2, this._realtimeClient);
|
|
3172
3351
|
}
|
|
3173
3352
|
terminate(e2) {
|
|
3174
|
-
|
|
3353
|
+
gs.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
|
|
3175
3354
|
}
|
|
3176
3355
|
_isConnected() {
|
|
3177
3356
|
return this._realtimeClient.isConnected();
|
|
3178
3357
|
}
|
|
3179
3358
|
uploadFile(e2, t2) {
|
|
3180
|
-
return
|
|
3359
|
+
return bs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
|
|
3181
3360
|
}
|
|
3182
3361
|
uploadImage(e2, t2) {
|
|
3183
|
-
return
|
|
3362
|
+
return bs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
|
|
3184
3363
|
}
|
|
3185
3364
|
uploadVideo(e2, t2) {
|
|
3186
|
-
return
|
|
3365
|
+
return bs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
|
|
3187
3366
|
}
|
|
3188
3367
|
uploadAudio(e2, t2) {
|
|
3189
|
-
return
|
|
3368
|
+
return bs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
|
|
3190
3369
|
}
|
|
3191
3370
|
uploadVoice(e2, t2) {
|
|
3192
|
-
return
|
|
3371
|
+
return bs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
|
|
3193
3372
|
}
|
|
3194
3373
|
}
|
|
3195
|
-
function
|
|
3374
|
+
function bs(_0, _1, _2, _3) {
|
|
3196
3375
|
return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
|
|
3197
3376
|
const u2 = new FormData();
|
|
3198
|
-
return u2.set("file", s2, r2), void 0 !== n2 && u2.set("subtype", n2), void 0 !== i2 && u2.set("width", i2.toString()), void 0 !== a2 && u2.set("height", a2.toString()), void 0 !== o2 && u2.set("duration", o2.toString()),
|
|
3377
|
+
return u2.set("file", s2, r2), void 0 !== n2 && u2.set("subtype", n2), void 0 !== i2 && u2.set("width", i2.toString()), void 0 !== a2 && u2.set("height", a2.toString()), void 0 !== o2 && u2.set("duration", o2.toString()), ts({ method: "POST", url: e2, data: u2, authProvider: t2 }).then((e3) => e3.json()).then((e3) => e3.attachmentToken).catch((e3) => __async(this, null, function* () {
|
|
3199
3378
|
if (e3 instanceof Response) {
|
|
3200
3379
|
const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
|
|
3201
3380
|
throw new Error(s3);
|
|
@@ -3205,7 +3384,7 @@ function ws(_0, _1, _2, _3) {
|
|
|
3205
3384
|
});
|
|
3206
3385
|
}
|
|
3207
3386
|
export {
|
|
3208
|
-
|
|
3387
|
+
ms as getTalkSession,
|
|
3209
3388
|
f as registerPolyfills
|
|
3210
3389
|
};
|
|
3211
3390
|
//# sourceMappingURL=talkSession.js.map
|