@talkjs/core 1.6.0 → 1.6.2

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.
@@ -56,7 +56,7 @@ var __async = (__this, __arguments, generator) => {
56
56
  step((generator = generator.apply(__this, __arguments)).next());
57
57
  });
58
58
  };
59
- var _a, _e2, _t2;
59
+ var _a, _b, _e2, _t2;
60
60
  function e(e2, s2) {
61
61
  if (s2.ok) return s2.value.data;
62
62
  if ("SESSION_DESTROYED" === s2.value) throw new Error(`${e2} failed because the session was destroyed`);
@@ -135,7 +135,7 @@ let p = null;
135
135
  function f({ WebSocket: e2 }) {
136
136
  p = e2;
137
137
  }
138
- class g {
138
+ class m {
139
139
  constructor(e2, t2) {
140
140
  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: () => {
141
141
  const e3 = new (function() {
@@ -184,9 +184,9 @@ class g {
184
184
  this.stateMachine.transition("destroy");
185
185
  }
186
186
  }
187
- class m {
187
+ class g {
188
188
  constructor(e2, t2) {
189
- this.handlers = t2, this.socket = new g(e2, { onOpen: () => this.handlers.onOpen(), onClose: () => this.handlers.onClose(), onMessage: (e3) => this.onWebSocketMessage(e3) });
189
+ this.handlers = t2, this.socket = new m(e2, { onOpen: () => this.handlers.onOpen(), onClose: () => this.handlers.onClose(), onMessage: (e3) => this.onWebSocketMessage(e3) });
190
190
  }
191
191
  call(e2, t2, s2, n2) {
192
192
  const r2 = `/${s2.map((e3) => encodeURIComponent(e3)).join("/")}`, i2 = JSON.stringify([e2, t2, r2, n2]);
@@ -235,7 +235,8 @@ class v {
235
235
  void 0 !== this.timeout && (clearTimeout(this.timeout), this.timeout = void 0);
236
236
  }
237
237
  }
238
- class w {
238
+ const w = "undefined" != typeof window ? (_a = window.queueMicrotask) != null ? _a : setTimeout : setTimeout;
239
+ class b {
239
240
  constructor() {
240
241
  this.i = -1;
241
242
  }
@@ -246,9 +247,9 @@ class w {
246
247
  this.i = -1;
247
248
  }
248
249
  }
249
- class b {
250
+ class y {
250
251
  constructor(e2, t2) {
251
- this.handlers = t2, this.seqCounter = new w(), this.responseHandlers = {}, this.heartbeats = new y(this), this.socket = new m(e2, { onUpstreamRestarting: () => {
252
+ this.handlers = t2, this.seqCounter = new b(), this.responseHandlers = {}, this.heartbeats = new C(this), this.socket = new g(e2, { onUpstreamRestarting: () => {
252
253
  this.heartbeats.serverActive(), this.handlers.onUpstreamRestarting();
253
254
  }, onOpen: () => {
254
255
  this.heartbeats.clientActive(), this.heartbeats.serverActive(), this.handlers.onReady();
@@ -264,11 +265,19 @@ class b {
264
265
  this.heartbeats.serverActive(), this.handlers.onAuthExpired();
265
266
  } });
266
267
  }
268
+ sync() {
269
+ return __async(this, null, function* () {
270
+ yield new Promise((e3) => w(() => e3()));
271
+ const e2 = Object.values(this.responseHandlers).map((e3) => e3.promise.catch(() => {
272
+ }));
273
+ return Promise.all(e2);
274
+ });
275
+ }
267
276
  call(e2, t2, s2) {
268
277
  const n2 = this.seqCounter.next(), r2 = d();
269
278
  this.responseHandlers[n2] = r2;
270
279
  const i2 = this.socket.call(n2, e2, t2, s2);
271
- return i2.ok || r2.resolve(i2), this.heartbeats.clientActive(), r2.promise;
280
+ return i2.ok || (r2.resolve(i2), delete this.responseHandlers[n2]), this.heartbeats.clientActive(), r2.promise;
272
281
  }
273
282
  onResponse(e2, t2, s2) {
274
283
  return __async(this, null, function* () {
@@ -291,7 +300,7 @@ class b {
291
300
  this.socket.terminate();
292
301
  }
293
302
  }
294
- class y {
303
+ class C {
295
304
  constructor(e2) {
296
305
  this.connection = e2, this.clientInactivityTimer = new v(25e3), this.serverInactivityTimer = new v(1e4), this.serverTimeoutTimer = new v(5e3);
297
306
  }
@@ -315,7 +324,7 @@ class y {
315
324
  });
316
325
  }
317
326
  }
318
- class C {
327
+ class A {
319
328
  constructor(e2, t2, s2) {
320
329
  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* () {
321
330
  yield this.renewSession();
@@ -333,7 +342,7 @@ class C {
333
342
  "READY" !== e3 && "RENEWING_SESSION" !== e3 || this.handlers.onNotReady(), this.authProvider.clearScheduledRefresh();
334
343
  } }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
335
344
  this.authProvider.clearScheduledRefresh(), this.connection.destroy();
336
- } } }), this.connection = new b(e2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onReady: () => this.stateMachine.transition("logIn"), onNotReady: () => {
345
+ } } }), this.connection = new y(e2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onReady: () => this.stateMachine.transition("logIn"), onNotReady: () => {
337
346
  this.stateMachine.transition("wsDisconnected");
338
347
  }, onAuthExpired: () => {
339
348
  this.stateMachine.transition("authExpired");
@@ -343,6 +352,11 @@ class C {
343
352
  "READY" === this.stateMachine.state && this.stateMachine.transition("scheduledReauth");
344
353
  });
345
354
  }
355
+ sync() {
356
+ return __async(this, null, function* () {
357
+ return this.connection.sync();
358
+ });
359
+ }
346
360
  call(e2, t2, s2) {
347
361
  const n2 = this.connection.call(e2, t2, s2);
348
362
  return n2.then((e3) => {
@@ -353,7 +367,8 @@ class C {
353
367
  this.connection.stopWs();
354
368
  }
355
369
  startWs() {
356
- this.connection.startWs();
370
+ this.connection.startWs(), this.authProvider.getToken().catch(() => {
371
+ });
357
372
  }
358
373
  destroy() {
359
374
  this.stateMachine.transition("destroy");
@@ -381,7 +396,7 @@ class C {
381
396
  });
382
397
  }
383
398
  }
384
- class A {
399
+ class E {
385
400
  constructor(e2, t2, s2) {
386
401
  this.handlers = s2, this.stateMachine = new u("StopStartConnection", ["STOPPED", "WAITING_FOR_WS", "READY", "TERMINATED"], { unexpectedDisconnect: { from: ["READY"], to: "WAITING_FOR_WS", afterTransition: () => {
387
402
  this.inactivityTimer.stop(), this.handlers.onNotReady();
@@ -395,7 +410,7 @@ class A {
395
410
  }), this.handlers.onReady();
396
411
  } }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
397
412
  this.inactivityTimer.stop(), this.connection.destroy();
398
- } } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new v(3e3), this.connection = new C(e2, t2, { onUpstreamRestarting: () => {
413
+ } } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new v(3e3), this.connection = new A(e2, t2, { onUpstreamRestarting: () => {
399
414
  this.handlers.onUpstreamRestarting();
400
415
  }, onReady: () => {
401
416
  this.stateMachine.transition("ready");
@@ -408,6 +423,11 @@ class A {
408
423
  get inactive() {
409
424
  return 0 === this.pendingCalls && 0 === this.activeSubscriptions;
410
425
  }
426
+ sync() {
427
+ return __async(this, null, function* () {
428
+ return this.connection.sync();
429
+ });
430
+ }
411
431
  ensureStarted() {
412
432
  this.stateMachine.canTransition("start") && this.stateMachine.transition("start");
413
433
  }
@@ -429,7 +449,7 @@ class A {
429
449
  logTrace(e2, t2, s2) {
430
450
  }
431
451
  }
432
- class E {
452
+ class k {
433
453
  constructor(e2, t2, s2) {
434
454
  this.handlers = s2, this.stateMachine = new u("QueuedConnection", ["NOT_READY", "PROCESSING_QUEUE", "READY", "TERMINATED"], { processQueue: { from: ["NOT_READY"], to: "PROCESSING_QUEUE", afterTransition: () => {
435
455
  this.sendQueuedCalls();
@@ -444,7 +464,7 @@ class E {
444
464
  e3 == null ? void 0 : e3.clientErr("SESSION_DESTROYED");
445
465
  }
446
466
  this.connection.destroy();
447
- } } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new A(e2, t2, { onUpstreamRestarting: () => {
467
+ } } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new E(e2, t2, { onUpstreamRestarting: () => {
448
468
  this.handlers.onUpstreamRestarting();
449
469
  }, onReady: () => {
450
470
  this.stateMachine.transition("processQueue");
@@ -454,6 +474,11 @@ class E {
454
474
  this.handlers.onPublish(e3, t3);
455
475
  } });
456
476
  }
477
+ sync() {
478
+ return __async(this, null, function* () {
479
+ return this.connection.sync();
480
+ });
481
+ }
457
482
  call(e2, t2, s2) {
458
483
  return "READY" === this.stateMachine.state ? this.connection.call(e2, t2, s2) : ("NOT_READY" === this.stateMachine.state && this.connection.ensureStarted(), "SUBSCRIBE" === e2 || "UNSUBSCRIBE" === e2 ? this._subscribe(e2, t2, s2) : this._call(e2, t2, s2));
459
484
  }
@@ -495,10 +520,10 @@ class E {
495
520
  return "READY" === this.stateMachine.state || "PROCESSING_QUEUE" === this.stateMachine.state;
496
521
  }
497
522
  }
498
- const k = "undefined" != typeof window ? (_a = window.queueMicrotask) != null ? _a : setTimeout : setTimeout;
499
- class x {
523
+ const x = "undefined" != typeof window ? (_b = window.queueMicrotask) != null ? _b : setTimeout : setTimeout;
524
+ class T {
500
525
  constructor(e2, t2) {
501
- this.clearPendingBatch = e2, this.sendCalls = t2, this.sent = false, k(() => this.send());
526
+ this.clearPendingBatch = e2, this.sendCalls = t2, this.sent = false, x(() => this.send());
502
527
  }
503
528
  send() {
504
529
  this.sent || (this.sent = true, this.clearPendingBatch(), this.sendCalls());
@@ -507,14 +532,14 @@ class x {
507
532
  this.sent = true;
508
533
  }
509
534
  }
510
- class T extends x {
535
+ class I extends T {
511
536
  constructor(e2, t2) {
512
537
  super(t2, () => {
513
538
  this.sendSubscribe(), this.sendGet();
514
539
  }), this.connection = e2, this.getCalls = [], this.subscribeCalls = [];
515
540
  }
516
541
  canPush(e2, t2) {
517
- return T.isCorrectBatchTypeFor(e2, t2);
542
+ return I.isCorrectBatchTypeFor(e2, t2);
518
543
  }
519
544
  static isCorrectBatchTypeFor(e2, t2) {
520
545
  return s(t2, ["users", "*"]) && ("GET" === e2 || "SUBSCRIBE" === e2);
@@ -540,12 +565,12 @@ class T extends x {
540
565
  this.connection.call("SUBSCRIBE", ["users"], { ids: e2 }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
541
566
  }
542
567
  }
543
- class I extends x {
568
+ class D extends T {
544
569
  constructor(e2, t2, s2) {
545
570
  super(s2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
546
571
  }
547
572
  canPush(e2, t2) {
548
- return !!I.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
573
+ return !!D.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
549
574
  }
550
575
  static isCorrectBatchTypeFor(e2, t2) {
551
576
  return s(t2, ["conversations", "*", "participants", "*"]) && ("PUT" === e2 || "POST" === e2 || "PATCH" === e2);
@@ -566,9 +591,14 @@ class I extends x {
566
591
  });
567
592
  }
568
593
  }
569
- class D {
594
+ class S {
570
595
  constructor(e2, t2, s2) {
571
- this.pendingBatch = null, this.connection = new E(e2, t2, s2);
596
+ this.pendingBatch = null, this.connection = new k(e2, t2, s2);
597
+ }
598
+ sync() {
599
+ return __async(this, null, function* () {
600
+ return this.connection.sync();
601
+ });
572
602
  }
573
603
  call(e2, t2, s2) {
574
604
  return __async(this, null, function* () {
@@ -587,18 +617,23 @@ class D {
587
617
  return this.connection.isConnected();
588
618
  }
589
619
  createEmptyBatchFor(e2, t2) {
590
- if (T.isCorrectBatchTypeFor(e2, t2)) return new T(this.connection, () => this.pendingBatch = null);
591
- if (I.isCorrectBatchTypeFor(e2, t2)) {
620
+ if (I.isCorrectBatchTypeFor(e2, t2)) return new I(this.connection, () => this.pendingBatch = null);
621
+ if (D.isCorrectBatchTypeFor(e2, t2)) {
592
622
  const e3 = t2[1];
593
- return new I(e3, this.connection, () => this.pendingBatch = null);
623
+ return new D(e3, this.connection, () => this.pendingBatch = null);
594
624
  }
595
625
  return null;
596
626
  }
597
627
  }
598
- const S = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
599
- class M {
628
+ const M = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
629
+ class F {
600
630
  constructor(e2, t2, s2) {
601
- this.throttler = new F(), this.alive = true, this.connection = new D(e2, t2, s2);
631
+ this.throttler = new B(), this.alive = true, this.connection = new S(e2, t2, s2);
632
+ }
633
+ sync() {
634
+ return __async(this, null, function* () {
635
+ return this.connection.sync();
636
+ });
602
637
  }
603
638
  call(e2, t2, s2) {
604
639
  return __async(this, null, function* () {
@@ -607,7 +642,7 @@ class M {
607
642
  const r2 = yield this.connection.call(e2, t2, s2);
608
643
  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;
609
644
  if (r2.ok || "client" !== r2.where) {
610
- const e3 = r2.value, t3 = e3.status, s3 = S[t3];
645
+ const e3 = r2.value, t3 = e3.status, s3 = M[t3];
611
646
  if ("RESOLVE" === s3) return this.throttler.resetDelay(), r2;
612
647
  if ("RETRY" === s3) continue;
613
648
  if ("DELAY" === s3) {
@@ -629,7 +664,7 @@ class M {
629
664
  return this.connection.isConnected();
630
665
  }
631
666
  }
632
- class F {
667
+ class B {
633
668
  constructor() {
634
669
  this.initialDelayMs = 200, this.exponentialFactor = 1.2, this.maxDelayMs = 3e4, this.currentDelayMs = this.initialDelayMs, this.lastCall = 0;
635
670
  }
@@ -644,21 +679,21 @@ class F {
644
679
  this.currentDelayMs = this.initialDelayMs;
645
680
  }
646
681
  }
647
- function B(e2) {
682
+ function R(e2) {
648
683
  return e2.map((e3) => encodeURIComponent(e3)).join();
649
684
  }
650
- class R {
685
+ class N {
651
686
  constructor() {
652
687
  this.paths = {};
653
688
  }
654
689
  add(e2) {
655
- this.paths[B(e2)] = e2;
690
+ this.paths[R(e2)] = e2;
656
691
  }
657
692
  delete(e2) {
658
- delete this.paths[B(e2)];
693
+ delete this.paths[R(e2)];
659
694
  }
660
695
  has(e2) {
661
- return Object.hasOwnProperty.call(this.paths, B(e2));
696
+ return Object.hasOwnProperty.call(this.paths, R(e2));
662
697
  }
663
698
  clear() {
664
699
  this.paths = {};
@@ -667,9 +702,9 @@ class R {
667
702
  Object.values(this.paths).forEach((t2) => e2(t2));
668
703
  }
669
704
  }
670
- class N {
705
+ class _ {
671
706
  constructor(e2, t2, s2) {
672
- this.handlers = s2, this.targetSubscriptions = new R(), this.connection = new M(e2, t2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onSubscriptionsLost: () => {
707
+ this.handlers = s2, this.targetSubscriptions = new N(), this.connection = new F(e2, t2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onSubscriptionsLost: () => {
673
708
  this.targetSubscriptions.forEach((e3) => {
674
709
  this.resubscribe(e3);
675
710
  }), this.handlers.onResubscribeSent();
@@ -677,6 +712,11 @@ class N {
677
712
  this.handlers.onPublish(e3, t3);
678
713
  } });
679
714
  }
715
+ sync() {
716
+ return __async(this, null, function* () {
717
+ return this.connection.sync();
718
+ });
719
+ }
680
720
  call(e2, t2, s2) {
681
721
  return this.connection.call(e2, t2, s2);
682
722
  }
@@ -703,22 +743,22 @@ class N {
703
743
  return this.connection.isConnected();
704
744
  }
705
745
  }
706
- function _(e2) {
746
+ function O(e2) {
707
747
  return Object.freeze(e2);
708
748
  }
709
- function O(e2) {
710
- return _(e2.map((e3) => function(e4) {
749
+ function P(e2) {
750
+ return O(e2.map((e3) => function(e4) {
711
751
  switch (e4.type) {
712
752
  case "text":
713
- return Object.freeze({ type: "text", children: P(e4.children) });
753
+ return Object.freeze({ type: "text", children: j(e4.children) });
714
754
  case "file":
715
755
  case "location":
716
756
  return Object.freeze(e4);
717
757
  }
718
758
  }(e3)));
719
759
  }
720
- function P(e2) {
721
- return _(e2.map((e3) => function(e4) {
760
+ function j(e2) {
761
+ return O(e2.map((e3) => function(e4) {
722
762
  if ("string" == typeof e4) return e4;
723
763
  switch (e4.type) {
724
764
  case "bold":
@@ -729,7 +769,7 @@ function P(e2) {
729
769
  case "link":
730
770
  case "actionLink":
731
771
  case "actionButton":
732
- return Object.freeze(__spreadProps(__spreadValues({}, e4), { children: P(e4.children) }));
772
+ return Object.freeze(__spreadProps(__spreadValues({}, e4), { children: j(e4.children) }));
733
773
  case "mention":
734
774
  case "autoLink":
735
775
  case "codeSpan":
@@ -741,38 +781,38 @@ function P(e2) {
741
781
  function U(e2, t2) {
742
782
  return void 0 === t2 ? e2 : t2;
743
783
  }
744
- function j(e2, t2) {
745
- return void 0 === t2 ? e2 : _(t2);
746
- }
747
784
  function $(e2, t2) {
785
+ return void 0 === t2 ? e2 : O(t2);
786
+ }
787
+ function W(e2, t2) {
748
788
  if (void 0 === t2) return e2;
749
- if (null === t2) return _({});
789
+ if (null === t2) return O({});
750
790
  const s2 = __spreadValues({}, e2);
751
791
  for (const e3 in t2) {
752
792
  const n2 = t2[e3];
753
793
  null === n2 ? delete s2[e3] : s2[e3] = n2;
754
794
  }
755
- return _(s2);
795
+ return O(s2);
756
796
  }
757
- function W(e2, t2) {
797
+ function q(e2, t2) {
758
798
  if (e2 === t2) return true;
759
799
  if (!e2 || !t2) return false;
760
800
  if ("object" != typeof e2 || "object" != typeof t2) return false;
761
801
  if (e2.constructor !== t2.constructor) return false;
762
802
  if (Array.isArray(e2) && Array.isArray(t2)) {
763
803
  if (e2.length !== t2.length) return false;
764
- for (let s2 = 0; s2 < e2.length; s2++) if (!W(e2[s2], t2[s2])) return false;
804
+ for (let s2 = 0; s2 < e2.length; s2++) if (!q(e2[s2], t2[s2])) return false;
765
805
  } else {
766
806
  const s2 = Object.keys(e2);
767
807
  if (s2.length !== Object.keys(t2).length) return false;
768
808
  for (const n2 of s2) {
769
809
  if (!Object.hasOwnProperty.call(t2, n2)) return false;
770
- if (!W(e2[n2], t2[n2])) return false;
810
+ if (!q(e2[n2], t2[n2])) return false;
771
811
  }
772
812
  }
773
813
  return true;
774
814
  }
775
- class q {
815
+ class H {
776
816
  constructor() {
777
817
  this.prev = Promise.resolve();
778
818
  }
@@ -782,8 +822,14 @@ class q {
782
822
  return this.prev = t2, t2;
783
823
  });
784
824
  }
825
+ sync() {
826
+ return __async(this, null, function* () {
827
+ return this.runExclusive(() => {
828
+ });
829
+ });
830
+ }
785
831
  }
786
- class H {
832
+ class L {
787
833
  constructor(e2) {
788
834
  this.initialised = false, this.getPointer = void 0, this.pendingStates = [e2], e2.resultPromise.then(() => this.initialised = true);
789
835
  }
@@ -795,10 +841,10 @@ class H {
795
841
  return (_a2 = this.pendingPointer) != null ? _a2 : this.getPointer;
796
842
  }
797
843
  canAppendState(e2) {
798
- var _a2, _b;
844
+ var _a2, _b2;
799
845
  const t2 = (_a2 = this.getPointer) == null ? void 0 : _a2.seq;
800
846
  if (void 0 !== t2 && e2 <= t2) return false;
801
- const s2 = (_b = this.pendingPointer) == null ? void 0 : _b.seq;
847
+ const s2 = (_b2 = this.pendingPointer) == null ? void 0 : _b2.seq;
802
848
  return !(void 0 !== s2 && e2 < s2);
803
849
  }
804
850
  set(e2) {
@@ -816,7 +862,7 @@ class H {
816
862
  return this.getPointer;
817
863
  }
818
864
  }
819
- class L extends H {
865
+ class G extends L {
820
866
  constructor(e2, t2) {
821
867
  super(e2), this.onTeardown = t2, this._error = null, this._lastGoodState = Promise.resolve(void 0), this.registerNewState(e2.resultPromise);
822
868
  }
@@ -845,10 +891,10 @@ class L extends H {
845
891
  }));
846
892
  }
847
893
  }
848
- class G extends L {
894
+ class z extends G {
849
895
  constructor(e2, t2) {
850
896
  const s2 = new Promise((e3) => setTimeout(e3)).then(() => this.fetchInitial(e2));
851
- super({ seq: e2, resultPromise: s2 }, t2.onTeardown), this.initialSeq = e2, this.getDeepMutex = new q(), this.lastDeep = void 0;
897
+ super({ seq: e2, resultPromise: s2 }, t2.onTeardown), this.initialSeq = e2, this.getDeepMutex = new H(), this.lastDeep = void 0;
852
898
  }
853
899
  refetchInitial(e2) {
854
900
  return __async(this, null, function* () {
@@ -891,31 +937,35 @@ class G extends L {
891
937
  });
892
938
  }
893
939
  }
894
- class z extends G {
940
+ class J extends z {
895
941
  constructor(e2, t2, s2) {
896
- super(e2, s2), this.emitMutex = t2, this.unsubscribeTimer = new J(), this.referencedByOtherStores = 0, this.listeners = [], this.lastEmitSeq = void 0, this.lastEmitResult = void 0, t2.runExclusive(() => __async(this, null, function* () {
942
+ super(e2, s2), this.emitMutex = t2, this.externallyIdleTimer = new Y(), this.externallyIdle = true, this.internallyIdleTimer = new Y(), this.internallyIdle = true, this.referencedByOtherStores = 0, this.listeners = [], this.lastEmitSeq = void 0, this.lastEmitResult = void 0, t2.runExclusive(() => __async(this, null, function* () {
897
943
  yield this.emit(e2);
898
944
  }));
899
945
  }
900
946
  registerInternalSubscription() {
901
- this.referencedByOtherStores++;
947
+ this.internallyIdleTimer.stop(), this.internallyIdle = false, this.referencedByOtherStores++;
902
948
  let e2 = true;
903
949
  return () => {
904
- e2 && (e2 = false, this.referencedByOtherStores--, this.startUnsubscribeTimerIfOrphan());
950
+ e2 && (e2 = false, this.referencedByOtherStores--, 0 === this.referencedByOtherStores && this.internallyIdleTimer.restart(() => {
951
+ this.internallyIdle = true, this.tryFullyUnsubscribe();
952
+ }, this.unsubscribeDebounceMs), this.tryFullyUnsubscribe());
905
953
  };
906
954
  }
907
955
  get onlyUsedInternally() {
908
956
  return 0 === this.listeners.length;
909
957
  }
910
958
  listen(e2) {
911
- return this.unsubscribeTimer.stop(), this.listeners.push(e2), void 0 !== this.lastEmitResult && e2(this.lastEmitResult), () => {
912
- this.listeners = this.listeners.filter((t2) => t2 !== e2), this.startUnsubscribeTimerIfOrphan();
959
+ this.externallyIdleTimer.stop(), this.externallyIdle = false, this.listeners.push(e2), void 0 !== this.lastEmitResult && e2(this.lastEmitResult);
960
+ let t2 = true;
961
+ return () => {
962
+ t2 && (t2 = false, this.listeners = this.listeners.filter((t3) => t3 !== e2), 0 === this.listeners.length && this.externallyIdleTimer.restart(() => {
963
+ this.externallyIdle = true, this.tryFullyUnsubscribe();
964
+ }, this.unsubscribeDebounceMs));
913
965
  };
914
966
  }
915
- startUnsubscribeTimerIfOrphan() {
916
- 0 === this.referencedByOtherStores && 0 === this.listeners.length && this.unsubscribeTimer.restart(() => {
917
- this.setError(l("UNSUBSCRIBED"));
918
- }, this.unsubscribeDebounceMs);
967
+ tryFullyUnsubscribe() {
968
+ this.externallyIdle && this.internallyIdle && this.setError(l("UNSUBSCRIBED"));
919
969
  }
920
970
  emit(e2) {
921
971
  return __async(this, null, function* () {
@@ -928,7 +978,7 @@ class z extends G {
928
978
  });
929
979
  }
930
980
  }
931
- class J {
981
+ class Y {
932
982
  constructor() {
933
983
  this.timerId = void 0;
934
984
  }
@@ -939,33 +989,33 @@ class J {
939
989
  clearTimeout(this.timerId);
940
990
  }
941
991
  }
942
- var Y, Q = {};
992
+ var Q, V = {};
943
993
  !function() {
944
- if (Y) return Q;
994
+ if (Q) return V;
945
995
  function e2(e3) {
946
996
  return String.fromCharCode(parseInt(e3.slice(1), 16));
947
997
  }
948
998
  function t2(e3) {
949
999
  return `%${`00${e3.charCodeAt(0).toString(16)}`.slice(-2)}`;
950
1000
  }
951
- Y = 1, Object.defineProperty(Q, "__esModule", { value: true }), Q.encode = function(t3) {
1001
+ Q = 1, Object.defineProperty(V, "__esModule", { value: true }), V.encode = function(t3) {
952
1002
  return btoa(encodeURIComponent(t3).replace(/%[0-9A-F]{2}/g, e2));
953
- }, Q.decode = function(e3) {
1003
+ }, V.decode = function(e3) {
954
1004
  return decodeURIComponent(Array.from(atob(e3), t2).join(""));
955
1005
  };
956
1006
  }();
957
- function V(e2, t2) {
1007
+ function Z(e2, t2) {
958
1008
  const s2 = t2.lastIndex;
959
1009
  let n2;
960
1010
  const r2 = [];
961
- for (; null !== (n2 = t2.exec(e2)); ) r2.push(n2);
1011
+ for (; null !== (n2 = t2.exec(e2)); ) r2.push(n2), "" === n2[0] && (t2.lastIndex += 1);
962
1012
  return t2.lastIndex = s2, r2;
963
1013
  }
964
- function Z(e2) {
1014
+ function K(e2) {
965
1015
  const t2 = e2.replace(/%2F/g, "/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/, "$1");
966
1016
  return decodeURIComponent(t2);
967
1017
  }
968
- function K(e2, t2) {
1018
+ function X(e2, t2) {
969
1019
  if (!e2() && !t2) {
970
1020
  t2 = e2.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/, "`$1`") + " was not true";
971
1021
  }
@@ -1001,51 +1051,55 @@ function K(e2, t2) {
1001
1051
  }, e2.falsy = function(e3) {
1002
1052
  }, e2.never = function(e3) {
1003
1053
  };
1004
- })(K || (K = {}));
1005
- const X = K, ee = /^\/.*[^\\]\/[im]*$/;
1006
- function te(e2) {
1007
- if (!ee.test(e2)) return false;
1008
- return !se(e2).test("");
1009
- }
1054
+ })(X || (X = {}));
1055
+ const ee = X, te = /^\/.*[^\\]\/[im]*$/;
1010
1056
  function se(e2) {
1057
+ if (!te.test(e2)) return false;
1058
+ return !ne(e2).test("");
1059
+ }
1060
+ function ne(e2) {
1011
1061
  const t2 = e2.match(/^\/(.*[^\\])\/(.*)$/);
1012
1062
  if (!t2) throw new Error(`Expected ${e2} to be a (non-empty) regex`);
1013
1063
  let s2 = t2[2] || "";
1014
1064
  return s2 = s2.replace(/[^im]/g, "") + "g", new RegExp(t2[1], s2);
1015
1065
  }
1016
- class ne {
1017
- constructor({ mode: e2, allowedHostnames: t2, allowedPhoneNrs: s2, allowedMatches: n2, forbiddenMatches: r2, suppressLinks: i2, suppressEmailAddresses: a2, suppressPhoneNumbers: o2, replacement: u2 }) {
1018
- X.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(te).map((e3) => se(e3)), this.forbiddenMatches = (r2 || []).filter(te).map((e3) => se(e3)), X(() => this.allowedMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"), X(() => 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;
1066
+ class re {
1067
+ constructor({ mode: e2, allowedHostnames: t2, allowedPhoneNrs: s2, allowedMatches: n2, forbiddenMatches: r2, forbiddenWords: i2, suppressLinks: a2, suppressEmailAddresses: o2, suppressPhoneNumbers: u2, replacement: c2 }) {
1068
+ if (ee.oneOf(e2, ["all", "otherOnly", "off"]), this.mode = e2, this.suppressLinks = false !== a2, this.suppressEmailAddresses = false !== o2, this.suppressPhoneNumbers = false !== u2, this.allowedHostnames = t2 || [], this.allowedPhoneNrs = (s2 || []).filter((e3) => e3).map((e3) => e3.replace(/[^0-9]/g, "")), this.allowedMatches = (n2 || []).filter(se).map((e3) => ne(e3)), this.forbiddenMatches = (r2 || []).filter(se).map((e3) => ne(e3)), i2) {
1069
+ const e3 = i2.split("\n").map((e4) => e4.trim().toLowerCase()).filter((e4) => e4.length > 0 && !e4.startsWith("#")).map((e4) => e4.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"));
1070
+ e3.length && this.forbiddenMatches.push(new RegExp(`\\b(${e3.join("|")})\\b`, "gi"));
1071
+ }
1072
+ ee(() => this.allowedMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"), ee(() => this.forbiddenMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"), c2 = c2 == null ? void 0 : c2.trim(), this.replacement = c2 && c2.length > 0 ? c2 : void 0;
1019
1073
  }
1020
1074
  shouldSuppress({ isContentBySender: e2 }) {
1021
1075
  return "all" === this.mode || "otherOnly" === this.mode && !e2;
1022
1076
  }
1023
1077
  }
1024
- function re(e2, t2) {
1078
+ function ie(e2, t2) {
1025
1079
  const s2 = e2.map((e3) => function(e4, t3) {
1026
1080
  if ("text" === e4.type) return function(e5, t4) {
1027
1081
  const s3 = function(e6) {
1028
- var _a2, _b, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m;
1082
+ var _a2, _b2, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m;
1029
1083
  let t5 = "";
1030
- 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: (_e3 = e6.enableEmojiImageFallback) != null ? _e3 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new ne({ 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 : {}, enableActions: (_m = e6.enableActions) != null ? _m : true };
1084
+ return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b2 = e6.markup) != null ? _b2 : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [], enableEmojiImageFallback: (_e3 = e6.enableEmojiImageFallback) != null ? _e3 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new re({ 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 : {}, enableActions: (_m = e6.enableActions) != null ? _m : true };
1031
1085
  }(t4);
1032
- return ie(e5, s3);
1086
+ return ae(e5, s3);
1033
1087
  }(e4.children, t3);
1034
- if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${Z(e4.url)}`;
1035
- if ("file" === e4.type && "image" === e4.subtype) return `📷 ${Z(e4.url)}`;
1036
- if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${Z(e4.url)}`;
1088
+ if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${K(e4.url)}`;
1089
+ if ("file" === e4.type && "image" === e4.subtype) return `📷 ${K(e4.url)}`;
1090
+ if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${K(e4.url)}`;
1037
1091
  if ("file" === e4.type && "voice" === e4.subtype) {
1038
1092
  const t4 = e4.duration;
1039
1093
  if (void 0 === t4) return "🎙️";
1040
1094
  return `🎙️ (${Math.floor(t4 / 60)}:${Math.floor(t4 % 60).toString().padStart(2, "0")})`;
1041
1095
  }
1042
- if ("file" === e4.type) return e4.subtype, `📎 ${Z(e4.url)}`;
1096
+ if ("file" === e4.type) return e4.subtype, `📎 ${K(e4.url)}`;
1043
1097
  if ("location" === e4.type) return "📍";
1044
1098
  return "";
1045
1099
  }(e3, t2));
1046
1100
  return s2.join("\n\n");
1047
1101
  }
1048
- function ie(e2, t2) {
1102
+ function ae(e2, t2) {
1049
1103
  return e2.flatMap((e3) => {
1050
1104
  if ("string" == typeof e3) return e3;
1051
1105
  switch (e3.type) {
@@ -1058,13 +1112,13 @@ function ie(e2, t2) {
1058
1112
  case "actionLink":
1059
1113
  case "actionbutton":
1060
1114
  case "actionButton":
1061
- return ie(e3.children, t2);
1115
+ return ae(e3.children, t2);
1062
1116
  case "bulletlist":
1063
1117
  case "bulletList":
1064
- return "\n" + ie(e3.children, t2);
1118
+ return "\n" + ae(e3.children, t2);
1065
1119
  case "bulletpoint":
1066
1120
  case "bulletPoint":
1067
- return "- " + ie(e3.children, t2) + "\n";
1121
+ return "- " + ae(e3.children, t2) + "\n";
1068
1122
  case "autolink":
1069
1123
  case "autoLink":
1070
1124
  case "codeblock":
@@ -1082,28 +1136,28 @@ function ie(e2, t2) {
1082
1136
  }
1083
1137
  }).join("");
1084
1138
  }
1085
- function ae(e2) {
1086
- return _({ id: e2.id, name: e2.name, custom: _(e2.custom), locale: e2.locale, photoUrl: e2.photoUrl, role: e2.role, welcomeMessage: e2.welcomeMessage });
1139
+ function oe(e2) {
1140
+ return O({ id: e2.id, name: e2.name, custom: O(e2.custom), locale: e2.locale, photoUrl: e2.photoUrl, role: e2.role, welcomeMessage: e2.welcomeMessage });
1087
1141
  }
1088
- function oe(e2, t2) {
1089
- return _({ user: t2, access: e2.access, notify: e2.notify, joinedAt: e2.joinedAt });
1142
+ function ue(e2, t2) {
1143
+ return O({ user: t2, access: e2.access, notify: e2.notify, joinedAt: e2.joinedAt });
1090
1144
  }
1091
- function ue(e2) {
1092
- const t2 = Object.entries(e2).map(([e3, t3]) => _({ emoji: e3, count: t3.count, currentUserReacted: t3.currentUserReacted }));
1093
- return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), _(t2);
1145
+ function ce(e2) {
1146
+ const t2 = Object.entries(e2).map(([e3, t3]) => O({ emoji: e3, count: t3.count, currentUserReacted: t3.currentUserReacted }));
1147
+ return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), O(t2);
1094
1148
  }
1095
- class ce extends z {
1149
+ class le extends J {
1096
1150
  constructor(e2, t2, s2, n2, r2) {
1097
- super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
1151
+ super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 3e4;
1098
1152
  }
1099
1153
  fetchInitial(e2) {
1100
1154
  return __async(this, null, function* () {
1101
1155
  const t2 = yield this.realtimeClient.call("GET", ["users", this.userId], { includePrivateFields: false }, { bypassCache: true });
1102
- return t2.ok ? c({ snapshot: ae(t2.value.data), lastChanged: e2 }) : "server" === t2.where && 404 === t2.value.status ? c({ snapshot: null, lastChanged: e2 }) : t2;
1156
+ return t2.ok ? c({ snapshot: oe(t2.value.data), lastChanged: e2 }) : "server" === t2.where && 404 === t2.value.status ? c({ snapshot: null, lastChanged: e2 }) : t2;
1103
1157
  });
1104
1158
  }
1105
1159
  equal(e2, t2) {
1106
- return W(e2.snapshot, t2.snapshot);
1160
+ return q(e2.snapshot, t2.snapshot);
1107
1161
  }
1108
1162
  loadNested(e2, t2) {
1109
1163
  return __async(this, null, function* () {
@@ -1111,13 +1165,13 @@ class ce extends z {
1111
1165
  });
1112
1166
  }
1113
1167
  userCreated(e2, t2) {
1114
- this.mutate(e2, (s2) => null !== s2.value.snapshot ? s2 : c({ snapshot: ae(t2.state), lastChanged: e2 }));
1168
+ this.mutate(e2, (s2) => null !== s2.value.snapshot ? s2 : c({ snapshot: oe(t2.state), lastChanged: e2 }));
1115
1169
  }
1116
1170
  userEdited(e2, t2) {
1117
1171
  this.mutate(e2, (s2) => {
1118
1172
  const n2 = s2.value.snapshot;
1119
1173
  if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
1120
- return c({ snapshot: { id: n2.id, name: U(n2.name, t2.diff.name), custom: $(n2.custom, t2.diff.custom), locale: U(n2.locale, t2.diff.locale), photoUrl: U(n2.photoUrl, t2.diff.photoUrl), role: U(n2.role, t2.diff.role), welcomeMessage: U(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
1174
+ return c({ snapshot: { id: n2.id, name: U(n2.name, t2.diff.name), custom: W(n2.custom, t2.diff.custom), locale: U(n2.locale, t2.diff.locale), photoUrl: U(n2.photoUrl, t2.diff.photoUrl), role: U(n2.role, t2.diff.role), welcomeMessage: U(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
1121
1175
  });
1122
1176
  }
1123
1177
  getFromCache() {
@@ -1134,7 +1188,7 @@ class ce extends z {
1134
1188
  });
1135
1189
  }
1136
1190
  }
1137
- class le extends G {
1191
+ class he extends z {
1138
1192
  constructor(e2, t2, s2, n2) {
1139
1193
  super(e2, {}), this.conversationId = t2, this.message = s2, this.realtimeClient = n2;
1140
1194
  }
@@ -1150,14 +1204,14 @@ class le extends G {
1150
1204
  if (!e3.ok) return e3;
1151
1205
  t2 = e3.value.data;
1152
1206
  }
1153
- 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: re(t2.content, {}), content: O(t2.content), reactions: ue(t2.reactions) } });
1207
+ return c({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: O(t2.custom), createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext: ie(t2.content, {}), content: P(t2.content), reactions: ce(t2.reactions) } });
1154
1208
  });
1155
1209
  }
1156
1210
  refetch(e2) {
1157
1211
  throw "Do not call refetch on message data stores, it can return outdated data. Destroy and remake them instead";
1158
1212
  }
1159
1213
  equal(e2, t2) {
1160
- return W(e2.data, t2.data);
1214
+ return q(e2.data, t2.data);
1161
1215
  }
1162
1216
  teardownNested(e2) {
1163
1217
  var _a2;
@@ -1172,21 +1226,21 @@ class le extends G {
1172
1226
  }
1173
1227
  loadNested(e2, t2) {
1174
1228
  return __async(this, null, function* () {
1175
- var _a2, _b, _c;
1176
- const s2 = yield (_b = (_a2 = t2.sender) == null ? void 0 : _a2.store) == null ? void 0 : _b.getDeep(e2);
1229
+ var _a2, _b2, _c;
1230
+ const s2 = yield (_b2 = (_a2 = t2.sender) == null ? void 0 : _a2.store) == null ? void 0 : _b2.getDeep(e2);
1177
1231
  if (false === (s2 == null ? void 0 : s2.ok)) return s2;
1178
1232
  if (null === t2.data) return c({ snapshot: null });
1179
1233
  const n2 = s2 == null ? void 0 : s2.value;
1180
- 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: t2.data.plaintext, content: t2.data.content, referencedMessageId: t2.data.referencedMessageId, reactions: t2.data.reactions }) });
1234
+ return c({ snapshot: O({ sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: O(t2.data.custom), createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: t2.data.plaintext, content: t2.data.content, referencedMessageId: t2.data.referencedMessageId, reactions: t2.data.reactions }) });
1181
1235
  });
1182
1236
  }
1183
1237
  messageEdited(e2, t2) {
1184
1238
  this.mutate(e2, (s2) => {
1185
1239
  if (null === s2.value.data) return s2;
1186
- const n2 = s2.value.data.content, r2 = (i2 = n2, void 0 === (a2 = t2.diff.content) ? i2 : O(a2));
1240
+ const n2 = s2.value.data.content, r2 = (i2 = n2, void 0 === (a2 = t2.diff.content) ? i2 : P(a2));
1187
1241
  var i2, a2;
1188
- const o2 = n2 === r2 ? s2.value.data.plaintext : re(r2, {});
1189
- 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: U(s2.value.data.editedAt, t2.diff.editedAt), custom: $(s2.value.data.custom, t2.diff.custom), plaintext: o2, content: r2, reactions: he(s2.value.data.reactions, t2.diff.reactions) } });
1242
+ const o2 = n2 === r2 ? s2.value.data.plaintext : ie(r2, {});
1243
+ 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: U(s2.value.data.editedAt, t2.diff.editedAt), custom: W(s2.value.data.custom, t2.diff.custom), plaintext: o2, content: r2, reactions: de(s2.value.data.reactions, t2.diff.reactions) } });
1190
1244
  });
1191
1245
  }
1192
1246
  messageDeleted(e2, t2) {
@@ -1194,7 +1248,7 @@ class le extends G {
1194
1248
  }
1195
1249
  getFromCache() {
1196
1250
  return __async(this, null, function* () {
1197
- var _b;
1251
+ var _b2;
1198
1252
  const e2 = yield this.mostRecentState.resultPromise;
1199
1253
  if (!e2.ok) return l("NOT_IN_CACHE");
1200
1254
  if (null === e2.value.data) {
@@ -1203,23 +1257,23 @@ class le extends G {
1203
1257
  const _a2 = e2.value, { sender: t2 } = _a2, s2 = __objRest(_a2, ["sender"]), n2 = {};
1204
1258
  return s2.data.reactions.forEach((e3) => {
1205
1259
  n2[e3.emoji] = { count: e3.count, currentUserReacted: e3.currentUserReacted };
1206
- }), c({ status: 200, data: __spreadProps(__spreadValues({}, s2.data), { senderId: (_b = t2 == null ? void 0 : t2.store.userId) != null ? _b : null, reactions: n2 }) });
1260
+ }), c({ status: 200, data: __spreadProps(__spreadValues({}, s2.data), { senderId: (_b2 = t2 == null ? void 0 : t2.store.userId) != null ? _b2 : null, reactions: n2 }) });
1207
1261
  });
1208
1262
  }
1209
1263
  }
1210
- function he(e2, t2) {
1264
+ function de(e2, t2) {
1211
1265
  if (void 0 === t2) return e2;
1212
1266
  const s2 = e2.map((e3) => {
1213
1267
  const s3 = t2[e3.emoji];
1214
- return void 0 === s3 ? e3 : _(null === s3 ? __spreadProps(__spreadValues({}, e3), { count: 0 }) : { emoji: e3.emoji, count: U(e3.count, s3.count), currentUserReacted: U(e3.currentUserReacted, s3.currentUserReacted) });
1268
+ return void 0 === s3 ? e3 : O(null === s3 ? __spreadProps(__spreadValues({}, e3), { count: 0 }) : { emoji: e3.emoji, count: U(e3.count, s3.count), currentUserReacted: U(e3.currentUserReacted, s3.currentUserReacted) });
1215
1269
  }).filter((e3) => e3.count > 0), n2 = new Set(s2.map((e3) => e3.emoji));
1216
1270
  for (const e3 in t2) {
1217
1271
  const r2 = t2[e3];
1218
- r2 && !n2.has(e3) && s2.push(_({ emoji: e3, count: r2.count, currentUserReacted: r2.currentUserReacted }));
1272
+ r2 && !n2.has(e3) && s2.push(O({ emoji: e3, count: r2.count, currentUserReacted: r2.currentUserReacted }));
1219
1273
  }
1220
- return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), _(s2);
1274
+ return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), O(s2);
1221
1275
  }
1222
- class de extends G {
1276
+ class pe extends z {
1223
1277
  constructor(e2, t2, s2, n2) {
1224
1278
  super(e2, {}), this.createdAt = t2, this.dataStore = s2, this.referencedDataStore = n2;
1225
1279
  }
@@ -1247,21 +1301,21 @@ class de extends G {
1247
1301
  }
1248
1302
  loadNested(e2, t2) {
1249
1303
  return __async(this, null, function* () {
1250
- var _a2, _b, _c;
1304
+ var _a2, _b2, _c;
1251
1305
  const s2 = yield t2.dataStore.getDeep(e2);
1252
1306
  if (!s2.ok) return s2;
1253
1307
  const n2 = s2.value;
1254
1308
  if (null === n2.snapshot) return c({ snapshot: null });
1255
1309
  const r2 = yield (_a2 = t2.referencedDataStore) == null ? void 0 : _a2.getDeep(e2);
1256
1310
  if (r2 && !r2.ok) return r2;
1257
- const i2 = (_b = r2 == null ? void 0 : r2.value) != null ? _b : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
1258
- return c({ snapshot: _({ id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: _(n2.snapshot.custom), createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: a2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content, reactions: n2.snapshot.reactions }) });
1311
+ const i2 = (_b2 = r2 == null ? void 0 : r2.value) != null ? _b2 : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
1312
+ return c({ snapshot: O({ id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: O(n2.snapshot.custom), createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: a2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content, reactions: n2.snapshot.reactions }) });
1259
1313
  });
1260
1314
  }
1261
1315
  }
1262
- class pe extends z {
1316
+ class fe extends J {
1263
1317
  constructor(e2, t2, s2, n2, r2) {
1264
- super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
1318
+ super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e4, this.pendingLoadMore = void 0;
1265
1319
  }
1266
1320
  listen(e2) {
1267
1321
  return this.onlyUsedInternally && this.mostRecentState.resultPromise.then((e3) => {
@@ -1273,7 +1327,7 @@ class pe extends z {
1273
1327
  }
1274
1328
  fetchInitial(e2) {
1275
1329
  return __async(this, null, function* () {
1276
- const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield fe({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
1330
+ const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield me({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
1277
1331
  return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) : ge({ seq: e2, messages: s2.value.messages, cursor: s2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : s2;
1278
1332
  });
1279
1333
  }
@@ -1305,14 +1359,14 @@ class pe extends z {
1305
1359
  });
1306
1360
  }
1307
1361
  equal(e2, t2) {
1308
- return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!W(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && W(e2.windowEnd, t2.windowEnd)));
1362
+ return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!q(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!q(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && q(e2.windowEnd, t2.windowEnd)));
1309
1363
  }
1310
1364
  loadNested(e2, t2) {
1311
1365
  return __async(this, null, function* () {
1312
1366
  if (null === t2.stores) return c({ snapshot: null, loadedAll: true });
1313
1367
  const s2 = yield Promise.all(t2.inWindow.map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
1314
1368
  if (n2) return n2;
1315
- return c({ snapshot: _(s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot)), loadedAll: null === t2.windowEnd });
1369
+ return c({ snapshot: O(s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot)), loadedAll: null === t2.windowEnd });
1316
1370
  });
1317
1371
  }
1318
1372
  loadMore(e2) {
@@ -1327,7 +1381,7 @@ class pe extends z {
1327
1381
  const t2 = yield this.mostRecentState.resultPromise;
1328
1382
  if (!t2.ok) return;
1329
1383
  if (null === t2.value.windowEnd) return;
1330
- const s2 = t2.value.windowEnd.cursor, n2 = yield fe({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
1384
+ const s2 = t2.value.windowEnd.cursor, n2 = yield me({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
1331
1385
  yield this.handlers.onLoadedMore({ type: "virtual.messages.loadedmore", conversationId: this.conversationId, data: n2 });
1332
1386
  });
1333
1387
  }
@@ -1339,12 +1393,12 @@ class pe extends z {
1339
1393
  if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."), s2;
1340
1394
  if (s2.value.windowEnd && t2.state.createdAt < s2.value.windowEnd.oldestMessageTs) return s2;
1341
1395
  if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
1342
- const n2 = __spreadValues({}, s2.value.stores), r2 = new le(e2, this.conversationId, t2.state, this.realtimeClient);
1396
+ const n2 = __spreadValues({}, s2.value.stores), r2 = new he(e2, this.conversationId, t2.state, this.realtimeClient);
1343
1397
  n2[t2.state.id] = r2;
1344
1398
  const i2 = t2.state.referencedMessageId;
1345
1399
  let a2;
1346
- null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new le(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
1347
- const o2 = new de(e2, t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
1400
+ null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new he(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
1401
+ const o2 = new pe(e2, t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
1348
1402
  u2.sort((e3, t3) => t3.createdAt - e3.createdAt);
1349
1403
  const l2 = u2[0].messageId === t2.messageId ? e2 : s2.value.lastMessageChanged;
1350
1404
  return c({ lastChanged: e2, lastMessageChanged: l2, stores: n2, inWindow: u2, windowEnd: s2.value.windowEnd });
@@ -1364,12 +1418,12 @@ class pe extends z {
1364
1418
  delete n2[t2.messageId];
1365
1419
  const r2 = s2.value.inWindow.filter((e3) => e3.messageId !== t2.messageId);
1366
1420
  if (t2.newLastMessage && 0 === r2.length) {
1367
- const s3 = new le(e2, this.conversationId, t2.newLastMessage, this.realtimeClient);
1421
+ const s3 = new he(e2, this.conversationId, t2.newLastMessage, this.realtimeClient);
1368
1422
  n2[s3.messageId] = s3;
1369
1423
  const i3 = t2.newLastMessage.referencedMessageId;
1370
1424
  let a2;
1371
- null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new le(e2, this.conversationId, i3, this.realtimeClient), n2[i3] = a2);
1372
- const o2 = new de(e2, t2.newLastMessage.createdAt, s3, a2);
1425
+ null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new he(e2, this.conversationId, i3, this.realtimeClient), n2[i3] = a2);
1426
+ const o2 = new pe(e2, t2.newLastMessage.createdAt, s3, a2);
1373
1427
  r2.push(o2);
1374
1428
  }
1375
1429
  const i2 = void 0 !== t2.newLastMessage ? e2 : s2.value.lastMessageChanged;
@@ -1401,7 +1455,7 @@ class pe extends z {
1401
1455
  });
1402
1456
  }
1403
1457
  }
1404
- function fe(_0) {
1458
+ function me(_0) {
1405
1459
  return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
1406
1460
  const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "messages"], r2, { bypassCache: true });
1407
1461
  if (i2.ok) {
@@ -1412,29 +1466,29 @@ function fe(_0) {
1412
1466
  });
1413
1467
  }
1414
1468
  function ge({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
1415
- var _a2, _b, _c, _d;
1469
+ var _a2, _b2, _c, _d;
1416
1470
  const a2 = t2 ? __spreadValues({}, t2.stores) : {};
1417
1471
  for (const t3 of s2) if (void 0 === a2[t3.id]) {
1418
- const s3 = new le(e2, r2, t3, i2);
1472
+ const s3 = new he(e2, r2, t3, i2);
1419
1473
  a2[s3.messageId] = s3;
1420
1474
  }
1421
1475
  for (const t3 of s2) {
1422
1476
  const s3 = t3.referencedMessageId;
1423
1477
  if (s3 && void 0 === a2[s3]) {
1424
- const t4 = new le(e2, r2, s3, i2);
1478
+ const t4 = new he(e2, r2, s3, i2);
1425
1479
  a2[t4.messageId] = t4;
1426
1480
  }
1427
1481
  }
1428
1482
  const o2 = t2 ? [...t2.inWindow] : [];
1429
- for (const t3 of s2) o2.push(new de(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
1483
+ for (const t3 of s2) o2.push(new pe(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
1430
1484
  o2.sort((e3, t3) => t3.createdAt - e3.createdAt);
1431
- 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;
1485
+ const u2 = (_b2 = (_a2 = t2 == null ? void 0 : t2.inWindow) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.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;
1432
1486
  if (null === n2) return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: null });
1433
1487
  return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: { cursor: n2, oldestMessageTs: s2[s2.length - 1].createdAt } });
1434
1488
  }
1435
- class me extends z {
1489
+ class ve extends J {
1436
1490
  constructor(e2, t2, s2, n2, r2) {
1437
- super(e2, n2, r2), this.convData = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 0;
1491
+ super(e2, n2, r2), this.convData = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 3e4;
1438
1492
  }
1439
1493
  fetchInitial(e2) {
1440
1494
  return __async(this, null, function* () {
@@ -1463,19 +1517,19 @@ class me extends z {
1463
1517
  });
1464
1518
  }
1465
1519
  }
1466
- function ve(e2, t2) {
1520
+ function we(e2, t2) {
1467
1521
  for (let s2 in e2) Object.prototype.hasOwnProperty.call(e2, s2) && t2(e2[s2], s2);
1468
1522
  }
1469
- function we(e2, t2) {
1523
+ function be(e2, t2) {
1470
1524
  return function(e3, t3) {
1471
1525
  let s2 = {}, n2 = 0;
1472
- return ve(e3, (e4, r2) => {
1526
+ return we(e3, (e4, r2) => {
1473
1527
  const [i2, a2] = t3([r2, e4], n2++);
1474
1528
  s2[i2] = a2;
1475
1529
  }), s2;
1476
1530
  }(e2, ([e3, s2]) => [e3, t2(s2, e3)]);
1477
1531
  }
1478
- class be extends z {
1532
+ class ye extends J {
1479
1533
  constructor(e2, t2, s2, n2, r2) {
1480
1534
  super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
1481
1535
  }
@@ -1487,24 +1541,24 @@ class be extends z {
1487
1541
  if (!t2.ok) return t2;
1488
1542
  const s2 = t2.value.data;
1489
1543
  if (s2.many) return c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
1490
- return c({ data: s2, userSubscriptions: we(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
1544
+ return c({ data: s2, userSubscriptions: be(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
1491
1545
  });
1492
1546
  }
1493
1547
  equal(e2, t2) {
1494
- return W(e2.data, t2.data);
1548
+ return q(e2.data, t2.data);
1495
1549
  }
1496
1550
  loadNested(e2, t2) {
1497
1551
  return __async(this, null, function* () {
1498
1552
  if (null === t2.data) return c({ snapshot: null, lastChanged: t2.lastChanged });
1499
- if (t2.data.many) return c({ snapshot: _({ many: true }), lastChanged: t2.lastChanged });
1553
+ if (t2.data.many) return c({ snapshot: O({ many: true }), lastChanged: t2.lastChanged });
1500
1554
  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);
1501
1555
  if (r2) return r2;
1502
1556
  const i2 = n2.map((e3) => e3.value), a2 = i2.map((e3) => e3.snapshot), o2 = i2.map((e3) => e3.lastChanged), u2 = Math.max(t2.lastChanged, ...o2);
1503
- return c({ snapshot: _({ users: _(a2), many: false }), lastChanged: u2 });
1557
+ return c({ snapshot: O({ users: O(a2), many: false }), lastChanged: u2 });
1504
1558
  });
1505
1559
  }
1506
1560
  typingAvailable(e2, t2) {
1507
- this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : we(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
1561
+ this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : be(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
1508
1562
  }
1509
1563
  typingChanged(e2, t2) {
1510
1564
  this.mutate(e2, (s2) => {
@@ -1512,7 +1566,7 @@ class be extends z {
1512
1566
  if (void 0 === t2.diff.many) {
1513
1567
  if (true === s2.value.data.many) return s2;
1514
1568
  const n2 = __spreadValues({}, s2.value.data.usersTyping), r2 = __spreadValues({}, s2.value.userSubscriptions);
1515
- return ve(t2.diff.usersTyping, (e3, t3) => {
1569
+ return we(t2.diff.usersTyping, (e3, t3) => {
1516
1570
  var _a2;
1517
1571
  "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]);
1518
1572
  }), c({ data: { usersTyping: n2, many: false }, userSubscriptions: r2, lastChanged: e2 });
@@ -1520,7 +1574,7 @@ class be extends z {
1520
1574
  if (true === t2.diff.many) return s2.value.data.many ? s2 : c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
1521
1575
  if (false === t2.diff.many) {
1522
1576
  if (false === s2.value.data.many) return s2;
1523
- const n2 = we(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
1577
+ const n2 = be(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
1524
1578
  return c({ data: t2.diff, userSubscriptions: n2, lastChanged: e2 });
1525
1579
  }
1526
1580
  throw t2.diff, "Unreachable";
@@ -1530,7 +1584,7 @@ class be extends z {
1530
1584
  this.mutate(e2, (t3) => null === t3.value.data ? t3 : c({ data: null, lastChanged: e2 }));
1531
1585
  }
1532
1586
  teardownNested(e2) {
1533
- e2.data && ve(e2.userSubscriptions, (e3) => e3.unsubscribe());
1587
+ e2.data && we(e2.userSubscriptions, (e3) => e3.unsubscribe());
1534
1588
  }
1535
1589
  anyChildChanged(e2, t2, s2) {
1536
1590
  return __async(this, null, function* () {
@@ -1544,7 +1598,7 @@ class be extends z {
1544
1598
  });
1545
1599
  }
1546
1600
  }
1547
- class ye extends G {
1601
+ class Ce extends z {
1548
1602
  constructor(e2, t2, s2, n2) {
1549
1603
  super(e2, {}), this.conversationId = t2, this.participantData = s2, this.realtimeClient = n2;
1550
1604
  }
@@ -1557,8 +1611,8 @@ class ye extends G {
1557
1611
  throw "Do not call refetch on participant data stores, it can return outdated data. Destroy and remake them instead";
1558
1612
  }
1559
1613
  equal(e2, t2) {
1560
- var _a2, _b, _c, _d;
1561
- return ((_b = (_a2 = e2.user) == null ? void 0 : _a2.store) == null ? void 0 : _b.userId) === ((_d = (_c = t2.user) == null ? void 0 : _c.store) == null ? void 0 : _d.userId) && W(e2.data, t2.data);
1614
+ var _a2, _b2, _c, _d;
1615
+ return ((_b2 = (_a2 = e2.user) == null ? void 0 : _a2.store) == null ? void 0 : _b2.userId) === ((_d = (_c = t2.user) == null ? void 0 : _c.store) == null ? void 0 : _d.userId) && q(e2.data, t2.data);
1562
1616
  }
1563
1617
  teardownNested(e2) {
1564
1618
  var _a2;
@@ -1577,7 +1631,7 @@ class ye extends G {
1577
1631
  const s2 = yield t2.user.store.getDeep(e2);
1578
1632
  if (false === s2.ok) return s2;
1579
1633
  const n2 = s2.value.snapshot;
1580
- return c({ snapshot: oe(t2.data, n2) });
1634
+ return c({ snapshot: ue(t2.data, n2) });
1581
1635
  });
1582
1636
  }
1583
1637
  participantEdited(e2, t2) {
@@ -1600,14 +1654,14 @@ class ye extends G {
1600
1654
  });
1601
1655
  }
1602
1656
  }
1603
- class Ce extends z {
1657
+ class Ae extends J {
1604
1658
  constructor(e2, t2, s2, n2, r2) {
1605
- super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
1659
+ super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 3e4, this.pendingLoadMore = void 0;
1606
1660
  }
1607
1661
  fetchInitial(e2) {
1608
1662
  return __async(this, null, function* () {
1609
- const t2 = yield Ae({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: 10 });
1610
- return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : Ee({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2;
1663
+ const t2 = yield Ee({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: 10 });
1664
+ return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : ke({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2;
1611
1665
  });
1612
1666
  }
1613
1667
  teardownNested(e2) {
@@ -1626,7 +1680,7 @@ class Ce extends z {
1626
1680
  });
1627
1681
  }
1628
1682
  equal(e2, t2) {
1629
- return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && W(e2.windowEnd, t2.windowEnd));
1683
+ return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!q(Object.keys(e2.stores), Object.keys(t2.stores)) && q(e2.windowEnd, t2.windowEnd));
1630
1684
  }
1631
1685
  loadNested(e2, t2) {
1632
1686
  return __async(this, null, function* () {
@@ -1634,7 +1688,7 @@ class Ce extends z {
1634
1688
  const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
1635
1689
  if (n2) return n2;
1636
1690
  const r2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
1637
- return r2.sort((e3, t3) => t3.joinedAt - e3.joinedAt), c({ snapshot: _(r2), loadedAll: null === t2.windowEnd });
1691
+ return r2.sort((e3, t3) => t3.joinedAt - e3.joinedAt), c({ snapshot: O(r2), loadedAll: null === t2.windowEnd });
1638
1692
  });
1639
1693
  }
1640
1694
  loadMore(e2) {
@@ -1649,19 +1703,19 @@ class Ce extends z {
1649
1703
  const t2 = yield this.mostRecentState.resultPromise;
1650
1704
  if (!t2.ok) return;
1651
1705
  if (null === t2.value.windowEnd) return;
1652
- const s2 = t2.value.windowEnd.cursor, n2 = yield Ae({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
1706
+ const s2 = t2.value.windowEnd.cursor, n2 = yield Ee({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
1653
1707
  yield this.handlers.onLoadedMore({ type: "virtual.participants.loadedmore", conversationId: this.conversationId, data: n2 });
1654
1708
  });
1655
1709
  }
1656
1710
  loadedMore(e2, t2) {
1657
- this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), s2) : Ee({ seq: e2, prevStores: s2.value.stores, participants: t2.data.value.participants, cursor: t2.data.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2.data);
1711
+ this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), s2) : ke({ seq: e2, prevStores: s2.value.stores, participants: t2.data.value.participants, cursor: t2.data.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2.data);
1658
1712
  }
1659
1713
  participantCreated(e2, t2) {
1660
1714
  this.mutate(e2, (s2) => {
1661
1715
  if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."), s2;
1662
1716
  if (s2.value.windowEnd && t2.state.joinedAt < s2.value.windowEnd.oldestParticipantTs) return s2;
1663
1717
  if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
1664
- const n2 = __spreadValues({}, s2.value.stores), r2 = new ye(e2, this.conversationId, t2.state, this.realtimeClient);
1718
+ const n2 = __spreadValues({}, s2.value.stores), r2 = new Ce(e2, this.conversationId, t2.state, this.realtimeClient);
1665
1719
  n2[t2.state.id] = r2;
1666
1720
  return c({ lastChanged: e2, stores: n2, windowEnd: s2.value.windowEnd });
1667
1721
  });
@@ -1701,7 +1755,7 @@ class Ce extends z {
1701
1755
  });
1702
1756
  }
1703
1757
  }
1704
- function Ae(_0) {
1758
+ function Ee(_0) {
1705
1759
  return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
1706
1760
  const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "participants"], r2, { bypassCache: true });
1707
1761
  if (i2.ok) {
@@ -1711,23 +1765,23 @@ function Ae(_0) {
1711
1765
  return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 : c({ participants: null, nextCursor: null });
1712
1766
  });
1713
1767
  }
1714
- function Ee({ seq: e2, prevStores: t2, participants: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
1768
+ function ke({ seq: e2, prevStores: t2, participants: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
1715
1769
  const a2 = t2 ? __spreadValues({}, t2) : {};
1716
1770
  for (const t3 of s2) if (void 0 === a2[t3.id]) {
1717
- const s3 = new ye(e2, r2, t3, i2);
1771
+ const s3 = new Ce(e2, r2, t3, i2);
1718
1772
  a2[t3.id] = s3;
1719
1773
  }
1720
1774
  if (null === n2) return c({ lastChanged: e2, stores: a2, windowEnd: null });
1721
1775
  return c({ lastChanged: e2, stores: a2, windowEnd: { cursor: n2, oldestParticipantTs: s2[s2.length - 1].joinedAt } });
1722
1776
  }
1723
- class ke extends z {
1777
+ class xe extends J {
1724
1778
  constructor(e2, t2, s2, n2, r2) {
1725
- super(e2, n2, r2), this.getConvDataStore = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
1779
+ super(e2, n2, r2), this.getConvDataStore = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e4, this.pendingLoadMore = void 0;
1726
1780
  }
1727
1781
  fetchInitial(e2) {
1728
1782
  return __async(this, null, function* () {
1729
- const t2 = yield xe({ realtimeClient: this.realtimeClient, count: 20 });
1730
- return t2.ok ? null === t2.value.conversations ? c({ lastChanged: e2, stores: null, windowEnd: null }) : Te({ seq: e2, conversations: t2.value.conversations, cursor: t2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2;
1783
+ const t2 = yield Te({ realtimeClient: this.realtimeClient, count: 20 });
1784
+ return t2.ok ? null === t2.value.conversations ? c({ lastChanged: e2, stores: null, windowEnd: null }) : Ie({ seq: e2, conversations: t2.value.conversations, cursor: t2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2;
1731
1785
  });
1732
1786
  }
1733
1787
  teardownNested(e2) {
@@ -1744,19 +1798,19 @@ class ke extends z {
1744
1798
  });
1745
1799
  }
1746
1800
  equal(e2, t2) {
1747
- return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && W(e2.windowEnd, t2.windowEnd));
1801
+ return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!q(Object.keys(e2.stores), Object.keys(t2.stores)) && q(e2.windowEnd, t2.windowEnd));
1748
1802
  }
1749
1803
  loadNested(e2, t2) {
1750
1804
  return __async(this, null, function* () {
1751
- if (null === t2.stores) return c({ snapshot: _([]), loadedAll: true });
1805
+ if (null === t2.stores) return c({ snapshot: O([]), loadedAll: true });
1752
1806
  const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.store.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
1753
1807
  if (n2) return n2;
1754
1808
  const r2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
1755
1809
  return r2.sort((e3, t3) => {
1756
- var _a2, _b, _c, _d;
1757
- const s3 = (_b = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b : e3.joinedAt;
1810
+ var _a2, _b2, _c, _d;
1811
+ const s3 = (_b2 = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b2 : e3.joinedAt;
1758
1812
  return ((_d = (_c = t3.lastMessage) == null ? void 0 : _c.createdAt) != null ? _d : t3.joinedAt) - s3;
1759
- }), c({ snapshot: _(r2), loadedAll: null === t2.windowEnd });
1813
+ }), c({ snapshot: O(r2), loadedAll: null === t2.windowEnd });
1760
1814
  });
1761
1815
  }
1762
1816
  loadMore(e2) {
@@ -1771,7 +1825,7 @@ class ke extends z {
1771
1825
  const t2 = yield this.mostRecentState.resultPromise;
1772
1826
  if (!t2.ok) return;
1773
1827
  if (null === t2.value.windowEnd) return;
1774
- const s2 = t2.value.windowEnd.cursor, n2 = yield xe({ count: e2, cursor: s2, realtimeClient: this.realtimeClient });
1828
+ const s2 = t2.value.windowEnd.cursor, n2 = yield Te({ count: e2, cursor: s2, realtimeClient: this.realtimeClient });
1775
1829
  yield this.handlers.onLoadedMore({ type: "virtual.conversations.loadedmore", data: n2 });
1776
1830
  });
1777
1831
  }
@@ -1785,7 +1839,7 @@ class ke extends z {
1785
1839
  });
1786
1840
  }
1787
1841
  loadedMore(e2, t2) {
1788
- this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), s2) : Te({ seq: e2, prevStores: s2.value.stores, conversations: t2.data.value.conversations, cursor: t2.data.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2.data);
1842
+ this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), s2) : Ie({ seq: e2, prevStores: s2.value.stores, conversations: t2.data.value.conversations, cursor: t2.data.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2.data);
1789
1843
  }
1790
1844
  userCreated(e2, t2) {
1791
1845
  this.mutate(e2, (e3) => null !== e3.value.stores ? e3 : c({ lastChanged: e3.value.lastChanged, stores: {}, windowEnd: null }));
@@ -1824,7 +1878,7 @@ class ke extends z {
1824
1878
  });
1825
1879
  }
1826
1880
  }
1827
- function xe(_0) {
1881
+ function Te(_0) {
1828
1882
  return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, count: s2 }) {
1829
1883
  const n2 = { limit: s2, cursor: e2 }, r2 = yield t2.call("GET", ["me", "conversations"], n2, { bypassCache: true });
1830
1884
  if (r2.ok) {
@@ -1834,15 +1888,15 @@ function xe(_0) {
1834
1888
  return r2.ok || "server" !== r2.where || 404 !== r2.value.status || "USER_NOT_FOUND" !== r2.value.errorCode ? r2 : c({ conversations: null, nextCursor: null });
1835
1889
  });
1836
1890
  }
1837
- function Te({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
1891
+ function Ie({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
1838
1892
  const i2 = t2 ? __spreadValues({}, t2) : {};
1839
1893
  for (const e3 of s2) void 0 === i2[e3.id] && (i2[e3.id] = r2(e3));
1840
1894
  if (null === n2) return c({ lastChanged: e2, stores: i2, windowEnd: null });
1841
1895
  return c({ lastChanged: e2, stores: i2, windowEnd: { cursor: n2, oldestMessageTs: Math.min(...s2.map((e3) => e3.lastMessageAt)) } });
1842
1896
  }
1843
- class Ie extends z {
1897
+ class De extends J {
1844
1898
  constructor(e2, t2, s2, n2, r2) {
1845
- super(e2, n2, r2), this.conversation = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 5e3;
1899
+ super(e2, n2, r2), this.conversation = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 0;
1846
1900
  }
1847
1901
  get conversationId() {
1848
1902
  return "string" == typeof this.conversation ? this.conversation : this.conversation.id;
@@ -1872,7 +1926,7 @@ class Ie extends z {
1872
1926
  });
1873
1927
  }
1874
1928
  equal(e2, t2) {
1875
- return W(e2.snapshot, t2.snapshot);
1929
+ return q(e2.snapshot, t2.snapshot);
1876
1930
  }
1877
1931
  loadNested(e2, t2) {
1878
1932
  return __async(this, null, function* () {
@@ -1881,17 +1935,17 @@ class Ie extends z {
1881
1935
  const s2 = yield t2.messageWindow.store.getDeep(e2);
1882
1936
  if (!s2.ok) return s2;
1883
1937
  const n2 = s2.value.snapshot, r2 = (_a2 = n2 == null ? void 0 : n2[0]) != null ? _a2 : null;
1884
- return c({ snapshot: _(__spreadProps(__spreadValues({}, t2.snapshot), { custom: _(t2.snapshot.custom), welcomeMessages: _(t2.snapshot.welcomeMessages), lastMessage: r2 })) });
1938
+ return c({ snapshot: O(__spreadProps(__spreadValues({}, t2.snapshot), { custom: O(t2.snapshot.custom), welcomeMessages: O(t2.snapshot.welcomeMessages), lastMessage: r2 })) });
1885
1939
  });
1886
1940
  }
1887
1941
  participantEdited(e2, t2) {
1888
- 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: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1942
+ 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: Se(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1889
1943
  }
1890
1944
  conversationEdited(e2, t2) {
1891
- 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: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1945
+ 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: Se(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1892
1946
  }
1893
1947
  sideEdited(e2, t2) {
1894
- 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: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1948
+ 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: Se(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1895
1949
  }
1896
1950
  sideCreated(e2, t2) {
1897
1951
  this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindow: s2.value.messageWindow }));
@@ -1906,13 +1960,13 @@ class Ie extends z {
1906
1960
  });
1907
1961
  }
1908
1962
  }
1909
- function De(e2, t2) {
1963
+ function Se(e2, t2) {
1910
1964
  const s2 = t2;
1911
- return { id: e2.id, createdAt: e2.createdAt, subject: U(e2.subject, s2.subject), photoUrl: U(e2.photoUrl, s2.photoUrl), welcomeMessages: j(e2.welcomeMessages, s2.welcomeMessages), custom: $(e2.custom, s2.custom), lastMessageAt: U(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: U(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: U(e2.isUnread, s2.isUnread), access: U(e2.access, s2.access), notify: U(e2.notify, s2.notify), readUntil: U(e2.readUntil, s2.readUntil), everyoneReadUntil: U(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
1965
+ return { id: e2.id, createdAt: e2.createdAt, subject: U(e2.subject, s2.subject), photoUrl: U(e2.photoUrl, s2.photoUrl), welcomeMessages: $(e2.welcomeMessages, s2.welcomeMessages), custom: W(e2.custom, s2.custom), lastMessageAt: U(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: U(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: U(e2.isUnread, s2.isUnread), access: U(e2.access, s2.access), notify: U(e2.notify, s2.notify), readUntil: U(e2.readUntil, s2.readUntil), everyoneReadUntil: U(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
1912
1966
  }
1913
- class Se extends z {
1967
+ class Me extends J {
1914
1968
  constructor(e2, t2, s2, n2, r2) {
1915
- super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e3;
1969
+ super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 3e4;
1916
1970
  }
1917
1971
  fetchInitial(e2) {
1918
1972
  return __async(this, null, function* () {
@@ -1921,7 +1975,7 @@ class Se extends z {
1921
1975
  });
1922
1976
  }
1923
1977
  equal(e2, t2) {
1924
- return W(e2.data, t2.data);
1978
+ return q(e2.data, t2.data);
1925
1979
  }
1926
1980
  teardownNested(e2) {
1927
1981
  e2.user.unsubscribe();
@@ -1936,7 +1990,7 @@ class Se extends z {
1936
1990
  const s2 = yield t2.user.store.getDeep(e2);
1937
1991
  if (!s2.ok) return s2;
1938
1992
  const n2 = s2.value.snapshot;
1939
- return null === t2.data || null === n2 ? c({ snapshot: null }) : c({ snapshot: _(__spreadProps(__spreadValues({}, t2.data), { user: n2 })) });
1993
+ return null === t2.data || null === n2 ? c({ snapshot: null }) : c({ snapshot: O(__spreadProps(__spreadValues({}, t2.data), { user: n2 })) });
1940
1994
  });
1941
1995
  }
1942
1996
  userCreated(e2, t2) {
@@ -1960,9 +2014,9 @@ class Se extends z {
1960
2014
  });
1961
2015
  }
1962
2016
  }
1963
- class Me {
2017
+ class Fe {
1964
2018
  constructor(e2, t2, s2) {
1965
- this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new q(), this.virtualSeqOffset = 0, this.realPublishSeq = 0, this.refetchOnNextNetworkLoss = true, this.connection = new N(e2, t2, { onUpstreamRestarting: () => {
2019
+ this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new H(), this.virtualSeqOffset = 0, this.realPublishSeq = 0, this.refetchOnNextNetworkLoss = true, this.connection = new _(e2, t2, { onUpstreamRestarting: () => {
1966
2020
  this.refetchOnNextNetworkLoss = false;
1967
2021
  }, onReady: () => {
1968
2022
  this.refetchOnNextNetworkLoss = true;
@@ -1974,7 +2028,7 @@ class Me {
1974
2028
  }
1975
2029
  }, onResubscribeError: (e3, t3) => {
1976
2030
  var _a2;
1977
- (_a2 = this.storeMap[Fe(e3)]) == null ? void 0 : _a2.setError(t3);
2031
+ (_a2 = this.storeMap[Be(e3)]) == null ? void 0 : _a2.setError(t3);
1978
2032
  }, onPublish: (e3, t3) => {
1979
2033
  this.realPublishSeq = e3;
1980
2034
  const s3 = this.virtualSeq;
@@ -1985,6 +2039,11 @@ class Me {
1985
2039
  get virtualSeq() {
1986
2040
  return this.realPublishSeq + this.virtualSeqOffset;
1987
2041
  }
2042
+ sync() {
2043
+ return __async(this, null, function* () {
2044
+ yield this.connection.sync(), yield this.emitMutex.sync();
2045
+ });
2046
+ }
1988
2047
  refetchAll(e2) {
1989
2048
  Object.values(this.storeMap).forEach((t2) => t2 == null ? void 0 : t2.refetch(e2));
1990
2049
  }
@@ -1995,10 +2054,10 @@ class Me {
1995
2054
  }));
1996
2055
  }
1997
2056
  handlePublish(e2, t2) {
1998
- var _a2, _b, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t3, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
2057
+ var _a2, _b2, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t3, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
1999
2058
  switch (t2.type) {
2000
2059
  case "user.created":
2001
- return (_a2 = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _a2.userCreated(e2, t2), (_b = this.storeMap["/me/conversations"]) == null ? void 0 : _b.userCreated(e2, t2), void ((_c = this.storeMap[`/users/${t2.userId}/online`]) == null ? void 0 : _c.userCreated(e2, t2));
2060
+ return (_a2 = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _a2.userCreated(e2, t2), (_b2 = this.storeMap["/me/conversations"]) == null ? void 0 : _b2.userCreated(e2, t2), void ((_c = this.storeMap[`/users/${t2.userId}/online`]) == null ? void 0 : _c.userCreated(e2, t2));
2002
2061
  case "user.edited":
2003
2062
  return void ((_d = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _d.userEdited(e2, t2));
2004
2063
  case "side.created":
@@ -2040,28 +2099,32 @@ class Me {
2040
2099
  call(e2, t2, n2, r2) {
2041
2100
  return __async(this, null, function* () {
2042
2101
  if (!r2.bypassCache && "GET" === e2) {
2043
- const e3 = Fe(t2);
2102
+ const e3 = Be(t2);
2044
2103
  if (e3 in this.storeMap) {
2045
2104
  const t3 = e3, s2 = this.storeMap[t3];
2046
2105
  if (s2 && "getFromCache" in s2) {
2106
+ yield this.sync();
2047
2107
  const e4 = yield s2.getFromCache();
2048
2108
  if ("NOT_IN_CACHE" !== e4.value) return e4;
2049
2109
  }
2050
2110
  } else if (s(t2, ["me", "conversations", "*", "messages", "*"])) {
2051
2111
  const e4 = this.storeMap[`/me/conversations/${t2[2]}/messages`];
2052
2112
  if (e4) {
2113
+ yield this.sync();
2053
2114
  const s2 = yield e4.getMessageFromCache(t2[4]);
2054
2115
  if ("NOT_IN_CACHE" !== s2.value) return s2;
2055
2116
  }
2056
2117
  } else if (s(t2, ["me", "conversations", "*", "participants", "*"])) {
2057
2118
  const e4 = this.storeMap[`/me/conversations/${t2[2]}/participants`];
2058
2119
  if (e4) {
2120
+ yield this.sync();
2059
2121
  const s2 = yield e4.getParticipantFromCache(t2[4]);
2060
2122
  if ("NOT_IN_CACHE" !== s2.value) return s2;
2061
2123
  }
2062
2124
  } else if (s(t2, ["me", "conversations", "*"])) {
2063
2125
  const e4 = this.storeMap["/me/conversations"];
2064
2126
  if (e4) {
2127
+ yield this.sync();
2065
2128
  const s2 = yield e4.getConvFromCache(t2[2]);
2066
2129
  if ("NOT_IN_CACHE" !== s2.value) return s2;
2067
2130
  }
@@ -2112,7 +2175,7 @@ class Me {
2112
2175
  });
2113
2176
  }
2114
2177
  getOrCreateStore(e2) {
2115
- const t2 = Fe(e2);
2178
+ const t2 = Be(e2);
2116
2179
  if (t2 in this.storeMap) return this.storeMap[t2];
2117
2180
  this.connection.subscribe(e2).then((e3) => {
2118
2181
  e3.ok || s2.setError(e3);
@@ -2129,13 +2192,13 @@ class Me {
2129
2192
  return this.connection.isConnected();
2130
2193
  }
2131
2194
  instantiateStore(e2, t2) {
2132
- if (s(e2, ["users", "*"])) return new ce(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2133
- if (s(e2, ["me", "conversations", "*"])) return new me(this.virtualSeq, this.subscribeConvData(e2[2]), this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2134
- if (s(e2, ["me", "conversations", "*", "messages"])) return new pe(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2135
- if (s(e2, ["me", "conversations", "*", "participants"])) return new Ce(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2136
- if (s(e2, ["me", "conversations", "*", "typing"])) return new be(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2137
- if (s(e2, ["me", "conversations"])) return new ke(this.virtualSeq, (e3) => this.subscribeConvData(e3), this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2138
- if (s(e2, ["users", "*", "online"])) return new Se(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2195
+ if (s(e2, ["users", "*"])) return new le(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2196
+ if (s(e2, ["me", "conversations", "*"])) return new ve(this.virtualSeq, this.subscribeConvData(e2[2]), this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2197
+ if (s(e2, ["me", "conversations", "*", "messages"])) return new fe(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2198
+ if (s(e2, ["me", "conversations", "*", "participants"])) return new Ae(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2199
+ if (s(e2, ["me", "conversations", "*", "typing"])) return new ye(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2200
+ if (s(e2, ["me", "conversations"])) return new xe(this.virtualSeq, (e3) => this.subscribeConvData(e3), this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2201
+ if (s(e2, ["users", "*", "online"])) return new Me(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2139
2202
  throw "Unreachable";
2140
2203
  }
2141
2204
  subscribeConvData(e2) {
@@ -2144,18 +2207,18 @@ class Me {
2144
2207
  const e3 = this.convDataStores[t2];
2145
2208
  return { store: e3, unsubscribe: e3.registerInternalSubscription() };
2146
2209
  }
2147
- const s2 = new Ie(this.virtualSeq, e2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
2210
+ const s2 = new De(this.virtualSeq, e2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
2148
2211
  delete this.convDataStores[t2];
2149
2212
  } });
2150
2213
  return this.convDataStores[t2] = s2, { store: s2, unsubscribe: s2.registerInternalSubscription() };
2151
2214
  }
2152
2215
  }
2153
- function Fe(e2) {
2216
+ function Be(e2) {
2154
2217
  return `/${e2.join("/")}`;
2155
2218
  }
2156
- class Be {
2219
+ class Re {
2157
2220
  constructor(e2, t2, s2) {
2158
- this.userId = t2, this.alive = true, this.connection = new Me(e2, s2, this), s2.onTokenRefreshFailed(() => {
2221
+ this.userId = t2, this.alive = true, this.connection = new Fe(e2, s2, this), s2.onTokenRefreshFailed(() => {
2159
2222
  this.destroy();
2160
2223
  });
2161
2224
  }
@@ -2177,13 +2240,9 @@ class Be {
2177
2240
  isConnected() {
2178
2241
  return this.connection.isConnected();
2179
2242
  }
2180
- listMessages(e2, t2) {
2243
+ sync() {
2181
2244
  return __async(this, null, function* () {
2182
- const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
2183
- if (!s2.ok) return Re(s2, "Listing messages in " + e2);
2184
- const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.hydrateMessageData(t3, e2))), i2 = r2.find((e3) => !e3.ok);
2185
- if (void 0 !== i2 && !i2.ok) return i2;
2186
- return c(r2.map(({ value: e3 }) => e3));
2245
+ yield this.connection.sync();
2187
2246
  });
2188
2247
  }
2189
2248
  hydrateMessageData(e2, t2) {
@@ -2193,7 +2252,7 @@ class Be {
2193
2252
  const i2 = yield n2;
2194
2253
  if (!i2.ok) return i2;
2195
2254
  const a2 = function(e3, t3, s3) {
2196
- return _({ id: e3.id, type: e3.type, sender: t3, referencedMessage: s3, custom: _(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ue(e3.reactions), plaintext: re(e3.content, {}) });
2255
+ return O({ id: e3.id, type: e3.type, sender: t3, referencedMessage: s3, custom: O(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ce(e3.reactions), plaintext: ie(e3.content, {}) });
2197
2256
  }(e2, r2.value, i2.value);
2198
2257
  return c(a2);
2199
2258
  });
@@ -2203,11 +2262,11 @@ class Be {
2203
2262
  const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
2204
2263
  if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
2205
2264
  if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
2206
- if (!s2.ok) return Re(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
2265
+ if (!s2.ok) return Ne(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
2207
2266
  const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
2208
2267
  if (!r2.ok) return r2;
2209
2268
  const i2 = function(e3, t3) {
2210
- return _({ id: e3.id, type: e3.type, sender: t3, referencedMessageId: e3.referencedMessageId, custom: _(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ue(e3.reactions), plaintext: re(e3.content, {}) });
2269
+ return O({ id: e3.id, type: e3.type, sender: t3, referencedMessageId: e3.referencedMessageId, custom: O(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ce(e3.reactions), plaintext: ie(e3.content, {}) });
2211
2270
  }(n2, r2.value);
2212
2271
  return c(i2);
2213
2272
  });
@@ -2216,20 +2275,20 @@ class Be {
2216
2275
  return __async(this, null, function* () {
2217
2276
  const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
2218
2277
  if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
2219
- if (!t2.ok) return Re(t2, "Get user " + e2);
2220
- return c(ae(t2.value.data));
2278
+ if (!t2.ok) return Ne(t2, "Get user " + e2);
2279
+ return c(oe(t2.value.data));
2221
2280
  });
2222
2281
  }
2223
2282
  }
2224
- function Re(e2, t2) {
2283
+ function Ne(e2, t2) {
2225
2284
  return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
2226
2285
  }
2227
- function Ne(e2, s2) {
2286
+ function _e(e2, s2) {
2228
2287
  var _a2;
2229
2288
  if (s2.ok) return s2.value;
2230
2289
  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));
2231
2290
  }
2232
- class _e {
2291
+ class Oe {
2233
2292
  constructor(e2, t2) {
2234
2293
  this.id = e2, this._realtimeClient = t2;
2235
2294
  }
@@ -2239,7 +2298,7 @@ class _e {
2239
2298
  get() {
2240
2299
  return __async(this, null, function* () {
2241
2300
  const e2 = yield this._realtimeClient.getUser(this.brandedId);
2242
- return Ne("Get user " + this.id, e2);
2301
+ return _e("Get user " + this.id, e2);
2243
2302
  });
2244
2303
  }
2245
2304
  set(t2) {
@@ -2263,7 +2322,7 @@ class _e {
2263
2322
  return this._realtimeClient.subscribe(["users", this.brandedId, "online"], e2);
2264
2323
  }
2265
2324
  }
2266
- class Oe {
2325
+ class Pe {
2267
2326
  constructor(e2, t2, s2) {
2268
2327
  this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
2269
2328
  }
@@ -2278,7 +2337,7 @@ class Oe {
2278
2337
  const t2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedConversationId, "participants", this.brandedUserId], {}), s2 = yield this._realtimeClient.call("GET", ["users", this.brandedUserId], { includePrivateFields: false }), [n2, r2] = yield Promise.all([t2, s2]);
2279
2338
  if (!n2.ok && "server" === n2.where && 404 === n2.value.status) return null;
2280
2339
  if (!r2.ok && "server" === r2.where && 404 === r2.value.status) return null;
2281
- return oe(e(`Get participant ${this.userId} in conversation ${this.conversationId}`, n2), ae(e(`Get user ${this.userId}`, r2)));
2340
+ return ue(e(`Get participant ${this.userId} in conversation ${this.conversationId}`, n2), oe(e(`Get user ${this.userId}`, r2)));
2282
2341
  });
2283
2342
  }
2284
2343
  set() {
@@ -2306,7 +2365,7 @@ class Oe {
2306
2365
  });
2307
2366
  }
2308
2367
  }
2309
- function Pe(e2) {
2368
+ function je(e2) {
2310
2369
  const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
2311
2370
  let s2 = 0;
2312
2371
  const n2 = [], r2 = e2 === s2;
@@ -2359,12 +2418,12 @@ const Ue = (e2, t2, s2 = void 0) => function(e3, t3) {
2359
2418
  return [e3];
2360
2419
  }
2361
2420
  });
2362
- function je(e2, t2) {
2421
+ function $e(e2, t2) {
2363
2422
  return (s2) => {
2364
2423
  const n2 = s2;
2365
2424
  let r2 = 0;
2366
2425
  const i2 = [];
2367
- for (const a2 of V(s2, e2)) {
2426
+ for (const a2 of Z(s2, e2)) {
2368
2427
  a2.index - r2 > 0 && i2.push(n2.substring(r2, a2.index));
2369
2428
  const e3 = t2(a2);
2370
2429
  Array.isArray(e3) ? i2.push(...e3) : i2.push(e3), r2 = a2.index + a2[0].length;
@@ -2372,29 +2431,29 @@ function je(e2, t2) {
2372
2431
  return r2 < s2.length && i2.push(s2.substring(r2)), i2;
2373
2432
  };
2374
2433
  }
2375
- const $e = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
2376
- var We = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(We || {});
2377
- const qe = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
2434
+ const We = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
2435
+ var qe = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(qe || {});
2436
+ const He = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
2378
2437
  const t2 = [];
2379
2438
  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");
2380
- }), He = { _: 1, "*": 4, "~": 2 };
2381
- function Le(e2) {
2382
- return Ge(e2, 0);
2439
+ }), Le = { _: 1, "*": 4, "~": 2 };
2440
+ function Ge(e2) {
2441
+ return ze(e2, 0);
2383
2442
  }
2384
- function Ge(e2, t2 = 0) {
2385
- const s2 = qe[t2], n2 = s2 ? function(e3) {
2386
- const t3 = ze.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${$e}])(?:${e3.source})(?=[\\s${$e}]|$)`, "g")), s3 = je(t3, (e4) => {
2443
+ function ze(e2, t2 = 0) {
2444
+ const s2 = He[t2], n2 = s2 ? function(e3) {
2445
+ const t3 = Je.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${We}])(?:${e3.source})(?=[\\s${We}]|$)`, "g")), s3 = $e(t3, (e4) => {
2387
2446
  const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
2388
- return [" ", { type: We[He[t4]], children: [s4] }];
2447
+ return [" ", { type: qe[Le[t4]], children: [s4] }];
2389
2448
  });
2390
2449
  return (e4) => {
2391
2450
  const [t4, ...n3] = s3(" " + e4);
2392
2451
  return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
2393
2452
  };
2394
2453
  }(s2) : () => [e2];
2395
- return Ue(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Ge(e3, t2 | We[s3]) : [e3]);
2454
+ return Ue(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? ze(e3, t2 | qe[s3]) : [e3]);
2396
2455
  }
2397
- const ze = function() {
2456
+ const Je = function() {
2398
2457
  const e2 = function() {
2399
2458
  try {
2400
2459
  return /* @__PURE__ */ new WeakMap();
@@ -2410,18 +2469,18 @@ const ze = function() {
2410
2469
  return e2.set(t2, n2), n2;
2411
2470
  } };
2412
2471
  }();
2413
- function Je(e2, t2) {
2472
+ function Ye(e2, t2) {
2414
2473
  if (Array.prototype.indexOf) return e2.indexOf(t2);
2415
2474
  for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
2416
2475
  return -1;
2417
2476
  }
2418
- function Ye(e2, t2) {
2477
+ function Qe(e2, t2) {
2419
2478
  for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
2420
2479
  }
2421
- function Qe(e2) {
2480
+ function Ve(e2) {
2422
2481
  throw new Error("Unhandled case for value: '" + e2 + "'");
2423
2482
  }
2424
- var Ve = function() {
2483
+ var Ze = function() {
2425
2484
  function e2(e3) {
2426
2485
  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 || "";
2427
2486
  }
@@ -2440,11 +2499,11 @@ var Ve = function() {
2440
2499
  }, e2.prototype.setClass = function(e3) {
2441
2500
  return this.setAttr("class", e3);
2442
2501
  }, e2.prototype.addClass = function(e3) {
2443
- for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Je(r2, t2) && r2.push(t2);
2502
+ for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Ye(r2, t2) && r2.push(t2);
2444
2503
  return this.getAttrs().class = r2.join(" "), this;
2445
2504
  }, e2.prototype.removeClass = function(e3) {
2446
2505
  for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); r2.length && (t2 = i2.shift()); ) {
2447
- var a2 = Je(r2, t2);
2506
+ var a2 = Ye(r2, t2);
2448
2507
  -1 !== a2 && r2.splice(a2, 1);
2449
2508
  }
2450
2509
  return this.getAttrs().class = r2.join(" "), this;
@@ -2470,12 +2529,12 @@ var Ve = function() {
2470
2529
  return t2.join(" ");
2471
2530
  }, e2;
2472
2531
  }();
2473
- var Ze = function() {
2532
+ var Ke = function() {
2474
2533
  function e2(e3) {
2475
2534
  void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
2476
2535
  }
2477
2536
  return e2.prototype.build = function(e3) {
2478
- return new Ve({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
2537
+ return new Ze({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
2479
2538
  }, e2.prototype.createAttrs = function(e3) {
2480
2539
  var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
2481
2540
  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;
@@ -2545,7 +2604,7 @@ var Ze = function() {
2545
2604
  }(e4, t3, s3);
2546
2605
  }(e3, s2);
2547
2606
  }, e2;
2548
- }(), Ke = function() {
2607
+ }(), Xe = function() {
2549
2608
  function e2(e3) {
2550
2609
  this.__jsduckDummyDocProp = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
2551
2610
  }
@@ -2560,30 +2619,30 @@ var Ze = function() {
2560
2619
  }, e2.prototype.buildTag = function() {
2561
2620
  return this.tagBuilder.build(this);
2562
2621
  }, e2;
2563
- }(), Xe = function(e2, t2) {
2564
- return Xe = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
2622
+ }(), et = function(e2, t2) {
2623
+ return et = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
2565
2624
  e3.__proto__ = t3;
2566
2625
  } || function(e3, t3) {
2567
2626
  for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
2568
- }, Xe(e2, t2);
2627
+ }, et(e2, t2);
2569
2628
  };
2570
- function et(e2, t2) {
2629
+ function tt(e2, t2) {
2571
2630
  function s2() {
2572
2631
  this.constructor = e2;
2573
2632
  }
2574
- Xe(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
2633
+ et(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
2575
2634
  }
2576
- var tt, st = function() {
2577
- return st = Object.assign || function(e2) {
2635
+ var st, nt = function() {
2636
+ return nt = Object.assign || function(e2) {
2578
2637
  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]);
2579
2638
  return e2;
2580
- }, st.apply(this, arguments);
2581
- }, nt = function(e2) {
2639
+ }, nt.apply(this, arguments);
2640
+ }, rt = function(e2) {
2582
2641
  function t2(t3) {
2583
2642
  var s2 = e2.call(this, t3) || this;
2584
2643
  return s2.email = "", s2.email = t3.email, s2;
2585
2644
  }
2586
- return et(t2, e2), t2.prototype.getType = function() {
2645
+ return tt(t2, e2), t2.prototype.getType = function() {
2587
2646
  return "email";
2588
2647
  }, t2.prototype.getEmail = function() {
2589
2648
  return this.email;
@@ -2592,12 +2651,12 @@ var tt, st = function() {
2592
2651
  }, t2.prototype.getAnchorText = function() {
2593
2652
  return this.email;
2594
2653
  }, t2;
2595
- }(Ke), rt = function(e2) {
2654
+ }(Xe), it = function(e2) {
2596
2655
  function t2(t3) {
2597
2656
  var s2 = e2.call(this, t3) || this;
2598
2657
  return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
2599
2658
  }
2600
- return et(t2, e2), t2.prototype.getType = function() {
2659
+ return tt(t2, e2), t2.prototype.getType = function() {
2601
2660
  return "hashtag";
2602
2661
  }, t2.prototype.getServiceName = function() {
2603
2662
  return this.serviceName;
@@ -2618,12 +2677,12 @@ var tt, st = function() {
2618
2677
  }, t2.prototype.getAnchorText = function() {
2619
2678
  return "#" + this.hashtag;
2620
2679
  }, t2;
2621
- }(Ke), it = function(e2) {
2680
+ }(Xe), at = function(e2) {
2622
2681
  function t2(t3) {
2623
2682
  var s2 = e2.call(this, t3) || this;
2624
2683
  return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
2625
2684
  }
2626
- return et(t2, e2), t2.prototype.getType = function() {
2685
+ return tt(t2, e2), t2.prototype.getType = function() {
2627
2686
  return "mention";
2628
2687
  }, t2.prototype.getMention = function() {
2629
2688
  return this.mention;
@@ -2646,12 +2705,12 @@ var tt, st = function() {
2646
2705
  var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
2647
2706
  return s2 && t3.push(s2), t3;
2648
2707
  }, t2;
2649
- }(Ke), at = function(e2) {
2708
+ }(Xe), ot = function(e2) {
2650
2709
  function t2(t3) {
2651
2710
  var s2 = e2.call(this, t3) || this;
2652
2711
  return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
2653
2712
  }
2654
- return et(t2, e2), t2.prototype.getType = function() {
2713
+ return tt(t2, e2), t2.prototype.getType = function() {
2655
2714
  return "phone";
2656
2715
  }, t2.prototype.getPhoneNumber = function() {
2657
2716
  return this.number;
@@ -2662,12 +2721,12 @@ var tt, st = function() {
2662
2721
  }, t2.prototype.getAnchorText = function() {
2663
2722
  return this.matchedText;
2664
2723
  }, t2;
2665
- }(Ke), ot = function(e2) {
2724
+ }(Xe), ut = function(e2) {
2666
2725
  function t2(t3) {
2667
2726
  var s2 = e2.call(this, t3) || this;
2668
2727
  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;
2669
2728
  }
2670
- return et(t2, e2), t2.prototype.getType = function() {
2729
+ return tt(t2, e2), t2.prototype.getType = function() {
2671
2730
  return "url";
2672
2731
  }, t2.prototype.getUrlMatchType = function() {
2673
2732
  return this.urlMatchType;
@@ -2695,19 +2754,19 @@ var tt, st = function() {
2695
2754
  return t3;
2696
2755
  }
2697
2756
  }, t2;
2698
- }(Ke), ut = function(e2) {
2757
+ }(Xe), ct = function(e2) {
2699
2758
  this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
2700
- }, ct = /[A-Za-z]/, lt = /[\d]/, ht = /[\D]/, dt = /\s/, pt = /['"]/, ft = /[\x00-\x1F\x7F]/, gt = /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, mt = gt + /\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, vt = /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, wt = mt + vt, bt = mt + vt, yt = "(?:[" + vt + "]{1,3}\\.){3}[" + vt + "]{1,3}", Ct = "[" + bt + "](?:[" + bt + "\\-]{0,61}[" + bt + "])?", At = function(e2) {
2701
- return "(?=(" + Ct + "))\\" + e2;
2702
- }, Et = function(e2) {
2703
- return "(?:" + At(e2) + "(?:\\." + At(e2 + 1) + "){0,126}|" + yt + ")";
2704
- }, kt = new RegExp("[" + bt + "]"), xt = /(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, Tt = new RegExp("[" + bt + "!#$%&'*+/=?^_`{|}~-]"), It = new RegExp("^" + xt.source + "$"), Dt = function(e2) {
2759
+ }, lt = /[A-Za-z]/, ht = /[\d]/, dt = /[\D]/, pt = /\s/, ft = /['"]/, mt = /[\x00-\x1F\x7F]/, gt = /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, vt = gt + /\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, wt = /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, bt = vt + wt, yt = vt + wt, Ct = "(?:[" + wt + "]{1,3}\\.){3}[" + wt + "]{1,3}", At = "[" + yt + "](?:[" + yt + "\\-]{0,61}[" + yt + "])?", Et = function(e2) {
2760
+ return "(?=(" + At + "))\\" + e2;
2761
+ }, kt = function(e2) {
2762
+ return "(?:" + Et(e2) + "(?:\\." + Et(e2 + 1) + "){0,126}|" + Ct + ")";
2763
+ }, xt = new RegExp("[" + yt + "]"), Tt = /(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, It = new RegExp("[" + yt + "!#$%&'*+/=?^_`{|}~-]"), Dt = new RegExp("^" + Tt.source + "$"), St = function(e2) {
2705
2764
  function t2() {
2706
2765
  var t3 = null !== e2 && e2.apply(this, arguments) || this;
2707
- return t3.localPartCharRegex = Tt, t3.strictTldRegex = It, t3;
2766
+ return t3.localPartCharRegex = It, t3.strictTldRegex = Dt, t3;
2708
2767
  }
2709
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2710
- for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new St(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
2768
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2769
+ for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new Mt(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
2711
2770
  var h2 = e3.charAt(u2);
2712
2771
  switch (c2) {
2713
2772
  case 0:
@@ -2720,10 +2779,10 @@ var tt, st = function() {
2720
2779
  f2(h2);
2721
2780
  break;
2722
2781
  case 3:
2723
- g2(h2);
2782
+ m2(h2);
2724
2783
  break;
2725
2784
  case 4:
2726
- m2(h2);
2785
+ g2(h2);
2727
2786
  break;
2728
2787
  case 5:
2729
2788
  v2(h2);
@@ -2735,7 +2794,7 @@ var tt, st = function() {
2735
2794
  b2(h2);
2736
2795
  break;
2737
2796
  default:
2738
- Qe(c2);
2797
+ Ve(c2);
2739
2798
  }
2740
2799
  u2++;
2741
2800
  }
@@ -2744,28 +2803,28 @@ var tt, st = function() {
2744
2803
  "m" === e4 ? y2(1) : s2.test(e4) && y2();
2745
2804
  }
2746
2805
  function p2(e4, t4) {
2747
- ":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new St(st(st({}, l2), { hasMailtoPrefix: true }))) : C2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : C2());
2806
+ ":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new Mt(nt(nt({}, l2), { hasMailtoPrefix: true }))) : C2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : C2());
2748
2807
  }
2749
2808
  function f2(e4) {
2750
2809
  "." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || C2();
2751
2810
  }
2752
- function g2(e4) {
2811
+ function m2(e4) {
2753
2812
  "." === e4 || "@" === e4 ? C2() : s2.test(e4) ? c2 = 2 : C2();
2754
2813
  }
2755
- function m2(e4) {
2756
- kt.test(e4) ? c2 = 5 : C2();
2814
+ function g2(e4) {
2815
+ xt.test(e4) ? c2 = 5 : C2();
2757
2816
  }
2758
2817
  function v2(e4) {
2759
- "." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : kt.test(e4) || A2();
2818
+ "." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : xt.test(e4) || A2();
2760
2819
  }
2761
2820
  function w2(e4) {
2762
- "-" === e4 || "." === e4 ? A2() : kt.test(e4) ? c2 = 5 : A2();
2821
+ "-" === e4 || "." === e4 ? A2() : xt.test(e4) ? c2 = 5 : A2();
2763
2822
  }
2764
2823
  function b2(e4) {
2765
- "." === e4 || "-" === e4 ? A2() : kt.test(e4) ? (c2 = 5, l2 = new St(st(st({}, l2), { hasDomainDot: true }))) : A2();
2824
+ "." === e4 || "-" === e4 ? A2() : xt.test(e4) ? (c2 = 5, l2 = new Mt(nt(nt({}, l2), { hasDomainDot: true }))) : A2();
2766
2825
  }
2767
2826
  function y2(e4) {
2768
- void 0 === e4 && (e4 = 2), c2 = e4, l2 = new St({ idx: u2 });
2827
+ void 0 === e4 && (e4 = 2), c2 = e4, l2 = new Mt({ idx: u2 });
2769
2828
  }
2770
2829
  function C2() {
2771
2830
  c2 = 0, l2 = a2;
@@ -2778,14 +2837,14 @@ var tt, st = function() {
2778
2837
  (function(e4) {
2779
2838
  var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
2780
2839
  return n2.test(s4);
2781
- })(i3) && r2.push(new nt({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
2840
+ })(i3) && r2.push(new rt({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
2782
2841
  }
2783
2842
  C2();
2784
2843
  }
2785
2844
  }, t2;
2786
- }(ut), St = function(e2) {
2845
+ }(ct), Mt = function(e2) {
2787
2846
  void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
2788
- }, Mt = function() {
2847
+ }, Ft = function() {
2789
2848
  function e2() {
2790
2849
  }
2791
2850
  return e2.isValid = function(e3, t2) {
@@ -2804,21 +2863,21 @@ var tt, st = function() {
2804
2863
  }, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
2805
2864
  return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
2806
2865
  }, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + gt + "]"), 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;
2807
- }(), Ft = (tt = new RegExp("[/?#](?:[" + bt + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + bt + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, Et(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, Et(6), ")", "|", "(", "(//)?", Et(10) + "\\.", xt.source, "(?![-" + wt + "])", ")", ")", "(?::[0-9]+)?", "(?:" + tt.source + ")?"].join(""), "gi")), Bt = new RegExp("[" + bt + "]"), Rt = function(e2) {
2866
+ }(), Bt = (st = new RegExp("[/?#](?:[" + yt + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + yt + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, kt(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, kt(6), ")", "|", "(", "(//)?", kt(10) + "\\.", Tt.source, "(?![-" + bt + "])", ")", ")", "(?::[0-9]+)?", "(?:" + st.source + ")?"].join(""), "gi")), Rt = new RegExp("[" + yt + "]"), Nt = function(e2) {
2808
2867
  function t2(t3) {
2809
2868
  var s2 = e2.call(this, t3) || this;
2810
- return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = Ft, s2.wordCharRegExp = Bt, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
2869
+ return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = Bt, s2.wordCharRegExp = Rt, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
2811
2870
  }
2812
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2871
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2813
2872
  for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
2814
- 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);
2815
- if (!Mt.isValid(s3, u3)) return "continue";
2816
- if (p2 > 0 && "@" === g2) return "continue";
2817
- if (p2 > 0 && f2 && c2.wordCharRegExp.test(g2)) return "continue";
2873
+ var s3 = t3[0], u3 = t3[1], l2 = t3[4], h2 = t3[5], d2 = t3[9], p2 = t3.index, f2 = h2 || d2, m2 = e3.charAt(p2 - 1);
2874
+ if (!Ft.isValid(s3, u3)) return "continue";
2875
+ if (p2 > 0 && "@" === m2) return "continue";
2876
+ if (p2 > 0 && f2 && c2.wordCharRegExp.test(m2)) return "continue";
2818
2877
  if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
2819
2878
  else {
2820
- var m2 = c2.matchHasInvalidCharAfterTld(s3, u3);
2821
- m2 > -1 && (s3 = s3.substr(0, m2));
2879
+ var g2 = c2.matchHasInvalidCharAfterTld(s3, u3);
2880
+ g2 > -1 && (s3 = s3.substr(0, g2));
2822
2881
  }
2823
2882
  var v2 = ["http://", "https://"].find(function(e4) {
2824
2883
  return !!u3 && -1 !== u3.indexOf(e4);
@@ -2828,7 +2887,7 @@ var tt, st = function() {
2828
2887
  s3 = s3.substr(w2), u3 = u3.substr(w2), p2 += w2;
2829
2888
  }
2830
2889
  var b2 = u3 ? "scheme" : l2 ? "www" : "tld", y2 = !!u3;
2831
- o2.push(new ot({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: b2, url: s3, protocolUrlMatch: y2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
2890
+ o2.push(new ut({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: b2, url: s3, protocolUrlMatch: y2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
2832
2891
  }, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
2833
2892
  return o2;
2834
2893
  }, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
@@ -2848,65 +2907,65 @@ var tt, st = function() {
2848
2907
  if (!e3) return -1;
2849
2908
  var s2 = 0;
2850
2909
  t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
2851
- var n2 = new RegExp("^((.?//)?[-." + bt + "]*[-" + bt + "]\\.[-" + bt + "]+)").exec(e3);
2910
+ var n2 = new RegExp("^((.?//)?[-." + yt + "]*[-" + yt + "]\\.[-" + yt + "]+)").exec(e3);
2852
2911
  return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
2853
2912
  }, t2;
2854
- }(ut), Nt = new RegExp("#[_" + bt + "]{1,139}(?![_" + bt + "])", "g"), _t = new RegExp("[^" + bt + "]"), Ot = function(e2) {
2913
+ }(ct), _t = new RegExp("#[_" + yt + "]{1,139}(?![_" + yt + "])", "g"), Ot = new RegExp("[^" + yt + "]"), Pt = function(e2) {
2855
2914
  function t2(t3) {
2856
2915
  var s2 = e2.call(this, t3) || this;
2857
- return s2.serviceName = "twitter", s2.matcherRegex = Nt, s2.nonWordCharRegex = _t, s2.serviceName = t3.serviceName, s2;
2916
+ return s2.serviceName = "twitter", s2.matcherRegex = _t, s2.nonWordCharRegex = Ot, s2.serviceName = t3.serviceName, s2;
2858
2917
  }
2859
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2918
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2860
2919
  for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
2861
2920
  var o2 = t3.index, u2 = e3.charAt(o2 - 1);
2862
2921
  if (0 === o2 || n2.test(u2)) {
2863
2922
  var c2 = t3[0], l2 = t3[0].slice(1);
2864
- a2.push(new rt({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
2923
+ a2.push(new it({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
2865
2924
  }
2866
2925
  }
2867
2926
  return a2;
2868
2927
  }, t2;
2869
- }(ut), Pt = 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"), Ut = function(e2) {
2928
+ }(ct), jt = 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"), Ut = function(e2) {
2870
2929
  function t2() {
2871
2930
  var t3 = null !== e2 && e2.apply(this, arguments) || this;
2872
- return t3.matcherRegex = Pt, t3;
2931
+ return t3.matcherRegex = jt, t3;
2873
2932
  }
2874
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2933
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2875
2934
  for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
2876
2935
  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/);
2877
- this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new at({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
2936
+ this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new ot({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
2878
2937
  }
2879
2938
  return r2;
2880
2939
  }, t2.prototype.testMatch = function(e3) {
2881
- return ht.test(e3);
2940
+ return dt.test(e3);
2882
2941
  }, t2;
2883
- }(ut), jt = new RegExp("@[_" + bt + "]{1,50}(?![_" + bt + "])", "g"), $t = new RegExp("@[_." + bt + "]{1,30}(?![_" + bt + "])", "g"), Wt = new RegExp("@[-_." + bt + "]{1,50}(?![-_" + bt + "])", "g"), qt = new RegExp("[^" + bt + "]"), Ht = function(e2) {
2942
+ }(ct), $t = new RegExp("@[_" + yt + "]{1,50}(?![_" + yt + "])", "g"), Wt = new RegExp("@[_." + yt + "]{1,30}(?![_" + yt + "])", "g"), qt = new RegExp("@[-_." + yt + "]{1,50}(?![-_" + yt + "])", "g"), Ht = new RegExp("[^" + yt + "]"), Lt = function(e2) {
2884
2943
  function t2(t3) {
2885
2944
  var s2 = e2.call(this, t3) || this;
2886
- return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: jt, instagram: $t, soundcloud: Wt }, s2.nonWordCharRegex = qt, s2.serviceName = t3.serviceName, s2;
2945
+ return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: $t, instagram: Wt, soundcloud: qt }, s2.nonWordCharRegex = Ht, s2.serviceName = t3.serviceName, s2;
2887
2946
  }
2888
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2947
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2889
2948
  var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
2890
2949
  if (!n2) return a2;
2891
2950
  for (; null !== (t3 = n2.exec(e3)); ) {
2892
2951
  var o2 = t3.index, u2 = e3.charAt(o2 - 1);
2893
2952
  if (0 === o2 || r2.test(u2)) {
2894
2953
  var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
2895
- a2.push(new it({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
2954
+ a2.push(new at({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
2896
2955
  }
2897
2956
  }
2898
2957
  return a2;
2899
2958
  }, t2;
2900
- }(ut);
2901
- function Lt(e2, t2) {
2902
- for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new Gt(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
2959
+ }(ct);
2960
+ function Gt(e2, t2) {
2961
+ for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new zt(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
2903
2962
  var f2 = e2.charAt(c2);
2904
2963
  switch (h2) {
2905
2964
  case 0:
2906
- g2(f2);
2965
+ m2(f2);
2907
2966
  break;
2908
2967
  case 1:
2909
- m2(f2);
2968
+ g2(f2);
2910
2969
  break;
2911
2970
  case 2:
2912
2971
  w2(f2);
@@ -2966,33 +3025,33 @@ function Lt(e2, t2) {
2966
3025
  _2(f2);
2967
3026
  break;
2968
3027
  default:
2969
- Qe(h2);
3028
+ Ve(h2);
2970
3029
  }
2971
3030
  c2++;
2972
3031
  }
2973
- function g2(e3) {
3032
+ function m2(e3) {
2974
3033
  "<" === e3 && P2();
2975
3034
  }
2976
- function m2(e3) {
2977
- "!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new Gt(st(st({}, p2), { isClosing: true }))) : "<" === e3 ? P2() : ct.test(e3) ? (h2 = 3, p2 = new Gt(st(st({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
3035
+ function g2(e3) {
3036
+ "!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new zt(nt(nt({}, p2), { isClosing: true }))) : "<" === e3 ? P2() : lt.test(e3) ? (h2 = 3, p2 = new zt(nt(nt({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
2978
3037
  }
2979
3038
  function v2(e3) {
2980
- dt.test(e3) ? (p2 = new Gt(st(st({}, p2), { name: j2() })), h2 = 4) : "<" === e3 ? P2() : "/" === e3 ? (p2 = new Gt(st(st({}, p2), { name: j2() })), h2 = 12) : ">" === e3 ? (p2 = new Gt(st(st({}, p2), { name: j2() })), U2()) : ct.test(e3) || lt.test(e3) || ":" === e3 || O2();
3039
+ pt.test(e3) ? (p2 = new zt(nt(nt({}, p2), { name: U2() })), h2 = 4) : "<" === e3 ? P2() : "/" === e3 ? (p2 = new zt(nt(nt({}, p2), { name: U2() })), h2 = 12) : ">" === e3 ? (p2 = new zt(nt(nt({}, p2), { name: U2() })), j2()) : lt.test(e3) || ht.test(e3) || ":" === e3 || O2();
2981
3040
  }
2982
3041
  function w2(e3) {
2983
- ">" === e3 ? O2() : ct.test(e3) ? h2 = 3 : O2();
3042
+ ">" === e3 ? O2() : lt.test(e3) ? h2 = 3 : O2();
2984
3043
  }
2985
3044
  function b2(e3) {
2986
- dt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? P2() : "=" === e3 || pt.test(e3) || ft.test(e3) ? O2() : h2 = 5);
3045
+ pt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? P2() : "=" === e3 || ft.test(e3) || mt.test(e3) ? O2() : h2 = 5);
2987
3046
  }
2988
3047
  function y2(e3) {
2989
- dt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? P2() : pt.test(e3) && O2();
3048
+ pt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? P2() : ft.test(e3) && O2();
2990
3049
  }
2991
3050
  function C2(e3) {
2992
- dt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? P2() : pt.test(e3) ? O2() : h2 = 5);
3051
+ pt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? P2() : ft.test(e3) ? O2() : h2 = 5);
2993
3052
  }
2994
3053
  function A2(e3) {
2995
- dt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? O2() : "<" === e3 ? P2() : h2 = 10);
3054
+ pt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? O2() : "<" === e3 ? P2() : h2 = 10);
2996
3055
  }
2997
3056
  function E2(e3) {
2998
3057
  '"' === e3 && (h2 = 11);
@@ -3001,16 +3060,16 @@ function Lt(e2, t2) {
3001
3060
  "'" === e3 && (h2 = 11);
3002
3061
  }
3003
3062
  function x2(e3) {
3004
- dt.test(e3) ? h2 = 4 : ">" === e3 ? U2() : "<" === e3 && P2();
3063
+ pt.test(e3) ? h2 = 4 : ">" === e3 ? j2() : "<" === e3 && P2();
3005
3064
  }
3006
3065
  function T2(e3) {
3007
- dt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? P2() : (h2 = 4, c2--);
3066
+ pt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? P2() : (h2 = 4, c2--);
3008
3067
  }
3009
3068
  function I2(e3) {
3010
- ">" === e3 ? (p2 = new Gt(st(st({}, p2), { isClosing: true })), U2()) : h2 = 4;
3069
+ ">" === e3 ? (p2 = new zt(nt(nt({}, p2), { isClosing: true })), j2()) : h2 = 4;
3011
3070
  }
3012
3071
  function D2(t3) {
3013
- "--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new Gt(st(st({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new Gt(st(st({}, p2), { type: "doctype" })), h2 = 20) : O2();
3072
+ "--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new zt(nt(nt({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new zt(nt(nt({}, p2), { type: "doctype" })), h2 = 20) : O2();
3014
3073
  }
3015
3074
  function S2(e3) {
3016
3075
  "-" === e3 ? h2 = 15 : ">" === e3 ? O2() : h2 = 16;
@@ -3025,33 +3084,33 @@ function Lt(e2, t2) {
3025
3084
  h2 = "-" === e3 ? 18 : 16;
3026
3085
  }
3027
3086
  function R2(e3) {
3028
- ">" === e3 ? U2() : "!" === e3 ? h2 = 19 : "-" === e3 || (h2 = 16);
3087
+ ">" === e3 ? j2() : "!" === e3 ? h2 = 19 : "-" === e3 || (h2 = 16);
3029
3088
  }
3030
3089
  function N2(e3) {
3031
- "-" === e3 ? h2 = 17 : ">" === e3 ? U2() : h2 = 16;
3090
+ "-" === e3 ? h2 = 17 : ">" === e3 ? j2() : h2 = 16;
3032
3091
  }
3033
3092
  function _2(e3) {
3034
- ">" === e3 ? U2() : "<" === e3 && P2();
3093
+ ">" === e3 ? j2() : "<" === e3 && P2();
3035
3094
  }
3036
3095
  function O2() {
3037
3096
  h2 = 0, p2 = u2;
3038
3097
  }
3039
3098
  function P2() {
3040
- h2 = 1, p2 = new Gt({ idx: c2 });
3099
+ h2 = 1, p2 = new zt({ idx: c2 });
3041
3100
  }
3042
- function U2() {
3101
+ function j2() {
3043
3102
  var t3 = e2.slice(d2, p2.idx);
3044
3103
  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)), O2(), d2 = c2 + 1;
3045
3104
  }
3046
- function j2() {
3105
+ function U2() {
3047
3106
  var t3 = p2.idx + (p2.isClosing ? 2 : 1);
3048
3107
  return e2.slice(t3, c2).toLowerCase();
3049
3108
  }
3050
3109
  d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
3051
3110
  }
3052
- var Gt = function(e2) {
3111
+ var zt = function(e2) {
3053
3112
  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;
3054
- }, zt = function() {
3113
+ }, Jt = function() {
3055
3114
  function e2(t2) {
3056
3115
  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;
3057
3116
  var s2 = this.mention;
@@ -3075,7 +3134,7 @@ var Gt = function(e2) {
3075
3134
  }(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
3076
3135
  }, e2.prototype.parse = function(e3) {
3077
3136
  var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
3078
- return Lt(e3, { onOpenTag: function(e4) {
3137
+ return Gt(e3, { onOpenTag: function(e4) {
3079
3138
  s2.indexOf(e4) >= 0 && n2++;
3080
3139
  }, onText: function(e4, s3) {
3081
3140
  if (0 === n2) {
@@ -3114,19 +3173,19 @@ var Gt = function(e2) {
3114
3173
  }
3115
3174
  return e3;
3116
3175
  }, e2.prototype.removeUnwantedMatches = function(e3) {
3117
- return this.hashtag || Ye(e3, function(e4) {
3176
+ return this.hashtag || Qe(e3, function(e4) {
3118
3177
  return "hashtag" === e4.getType();
3119
- }), this.email || Ye(e3, function(e4) {
3178
+ }), this.email || Qe(e3, function(e4) {
3120
3179
  return "email" === e4.getType();
3121
- }), this.phone || Ye(e3, function(e4) {
3180
+ }), this.phone || Qe(e3, function(e4) {
3122
3181
  return "phone" === e4.getType();
3123
- }), this.mention || Ye(e3, function(e4) {
3182
+ }), this.mention || Qe(e3, function(e4) {
3124
3183
  return "mention" === e4.getType();
3125
- }), this.urls.schemeMatches || Ye(e3, function(e4) {
3184
+ }), this.urls.schemeMatches || Qe(e3, function(e4) {
3126
3185
  return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
3127
- }), this.urls.wwwMatches || Ye(e3, function(e4) {
3186
+ }), this.urls.wwwMatches || Qe(e3, function(e4) {
3128
3187
  return "url" === e4.getType() && "www" === e4.getUrlMatchType();
3129
- }), this.urls.tldMatches || Ye(e3, function(e4) {
3188
+ }), this.urls.tldMatches || Qe(e3, function(e4) {
3130
3189
  return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
3131
3190
  }), e3;
3132
3191
  }, e2.prototype.parseText = function(e3, t2) {
@@ -3146,93 +3205,93 @@ var Gt = function(e2) {
3146
3205
  return s2.push(e3.substring(n2)), s2.join("");
3147
3206
  }, e2.prototype.createMatchReturnVal = function(e3) {
3148
3207
  var t2;
3149
- return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof Ve ? t2.toAnchorString() : e3.buildTag().toAnchorString();
3208
+ return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof Ze ? t2.toAnchorString() : e3.buildTag().toAnchorString();
3150
3209
  }, e2.prototype.getMatchers = function() {
3151
3210
  if (this.matchers) return this.matchers;
3152
- var e3 = this.getTagBuilder(), t2 = [new Ot({ tagBuilder: e3, serviceName: this.hashtag }), new Dt({ tagBuilder: e3 }), new Ut({ tagBuilder: e3 }), new Ht({ tagBuilder: e3, serviceName: this.mention }), new Rt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
3211
+ var e3 = this.getTagBuilder(), t2 = [new Pt({ tagBuilder: e3, serviceName: this.hashtag }), new St({ tagBuilder: e3 }), new Ut({ tagBuilder: e3 }), new Lt({ tagBuilder: e3, serviceName: this.mention }), new Nt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
3153
3212
  return this.matchers = t2;
3154
3213
  }, e2.prototype.getTagBuilder = function() {
3155
3214
  var e3 = this.tagBuilder;
3156
- return e3 || (e3 = this.tagBuilder = new Ze({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
3157
- }, e2.version = "3.14.3", e2.AnchorTagBuilder = Ze, e2.HtmlTag = Ve, e2.matcher = { Email: Dt, Hashtag: Ot, Matcher: ut, Mention: Ht, Phone: Ut, Url: Rt }, e2.match = { Email: nt, Hashtag: rt, Match: Ke, Mention: it, Phone: at, Url: ot }, e2;
3215
+ return e3 || (e3 = this.tagBuilder = new Ke({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
3216
+ }, e2.version = "3.14.3", e2.AnchorTagBuilder = Ke, e2.HtmlTag = Ze, e2.matcher = { Email: St, Hashtag: Pt, Matcher: ct, Mention: Lt, Phone: Ut, Url: Nt }, e2.match = { Email: rt, Hashtag: it, Match: Xe, Mention: at, Phone: ot, Url: ut }, e2;
3158
3217
  }();
3159
- function Jt(e2, t2 = e2) {
3218
+ function Yt(e2, t2 = e2) {
3160
3219
  return { type: "autolink", url: e2, text: t2 };
3161
3220
  }
3162
- const Yt = je(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
3221
+ const Qt = $e(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
3163
3222
  return { type: "mention", id: e3, text: t3 };
3164
- }(decodeURIComponent(t2), s2)), Qt = je(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
3223
+ }(decodeURIComponent(t2), s2)), Vt = $e(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
3165
3224
  return { type: "customemoji", text: e3 };
3166
- }(t2)), Vt = je(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
3225
+ }(t2)), Zt = $e(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
3167
3226
  return { type: "link", url: e3, children: t3 };
3168
- }(t2, [s2])), Zt = je(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3169
- const { action: n2, params: r2 } = Xt(t2);
3227
+ }(t2, [s2])), Kt = $e(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3228
+ const { action: n2, params: r2 } = es(t2);
3170
3229
  return /* @__PURE__ */ function(e3, t3, s3 = []) {
3171
3230
  return { type: "actionlink", action: e3, params: t3, children: s3 };
3172
3231
  }(n2, r2, [s2]);
3173
- }), Kt = je(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3174
- const { action: n2, params: r2 } = Xt(t2);
3232
+ }), Xt = $e(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3233
+ const { action: n2, params: r2 } = es(t2);
3175
3234
  return /* @__PURE__ */ function(e3, t3, s3 = []) {
3176
3235
  return { type: "actionbutton", action: e3, params: t3, children: s3 };
3177
3236
  }(n2, r2, [s2]);
3178
3237
  });
3179
- function Xt(e2) {
3238
+ function es(e2) {
3180
3239
  const t2 = e2.indexOf("?");
3181
3240
  if (-1 === t2) return { action: e2, params: {} };
3182
3241
  return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
3183
3242
  }
3184
- const es = je(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
3243
+ const ts = $e(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
3185
3244
  return { type: "bulletlist", children: e3 };
3186
- }([e2.startsWith("\n") ? e2.slice(1) : e2])), ts = je(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), ss = (e2) => {
3245
+ }([e2.startsWith("\n") ? e2.slice(1) : e2])), ss = $e(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), ns = (e2) => {
3187
3246
  const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
3188
3247
  let s2 = 0;
3189
3248
  const n2 = [];
3190
- for (const r2 of V(e2, t2)) {
3249
+ for (const r2 of Z(e2, t2)) {
3191
3250
  const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
3192
3251
  a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
3193
- const o2 = Jt("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
3252
+ const o2 = Yt("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
3194
3253
  n2.push(o2), s2 = a2 + i2.length;
3195
3254
  }
3196
3255
  return s2 < e2.length && n2.push(e2.substring(s2)), n2;
3197
- }, ns = (e2) => Vt(e2).flatMap((e3) => "string" == typeof e3 ? rs(e3) : ["<", ...rs(e3.url), ...rs("|" + e3.children[0] + ">")]), rs = (e2) => {
3198
- const t2 = zt.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
3256
+ }, rs = (e2) => Zt(e2).flatMap((e3) => "string" == typeof e3 ? is(e3) : ["<", ...is(e3.url), ...is("|" + e3.children[0] + ">")]), is = (e2) => {
3257
+ const t2 = Jt.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
3199
3258
  let n2 = 0;
3200
3259
  for (const r2 of t2) {
3201
3260
  const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
3202
3261
  let o2 = i2;
3203
- r2 instanceof nt ? o2 = "mailto:" + r2.getEmail() : r2 instanceof ot && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Jt(o2, i2)), n2 = t3 + a2;
3262
+ r2 instanceof rt ? o2 = "mailto:" + r2.getEmail() : r2 instanceof ut && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Yt(o2, i2)), n2 = t3 + a2;
3204
3263
  }
3205
3264
  return n2 < e2.length && s2.push(e2.substring(n2)), s2;
3206
- }, is = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
3207
- function as(e2 = { except: [] }) {
3265
+ }, as = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
3266
+ function os(e2 = { except: [] }) {
3208
3267
  var _a2;
3209
- const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : is.filter((t3) => !e2.only.includes(t3));
3210
- return s2.includes("BulletPoint") || t2.multilineSteps.push(es, ts), s2.includes("Mention") || t2.singlelineSteps.push(Yt), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Qt), s2.includes("Codespan") || t2.multilineSteps.push(je(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3.replace(/<!!mention:.*?\|([^>]*)>/gim, "@$1").replace(/<!!customemoji:(.*?)>/gim, "$1") }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Vt), s2.includes("Actions") || (t2.singlelineSteps.push(Zt), t2.singlelineSteps.push(Kt)), s2.includes("Wikitext") || t2.singlelineSteps.push(Le), s2.includes("Autolink") || t2.singlelineSteps.push(ns, ss), t2;
3268
+ const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : as.filter((t3) => !e2.only.includes(t3));
3269
+ return s2.includes("BulletPoint") || t2.multilineSteps.push(ts, ss), s2.includes("Mention") || t2.singlelineSteps.push(Qt), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Vt), s2.includes("Codespan") || t2.multilineSteps.push($e(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3.replace(/<!!mention:.*?\|([^>]*)>/gim, "@$1").replace(/<!!customemoji:(.*?)>/gim, "$1") }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Zt), s2.includes("Actions") || (t2.singlelineSteps.push(Kt), t2.singlelineSteps.push(Xt)), s2.includes("Wikitext") || t2.singlelineSteps.push(Ge), s2.includes("Autolink") || t2.singlelineSteps.push(rs, ns), t2;
3211
3270
  }
3212
- const os = function(e2) {
3271
+ const us = function(e2) {
3213
3272
  const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
3214
3273
  return (e3) => Array.from(e3.match(t2) || []);
3215
3274
  }("\n");
3216
- function us(e2, t2 = { except: [] }) {
3275
+ function cs(e2, t2 = { except: [] }) {
3217
3276
  let s2 = function(e3, t3) {
3218
3277
  let s3 = [e3];
3219
- return s3 = ls(s3, t3.multilineSteps), s3 = ls(s3, [os]), s3 = ls(s3, t3.singlelineSteps), s3 = hs(s3), s3;
3220
- }(e2, as(t2));
3221
- return s2 = ds(s2, false), s2;
3278
+ return s3 = hs(s3, t3.multilineSteps), s3 = hs(s3, [us]), s3 = hs(s3, t3.singlelineSteps), s3 = ds(s3), s3;
3279
+ }(e2, os(t2));
3280
+ return s2 = ps(s2, false), s2;
3222
3281
  }
3223
- function cs(e2) {
3224
- return us(e2, { except: ["FormattedLink", "Actions"] });
3282
+ function ls(e2) {
3283
+ return cs(e2, { except: ["FormattedLink", "Actions"] });
3225
3284
  }
3226
- function ls(e2, t2) {
3285
+ function hs(e2, t2) {
3227
3286
  return t2.reduce((e3, t3) => Ue(e3, t3), e2);
3228
3287
  }
3229
- function hs(e2) {
3288
+ function ds(e2) {
3230
3289
  const t2 = [];
3231
3290
  let s2 = -1;
3232
- 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: hs(n2.children) }) : n2;
3291
+ 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: ds(n2.children) }) : n2;
3233
3292
  return t2;
3234
3293
  }
3235
- function ds(e2, t2) {
3294
+ function ps(e2, t2) {
3236
3295
  const s2 = [];
3237
3296
  let n2 = [];
3238
3297
  for (let r2 = 0; r2 < e2.length; r2++) {
@@ -3240,13 +3299,13 @@ function ds(e2, t2) {
3240
3299
  if ("string" == typeof i2) n2.push(i2);
3241
3300
  else if ("children" in i2) {
3242
3301
  n2.length > 0 && (s2.push(n2.join("")), n2 = []);
3243
- const e3 = ds(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type);
3302
+ const e3 = ps(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type);
3244
3303
  s2.push(__spreadProps(__spreadValues({}, i2), { children: e3 }));
3245
3304
  } else "autolink" === i2.type && t2 ? n2.push(i2.text) : (n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2.push(i2));
3246
3305
  }
3247
3306
  return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
3248
3307
  }
3249
- class ps {
3308
+ class fs {
3250
3309
  constructor(e2, t2, s2, n2) {
3251
3310
  this.emoji = e2, this.messageId = t2, this.conversationId = s2, this._realtimeClient = n2;
3252
3311
  }
@@ -3269,7 +3328,7 @@ class ps {
3269
3328
  });
3270
3329
  }
3271
3330
  }
3272
- class fs {
3331
+ class ms {
3273
3332
  constructor(e2, t2, s2) {
3274
3333
  this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
3275
3334
  }
@@ -3282,7 +3341,7 @@ class fs {
3282
3341
  reaction(e2) {
3283
3342
  if ("string" != typeof e2) throw new Error(`Creating ReactionRef failed because emoji "${e2}" is not a string`);
3284
3343
  if ("" === e2) throw new Error(`Creating ReactionRef failed because emoji "${e2}" is an empty string`);
3285
- return new ps(e2, this.brandedId, this.brandedConversationId, this._realtimeClient);
3344
+ return new fs(e2, this.brandedId, this.brandedConversationId, this._realtimeClient);
3286
3345
  }
3287
3346
  get() {
3288
3347
  return __async(this, null, function* () {
@@ -3290,7 +3349,7 @@ class fs {
3290
3349
  if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
3291
3350
  if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
3292
3351
  const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.hydrateMessageData(s2, this.brandedConversationId);
3293
- return Ne("Get message " + this.id, n2);
3352
+ return _e("Get message " + this.id, n2);
3294
3353
  });
3295
3354
  }
3296
3355
  edit(t2) {
@@ -3308,14 +3367,14 @@ class fs {
3308
3367
  }
3309
3368
  function gs(e2) {
3310
3369
  if ("string" == typeof e2) {
3311
- return [{ type: "text", children: us(e2) }];
3370
+ return [{ type: "text", children: cs(e2) }];
3312
3371
  }
3313
3372
  if ("text" in e2 && e2.text) {
3314
- return [{ type: "text", children: us(e2.text) }];
3373
+ return [{ type: "text", children: cs(e2.text) }];
3315
3374
  }
3316
3375
  if ("content" in e2 && e2.content) return e2.content;
3317
3376
  }
3318
- class ms {
3377
+ class vs {
3319
3378
  constructor(e2, t2) {
3320
3379
  this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
3321
3380
  }
@@ -3328,24 +3387,27 @@ class ms {
3328
3387
  participant(e2) {
3329
3388
  if ("string" == typeof e2) {
3330
3389
  if ("" === e2) throw new Error(`Creating ParticipantRef failed because ID "${e2}" is an empty string`);
3331
- return new Oe(e2, this.id, this._realtimeClient);
3390
+ return new Pe(e2, this.id, this._realtimeClient);
3332
3391
  }
3333
- if ("brandedId" in e2) return new Oe(e2.id, this.id, this._realtimeClient);
3392
+ if ("brandedId" in e2) return new Pe(e2.id, this.id, this._realtimeClient);
3334
3393
  throw new Error(`Creating ParticipantRef failed because user "${e2}" is not a string or a UserRef`);
3335
3394
  }
3336
3395
  message(e2) {
3337
3396
  if ("string" != typeof e2) throw new Error(`Creating MessageRef failed because ID "${e2}" is not a string`);
3338
3397
  if ("" === e2) throw new Error(`Creating MessageRef failed because ID "${e2}" is an empty string`);
3339
- return new fs(e2, this.brandedId, this._realtimeClient);
3398
+ return new ms(e2, this.brandedId, this._realtimeClient);
3340
3399
  }
3341
3400
  get() {
3342
3401
  return __async(this, null, function* () {
3343
- const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
3344
- if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
3345
- const n2 = e("Get conversation " + this.id, s2), r2 = Ne("Get last message in conversation " + this.id, yield t2);
3346
- return function(e2, t3) {
3347
- 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: t3, readUntil: e2.readUntil, everyoneReadUntil: e2.everyoneReadUntil });
3348
- }(n2, 0 === r2.length ? null : r2[0]);
3402
+ const e2 = this.subscribe(), t2 = yield e2.connected.catch(() => {
3403
+ throw new Error("GET Conversation failed, could not fetch conversation");
3404
+ });
3405
+ yield this._realtimeClient.sync();
3406
+ const s2 = e2.state;
3407
+ if (e2.unsubscribe(), "active" === s2.type) return s2.latestSnapshot;
3408
+ if ("pending" === s2.type) return t2.latestSnapshot;
3409
+ if ("unsubscribed" === s2.type) return t2.latestSnapshot;
3410
+ throw "error" === s2.type ? s2.error : "Unreachable";
3349
3411
  });
3350
3412
  }
3351
3413
  set(t2) {
@@ -3387,8 +3449,8 @@ class ms {
3387
3449
  }
3388
3450
  send(t2) {
3389
3451
  return __async(this, null, function* () {
3390
- const s2 = { content: vs(t2), referencedMessageId: ws(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: Pe((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
3391
- return new fs(r2.id, this.brandedId, this._realtimeClient);
3452
+ const s2 = { content: ws(t2), referencedMessageId: bs(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: je((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
3453
+ return new ms(r2.id, this.brandedId, this._realtimeClient);
3392
3454
  });
3393
3455
  }
3394
3456
  subscribeMessages(e2) {
@@ -3410,21 +3472,21 @@ class ms {
3410
3472
  });
3411
3473
  }
3412
3474
  }
3413
- function vs(e2) {
3475
+ function ws(e2) {
3414
3476
  if ("string" == typeof e2) {
3415
- return [{ type: "text", children: cs(e2) }];
3477
+ return [{ type: "text", children: ls(e2) }];
3416
3478
  }
3417
3479
  if ("text" in e2) {
3418
- return [{ type: "text", children: cs(e2.text) }];
3480
+ return [{ type: "text", children: ls(e2.text) }];
3419
3481
  }
3420
3482
  return e2.content;
3421
3483
  }
3422
- function ws(e2) {
3484
+ function bs(e2) {
3423
3485
  if ("string" == typeof e2) return;
3424
3486
  const t2 = e2.referencedMessage;
3425
3487
  return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
3426
3488
  }
3427
- class bs {
3489
+ class ys {
3428
3490
  constructor(e2, t2, s2) {
3429
3491
  this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
3430
3492
  }
@@ -3437,7 +3499,7 @@ class bs {
3437
3499
  }
3438
3500
  static fromHost(e2) {
3439
3501
  var _a2;
3440
- const t2 = new bs("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
3502
+ const t2 = new ys("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
3441
3503
  if (!e2) return t2;
3442
3504
  if ("@currentHost" === e2) {
3443
3505
  if ("undefined" == typeof location) throw new Error("You can only use @currentHost in a browser.");
@@ -3447,17 +3509,17 @@ class bs {
3447
3509
  const s2 = e2.match(/^(?:\w+-)?([^.]+)\.talkjs\.com$/);
3448
3510
  if (s2) {
3449
3511
  const e3 = s2[1];
3450
- return ["app", "cdn", "api", "realtime"].includes(e3) ? t2 : new bs(`wss://realtime-${e3}.talkjs.com/v1`, `https://app-${e3}.talkjs.com/api/v0`, `https://api-${e3}.talkjs.com/v1`);
3512
+ return ["app", "cdn", "api", "realtime"].includes(e3) ? t2 : new ys(`wss://realtime-${e3}.talkjs.com/v1`, `https://app-${e3}.talkjs.com/api/v0`, `https://api-${e3}.talkjs.com/v1`);
3451
3513
  }
3452
3514
  return t2;
3453
3515
  }
3454
- return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new bs(`ws://${e2}/public_api/v1`, `http://${e2}/api/v0`, `http://${e2}/public_api/v1`) : new bs(`wss://${e2}/public_api/v1`, `https://${e2}/api/v0`, `https://${e2}/public_api/v1`);
3516
+ return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new ys(`ws://${e2}/public_api/v1`, `http://${e2}/api/v0`, `http://${e2}/public_api/v1`) : new ys(`wss://${e2}/public_api/v1`, `https://${e2}/api/v0`, `https://${e2}/public_api/v1`);
3455
3517
  }
3456
3518
  }
3457
- function ys({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2, errorTracker: u2 }) {
3519
+ function Cs({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2, errorTracker: u2 }) {
3458
3520
  var _a2;
3459
3521
  (!r2 || r2 <= 0) && (r2 = 1);
3460
- const c2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-12-05T12:12:52.344Z" };
3522
+ const c2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2026-01-08T15:43:23.764Z" };
3461
3523
  s2 instanceof FormData || (c2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
3462
3524
  return a(r2, () => __async(this, null, function* () {
3463
3525
  if (o2) {
@@ -3481,12 +3543,12 @@ function ys({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
3481
3543
  throw s3;
3482
3544
  });
3483
3545
  }
3484
- class Cs {
3546
+ class As {
3485
3547
  constructor(e2) {
3486
3548
  __privateAdd(this, _e2);
3487
3549
  __privateAdd(this, _t2);
3488
- var _a2, _b, _c, _d;
3489
- this._timeCreated = Date.now(), __privateSet(this, _e2, (_b = (_a2 = globalThis.document) == null ? void 0 : _a2.referrer) != null ? _b : ""), __privateSet(this, _t2, ((_d = (_c = globalThis.location) == null ? void 0 : _c.href) != null ? _d : globalThis.HermesInternal) ? "React Native Hermes" : ""), this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-12-05T12:12:52.344Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: __privateGet(this, _t2), referrer: __privateGet(this, _e2), userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: __privateGet(this, _t2), stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2025-12-05T12:12:52.344Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
3550
+ var _a2, _b2, _c, _d;
3551
+ this._timeCreated = Date.now(), __privateSet(this, _e2, (_b2 = (_a2 = globalThis.document) == null ? void 0 : _a2.referrer) != null ? _b2 : ""), __privateSet(this, _t2, ((_d = (_c = globalThis.location) == null ? void 0 : _c.href) != null ? _d : globalThis.HermesInternal) ? "React Native Hermes" : ""), this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2026-01-08T15:43:23.764Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: __privateGet(this, _t2), referrer: __privateGet(this, _e2), userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: __privateGet(this, _t2), stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2026-01-08T15:43:23.764Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
3490
3552
  }
3491
3553
  setData({ appId: e2, meId: t2, sessionId: s2 }) {
3492
3554
  this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
@@ -3496,7 +3558,7 @@ class Cs {
3496
3558
  try {
3497
3559
  0;
3498
3560
  const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
3499
- yield ys({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
3561
+ yield Cs({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
3500
3562
  } catch (e3) {
3501
3563
  console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
3502
3564
  }
@@ -3505,9 +3567,9 @@ class Cs {
3505
3567
  }
3506
3568
  _e2 = new WeakMap();
3507
3569
  _t2 = new WeakMap();
3508
- const As = { log: (e2) => Promise.resolve(), setData: (e2) => {
3570
+ const Es = { log: (e2) => Promise.resolve(), setData: (e2) => {
3509
3571
  } };
3510
- class Es {
3572
+ class ks {
3511
3573
  constructor(e2, t2 = {}) {
3512
3574
  this._onSubscription = t2, this._handlers = {};
3513
3575
  for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
@@ -3533,9 +3595,9 @@ class Es {
3533
3595
  return e2 in this._handlers;
3534
3596
  }
3535
3597
  on(e2, t2) {
3536
- var _a2, _b;
3598
+ var _a2, _b2;
3537
3599
  if (!this.supports(e2)) throw new Error(`Unknown event type '${String(e2)}'`);
3538
- (_b = (_a2 = this._onSubscription)[e2]) == null ? void 0 : _b.call(_a2), this._handlers[e2].push(t2);
3600
+ (_b2 = (_a2 = this._onSubscription)[e2]) == null ? void 0 : _b2.call(_a2), this._handlers[e2].push(t2);
3539
3601
  }
3540
3602
  off(e2, t2) {
3541
3603
  if (!Object.hasOwnProperty.call(this._handlers, e2)) throw new Error(`Unknown event type '${String(e2)}'`);
@@ -3552,7 +3614,7 @@ class Es {
3552
3614
  return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
3553
3615
  }
3554
3616
  }
3555
- class ks {
3617
+ class xs {
3556
3618
  constructor(e2) {
3557
3619
  this.handlers = e2, this.tokenResult = null, this.pendingToken = null;
3558
3620
  }
@@ -3574,23 +3636,23 @@ class ks {
3574
3636
  this.tokenResult = null, this.refreshToken();
3575
3637
  }
3576
3638
  }
3577
- class xs {
3639
+ class Ts {
3578
3640
  constructor(e2, t2, s2, n2) {
3579
- this.apiUrls = e2, this.appId = t2, this.userId = s2, this.signature = n2, this.inner = new ks({ onChange: (e3) => {
3641
+ this.apiUrls = e2, this.appId = t2, this.userId = s2, this.signature = n2, this.inner = new xs({ onChange: (e3) => {
3580
3642
  e3.ok ? this.eventEmitter.emit("tokenChanged", e3.value) : this.emitTokenRefreshFailed(e3.value);
3581
3643
  }, onNeedToken: () => __async(this, null, function* () {
3582
- if (this._usingBokens) yield this.sendBokenRequest().then((e3) => this.inner.setTokenResult(c(e3))).catch((e3) => this.inner.setTokenResult(h(e3)));
3644
+ if (this._usingBokens && !this.signature && !this._calledBokens && (yield new Promise((e3) => setTimeout(e3, 1))), this._usingBokens) yield this.sendBokenRequest().then((e3) => this.inner.setTokenResult(c(e3))).catch((e3) => this.inner.setTokenResult(h(e3)));
3583
3645
  else if (this.onNeedToken) this.onNeedToken();
3584
3646
  else {
3585
3647
  const e3 = l("Cannot refresh token, no `onNeedToken` provided.");
3586
3648
  this.inner.setTokenResult(e3);
3587
3649
  }
3588
- }) }), this._usingBokens = true, this.onNeedToken = void 0, this.eventEmitter = new Es({ tokenChanged(e3) {
3650
+ }) }), this._usingBokens = true, this._calledBokens = false, this.onNeedToken = void 0, this.eventEmitter = new ks({ tokenChanged(e3) {
3589
3651
  }, tokenRefreshFailed(e3) {
3590
3652
  }, tokenAccepted(e3) {
3591
3653
  } }), this.sessionExpiryWarningTimeoutId = void 0;
3592
3654
  const r2 = "undefined" != typeof window && e2.restApiHttpUrl.includes("api.talkjs.com");
3593
- this.errorTracker = r2 ? new Cs("970cd0be0fb74630b75c8451051299dc") : As;
3655
+ this.errorTracker = r2 ? new As("970cd0be0fb74630b75c8451051299dc") : Es;
3594
3656
  }
3595
3657
  get usingBokens() {
3596
3658
  return this._usingBokens;
@@ -3602,8 +3664,11 @@ class xs {
3602
3664
  throw e2.value;
3603
3665
  });
3604
3666
  }
3667
+ checkCanSetAuth() {
3668
+ if (this._calledBokens) throw new Error("[TalkJS] Cannot switch to JWT authentication once connected to TalkJS servers. To use JWTs, call `setToken` or set `onNeedToken` before triggering any requests or mounting any components. We recommend setting up authentication in your app's entry point (App.jsx, main.js, or similar) so it runs first.");
3669
+ }
3605
3670
  setToken(e2) {
3606
- setTimeout(() => this.checkJwt(e2), 200), this._usingBokens = false, this.inner.setTokenResult(c(e2));
3671
+ this.checkCanSetAuth(), setTimeout(() => this.checkJwt(e2), 200), this._usingBokens = false, this.inner.setTokenResult(c(e2));
3607
3672
  }
3608
3673
  setTokenError(e2) {
3609
3674
  this._usingBokens = false, this.inner.setTokenResult(l(e2));
@@ -3615,7 +3680,7 @@ class xs {
3615
3680
  this.inner.invalidateAndRefresh();
3616
3681
  }
3617
3682
  setOnNeedToken(e2) {
3618
- this._usingBokens = false, this.onNeedToken = e2;
3683
+ this.checkCanSetAuth(), this._usingBokens = false, this.onNeedToken = e2;
3619
3684
  }
3620
3685
  onTokenChanged(e2) {
3621
3686
  return this.eventEmitter.on("tokenChanged", e2), () => {
@@ -3662,7 +3727,7 @@ class xs {
3662
3727
  const e3 = function(e4) {
3663
3728
  const t3 = e4.split(".");
3664
3729
  if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
3665
- return { header: Ts(t3[0]), payload: Ts(t3[1]) };
3730
+ return { header: Is(t3[0]), payload: Is(t3[1]) };
3666
3731
  }(s2);
3667
3732
  n2 = e3.header, r2 = e3.payload;
3668
3733
  } catch (e3) {
@@ -3704,8 +3769,9 @@ class xs {
3704
3769
  }
3705
3770
  sendBokenRequest() {
3706
3771
  return __async(this, null, function* () {
3772
+ this._calledBokens = true;
3707
3773
  let e2 = 0;
3708
- const t2 = this.apiUrls.getBokensUrl(this.appId, this.userId, this.signature), s2 = yield ys({ method: "GET", url: t2, attempts: 1e4, shouldRetry: (t3) => {
3774
+ const t2 = this.apiUrls.getBokensUrl(this.appId, this.userId, this.signature), s2 = yield Cs({ method: "GET", url: t2, attempts: 1e4, shouldRetry: (t3) => {
3709
3775
  if (t3 instanceof Error) return true;
3710
3776
  if (401 === t3.status) throw "Check that you provided a valid signature.";
3711
3777
  if (404 === t3.status) throw "Check that you specified the correct App ID.";
@@ -3718,7 +3784,7 @@ class xs {
3718
3784
  });
3719
3785
  }
3720
3786
  }
3721
- function Ts(e2) {
3787
+ function Is(e2) {
3722
3788
  try {
3723
3789
  const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
3724
3790
  return JSON.parse(s2);
@@ -3726,14 +3792,14 @@ function Ts(e2) {
3726
3792
  throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
3727
3793
  }
3728
3794
  }
3729
- const Is = new class {
3795
+ const Ds = new class {
3730
3796
  constructor() {
3731
3797
  this.registry = {};
3732
3798
  }
3733
3799
  getOrCreate(e2) {
3734
3800
  const t2 = this.key(e2), s2 = this.registry[t2];
3735
3801
  if (s2) return s2;
3736
- const n2 = new Ss(e2);
3802
+ const n2 = new Ms(e2);
3737
3803
  return this.registry[t2] = n2, n2;
3738
3804
  }
3739
3805
  deregister(e2, t2) {
@@ -3744,11 +3810,11 @@ const Is = new class {
3744
3810
  return `${e2}:${t2}`;
3745
3811
  }
3746
3812
  }();
3747
- function Ds(e2) {
3813
+ function Ss(e2) {
3748
3814
  if (!e2) throw new Error("[TalkJS] Must provide an options object to `getTalkSession`");
3749
- return e2.forceCreateNew ? new Ss(e2) : Is.getOrCreate(e2);
3815
+ return e2.forceCreateNew ? new Ms(e2) : Ds.getOrCreate(e2);
3750
3816
  }
3751
- class Ss {
3817
+ class Ms {
3752
3818
  constructor(e2) {
3753
3819
  this._onNeedToken = void 0, function(e3) {
3754
3820
  function t3(e4, t4) {
@@ -3758,7 +3824,7 @@ class Ss {
3758
3824
  void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of the `getTalkSession` options must be a function.");
3759
3825
  }(e2);
3760
3826
  const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
3761
- this._appId = t2, this._apiUrls = e2.apiUrls ? new bs(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : bs.fromHost(e2.host), this._authProvider = new xs(this._apiUrls, t2, s2, i2), n2 && this._authProvider.setToken(n2), r2 && this._authProvider.setOnNeedToken(() => __async(this, null, function* () {
3827
+ this._appId = t2, this._apiUrls = e2.apiUrls ? new ys(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : ys.fromHost(e2.host), this._authProvider = new Ts(this._apiUrls, t2, s2, i2), n2 && this._authProvider.setToken(n2), r2 && this._authProvider.setOnNeedToken(() => __async(this, null, function* () {
3762
3828
  try {
3763
3829
  const e3 = yield r2();
3764
3830
  this._authProvider.setToken(e3);
@@ -3767,11 +3833,11 @@ class Ss {
3767
3833
  }
3768
3834
  }));
3769
3835
  const a2 = Math.random().toString().split(".")[1];
3770
- this._realtimeClient = new Be(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.5.9", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new _e(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
3836
+ this._realtimeClient = new Re(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.6.1", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new Oe(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
3771
3837
  console.error(`[TalkJS] ${e3}`);
3772
3838
  }), function(e3, t3) {
3773
3839
  return __async(this, null, function* () {
3774
- return ys({ method: "GET", url: `${t3}/${e3}` }).then((e4) => __async(this, null, function* () {
3840
+ return Cs({ method: "GET", url: `${t3}/${e3}` }).then((e4) => __async(this, null, function* () {
3775
3841
  return 200 === e4.status || 404 !== e4.status && (console.warn(`[TalkJS] Received unexpected ${e4.status} status code when validating app ID. Assuming that the app ID is valid.`), true);
3776
3842
  })).catch((e4) => {
3777
3843
  if ("string" != typeof e4 && "status" in e4) {
@@ -3811,42 +3877,42 @@ class Ss {
3811
3877
  user(e2) {
3812
3878
  if ("string" != typeof e2) throw new Error(`Creating UserRef failed because ID "${e2}" is not a string`);
3813
3879
  if ("" === e2) throw new Error(`Creating UserRef failed because ID "${e2}" is an empty string`);
3814
- return new _e(e2, this._realtimeClient);
3880
+ return new Oe(e2, this._realtimeClient);
3815
3881
  }
3816
3882
  conversation(e2) {
3817
3883
  if ("string" != typeof e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is not a string`);
3818
3884
  if ("" === e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is an empty string`);
3819
- return new ms(e2, this._realtimeClient);
3885
+ return new vs(e2, this._realtimeClient);
3820
3886
  }
3821
3887
  subscribeConversations(e2) {
3822
3888
  return this._realtimeClient.subscribe(["me", "conversations"], e2);
3823
3889
  }
3824
3890
  terminate(e2) {
3825
- Is.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
3891
+ Ds.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
3826
3892
  }
3827
3893
  _isConnected() {
3828
3894
  return this._realtimeClient.isConnected();
3829
3895
  }
3830
3896
  uploadFile(e2, t2) {
3831
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
3897
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
3832
3898
  }
3833
3899
  uploadImage(e2, t2) {
3834
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
3900
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
3835
3901
  }
3836
3902
  uploadVideo(e2, t2) {
3837
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
3903
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
3838
3904
  }
3839
3905
  uploadAudio(e2, t2) {
3840
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
3906
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
3841
3907
  }
3842
3908
  uploadVoice(e2, t2) {
3843
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
3909
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
3844
3910
  }
3845
3911
  }
3846
- function Ms(_0, _1, _2, _3) {
3912
+ function Fs(_0, _1, _2, _3) {
3847
3913
  return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
3848
3914
  const u2 = new FormData();
3849
- 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()), ys({ method: "POST", url: e2, data: u2, authProvider: t2, errorTracker: t2.errorTracker }).then((e3) => e3.json()).then((e3) => e3.fileToken).catch((e3) => __async(this, null, function* () {
3915
+ 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()), Cs({ method: "POST", url: e2, data: u2, authProvider: t2, errorTracker: t2.errorTracker }).then((e3) => e3.json()).then((e3) => e3.fileToken).catch((e3) => __async(this, null, function* () {
3850
3916
  if (e3 instanceof Response) {
3851
3917
  const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
3852
3918
  throw new Error(s3);
@@ -3856,7 +3922,7 @@ function Ms(_0, _1, _2, _3) {
3856
3922
  });
3857
3923
  }
3858
3924
  export {
3859
- Ds as getTalkSession,
3925
+ Ss as getTalkSession,
3860
3926
  f as registerPolyfills
3861
3927
  };
3862
3928
  //# sourceMappingURL=talkSession.js.map