@talkjs/core 1.5.4 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/dist/talkSession.cjs +1 -1
- package/dist/talkSession.d.ts +189 -193
- package/dist/talkSession.js +512 -461
- package/package.json +1 -1
package/dist/talkSession.js
CHANGED
|
@@ -531,12 +531,12 @@ class I extends x {
|
|
|
531
531
|
this.connection.call("SUBSCRIBE", ["users"], { ids: e2 }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
class
|
|
534
|
+
class T extends x {
|
|
535
535
|
constructor(e2, t2, s2) {
|
|
536
536
|
super(s2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
|
|
537
537
|
}
|
|
538
538
|
canPush(e2, t2) {
|
|
539
|
-
return !!
|
|
539
|
+
return !!T.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
|
|
540
540
|
}
|
|
541
541
|
static isCorrectBatchTypeFor(e2, t2) {
|
|
542
542
|
return s(t2, ["conversations", "*", "participants", "*"]) && ("PUT" === e2 || "POST" === e2 || "PATCH" === e2);
|
|
@@ -557,7 +557,7 @@ class S extends x {
|
|
|
557
557
|
});
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
class
|
|
560
|
+
class D {
|
|
561
561
|
constructor(e2, t2, s2) {
|
|
562
562
|
this.pendingBatch = null, this.connection = new E(e2, t2, s2);
|
|
563
563
|
}
|
|
@@ -579,17 +579,17 @@ class T {
|
|
|
579
579
|
}
|
|
580
580
|
createEmptyBatchFor(e2, t2) {
|
|
581
581
|
if (I.isCorrectBatchTypeFor(e2, t2)) return new I(this.connection, () => this.pendingBatch = null);
|
|
582
|
-
if (
|
|
582
|
+
if (T.isCorrectBatchTypeFor(e2, t2)) {
|
|
583
583
|
const e3 = t2[1];
|
|
584
|
-
return new
|
|
584
|
+
return new T(e3, this.connection, () => this.pendingBatch = null);
|
|
585
585
|
}
|
|
586
586
|
return null;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
const
|
|
589
|
+
const S = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
|
|
590
590
|
class M {
|
|
591
591
|
constructor(e2, t2, s2) {
|
|
592
|
-
this.throttler = new F(), this.alive = true, this.connection = new
|
|
592
|
+
this.throttler = new F(), this.alive = true, this.connection = new D(e2, t2, s2);
|
|
593
593
|
}
|
|
594
594
|
call(e2, t2, s2) {
|
|
595
595
|
return __async(this, null, function* () {
|
|
@@ -598,7 +598,7 @@ class M {
|
|
|
598
598
|
const r2 = yield this.connection.call(e2, t2, s2);
|
|
599
599
|
if ((r2.ok || "client" !== r2.where || "SOCKET_NOT_READY" !== r2.value) && (r2.ok || "server" !== r2.where || 500 !== r2.value.status) || n2++, 10 === n2) return r2;
|
|
600
600
|
if (r2.ok || "client" !== r2.where) {
|
|
601
|
-
const e3 = r2.value, t3 = e3.status, s3 =
|
|
601
|
+
const e3 = r2.value, t3 = e3.status, s3 = S[t3];
|
|
602
602
|
if ("RESOLVE" === s3) return this.throttler.resetDelay(), r2;
|
|
603
603
|
if ("RETRY" === s3) continue;
|
|
604
604
|
if ("DELAY" === s3) {
|
|
@@ -694,38 +694,76 @@ class N {
|
|
|
694
694
|
return this.connection.isConnected();
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
function _(e2
|
|
697
|
+
function _(e2) {
|
|
698
|
+
return Object.freeze(e2);
|
|
699
|
+
}
|
|
700
|
+
function P(e2) {
|
|
701
|
+
return _(e2.map((e3) => function(e4) {
|
|
702
|
+
switch (e4.type) {
|
|
703
|
+
case "text":
|
|
704
|
+
return Object.freeze({ type: "text", children: O(e4.children) });
|
|
705
|
+
case "file":
|
|
706
|
+
case "location":
|
|
707
|
+
return Object.freeze(e4);
|
|
708
|
+
}
|
|
709
|
+
}(e3)));
|
|
710
|
+
}
|
|
711
|
+
function O(e2) {
|
|
712
|
+
return _(e2.map((e3) => function(e4) {
|
|
713
|
+
if ("string" == typeof e4) return e4;
|
|
714
|
+
switch (e4.type) {
|
|
715
|
+
case "bold":
|
|
716
|
+
case "italic":
|
|
717
|
+
case "strikethrough":
|
|
718
|
+
case "bulletList":
|
|
719
|
+
case "bulletPoint":
|
|
720
|
+
case "link":
|
|
721
|
+
case "actionLink":
|
|
722
|
+
case "actionButton":
|
|
723
|
+
return Object.freeze(__spreadProps(__spreadValues({}, e4), { children: O(e4.children) }));
|
|
724
|
+
case "mention":
|
|
725
|
+
case "autoLink":
|
|
726
|
+
case "codeSpan":
|
|
727
|
+
case "customEmoji":
|
|
728
|
+
return Object.freeze(e4);
|
|
729
|
+
}
|
|
730
|
+
}(e3)));
|
|
731
|
+
}
|
|
732
|
+
function j(e2, t2) {
|
|
698
733
|
return void 0 === t2 ? e2 : t2;
|
|
699
734
|
}
|
|
700
|
-
function
|
|
735
|
+
function U(e2, t2) {
|
|
736
|
+
return void 0 === t2 ? e2 : _(t2);
|
|
737
|
+
}
|
|
738
|
+
function $(e2, t2) {
|
|
701
739
|
if (void 0 === t2) return e2;
|
|
702
|
-
if (null === t2) return {};
|
|
740
|
+
if (null === t2) return _({});
|
|
703
741
|
const s2 = __spreadValues({}, e2);
|
|
704
742
|
for (const e3 in t2) {
|
|
705
743
|
const n2 = t2[e3];
|
|
706
744
|
null === n2 ? delete s2[e3] : s2[e3] = n2;
|
|
707
745
|
}
|
|
708
|
-
return s2;
|
|
746
|
+
return _(s2);
|
|
709
747
|
}
|
|
710
|
-
function
|
|
748
|
+
function W(e2, t2) {
|
|
711
749
|
if (e2 === t2) return true;
|
|
712
750
|
if (!e2 || !t2) return false;
|
|
713
751
|
if ("object" != typeof e2 || "object" != typeof t2) return false;
|
|
714
752
|
if (e2.constructor !== t2.constructor) return false;
|
|
715
753
|
if (Array.isArray(e2) && Array.isArray(t2)) {
|
|
716
754
|
if (e2.length !== t2.length) return false;
|
|
717
|
-
for (let s2 = 0; s2 < e2.length; s2++) if (!
|
|
755
|
+
for (let s2 = 0; s2 < e2.length; s2++) if (!W(e2[s2], t2[s2])) return false;
|
|
718
756
|
} else {
|
|
719
757
|
const s2 = Object.keys(e2);
|
|
720
758
|
if (s2.length !== Object.keys(t2).length) return false;
|
|
721
759
|
for (const n2 of s2) {
|
|
722
760
|
if (!Object.hasOwnProperty.call(t2, n2)) return false;
|
|
723
|
-
if (!
|
|
761
|
+
if (!W(e2[n2], t2[n2])) return false;
|
|
724
762
|
}
|
|
725
763
|
}
|
|
726
764
|
return true;
|
|
727
765
|
}
|
|
728
|
-
class
|
|
766
|
+
class q {
|
|
729
767
|
constructor() {
|
|
730
768
|
this.prev = Promise.resolve();
|
|
731
769
|
}
|
|
@@ -736,7 +774,7 @@ class U {
|
|
|
736
774
|
});
|
|
737
775
|
}
|
|
738
776
|
}
|
|
739
|
-
class
|
|
777
|
+
class H {
|
|
740
778
|
constructor(e2) {
|
|
741
779
|
this.initialised = false, this.getPointer = void 0, this.pendingStates = [e2], e2.resultPromise.then(() => this.initialised = true);
|
|
742
780
|
}
|
|
@@ -769,7 +807,7 @@ class j {
|
|
|
769
807
|
return this.getPointer;
|
|
770
808
|
}
|
|
771
809
|
}
|
|
772
|
-
class
|
|
810
|
+
class L extends H {
|
|
773
811
|
constructor(e2, t2) {
|
|
774
812
|
super(e2), this.onTeardown = t2, this._error = null, this._lastGoodState = Promise.resolve(void 0), this.registerNewState(e2.resultPromise);
|
|
775
813
|
}
|
|
@@ -798,10 +836,10 @@ class $ extends j {
|
|
|
798
836
|
}));
|
|
799
837
|
}
|
|
800
838
|
}
|
|
801
|
-
class
|
|
839
|
+
class G extends L {
|
|
802
840
|
constructor(e2, t2) {
|
|
803
841
|
const s2 = new Promise((e3) => setTimeout(e3)).then(() => this.fetchInitial(e2));
|
|
804
|
-
super({ seq: e2, resultPromise: s2 }, t2.onTeardown), this.initialSeq = e2, this.getDeepMutex = new
|
|
842
|
+
super({ seq: e2, resultPromise: s2 }, t2.onTeardown), this.initialSeq = e2, this.getDeepMutex = new q(), this.lastDeep = void 0;
|
|
805
843
|
}
|
|
806
844
|
refetchInitial(e2) {
|
|
807
845
|
return __async(this, null, function* () {
|
|
@@ -844,9 +882,9 @@ class W extends $ {
|
|
|
844
882
|
});
|
|
845
883
|
}
|
|
846
884
|
}
|
|
847
|
-
class
|
|
885
|
+
class z extends G {
|
|
848
886
|
constructor(e2, t2, s2) {
|
|
849
|
-
super(e2, s2), this.emitMutex = t2, this.unsubscribeTimer = new
|
|
887
|
+
super(e2, s2), this.emitMutex = t2, this.unsubscribeTimer = new J(), this.referencedByOtherStores = 0, this.listeners = [], this.lastEmitSeq = void 0, this.lastEmitResult = void 0, t2.runExclusive(() => __async(this, null, function* () {
|
|
850
888
|
yield this.emit(e2);
|
|
851
889
|
}));
|
|
852
890
|
}
|
|
@@ -881,7 +919,7 @@ class q extends W {
|
|
|
881
919
|
});
|
|
882
920
|
}
|
|
883
921
|
}
|
|
884
|
-
class
|
|
922
|
+
class J {
|
|
885
923
|
constructor() {
|
|
886
924
|
this.timerId = void 0;
|
|
887
925
|
}
|
|
@@ -892,76 +930,34 @@ class H {
|
|
|
892
930
|
clearTimeout(this.timerId);
|
|
893
931
|
}
|
|
894
932
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
|
|
898
|
-
}
|
|
899
|
-
fetchInitial(e2) {
|
|
900
|
-
return __async(this, null, function* () {
|
|
901
|
-
const t2 = yield this.realtimeClient.call("GET", ["users", this.userId], { includePrivateFields: false }, { bypassCache: true });
|
|
902
|
-
return t2.ok ? c({ snapshot: this.realtimeClient.createUserSnapshot(t2.value.data), lastChanged: e2 }) : "server" === t2.where && 404 === t2.value.status ? c({ snapshot: null, lastChanged: e2 }) : t2;
|
|
903
|
-
});
|
|
904
|
-
}
|
|
905
|
-
equal(e2, t2) {
|
|
906
|
-
return O(e2.snapshot, t2.snapshot);
|
|
907
|
-
}
|
|
908
|
-
loadNested(e2, t2) {
|
|
909
|
-
return __async(this, null, function* () {
|
|
910
|
-
return c(t2);
|
|
911
|
-
});
|
|
912
|
-
}
|
|
913
|
-
userCreated(e2, t2) {
|
|
914
|
-
this.mutate(e2, (s2) => null !== s2.value.snapshot ? s2 : c({ snapshot: this.realtimeClient.createUserSnapshot(t2.state), lastChanged: e2 }));
|
|
915
|
-
}
|
|
916
|
-
userEdited(e2, t2) {
|
|
917
|
-
this.mutate(e2, (s2) => {
|
|
918
|
-
const n2 = s2.value.snapshot;
|
|
919
|
-
if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
|
|
920
|
-
return c({ snapshot: { id: n2.id, name: _(n2.name, t2.diff.name), custom: P(n2.custom, t2.diff.custom), locale: _(n2.locale, t2.diff.locale), photoUrl: _(n2.photoUrl, t2.diff.photoUrl), role: _(n2.role, t2.diff.role), welcomeMessage: _(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
getFromCache() {
|
|
924
|
-
return __async(this, null, function* () {
|
|
925
|
-
const e2 = yield this.mostRecentState.resultPromise;
|
|
926
|
-
return e2.ok ? null === e2.value.snapshot ? h({ status: 404, errorCode: "USER_NOT_FOUND", reasons: ["That user does not exist yet"] }) : c({ status: 200, data: { id: e2.value.snapshot.id, name: e2.value.snapshot.name, custom: e2.value.snapshot.custom, locale: e2.value.snapshot.locale, photoUrl: e2.value.snapshot.photoUrl, role: e2.value.snapshot.role, welcomeMessage: e2.value.snapshot.welcomeMessage } }) : l("NOT_IN_CACHE");
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
teardownNested(e2) {
|
|
930
|
-
}
|
|
931
|
-
anyChildChanged(e2, t2, s2) {
|
|
932
|
-
return __async(this, null, function* () {
|
|
933
|
-
return false;
|
|
934
|
-
});
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
var L, z = {};
|
|
938
|
-
function J(e2, t2) {
|
|
933
|
+
var Y, Q = {};
|
|
934
|
+
function V(e2, t2) {
|
|
939
935
|
const s2 = t2.lastIndex;
|
|
940
936
|
let n2;
|
|
941
937
|
const r2 = [];
|
|
942
938
|
for (; null !== (n2 = t2.exec(e2)); ) r2.push(n2);
|
|
943
939
|
return t2.lastIndex = s2, r2;
|
|
944
940
|
}
|
|
945
|
-
function
|
|
941
|
+
function Z(e2) {
|
|
946
942
|
const t2 = e2.replace(/%2F/g, "/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/, "$1");
|
|
947
943
|
return decodeURIComponent(t2);
|
|
948
944
|
}
|
|
949
|
-
function
|
|
945
|
+
function K(e2, t2) {
|
|
950
946
|
if (!e2() && !t2) {
|
|
951
947
|
t2 = e2.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/, "`$1`") + " was not true";
|
|
952
948
|
}
|
|
953
949
|
}
|
|
954
950
|
!function() {
|
|
955
|
-
if (
|
|
951
|
+
if (Y) return Q;
|
|
956
952
|
function e2(e3) {
|
|
957
953
|
return String.fromCharCode(parseInt(e3.slice(1), 16));
|
|
958
954
|
}
|
|
959
955
|
function t2(e3) {
|
|
960
956
|
return `%${`00${e3.charCodeAt(0).toString(16)}`.slice(-2)}`;
|
|
961
957
|
}
|
|
962
|
-
|
|
958
|
+
Y = 1, Object.defineProperty(Q, "__esModule", { value: true }), Q.encode = function(t3) {
|
|
963
959
|
return btoa(encodeURIComponent(t3).replace(/%[0-9A-F]{2}/g, e2));
|
|
964
|
-
},
|
|
960
|
+
}, Q.decode = function(e3) {
|
|
965
961
|
return decodeURIComponent(Array.from(atob(e3), t2).join(""));
|
|
966
962
|
};
|
|
967
963
|
}(), ((e2) => {
|
|
@@ -995,51 +991,51 @@ function Q(e2, t2) {
|
|
|
995
991
|
}, e2.falsy = function(e3) {
|
|
996
992
|
}, e2.never = function(e3) {
|
|
997
993
|
};
|
|
998
|
-
})(
|
|
999
|
-
const
|
|
1000
|
-
function
|
|
1001
|
-
if (!
|
|
1002
|
-
return !
|
|
994
|
+
})(K || (K = {}));
|
|
995
|
+
const X = K, ee = /^\/.*[^\\]\/[im]*$/;
|
|
996
|
+
function te(e2) {
|
|
997
|
+
if (!ee.test(e2)) return false;
|
|
998
|
+
return !se(e2).test("");
|
|
1003
999
|
}
|
|
1004
|
-
function
|
|
1000
|
+
function se(e2) {
|
|
1005
1001
|
const t2 = e2.match(/^\/(.*[^\\])\/(.*)$/);
|
|
1006
1002
|
if (!t2) throw new Error(`Expected ${e2} to be a (non-empty) regex`);
|
|
1007
1003
|
let s2 = t2[2] || "";
|
|
1008
1004
|
return s2 = s2.replace(/[^im]/g, "") + "g", new RegExp(t2[1], s2);
|
|
1009
1005
|
}
|
|
1010
|
-
class
|
|
1006
|
+
class ne {
|
|
1011
1007
|
constructor({ mode: e2, allowedHostnames: t2, allowedPhoneNrs: s2, allowedMatches: n2, forbiddenMatches: r2, suppressLinks: i2, suppressEmailAddresses: a2, suppressPhoneNumbers: o2, replacement: u2 }) {
|
|
1012
|
-
|
|
1008
|
+
X.oneOf(e2, ["all", "otherOnly", "off"]), this.mode = e2, this.suppressLinks = false !== i2, this.suppressEmailAddresses = false !== a2, this.suppressPhoneNumbers = false !== o2, this.allowedHostnames = t2 || [], this.allowedPhoneNrs = (s2 || []).filter((e3) => e3).map((e3) => e3.replace(/[^0-9]/g, "")), this.allowedMatches = (n2 || []).filter(te).map((e3) => se(e3)), this.forbiddenMatches = (r2 || []).filter(te).map((e3) => se(e3)), X(() => this.allowedMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"), X(() => this.forbiddenMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"), u2 = u2 == null ? void 0 : u2.trim(), this.replacement = u2 && u2.length > 0 ? u2 : void 0;
|
|
1013
1009
|
}
|
|
1014
1010
|
shouldSuppress({ isContentBySender: e2 }) {
|
|
1015
1011
|
return "all" === this.mode || "otherOnly" === this.mode && !e2;
|
|
1016
1012
|
}
|
|
1017
1013
|
}
|
|
1018
|
-
function
|
|
1014
|
+
function re(e2, t2) {
|
|
1019
1015
|
const s2 = e2.map((e3) => function(e4, t3) {
|
|
1020
1016
|
if ("text" === e4.type) return function(e5, t4) {
|
|
1021
1017
|
const s3 = function(e6) {
|
|
1022
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l;
|
|
1018
|
+
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
1023
1019
|
let t5 = "";
|
|
1024
|
-
return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b = e6.markup) != null ? _b : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [], enableEmojiImageFallback: (_e2 = e6.enableEmojiImageFallback) != null ? _e2 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new
|
|
1020
|
+
return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b = e6.markup) != null ? _b : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [], enableEmojiImageFallback: (_e2 = e6.enableEmojiImageFallback) != null ? _e2 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new 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 };
|
|
1025
1021
|
}(t4);
|
|
1026
|
-
return
|
|
1022
|
+
return ie(e5, s3);
|
|
1027
1023
|
}(e4.children, t3);
|
|
1028
|
-
if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${
|
|
1029
|
-
if ("file" === e4.type && "image" === e4.subtype) return `📷 ${
|
|
1030
|
-
if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${
|
|
1024
|
+
if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${Z(e4.url)}`;
|
|
1025
|
+
if ("file" === e4.type && "image" === e4.subtype) return `📷 ${Z(e4.url)}`;
|
|
1026
|
+
if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${Z(e4.url)}`;
|
|
1031
1027
|
if ("file" === e4.type && "voice" === e4.subtype) {
|
|
1032
1028
|
const t4 = e4.duration;
|
|
1033
1029
|
if (void 0 === t4) return "🎙️";
|
|
1034
1030
|
return `🎙️ (${Math.floor(t4 / 60)}:${Math.floor(t4 % 60).toString().padStart(2, "0")})`;
|
|
1035
1031
|
}
|
|
1036
|
-
if ("file" === e4.type) return e4.subtype, `📎 ${
|
|
1032
|
+
if ("file" === e4.type) return e4.subtype, `📎 ${Z(e4.url)}`;
|
|
1037
1033
|
if ("location" === e4.type) return "📍";
|
|
1038
1034
|
return "";
|
|
1039
1035
|
}(e3, t2));
|
|
1040
1036
|
return s2.join("\n\n");
|
|
1041
1037
|
}
|
|
1042
|
-
function
|
|
1038
|
+
function ie(e2, t2) {
|
|
1043
1039
|
return e2.flatMap((e3) => {
|
|
1044
1040
|
if ("string" == typeof e3) return e3;
|
|
1045
1041
|
switch (e3.type) {
|
|
@@ -1052,13 +1048,13 @@ function se(e2, t2) {
|
|
|
1052
1048
|
case "actionLink":
|
|
1053
1049
|
case "actionbutton":
|
|
1054
1050
|
case "actionButton":
|
|
1055
|
-
return
|
|
1051
|
+
return ie(e3.children, t2);
|
|
1056
1052
|
case "bulletlist":
|
|
1057
1053
|
case "bulletList":
|
|
1058
|
-
return "\n" +
|
|
1054
|
+
return "\n" + ie(e3.children, t2);
|
|
1059
1055
|
case "bulletpoint":
|
|
1060
1056
|
case "bulletPoint":
|
|
1061
|
-
return "- " +
|
|
1057
|
+
return "- " + ie(e3.children, t2) + "\n";
|
|
1062
1058
|
case "autolink":
|
|
1063
1059
|
case "autoLink":
|
|
1064
1060
|
case "codeblock":
|
|
@@ -1076,7 +1072,59 @@ function se(e2, t2) {
|
|
|
1076
1072
|
}
|
|
1077
1073
|
}).join("");
|
|
1078
1074
|
}
|
|
1079
|
-
|
|
1075
|
+
function ae(e2) {
|
|
1076
|
+
return _({ id: e2.id, name: e2.name, custom: _(e2.custom), locale: e2.locale, photoUrl: e2.photoUrl, role: e2.role, welcomeMessage: e2.welcomeMessage });
|
|
1077
|
+
}
|
|
1078
|
+
function oe(e2, t2) {
|
|
1079
|
+
return _({ user: t2, access: e2.access, notify: e2.notify, joinedAt: e2.joinedAt });
|
|
1080
|
+
}
|
|
1081
|
+
function ue(e2) {
|
|
1082
|
+
const t2 = Object.entries(e2).map(([e3, t3]) => _({ emoji: e3, count: t3.count, currentUserReacted: t3.currentUserReacted }));
|
|
1083
|
+
return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), _(t2);
|
|
1084
|
+
}
|
|
1085
|
+
class ce extends z {
|
|
1086
|
+
constructor(e2, t2, s2, n2, r2) {
|
|
1087
|
+
super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
|
|
1088
|
+
}
|
|
1089
|
+
fetchInitial(e2) {
|
|
1090
|
+
return __async(this, null, function* () {
|
|
1091
|
+
const t2 = yield this.realtimeClient.call("GET", ["users", this.userId], { includePrivateFields: false }, { bypassCache: true });
|
|
1092
|
+
return t2.ok ? c({ snapshot: ae(t2.value.data), lastChanged: e2 }) : "server" === t2.where && 404 === t2.value.status ? c({ snapshot: null, lastChanged: e2 }) : t2;
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
equal(e2, t2) {
|
|
1096
|
+
return W(e2.snapshot, t2.snapshot);
|
|
1097
|
+
}
|
|
1098
|
+
loadNested(e2, t2) {
|
|
1099
|
+
return __async(this, null, function* () {
|
|
1100
|
+
return c(t2);
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
userCreated(e2, t2) {
|
|
1104
|
+
this.mutate(e2, (s2) => null !== s2.value.snapshot ? s2 : c({ snapshot: ae(t2.state), lastChanged: e2 }));
|
|
1105
|
+
}
|
|
1106
|
+
userEdited(e2, t2) {
|
|
1107
|
+
this.mutate(e2, (s2) => {
|
|
1108
|
+
const n2 = s2.value.snapshot;
|
|
1109
|
+
if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
|
|
1110
|
+
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 });
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
getFromCache() {
|
|
1114
|
+
return __async(this, null, function* () {
|
|
1115
|
+
const e2 = yield this.mostRecentState.resultPromise;
|
|
1116
|
+
return e2.ok ? null === e2.value.snapshot ? h({ status: 404, errorCode: "USER_NOT_FOUND", reasons: ["That user does not exist yet"] }) : c({ status: 200, data: { id: e2.value.snapshot.id, name: e2.value.snapshot.name, custom: e2.value.snapshot.custom, locale: e2.value.snapshot.locale, photoUrl: e2.value.snapshot.photoUrl, role: e2.value.snapshot.role, welcomeMessage: e2.value.snapshot.welcomeMessage } }) : l("NOT_IN_CACHE");
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
teardownNested(e2) {
|
|
1120
|
+
}
|
|
1121
|
+
anyChildChanged(e2, t2, s2) {
|
|
1122
|
+
return __async(this, null, function* () {
|
|
1123
|
+
return false;
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
class le extends G {
|
|
1080
1128
|
constructor(e2, t2, s2, n2) {
|
|
1081
1129
|
super(e2, {}), this.conversationId = t2, this.message = s2, this.realtimeClient = n2;
|
|
1082
1130
|
}
|
|
@@ -1092,14 +1140,14 @@ class ne extends W {
|
|
|
1092
1140
|
if (!e3.ok) return e3;
|
|
1093
1141
|
t2 = e3.value.data;
|
|
1094
1142
|
}
|
|
1095
|
-
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:
|
|
1143
|
+
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) } });
|
|
1096
1144
|
});
|
|
1097
1145
|
}
|
|
1098
1146
|
refetch(e2) {
|
|
1099
1147
|
throw "Do not call refetch on message data stores, it can return outdated data. Destroy and remake them instead";
|
|
1100
1148
|
}
|
|
1101
1149
|
equal(e2, t2) {
|
|
1102
|
-
return
|
|
1150
|
+
return W(e2.data, t2.data);
|
|
1103
1151
|
}
|
|
1104
1152
|
teardownNested(e2) {
|
|
1105
1153
|
var _a2;
|
|
@@ -1119,17 +1167,20 @@ class ne extends W {
|
|
|
1119
1167
|
if (false === (s2 == null ? void 0 : s2.ok)) return s2;
|
|
1120
1168
|
if (null === t2.data) return c({ snapshot: null });
|
|
1121
1169
|
const n2 = s2 == null ? void 0 : s2.value;
|
|
1122
|
-
return c({ snapshot: { sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: t2.data.custom, createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext:
|
|
1170
|
+
return c({ snapshot: _({ sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: _(t2.data.custom), createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: t2.data.plaintext, content: t2.data.content, referencedMessageId: t2.data.referencedMessageId, reactions: t2.data.reactions }) });
|
|
1123
1171
|
});
|
|
1124
1172
|
}
|
|
1125
1173
|
messageEdited(e2, t2) {
|
|
1126
1174
|
this.mutate(e2, (s2) => {
|
|
1127
1175
|
if (null === s2.value.data) return s2;
|
|
1128
|
-
|
|
1176
|
+
const n2 = s2.value.data.content, r2 = (i2 = n2, void 0 === (a2 = t2.diff.content) ? i2 : P(a2));
|
|
1177
|
+
var i2, a2;
|
|
1178
|
+
const o2 = n2 === r2 ? s2.value.data.plaintext : re(r2, {});
|
|
1179
|
+
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) } });
|
|
1129
1180
|
});
|
|
1130
1181
|
}
|
|
1131
1182
|
messageDeleted(e2, t2) {
|
|
1132
|
-
this.mutate(e2, (s2) => null === s2.value.data ? s2 : this.messageId === t2.messageId ? (this.teardownNested(s2.value), c({ lastChanged: e2, sender: null, data: null })) : s2.value.data.referencedMessageId === t2.messageId ? c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: null, editedAt: s2.value.data.editedAt, custom: s2.value.data.custom, content: s2.value.data.content, reactions: s2.value.data.reactions } }) : s2);
|
|
1183
|
+
this.mutate(e2, (s2) => null === s2.value.data ? s2 : this.messageId === t2.messageId ? (this.teardownNested(s2.value), c({ lastChanged: e2, sender: null, data: null })) : s2.value.data.referencedMessageId === t2.messageId ? c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: null, editedAt: s2.value.data.editedAt, custom: s2.value.data.custom, plaintext: s2.value.data.plaintext, content: s2.value.data.content, reactions: s2.value.data.reactions } }) : s2);
|
|
1133
1184
|
}
|
|
1134
1185
|
getFromCache() {
|
|
1135
1186
|
return __async(this, null, function* () {
|
|
@@ -1146,23 +1197,19 @@ class ne extends W {
|
|
|
1146
1197
|
});
|
|
1147
1198
|
}
|
|
1148
1199
|
}
|
|
1149
|
-
function
|
|
1200
|
+
function he(e2, t2) {
|
|
1150
1201
|
if (void 0 === t2) return e2;
|
|
1151
1202
|
const s2 = e2.map((e3) => {
|
|
1152
1203
|
const s3 = t2[e3.emoji];
|
|
1153
|
-
return void 0 === s3 ? e3 : null === s3 ? __spreadProps(__spreadValues({}, e3), { count: 0 }) : { emoji: e3.emoji, count:
|
|
1204
|
+
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) });
|
|
1154
1205
|
}).filter((e3) => e3.count > 0), n2 = new Set(s2.map((e3) => e3.emoji));
|
|
1155
1206
|
for (const e3 in t2) {
|
|
1156
1207
|
const r2 = t2[e3];
|
|
1157
|
-
r2 && !n2.has(e3) && s2.push({ emoji: e3, count: r2.count, currentUserReacted: r2.currentUserReacted });
|
|
1208
|
+
r2 && !n2.has(e3) && s2.push(_({ emoji: e3, count: r2.count, currentUserReacted: r2.currentUserReacted }));
|
|
1158
1209
|
}
|
|
1159
|
-
return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), s2;
|
|
1160
|
-
}
|
|
1161
|
-
function ie(e2) {
|
|
1162
|
-
const t2 = Object.entries(e2).map(([e3, t3]) => ({ emoji: e3, count: t3.count, currentUserReacted: t3.currentUserReacted }));
|
|
1163
|
-
return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), t2;
|
|
1210
|
+
return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), _(s2);
|
|
1164
1211
|
}
|
|
1165
|
-
class
|
|
1212
|
+
class de extends G {
|
|
1166
1213
|
constructor(e2, t2, s2, n2) {
|
|
1167
1214
|
super(e2, {}), this.createdAt = t2, this.dataStore = s2, this.referencedDataStore = n2;
|
|
1168
1215
|
}
|
|
@@ -1198,11 +1245,11 @@ class ae extends W {
|
|
|
1198
1245
|
const r2 = yield (_a2 = t2.referencedDataStore) == null ? void 0 : _a2.getDeep(e2);
|
|
1199
1246
|
if (r2 && !r2.ok) return r2;
|
|
1200
1247
|
const i2 = (_b = r2 == null ? void 0 : r2.value) != null ? _b : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
|
|
1201
|
-
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 } });
|
|
1248
|
+
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 }) });
|
|
1202
1249
|
});
|
|
1203
1250
|
}
|
|
1204
1251
|
}
|
|
1205
|
-
class
|
|
1252
|
+
class pe extends z {
|
|
1206
1253
|
constructor(e2, t2, s2, n2, r2) {
|
|
1207
1254
|
super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1208
1255
|
}
|
|
@@ -1216,8 +1263,8 @@ class oe extends q {
|
|
|
1216
1263
|
}
|
|
1217
1264
|
fetchInitial(e2) {
|
|
1218
1265
|
return __async(this, null, function* () {
|
|
1219
|
-
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield
|
|
1220
|
-
return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) :
|
|
1266
|
+
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield fe({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
|
|
1267
|
+
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;
|
|
1221
1268
|
});
|
|
1222
1269
|
}
|
|
1223
1270
|
teardownNested(e2) {
|
|
@@ -1248,14 +1295,14 @@ class oe extends q {
|
|
|
1248
1295
|
});
|
|
1249
1296
|
}
|
|
1250
1297
|
equal(e2, t2) {
|
|
1251
|
-
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!
|
|
1298
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!W(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && W(e2.windowEnd, t2.windowEnd)));
|
|
1252
1299
|
}
|
|
1253
1300
|
loadNested(e2, t2) {
|
|
1254
1301
|
return __async(this, null, function* () {
|
|
1255
1302
|
if (null === t2.stores) return c({ snapshot: null, loadedAll: true });
|
|
1256
1303
|
const s2 = yield Promise.all(t2.inWindow.map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1257
1304
|
if (n2) return n2;
|
|
1258
|
-
return c({ snapshot: s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot), loadedAll: null === t2.windowEnd });
|
|
1305
|
+
return c({ snapshot: _(s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot)), loadedAll: null === t2.windowEnd });
|
|
1259
1306
|
});
|
|
1260
1307
|
}
|
|
1261
1308
|
loadMore(e2) {
|
|
@@ -1270,24 +1317,24 @@ class oe extends q {
|
|
|
1270
1317
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1271
1318
|
if (!t2.ok) return;
|
|
1272
1319
|
if (null === t2.value.windowEnd) return;
|
|
1273
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1320
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield fe({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
|
|
1274
1321
|
yield this.handlers.onLoadedMore({ type: "virtual.messages.loadedmore", conversationId: this.conversationId, data: n2 });
|
|
1275
1322
|
});
|
|
1276
1323
|
}
|
|
1277
1324
|
loadedMore(e2, t2) {
|
|
1278
|
-
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) :
|
|
1325
|
+
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);
|
|
1279
1326
|
}
|
|
1280
1327
|
messageCreated(e2, t2) {
|
|
1281
1328
|
this.mutate(e2, (s2) => {
|
|
1282
1329
|
if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."), s2;
|
|
1283
1330
|
if (s2.value.windowEnd && t2.state.createdAt < s2.value.windowEnd.oldestMessageTs) return s2;
|
|
1284
1331
|
if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
|
|
1285
|
-
const n2 = __spreadValues({}, s2.value.stores), r2 = new
|
|
1332
|
+
const n2 = __spreadValues({}, s2.value.stores), r2 = new le(e2, this.conversationId, t2.state, this.realtimeClient);
|
|
1286
1333
|
n2[t2.state.id] = r2;
|
|
1287
1334
|
const i2 = t2.state.referencedMessageId;
|
|
1288
1335
|
let a2;
|
|
1289
|
-
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new
|
|
1290
|
-
const o2 = new
|
|
1336
|
+
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new le(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
|
|
1337
|
+
const o2 = new de(e2, t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
|
|
1291
1338
|
u2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1292
1339
|
const l2 = u2[0].messageId === t2.messageId ? e2 : s2.value.lastMessageChanged;
|
|
1293
1340
|
return c({ lastChanged: e2, lastMessageChanged: l2, stores: n2, inWindow: u2, windowEnd: s2.value.windowEnd });
|
|
@@ -1307,12 +1354,12 @@ class oe extends q {
|
|
|
1307
1354
|
delete n2[t2.messageId];
|
|
1308
1355
|
const r2 = s2.value.inWindow.filter((e3) => e3.messageId !== t2.messageId);
|
|
1309
1356
|
if (t2.newLastMessage && 0 === r2.length) {
|
|
1310
|
-
const s3 = new
|
|
1357
|
+
const s3 = new le(e2, this.conversationId, t2.newLastMessage, this.realtimeClient);
|
|
1311
1358
|
n2[s3.messageId] = s3;
|
|
1312
1359
|
const i3 = t2.newLastMessage.referencedMessageId;
|
|
1313
1360
|
let a2;
|
|
1314
|
-
null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new
|
|
1315
|
-
const o2 = new
|
|
1361
|
+
null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new le(e2, this.conversationId, i3, this.realtimeClient), n2[i3] = a2);
|
|
1362
|
+
const o2 = new de(e2, t2.newLastMessage.createdAt, s3, a2);
|
|
1316
1363
|
r2.push(o2);
|
|
1317
1364
|
}
|
|
1318
1365
|
const i2 = void 0 !== t2.newLastMessage ? e2 : s2.value.lastMessageChanged;
|
|
@@ -1344,7 +1391,7 @@ class oe extends q {
|
|
|
1344
1391
|
});
|
|
1345
1392
|
}
|
|
1346
1393
|
}
|
|
1347
|
-
function
|
|
1394
|
+
function fe(_0) {
|
|
1348
1395
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1349
1396
|
const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "messages"], r2, { bypassCache: true });
|
|
1350
1397
|
if (i2.ok) {
|
|
@@ -1354,42 +1401,42 @@ function ue(_0) {
|
|
|
1354
1401
|
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 });
|
|
1355
1402
|
});
|
|
1356
1403
|
}
|
|
1357
|
-
function
|
|
1404
|
+
function me({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
|
|
1358
1405
|
var _a2, _b, _c, _d;
|
|
1359
1406
|
const a2 = t2 ? __spreadValues({}, t2.stores) : {};
|
|
1360
1407
|
for (const t3 of s2) if (void 0 === a2[t3.id]) {
|
|
1361
|
-
const s3 = new
|
|
1408
|
+
const s3 = new le(e2, r2, t3, i2);
|
|
1362
1409
|
a2[s3.messageId] = s3;
|
|
1363
1410
|
}
|
|
1364
1411
|
for (const t3 of s2) {
|
|
1365
1412
|
const s3 = t3.referencedMessageId;
|
|
1366
1413
|
if (s3 && void 0 === a2[s3]) {
|
|
1367
|
-
const t4 = new
|
|
1414
|
+
const t4 = new le(e2, r2, s3, i2);
|
|
1368
1415
|
a2[t4.messageId] = t4;
|
|
1369
1416
|
}
|
|
1370
1417
|
}
|
|
1371
1418
|
const o2 = t2 ? [...t2.inWindow] : [];
|
|
1372
|
-
for (const t3 of s2) o2.push(new
|
|
1419
|
+
for (const t3 of s2) o2.push(new de(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
|
|
1373
1420
|
o2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1374
1421
|
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;
|
|
1375
1422
|
if (null === n2) return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: null });
|
|
1376
1423
|
return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: { cursor: n2, oldestMessageTs: s2[s2.length - 1].createdAt } });
|
|
1377
1424
|
}
|
|
1378
|
-
class
|
|
1425
|
+
class ge extends z {
|
|
1379
1426
|
constructor(e2, t2, s2, n2, r2) {
|
|
1380
|
-
super(e2, n2, r2), this.
|
|
1427
|
+
super(e2, n2, r2), this.convData = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 0;
|
|
1381
1428
|
}
|
|
1382
1429
|
fetchInitial(e2) {
|
|
1383
1430
|
return __async(this, null, function* () {
|
|
1384
|
-
return c({ lastChanged: e2,
|
|
1431
|
+
return c({ lastChanged: e2, convData: this.convData });
|
|
1385
1432
|
});
|
|
1386
1433
|
}
|
|
1387
1434
|
teardownNested(e2) {
|
|
1388
|
-
e2.
|
|
1435
|
+
e2.convData.unsubscribe();
|
|
1389
1436
|
}
|
|
1390
1437
|
anyChildChanged(e2, t2, s2) {
|
|
1391
1438
|
return __async(this, null, function* () {
|
|
1392
|
-
return s2.
|
|
1439
|
+
return s2.convData.store.changedBetween(e2, t2);
|
|
1393
1440
|
});
|
|
1394
1441
|
}
|
|
1395
1442
|
equal(e2, t2) {
|
|
@@ -1397,28 +1444,28 @@ class le extends q {
|
|
|
1397
1444
|
}
|
|
1398
1445
|
loadNested(e2, t2) {
|
|
1399
1446
|
return __async(this, null, function* () {
|
|
1400
|
-
return t2.
|
|
1447
|
+
return t2.convData.store.getDeep(e2);
|
|
1401
1448
|
});
|
|
1402
1449
|
}
|
|
1403
1450
|
getFromCache() {
|
|
1404
1451
|
return __async(this, null, function* () {
|
|
1405
|
-
return this.
|
|
1452
|
+
return this.convData.store.getFromCache();
|
|
1406
1453
|
});
|
|
1407
1454
|
}
|
|
1408
1455
|
}
|
|
1409
|
-
function
|
|
1456
|
+
function ve(e2, t2) {
|
|
1410
1457
|
for (let s2 in e2) Object.prototype.hasOwnProperty.call(e2, s2) && t2(e2[s2], s2);
|
|
1411
1458
|
}
|
|
1412
|
-
function
|
|
1459
|
+
function we(e2, t2) {
|
|
1413
1460
|
return function(e3, t3) {
|
|
1414
1461
|
let s2 = {}, n2 = 0;
|
|
1415
|
-
return
|
|
1462
|
+
return ve(e3, (e4, r2) => {
|
|
1416
1463
|
const [i2, a2] = t3([r2, e4], n2++);
|
|
1417
1464
|
s2[i2] = a2;
|
|
1418
1465
|
}), s2;
|
|
1419
1466
|
}(e2, ([e3, s2]) => [e3, t2(s2, e3)]);
|
|
1420
1467
|
}
|
|
1421
|
-
class
|
|
1468
|
+
class be extends z {
|
|
1422
1469
|
constructor(e2, t2, s2, n2, r2) {
|
|
1423
1470
|
super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
|
|
1424
1471
|
}
|
|
@@ -1430,24 +1477,24 @@ class pe extends q {
|
|
|
1430
1477
|
if (!t2.ok) return t2;
|
|
1431
1478
|
const s2 = t2.value.data;
|
|
1432
1479
|
if (s2.many) return c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1433
|
-
return c({ data: s2, userSubscriptions:
|
|
1480
|
+
return c({ data: s2, userSubscriptions: we(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
|
|
1434
1481
|
});
|
|
1435
1482
|
}
|
|
1436
1483
|
equal(e2, t2) {
|
|
1437
|
-
return
|
|
1484
|
+
return W(e2.data, t2.data);
|
|
1438
1485
|
}
|
|
1439
1486
|
loadNested(e2, t2) {
|
|
1440
1487
|
return __async(this, null, function* () {
|
|
1441
1488
|
if (null === t2.data) return c({ snapshot: null, lastChanged: t2.lastChanged });
|
|
1442
|
-
if (t2.data.many) return c({ snapshot: { many: true }, lastChanged: t2.lastChanged });
|
|
1489
|
+
if (t2.data.many) return c({ snapshot: _({ many: true }), lastChanged: t2.lastChanged });
|
|
1443
1490
|
const s2 = Object.entries(t2.data.usersTyping).sort(([e3, t3], [s3, n3]) => t3 - n3).map(([e3, t3]) => e3).map((s3) => t2.userSubscriptions[s3].store.getDeep(e2)), n2 = yield Promise.all(s2), r2 = n2.find((e3) => !e3.ok);
|
|
1444
1491
|
if (r2) return r2;
|
|
1445
|
-
const i2 = n2.map((e3) => e3.value), a2 = i2.map((e3) => e3.snapshot), o2 = i2.map((e3) => e3.lastChanged);
|
|
1446
|
-
return c({ snapshot: { users: a2, many: false }, lastChanged:
|
|
1492
|
+
const i2 = n2.map((e3) => e3.value), a2 = i2.map((e3) => e3.snapshot), o2 = i2.map((e3) => e3.lastChanged), u2 = Math.max(t2.lastChanged, ...o2);
|
|
1493
|
+
return c({ snapshot: _({ users: _(a2), many: false }), lastChanged: u2 });
|
|
1447
1494
|
});
|
|
1448
1495
|
}
|
|
1449
1496
|
typingAvailable(e2, t2) {
|
|
1450
|
-
this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} :
|
|
1497
|
+
this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : we(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
|
|
1451
1498
|
}
|
|
1452
1499
|
typingChanged(e2, t2) {
|
|
1453
1500
|
this.mutate(e2, (s2) => {
|
|
@@ -1455,7 +1502,7 @@ class pe extends q {
|
|
|
1455
1502
|
if (void 0 === t2.diff.many) {
|
|
1456
1503
|
if (true === s2.value.data.many) return s2;
|
|
1457
1504
|
const n2 = __spreadValues({}, s2.value.data.usersTyping), r2 = __spreadValues({}, s2.value.userSubscriptions);
|
|
1458
|
-
return
|
|
1505
|
+
return ve(t2.diff.usersTyping, (e3, t3) => {
|
|
1459
1506
|
var _a2;
|
|
1460
1507
|
"number" == typeof e3 ? (n2[t3] = e3, r2[t3] = this.realtimeClient.internalSubscribe(["users", t3])) : null === e3 && (delete n2[t3], (_a2 = r2[t3]) == null ? void 0 : _a2.unsubscribe(), delete r2[t3]);
|
|
1461
1508
|
}), c({ data: { usersTyping: n2, many: false }, userSubscriptions: r2, lastChanged: e2 });
|
|
@@ -1463,7 +1510,7 @@ class pe extends q {
|
|
|
1463
1510
|
if (true === t2.diff.many) return s2.value.data.many ? s2 : c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1464
1511
|
if (false === t2.diff.many) {
|
|
1465
1512
|
if (false === s2.value.data.many) return s2;
|
|
1466
|
-
const n2 =
|
|
1513
|
+
const n2 = we(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
|
|
1467
1514
|
return c({ data: t2.diff, userSubscriptions: n2, lastChanged: e2 });
|
|
1468
1515
|
}
|
|
1469
1516
|
throw t2.diff, "Unreachable";
|
|
@@ -1473,7 +1520,7 @@ class pe extends q {
|
|
|
1473
1520
|
this.mutate(e2, (t3) => null === t3.value.data ? t3 : c({ data: null, lastChanged: e2 }));
|
|
1474
1521
|
}
|
|
1475
1522
|
teardownNested(e2) {
|
|
1476
|
-
e2.data &&
|
|
1523
|
+
e2.data && ve(e2.userSubscriptions, (e3) => e3.unsubscribe());
|
|
1477
1524
|
}
|
|
1478
1525
|
anyChildChanged(e2, t2, s2) {
|
|
1479
1526
|
return __async(this, null, function* () {
|
|
@@ -1487,7 +1534,7 @@ class pe extends q {
|
|
|
1487
1534
|
});
|
|
1488
1535
|
}
|
|
1489
1536
|
}
|
|
1490
|
-
class
|
|
1537
|
+
class ye extends G {
|
|
1491
1538
|
constructor(e2, t2, s2, n2) {
|
|
1492
1539
|
super(e2, {}), this.conversationId = t2, this.participantData = s2, this.realtimeClient = n2;
|
|
1493
1540
|
}
|
|
@@ -1501,7 +1548,7 @@ class fe extends W {
|
|
|
1501
1548
|
}
|
|
1502
1549
|
equal(e2, t2) {
|
|
1503
1550
|
var _a2, _b, _c, _d;
|
|
1504
|
-
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) &&
|
|
1551
|
+
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);
|
|
1505
1552
|
}
|
|
1506
1553
|
teardownNested(e2) {
|
|
1507
1554
|
var _a2;
|
|
@@ -1520,13 +1567,13 @@ class fe extends W {
|
|
|
1520
1567
|
const s2 = yield t2.user.store.getDeep(e2);
|
|
1521
1568
|
if (false === s2.ok) return s2;
|
|
1522
1569
|
const n2 = s2.value.snapshot;
|
|
1523
|
-
return c({ snapshot:
|
|
1570
|
+
return c({ snapshot: oe(t2.data, n2) });
|
|
1524
1571
|
});
|
|
1525
1572
|
}
|
|
1526
1573
|
participantEdited(e2, t2) {
|
|
1527
1574
|
this.mutate(e2, (s2) => {
|
|
1528
1575
|
if (null === s2.value.data) return s2;
|
|
1529
|
-
return c({ lastChanged: e2, user: s2.value.user, data: { id: s2.value.data.id, access:
|
|
1576
|
+
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 } });
|
|
1530
1577
|
});
|
|
1531
1578
|
}
|
|
1532
1579
|
participantDeleted(e2, t2) {
|
|
@@ -1543,14 +1590,14 @@ class fe extends W {
|
|
|
1543
1590
|
});
|
|
1544
1591
|
}
|
|
1545
1592
|
}
|
|
1546
|
-
class
|
|
1593
|
+
class Ce extends z {
|
|
1547
1594
|
constructor(e2, t2, s2, n2, r2) {
|
|
1548
1595
|
super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1549
1596
|
}
|
|
1550
1597
|
fetchInitial(e2) {
|
|
1551
1598
|
return __async(this, null, function* () {
|
|
1552
|
-
const t2 = yield
|
|
1553
|
-
return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) :
|
|
1599
|
+
const t2 = yield Ae({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: 10 });
|
|
1600
|
+
return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : Ee({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2;
|
|
1554
1601
|
});
|
|
1555
1602
|
}
|
|
1556
1603
|
teardownNested(e2) {
|
|
@@ -1569,7 +1616,7 @@ class me extends q {
|
|
|
1569
1616
|
});
|
|
1570
1617
|
}
|
|
1571
1618
|
equal(e2, t2) {
|
|
1572
|
-
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!
|
|
1619
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && W(e2.windowEnd, t2.windowEnd));
|
|
1573
1620
|
}
|
|
1574
1621
|
loadNested(e2, t2) {
|
|
1575
1622
|
return __async(this, null, function* () {
|
|
@@ -1577,7 +1624,7 @@ class me extends q {
|
|
|
1577
1624
|
const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1578
1625
|
if (n2) return n2;
|
|
1579
1626
|
const r2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
|
|
1580
|
-
return r2.sort((e3, t3) => t3.joinedAt - e3.joinedAt), c({ snapshot: r2, loadedAll: null === t2.windowEnd });
|
|
1627
|
+
return r2.sort((e3, t3) => t3.joinedAt - e3.joinedAt), c({ snapshot: _(r2), loadedAll: null === t2.windowEnd });
|
|
1581
1628
|
});
|
|
1582
1629
|
}
|
|
1583
1630
|
loadMore(e2) {
|
|
@@ -1592,19 +1639,19 @@ class me extends q {
|
|
|
1592
1639
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1593
1640
|
if (!t2.ok) return;
|
|
1594
1641
|
if (null === t2.value.windowEnd) return;
|
|
1595
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1642
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield Ae({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
|
|
1596
1643
|
yield this.handlers.onLoadedMore({ type: "virtual.participants.loadedmore", conversationId: this.conversationId, data: n2 });
|
|
1597
1644
|
});
|
|
1598
1645
|
}
|
|
1599
1646
|
loadedMore(e2, t2) {
|
|
1600
|
-
this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), s2) :
|
|
1647
|
+
this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), s2) : Ee({ seq: e2, prevStores: s2.value.stores, participants: t2.data.value.participants, cursor: t2.data.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2.data);
|
|
1601
1648
|
}
|
|
1602
1649
|
participantCreated(e2, t2) {
|
|
1603
1650
|
this.mutate(e2, (s2) => {
|
|
1604
1651
|
if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."), s2;
|
|
1605
1652
|
if (s2.value.windowEnd && t2.state.joinedAt < s2.value.windowEnd.oldestParticipantTs) return s2;
|
|
1606
1653
|
if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
|
|
1607
|
-
const n2 = __spreadValues({}, s2.value.stores), r2 = new
|
|
1654
|
+
const n2 = __spreadValues({}, s2.value.stores), r2 = new ye(e2, this.conversationId, t2.state, this.realtimeClient);
|
|
1608
1655
|
n2[t2.state.id] = r2;
|
|
1609
1656
|
return c({ lastChanged: e2, stores: n2, windowEnd: s2.value.windowEnd });
|
|
1610
1657
|
});
|
|
@@ -1644,7 +1691,7 @@ class me extends q {
|
|
|
1644
1691
|
});
|
|
1645
1692
|
}
|
|
1646
1693
|
}
|
|
1647
|
-
function
|
|
1694
|
+
function Ae(_0) {
|
|
1648
1695
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1649
1696
|
const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "participants"], r2, { bypassCache: true });
|
|
1650
1697
|
if (i2.ok) {
|
|
@@ -1654,23 +1701,23 @@ function ge(_0) {
|
|
|
1654
1701
|
return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 : c({ participants: null, nextCursor: null });
|
|
1655
1702
|
});
|
|
1656
1703
|
}
|
|
1657
|
-
function
|
|
1704
|
+
function Ee({ seq: e2, prevStores: t2, participants: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
|
|
1658
1705
|
const a2 = t2 ? __spreadValues({}, t2) : {};
|
|
1659
1706
|
for (const t3 of s2) if (void 0 === a2[t3.id]) {
|
|
1660
|
-
const s3 = new
|
|
1707
|
+
const s3 = new ye(e2, r2, t3, i2);
|
|
1661
1708
|
a2[t3.id] = s3;
|
|
1662
1709
|
}
|
|
1663
1710
|
if (null === n2) return c({ lastChanged: e2, stores: a2, windowEnd: null });
|
|
1664
1711
|
return c({ lastChanged: e2, stores: a2, windowEnd: { cursor: n2, oldestParticipantTs: s2[s2.length - 1].joinedAt } });
|
|
1665
1712
|
}
|
|
1666
|
-
class
|
|
1713
|
+
class ke extends z {
|
|
1667
1714
|
constructor(e2, t2, s2, n2, r2) {
|
|
1668
1715
|
super(e2, n2, r2), this.getConvDataStore = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1669
1716
|
}
|
|
1670
1717
|
fetchInitial(e2) {
|
|
1671
1718
|
return __async(this, null, function* () {
|
|
1672
|
-
const t2 = yield
|
|
1673
|
-
return t2.ok ? null === t2.value.conversations ? c({ lastChanged: e2, stores: null, windowEnd: null }) :
|
|
1719
|
+
const t2 = yield xe({ realtimeClient: this.realtimeClient, count: 20 });
|
|
1720
|
+
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;
|
|
1674
1721
|
});
|
|
1675
1722
|
}
|
|
1676
1723
|
teardownNested(e2) {
|
|
@@ -1687,11 +1734,11 @@ class we extends q {
|
|
|
1687
1734
|
});
|
|
1688
1735
|
}
|
|
1689
1736
|
equal(e2, t2) {
|
|
1690
|
-
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!
|
|
1737
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && W(e2.windowEnd, t2.windowEnd));
|
|
1691
1738
|
}
|
|
1692
1739
|
loadNested(e2, t2) {
|
|
1693
1740
|
return __async(this, null, function* () {
|
|
1694
|
-
if (null === t2.stores) return c({ snapshot: [], loadedAll: true });
|
|
1741
|
+
if (null === t2.stores) return c({ snapshot: _([]), loadedAll: true });
|
|
1695
1742
|
const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.store.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1696
1743
|
if (n2) return n2;
|
|
1697
1744
|
const r2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
|
|
@@ -1699,7 +1746,7 @@ class we extends q {
|
|
|
1699
1746
|
var _a2, _b, _c, _d;
|
|
1700
1747
|
const s3 = (_b = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b : e3.joinedAt;
|
|
1701
1748
|
return ((_d = (_c = t3.lastMessage) == null ? void 0 : _c.createdAt) != null ? _d : t3.joinedAt) - s3;
|
|
1702
|
-
}), c({ snapshot: r2, loadedAll: null === t2.windowEnd });
|
|
1749
|
+
}), c({ snapshot: _(r2), loadedAll: null === t2.windowEnd });
|
|
1703
1750
|
});
|
|
1704
1751
|
}
|
|
1705
1752
|
loadMore(e2) {
|
|
@@ -1714,7 +1761,7 @@ class we extends q {
|
|
|
1714
1761
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1715
1762
|
if (!t2.ok) return;
|
|
1716
1763
|
if (null === t2.value.windowEnd) return;
|
|
1717
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1764
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield xe({ count: e2, cursor: s2, realtimeClient: this.realtimeClient });
|
|
1718
1765
|
yield this.handlers.onLoadedMore({ type: "virtual.conversations.loadedmore", data: n2 });
|
|
1719
1766
|
});
|
|
1720
1767
|
}
|
|
@@ -1728,14 +1775,17 @@ class we extends q {
|
|
|
1728
1775
|
});
|
|
1729
1776
|
}
|
|
1730
1777
|
loadedMore(e2, t2) {
|
|
1731
|
-
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) :
|
|
1778
|
+
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);
|
|
1732
1779
|
}
|
|
1733
1780
|
userCreated(e2, t2) {
|
|
1734
1781
|
this.mutate(e2, (e3) => null !== e3.value.stores ? e3 : c({ lastChanged: e3.value.lastChanged, stores: {}, windowEnd: null }));
|
|
1735
1782
|
}
|
|
1736
1783
|
sideCreated(e2, t2) {
|
|
1737
1784
|
const s2 = this.getConvDataStore(t2.state);
|
|
1738
|
-
this.mutate(e2, (n2) =>
|
|
1785
|
+
this.mutate(e2, (n2) => {
|
|
1786
|
+
let r2 = n2.value.stores;
|
|
1787
|
+
return null === r2 && (console.warn("[TalkJS] Received a 'side.created' event when we thought your user didn't exist."), r2 = {}), Object.hasOwnProperty.call(r2, t2.conversationId) ? (s2.unsubscribe(), n2) : c({ lastChanged: e2, stores: __spreadProps(__spreadValues({}, r2), { [t2.conversationId]: s2 }), windowEnd: n2.value.windowEnd });
|
|
1788
|
+
});
|
|
1739
1789
|
}
|
|
1740
1790
|
sideDeleted(e2, t2) {
|
|
1741
1791
|
this.mutate(e2, (s2) => {
|
|
@@ -1764,7 +1814,7 @@ class we extends q {
|
|
|
1764
1814
|
});
|
|
1765
1815
|
}
|
|
1766
1816
|
}
|
|
1767
|
-
function
|
|
1817
|
+
function xe(_0) {
|
|
1768
1818
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, count: s2 }) {
|
|
1769
1819
|
const n2 = { limit: s2, cursor: e2 }, r2 = yield t2.call("GET", ["me", "conversations"], n2, { bypassCache: true });
|
|
1770
1820
|
if (r2.ok) {
|
|
@@ -1774,13 +1824,13 @@ function be(_0) {
|
|
|
1774
1824
|
return r2.ok || "server" !== r2.where || 404 !== r2.value.status || "USER_NOT_FOUND" !== r2.value.errorCode ? r2 : c({ conversations: null, nextCursor: null });
|
|
1775
1825
|
});
|
|
1776
1826
|
}
|
|
1777
|
-
function
|
|
1827
|
+
function Ie({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
|
|
1778
1828
|
const i2 = t2 ? __spreadValues({}, t2) : {};
|
|
1779
1829
|
for (const e3 of s2) void 0 === i2[e3.id] && (i2[e3.id] = r2(e3));
|
|
1780
1830
|
if (null === n2) return c({ lastChanged: e2, stores: i2, windowEnd: null });
|
|
1781
1831
|
return c({ lastChanged: e2, stores: i2, windowEnd: { cursor: n2, oldestMessageTs: Math.min(...s2.map((e3) => e3.lastMessageAt)) } });
|
|
1782
1832
|
}
|
|
1783
|
-
class
|
|
1833
|
+
class Te extends z {
|
|
1784
1834
|
constructor(e2, t2, s2, n2, r2) {
|
|
1785
1835
|
super(e2, n2, r2), this.conversation = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 5e3;
|
|
1786
1836
|
}
|
|
@@ -1790,7 +1840,7 @@ class Ce extends q {
|
|
|
1790
1840
|
fetchInitial(e2) {
|
|
1791
1841
|
return __async(this, null, function* () {
|
|
1792
1842
|
const t2 = this.realtimeClient.internalSubscribe(["me", "conversations", this.conversationId, "messages"]);
|
|
1793
|
-
if ("object" == typeof this.conversation) return c({ lastChanged: e2, snapshot: this.conversation,
|
|
1843
|
+
if ("object" == typeof this.conversation) return c({ lastChanged: e2, snapshot: this.conversation, messageWindow: t2 });
|
|
1794
1844
|
const s2 = yield this.realtimeClient.call("GET", ["me", "conversations", this.conversationId], {}, { bypassCache: true });
|
|
1795
1845
|
let n2;
|
|
1796
1846
|
if (s2.ok) n2 = s2.value.data;
|
|
@@ -1799,45 +1849,45 @@ class Ce extends q {
|
|
|
1799
1849
|
if ("server" !== s2.where || 403 !== s2.value.status || "NOT_A_PARTICIPANT" !== s2.value.errorCode) return t2.unsubscribe(), s2;
|
|
1800
1850
|
n2 = null;
|
|
1801
1851
|
}
|
|
1802
|
-
return c({ lastChanged: e2, snapshot: n2,
|
|
1852
|
+
return c({ lastChanged: e2, snapshot: n2, messageWindow: t2 });
|
|
1803
1853
|
});
|
|
1804
1854
|
}
|
|
1805
1855
|
teardownNested(e2) {
|
|
1806
1856
|
var _a2;
|
|
1807
|
-
(_a2 = e2.
|
|
1857
|
+
(_a2 = e2.messageWindow) == null ? void 0 : _a2.unsubscribe();
|
|
1808
1858
|
}
|
|
1809
1859
|
anyChildChanged(e2, t2, s2) {
|
|
1810
1860
|
return __async(this, null, function* () {
|
|
1811
|
-
return true === (yield s2.
|
|
1861
|
+
return true === (yield s2.messageWindow.store.lastMessageChangedBetween(e2, t2));
|
|
1812
1862
|
});
|
|
1813
1863
|
}
|
|
1814
1864
|
equal(e2, t2) {
|
|
1815
|
-
return
|
|
1865
|
+
return W(e2.snapshot, t2.snapshot);
|
|
1816
1866
|
}
|
|
1817
1867
|
loadNested(e2, t2) {
|
|
1818
1868
|
return __async(this, null, function* () {
|
|
1819
1869
|
var _a2;
|
|
1820
1870
|
if (!t2.snapshot) return c({ snapshot: null, loadedAll: true });
|
|
1821
|
-
const s2 = yield t2.
|
|
1871
|
+
const s2 = yield t2.messageWindow.store.getDeep(e2);
|
|
1822
1872
|
if (!s2.ok) return s2;
|
|
1823
1873
|
const n2 = s2.value.snapshot, r2 = (_a2 = n2 == null ? void 0 : n2[0]) != null ? _a2 : null;
|
|
1824
|
-
return c({ snapshot: __spreadProps(__spreadValues({}, t2.snapshot), { lastMessage: r2 }) });
|
|
1874
|
+
return c({ snapshot: _(__spreadProps(__spreadValues({}, t2.snapshot), { custom: _(t2.snapshot.custom), welcomeMessages: _(t2.snapshot.welcomeMessages), lastMessage: r2 })) });
|
|
1825
1875
|
});
|
|
1826
1876
|
}
|
|
1827
1877
|
participantEdited(e2, t2) {
|
|
1828
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1878
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
|
|
1829
1879
|
}
|
|
1830
1880
|
conversationEdited(e2, t2) {
|
|
1831
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1881
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
|
|
1832
1882
|
}
|
|
1833
1883
|
sideEdited(e2, t2) {
|
|
1834
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot:
|
|
1884
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
|
|
1835
1885
|
}
|
|
1836
1886
|
sideCreated(e2, t2) {
|
|
1837
|
-
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state,
|
|
1887
|
+
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindow: s2.value.messageWindow }));
|
|
1838
1888
|
}
|
|
1839
1889
|
sideDeleted(e2, t2) {
|
|
1840
|
-
this.mutate(e2, (t3) => null === t3.value.snapshot ? t3 : c({ lastChanged: e2, snapshot: null,
|
|
1890
|
+
this.mutate(e2, (t3) => null === t3.value.snapshot ? t3 : c({ lastChanged: e2, snapshot: null, messageWindow: t3.value.messageWindow }));
|
|
1841
1891
|
}
|
|
1842
1892
|
getFromCache() {
|
|
1843
1893
|
return __async(this, null, function* () {
|
|
@@ -1846,11 +1896,11 @@ class Ce extends q {
|
|
|
1846
1896
|
});
|
|
1847
1897
|
}
|
|
1848
1898
|
}
|
|
1849
|
-
function
|
|
1899
|
+
function De(e2, t2) {
|
|
1850
1900
|
const s2 = t2;
|
|
1851
|
-
return { id: e2.id, createdAt: e2.createdAt, subject:
|
|
1901
|
+
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 };
|
|
1852
1902
|
}
|
|
1853
|
-
class
|
|
1903
|
+
class Se extends z {
|
|
1854
1904
|
constructor(e2, t2, s2, n2, r2) {
|
|
1855
1905
|
super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e3;
|
|
1856
1906
|
}
|
|
@@ -1861,7 +1911,7 @@ class Ee extends q {
|
|
|
1861
1911
|
});
|
|
1862
1912
|
}
|
|
1863
1913
|
equal(e2, t2) {
|
|
1864
|
-
return
|
|
1914
|
+
return W(e2.data, t2.data);
|
|
1865
1915
|
}
|
|
1866
1916
|
teardownNested(e2) {
|
|
1867
1917
|
e2.user.unsubscribe();
|
|
@@ -1876,7 +1926,7 @@ class Ee extends q {
|
|
|
1876
1926
|
const s2 = yield t2.user.store.getDeep(e2);
|
|
1877
1927
|
if (!s2.ok) return s2;
|
|
1878
1928
|
const n2 = s2.value.snapshot;
|
|
1879
|
-
return null === t2.data || null === n2 ? c({ snapshot: null }) : c({ snapshot: __spreadValues({ user: n2 }
|
|
1929
|
+
return null === t2.data || null === n2 ? c({ snapshot: null }) : c({ snapshot: _(__spreadProps(__spreadValues({}, t2.data), { user: n2 })) });
|
|
1880
1930
|
});
|
|
1881
1931
|
}
|
|
1882
1932
|
userCreated(e2, t2) {
|
|
@@ -1900,9 +1950,9 @@ class Ee extends q {
|
|
|
1900
1950
|
});
|
|
1901
1951
|
}
|
|
1902
1952
|
}
|
|
1903
|
-
class
|
|
1953
|
+
class Me {
|
|
1904
1954
|
constructor(e2, t2, s2) {
|
|
1905
|
-
this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new
|
|
1955
|
+
this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new q(), this.virtualSeqOffset = 0, this.realPublishSeq = 0, this.refetchOnNextNetworkLoss = true, this.connection = new N(e2, t2, { onUpstreamRestarting: () => {
|
|
1906
1956
|
this.refetchOnNextNetworkLoss = false;
|
|
1907
1957
|
}, onReady: () => {
|
|
1908
1958
|
this.refetchOnNextNetworkLoss = true;
|
|
@@ -1914,7 +1964,7 @@ class ke {
|
|
|
1914
1964
|
}
|
|
1915
1965
|
}, onResubscribeError: (e3, t3) => {
|
|
1916
1966
|
var _a2;
|
|
1917
|
-
(_a2 = this.storeMap[
|
|
1967
|
+
(_a2 = this.storeMap[Fe(e3)]) == null ? void 0 : _a2.setError(t3);
|
|
1918
1968
|
}, onPublish: (e3, t3) => {
|
|
1919
1969
|
this.realPublishSeq = e3;
|
|
1920
1970
|
const s3 = this.virtualSeq;
|
|
@@ -1935,7 +1985,7 @@ class ke {
|
|
|
1935
1985
|
}));
|
|
1936
1986
|
}
|
|
1937
1987
|
handlePublish(e2, t2) {
|
|
1938
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r,
|
|
1988
|
+
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s2, _t2, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
1939
1989
|
switch (t2.type) {
|
|
1940
1990
|
case "user.created":
|
|
1941
1991
|
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));
|
|
@@ -1954,7 +2004,7 @@ class ke {
|
|
|
1954
2004
|
case "message.edited":
|
|
1955
2005
|
return void ((_r = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _r.messageEdited(e2, t2));
|
|
1956
2006
|
case "message.deleted":
|
|
1957
|
-
return void ((
|
|
2007
|
+
return void ((_s2 = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _s2.messageDeleted(e2, t2));
|
|
1958
2008
|
case "typing.available":
|
|
1959
2009
|
return void ((_t2 = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _t2.typingAvailable(e2, t2));
|
|
1960
2010
|
case "typing.changed":
|
|
@@ -1980,7 +2030,7 @@ class ke {
|
|
|
1980
2030
|
call(e2, t2, n2, r2) {
|
|
1981
2031
|
return __async(this, null, function* () {
|
|
1982
2032
|
if (!r2.bypassCache && "GET" === e2) {
|
|
1983
|
-
const e3 =
|
|
2033
|
+
const e3 = Fe(t2);
|
|
1984
2034
|
if (e3 in this.storeMap) {
|
|
1985
2035
|
const t3 = e3, s2 = this.storeMap[t3];
|
|
1986
2036
|
if (s2 && "getFromCache" in s2) {
|
|
@@ -2052,7 +2102,7 @@ class ke {
|
|
|
2052
2102
|
});
|
|
2053
2103
|
}
|
|
2054
2104
|
getOrCreateStore(e2) {
|
|
2055
|
-
const t2 =
|
|
2105
|
+
const t2 = Fe(e2);
|
|
2056
2106
|
if (t2 in this.storeMap) return this.storeMap[t2];
|
|
2057
2107
|
this.connection.subscribe(e2).then((e3) => {
|
|
2058
2108
|
e3.ok || s2.setError(e3);
|
|
@@ -2069,13 +2119,13 @@ class ke {
|
|
|
2069
2119
|
return this.connection.isConnected();
|
|
2070
2120
|
}
|
|
2071
2121
|
instantiateStore(e2, t2) {
|
|
2072
|
-
if (s(e2, ["users", "*"])) return new
|
|
2073
|
-
if (s(e2, ["me", "conversations", "*"])) return new
|
|
2074
|
-
if (s(e2, ["me", "conversations", "*", "messages"])) return new
|
|
2075
|
-
if (s(e2, ["me", "conversations", "*", "participants"])) return new
|
|
2076
|
-
if (s(e2, ["me", "conversations", "*", "typing"])) return new
|
|
2077
|
-
if (s(e2, ["me", "conversations"])) return new
|
|
2078
|
-
if (s(e2, ["users", "*", "online"])) return new
|
|
2122
|
+
if (s(e2, ["users", "*"])) return new ce(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
|
|
2123
|
+
if (s(e2, ["me", "conversations", "*"])) return new ge(this.virtualSeq, this.subscribeConvData(e2[2]), this.realtimeClient, this.emitMutex, { onTeardown: t2 });
|
|
2124
|
+
if (s(e2, ["me", "conversations", "*", "messages"])) return new pe(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
|
|
2125
|
+
if (s(e2, ["me", "conversations", "*", "participants"])) return new Ce(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
|
|
2126
|
+
if (s(e2, ["me", "conversations", "*", "typing"])) return new be(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
|
|
2127
|
+
if (s(e2, ["me", "conversations"])) return new ke(this.virtualSeq, (e3) => this.subscribeConvData(e3), this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
|
|
2128
|
+
if (s(e2, ["users", "*", "online"])) return new Se(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
|
|
2079
2129
|
throw "Unreachable";
|
|
2080
2130
|
}
|
|
2081
2131
|
subscribeConvData(e2) {
|
|
@@ -2084,18 +2134,18 @@ class ke {
|
|
|
2084
2134
|
const e3 = this.convDataStores[t2];
|
|
2085
2135
|
return { store: e3, unsubscribe: e3.registerInternalSubscription() };
|
|
2086
2136
|
}
|
|
2087
|
-
const s2 = new
|
|
2137
|
+
const s2 = new Te(this.virtualSeq, e2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
|
|
2088
2138
|
delete this.convDataStores[t2];
|
|
2089
2139
|
} });
|
|
2090
2140
|
return this.convDataStores[t2] = s2, { store: s2, unsubscribe: s2.registerInternalSubscription() };
|
|
2091
2141
|
}
|
|
2092
2142
|
}
|
|
2093
|
-
function
|
|
2143
|
+
function Fe(e2) {
|
|
2094
2144
|
return `/${e2.join("/")}`;
|
|
2095
2145
|
}
|
|
2096
|
-
class
|
|
2146
|
+
class Be {
|
|
2097
2147
|
constructor(e2, t2, s2) {
|
|
2098
|
-
this.userId = t2, this.alive = true, this.connection = new
|
|
2148
|
+
this.userId = t2, this.alive = true, this.connection = new Me(e2, s2, this), s2.onTokenRefreshFailed(() => {
|
|
2099
2149
|
this.destroy();
|
|
2100
2150
|
});
|
|
2101
2151
|
}
|
|
@@ -2120,28 +2170,22 @@ class Ie {
|
|
|
2120
2170
|
listMessages(e2, t2) {
|
|
2121
2171
|
return __async(this, null, function* () {
|
|
2122
2172
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
|
|
2123
|
-
if (!s2.ok) return
|
|
2124
|
-
const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.
|
|
2173
|
+
if (!s2.ok) return Re(s2, "Listing messages in " + e2);
|
|
2174
|
+
const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.hydrateMessageData(t3, e2))), i2 = r2.find((e3) => !e3.ok);
|
|
2125
2175
|
if (void 0 !== i2 && !i2.ok) return i2;
|
|
2126
2176
|
return c(r2.map(({ value: e3 }) => e3));
|
|
2127
2177
|
});
|
|
2128
2178
|
}
|
|
2129
|
-
|
|
2130
|
-
return { id: e2.id, subject: e2.subject, photoUrl: e2.photoUrl, welcomeMessages: e2.welcomeMessages, custom: e2.custom, createdAt: e2.createdAt, joinedAt: e2.joinedAt, lastMessageAt: e2.lastMessageAt, unreadMessageCount: e2.unreadMessageCount, isUnread: e2.isUnread, access: e2.access, notify: e2.notify, lastMessage: t2, readUntil: e2.readUntil, everyoneReadUntil: e2.everyoneReadUntil };
|
|
2131
|
-
}
|
|
2132
|
-
createUserSnapshot(e2) {
|
|
2133
|
-
return { id: e2.id, name: e2.name, custom: e2.custom, locale: e2.locale, photoUrl: e2.photoUrl, role: e2.role, welcomeMessage: e2.welcomeMessage };
|
|
2134
|
-
}
|
|
2135
|
-
createParticipantSnapshotPreloaded(e2, t2) {
|
|
2136
|
-
return { user: t2, access: e2.access, notify: e2.notify, joinedAt: e2.joinedAt };
|
|
2137
|
-
}
|
|
2138
|
-
createMessageSnapshot(e2, t2) {
|
|
2179
|
+
hydrateMessageData(e2, t2) {
|
|
2139
2180
|
return __async(this, null, function* () {
|
|
2140
2181
|
const s2 = null === e2.senderId ? Promise.resolve(c(null)) : this.getUser(e2.senderId), n2 = null === e2.referencedMessageId ? Promise.resolve(c(null)) : this.getReferencedMessage(t2, e2.referencedMessageId), r2 = yield s2;
|
|
2141
2182
|
if (!r2.ok) return r2;
|
|
2142
2183
|
const i2 = yield n2;
|
|
2143
2184
|
if (!i2.ok) return i2;
|
|
2144
|
-
|
|
2185
|
+
const a2 = function(e3, t3, s3) {
|
|
2186
|
+
return _({ id: e3.id, type: e3.type, sender: t3, referencedMessage: s3, custom: _(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ue(e3.reactions), plaintext: re(e3.content, {}) });
|
|
2187
|
+
}(e2, r2.value, i2.value);
|
|
2188
|
+
return c(a2);
|
|
2145
2189
|
});
|
|
2146
2190
|
}
|
|
2147
2191
|
getReferencedMessage(e2, t2) {
|
|
@@ -2149,37 +2193,33 @@ class Ie {
|
|
|
2149
2193
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
|
|
2150
2194
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
|
|
2151
2195
|
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
|
|
2152
|
-
if (!s2.ok) return
|
|
2196
|
+
if (!s2.ok) return Re(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
|
|
2153
2197
|
const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
|
|
2154
2198
|
if (!r2.ok) return r2;
|
|
2155
|
-
const i2 =
|
|
2156
|
-
|
|
2199
|
+
const i2 = function(e3, t3) {
|
|
2200
|
+
return _({ id: e3.id, type: e3.type, sender: t3, referencedMessageId: e3.referencedMessageId, custom: _(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ue(e3.reactions), plaintext: re(e3.content, {}) });
|
|
2201
|
+
}(n2, r2.value);
|
|
2202
|
+
return c(i2);
|
|
2157
2203
|
});
|
|
2158
2204
|
}
|
|
2159
2205
|
getUser(e2) {
|
|
2160
2206
|
return __async(this, null, function* () {
|
|
2161
2207
|
const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
|
|
2162
2208
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
|
|
2163
|
-
if (!t2.ok) return
|
|
2164
|
-
return c(
|
|
2209
|
+
if (!t2.ok) return Re(t2, "Get user " + e2);
|
|
2210
|
+
return c(ae(t2.value.data));
|
|
2165
2211
|
});
|
|
2166
2212
|
}
|
|
2167
|
-
createMessageSnapshotPreloaded(e2, t2, s2) {
|
|
2168
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, reactions: ie(e2.reactions), plaintext: te(e2.content, {}) };
|
|
2169
|
-
}
|
|
2170
|
-
createReferencedMessageSnapshotPreloaded(e2, t2) {
|
|
2171
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, reactions: ie(e2.reactions), plaintext: te(e2.content, {}) };
|
|
2172
|
-
}
|
|
2173
2213
|
}
|
|
2174
|
-
function
|
|
2214
|
+
function Re(e2, t2) {
|
|
2175
2215
|
return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
|
|
2176
2216
|
}
|
|
2177
|
-
function
|
|
2217
|
+
function Ne(e2, s2) {
|
|
2178
2218
|
var _a2;
|
|
2179
2219
|
if (s2.ok) return s2.value;
|
|
2180
2220
|
throw "SESSION_DESTROYED" === s2.value ? new Error(`${e2} failed because the session was destroyed`) : new Error(t((_a2 = s2.value.operation) != null ? _a2 : e2, s2.value));
|
|
2181
2221
|
}
|
|
2182
|
-
class
|
|
2222
|
+
class _e {
|
|
2183
2223
|
constructor(e2, t2) {
|
|
2184
2224
|
this.id = e2, this._realtimeClient = t2;
|
|
2185
2225
|
}
|
|
@@ -2189,7 +2229,7 @@ class De {
|
|
|
2189
2229
|
get() {
|
|
2190
2230
|
return __async(this, null, function* () {
|
|
2191
2231
|
const e2 = yield this._realtimeClient.getUser(this.brandedId);
|
|
2192
|
-
return
|
|
2232
|
+
return Ne("Get user " + this.id, e2);
|
|
2193
2233
|
});
|
|
2194
2234
|
}
|
|
2195
2235
|
set(t2) {
|
|
@@ -2213,7 +2253,7 @@ class De {
|
|
|
2213
2253
|
return this._realtimeClient.subscribe(["users", this.brandedId, "online"], e2);
|
|
2214
2254
|
}
|
|
2215
2255
|
}
|
|
2216
|
-
class
|
|
2256
|
+
class Pe {
|
|
2217
2257
|
constructor(e2, t2, s2) {
|
|
2218
2258
|
this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
2219
2259
|
}
|
|
@@ -2228,8 +2268,7 @@ class Me {
|
|
|
2228
2268
|
const t2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedConversationId, "participants", this.brandedUserId], {}), s2 = yield this._realtimeClient.call("GET", ["users", this.brandedUserId], { includePrivateFields: false }), [n2, r2] = yield Promise.all([t2, s2]);
|
|
2229
2269
|
if (!n2.ok && "server" === n2.where && 404 === n2.value.status) return null;
|
|
2230
2270
|
if (!r2.ok && "server" === r2.where && 404 === r2.value.status) return null;
|
|
2231
|
-
|
|
2232
|
-
return this._realtimeClient.createParticipantSnapshotPreloaded(i2, o2);
|
|
2271
|
+
return oe(e(`Get participant ${this.userId} in conversation ${this.conversationId}`, n2), ae(e(`Get user ${this.userId}`, r2)));
|
|
2233
2272
|
});
|
|
2234
2273
|
}
|
|
2235
2274
|
set() {
|
|
@@ -2257,7 +2296,7 @@ class Me {
|
|
|
2257
2296
|
});
|
|
2258
2297
|
}
|
|
2259
2298
|
}
|
|
2260
|
-
function
|
|
2299
|
+
function Oe(e2) {
|
|
2261
2300
|
const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
2262
2301
|
let s2 = 0;
|
|
2263
2302
|
const n2 = [], r2 = e2 === s2;
|
|
@@ -2275,7 +2314,7 @@ function Fe(e2) {
|
|
|
2275
2314
|
if (20 != a2.length) throw new Error("Length should be 20.");
|
|
2276
2315
|
return a2;
|
|
2277
2316
|
}
|
|
2278
|
-
const
|
|
2317
|
+
const je = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
2279
2318
|
return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
|
|
2280
2319
|
}(e2, (e3) => {
|
|
2281
2320
|
if ("string" == typeof e3) return t2(e3, s2);
|
|
@@ -2288,14 +2327,14 @@ const Be = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
2288
2327
|
case "bulletList":
|
|
2289
2328
|
case "bulletpoint":
|
|
2290
2329
|
case "bulletPoint":
|
|
2291
|
-
return [{ type: e3.type, children:
|
|
2330
|
+
return [{ type: e3.type, children: je(e3.children, t2, e3.type) }];
|
|
2292
2331
|
case "link":
|
|
2293
|
-
return [{ type: e3.type, url: e3.url, children:
|
|
2332
|
+
return [{ type: e3.type, url: e3.url, children: je(e3.children, t2, e3.type) }];
|
|
2294
2333
|
case "actionlink":
|
|
2295
2334
|
case "actionLink":
|
|
2296
2335
|
case "actionbutton":
|
|
2297
2336
|
case "actionButton":
|
|
2298
|
-
return [{ type: e3.type, action: e3.action, params: e3.params, children:
|
|
2337
|
+
return [{ type: e3.type, action: e3.action, params: e3.params, children: je(e3.children, t2, e3.type) }];
|
|
2299
2338
|
case "mention":
|
|
2300
2339
|
case "autolink":
|
|
2301
2340
|
case "autoLink":
|
|
@@ -2310,12 +2349,12 @@ const Be = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
2310
2349
|
return [e3];
|
|
2311
2350
|
}
|
|
2312
2351
|
});
|
|
2313
|
-
function
|
|
2352
|
+
function Ue(e2, t2) {
|
|
2314
2353
|
return (s2) => {
|
|
2315
2354
|
const n2 = s2;
|
|
2316
2355
|
let r2 = 0;
|
|
2317
2356
|
const i2 = [];
|
|
2318
|
-
for (const a2 of
|
|
2357
|
+
for (const a2 of V(s2, e2)) {
|
|
2319
2358
|
a2.index - r2 > 0 && i2.push(n2.substring(r2, a2.index));
|
|
2320
2359
|
const e3 = t2(a2);
|
|
2321
2360
|
Array.isArray(e3) ? i2.push(...e3) : i2.push(e3), r2 = a2.index + a2[0].length;
|
|
@@ -2323,29 +2362,29 @@ function Re(e2, t2) {
|
|
|
2323
2362
|
return r2 < s2.length && i2.push(s2.substring(r2)), i2;
|
|
2324
2363
|
};
|
|
2325
2364
|
}
|
|
2326
|
-
const
|
|
2327
|
-
var
|
|
2328
|
-
const
|
|
2365
|
+
const $e = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
2366
|
+
var We = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(We || {});
|
|
2367
|
+
const qe = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
|
|
2329
2368
|
const t2 = [];
|
|
2330
2369
|
return 1 & e2 || t2.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/), 2 & e2 || t2.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/), 4 & e2 || t2.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/), new RegExp(t2.map((e3) => e3.source).join("|"), "g");
|
|
2331
|
-
}),
|
|
2332
|
-
function
|
|
2333
|
-
return
|
|
2370
|
+
}), He = { _: 1, "*": 4, "~": 2 };
|
|
2371
|
+
function Le(e2) {
|
|
2372
|
+
return Ge(e2, 0);
|
|
2334
2373
|
}
|
|
2335
|
-
function
|
|
2336
|
-
const s2 =
|
|
2337
|
-
const t3 =
|
|
2374
|
+
function Ge(e2, t2 = 0) {
|
|
2375
|
+
const s2 = qe[t2], n2 = s2 ? function(e3) {
|
|
2376
|
+
const t3 = ze.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${$e}])(?:${e3.source})(?=[\\s${$e}]|$)`, "g")), s3 = Ue(t3, (e4) => {
|
|
2338
2377
|
const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
|
|
2339
|
-
return [" ", { type:
|
|
2378
|
+
return [" ", { type: We[He[t4]], children: [s4] }];
|
|
2340
2379
|
});
|
|
2341
2380
|
return (e4) => {
|
|
2342
2381
|
const [t4, ...n3] = s3(" " + e4);
|
|
2343
2382
|
return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
|
|
2344
2383
|
};
|
|
2345
2384
|
}(s2) : () => [e2];
|
|
2346
|
-
return
|
|
2385
|
+
return je(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Ge(e3, t2 | We[s3]) : [e3]);
|
|
2347
2386
|
}
|
|
2348
|
-
const
|
|
2387
|
+
const ze = function() {
|
|
2349
2388
|
const e2 = function() {
|
|
2350
2389
|
try {
|
|
2351
2390
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -2361,18 +2400,18 @@ const $e = function() {
|
|
|
2361
2400
|
return e2.set(t2, n2), n2;
|
|
2362
2401
|
} };
|
|
2363
2402
|
}();
|
|
2364
|
-
function
|
|
2403
|
+
function Je(e2, t2) {
|
|
2365
2404
|
if (Array.prototype.indexOf) return e2.indexOf(t2);
|
|
2366
2405
|
for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
|
|
2367
2406
|
return -1;
|
|
2368
2407
|
}
|
|
2369
|
-
function
|
|
2408
|
+
function Ye(e2, t2) {
|
|
2370
2409
|
for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
|
|
2371
2410
|
}
|
|
2372
|
-
function
|
|
2411
|
+
function Qe(e2) {
|
|
2373
2412
|
throw new Error("Unhandled case for value: '" + e2 + "'");
|
|
2374
2413
|
}
|
|
2375
|
-
var
|
|
2414
|
+
var Ve = function() {
|
|
2376
2415
|
function e2(e3) {
|
|
2377
2416
|
void 0 === e3 && (e3 = {}), this.tagName = "", this.attrs = {}, this.innerHTML = "", this.whitespaceRegex = /\s+/, this.tagName = e3.tagName || "", this.attrs = e3.attrs || {}, this.innerHTML = e3.innerHtml || e3.innerHTML || "";
|
|
2378
2417
|
}
|
|
@@ -2391,11 +2430,11 @@ var Ge = function() {
|
|
|
2391
2430
|
}, e2.prototype.setClass = function(e3) {
|
|
2392
2431
|
return this.setAttr("class", e3);
|
|
2393
2432
|
}, e2.prototype.addClass = function(e3) {
|
|
2394
|
-
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 ===
|
|
2433
|
+
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Je(r2, t2) && r2.push(t2);
|
|
2395
2434
|
return this.getAttrs().class = r2.join(" "), this;
|
|
2396
2435
|
}, e2.prototype.removeClass = function(e3) {
|
|
2397
2436
|
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); r2.length && (t2 = i2.shift()); ) {
|
|
2398
|
-
var a2 =
|
|
2437
|
+
var a2 = Je(r2, t2);
|
|
2399
2438
|
-1 !== a2 && r2.splice(a2, 1);
|
|
2400
2439
|
}
|
|
2401
2440
|
return this.getAttrs().class = r2.join(" "), this;
|
|
@@ -2421,12 +2460,12 @@ var Ge = function() {
|
|
|
2421
2460
|
return t2.join(" ");
|
|
2422
2461
|
}, e2;
|
|
2423
2462
|
}();
|
|
2424
|
-
var
|
|
2463
|
+
var Ze = function() {
|
|
2425
2464
|
function e2(e3) {
|
|
2426
2465
|
void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
|
|
2427
2466
|
}
|
|
2428
2467
|
return e2.prototype.build = function(e3) {
|
|
2429
|
-
return new
|
|
2468
|
+
return new Ve({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
|
|
2430
2469
|
}, e2.prototype.createAttrs = function(e3) {
|
|
2431
2470
|
var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
|
|
2432
2471
|
return s2 && (t2.class = s2), this.newWindow && (t2.target = "_blank", t2.rel = "noopener noreferrer"), this.truncate && this.truncate.length && this.truncate.length < e3.getAnchorText().length && (t2.title = e3.getAnchorHref()), t2;
|
|
@@ -2496,7 +2535,7 @@ var Le = function() {
|
|
|
2496
2535
|
}(e4, t3, s3);
|
|
2497
2536
|
}(e3, s2);
|
|
2498
2537
|
}, e2;
|
|
2499
|
-
}(),
|
|
2538
|
+
}(), Ke = function() {
|
|
2500
2539
|
function e2(e3) {
|
|
2501
2540
|
this.__jsduckDummyDocProp = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
|
|
2502
2541
|
}
|
|
@@ -2511,30 +2550,30 @@ var Le = function() {
|
|
|
2511
2550
|
}, e2.prototype.buildTag = function() {
|
|
2512
2551
|
return this.tagBuilder.build(this);
|
|
2513
2552
|
}, e2;
|
|
2514
|
-
}(),
|
|
2515
|
-
return
|
|
2553
|
+
}(), Xe = function(e2, t2) {
|
|
2554
|
+
return Xe = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
|
|
2516
2555
|
e3.__proto__ = t3;
|
|
2517
2556
|
} || function(e3, t3) {
|
|
2518
2557
|
for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
|
|
2519
|
-
},
|
|
2558
|
+
}, Xe(e2, t2);
|
|
2520
2559
|
};
|
|
2521
|
-
function
|
|
2560
|
+
function et(e2, t2) {
|
|
2522
2561
|
function s2() {
|
|
2523
2562
|
this.constructor = e2;
|
|
2524
2563
|
}
|
|
2525
|
-
|
|
2564
|
+
Xe(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
|
|
2526
2565
|
}
|
|
2527
|
-
var
|
|
2528
|
-
return
|
|
2566
|
+
var tt, st = function() {
|
|
2567
|
+
return st = Object.assign || function(e2) {
|
|
2529
2568
|
for (var t2, s2 = 1, n2 = arguments.length; s2 < n2; s2++) for (var r2 in t2 = arguments[s2]) Object.prototype.hasOwnProperty.call(t2, r2) && (e2[r2] = t2[r2]);
|
|
2530
2569
|
return e2;
|
|
2531
|
-
},
|
|
2532
|
-
},
|
|
2570
|
+
}, st.apply(this, arguments);
|
|
2571
|
+
}, nt = function(e2) {
|
|
2533
2572
|
function t2(t3) {
|
|
2534
2573
|
var s2 = e2.call(this, t3) || this;
|
|
2535
2574
|
return s2.email = "", s2.email = t3.email, s2;
|
|
2536
2575
|
}
|
|
2537
|
-
return
|
|
2576
|
+
return et(t2, e2), t2.prototype.getType = function() {
|
|
2538
2577
|
return "email";
|
|
2539
2578
|
}, t2.prototype.getEmail = function() {
|
|
2540
2579
|
return this.email;
|
|
@@ -2543,12 +2582,12 @@ var Qe, Ve = function() {
|
|
|
2543
2582
|
}, t2.prototype.getAnchorText = function() {
|
|
2544
2583
|
return this.email;
|
|
2545
2584
|
}, t2;
|
|
2546
|
-
}(
|
|
2585
|
+
}(Ke), rt = function(e2) {
|
|
2547
2586
|
function t2(t3) {
|
|
2548
2587
|
var s2 = e2.call(this, t3) || this;
|
|
2549
2588
|
return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
|
|
2550
2589
|
}
|
|
2551
|
-
return
|
|
2590
|
+
return et(t2, e2), t2.prototype.getType = function() {
|
|
2552
2591
|
return "hashtag";
|
|
2553
2592
|
}, t2.prototype.getServiceName = function() {
|
|
2554
2593
|
return this.serviceName;
|
|
@@ -2569,12 +2608,12 @@ var Qe, Ve = function() {
|
|
|
2569
2608
|
}, t2.prototype.getAnchorText = function() {
|
|
2570
2609
|
return "#" + this.hashtag;
|
|
2571
2610
|
}, t2;
|
|
2572
|
-
}(
|
|
2611
|
+
}(Ke), it = function(e2) {
|
|
2573
2612
|
function t2(t3) {
|
|
2574
2613
|
var s2 = e2.call(this, t3) || this;
|
|
2575
2614
|
return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
|
|
2576
2615
|
}
|
|
2577
|
-
return
|
|
2616
|
+
return et(t2, e2), t2.prototype.getType = function() {
|
|
2578
2617
|
return "mention";
|
|
2579
2618
|
}, t2.prototype.getMention = function() {
|
|
2580
2619
|
return this.mention;
|
|
@@ -2597,12 +2636,12 @@ var Qe, Ve = function() {
|
|
|
2597
2636
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2598
2637
|
return s2 && t3.push(s2), t3;
|
|
2599
2638
|
}, t2;
|
|
2600
|
-
}(
|
|
2639
|
+
}(Ke), at = function(e2) {
|
|
2601
2640
|
function t2(t3) {
|
|
2602
2641
|
var s2 = e2.call(this, t3) || this;
|
|
2603
2642
|
return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
|
|
2604
2643
|
}
|
|
2605
|
-
return
|
|
2644
|
+
return et(t2, e2), t2.prototype.getType = function() {
|
|
2606
2645
|
return "phone";
|
|
2607
2646
|
}, t2.prototype.getPhoneNumber = function() {
|
|
2608
2647
|
return this.number;
|
|
@@ -2613,12 +2652,12 @@ var Qe, Ve = function() {
|
|
|
2613
2652
|
}, t2.prototype.getAnchorText = function() {
|
|
2614
2653
|
return this.matchedText;
|
|
2615
2654
|
}, t2;
|
|
2616
|
-
}(
|
|
2655
|
+
}(Ke), ot = function(e2) {
|
|
2617
2656
|
function t2(t3) {
|
|
2618
2657
|
var s2 = e2.call(this, t3) || this;
|
|
2619
2658
|
return s2.url = "", s2.urlMatchType = "scheme", s2.protocolUrlMatch = false, s2.protocolRelativeMatch = false, s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.schemePrefixRegex = /^(https?:\/\/)?/i, s2.wwwPrefixRegex = /^(https?:\/\/)?(www\.)?/i, s2.protocolRelativeRegex = /^\/\//, s2.protocolPrepended = false, s2.urlMatchType = t3.urlMatchType, s2.url = t3.url, s2.protocolUrlMatch = t3.protocolUrlMatch, s2.protocolRelativeMatch = t3.protocolRelativeMatch, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2620
2659
|
}
|
|
2621
|
-
return
|
|
2660
|
+
return et(t2, e2), t2.prototype.getType = function() {
|
|
2622
2661
|
return "url";
|
|
2623
2662
|
}, t2.prototype.getUrlMatchType = function() {
|
|
2624
2663
|
return this.urlMatchType;
|
|
@@ -2646,19 +2685,19 @@ var Qe, Ve = function() {
|
|
|
2646
2685
|
return t3;
|
|
2647
2686
|
}
|
|
2648
2687
|
}, t2;
|
|
2649
|
-
}(
|
|
2688
|
+
}(Ke), ut = function(e2) {
|
|
2650
2689
|
this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
|
|
2651
|
-
},
|
|
2652
|
-
return "(?=(" +
|
|
2653
|
-
},
|
|
2654
|
-
return "(?:" +
|
|
2655
|
-
}, wt = new RegExp("[" + pt + "]"), bt = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, yt = new RegExp("[" + pt + "!#$%&'*+/=?^_`{|}~-]"), Ct = new RegExp("^" + bt.source + "$"), At = function(e2) {
|
|
2690
|
+
}, 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) {
|
|
2691
|
+
return "(?=(" + Ct + "))\\" + e2;
|
|
2692
|
+
}, Et = function(e2) {
|
|
2693
|
+
return "(?:" + At(e2) + "(?:\\." + At(e2 + 1) + "){0,126}|" + yt + ")";
|
|
2694
|
+
}, 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) {
|
|
2656
2695
|
function t2() {
|
|
2657
2696
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2658
|
-
return t3.localPartCharRegex =
|
|
2697
|
+
return t3.localPartCharRegex = It, t3.strictTldRegex = Tt, t3;
|
|
2659
2698
|
}
|
|
2660
|
-
return
|
|
2661
|
-
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new
|
|
2699
|
+
return et(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2700
|
+
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; ) {
|
|
2662
2701
|
var h2 = e3.charAt(u2);
|
|
2663
2702
|
switch (c2) {
|
|
2664
2703
|
case 0:
|
|
@@ -2686,7 +2725,7 @@ var Qe, Ve = function() {
|
|
|
2686
2725
|
b2(h2);
|
|
2687
2726
|
break;
|
|
2688
2727
|
default:
|
|
2689
|
-
|
|
2728
|
+
Qe(c2);
|
|
2690
2729
|
}
|
|
2691
2730
|
u2++;
|
|
2692
2731
|
}
|
|
@@ -2695,7 +2734,7 @@ var Qe, Ve = function() {
|
|
|
2695
2734
|
"m" === e4 ? y2(1) : s2.test(e4) && y2();
|
|
2696
2735
|
}
|
|
2697
2736
|
function p2(e4, t4) {
|
|
2698
|
-
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new
|
|
2737
|
+
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new St(st(st({}, l2), { hasMailtoPrefix: true }))) : C2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : C2());
|
|
2699
2738
|
}
|
|
2700
2739
|
function f2(e4) {
|
|
2701
2740
|
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || C2();
|
|
@@ -2704,19 +2743,19 @@ var Qe, Ve = function() {
|
|
|
2704
2743
|
"." === e4 || "@" === e4 ? C2() : s2.test(e4) ? c2 = 2 : C2();
|
|
2705
2744
|
}
|
|
2706
2745
|
function g2(e4) {
|
|
2707
|
-
|
|
2746
|
+
kt.test(e4) ? c2 = 5 : C2();
|
|
2708
2747
|
}
|
|
2709
2748
|
function v2(e4) {
|
|
2710
|
-
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 :
|
|
2749
|
+
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : kt.test(e4) || A2();
|
|
2711
2750
|
}
|
|
2712
2751
|
function w2(e4) {
|
|
2713
|
-
"-" === e4 || "." === e4 ? A2() :
|
|
2752
|
+
"-" === e4 || "." === e4 ? A2() : kt.test(e4) ? c2 = 5 : A2();
|
|
2714
2753
|
}
|
|
2715
2754
|
function b2(e4) {
|
|
2716
|
-
"." === e4 || "-" === e4 ? A2() :
|
|
2755
|
+
"." === e4 || "-" === e4 ? A2() : kt.test(e4) ? (c2 = 5, l2 = new St(st(st({}, l2), { hasDomainDot: true }))) : A2();
|
|
2717
2756
|
}
|
|
2718
2757
|
function y2(e4) {
|
|
2719
|
-
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new
|
|
2758
|
+
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new St({ idx: u2 });
|
|
2720
2759
|
}
|
|
2721
2760
|
function C2() {
|
|
2722
2761
|
c2 = 0, l2 = a2;
|
|
@@ -2729,14 +2768,14 @@ var Qe, Ve = function() {
|
|
|
2729
2768
|
(function(e4) {
|
|
2730
2769
|
var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
|
|
2731
2770
|
return n2.test(s4);
|
|
2732
|
-
})(i3) && r2.push(new
|
|
2771
|
+
})(i3) && r2.push(new nt({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
|
|
2733
2772
|
}
|
|
2734
2773
|
C2();
|
|
2735
2774
|
}
|
|
2736
2775
|
}, t2;
|
|
2737
|
-
}(
|
|
2776
|
+
}(ut), St = function(e2) {
|
|
2738
2777
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
|
|
2739
|
-
},
|
|
2778
|
+
}, Mt = function() {
|
|
2740
2779
|
function e2() {
|
|
2741
2780
|
}
|
|
2742
2781
|
return e2.isValid = function(e3, t2) {
|
|
@@ -2754,16 +2793,16 @@ var Qe, Ve = function() {
|
|
|
2754
2793
|
return !(!e3 || t2 && this.hasFullProtocolRegex.test(t2) || -1 !== e3.indexOf("."));
|
|
2755
2794
|
}, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
|
|
2756
2795
|
return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
|
|
2757
|
-
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" +
|
|
2758
|
-
}(),
|
|
2796
|
+
}, 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;
|
|
2797
|
+
}(), 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) {
|
|
2759
2798
|
function t2(t3) {
|
|
2760
2799
|
var s2 = e2.call(this, t3) || this;
|
|
2761
|
-
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex =
|
|
2800
|
+
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = Ft, s2.wordCharRegExp = Bt, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2762
2801
|
}
|
|
2763
|
-
return
|
|
2802
|
+
return et(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2764
2803
|
for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
|
|
2765
2804
|
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);
|
|
2766
|
-
if (!
|
|
2805
|
+
if (!Mt.isValid(s3, u3)) return "continue";
|
|
2767
2806
|
if (p2 > 0 && "@" === m2) return "continue";
|
|
2768
2807
|
if (p2 > 0 && f2 && c2.wordCharRegExp.test(m2)) return "continue";
|
|
2769
2808
|
if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
|
|
@@ -2779,7 +2818,7 @@ var Qe, Ve = function() {
|
|
|
2779
2818
|
s3 = s3.substr(w2), u3 = u3.substr(w2), p2 += w2;
|
|
2780
2819
|
}
|
|
2781
2820
|
var b2 = u3 ? "scheme" : l2 ? "www" : "tld", y2 = !!u3;
|
|
2782
|
-
o2.push(new
|
|
2821
|
+
o2.push(new ot({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: b2, url: s3, protocolUrlMatch: y2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
|
|
2783
2822
|
}, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
|
|
2784
2823
|
return o2;
|
|
2785
2824
|
}, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
|
|
@@ -2799,58 +2838,58 @@ var Qe, Ve = function() {
|
|
|
2799
2838
|
if (!e3) return -1;
|
|
2800
2839
|
var s2 = 0;
|
|
2801
2840
|
t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
|
|
2802
|
-
var n2 = new RegExp("^((.?//)?[-." +
|
|
2841
|
+
var n2 = new RegExp("^((.?//)?[-." + bt + "]*[-" + bt + "]\\.[-" + bt + "]+)").exec(e3);
|
|
2803
2842
|
return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
|
|
2804
2843
|
}, t2;
|
|
2805
|
-
}(
|
|
2844
|
+
}(ut), Nt = new RegExp("#[_" + bt + "]{1,139}(?![_" + bt + "])", "g"), _t = new RegExp("[^" + bt + "]"), Pt = function(e2) {
|
|
2806
2845
|
function t2(t3) {
|
|
2807
2846
|
var s2 = e2.call(this, t3) || this;
|
|
2808
|
-
return s2.serviceName = "twitter", s2.matcherRegex =
|
|
2847
|
+
return s2.serviceName = "twitter", s2.matcherRegex = Nt, s2.nonWordCharRegex = _t, s2.serviceName = t3.serviceName, s2;
|
|
2809
2848
|
}
|
|
2810
|
-
return
|
|
2849
|
+
return et(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2811
2850
|
for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2812
2851
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2813
2852
|
if (0 === o2 || n2.test(u2)) {
|
|
2814
2853
|
var c2 = t3[0], l2 = t3[0].slice(1);
|
|
2815
|
-
a2.push(new
|
|
2854
|
+
a2.push(new rt({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
|
|
2816
2855
|
}
|
|
2817
2856
|
}
|
|
2818
2857
|
return a2;
|
|
2819
2858
|
}, t2;
|
|
2820
|
-
}(
|
|
2859
|
+
}(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) {
|
|
2821
2860
|
function t2() {
|
|
2822
2861
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2823
|
-
return t3.matcherRegex =
|
|
2862
|
+
return t3.matcherRegex = Ot, t3;
|
|
2824
2863
|
}
|
|
2825
|
-
return
|
|
2864
|
+
return et(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2826
2865
|
for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2827
2866
|
var i2 = t3[0], a2 = i2.replace(/[^0-9,;#]/g, ""), o2 = !(!t3[1] && !t3[2]), u2 = 0 == t3.index ? "" : e3.substr(t3.index - 1, 1), c2 = e3.substr(t3.index + i2.length, 1), l2 = !u2.match(/\d/) && !c2.match(/\d/);
|
|
2828
|
-
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new
|
|
2867
|
+
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new at({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
|
|
2829
2868
|
}
|
|
2830
2869
|
return r2;
|
|
2831
2870
|
}, t2.prototype.testMatch = function(e3) {
|
|
2832
|
-
return
|
|
2871
|
+
return ht.test(e3);
|
|
2833
2872
|
}, t2;
|
|
2834
|
-
}(
|
|
2873
|
+
}(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) {
|
|
2835
2874
|
function t2(t3) {
|
|
2836
2875
|
var s2 = e2.call(this, t3) || this;
|
|
2837
|
-
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter:
|
|
2876
|
+
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: Ut, instagram: $t, soundcloud: Wt }, s2.nonWordCharRegex = qt, s2.serviceName = t3.serviceName, s2;
|
|
2838
2877
|
}
|
|
2839
|
-
return
|
|
2878
|
+
return et(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2840
2879
|
var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
|
|
2841
2880
|
if (!n2) return a2;
|
|
2842
2881
|
for (; null !== (t3 = n2.exec(e3)); ) {
|
|
2843
2882
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2844
2883
|
if (0 === o2 || r2.test(u2)) {
|
|
2845
2884
|
var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
|
|
2846
|
-
a2.push(new
|
|
2885
|
+
a2.push(new it({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
|
|
2847
2886
|
}
|
|
2848
2887
|
}
|
|
2849
2888
|
return a2;
|
|
2850
2889
|
}, t2;
|
|
2851
|
-
}(
|
|
2852
|
-
function
|
|
2853
|
-
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new
|
|
2890
|
+
}(ut);
|
|
2891
|
+
function Lt(e2, t2) {
|
|
2892
|
+
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new Gt(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
|
|
2854
2893
|
var f2 = e2.charAt(c2);
|
|
2855
2894
|
switch (h2) {
|
|
2856
2895
|
case 0:
|
|
@@ -2890,13 +2929,13 @@ function Ut(e2, t2) {
|
|
|
2890
2929
|
I2(f2);
|
|
2891
2930
|
break;
|
|
2892
2931
|
case 12:
|
|
2893
|
-
|
|
2932
|
+
T2(f2);
|
|
2894
2933
|
break;
|
|
2895
2934
|
case 13:
|
|
2896
|
-
|
|
2935
|
+
D2();
|
|
2897
2936
|
break;
|
|
2898
2937
|
case 14:
|
|
2899
|
-
|
|
2938
|
+
S2(f2);
|
|
2900
2939
|
break;
|
|
2901
2940
|
case 15:
|
|
2902
2941
|
M2(f2);
|
|
@@ -2917,7 +2956,7 @@ function Ut(e2, t2) {
|
|
|
2917
2956
|
_2(f2);
|
|
2918
2957
|
break;
|
|
2919
2958
|
default:
|
|
2920
|
-
|
|
2959
|
+
Qe(h2);
|
|
2921
2960
|
}
|
|
2922
2961
|
c2++;
|
|
2923
2962
|
}
|
|
@@ -2925,25 +2964,25 @@ function Ut(e2, t2) {
|
|
|
2925
2964
|
"<" === e3 && O2();
|
|
2926
2965
|
}
|
|
2927
2966
|
function g2(e3) {
|
|
2928
|
-
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new
|
|
2967
|
+
"!" === 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);
|
|
2929
2968
|
}
|
|
2930
2969
|
function v2(e3) {
|
|
2931
|
-
|
|
2970
|
+
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();
|
|
2932
2971
|
}
|
|
2933
2972
|
function w2(e3) {
|
|
2934
|
-
">" === e3 ? P2() :
|
|
2973
|
+
">" === e3 ? P2() : ct.test(e3) ? h2 = 3 : P2();
|
|
2935
2974
|
}
|
|
2936
2975
|
function b2(e3) {
|
|
2937
|
-
|
|
2976
|
+
dt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? O2() : "=" === e3 || pt.test(e3) || ft.test(e3) ? P2() : h2 = 5);
|
|
2938
2977
|
}
|
|
2939
2978
|
function y2(e3) {
|
|
2940
|
-
|
|
2979
|
+
dt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? O2() : pt.test(e3) && P2();
|
|
2941
2980
|
}
|
|
2942
2981
|
function C2(e3) {
|
|
2943
|
-
|
|
2982
|
+
dt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? O2() : pt.test(e3) ? P2() : h2 = 5);
|
|
2944
2983
|
}
|
|
2945
2984
|
function A2(e3) {
|
|
2946
|
-
|
|
2985
|
+
dt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? P2() : "<" === e3 ? O2() : h2 = 10);
|
|
2947
2986
|
}
|
|
2948
2987
|
function E2(e3) {
|
|
2949
2988
|
'"' === e3 && (h2 = 11);
|
|
@@ -2952,18 +2991,18 @@ function Ut(e2, t2) {
|
|
|
2952
2991
|
"'" === e3 && (h2 = 11);
|
|
2953
2992
|
}
|
|
2954
2993
|
function x2(e3) {
|
|
2955
|
-
|
|
2994
|
+
dt.test(e3) ? h2 = 4 : ">" === e3 ? j2() : "<" === e3 && O2();
|
|
2956
2995
|
}
|
|
2957
2996
|
function I2(e3) {
|
|
2958
|
-
|
|
2997
|
+
dt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? O2() : (h2 = 4, c2--);
|
|
2959
2998
|
}
|
|
2960
|
-
function
|
|
2961
|
-
">" === e3 ? (p2 = new
|
|
2999
|
+
function T2(e3) {
|
|
3000
|
+
">" === e3 ? (p2 = new Gt(st(st({}, p2), { isClosing: true })), j2()) : h2 = 4;
|
|
2962
3001
|
}
|
|
2963
|
-
function
|
|
2964
|
-
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new
|
|
3002
|
+
function D2(t3) {
|
|
3003
|
+
"--" === 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();
|
|
2965
3004
|
}
|
|
2966
|
-
function
|
|
3005
|
+
function S2(e3) {
|
|
2967
3006
|
"-" === e3 ? h2 = 15 : ">" === e3 ? P2() : h2 = 16;
|
|
2968
3007
|
}
|
|
2969
3008
|
function M2(e3) {
|
|
@@ -2976,33 +3015,33 @@ function Ut(e2, t2) {
|
|
|
2976
3015
|
h2 = "-" === e3 ? 18 : 16;
|
|
2977
3016
|
}
|
|
2978
3017
|
function R2(e3) {
|
|
2979
|
-
">" === e3 ?
|
|
3018
|
+
">" === e3 ? j2() : "!" === e3 ? h2 = 19 : "-" === e3 || (h2 = 16);
|
|
2980
3019
|
}
|
|
2981
3020
|
function N2(e3) {
|
|
2982
|
-
"-" === e3 ? h2 = 17 : ">" === e3 ?
|
|
3021
|
+
"-" === e3 ? h2 = 17 : ">" === e3 ? j2() : h2 = 16;
|
|
2983
3022
|
}
|
|
2984
3023
|
function _2(e3) {
|
|
2985
|
-
">" === e3 ?
|
|
3024
|
+
">" === e3 ? j2() : "<" === e3 && O2();
|
|
2986
3025
|
}
|
|
2987
3026
|
function P2() {
|
|
2988
3027
|
h2 = 0, p2 = u2;
|
|
2989
3028
|
}
|
|
2990
3029
|
function O2() {
|
|
2991
|
-
h2 = 1, p2 = new
|
|
3030
|
+
h2 = 1, p2 = new Gt({ idx: c2 });
|
|
2992
3031
|
}
|
|
2993
|
-
function
|
|
3032
|
+
function j2() {
|
|
2994
3033
|
var t3 = e2.slice(d2, p2.idx);
|
|
2995
3034
|
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;
|
|
2996
3035
|
}
|
|
2997
|
-
function
|
|
3036
|
+
function U2() {
|
|
2998
3037
|
var t3 = p2.idx + (p2.isClosing ? 2 : 1);
|
|
2999
3038
|
return e2.slice(t3, c2).toLowerCase();
|
|
3000
3039
|
}
|
|
3001
3040
|
d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
|
|
3002
3041
|
}
|
|
3003
|
-
var
|
|
3042
|
+
var Gt = function(e2) {
|
|
3004
3043
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.type = e2.type || "tag", this.name = e2.name || "", this.isOpening = !!e2.isOpening, this.isClosing = !!e2.isClosing;
|
|
3005
|
-
},
|
|
3044
|
+
}, zt = function() {
|
|
3006
3045
|
function e2(t2) {
|
|
3007
3046
|
void 0 === t2 && (t2 = {}), this.version = e2.version, this.urls = {}, this.email = true, this.phone = true, this.hashtag = false, this.mention = false, this.newWindow = true, this.stripPrefix = { scheme: true, www: true }, this.stripTrailingSlash = true, this.decodePercentEncoding = true, this.truncate = { length: 0, location: "end" }, this.className = "", this.replaceFn = null, this.context = void 0, this.sanitizeHtml = false, this.matchers = null, this.tagBuilder = null, this.urls = this.normalizeUrlsCfg(t2.urls), this.email = "boolean" == typeof t2.email ? t2.email : this.email, this.phone = "boolean" == typeof t2.phone ? t2.phone : this.phone, this.hashtag = t2.hashtag || this.hashtag, this.mention = t2.mention || this.mention, this.newWindow = "boolean" == typeof t2.newWindow ? t2.newWindow : this.newWindow, this.stripPrefix = this.normalizeStripPrefixCfg(t2.stripPrefix), this.stripTrailingSlash = "boolean" == typeof t2.stripTrailingSlash ? t2.stripTrailingSlash : this.stripTrailingSlash, this.decodePercentEncoding = "boolean" == typeof t2.decodePercentEncoding ? t2.decodePercentEncoding : this.decodePercentEncoding, this.sanitizeHtml = t2.sanitizeHtml || false;
|
|
3008
3047
|
var s2 = this.mention;
|
|
@@ -3026,7 +3065,7 @@ var jt = function(e2) {
|
|
|
3026
3065
|
}(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
|
|
3027
3066
|
}, e2.prototype.parse = function(e3) {
|
|
3028
3067
|
var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
|
|
3029
|
-
return
|
|
3068
|
+
return Lt(e3, { onOpenTag: function(e4) {
|
|
3030
3069
|
s2.indexOf(e4) >= 0 && n2++;
|
|
3031
3070
|
}, onText: function(e4, s3) {
|
|
3032
3071
|
if (0 === n2) {
|
|
@@ -3065,19 +3104,19 @@ var jt = function(e2) {
|
|
|
3065
3104
|
}
|
|
3066
3105
|
return e3;
|
|
3067
3106
|
}, e2.prototype.removeUnwantedMatches = function(e3) {
|
|
3068
|
-
return this.hashtag ||
|
|
3107
|
+
return this.hashtag || Ye(e3, function(e4) {
|
|
3069
3108
|
return "hashtag" === e4.getType();
|
|
3070
|
-
}), this.email ||
|
|
3109
|
+
}), this.email || Ye(e3, function(e4) {
|
|
3071
3110
|
return "email" === e4.getType();
|
|
3072
|
-
}), this.phone ||
|
|
3111
|
+
}), this.phone || Ye(e3, function(e4) {
|
|
3073
3112
|
return "phone" === e4.getType();
|
|
3074
|
-
}), this.mention ||
|
|
3113
|
+
}), this.mention || Ye(e3, function(e4) {
|
|
3075
3114
|
return "mention" === e4.getType();
|
|
3076
|
-
}), this.urls.schemeMatches ||
|
|
3115
|
+
}), this.urls.schemeMatches || Ye(e3, function(e4) {
|
|
3077
3116
|
return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
|
|
3078
|
-
}), this.urls.wwwMatches ||
|
|
3117
|
+
}), this.urls.wwwMatches || Ye(e3, function(e4) {
|
|
3079
3118
|
return "url" === e4.getType() && "www" === e4.getUrlMatchType();
|
|
3080
|
-
}), this.urls.tldMatches ||
|
|
3119
|
+
}), this.urls.tldMatches || Ye(e3, function(e4) {
|
|
3081
3120
|
return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
|
|
3082
3121
|
}), e3;
|
|
3083
3122
|
}, e2.prototype.parseText = function(e3, t2) {
|
|
@@ -3097,102 +3136,107 @@ var jt = function(e2) {
|
|
|
3097
3136
|
return s2.push(e3.substring(n2)), s2.join("");
|
|
3098
3137
|
}, e2.prototype.createMatchReturnVal = function(e3) {
|
|
3099
3138
|
var t2;
|
|
3100
|
-
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof
|
|
3139
|
+
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();
|
|
3101
3140
|
}, e2.prototype.getMatchers = function() {
|
|
3102
3141
|
if (this.matchers) return this.matchers;
|
|
3103
|
-
var e3 = this.getTagBuilder(), t2 = [new
|
|
3142
|
+
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 })];
|
|
3104
3143
|
return this.matchers = t2;
|
|
3105
3144
|
}, e2.prototype.getTagBuilder = function() {
|
|
3106
3145
|
var e3 = this.tagBuilder;
|
|
3107
|
-
return e3 || (e3 = this.tagBuilder = new
|
|
3108
|
-
}, e2.version = "3.14.3", e2.AnchorTagBuilder =
|
|
3146
|
+
return e3 || (e3 = this.tagBuilder = new Ze({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
|
|
3147
|
+
}, 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;
|
|
3109
3148
|
}();
|
|
3110
|
-
function
|
|
3149
|
+
function Jt(e2, t2 = e2) {
|
|
3111
3150
|
return { type: "autolink", url: e2, text: t2 };
|
|
3112
3151
|
}
|
|
3113
|
-
const
|
|
3152
|
+
const Yt = Ue(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
3114
3153
|
return { type: "mention", id: e3, text: t3 };
|
|
3115
|
-
}(decodeURIComponent(t2), s2)),
|
|
3154
|
+
}(decodeURIComponent(t2), s2)), Qt = Ue(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
|
|
3116
3155
|
return { type: "customemoji", text: e3 };
|
|
3117
|
-
}(t2)),
|
|
3156
|
+
}(t2)), Vt = Ue(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
|
|
3118
3157
|
return { type: "link", url: e3, children: t3 };
|
|
3119
|
-
}(t2, [s2])),
|
|
3120
|
-
const { action: n2, params: r2 } =
|
|
3158
|
+
}(t2, [s2])), Zt = Ue(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3159
|
+
const { action: n2, params: r2 } = Xt(t2);
|
|
3121
3160
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
3122
3161
|
return { type: "actionlink", action: e3, params: t3, children: s3 };
|
|
3123
3162
|
}(n2, r2, [s2]);
|
|
3124
|
-
}),
|
|
3125
|
-
const { action: n2, params: r2 } =
|
|
3163
|
+
}), Kt = Ue(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3164
|
+
const { action: n2, params: r2 } = Xt(t2);
|
|
3126
3165
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
3127
3166
|
return { type: "actionbutton", action: e3, params: t3, children: s3 };
|
|
3128
3167
|
}(n2, r2, [s2]);
|
|
3129
3168
|
});
|
|
3130
|
-
function
|
|
3169
|
+
function Xt(e2) {
|
|
3131
3170
|
const t2 = e2.indexOf("?");
|
|
3132
3171
|
if (-1 === t2) return { action: e2, params: {} };
|
|
3133
3172
|
return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
|
|
3134
3173
|
}
|
|
3135
|
-
const
|
|
3174
|
+
const es = Ue(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
|
|
3136
3175
|
return { type: "bulletlist", children: e3 };
|
|
3137
|
-
}([e2.startsWith("\n") ? e2.slice(1) : e2])),
|
|
3176
|
+
}([e2.startsWith("\n") ? e2.slice(1) : e2])), ts = Ue(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), ss = (e2) => {
|
|
3138
3177
|
const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
|
|
3139
3178
|
let s2 = 0;
|
|
3140
3179
|
const n2 = [];
|
|
3141
|
-
for (const r2 of
|
|
3180
|
+
for (const r2 of V(e2, t2)) {
|
|
3142
3181
|
const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
|
|
3143
3182
|
a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
|
|
3144
|
-
const o2 =
|
|
3183
|
+
const o2 = Jt("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
|
|
3145
3184
|
n2.push(o2), s2 = a2 + i2.length;
|
|
3146
3185
|
}
|
|
3147
3186
|
return s2 < e2.length && n2.push(e2.substring(s2)), n2;
|
|
3148
|
-
},
|
|
3149
|
-
const t2 =
|
|
3187
|
+
}, ns = (e2) => Vt(e2).flatMap((e3) => "string" == typeof e3 ? rs(e3) : ["<", ...rs(e3.url), ...rs("|" + e3.children[0] + ">")]), rs = (e2) => {
|
|
3188
|
+
const t2 = zt.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
|
|
3150
3189
|
let n2 = 0;
|
|
3151
3190
|
for (const r2 of t2) {
|
|
3152
3191
|
const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
|
|
3153
3192
|
let o2 = i2;
|
|
3154
|
-
r2 instanceof
|
|
3193
|
+
r2 instanceof nt ? o2 = "mailto:" + r2.getEmail() : r2 instanceof ot && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Jt(o2, i2)), n2 = t3 + a2;
|
|
3155
3194
|
}
|
|
3156
3195
|
return n2 < e2.length && s2.push(e2.substring(n2)), s2;
|
|
3157
|
-
},
|
|
3158
|
-
function
|
|
3196
|
+
}, is = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
|
|
3197
|
+
function as(e2 = { except: [] }) {
|
|
3159
3198
|
var _a2;
|
|
3160
|
-
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 :
|
|
3161
|
-
return s2.includes("BulletPoint") || t2.multilineSteps.push(
|
|
3199
|
+
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : is.filter((t3) => !e2.only.includes(t3));
|
|
3200
|
+
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;
|
|
3162
3201
|
}
|
|
3163
|
-
const
|
|
3202
|
+
const os = function(e2) {
|
|
3164
3203
|
const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
|
|
3165
3204
|
return (e3) => Array.from(e3.match(t2) || []);
|
|
3166
3205
|
}("\n");
|
|
3167
|
-
function
|
|
3206
|
+
function us(e2, t2 = { except: [] }) {
|
|
3168
3207
|
let s2 = function(e3, t3) {
|
|
3169
3208
|
let s3 = [e3];
|
|
3170
|
-
return s3 =
|
|
3171
|
-
}(e2,
|
|
3172
|
-
return s2 =
|
|
3209
|
+
return s3 = ls(s3, t3.multilineSteps), s3 = ls(s3, [os]), s3 = ls(s3, t3.singlelineSteps), s3 = hs(s3), s3;
|
|
3210
|
+
}(e2, as(t2));
|
|
3211
|
+
return s2 = ds(s2, false), s2;
|
|
3173
3212
|
}
|
|
3174
|
-
function
|
|
3175
|
-
return
|
|
3213
|
+
function cs(e2) {
|
|
3214
|
+
return us(e2, { except: ["FormattedLink", "Actions"] });
|
|
3176
3215
|
}
|
|
3177
|
-
function
|
|
3178
|
-
return t2.reduce((e3, t3) =>
|
|
3216
|
+
function ls(e2, t2) {
|
|
3217
|
+
return t2.reduce((e3, t3) => je(e3, t3), e2);
|
|
3179
3218
|
}
|
|
3180
|
-
function
|
|
3219
|
+
function hs(e2) {
|
|
3181
3220
|
const t2 = [];
|
|
3182
3221
|
let s2 = -1;
|
|
3183
|
-
for (const n2 of e2) "string" == typeof n2 ? "string" == typeof t2[s2] ? t2[s2] += n2 : t2[++s2] = n2 : t2[++s2] = "children" in n2 ? __spreadProps(__spreadValues({}, n2), { children:
|
|
3222
|
+
for (const n2 of e2) "string" == typeof n2 ? "string" == typeof t2[s2] ? t2[s2] += n2 : t2[++s2] = n2 : t2[++s2] = "children" in n2 ? __spreadProps(__spreadValues({}, n2), { children: hs(n2.children) }) : n2;
|
|
3184
3223
|
return t2;
|
|
3185
3224
|
}
|
|
3186
|
-
function
|
|
3225
|
+
function ds(e2, t2) {
|
|
3187
3226
|
const s2 = [];
|
|
3188
3227
|
let n2 = [];
|
|
3189
3228
|
for (let r2 = 0; r2 < e2.length; r2++) {
|
|
3190
3229
|
const i2 = e2[r2];
|
|
3191
|
-
"string" == typeof i2
|
|
3230
|
+
if ("string" == typeof i2) n2.push(i2);
|
|
3231
|
+
else if ("children" in i2) {
|
|
3232
|
+
n2.length > 0 && (s2.push(n2.join("")), n2 = []);
|
|
3233
|
+
const e3 = ds(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type);
|
|
3234
|
+
s2.push(__spreadProps(__spreadValues({}, i2), { children: e3 }));
|
|
3235
|
+
} else "autolink" === i2.type && t2 ? n2.push(i2.text) : (n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2.push(i2));
|
|
3192
3236
|
}
|
|
3193
3237
|
return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
|
|
3194
3238
|
}
|
|
3195
|
-
class
|
|
3239
|
+
class ps {
|
|
3196
3240
|
constructor(e2, t2, s2, n2) {
|
|
3197
3241
|
this.emoji = e2, this.messageId = t2, this.conversationId = s2, this._realtimeClient = n2;
|
|
3198
3242
|
}
|
|
@@ -3215,7 +3259,7 @@ class os {
|
|
|
3215
3259
|
});
|
|
3216
3260
|
}
|
|
3217
3261
|
}
|
|
3218
|
-
class
|
|
3262
|
+
class fs {
|
|
3219
3263
|
constructor(e2, t2, s2) {
|
|
3220
3264
|
this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
3221
3265
|
}
|
|
@@ -3228,20 +3272,20 @@ class us {
|
|
|
3228
3272
|
reaction(e2) {
|
|
3229
3273
|
if ("string" != typeof e2) throw new Error(`Creating ReactionRef failed because emoji "${e2}" is not a string`);
|
|
3230
3274
|
if ("" === e2) throw new Error(`Creating ReactionRef failed because emoji "${e2}" is an empty string`);
|
|
3231
|
-
return new
|
|
3275
|
+
return new ps(e2, this.brandedId, this.brandedConversationId, this._realtimeClient);
|
|
3232
3276
|
}
|
|
3233
3277
|
get() {
|
|
3234
3278
|
return __async(this, null, function* () {
|
|
3235
3279
|
const t2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedConversationId, "messages", this.brandedId], {});
|
|
3236
3280
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
|
|
3237
3281
|
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
|
|
3238
|
-
const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.
|
|
3239
|
-
return
|
|
3282
|
+
const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.hydrateMessageData(s2, this.brandedConversationId);
|
|
3283
|
+
return Ne("Get message " + this.id, n2);
|
|
3240
3284
|
});
|
|
3241
3285
|
}
|
|
3242
3286
|
edit(t2) {
|
|
3243
3287
|
return __async(this, null, function* () {
|
|
3244
|
-
const s2 = { content:
|
|
3288
|
+
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);
|
|
3245
3289
|
e(`Edit message ${this.id} in conversation ${this.conversationId}`, n2);
|
|
3246
3290
|
});
|
|
3247
3291
|
}
|
|
@@ -3252,16 +3296,16 @@ class us {
|
|
|
3252
3296
|
});
|
|
3253
3297
|
}
|
|
3254
3298
|
}
|
|
3255
|
-
function
|
|
3299
|
+
function ms(e2) {
|
|
3256
3300
|
if ("string" == typeof e2) {
|
|
3257
|
-
return [{ type: "text", children:
|
|
3301
|
+
return [{ type: "text", children: us(e2) }];
|
|
3258
3302
|
}
|
|
3259
3303
|
if ("text" in e2 && e2.text) {
|
|
3260
|
-
return [{ type: "text", children:
|
|
3304
|
+
return [{ type: "text", children: us(e2.text) }];
|
|
3261
3305
|
}
|
|
3262
3306
|
if ("content" in e2 && e2.content) return e2.content;
|
|
3263
3307
|
}
|
|
3264
|
-
class
|
|
3308
|
+
class gs {
|
|
3265
3309
|
constructor(e2, t2) {
|
|
3266
3310
|
this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
|
|
3267
3311
|
}
|
|
@@ -3274,22 +3318,24 @@ class ls {
|
|
|
3274
3318
|
participant(e2) {
|
|
3275
3319
|
if ("string" == typeof e2) {
|
|
3276
3320
|
if ("" === e2) throw new Error(`Creating ParticipantRef failed because ID "${e2}" is an empty string`);
|
|
3277
|
-
return new
|
|
3321
|
+
return new Pe(e2, this.id, this._realtimeClient);
|
|
3278
3322
|
}
|
|
3279
|
-
if ("brandedId" in e2) return new
|
|
3323
|
+
if ("brandedId" in e2) return new Pe(e2.id, this.id, this._realtimeClient);
|
|
3280
3324
|
throw new Error(`Creating ParticipantRef failed because user "${e2}" is not a string or a UserRef`);
|
|
3281
3325
|
}
|
|
3282
3326
|
message(e2) {
|
|
3283
3327
|
if ("string" != typeof e2) throw new Error(`Creating MessageRef failed because ID "${e2}" is not a string`);
|
|
3284
3328
|
if ("" === e2) throw new Error(`Creating MessageRef failed because ID "${e2}" is an empty string`);
|
|
3285
|
-
return new
|
|
3329
|
+
return new fs(e2, this.brandedId, this._realtimeClient);
|
|
3286
3330
|
}
|
|
3287
3331
|
get() {
|
|
3288
3332
|
return __async(this, null, function* () {
|
|
3289
3333
|
const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
|
|
3290
3334
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
|
|
3291
|
-
const n2 = e("Get conversation " + this.id, s2), r2 =
|
|
3292
|
-
return
|
|
3335
|
+
const n2 = e("Get conversation " + this.id, s2), r2 = Ne("Get last message in conversation " + this.id, yield t2);
|
|
3336
|
+
return function(e2, t3) {
|
|
3337
|
+
return _({ id: e2.id, subject: e2.subject, photoUrl: e2.photoUrl, welcomeMessages: _(e2.welcomeMessages), custom: _(e2.custom), createdAt: e2.createdAt, joinedAt: e2.joinedAt, lastMessageAt: e2.lastMessageAt, unreadMessageCount: e2.unreadMessageCount, isUnread: e2.isUnread, access: e2.access, notify: e2.notify, lastMessage: t3, readUntil: e2.readUntil, everyoneReadUntil: e2.everyoneReadUntil });
|
|
3338
|
+
}(n2, 0 === r2.length ? null : r2[0]);
|
|
3293
3339
|
});
|
|
3294
3340
|
}
|
|
3295
3341
|
set(t2) {
|
|
@@ -3331,8 +3377,8 @@ class ls {
|
|
|
3331
3377
|
}
|
|
3332
3378
|
send(t2) {
|
|
3333
3379
|
return __async(this, null, function* () {
|
|
3334
|
-
const s2 = { content:
|
|
3335
|
-
return new
|
|
3380
|
+
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);
|
|
3381
|
+
return new fs(r2.id, this.brandedId, this._realtimeClient);
|
|
3336
3382
|
});
|
|
3337
3383
|
}
|
|
3338
3384
|
subscribeMessages(e2) {
|
|
@@ -3354,21 +3400,21 @@ class ls {
|
|
|
3354
3400
|
});
|
|
3355
3401
|
}
|
|
3356
3402
|
}
|
|
3357
|
-
function
|
|
3403
|
+
function vs(e2) {
|
|
3358
3404
|
if ("string" == typeof e2) {
|
|
3359
|
-
return [{ type: "text", children:
|
|
3405
|
+
return [{ type: "text", children: cs(e2) }];
|
|
3360
3406
|
}
|
|
3361
3407
|
if ("text" in e2) {
|
|
3362
|
-
return [{ type: "text", children:
|
|
3408
|
+
return [{ type: "text", children: cs(e2.text) }];
|
|
3363
3409
|
}
|
|
3364
3410
|
return e2.content;
|
|
3365
3411
|
}
|
|
3366
|
-
function
|
|
3412
|
+
function ws(e2) {
|
|
3367
3413
|
if ("string" == typeof e2) return;
|
|
3368
3414
|
const t2 = e2.referencedMessage;
|
|
3369
3415
|
return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
|
|
3370
3416
|
}
|
|
3371
|
-
class
|
|
3417
|
+
class bs {
|
|
3372
3418
|
constructor(e2, t2, s2) {
|
|
3373
3419
|
this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
|
|
3374
3420
|
}
|
|
@@ -3380,23 +3426,28 @@ class ps {
|
|
|
3380
3426
|
return this.realtimeWsApiUrl + `/${e2}/realtime/${i2}?talkjs-client-build=${r2 != null ? r2 : "standalone"}&talkjs-core=${s2}&talkjs-client-id=${n2}`;
|
|
3381
3427
|
}
|
|
3382
3428
|
static fromHost(e2) {
|
|
3383
|
-
|
|
3429
|
+
var _a2;
|
|
3430
|
+
const t2 = new bs("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
|
|
3384
3431
|
if (!e2) return t2;
|
|
3432
|
+
if ("@currentHost" === e2) {
|
|
3433
|
+
if ("undefined" == typeof location) throw new Error("You can only use @currentHost in a browser.");
|
|
3434
|
+
e2 = ((_a2 = window.top) != null ? _a2 : window).location.host;
|
|
3435
|
+
}
|
|
3385
3436
|
if (e2.endsWith("talkjs.com")) {
|
|
3386
|
-
const s2 = e2.match(
|
|
3437
|
+
const s2 = e2.match(/^(?:\w+-)?([^.]+)\.talkjs\.com$/);
|
|
3387
3438
|
if (s2) {
|
|
3388
3439
|
const e3 = s2[1];
|
|
3389
|
-
return new
|
|
3440
|
+
return ["app", "cdn", "api", "realtime"].includes(e3) ? t2 : new bs(`wss://realtime-${e3}.talkjs.com/v1`, `https://app-${e3}.talkjs.com/api/v0`, `https://api-${e3}.talkjs.com/v1`);
|
|
3390
3441
|
}
|
|
3391
3442
|
return t2;
|
|
3392
3443
|
}
|
|
3393
|
-
return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new
|
|
3444
|
+
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`);
|
|
3394
3445
|
}
|
|
3395
3446
|
}
|
|
3396
|
-
function
|
|
3447
|
+
function ys({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2 }) {
|
|
3397
3448
|
var _a2;
|
|
3398
3449
|
(!r2 || r2 <= 0) && (r2 = 1);
|
|
3399
|
-
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-
|
|
3450
|
+
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-10-28T10:10:39.064Z" };
|
|
3400
3451
|
s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
3401
3452
|
return a(r2, () => __async(this, null, function* () {
|
|
3402
3453
|
if (o2) {
|
|
@@ -3408,19 +3459,19 @@ function fs({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
|
|
|
3408
3459
|
throw e3;
|
|
3409
3460
|
});
|
|
3410
3461
|
}), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
|
|
3411
|
-
return o2 && 401 === s3.status ? (
|
|
3462
|
+
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);
|
|
3412
3463
|
}) }).catch((s3) => {
|
|
3413
3464
|
if (Math.random() < 0.1 && !t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
3414
3465
|
const n3 = `Network Error for ${e2} ${t2}`;
|
|
3415
3466
|
if ("undefined" != typeof window) if (s3 instanceof Response) {
|
|
3416
|
-
s3.clone().text().then((e3) =>
|
|
3417
|
-
} else
|
|
3467
|
+
s3.clone().text().then((e3) => Ds.log(`${n3} ${s3.status} ${e3} (10% logged)`));
|
|
3468
|
+
} else Ds.log(`${n3} ${s3} (10% logged)`);
|
|
3418
3469
|
console.error("[TalkJS]", n3);
|
|
3419
3470
|
}
|
|
3420
3471
|
throw s3;
|
|
3421
3472
|
});
|
|
3422
3473
|
}
|
|
3423
|
-
const { cdnHost:
|
|
3474
|
+
const { cdnHost: Cs, appHost: As, restHost: Es, realtimeHost: ks, appProtocol: xs, appWsProtocol: Is } = function() {
|
|
3424
3475
|
if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
|
|
3425
3476
|
const e2 = function() {
|
|
3426
3477
|
if (document.currentScript) return document.currentScript.src;
|
|
@@ -3445,11 +3496,11 @@ const { cdnHost: ms, appHost: gs, restHost: vs, realtimeHost: ws, appProtocol: b
|
|
|
3445
3496
|
}(n2), a2 = t2.protocol;
|
|
3446
3497
|
return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
|
|
3447
3498
|
}();
|
|
3448
|
-
const
|
|
3449
|
-
const
|
|
3499
|
+
const Ts = As.startsWith("app.talkjs.com");
|
|
3500
|
+
const Ds = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
3450
3501
|
} } : new class {
|
|
3451
3502
|
constructor(e2) {
|
|
3452
|
-
this._timeCreated = Date.now(), this._enabled =
|
|
3503
|
+
this._timeCreated = Date.now(), this._enabled = Ts, this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-10-28T10:10:39.064Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: window.location.href, referrer: document.referrer, userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: window.location.href, stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2025-10-28T10:10:39.064Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
3453
3504
|
}
|
|
3454
3505
|
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
3455
3506
|
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
@@ -3459,14 +3510,14 @@ const As = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setD
|
|
|
3459
3510
|
try {
|
|
3460
3511
|
if (!this._enabled) return Promise.resolve();
|
|
3461
3512
|
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
3462
|
-
yield
|
|
3513
|
+
yield ys({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
3463
3514
|
} catch (e3) {
|
|
3464
3515
|
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
3465
3516
|
}
|
|
3466
3517
|
});
|
|
3467
3518
|
}
|
|
3468
3519
|
}("970cd0be0fb74630b75c8451051299dc");
|
|
3469
|
-
class
|
|
3520
|
+
class Ss {
|
|
3470
3521
|
constructor(e2, t2 = {}) {
|
|
3471
3522
|
this._onSubscription = t2, this._handlers = {};
|
|
3472
3523
|
for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
|
|
@@ -3511,9 +3562,9 @@ class Es {
|
|
|
3511
3562
|
return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
|
|
3512
3563
|
}
|
|
3513
3564
|
}
|
|
3514
|
-
class
|
|
3565
|
+
class Ms {
|
|
3515
3566
|
constructor(e2, t2, s2, n2, r2, i2) {
|
|
3516
|
-
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new
|
|
3567
|
+
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new Ss({ tokenChanged(e3) {
|
|
3517
3568
|
}, tokenRefreshFailed(e3) {
|
|
3518
3569
|
}, tokenAccepted(e3) {
|
|
3519
3570
|
} }), 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.");
|
|
@@ -3605,7 +3656,7 @@ class ks {
|
|
|
3605
3656
|
const e3 = function(e4) {
|
|
3606
3657
|
const t3 = e4.split(".");
|
|
3607
3658
|
if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
|
|
3608
|
-
return { header:
|
|
3659
|
+
return { header: Fs(t3[0]), payload: Fs(t3[1]) };
|
|
3609
3660
|
}(s2);
|
|
3610
3661
|
n2 = e3.header, r2 = e3.payload;
|
|
3611
3662
|
} catch (e3) {
|
|
@@ -3619,7 +3670,7 @@ class ks {
|
|
|
3619
3670
|
const e3 = this.checkJwtPayload(r2);
|
|
3620
3671
|
t2.push(...e3);
|
|
3621
3672
|
}
|
|
3622
|
-
if (t2.length) if (this.usingBokens)
|
|
3673
|
+
if (t2.length) if (this.usingBokens) Ds.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
|
|
3623
3674
|
else {
|
|
3624
3675
|
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.");
|
|
3625
3676
|
const s3 = t2.length > 1;
|
|
@@ -3648,7 +3699,7 @@ class ks {
|
|
|
3648
3699
|
sendBokenRequest(e2, t2) {
|
|
3649
3700
|
return __async(this, null, function* () {
|
|
3650
3701
|
let s2 = 0;
|
|
3651
|
-
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield
|
|
3702
|
+
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield ys({ method: "GET", url: n2, attempts: 1e4, shouldRetry: (e3) => {
|
|
3652
3703
|
if (e3 instanceof Error) return true;
|
|
3653
3704
|
if (401 === e3.status) throw "Check that you provided a valid signature.";
|
|
3654
3705
|
if (404 === e3.status) throw "Check that you specified the correct App ID.";
|
|
@@ -3661,7 +3712,7 @@ class ks {
|
|
|
3661
3712
|
});
|
|
3662
3713
|
}
|
|
3663
3714
|
}
|
|
3664
|
-
function
|
|
3715
|
+
function Fs(e2) {
|
|
3665
3716
|
try {
|
|
3666
3717
|
const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
3667
3718
|
return JSON.parse(s2);
|
|
@@ -3669,7 +3720,7 @@ function xs(e2) {
|
|
|
3669
3720
|
throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
|
|
3670
3721
|
}
|
|
3671
3722
|
}
|
|
3672
|
-
class
|
|
3723
|
+
class Bs {
|
|
3673
3724
|
constructor(e2) {
|
|
3674
3725
|
this.target = e2;
|
|
3675
3726
|
}
|
|
@@ -3677,7 +3728,7 @@ class Is {
|
|
|
3677
3728
|
return this.target;
|
|
3678
3729
|
}
|
|
3679
3730
|
}
|
|
3680
|
-
const
|
|
3731
|
+
const Rs = new class {
|
|
3681
3732
|
constructor() {
|
|
3682
3733
|
this.registry = {};
|
|
3683
3734
|
}
|
|
@@ -3685,7 +3736,7 @@ const Ss = new class {
|
|
|
3685
3736
|
var _a2;
|
|
3686
3737
|
const t2 = this.key(e2), s2 = (_a2 = this.registry[t2]) == null ? void 0 : _a2.deref();
|
|
3687
3738
|
if (s2) return s2;
|
|
3688
|
-
const n2 = new
|
|
3739
|
+
const n2 = new _s(e2), r2 = globalThis.WeakRef ? new WeakRef(n2) : new Bs(n2);
|
|
3689
3740
|
return this.registry[t2] = r2, n2;
|
|
3690
3741
|
}
|
|
3691
3742
|
deregister(e2, t2) {
|
|
@@ -3696,11 +3747,11 @@ const Ss = new class {
|
|
|
3696
3747
|
return `${e2}:${t2}`;
|
|
3697
3748
|
}
|
|
3698
3749
|
}();
|
|
3699
|
-
function
|
|
3750
|
+
function Ns(e2) {
|
|
3700
3751
|
if (!e2) throw new Error("[TalkJS] Must provide an options object to `getTalkSession`");
|
|
3701
|
-
return e2.forceCreateNew ? new
|
|
3752
|
+
return e2.forceCreateNew ? new _s(e2) : Rs.getOrCreate(e2);
|
|
3702
3753
|
}
|
|
3703
|
-
class
|
|
3754
|
+
class _s {
|
|
3704
3755
|
constructor(e2) {
|
|
3705
3756
|
!function(e3) {
|
|
3706
3757
|
function t3(e4, t4) {
|
|
@@ -3710,13 +3761,13 @@ class Ds {
|
|
|
3710
3761
|
void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of TalkSession#constructor must be a function.");
|
|
3711
3762
|
}(e2);
|
|
3712
3763
|
const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
|
|
3713
|
-
this._appId = t2, this._apiUrls = e2.apiUrls ? new
|
|
3764
|
+
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);
|
|
3714
3765
|
const a2 = Math.random().toString().split(".")[1];
|
|
3715
|
-
this._realtimeClient = new
|
|
3766
|
+
this._realtimeClient = new Be(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.5.5", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new _e(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
|
|
3716
3767
|
console.error(`[TalkSession] ${e3}`);
|
|
3717
3768
|
}), function(e3, t3, s3) {
|
|
3718
3769
|
return __async(this, null, function* () {
|
|
3719
|
-
return
|
|
3770
|
+
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) => {
|
|
3720
3771
|
if ("string" != typeof e4 && "status" in e4) {
|
|
3721
3772
|
const t4 = e4;
|
|
3722
3773
|
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);
|
|
@@ -3739,42 +3790,42 @@ class Ds {
|
|
|
3739
3790
|
user(e2) {
|
|
3740
3791
|
if ("string" != typeof e2) throw new Error(`Creating UserRef failed because ID "${e2}" is not a string`);
|
|
3741
3792
|
if ("" === e2) throw new Error(`Creating UserRef failed because ID "${e2}" is an empty string`);
|
|
3742
|
-
return new
|
|
3793
|
+
return new _e(e2, this._realtimeClient);
|
|
3743
3794
|
}
|
|
3744
3795
|
conversation(e2) {
|
|
3745
3796
|
if ("string" != typeof e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is not a string`);
|
|
3746
3797
|
if ("" === e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is an empty string`);
|
|
3747
|
-
return new
|
|
3798
|
+
return new gs(e2, this._realtimeClient);
|
|
3748
3799
|
}
|
|
3749
3800
|
subscribeConversations(e2) {
|
|
3750
3801
|
return this._realtimeClient.subscribe(["me", "conversations"], e2);
|
|
3751
3802
|
}
|
|
3752
3803
|
terminate(e2) {
|
|
3753
|
-
|
|
3804
|
+
Rs.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
|
|
3754
3805
|
}
|
|
3755
3806
|
_isConnected() {
|
|
3756
3807
|
return this._realtimeClient.isConnected();
|
|
3757
3808
|
}
|
|
3758
3809
|
uploadFile(e2, t2) {
|
|
3759
|
-
return
|
|
3810
|
+
return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
|
|
3760
3811
|
}
|
|
3761
3812
|
uploadImage(e2, t2) {
|
|
3762
|
-
return
|
|
3813
|
+
return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
|
|
3763
3814
|
}
|
|
3764
3815
|
uploadVideo(e2, t2) {
|
|
3765
|
-
return
|
|
3816
|
+
return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
|
|
3766
3817
|
}
|
|
3767
3818
|
uploadAudio(e2, t2) {
|
|
3768
|
-
return
|
|
3819
|
+
return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
|
|
3769
3820
|
}
|
|
3770
3821
|
uploadVoice(e2, t2) {
|
|
3771
|
-
return
|
|
3822
|
+
return Ps(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
|
|
3772
3823
|
}
|
|
3773
3824
|
}
|
|
3774
|
-
function
|
|
3825
|
+
function Ps(_0, _1, _2, _3) {
|
|
3775
3826
|
return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
|
|
3776
3827
|
const u2 = new FormData();
|
|
3777
|
-
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()),
|
|
3828
|
+
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* () {
|
|
3778
3829
|
if (e3 instanceof Response) {
|
|
3779
3830
|
const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
|
|
3780
3831
|
throw new Error(s3);
|
|
@@ -3784,7 +3835,7 @@ function Ms(_0, _1, _2, _3) {
|
|
|
3784
3835
|
});
|
|
3785
3836
|
}
|
|
3786
3837
|
export {
|
|
3787
|
-
|
|
3838
|
+
Ns as getTalkSession,
|
|
3788
3839
|
f as registerPolyfills
|
|
3789
3840
|
};
|
|
3790
3841
|
//# sourceMappingURL=talkSession.js.map
|