@talkjs/core 1.5.8 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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, _b;
59
+ var _a, _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 m {
138
+ class g {
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 m {
184
184
  this.stateMachine.transition("destroy");
185
185
  }
186
186
  }
187
- class g {
187
+ class m {
188
188
  constructor(e2, t2) {
189
- this.handlers = t2, this.socket = new m(e2, { onOpen: () => this.handlers.onOpen(), onClose: () => this.handlers.onClose(), onMessage: (e3) => this.onWebSocketMessage(e3) });
189
+ this.handlers = t2, this.socket = new g(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]);
@@ -205,7 +205,7 @@ class g {
205
205
  this.socket.terminate();
206
206
  }
207
207
  onWebSocketMessage(e2) {
208
- if ("Auth token expired" !== e2.data) try {
208
+ try {
209
209
  const t2 = JSON.parse(e2.data);
210
210
  if ("PUBLISH" === t2[1]) {
211
211
  const e3 = t2[0], s2 = JSON.stringify([e3, "ACK"]);
@@ -220,7 +220,6 @@ class g {
220
220
  }
221
221
  } catch (e3) {
222
222
  }
223
- else this.handlers.onAuthExpired();
224
223
  }
225
224
  }
226
225
  class v {
@@ -249,7 +248,7 @@ class w {
249
248
  }
250
249
  class b {
251
250
  constructor(e2, t2) {
252
- this.handlers = t2, this.seqCounter = new w(), this.responseHandlers = {}, this.heartbeats = new y(this), this.socket = new g(e2, { onUpstreamRestarting: () => {
251
+ this.handlers = t2, this.seqCounter = new w(), this.responseHandlers = {}, this.heartbeats = new y(this), this.socket = new m(e2, { onUpstreamRestarting: () => {
253
252
  this.heartbeats.serverActive(), this.handlers.onUpstreamRestarting();
254
253
  }, onOpen: () => {
255
254
  this.heartbeats.clientActive(), this.heartbeats.serverActive(), this.handlers.onReady();
@@ -321,15 +320,15 @@ class C {
321
320
  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* () {
322
321
  yield this.renewSession();
323
322
  }) }, logInFailed: { from: ["LOGGING_IN"], to: "LOGGING_IN", afterTransition: () => __async(this, null, function* () {
324
- this.authProvider.refreshToken(), yield this.renewSession();
323
+ this.authProvider.invalidateAndRefresh(), yield this.renewSession();
325
324
  }) }, scheduledReauth: { from: ["READY"], to: "RENEWING_SESSION", afterTransition: () => __async(this, null, function* () {
326
325
  yield this.renewSession();
327
326
  }) }, scheduledReauthFailed: { from: ["RENEWING_SESSION"], to: "RENEWING_SESSION", afterTransition: () => __async(this, null, function* () {
328
- this.authProvider.refreshToken(), yield this.renewSession();
327
+ this.authProvider.invalidateAndRefresh(), yield this.renewSession();
329
328
  }) }, authenticated: { from: ["LOGGING_IN", "RENEWING_SESSION"], to: "READY", afterTransition: ({ from: e3 }) => {
330
329
  "LOGGING_IN" === e3 && this.handlers.onReady();
331
330
  } }, authExpired: { from: ["READY", "RENEWING_SESSION"], to: "LOGGING_IN", afterTransition: () => __async(this, null, function* () {
332
- this.handlers.onNotReady(), this.authProvider.refreshToken(), yield this.renewSession();
331
+ this.handlers.onNotReady(), this.authProvider.invalidateAndRefresh(), yield this.renewSession();
333
332
  }) }, wsDisconnected: { from: ["READY", "LOGGING_IN", "RENEWING_SESSION"], to: "WAITING_FOR_WS", afterTransition: ({ from: e3 }) => {
334
333
  "READY" !== e3 && "RENEWING_SESSION" !== e3 || this.handlers.onNotReady(), this.authProvider.clearScheduledRefresh();
335
334
  } }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
@@ -361,7 +360,10 @@ class C {
361
360
  }
362
361
  renewSession() {
363
362
  return __async(this, null, function* () {
364
- const e2 = yield this.authProvider.getToken(), s2 = yield this.connection.call("POST", ["session", "renew"], { token: e2 });
363
+ const e2 = yield this.authProvider.getToken().catch(() => {
364
+ });
365
+ if (!e2) return;
366
+ const s2 = yield this.connection.call("POST", ["session", "renew"], { token: e2 });
365
367
  if (!s2.ok && "client" === s2.where) return;
366
368
  const n2 = s2.value;
367
369
  if (n2.status, 200 === n2.status) {
@@ -505,14 +507,14 @@ class x {
505
507
  this.sent = true;
506
508
  }
507
509
  }
508
- class I extends x {
510
+ class T extends x {
509
511
  constructor(e2, t2) {
510
512
  super(t2, () => {
511
513
  this.sendSubscribe(), this.sendGet();
512
514
  }), this.connection = e2, this.getCalls = [], this.subscribeCalls = [];
513
515
  }
514
516
  canPush(e2, t2) {
515
- return I.isCorrectBatchTypeFor(e2, t2);
517
+ return T.isCorrectBatchTypeFor(e2, t2);
516
518
  }
517
519
  static isCorrectBatchTypeFor(e2, t2) {
518
520
  return s(t2, ["users", "*"]) && ("GET" === e2 || "SUBSCRIBE" === e2);
@@ -538,12 +540,12 @@ class I extends x {
538
540
  this.connection.call("SUBSCRIBE", ["users"], { ids: e2 }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
539
541
  }
540
542
  }
541
- class T extends x {
543
+ class I extends x {
542
544
  constructor(e2, t2, s2) {
543
545
  super(s2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
544
546
  }
545
547
  canPush(e2, t2) {
546
- return !!T.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
548
+ return !!I.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
547
549
  }
548
550
  static isCorrectBatchTypeFor(e2, t2) {
549
551
  return s(t2, ["conversations", "*", "participants", "*"]) && ("PUT" === e2 || "POST" === e2 || "PATCH" === e2);
@@ -585,10 +587,10 @@ class D {
585
587
  return this.connection.isConnected();
586
588
  }
587
589
  createEmptyBatchFor(e2, t2) {
588
- if (I.isCorrectBatchTypeFor(e2, t2)) return new I(this.connection, () => this.pendingBatch = null);
589
- if (T.isCorrectBatchTypeFor(e2, t2)) {
590
+ if (T.isCorrectBatchTypeFor(e2, t2)) return new T(this.connection, () => this.pendingBatch = null);
591
+ if (I.isCorrectBatchTypeFor(e2, t2)) {
590
592
  const e3 = t2[1];
591
- return new T(e3, this.connection, () => this.pendingBatch = null);
593
+ return new I(e3, this.connection, () => this.pendingBatch = null);
592
594
  }
593
595
  return null;
594
596
  }
@@ -704,18 +706,18 @@ class N {
704
706
  function _(e2) {
705
707
  return Object.freeze(e2);
706
708
  }
707
- function P(e2) {
709
+ function O(e2) {
708
710
  return _(e2.map((e3) => function(e4) {
709
711
  switch (e4.type) {
710
712
  case "text":
711
- return Object.freeze({ type: "text", children: O(e4.children) });
713
+ return Object.freeze({ type: "text", children: P(e4.children) });
712
714
  case "file":
713
715
  case "location":
714
716
  return Object.freeze(e4);
715
717
  }
716
718
  }(e3)));
717
719
  }
718
- function O(e2) {
720
+ function P(e2) {
719
721
  return _(e2.map((e3) => function(e4) {
720
722
  if ("string" == typeof e4) return e4;
721
723
  switch (e4.type) {
@@ -727,7 +729,7 @@ function O(e2) {
727
729
  case "link":
728
730
  case "actionLink":
729
731
  case "actionButton":
730
- return Object.freeze(__spreadProps(__spreadValues({}, e4), { children: O(e4.children) }));
732
+ return Object.freeze(__spreadProps(__spreadValues({}, e4), { children: P(e4.children) }));
731
733
  case "mention":
732
734
  case "autoLink":
733
735
  case "codeSpan":
@@ -736,10 +738,10 @@ function O(e2) {
736
738
  }
737
739
  }(e3)));
738
740
  }
739
- function j(e2, t2) {
741
+ function U(e2, t2) {
740
742
  return void 0 === t2 ? e2 : t2;
741
743
  }
742
- function U(e2, t2) {
744
+ function j(e2, t2) {
743
745
  return void 0 === t2 ? e2 : _(t2);
744
746
  }
745
747
  function $(e2, t2) {
@@ -793,10 +795,10 @@ class H {
793
795
  return (_a2 = this.pendingPointer) != null ? _a2 : this.getPointer;
794
796
  }
795
797
  canAppendState(e2) {
796
- var _a2, _b2;
798
+ var _a2, _b;
797
799
  const t2 = (_a2 = this.getPointer) == null ? void 0 : _a2.seq;
798
800
  if (void 0 !== t2 && e2 <= t2) return false;
799
- const s2 = (_b2 = this.pendingPointer) == null ? void 0 : _b2.seq;
801
+ const s2 = (_b = this.pendingPointer) == null ? void 0 : _b.seq;
800
802
  return !(void 0 !== s2 && e2 < s2);
801
803
  }
802
804
  set(e2) {
@@ -1023,9 +1025,9 @@ function re(e2, t2) {
1023
1025
  const s2 = e2.map((e3) => function(e4, t3) {
1024
1026
  if ("text" === e4.type) return function(e5, t4) {
1025
1027
  const s3 = function(e6) {
1026
- var _a2, _b2, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m;
1028
+ var _a2, _b, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m;
1027
1029
  let t5 = "";
1028
- 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 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 };
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 };
1029
1031
  }(t4);
1030
1032
  return ie(e5, s3);
1031
1033
  }(e4.children, t3);
@@ -1115,7 +1117,7 @@ class ce extends z {
1115
1117
  this.mutate(e2, (s2) => {
1116
1118
  const n2 = s2.value.snapshot;
1117
1119
  if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
1118
- return c({ snapshot: { id: n2.id, name: j(n2.name, t2.diff.name), custom: $(n2.custom, t2.diff.custom), locale: j(n2.locale, t2.diff.locale), photoUrl: j(n2.photoUrl, t2.diff.photoUrl), role: j(n2.role, t2.diff.role), welcomeMessage: j(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
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 });
1119
1121
  });
1120
1122
  }
1121
1123
  getFromCache() {
@@ -1148,7 +1150,7 @@ class le extends G {
1148
1150
  if (!e3.ok) return e3;
1149
1151
  t2 = e3.value.data;
1150
1152
  }
1151
- 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: P(t2.content), reactions: ue(t2.reactions) } });
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) } });
1152
1154
  });
1153
1155
  }
1154
1156
  refetch(e2) {
@@ -1170,8 +1172,8 @@ class le extends G {
1170
1172
  }
1171
1173
  loadNested(e2, t2) {
1172
1174
  return __async(this, null, function* () {
1173
- var _a2, _b2, _c;
1174
- const s2 = yield (_b2 = (_a2 = t2.sender) == null ? void 0 : _a2.store) == null ? void 0 : _b2.getDeep(e2);
1175
+ var _a2, _b, _c;
1176
+ const s2 = yield (_b = (_a2 = t2.sender) == null ? void 0 : _a2.store) == null ? void 0 : _b.getDeep(e2);
1175
1177
  if (false === (s2 == null ? void 0 : s2.ok)) return s2;
1176
1178
  if (null === t2.data) return c({ snapshot: null });
1177
1179
  const n2 = s2 == null ? void 0 : s2.value;
@@ -1181,10 +1183,10 @@ class le extends G {
1181
1183
  messageEdited(e2, t2) {
1182
1184
  this.mutate(e2, (s2) => {
1183
1185
  if (null === s2.value.data) return s2;
1184
- const n2 = s2.value.data.content, r2 = (i2 = n2, void 0 === (a2 = t2.diff.content) ? i2 : P(a2));
1186
+ const n2 = s2.value.data.content, r2 = (i2 = n2, void 0 === (a2 = t2.diff.content) ? i2 : O(a2));
1185
1187
  var i2, a2;
1186
1188
  const o2 = n2 === r2 ? s2.value.data.plaintext : re(r2, {});
1187
- 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: j(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) } });
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) } });
1188
1190
  });
1189
1191
  }
1190
1192
  messageDeleted(e2, t2) {
@@ -1192,7 +1194,7 @@ class le extends G {
1192
1194
  }
1193
1195
  getFromCache() {
1194
1196
  return __async(this, null, function* () {
1195
- var _b2;
1197
+ var _b;
1196
1198
  const e2 = yield this.mostRecentState.resultPromise;
1197
1199
  if (!e2.ok) return l("NOT_IN_CACHE");
1198
1200
  if (null === e2.value.data) {
@@ -1201,7 +1203,7 @@ class le extends G {
1201
1203
  const _a2 = e2.value, { sender: t2 } = _a2, s2 = __objRest(_a2, ["sender"]), n2 = {};
1202
1204
  return s2.data.reactions.forEach((e3) => {
1203
1205
  n2[e3.emoji] = { count: e3.count, currentUserReacted: e3.currentUserReacted };
1204
- }), c({ status: 200, data: __spreadProps(__spreadValues({}, s2.data), { senderId: (_b2 = t2 == null ? void 0 : t2.store.userId) != null ? _b2 : null, reactions: n2 }) });
1206
+ }), c({ status: 200, data: __spreadProps(__spreadValues({}, s2.data), { senderId: (_b = t2 == null ? void 0 : t2.store.userId) != null ? _b : null, reactions: n2 }) });
1205
1207
  });
1206
1208
  }
1207
1209
  }
@@ -1209,7 +1211,7 @@ function he(e2, t2) {
1209
1211
  if (void 0 === t2) return e2;
1210
1212
  const s2 = e2.map((e3) => {
1211
1213
  const s3 = t2[e3.emoji];
1212
- return void 0 === s3 ? e3 : _(null === s3 ? __spreadProps(__spreadValues({}, e3), { count: 0 }) : { emoji: e3.emoji, count: j(e3.count, s3.count), currentUserReacted: j(e3.currentUserReacted, s3.currentUserReacted) });
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) });
1213
1215
  }).filter((e3) => e3.count > 0), n2 = new Set(s2.map((e3) => e3.emoji));
1214
1216
  for (const e3 in t2) {
1215
1217
  const r2 = t2[e3];
@@ -1245,14 +1247,14 @@ class de extends G {
1245
1247
  }
1246
1248
  loadNested(e2, t2) {
1247
1249
  return __async(this, null, function* () {
1248
- var _a2, _b2, _c;
1250
+ var _a2, _b, _c;
1249
1251
  const s2 = yield t2.dataStore.getDeep(e2);
1250
1252
  if (!s2.ok) return s2;
1251
1253
  const n2 = s2.value;
1252
1254
  if (null === n2.snapshot) return c({ snapshot: null });
1253
1255
  const r2 = yield (_a2 = t2.referencedDataStore) == null ? void 0 : _a2.getDeep(e2);
1254
1256
  if (r2 && !r2.ok) return r2;
1255
- const i2 = (_b2 = r2 == null ? void 0 : r2.value) != null ? _b2 : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
1257
+ const i2 = (_b = r2 == null ? void 0 : r2.value) != null ? _b : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
1256
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 }) });
1257
1259
  });
1258
1260
  }
@@ -1272,7 +1274,7 @@ class pe extends z {
1272
1274
  fetchInitial(e2) {
1273
1275
  return __async(this, null, function* () {
1274
1276
  const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield fe({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
1275
- return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) : me({ seq: e2, messages: s2.value.messages, cursor: s2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : s2;
1277
+ 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;
1276
1278
  });
1277
1279
  }
1278
1280
  teardownNested(e2) {
@@ -1330,7 +1332,7 @@ class pe extends z {
1330
1332
  });
1331
1333
  }
1332
1334
  loadedMore(e2, t2) {
1333
- this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), s2) : me({ seq: e2, prevState: s2.value, messages: t2.data.value.messages, cursor: t2.data.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2.data);
1335
+ this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), s2) : ge({ seq: e2, prevState: s2.value, messages: t2.data.value.messages, cursor: t2.data.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2.data);
1334
1336
  }
1335
1337
  messageCreated(e2, t2) {
1336
1338
  this.mutate(e2, (s2) => {
@@ -1409,8 +1411,8 @@ function fe(_0) {
1409
1411
  return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 : c({ messages: null, nextCursor: null });
1410
1412
  });
1411
1413
  }
1412
- function me({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
1413
- var _a2, _b2, _c, _d;
1414
+ function ge({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
1415
+ var _a2, _b, _c, _d;
1414
1416
  const a2 = t2 ? __spreadValues({}, t2.stores) : {};
1415
1417
  for (const t3 of s2) if (void 0 === a2[t3.id]) {
1416
1418
  const s3 = new le(e2, r2, t3, i2);
@@ -1426,11 +1428,11 @@ function me({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId:
1426
1428
  const o2 = t2 ? [...t2.inWindow] : [];
1427
1429
  for (const t3 of s2) o2.push(new de(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
1428
1430
  o2.sort((e3, t3) => t3.createdAt - e3.createdAt);
1429
- 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;
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;
1430
1432
  if (null === n2) return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: null });
1431
1433
  return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: { cursor: n2, oldestMessageTs: s2[s2.length - 1].createdAt } });
1432
1434
  }
1433
- class ge extends z {
1435
+ class me extends z {
1434
1436
  constructor(e2, t2, s2, n2, r2) {
1435
1437
  super(e2, n2, r2), this.convData = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 0;
1436
1438
  }
@@ -1555,8 +1557,8 @@ class ye extends G {
1555
1557
  throw "Do not call refetch on participant data stores, it can return outdated data. Destroy and remake them instead";
1556
1558
  }
1557
1559
  equal(e2, t2) {
1558
- var _a2, _b2, _c, _d;
1559
- 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) && W(e2.data, t2.data);
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);
1560
1562
  }
1561
1563
  teardownNested(e2) {
1562
1564
  var _a2;
@@ -1581,7 +1583,7 @@ class ye extends G {
1581
1583
  participantEdited(e2, t2) {
1582
1584
  this.mutate(e2, (s2) => {
1583
1585
  if (null === s2.value.data) return s2;
1584
- return c({ lastChanged: e2, user: s2.value.user, data: { id: s2.value.data.id, access: j(s2.value.data.access, t2.diff.access), notify: j(s2.value.data.notify, t2.diff.notify), joinedAt: s2.value.data.joinedAt } });
1586
+ return c({ lastChanged: e2, user: s2.value.user, data: { id: s2.value.data.id, access: U(s2.value.data.access, t2.diff.access), notify: U(s2.value.data.notify, t2.diff.notify), joinedAt: s2.value.data.joinedAt } });
1585
1587
  });
1586
1588
  }
1587
1589
  participantDeleted(e2, t2) {
@@ -1725,7 +1727,7 @@ class ke extends z {
1725
1727
  fetchInitial(e2) {
1726
1728
  return __async(this, null, function* () {
1727
1729
  const t2 = yield xe({ realtimeClient: this.realtimeClient, count: 20 });
1728
- 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;
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;
1729
1731
  });
1730
1732
  }
1731
1733
  teardownNested(e2) {
@@ -1751,8 +1753,8 @@ class ke extends z {
1751
1753
  if (n2) return n2;
1752
1754
  const r2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
1753
1755
  return r2.sort((e3, t3) => {
1754
- var _a2, _b2, _c, _d;
1755
- const s3 = (_b2 = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b2 : e3.joinedAt;
1756
+ var _a2, _b, _c, _d;
1757
+ const s3 = (_b = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b : e3.joinedAt;
1756
1758
  return ((_d = (_c = t3.lastMessage) == null ? void 0 : _c.createdAt) != null ? _d : t3.joinedAt) - s3;
1757
1759
  }), c({ snapshot: _(r2), loadedAll: null === t2.windowEnd });
1758
1760
  });
@@ -1783,7 +1785,7 @@ class ke extends z {
1783
1785
  });
1784
1786
  }
1785
1787
  loadedMore(e2, t2) {
1786
- 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);
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);
1787
1789
  }
1788
1790
  userCreated(e2, t2) {
1789
1791
  this.mutate(e2, (e3) => null !== e3.value.stores ? e3 : c({ lastChanged: e3.value.lastChanged, stores: {}, windowEnd: null }));
@@ -1832,13 +1834,13 @@ function xe(_0) {
1832
1834
  return r2.ok || "server" !== r2.where || 404 !== r2.value.status || "USER_NOT_FOUND" !== r2.value.errorCode ? r2 : c({ conversations: null, nextCursor: null });
1833
1835
  });
1834
1836
  }
1835
- function Ie({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
1837
+ function Te({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
1836
1838
  const i2 = t2 ? __spreadValues({}, t2) : {};
1837
1839
  for (const e3 of s2) void 0 === i2[e3.id] && (i2[e3.id] = r2(e3));
1838
1840
  if (null === n2) return c({ lastChanged: e2, stores: i2, windowEnd: null });
1839
1841
  return c({ lastChanged: e2, stores: i2, windowEnd: { cursor: n2, oldestMessageTs: Math.min(...s2.map((e3) => e3.lastMessageAt)) } });
1840
1842
  }
1841
- class Te extends z {
1843
+ class Ie extends z {
1842
1844
  constructor(e2, t2, s2, n2, r2) {
1843
1845
  super(e2, n2, r2), this.conversation = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 5e3;
1844
1846
  }
@@ -1906,7 +1908,7 @@ class Te extends z {
1906
1908
  }
1907
1909
  function De(e2, t2) {
1908
1910
  const s2 = t2;
1909
- return { id: e2.id, createdAt: e2.createdAt, subject: j(e2.subject, s2.subject), photoUrl: j(e2.photoUrl, s2.photoUrl), welcomeMessages: U(e2.welcomeMessages, s2.welcomeMessages), custom: $(e2.custom, s2.custom), lastMessageAt: j(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: j(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: j(e2.isUnread, s2.isUnread), access: j(e2.access, s2.access), notify: j(e2.notify, s2.notify), readUntil: j(e2.readUntil, s2.readUntil), everyoneReadUntil: j(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
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 };
1910
1912
  }
1911
1913
  class Se extends z {
1912
1914
  constructor(e2, t2, s2, n2, r2) {
@@ -1993,10 +1995,10 @@ class Me {
1993
1995
  }));
1994
1996
  }
1995
1997
  handlePublish(e2, t2) {
1996
- var _a2, _b2, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s2, _t3, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
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;
1997
1999
  switch (t2.type) {
1998
2000
  case "user.created":
1999
- 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));
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));
2000
2002
  case "user.edited":
2001
2003
  return void ((_d = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _d.userEdited(e2, t2));
2002
2004
  case "side.created":
@@ -2012,7 +2014,7 @@ class Me {
2012
2014
  case "message.edited":
2013
2015
  return void ((_r = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _r.messageEdited(e2, t2));
2014
2016
  case "message.deleted":
2015
- return void ((_s2 = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _s2.messageDeleted(e2, t2));
2017
+ return void ((_s = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _s.messageDeleted(e2, t2));
2016
2018
  case "typing.available":
2017
2019
  return void ((_t3 = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _t3.typingAvailable(e2, t2));
2018
2020
  case "typing.changed":
@@ -2128,7 +2130,7 @@ class Me {
2128
2130
  }
2129
2131
  instantiateStore(e2, t2) {
2130
2132
  if (s(e2, ["users", "*"])) return new ce(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2131
- if (s(e2, ["me", "conversations", "*"])) return new ge(this.virtualSeq, this.subscribeConvData(e2[2]), 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 });
2132
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) });
2133
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) });
2134
2136
  if (s(e2, ["me", "conversations", "*", "typing"])) return new be(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
@@ -2142,7 +2144,7 @@ class Me {
2142
2144
  const e3 = this.convDataStores[t2];
2143
2145
  return { store: e3, unsubscribe: e3.registerInternalSubscription() };
2144
2146
  }
2145
- const s2 = new Te(this.virtualSeq, e2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
2147
+ const s2 = new Ie(this.virtualSeq, e2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
2146
2148
  delete this.convDataStores[t2];
2147
2149
  } });
2148
2150
  return this.convDataStores[t2] = s2, { store: s2, unsubscribe: s2.registerInternalSubscription() };
@@ -2261,7 +2263,7 @@ class _e {
2261
2263
  return this._realtimeClient.subscribe(["users", this.brandedId, "online"], e2);
2262
2264
  }
2263
2265
  }
2264
- class Pe {
2266
+ class Oe {
2265
2267
  constructor(e2, t2, s2) {
2266
2268
  this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
2267
2269
  }
@@ -2304,7 +2306,7 @@ class Pe {
2304
2306
  });
2305
2307
  }
2306
2308
  }
2307
- function Oe(e2) {
2309
+ function Pe(e2) {
2308
2310
  const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
2309
2311
  let s2 = 0;
2310
2312
  const n2 = [], r2 = e2 === s2;
@@ -2322,7 +2324,7 @@ function Oe(e2) {
2322
2324
  if (20 != a2.length) throw new Error("Length should be 20.");
2323
2325
  return a2;
2324
2326
  }
2325
- const je = (e2, t2, s2 = void 0) => function(e3, t3) {
2327
+ const Ue = (e2, t2, s2 = void 0) => function(e3, t3) {
2326
2328
  return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
2327
2329
  }(e2, (e3) => {
2328
2330
  if ("string" == typeof e3) return t2(e3, s2);
@@ -2335,14 +2337,14 @@ const je = (e2, t2, s2 = void 0) => function(e3, t3) {
2335
2337
  case "bulletList":
2336
2338
  case "bulletpoint":
2337
2339
  case "bulletPoint":
2338
- return [{ type: e3.type, children: je(e3.children, t2, e3.type) }];
2340
+ return [{ type: e3.type, children: Ue(e3.children, t2, e3.type) }];
2339
2341
  case "link":
2340
- return [{ type: e3.type, url: e3.url, children: je(e3.children, t2, e3.type) }];
2342
+ return [{ type: e3.type, url: e3.url, children: Ue(e3.children, t2, e3.type) }];
2341
2343
  case "actionlink":
2342
2344
  case "actionLink":
2343
2345
  case "actionbutton":
2344
2346
  case "actionButton":
2345
- return [{ type: e3.type, action: e3.action, params: e3.params, children: je(e3.children, t2, e3.type) }];
2347
+ return [{ type: e3.type, action: e3.action, params: e3.params, children: Ue(e3.children, t2, e3.type) }];
2346
2348
  case "mention":
2347
2349
  case "autolink":
2348
2350
  case "autoLink":
@@ -2357,7 +2359,7 @@ const je = (e2, t2, s2 = void 0) => function(e3, t3) {
2357
2359
  return [e3];
2358
2360
  }
2359
2361
  });
2360
- function Ue(e2, t2) {
2362
+ function je(e2, t2) {
2361
2363
  return (s2) => {
2362
2364
  const n2 = s2;
2363
2365
  let r2 = 0;
@@ -2381,7 +2383,7 @@ function Le(e2) {
2381
2383
  }
2382
2384
  function Ge(e2, t2 = 0) {
2383
2385
  const s2 = qe[t2], n2 = s2 ? function(e3) {
2384
- const t3 = ze.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${$e}])(?:${e3.source})(?=[\\s${$e}]|$)`, "g")), s3 = Ue(t3, (e4) => {
2386
+ const t3 = ze.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${$e}])(?:${e3.source})(?=[\\s${$e}]|$)`, "g")), s3 = je(t3, (e4) => {
2385
2387
  const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
2386
2388
  return [" ", { type: We[He[t4]], children: [s4] }];
2387
2389
  });
@@ -2390,7 +2392,7 @@ function Ge(e2, t2 = 0) {
2390
2392
  return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
2391
2393
  };
2392
2394
  }(s2) : () => [e2];
2393
- return je(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Ge(e3, t2 | We[s3]) : [e3]);
2395
+ return Ue(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Ge(e3, t2 | We[s3]) : [e3]);
2394
2396
  }
2395
2397
  const ze = function() {
2396
2398
  const e2 = function() {
@@ -2695,14 +2697,14 @@ var tt, st = function() {
2695
2697
  }, t2;
2696
2698
  }(Ke), ut = function(e2) {
2697
2699
  this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
2698
- }, ct = /[A-Za-z]/, lt = /[\d]/, ht = /[\D]/, dt = /\s/, pt = /['"]/, ft = /[\x00-\x1F\x7F]/, mt = /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, gt = mt + /\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 = gt + vt, bt = gt + vt, yt = "(?:[" + vt + "]{1,3}\\.){3}[" + vt + "]{1,3}", Ct = "[" + bt + "](?:[" + bt + "\\-]{0,61}[" + bt + "])?", At = function(e2) {
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) {
2699
2701
  return "(?=(" + Ct + "))\\" + e2;
2700
2702
  }, Et = function(e2) {
2701
2703
  return "(?:" + At(e2) + "(?:\\." + At(e2 + 1) + "){0,126}|" + yt + ")";
2702
- }, 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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, It = new RegExp("[" + bt + "!#$%&'*+/=?^_`{|}~-]"), Tt = new RegExp("^" + xt.source + "$"), Dt = function(e2) {
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) {
2703
2705
  function t2() {
2704
2706
  var t3 = null !== e2 && e2.apply(this, arguments) || this;
2705
- return t3.localPartCharRegex = It, t3.strictTldRegex = Tt, t3;
2707
+ return t3.localPartCharRegex = Tt, t3.strictTldRegex = It, t3;
2706
2708
  }
2707
2709
  return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2708
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; ) {
@@ -2718,10 +2720,10 @@ var tt, st = function() {
2718
2720
  f2(h2);
2719
2721
  break;
2720
2722
  case 3:
2721
- m2(h2);
2723
+ g2(h2);
2722
2724
  break;
2723
2725
  case 4:
2724
- g2(h2);
2726
+ m2(h2);
2725
2727
  break;
2726
2728
  case 5:
2727
2729
  v2(h2);
@@ -2747,10 +2749,10 @@ var tt, st = function() {
2747
2749
  function f2(e4) {
2748
2750
  "." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || C2();
2749
2751
  }
2750
- function m2(e4) {
2752
+ function g2(e4) {
2751
2753
  "." === e4 || "@" === e4 ? C2() : s2.test(e4) ? c2 = 2 : C2();
2752
2754
  }
2753
- function g2(e4) {
2755
+ function m2(e4) {
2754
2756
  kt.test(e4) ? c2 = 5 : C2();
2755
2757
  }
2756
2758
  function v2(e4) {
@@ -2801,7 +2803,7 @@ var tt, st = function() {
2801
2803
  return !(!e3 || t2 && this.hasFullProtocolRegex.test(t2) || -1 !== e3.indexOf("."));
2802
2804
  }, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
2803
2805
  return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
2804
- }, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + mt + "]"), 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;
2806
+ }, 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;
2805
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) {
2806
2808
  function t2(t3) {
2807
2809
  var s2 = e2.call(this, t3) || this;
@@ -2809,14 +2811,14 @@ var tt, st = function() {
2809
2811
  }
2810
2812
  return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2811
2813
  for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
2812
- 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);
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);
2813
2815
  if (!Mt.isValid(s3, u3)) return "continue";
2814
- if (p2 > 0 && "@" === m2) return "continue";
2815
- if (p2 > 0 && f2 && c2.wordCharRegExp.test(m2)) return "continue";
2816
+ if (p2 > 0 && "@" === g2) return "continue";
2817
+ if (p2 > 0 && f2 && c2.wordCharRegExp.test(g2)) return "continue";
2816
2818
  if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
2817
2819
  else {
2818
- var g2 = c2.matchHasInvalidCharAfterTld(s3, u3);
2819
- g2 > -1 && (s3 = s3.substr(0, g2));
2820
+ var m2 = c2.matchHasInvalidCharAfterTld(s3, u3);
2821
+ m2 > -1 && (s3 = s3.substr(0, m2));
2820
2822
  }
2821
2823
  var v2 = ["http://", "https://"].find(function(e4) {
2822
2824
  return !!u3 && -1 !== u3.indexOf(e4);
@@ -2849,7 +2851,7 @@ var tt, st = function() {
2849
2851
  var n2 = new RegExp("^((.?//)?[-." + bt + "]*[-" + bt + "]\\.[-" + bt + "]+)").exec(e3);
2850
2852
  return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
2851
2853
  }, t2;
2852
- }(ut), Nt = new RegExp("#[_" + bt + "]{1,139}(?![_" + bt + "])", "g"), _t = new RegExp("[^" + bt + "]"), Pt = function(e2) {
2854
+ }(ut), Nt = new RegExp("#[_" + bt + "]{1,139}(?![_" + bt + "])", "g"), _t = new RegExp("[^" + bt + "]"), Ot = function(e2) {
2853
2855
  function t2(t3) {
2854
2856
  var s2 = e2.call(this, t3) || this;
2855
2857
  return s2.serviceName = "twitter", s2.matcherRegex = Nt, s2.nonWordCharRegex = _t, s2.serviceName = t3.serviceName, s2;
@@ -2864,10 +2866,10 @@ var tt, st = function() {
2864
2866
  }
2865
2867
  return a2;
2866
2868
  }, t2;
2867
- }(ut), Ot = 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"), jt = function(e2) {
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) {
2868
2870
  function t2() {
2869
2871
  var t3 = null !== e2 && e2.apply(this, arguments) || this;
2870
- return t3.matcherRegex = Ot, t3;
2872
+ return t3.matcherRegex = Pt, t3;
2871
2873
  }
2872
2874
  return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2873
2875
  for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
@@ -2878,10 +2880,10 @@ var tt, st = function() {
2878
2880
  }, t2.prototype.testMatch = function(e3) {
2879
2881
  return ht.test(e3);
2880
2882
  }, t2;
2881
- }(ut), Ut = 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) {
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) {
2882
2884
  function t2(t3) {
2883
2885
  var s2 = e2.call(this, t3) || this;
2884
- return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: Ut, instagram: $t, soundcloud: Wt }, s2.nonWordCharRegex = qt, s2.serviceName = t3.serviceName, s2;
2886
+ return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: jt, instagram: $t, soundcloud: Wt }, s2.nonWordCharRegex = qt, s2.serviceName = t3.serviceName, s2;
2885
2887
  }
2886
2888
  return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2887
2889
  var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
@@ -2901,10 +2903,10 @@ function Lt(e2, t2) {
2901
2903
  var f2 = e2.charAt(c2);
2902
2904
  switch (h2) {
2903
2905
  case 0:
2904
- m2(f2);
2906
+ g2(f2);
2905
2907
  break;
2906
2908
  case 1:
2907
- g2(f2);
2909
+ m2(f2);
2908
2910
  break;
2909
2911
  case 2:
2910
2912
  w2(f2);
@@ -2934,10 +2936,10 @@ function Lt(e2, t2) {
2934
2936
  x2(f2);
2935
2937
  break;
2936
2938
  case 11:
2937
- I2(f2);
2939
+ T2(f2);
2938
2940
  break;
2939
2941
  case 12:
2940
- T2(f2);
2942
+ I2(f2);
2941
2943
  break;
2942
2944
  case 13:
2943
2945
  D2();
@@ -2968,29 +2970,29 @@ function Lt(e2, t2) {
2968
2970
  }
2969
2971
  c2++;
2970
2972
  }
2971
- function m2(e3) {
2972
- "<" === e3 && O2();
2973
- }
2974
2973
  function g2(e3) {
2975
- "!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new Gt(st(st({}, p2), { isClosing: true }))) : "<" === e3 ? O2() : ct.test(e3) ? (h2 = 3, p2 = new Gt(st(st({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
2974
+ "<" === e3 && P2();
2975
+ }
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);
2976
2978
  }
2977
2979
  function v2(e3) {
2978
- dt.test(e3) ? (p2 = new Gt(st(st({}, p2), { name: U2() })), h2 = 4) : "<" === e3 ? O2() : "/" === e3 ? (p2 = new Gt(st(st({}, p2), { name: U2() })), h2 = 12) : ">" === e3 ? (p2 = new Gt(st(st({}, p2), { name: U2() })), j2()) : ct.test(e3) || lt.test(e3) || ":" === e3 || P2();
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();
2979
2981
  }
2980
2982
  function w2(e3) {
2981
- ">" === e3 ? P2() : ct.test(e3) ? h2 = 3 : P2();
2983
+ ">" === e3 ? O2() : ct.test(e3) ? h2 = 3 : O2();
2982
2984
  }
2983
2985
  function b2(e3) {
2984
- dt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? O2() : "=" === e3 || pt.test(e3) || ft.test(e3) ? P2() : h2 = 5);
2986
+ dt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? P2() : "=" === e3 || pt.test(e3) || ft.test(e3) ? O2() : h2 = 5);
2985
2987
  }
2986
2988
  function y2(e3) {
2987
- dt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? O2() : pt.test(e3) && P2();
2989
+ dt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? P2() : pt.test(e3) && O2();
2988
2990
  }
2989
2991
  function C2(e3) {
2990
- dt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? O2() : pt.test(e3) ? P2() : h2 = 5);
2992
+ dt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? P2() : pt.test(e3) ? O2() : h2 = 5);
2991
2993
  }
2992
2994
  function A2(e3) {
2993
- dt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? P2() : "<" === e3 ? O2() : h2 = 10);
2995
+ dt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? O2() : "<" === e3 ? P2() : h2 = 10);
2994
2996
  }
2995
2997
  function E2(e3) {
2996
2998
  '"' === e3 && (h2 = 11);
@@ -2999,22 +3001,22 @@ function Lt(e2, t2) {
2999
3001
  "'" === e3 && (h2 = 11);
3000
3002
  }
3001
3003
  function x2(e3) {
3002
- dt.test(e3) ? h2 = 4 : ">" === e3 ? j2() : "<" === e3 && O2();
3003
- }
3004
- function I2(e3) {
3005
- dt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? O2() : (h2 = 4, c2--);
3004
+ dt.test(e3) ? h2 = 4 : ">" === e3 ? U2() : "<" === e3 && P2();
3006
3005
  }
3007
3006
  function T2(e3) {
3008
- ">" === e3 ? (p2 = new Gt(st(st({}, p2), { isClosing: true })), j2()) : h2 = 4;
3007
+ dt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? P2() : (h2 = 4, c2--);
3008
+ }
3009
+ function I2(e3) {
3010
+ ">" === e3 ? (p2 = new Gt(st(st({}, p2), { isClosing: true })), U2()) : h2 = 4;
3009
3011
  }
3010
3012
  function D2(t3) {
3011
- "--" === 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) : P2();
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();
3012
3014
  }
3013
3015
  function S2(e3) {
3014
- "-" === e3 ? h2 = 15 : ">" === e3 ? P2() : h2 = 16;
3016
+ "-" === e3 ? h2 = 15 : ">" === e3 ? O2() : h2 = 16;
3015
3017
  }
3016
3018
  function M2(e3) {
3017
- "-" === e3 ? h2 = 18 : ">" === e3 ? P2() : h2 = 16;
3019
+ "-" === e3 ? h2 = 18 : ">" === e3 ? O2() : h2 = 16;
3018
3020
  }
3019
3021
  function F2(e3) {
3020
3022
  "-" === e3 && (h2 = 17);
@@ -3023,25 +3025,25 @@ function Lt(e2, t2) {
3023
3025
  h2 = "-" === e3 ? 18 : 16;
3024
3026
  }
3025
3027
  function R2(e3) {
3026
- ">" === e3 ? j2() : "!" === e3 ? h2 = 19 : "-" === e3 || (h2 = 16);
3028
+ ">" === e3 ? U2() : "!" === e3 ? h2 = 19 : "-" === e3 || (h2 = 16);
3027
3029
  }
3028
3030
  function N2(e3) {
3029
- "-" === e3 ? h2 = 17 : ">" === e3 ? j2() : h2 = 16;
3031
+ "-" === e3 ? h2 = 17 : ">" === e3 ? U2() : h2 = 16;
3030
3032
  }
3031
3033
  function _2(e3) {
3032
- ">" === e3 ? j2() : "<" === e3 && O2();
3034
+ ">" === e3 ? U2() : "<" === e3 && P2();
3033
3035
  }
3034
- function P2() {
3036
+ function O2() {
3035
3037
  h2 = 0, p2 = u2;
3036
3038
  }
3037
- function O2() {
3039
+ function P2() {
3038
3040
  h2 = 1, p2 = new Gt({ idx: c2 });
3039
3041
  }
3040
- function j2() {
3042
+ function U2() {
3041
3043
  var t3 = e2.slice(d2, p2.idx);
3042
- 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)), P2(), d2 = c2 + 1;
3044
+ 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;
3043
3045
  }
3044
- function U2() {
3046
+ function j2() {
3045
3047
  var t3 = p2.idx + (p2.isClosing ? 2 : 1);
3046
3048
  return e2.slice(t3, c2).toLowerCase();
3047
3049
  }
@@ -3147,28 +3149,28 @@ var Gt = function(e2) {
3147
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();
3148
3150
  }, e2.prototype.getMatchers = function() {
3149
3151
  if (this.matchers) return this.matchers;
3150
- var e3 = this.getTagBuilder(), t2 = [new Pt({ tagBuilder: e3, serviceName: this.hashtag }), new Dt({ tagBuilder: e3 }), new jt({ tagBuilder: e3 }), new Ht({ tagBuilder: e3, serviceName: this.mention }), new Rt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
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 })];
3151
3153
  return this.matchers = t2;
3152
3154
  }, e2.prototype.getTagBuilder = function() {
3153
3155
  var e3 = this.tagBuilder;
3154
3156
  return e3 || (e3 = this.tagBuilder = new Ze({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
3155
- }, e2.version = "3.14.3", e2.AnchorTagBuilder = Ze, e2.HtmlTag = Ve, e2.matcher = { Email: Dt, Hashtag: Pt, Matcher: ut, Mention: Ht, Phone: jt, Url: Rt }, e2.match = { Email: nt, Hashtag: rt, Match: Ke, Mention: it, Phone: at, Url: ot }, e2;
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;
3156
3158
  }();
3157
3159
  function Jt(e2, t2 = e2) {
3158
3160
  return { type: "autolink", url: e2, text: t2 };
3159
3161
  }
3160
- const Yt = Ue(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
3162
+ const Yt = je(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
3161
3163
  return { type: "mention", id: e3, text: t3 };
3162
- }(decodeURIComponent(t2), s2)), Qt = Ue(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
3164
+ }(decodeURIComponent(t2), s2)), Qt = je(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
3163
3165
  return { type: "customemoji", text: e3 };
3164
- }(t2)), Vt = Ue(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
3166
+ }(t2)), Vt = je(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
3165
3167
  return { type: "link", url: e3, children: t3 };
3166
- }(t2, [s2])), Zt = Ue(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3168
+ }(t2, [s2])), Zt = je(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3167
3169
  const { action: n2, params: r2 } = Xt(t2);
3168
3170
  return /* @__PURE__ */ function(e3, t3, s3 = []) {
3169
3171
  return { type: "actionlink", action: e3, params: t3, children: s3 };
3170
3172
  }(n2, r2, [s2]);
3171
- }), Kt = Ue(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3173
+ }), Kt = je(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3172
3174
  const { action: n2, params: r2 } = Xt(t2);
3173
3175
  return /* @__PURE__ */ function(e3, t3, s3 = []) {
3174
3176
  return { type: "actionbutton", action: e3, params: t3, children: s3 };
@@ -3179,9 +3181,9 @@ function Xt(e2) {
3179
3181
  if (-1 === t2) return { action: e2, params: {} };
3180
3182
  return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
3181
3183
  }
3182
- const es = Ue(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
3184
+ const es = je(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
3183
3185
  return { type: "bulletlist", children: e3 };
3184
- }([e2.startsWith("\n") ? e2.slice(1) : e2])), ts = Ue(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), ss = (e2) => {
3186
+ }([e2.startsWith("\n") ? e2.slice(1) : e2])), ts = je(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), ss = (e2) => {
3185
3187
  const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
3186
3188
  let s2 = 0;
3187
3189
  const n2 = [];
@@ -3205,7 +3207,7 @@ const es = Ue(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__
3205
3207
  function as(e2 = { except: [] }) {
3206
3208
  var _a2;
3207
3209
  const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : is.filter((t3) => !e2.only.includes(t3));
3208
- 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(Ue(/```([^]+?)```/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;
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;
3209
3211
  }
3210
3212
  const os = function(e2) {
3211
3213
  const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
@@ -3222,7 +3224,7 @@ function cs(e2) {
3222
3224
  return us(e2, { except: ["FormattedLink", "Actions"] });
3223
3225
  }
3224
3226
  function ls(e2, t2) {
3225
- return t2.reduce((e3, t3) => je(e3, t3), e2);
3227
+ return t2.reduce((e3, t3) => Ue(e3, t3), e2);
3226
3228
  }
3227
3229
  function hs(e2) {
3228
3230
  const t2 = [];
@@ -3293,7 +3295,7 @@ class fs {
3293
3295
  }
3294
3296
  edit(t2) {
3295
3297
  return __async(this, null, function* () {
3296
- const s2 = { content: ms(t2), custom: "string" == typeof t2 ? void 0 : t2.custom }, n2 = yield this._realtimeClient.call("PATCH", ["conversations", this.brandedConversationId, "messages", this.brandedId], s2);
3298
+ const s2 = { content: gs(t2), custom: "string" == typeof t2 ? void 0 : t2.custom }, n2 = yield this._realtimeClient.call("PATCH", ["conversations", this.brandedConversationId, "messages", this.brandedId], s2);
3297
3299
  e(`Edit message ${this.id} in conversation ${this.conversationId}`, n2);
3298
3300
  });
3299
3301
  }
@@ -3304,7 +3306,7 @@ class fs {
3304
3306
  });
3305
3307
  }
3306
3308
  }
3307
- function ms(e2) {
3309
+ function gs(e2) {
3308
3310
  if ("string" == typeof e2) {
3309
3311
  return [{ type: "text", children: us(e2) }];
3310
3312
  }
@@ -3313,7 +3315,7 @@ function ms(e2) {
3313
3315
  }
3314
3316
  if ("content" in e2 && e2.content) return e2.content;
3315
3317
  }
3316
- class gs {
3318
+ class ms {
3317
3319
  constructor(e2, t2) {
3318
3320
  this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
3319
3321
  }
@@ -3326,9 +3328,9 @@ class gs {
3326
3328
  participant(e2) {
3327
3329
  if ("string" == typeof e2) {
3328
3330
  if ("" === e2) throw new Error(`Creating ParticipantRef failed because ID "${e2}" is an empty string`);
3329
- return new Pe(e2, this.id, this._realtimeClient);
3331
+ return new Oe(e2, this.id, this._realtimeClient);
3330
3332
  }
3331
- if ("brandedId" in e2) return new Pe(e2.id, this.id, this._realtimeClient);
3333
+ if ("brandedId" in e2) return new Oe(e2.id, this.id, this._realtimeClient);
3332
3334
  throw new Error(`Creating ParticipantRef failed because user "${e2}" is not a string or a UserRef`);
3333
3335
  }
3334
3336
  message(e2) {
@@ -3385,7 +3387,7 @@ class gs {
3385
3387
  }
3386
3388
  send(t2) {
3387
3389
  return __async(this, null, function* () {
3388
- const s2 = { content: vs(t2), referencedMessageId: ws(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: Oe((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
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);
3389
3391
  return new fs(r2.id, this.brandedId, this._realtimeClient);
3390
3392
  });
3391
3393
  }
@@ -3452,65 +3454,39 @@ class bs {
3452
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`);
3453
3455
  }
3454
3456
  }
3455
- function ys({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2 }) {
3457
+ function ys({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2, errorTracker: u2 }) {
3456
3458
  var _a2;
3457
3459
  (!r2 || r2 <= 0) && (r2 = 1);
3458
- const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-10-30T09:02:16.772Z" };
3459
- s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
3460
+ const c2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-12-05T12:12:52.344Z" };
3461
+ s2 instanceof FormData || (c2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
3460
3462
  return a(r2, () => __async(this, null, function* () {
3461
3463
  if (o2) {
3462
3464
  const e3 = yield o2.getToken();
3463
- u2.Authorization = `Bearer ${e3}`;
3465
+ c2.Authorization = `Bearer ${e3}`;
3464
3466
  }
3465
- return fetch(t2, { method: e2, headers: u2, body: s2 }).then((e3) => {
3467
+ return fetch(t2, { method: e2, headers: c2, body: s2 }).then((e3) => {
3466
3468
  if (e3.ok) return e3;
3467
3469
  throw e3;
3468
3470
  });
3469
3471
  }), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
3470
- return o2 && 401 === s3.status ? (Ds.log(`401 error from ${e2} ${t2}, ${yield o2.getToken()}`), o2.refreshToken(), true) : i2 ? i2(s3) : !("status" in s3 && s3.status >= 400 && s3.status < 500);
3472
+ return o2 && 401 === s3.status ? (u2 == null ? void 0 : u2.log(`401 error from ${e2} ${t2}, ${yield o2.getToken()}`), o2.invalidateAndRefresh(), true) : i2 ? i2(s3) : !("status" in s3 && s3.status >= 400 && s3.status < 500);
3471
3473
  }) }).catch((s3) => {
3472
3474
  if (Math.random() < 0.1 && !t2.toString().startsWith("https://capture.trackjs.com")) {
3473
3475
  const n3 = `Network Error for ${e2} ${t2}`;
3474
3476
  if ("undefined" != typeof window) if (s3 instanceof Response) {
3475
- s3.clone().text().then((e3) => Ds.log(`${n3} ${s3.status} ${e3} (10% logged)`));
3476
- } else Ds.log(`${n3} ${s3} (10% logged)`);
3477
+ s3.clone().text().then((e3) => u2 == null ? void 0 : u2.log(`${n3} ${s3.status} ${e3} (10% logged)`));
3478
+ } else u2 == null ? void 0 : u2.log(`${n3} ${s3} (10% logged)`);
3477
3479
  console.error("[TalkJS]", n3);
3478
3480
  }
3479
3481
  throw s3;
3480
3482
  });
3481
3483
  }
3482
- const { cdnHost: Cs, appHost: As, restHost: Es, realtimeHost: ks, appProtocol: xs, appWsProtocol: Is } = function() {
3483
- if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
3484
- if (!globalThis.document) return { appHost: "app.talkjs.com", appProtocol: "http:", appWsProtocol: "ws:" };
3485
- const e2 = function() {
3486
- if (document.currentScript) return document.currentScript.src;
3487
- try {
3488
- throw new Error();
3489
- } catch (e3) {
3490
- const t3 = e3.stack.match(/https?:\/\/.*\.(js|jsx|ts|tsx)/);
3491
- return t3 ? t3[0] : "";
3492
- }
3493
- }(), t2 = new URL(e2), s2 = t2.host, n2 = function(e3) {
3494
- if (e3.match(/^cdn[.-]/)) return e3.replace(/^cdn/, "app");
3495
- if ("talkjs.com" === e3) return "app.talkjs.com";
3496
- return e3;
3497
- }(s2), r2 = function(e3) {
3498
- if (e3.match(/^app[.-]/)) return e3.replace(/^app/, "api");
3499
- return e3 + "/public_api";
3500
- }(n2), i2 = function(e3) {
3501
- if (e3.match(/^app[.-]/)) return e3.replace(/^app/, "realtime");
3502
- return e3 + "/public_api";
3503
- }(n2), a2 = t2.protocol;
3504
- return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
3505
- }();
3506
- const Ts = As.startsWith("app.talkjs.com");
3507
- const Ds = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
3508
- } } : new (_b = class {
3484
+ class Cs {
3509
3485
  constructor(e2) {
3510
3486
  __privateAdd(this, _e2);
3511
3487
  __privateAdd(this, _t2);
3512
- var _a2, _b2, _c, _d;
3513
- this._timeCreated = Date.now(), this._enabled = Ts, __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-2025-10-30T09:02:16.772Z" }, 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-10-30T09:02:16.772Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
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;
3514
3490
  }
3515
3491
  setData({ appId: e2, meId: t2, sessionId: s2 }) {
3516
3492
  this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
@@ -3518,7 +3494,7 @@ const Ds = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setD
3518
3494
  log(e2) {
3519
3495
  return __async(this, null, function* () {
3520
3496
  try {
3521
- if (!this._enabled) return Promise.resolve();
3497
+ 0;
3522
3498
  const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
3523
3499
  yield ys({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
3524
3500
  } catch (e3) {
@@ -3526,8 +3502,12 @@ const Ds = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setD
3526
3502
  }
3527
3503
  });
3528
3504
  }
3529
- }, _e2 = new WeakMap(), _t2 = new WeakMap(), _b)("970cd0be0fb74630b75c8451051299dc");
3530
- class Ss {
3505
+ }
3506
+ _e2 = new WeakMap();
3507
+ _t2 = new WeakMap();
3508
+ const As = { log: (e2) => Promise.resolve(), setData: (e2) => {
3509
+ } };
3510
+ class Es {
3531
3511
  constructor(e2, t2 = {}) {
3532
3512
  this._onSubscription = t2, this._handlers = {};
3533
3513
  for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
@@ -3553,9 +3533,9 @@ class Ss {
3553
3533
  return e2 in this._handlers;
3554
3534
  }
3555
3535
  on(e2, t2) {
3556
- var _a2, _b2;
3536
+ var _a2, _b;
3557
3537
  if (!this.supports(e2)) throw new Error(`Unknown event type '${String(e2)}'`);
3558
- (_b2 = (_a2 = this._onSubscription)[e2]) == null ? void 0 : _b2.call(_a2), this._handlers[e2].push(t2);
3538
+ (_b = (_a2 = this._onSubscription)[e2]) == null ? void 0 : _b.call(_a2), this._handlers[e2].push(t2);
3559
3539
  }
3560
3540
  off(e2, t2) {
3561
3541
  if (!Object.hasOwnProperty.call(this._handlers, e2)) throw new Error(`Unknown event type '${String(e2)}'`);
@@ -3572,41 +3552,83 @@ class Ss {
3572
3552
  return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
3573
3553
  }
3574
3554
  }
3575
- class Ms {
3576
- constructor(e2, t2, s2, n2, r2, i2) {
3577
- if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new Ss({ tokenChanged(e3) {
3555
+ class ks {
3556
+ constructor(e2) {
3557
+ this.handlers = e2, this.tokenResult = null, this.pendingToken = null;
3558
+ }
3559
+ getTokenResult() {
3560
+ return __async(this, null, function* () {
3561
+ if (this.tokenResult) return this.tokenResult;
3562
+ if (this.pendingToken) return this.pendingToken.promise;
3563
+ const e2 = o();
3564
+ return this.pendingToken = e2, this.handlers.onNeedToken(), e2.promise;
3565
+ });
3566
+ }
3567
+ setTokenResult(e2) {
3568
+ this.pendingToken && (this.pendingToken.resolve(e2), this.pendingToken = null), this.tokenResult = e2, this.handlers.onChange(e2);
3569
+ }
3570
+ refreshToken() {
3571
+ this.pendingToken || (this.pendingToken = o(), this.handlers.onNeedToken());
3572
+ }
3573
+ invalidateAndRefresh() {
3574
+ this.tokenResult = null, this.refreshToken();
3575
+ }
3576
+ }
3577
+ class xs {
3578
+ constructor(e2, t2, s2, n2) {
3579
+ this.apiUrls = e2, this.appId = t2, this.userId = s2, this.signature = n2, this.inner = new ks({ onChange: (e3) => {
3580
+ e3.ok ? this.eventEmitter.emit("tokenChanged", e3.value) : this.emitTokenRefreshFailed(e3.value);
3581
+ }, 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)));
3583
+ else if (this.onNeedToken) this.onNeedToken();
3584
+ else {
3585
+ const e3 = l("Cannot refresh token, no `onNeedToken` provided.");
3586
+ this.inner.setTokenResult(e3);
3587
+ }
3588
+ }) }), this._usingBokens = true, this.onNeedToken = void 0, this.eventEmitter = new Es({ tokenChanged(e3) {
3578
3589
  }, tokenRefreshFailed(e3) {
3579
3590
  }, tokenAccepted(e3) {
3580
- } }), this.sessionExpiryWarningTimeoutId = void 0, i2 && (n2 || r2)) throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");
3581
- n2 ? this.fetchToken(() => n2) : (r2 || (this.usingBokens = true, this.tokenFetcher = () => this.sendBokenRequest(e2, i2)), this.refreshToken());
3591
+ } }), this.sessionExpiryWarningTimeoutId = void 0;
3592
+ const r2 = "undefined" != typeof window && e2.restApiHttpUrl.includes("api.talkjs.com");
3593
+ this.errorTracker = r2 ? new Cs("970cd0be0fb74630b75c8451051299dc") : As;
3582
3594
  }
3583
- get canRefreshToken() {
3584
- return this.usingBokens || !!this.tokenFetcher;
3595
+ get usingBokens() {
3596
+ return this._usingBokens;
3585
3597
  }
3586
3598
  getToken() {
3587
- return this.token;
3599
+ return __async(this, null, function* () {
3600
+ const e2 = yield this.inner.getTokenResult();
3601
+ if (e2.ok) return e2.value;
3602
+ throw e2.value;
3603
+ });
3604
+ }
3605
+ setToken(e2) {
3606
+ setTimeout(() => this.checkJwt(e2), 200), this._usingBokens = false, this.inner.setTokenResult(c(e2));
3607
+ }
3608
+ setTokenError(e2) {
3609
+ this._usingBokens = false, this.inner.setTokenResult(l(e2));
3588
3610
  }
3589
3611
  refreshToken() {
3590
- if (!this.requestInProgress) {
3591
- if (!this.tokenFetcher) throw this.emitTokenRefreshFailed("no `tokenFetcher` provided"), new Error("[TalkJS] Cannot refresh token, no `tokenFetcher` provided.");
3592
- this.fetchToken(this.tokenFetcher);
3593
- }
3612
+ this.inner.refreshToken();
3613
+ }
3614
+ invalidateAndRefresh() {
3615
+ this.inner.invalidateAndRefresh();
3616
+ }
3617
+ setOnNeedToken(e2) {
3618
+ this._usingBokens = false, this.onNeedToken = e2;
3594
3619
  }
3595
3620
  onTokenChanged(e2) {
3596
3621
  return this.eventEmitter.on("tokenChanged", e2), () => {
3597
3622
  this.eventEmitter.off("tokenChanged", e2);
3598
3623
  };
3599
3624
  }
3600
- emitTokenChanged(e2) {
3601
- this.eventEmitter.emit("tokenChanged", e2);
3602
- }
3603
3625
  onTokenRefreshFailed(e2) {
3604
3626
  return this.eventEmitter.on("tokenRefreshFailed", e2), () => {
3605
3627
  this.eventEmitter.off("tokenRefreshFailed", e2);
3606
3628
  };
3607
3629
  }
3608
3630
  emitTokenRefreshFailed(e2) {
3609
- this.eventEmitter.emit("tokenRefreshFailed", e2), console.error(`[TalkJS] Could not authenticate, cannot recover automatically: ${e2}`);
3631
+ this.eventEmitter.emit("tokenRefreshFailed", e2);
3610
3632
  }
3611
3633
  onTokenAccepted(e2) {
3612
3634
  return this.eventEmitter.on("tokenAccepted", e2), () => {
@@ -3621,38 +3643,12 @@ class Ms {
3621
3643
  }
3622
3644
  scheduleRefresh(e2) {
3623
3645
  if (this.clearScheduledRefresh(), null === e2) return;
3624
- const t2 = void 0 !== this.tokenFetcher;
3625
- e2 < 120 && !t2 ? console.warn(`[TalkJS] TalkJS will stop working in ${e2} seconds due to auth token expiry. Token expires in ${e2} seconds, and cannot be refreshed because no \`tokenFetcher\` was provided when creating the session. Non-refreshable tokens are recommended to expire at least 24 hours in the future.`) : e2 < 120 && t2 ? console.warn(`[TalkJS] TalkJS auth token will expire and need to be refreshed in ${e2} seconds. Refreshable JWTs are recommended to expire at least 30 minutes in the future, to improve performance and reduce unnecessary refreshes.`) : e2 < 3300 && !t2 && console.warn(`[TalkJS debug] TalkJS will stop working in ${Math.round(e2 / 60)} minutes due to auth token expiry. Non-refreshable tokens are recommended to expire at least 24 hours in the future. Alternatively, provide a \`tokenFetcher\` when creating the session, so that tokens can be refreshed when they expire.`);
3626
- if (void 0 !== this.tokenFetcher) {
3627
- const t3 = e2 > 600 ? e2 - 300 : e2 / 2, s2 = Math.min(1728e6, 1e3 * t3);
3628
- this.sessionExpiryWarningTimeoutId = setTimeout(() => {
3629
- this.refreshToken();
3630
- }, s2);
3631
- } else e2 < 2e6 && (this.sessionExpiryWarningTimeoutId = setTimeout(() => {
3632
- this.emitTokenRefreshFailed("Token has expired and no `tokenFetcher` was provided when creating the session, so it cannot be refreshed.");
3633
- }, 1e3 * e2));
3634
- }
3635
- fetchToken(e2) {
3636
- return __async(this, null, function* () {
3637
- if (this.requestInProgress) return;
3638
- this.requestInProgress = true;
3639
- const t2 = () => __async(this, null, function* () {
3640
- const t3 = yield e2();
3641
- return this.checkJwt(t3), t3;
3642
- });
3643
- try {
3644
- const e3 = void 0 !== this.token;
3645
- this.token = t2(), yield this.token.then((t3) => {
3646
- e3 && this.emitTokenChanged(t3);
3647
- }).catch((e4) => {
3648
- this.emitTokenRefreshFailed(e4);
3649
- });
3650
- } catch (e3) {
3651
- this.emitTokenRefreshFailed(e3);
3652
- } finally {
3653
- this.requestInProgress = false;
3654
- }
3655
- });
3646
+ const t2 = void 0 !== this.onNeedToken;
3647
+ e2 < 120 && !t2 ? console.warn(`[TalkJS] TalkJS will stop working in ${e2} seconds due to auth token expiry. Token expires in ${e2} seconds, and cannot be refreshed because no \`onNeedToken\` callback was provided. Non-refreshable tokens are recommended to expire at least 24 hours in the future.`) : e2 < 120 && t2 ? console.warn(`[TalkJS] TalkJS auth token will expire and need to be refreshed in ${e2} seconds. Refreshable JWTs are recommended to expire at least 30 minutes in the future, to improve performance and reduce unnecessary refreshes.`) : e2 < 3300 && !t2 && console.warn(`[TalkJS debug] TalkJS will stop working in ${Math.round(e2 / 60)} minutes due to auth token expiry. Non-refreshable tokens are recommended to expire at least 24 hours in the future. Alternatively, set \`onNeedToken\` with a callback that will run whenever a new token is needed.`);
3648
+ const s2 = e2 > 600 ? e2 - 300 : e2 / 2, n2 = Math.min(1728e6, 1e3 * s2);
3649
+ this.sessionExpiryWarningTimeoutId = setTimeout(() => {
3650
+ void 0 !== this.onNeedToken && this.refreshToken();
3651
+ }, n2);
3656
3652
  }
3657
3653
  checkJwt(e2) {
3658
3654
  !function(e3) {
@@ -3666,7 +3662,7 @@ class Ms {
3666
3662
  const e3 = function(e4) {
3667
3663
  const t3 = e4.split(".");
3668
3664
  if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
3669
- return { header: Fs(t3[0]), payload: Fs(t3[1]) };
3665
+ return { header: Ts(t3[0]), payload: Ts(t3[1]) };
3670
3666
  }(s2);
3671
3667
  n2 = e3.header, r2 = e3.payload;
3672
3668
  } catch (e3) {
@@ -3680,7 +3676,7 @@ class Ms {
3680
3676
  const e3 = this.checkJwtPayload(r2);
3681
3677
  t2.push(...e3);
3682
3678
  }
3683
- if (t2.length) if (this.usingBokens) Ds.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
3679
+ if (t2.length) if (this.usingBokens) this.errorTracker.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
3684
3680
  else {
3685
3681
  console.warn("[TalkJS] Authentication token appears to be generated incorrectly. Will still attempt to authenticate, but TalkJS may not work as expected. See below for a description of any problems and how to fix them.");
3686
3682
  const s3 = t2.length > 1;
@@ -3706,23 +3702,23 @@ class Ms {
3706
3702
  const a2 = e2.nbf;
3707
3703
  return void 0 === a2 || ("number" != typeof a2 ? t2.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` was ${typeof r2} instead of a number. If set, \`nbf\` should be the date when the JWT becomes valid, as a number of seconds since 1970-01-01.`) : a2 > 1e11 && t2.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` is very large (${a2}, representing ${new Date(1e3 * a2).toLocaleDateString()}). If set, \`nbf\` should be the date when the JWT becomes valid, as a number of seconds since 1970-01-01. Double-check that you are using seconds and not milliseconds or nanoseconds.`)), t2;
3708
3704
  }
3709
- sendBokenRequest(e2, t2) {
3705
+ sendBokenRequest() {
3710
3706
  return __async(this, null, function* () {
3711
- let s2 = 0;
3712
- const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield ys({ method: "GET", url: n2, attempts: 1e4, shouldRetry: (e3) => {
3713
- if (e3 instanceof Error) return true;
3714
- if (401 === e3.status) throw "Check that you provided a valid signature.";
3715
- if (404 === e3.status) throw "Check that you specified the correct App ID.";
3716
- if (429 === e3.status || 502 === e3.status) return true;
3717
- if (e3.status >= 400 && e3.status < 500) throw `Unexpected HTTP ${e3.status} response when fetching auth token. Check that you configured the session correctly.`;
3718
- if (s2++, s2 >= 5) throw `Unexpected HTTP ${e3.status} response when fetching auth token, retrying did not help.`;
3707
+ 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) => {
3709
+ if (t3 instanceof Error) return true;
3710
+ if (401 === t3.status) throw "Check that you provided a valid signature.";
3711
+ if (404 === t3.status) throw "Check that you specified the correct App ID.";
3712
+ if (429 === t3.status || 502 === t3.status) return true;
3713
+ if (t3.status >= 400 && t3.status < 500) throw `Unexpected HTTP ${t3.status} response when fetching auth token. Check that you configured the session correctly.`;
3714
+ if (e2++, e2 >= 5) throw `Unexpected HTTP ${t3.status} response when fetching auth token, retrying did not help.`;
3719
3715
  return true;
3720
- } });
3721
- return (yield r2.json()).boken;
3716
+ }, errorTracker: this.errorTracker });
3717
+ return (yield s2.json()).boken;
3722
3718
  });
3723
3719
  }
3724
3720
  }
3725
- function Fs(e2) {
3721
+ function Ts(e2) {
3726
3722
  try {
3727
3723
  const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
3728
3724
  return JSON.parse(s2);
@@ -3730,24 +3726,15 @@ function Fs(e2) {
3730
3726
  throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
3731
3727
  }
3732
3728
  }
3733
- class Bs {
3734
- constructor(e2) {
3735
- this.target = e2;
3736
- }
3737
- deref() {
3738
- return this.target;
3739
- }
3740
- }
3741
- const Rs = new class {
3729
+ const Is = new class {
3742
3730
  constructor() {
3743
3731
  this.registry = {};
3744
3732
  }
3745
3733
  getOrCreate(e2) {
3746
- var _a2;
3747
- const t2 = this.key(e2), s2 = (_a2 = this.registry[t2]) == null ? void 0 : _a2.deref();
3734
+ const t2 = this.key(e2), s2 = this.registry[t2];
3748
3735
  if (s2) return s2;
3749
- const n2 = new _s(e2), r2 = globalThis.WeakRef ? new WeakRef(n2) : new Bs(n2);
3750
- return this.registry[t2] = r2, n2;
3736
+ const n2 = new Ss(e2);
3737
+ return this.registry[t2] = n2, n2;
3751
3738
  }
3752
3739
  deregister(e2, t2) {
3753
3740
  const s2 = this.key({ appId: e2, userId: t2 });
@@ -3757,27 +3744,36 @@ const Rs = new class {
3757
3744
  return `${e2}:${t2}`;
3758
3745
  }
3759
3746
  }();
3760
- function Ns(e2) {
3747
+ function Ds(e2) {
3761
3748
  if (!e2) throw new Error("[TalkJS] Must provide an options object to `getTalkSession`");
3762
- return e2.forceCreateNew ? new _s(e2) : Rs.getOrCreate(e2);
3749
+ return e2.forceCreateNew ? new Ss(e2) : Is.getOrCreate(e2);
3763
3750
  }
3764
- class _s {
3751
+ class Ss {
3765
3752
  constructor(e2) {
3766
- !function(e3) {
3753
+ this._onNeedToken = void 0, function(e3) {
3767
3754
  function t3(e4, t4) {
3768
3755
  if (!e4) throw new Error("[TalkJS] TalkSession: " + t4);
3769
3756
  }
3770
- t3(e3 && "object" == typeof e3, "Expected an object argument in TalkSession#constructor."), t3(e3.appId && "string" == typeof e3.appId, "The `appId` property of TalkSession#constructor is required and it must be a non-empty string."), t3("string" == typeof e3.userId, "The `userId` property of TalkSession#constructor is required and it must be a string."), void 0 !== e3.token && t3(e3.token && "string" == typeof e3.token, "The `token` property of TalkSession#constructor must be a non-empty string.");
3771
- void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of TalkSession#constructor must be a function.");
3757
+ t3(e3 && "object" == typeof e3, "Expected an object argument in `getTalkSession`."), t3(e3.appId && "string" == typeof e3.appId, "The `appId` property of the `getTalkSession` options is required and it must be a non-empty string."), t3("string" == typeof e3.userId, "The `userId` property of the `getTalkSession` options is required and it must be a string."), void 0 !== e3.token && t3(e3.token && "string" == typeof e3.token, "The `token` property of the `getTalkSession` options must be a non-empty string.");
3758
+ void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of the `getTalkSession` options must be a function.");
3772
3759
  }(e2);
3773
3760
  const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
3774
- 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 Ms(this._apiUrls, t2, s2, n2, r2, i2);
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* () {
3762
+ try {
3763
+ const e3 = yield r2();
3764
+ this._authProvider.setToken(e3);
3765
+ } catch (e3) {
3766
+ this._authProvider.setTokenError(`${e3}`);
3767
+ }
3768
+ }));
3775
3769
  const a2 = Math.random().toString().split(".")[1];
3776
- this._realtimeClient = new Be(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.5.7", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new _e(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
3777
- console.error(`[TalkSession] ${e3}`);
3778
- }), function(e3, t3, s3) {
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) => {
3771
+ console.error(`[TalkJS] ${e3}`);
3772
+ }), function(e3, t3) {
3779
3773
  return __async(this, null, function* () {
3780
- return ys({ method: "GET", url: `${t3}/${e3}/app`, authProvider: s3 }).then((e4) => 200 === e4.status || 404 !== e4.status && (console.warn(`[TalkJS] Received unexpected ${e4.status} status code when validating app ID. Assuming that the app ID is valid.`), true)).catch((e4) => {
3774
+ return ys({ method: "GET", url: `${t3}/${e3}` }).then((e4) => __async(this, null, function* () {
3775
+ 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
+ })).catch((e4) => {
3781
3777
  if ("string" != typeof e4 && "status" in e4) {
3782
3778
  const t4 = e4;
3783
3779
  return 200 === t4.status || 404 !== t4.status && (console.warn(`[TalkJS] Received unexpected ${t4.status} status code when validating app ID. Assuming that the app ID is valid.`), true);
@@ -3785,12 +3781,27 @@ class _s {
3785
3781
  return console.warn("[TalkJS] Encountered network issues when validating app ID. Assuming that the app ID is valid."), true;
3786
3782
  });
3787
3783
  });
3788
- }(this._appId, this._apiUrls.internalHttpApiUrl, this._authProvider).then((e3) => {
3784
+ }(this._appId, this._apiUrls.internalHttpApiUrl).then((e3) => {
3789
3785
  e3 || this.terminate(new Error(`The app ID ${this._appId} does not exist. Make sure you are using the correct app ID as found on the TalkJS dashboard. App IDs are case-sensitive.`));
3790
3786
  }), this._authProvider.onTokenRefreshFailed((e3) => {
3791
3787
  this.terminate(new Error(`Could not authenticate, cannot recover automatically: ${e3}`));
3792
3788
  });
3793
3789
  }
3790
+ setToken(e2) {
3791
+ this._authProvider.setToken(e2);
3792
+ }
3793
+ get onNeedToken() {
3794
+ return this._onNeedToken;
3795
+ }
3796
+ set onNeedToken(e2) {
3797
+ this._onNeedToken = e2, void 0 === e2 ? this._authProvider.setOnNeedToken(void 0) : this._authProvider.setOnNeedToken(() => {
3798
+ try {
3799
+ e2();
3800
+ } catch (e3) {
3801
+ console.error("[TalkJS] error when calling `onNeedToken` - your auth token will expire soon.", e3);
3802
+ }
3803
+ });
3804
+ }
3794
3805
  onError(e2) {
3795
3806
  const t2 = o();
3796
3807
  return Promise.race([t2.promise, this._terminationReason.promise]).then((t3) => {
@@ -3805,37 +3816,37 @@ class _s {
3805
3816
  conversation(e2) {
3806
3817
  if ("string" != typeof e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is not a string`);
3807
3818
  if ("" === e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is an empty string`);
3808
- return new gs(e2, this._realtimeClient);
3819
+ return new ms(e2, this._realtimeClient);
3809
3820
  }
3810
3821
  subscribeConversations(e2) {
3811
3822
  return this._realtimeClient.subscribe(["me", "conversations"], e2);
3812
3823
  }
3813
3824
  terminate(e2) {
3814
- Rs.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
3825
+ Is.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
3815
3826
  }
3816
3827
  _isConnected() {
3817
3828
  return this._realtimeClient.isConnected();
3818
3829
  }
3819
3830
  uploadFile(e2, t2) {
3820
- return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
3831
+ return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
3821
3832
  }
3822
3833
  uploadImage(e2, t2) {
3823
- return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
3834
+ return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
3824
3835
  }
3825
3836
  uploadVideo(e2, t2) {
3826
- return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
3837
+ return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
3827
3838
  }
3828
3839
  uploadAudio(e2, t2) {
3829
- return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
3840
+ return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
3830
3841
  }
3831
3842
  uploadVoice(e2, t2) {
3832
- return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
3843
+ return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
3833
3844
  }
3834
3845
  }
3835
- function Ps(_0, _1, _2, _3) {
3846
+ function Ms(_0, _1, _2, _3) {
3836
3847
  return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
3837
3848
  const u2 = new FormData();
3838
- 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 }).then((e3) => e3.json()).then((e3) => e3.attachmentToken).catch((e3) => __async(this, null, function* () {
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* () {
3839
3850
  if (e3 instanceof Response) {
3840
3851
  const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
3841
3852
  throw new Error(s3);
@@ -3845,7 +3856,7 @@ function Ps(_0, _1, _2, _3) {
3845
3856
  });
3846
3857
  }
3847
3858
  export {
3848
- Ns as getTalkSession,
3859
+ Ds as getTalkSession,
3849
3860
  f as registerPolyfills
3850
3861
  };
3851
3862
  //# sourceMappingURL=talkSession.js.map