@sendity/client 0.1.7 → 0.1.9
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/dist/components/sendity.d.ts +1 -0
- package/dist/i18n/index.d.ts +4 -1
- package/dist/i18n/sendity.cs.d.ts +3 -0
- package/dist/i18n/sendity.da.d.ts +3 -0
- package/dist/i18n/sendity.de-he.d.ts +3 -0
- package/dist/i18n/sendity.el.d.ts +3 -0
- package/dist/i18n/sendity.es.d.ts +3 -0
- package/dist/i18n/sendity.hr.d.ts +3 -0
- package/dist/i18n/sendity.it.d.ts +3 -0
- package/dist/i18n/sendity.nl.d.ts +3 -0
- package/dist/i18n/sendity.pl.d.ts +3 -0
- package/dist/i18n/sendity.tr.d.ts +3 -0
- package/dist/sendity-client.js +1054 -758
- package/package.json +1 -1
package/dist/sendity-client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ft = `<template id="sendity-tpl">
|
|
2
2
|
<div class="sendity" role="region" aria-label="Sendity authentication">
|
|
3
3
|
<div class="sendity-body">
|
|
4
4
|
<slot id="prompt">
|
|
@@ -33,7 +33,7 @@ const pt = `<template id="sendity-tpl">
|
|
|
33
33
|
</footer>
|
|
34
34
|
</div>
|
|
35
35
|
</template>
|
|
36
|
-
`,
|
|
36
|
+
`, Di = `/* Sendity client — passwordless channel-control authentication widget.
|
|
37
37
|
Design tokens mirror the Sendity Design System (emerald accent, stone neutral,
|
|
38
38
|
Zilla Slab display / Geist UI / Geist Mono). All values are overridable via
|
|
39
39
|
CSS custom properties so the host page can theme the widget.
|
|
@@ -85,6 +85,7 @@ const pt = `<template id="sendity-tpl">
|
|
|
85
85
|
--sendity-code-border-color:var(--sendity-border-strong);
|
|
86
86
|
--sendity-code-border-radius: 0.75rem; /* 12 — radius-lg */
|
|
87
87
|
--sendity-code-padding: 0.95rem 0.75rem;
|
|
88
|
+
--sendity-code-min-height: 3.75rem;
|
|
88
89
|
|
|
89
90
|
/* Channel buttons: muted Sky for Email, brand Emerald for WhatsApp. */
|
|
90
91
|
--sendity-email-bg: #e0f2fe; /* sky-100 */
|
|
@@ -237,6 +238,8 @@ const pt = `<template id="sendity-tpl">
|
|
|
237
238
|
border: var(--sendity-code-border-size) var(--sendity-code-border-style) var(--sendity-code-border-color);
|
|
238
239
|
display: inline-grid;
|
|
239
240
|
place-items: center;
|
|
241
|
+
min-height: var(--sendity-code-min-height);
|
|
242
|
+
flex: 0 0 auto;
|
|
240
243
|
text-align: center;
|
|
241
244
|
gap: 0.5rem;
|
|
242
245
|
overflow: hidden;
|
|
@@ -690,7 +693,7 @@ const pt = `<template id="sendity-tpl">
|
|
|
690
693
|
--sendity-shadow-error: 0 0 0 1px rgb(244 63 94 / 0.24), 0 18px 46px -18px rgb(244 63 94 / 0.9);
|
|
691
694
|
}
|
|
692
695
|
`;
|
|
693
|
-
class
|
|
696
|
+
class Oe {
|
|
694
697
|
constructor() {
|
|
695
698
|
this.notificationCreatedEvent = ".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated";
|
|
696
699
|
}
|
|
@@ -719,7 +722,7 @@ class qe {
|
|
|
719
722
|
return this.stopListening(".client-" + i, s);
|
|
720
723
|
}
|
|
721
724
|
}
|
|
722
|
-
class
|
|
725
|
+
class Et {
|
|
723
726
|
/**
|
|
724
727
|
* Create a new class instance.
|
|
725
728
|
*/
|
|
@@ -739,19 +742,19 @@ class Ct {
|
|
|
739
742
|
this.namespace = i;
|
|
740
743
|
}
|
|
741
744
|
}
|
|
742
|
-
function
|
|
745
|
+
function Bi(g) {
|
|
743
746
|
try {
|
|
744
|
-
return Reflect.construct(String, [],
|
|
747
|
+
return Reflect.construct(String, [], g), !0;
|
|
745
748
|
} catch {
|
|
746
749
|
return !1;
|
|
747
750
|
}
|
|
748
751
|
}
|
|
749
|
-
class
|
|
752
|
+
class Ne extends Oe {
|
|
750
753
|
/**
|
|
751
754
|
* Create a new class instance.
|
|
752
755
|
*/
|
|
753
756
|
constructor(i, s, a) {
|
|
754
|
-
super(), this.name = s, this.pusher = i, this.options = a, this.eventFormatter = new
|
|
757
|
+
super(), this.name = s, this.pusher = i, this.options = a, this.eventFormatter = new Et(this.options.namespace), this.subscribe();
|
|
755
758
|
}
|
|
756
759
|
/**
|
|
757
760
|
* Subscribe to a Pusher channel.
|
|
@@ -781,8 +784,8 @@ class Ue extends qe {
|
|
|
781
784
|
let h = String(this.options.namespace ?? "").replace(
|
|
782
785
|
/\./g,
|
|
783
786
|
"\\"
|
|
784
|
-
),
|
|
785
|
-
i(
|
|
787
|
+
), l = s.startsWith(h) ? s.substring(h.length + 1) : "." + s;
|
|
788
|
+
i(l, a);
|
|
786
789
|
}), this;
|
|
787
790
|
}
|
|
788
791
|
/**
|
|
@@ -823,7 +826,7 @@ class Ue extends qe {
|
|
|
823
826
|
return this.subscription.bind(i, s), this;
|
|
824
827
|
}
|
|
825
828
|
}
|
|
826
|
-
class
|
|
829
|
+
class xt extends Ne {
|
|
827
830
|
/**
|
|
828
831
|
* Send a whisper event to other clients in the channel.
|
|
829
832
|
*/
|
|
@@ -834,7 +837,7 @@ class St extends Ue {
|
|
|
834
837
|
), this;
|
|
835
838
|
}
|
|
836
839
|
}
|
|
837
|
-
class
|
|
840
|
+
class Fi extends Ne {
|
|
838
841
|
/**
|
|
839
842
|
* Send a whisper event to other clients in the channel.
|
|
840
843
|
*/
|
|
@@ -845,7 +848,7 @@ class Di extends Ue {
|
|
|
845
848
|
), this;
|
|
846
849
|
}
|
|
847
850
|
}
|
|
848
|
-
class
|
|
851
|
+
class $i extends xt {
|
|
849
852
|
/**
|
|
850
853
|
* Register a callback to be called anytime the member list changes.
|
|
851
854
|
*/
|
|
@@ -880,12 +883,12 @@ class Wi extends St {
|
|
|
880
883
|
}), this;
|
|
881
884
|
}
|
|
882
885
|
}
|
|
883
|
-
class Tt extends
|
|
886
|
+
class Tt extends Oe {
|
|
884
887
|
/**
|
|
885
888
|
* Create a new class instance.
|
|
886
889
|
*/
|
|
887
890
|
constructor(i, s, a) {
|
|
888
|
-
super(), this.events = {}, this.listeners = {}, this.name = s, this.socket = i, this.options = a, this.eventFormatter = new
|
|
891
|
+
super(), this.events = {}, this.listeners = {}, this.name = s, this.socket = i, this.options = a, this.eventFormatter = new Et(this.options.namespace), this.subscribe();
|
|
889
892
|
}
|
|
890
893
|
/**
|
|
891
894
|
* Subscribe to a Socket.io channel.
|
|
@@ -936,7 +939,7 @@ class Tt extends qe {
|
|
|
936
939
|
*/
|
|
937
940
|
on(i, s) {
|
|
938
941
|
return this.listeners[i] = this.listeners[i] || [], this.events[i] || (this.events[i] = (a, h) => {
|
|
939
|
-
this.name === a && this.listeners[i] && this.listeners[i].forEach((
|
|
942
|
+
this.name === a && this.listeners[i] && this.listeners[i].forEach((l) => l(h));
|
|
940
943
|
}, this.socket.on(i, this.events[i])), this.listeners[i].push(s), this;
|
|
941
944
|
}
|
|
942
945
|
/**
|
|
@@ -956,7 +959,7 @@ class Tt extends qe {
|
|
|
956
959
|
)), (!s || this.listeners[i].length === 0) && (this.events[i] && (this.socket.removeListener(i, this.events[i]), delete this.events[i]), delete this.listeners[i]);
|
|
957
960
|
}
|
|
958
961
|
}
|
|
959
|
-
class
|
|
962
|
+
class kt extends Tt {
|
|
960
963
|
/**
|
|
961
964
|
* Send a whisper event to other clients in the channel.
|
|
962
965
|
*/
|
|
@@ -968,7 +971,7 @@ class Et extends Tt {
|
|
|
968
971
|
}), this;
|
|
969
972
|
}
|
|
970
973
|
}
|
|
971
|
-
class
|
|
974
|
+
class Vi extends kt {
|
|
972
975
|
/**
|
|
973
976
|
* Register a callback to be called anytime the member list changes.
|
|
974
977
|
*/
|
|
@@ -1006,7 +1009,7 @@ class Fi extends Et {
|
|
|
1006
1009
|
), this;
|
|
1007
1010
|
}
|
|
1008
1011
|
}
|
|
1009
|
-
class ge extends
|
|
1012
|
+
class ge extends Oe {
|
|
1010
1013
|
/**
|
|
1011
1014
|
* Subscribe to a channel.
|
|
1012
1015
|
*/
|
|
@@ -1054,7 +1057,7 @@ class ge extends qe {
|
|
|
1054
1057
|
return this;
|
|
1055
1058
|
}
|
|
1056
1059
|
}
|
|
1057
|
-
class
|
|
1060
|
+
class _t extends ge {
|
|
1058
1061
|
/**
|
|
1059
1062
|
* Send a whisper event to other clients in the channel.
|
|
1060
1063
|
*/
|
|
@@ -1062,7 +1065,7 @@ class xt extends ge {
|
|
|
1062
1065
|
return this;
|
|
1063
1066
|
}
|
|
1064
1067
|
}
|
|
1065
|
-
class
|
|
1068
|
+
class Xi extends ge {
|
|
1066
1069
|
/**
|
|
1067
1070
|
* Send a whisper event to other clients in the channel.
|
|
1068
1071
|
*/
|
|
@@ -1070,7 +1073,7 @@ class Bi extends ge {
|
|
|
1070
1073
|
return this;
|
|
1071
1074
|
}
|
|
1072
1075
|
}
|
|
1073
|
-
class
|
|
1076
|
+
class Gi extends _t {
|
|
1074
1077
|
/**
|
|
1075
1078
|
* Register a callback to be called anytime the member list changes.
|
|
1076
1079
|
*/
|
|
@@ -1096,7 +1099,7 @@ class $i extends xt {
|
|
|
1096
1099
|
return this;
|
|
1097
1100
|
}
|
|
1098
1101
|
}
|
|
1099
|
-
const
|
|
1102
|
+
const At = class Lt {
|
|
1100
1103
|
/**
|
|
1101
1104
|
* Create a new class instance.
|
|
1102
1105
|
*/
|
|
@@ -1108,7 +1111,7 @@ const _t = class kt {
|
|
|
1108
1111
|
*/
|
|
1109
1112
|
setOptions(i) {
|
|
1110
1113
|
this.options = {
|
|
1111
|
-
...
|
|
1114
|
+
...Lt._defaultOptions,
|
|
1112
1115
|
...i,
|
|
1113
1116
|
broadcaster: i.broadcaster
|
|
1114
1117
|
};
|
|
@@ -1123,7 +1126,7 @@ const _t = class kt {
|
|
|
1123
1126
|
return typeof window < "u" && (i = window.Laravel) != null && i.csrfToken ? window.Laravel.csrfToken : this.options.csrfToken ? this.options.csrfToken : typeof document < "u" && typeof document.querySelector == "function" ? ((s = document.querySelector('meta[name="csrf-token"]')) == null ? void 0 : s.getAttribute("content")) ?? null : null;
|
|
1124
1127
|
}
|
|
1125
1128
|
};
|
|
1126
|
-
|
|
1129
|
+
At._defaultOptions = {
|
|
1127
1130
|
auth: {
|
|
1128
1131
|
headers: {}
|
|
1129
1132
|
},
|
|
@@ -1138,8 +1141,8 @@ _t._defaultOptions = {
|
|
|
1138
1141
|
key: null,
|
|
1139
1142
|
namespace: "App.Events"
|
|
1140
1143
|
};
|
|
1141
|
-
let
|
|
1142
|
-
class
|
|
1144
|
+
let Ue = At;
|
|
1145
|
+
class pe extends Ue {
|
|
1143
1146
|
constructor() {
|
|
1144
1147
|
super(...arguments), this.channels = {};
|
|
1145
1148
|
}
|
|
@@ -1177,7 +1180,7 @@ class fe extends Ne {
|
|
|
1177
1180
|
* Get a channel instance by name.
|
|
1178
1181
|
*/
|
|
1179
1182
|
channel(i) {
|
|
1180
|
-
return this.channels[i] || (this.channels[i] = new
|
|
1183
|
+
return this.channels[i] || (this.channels[i] = new Ne(
|
|
1181
1184
|
this.pusher,
|
|
1182
1185
|
i,
|
|
1183
1186
|
this.options
|
|
@@ -1187,7 +1190,7 @@ class fe extends Ne {
|
|
|
1187
1190
|
* Get a private channel instance by name.
|
|
1188
1191
|
*/
|
|
1189
1192
|
privateChannel(i) {
|
|
1190
|
-
return this.channels["private-" + i] || (this.channels["private-" + i] = new
|
|
1193
|
+
return this.channels["private-" + i] || (this.channels["private-" + i] = new xt(
|
|
1191
1194
|
this.pusher,
|
|
1192
1195
|
"private-" + i,
|
|
1193
1196
|
this.options
|
|
@@ -1197,7 +1200,7 @@ class fe extends Ne {
|
|
|
1197
1200
|
* Get a private encrypted channel instance by name.
|
|
1198
1201
|
*/
|
|
1199
1202
|
encryptedPrivateChannel(i) {
|
|
1200
|
-
return this.channels["private-encrypted-" + i] || (this.channels["private-encrypted-" + i] = new
|
|
1203
|
+
return this.channels["private-encrypted-" + i] || (this.channels["private-encrypted-" + i] = new Fi(
|
|
1201
1204
|
this.pusher,
|
|
1202
1205
|
"private-encrypted-" + i,
|
|
1203
1206
|
this.options
|
|
@@ -1207,7 +1210,7 @@ class fe extends Ne {
|
|
|
1207
1210
|
* Get a presence channel instance by name.
|
|
1208
1211
|
*/
|
|
1209
1212
|
presenceChannel(i) {
|
|
1210
|
-
return this.channels["presence-" + i] || (this.channels["presence-" + i] = new
|
|
1213
|
+
return this.channels["presence-" + i] || (this.channels["presence-" + i] = new $i(
|
|
1211
1214
|
this.pusher,
|
|
1212
1215
|
"presence-" + i,
|
|
1213
1216
|
this.options
|
|
@@ -1276,7 +1279,7 @@ class fe extends Ne {
|
|
|
1276
1279
|
this.pusher.disconnect();
|
|
1277
1280
|
}
|
|
1278
1281
|
}
|
|
1279
|
-
class
|
|
1282
|
+
class Ji extends Ue {
|
|
1280
1283
|
constructor() {
|
|
1281
1284
|
super(...arguments), this.channels = {};
|
|
1282
1285
|
}
|
|
@@ -1326,7 +1329,7 @@ class Vi extends Ne {
|
|
|
1326
1329
|
* Get a private channel instance by name.
|
|
1327
1330
|
*/
|
|
1328
1331
|
privateChannel(i) {
|
|
1329
|
-
return this.channels["private-" + i] || (this.channels["private-" + i] = new
|
|
1332
|
+
return this.channels["private-" + i] || (this.channels["private-" + i] = new kt(
|
|
1330
1333
|
this.socket,
|
|
1331
1334
|
"private-" + i,
|
|
1332
1335
|
this.options
|
|
@@ -1336,7 +1339,7 @@ class Vi extends Ne {
|
|
|
1336
1339
|
* Get a presence channel instance by name.
|
|
1337
1340
|
*/
|
|
1338
1341
|
presenceChannel(i) {
|
|
1339
|
-
return this.channels["presence-" + i] || (this.channels["presence-" + i] = new
|
|
1342
|
+
return this.channels["presence-" + i] || (this.channels["presence-" + i] = new Vi(
|
|
1340
1343
|
this.socket,
|
|
1341
1344
|
"presence-" + i,
|
|
1342
1345
|
this.options
|
|
@@ -1398,7 +1401,7 @@ class Vi extends Ne {
|
|
|
1398
1401
|
this.socket.disconnect();
|
|
1399
1402
|
}
|
|
1400
1403
|
}
|
|
1401
|
-
class mt extends
|
|
1404
|
+
class mt extends Ue {
|
|
1402
1405
|
constructor() {
|
|
1403
1406
|
super(...arguments), this.channels = {};
|
|
1404
1407
|
}
|
|
@@ -1423,19 +1426,19 @@ class mt extends Ne {
|
|
|
1423
1426
|
* Get a private channel instance by name.
|
|
1424
1427
|
*/
|
|
1425
1428
|
privateChannel(i) {
|
|
1426
|
-
return new
|
|
1429
|
+
return new _t();
|
|
1427
1430
|
}
|
|
1428
1431
|
/**
|
|
1429
1432
|
* Get a private encrypted channel instance by name.
|
|
1430
1433
|
*/
|
|
1431
1434
|
encryptedPrivateChannel(i) {
|
|
1432
|
-
return new
|
|
1435
|
+
return new Xi();
|
|
1433
1436
|
}
|
|
1434
1437
|
/**
|
|
1435
1438
|
* Get a presence channel instance by name.
|
|
1436
1439
|
*/
|
|
1437
1440
|
presenceChannel(i) {
|
|
1438
|
-
return new
|
|
1441
|
+
return new Gi();
|
|
1439
1442
|
}
|
|
1440
1443
|
/**
|
|
1441
1444
|
* Leave the given channel, as well as its private and presence variants.
|
|
@@ -1472,7 +1475,7 @@ class mt extends Ne {
|
|
|
1472
1475
|
disconnect() {
|
|
1473
1476
|
}
|
|
1474
1477
|
}
|
|
1475
|
-
class
|
|
1478
|
+
class Ki {
|
|
1476
1479
|
/**
|
|
1477
1480
|
* Create a new class instance.
|
|
1478
1481
|
*/
|
|
@@ -1490,23 +1493,23 @@ class Xi {
|
|
|
1490
1493
|
*/
|
|
1491
1494
|
connect() {
|
|
1492
1495
|
if (this.options.broadcaster === "reverb")
|
|
1493
|
-
this.connector = new
|
|
1496
|
+
this.connector = new pe({
|
|
1494
1497
|
...this.options,
|
|
1495
1498
|
cluster: ""
|
|
1496
1499
|
});
|
|
1497
1500
|
else if (this.options.broadcaster === "pusher")
|
|
1498
|
-
this.connector = new
|
|
1501
|
+
this.connector = new pe(this.options);
|
|
1499
1502
|
else if (this.options.broadcaster === "ably")
|
|
1500
|
-
this.connector = new
|
|
1503
|
+
this.connector = new pe({
|
|
1501
1504
|
...this.options,
|
|
1502
1505
|
cluster: "",
|
|
1503
1506
|
broadcaster: "pusher"
|
|
1504
1507
|
});
|
|
1505
1508
|
else if (this.options.broadcaster === "socket.io")
|
|
1506
|
-
this.connector = new
|
|
1509
|
+
this.connector = new Ji(this.options);
|
|
1507
1510
|
else if (this.options.broadcaster === "null")
|
|
1508
1511
|
this.connector = new mt(this.options);
|
|
1509
|
-
else if (typeof this.options.broadcaster == "function" &&
|
|
1512
|
+
else if (typeof this.options.broadcaster == "function" && Bi(this.options.broadcaster))
|
|
1510
1513
|
this.connector = new this.options.broadcaster(this.options);
|
|
1511
1514
|
else
|
|
1512
1515
|
throw new Error(
|
|
@@ -1569,7 +1572,7 @@ class Xi {
|
|
|
1569
1572
|
);
|
|
1570
1573
|
}
|
|
1571
1574
|
connectorSupportsEncryptedPrivateChannels(i) {
|
|
1572
|
-
return i instanceof
|
|
1575
|
+
return i instanceof pe || i instanceof mt;
|
|
1573
1576
|
}
|
|
1574
1577
|
/**
|
|
1575
1578
|
* Get the Socket ID for the connection.
|
|
@@ -1630,203 +1633,203 @@ class Xi {
|
|
|
1630
1633
|
);
|
|
1631
1634
|
}
|
|
1632
1635
|
}
|
|
1633
|
-
function
|
|
1634
|
-
return
|
|
1636
|
+
function Yi(g) {
|
|
1637
|
+
return g && g.__esModule && Object.prototype.hasOwnProperty.call(g, "default") ? g.default : g;
|
|
1635
1638
|
}
|
|
1636
|
-
var
|
|
1639
|
+
var Pe = { exports: {} };
|
|
1637
1640
|
var gt;
|
|
1638
|
-
function
|
|
1639
|
-
return gt || (gt = 1, (function(
|
|
1641
|
+
function Qi() {
|
|
1642
|
+
return gt || (gt = 1, (function(g, i) {
|
|
1640
1643
|
(function(a, h) {
|
|
1641
|
-
|
|
1644
|
+
g.exports = h();
|
|
1642
1645
|
})(self, () => (
|
|
1643
1646
|
/******/
|
|
1644
1647
|
(() => {
|
|
1645
1648
|
var s = {
|
|
1646
1649
|
/***/
|
|
1647
|
-
594(m,
|
|
1650
|
+
594(m, v) {
|
|
1648
1651
|
var y = this && this.__extends || /* @__PURE__ */ (function() {
|
|
1649
|
-
var
|
|
1650
|
-
return
|
|
1652
|
+
var x = function(u, p) {
|
|
1653
|
+
return x = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(C, L) {
|
|
1651
1654
|
C.__proto__ = L;
|
|
1652
1655
|
} || function(C, L) {
|
|
1653
|
-
for (var
|
|
1654
|
-
},
|
|
1656
|
+
for (var O in L) L.hasOwnProperty(O) && (C[O] = L[O]);
|
|
1657
|
+
}, x(u, p);
|
|
1655
1658
|
};
|
|
1656
|
-
return function(u,
|
|
1657
|
-
|
|
1659
|
+
return function(u, p) {
|
|
1660
|
+
x(u, p);
|
|
1658
1661
|
function C() {
|
|
1659
1662
|
this.constructor = u;
|
|
1660
1663
|
}
|
|
1661
|
-
u.prototype =
|
|
1664
|
+
u.prototype = p === null ? Object.create(p) : (C.prototype = p.prototype, new C());
|
|
1662
1665
|
};
|
|
1663
1666
|
})();
|
|
1664
|
-
Object.defineProperty(
|
|
1665
|
-
var
|
|
1667
|
+
Object.defineProperty(v, "__esModule", { value: !0 });
|
|
1668
|
+
var T = 256, S = (
|
|
1666
1669
|
/** @class */
|
|
1667
1670
|
(function() {
|
|
1668
|
-
function
|
|
1671
|
+
function x(u) {
|
|
1669
1672
|
u === void 0 && (u = "="), this._paddingCharacter = u;
|
|
1670
1673
|
}
|
|
1671
|
-
return
|
|
1674
|
+
return x.prototype.encodedLength = function(u) {
|
|
1672
1675
|
return this._paddingCharacter ? (u + 2) / 3 * 4 | 0 : (u * 8 + 5) / 6 | 0;
|
|
1673
|
-
},
|
|
1674
|
-
for (var
|
|
1676
|
+
}, x.prototype.encode = function(u) {
|
|
1677
|
+
for (var p = "", C = 0; C < u.length - 2; C += 3) {
|
|
1675
1678
|
var L = u[C] << 16 | u[C + 1] << 8 | u[C + 2];
|
|
1676
|
-
|
|
1679
|
+
p += this._encodeByte(L >>> 18 & 63), p += this._encodeByte(L >>> 12 & 63), p += this._encodeByte(L >>> 6 & 63), p += this._encodeByte(L >>> 0 & 63);
|
|
1677
1680
|
}
|
|
1678
|
-
var
|
|
1679
|
-
if (
|
|
1680
|
-
var L = u[C] << 16 | (
|
|
1681
|
-
|
|
1681
|
+
var O = u.length - C;
|
|
1682
|
+
if (O > 0) {
|
|
1683
|
+
var L = u[C] << 16 | (O === 2 ? u[C + 1] << 8 : 0);
|
|
1684
|
+
p += this._encodeByte(L >>> 18 & 63), p += this._encodeByte(L >>> 12 & 63), O === 2 ? p += this._encodeByte(L >>> 6 & 63) : p += this._paddingCharacter || "", p += this._paddingCharacter || "";
|
|
1682
1685
|
}
|
|
1683
|
-
return
|
|
1684
|
-
},
|
|
1686
|
+
return p;
|
|
1687
|
+
}, x.prototype.maxDecodedLength = function(u) {
|
|
1685
1688
|
return this._paddingCharacter ? u / 4 * 3 | 0 : (u * 6 + 7) / 8 | 0;
|
|
1686
|
-
},
|
|
1689
|
+
}, x.prototype.decodedLength = function(u) {
|
|
1687
1690
|
return this.maxDecodedLength(u.length - this._getPaddingLength(u));
|
|
1688
|
-
},
|
|
1691
|
+
}, x.prototype.decode = function(u) {
|
|
1689
1692
|
if (u.length === 0)
|
|
1690
1693
|
return new Uint8Array(0);
|
|
1691
|
-
for (var
|
|
1692
|
-
|
|
1693
|
-
if (
|
|
1694
|
+
for (var p = this._getPaddingLength(u), C = u.length - p, L = new Uint8Array(this.maxDecodedLength(C)), O = 0, q = 0, W = 0, G = 0, M = 0, H = 0, J = 0; q < C - 4; q += 4)
|
|
1695
|
+
G = this._decodeChar(u.charCodeAt(q + 0)), M = this._decodeChar(u.charCodeAt(q + 1)), H = this._decodeChar(u.charCodeAt(q + 2)), J = this._decodeChar(u.charCodeAt(q + 3)), L[O++] = G << 2 | M >>> 4, L[O++] = M << 4 | H >>> 2, L[O++] = H << 6 | J, W |= G & T, W |= M & T, W |= H & T, W |= J & T;
|
|
1696
|
+
if (q < C - 1 && (G = this._decodeChar(u.charCodeAt(q)), M = this._decodeChar(u.charCodeAt(q + 1)), L[O++] = G << 2 | M >>> 4, W |= G & T, W |= M & T), q < C - 2 && (H = this._decodeChar(u.charCodeAt(q + 2)), L[O++] = M << 4 | H >>> 2, W |= H & T), q < C - 3 && (J = this._decodeChar(u.charCodeAt(q + 3)), L[O++] = H << 6 | J, W |= J & T), W !== 0)
|
|
1694
1697
|
throw new Error("Base64Coder: incorrect characters for decoding");
|
|
1695
1698
|
return L;
|
|
1696
|
-
},
|
|
1697
|
-
var
|
|
1698
|
-
return
|
|
1699
|
-
},
|
|
1700
|
-
var
|
|
1701
|
-
return
|
|
1702
|
-
},
|
|
1703
|
-
var
|
|
1699
|
+
}, x.prototype._encodeByte = function(u) {
|
|
1700
|
+
var p = u;
|
|
1701
|
+
return p += 65, p += 25 - u >>> 8 & 6, p += 51 - u >>> 8 & -75, p += 61 - u >>> 8 & -15, p += 62 - u >>> 8 & 3, String.fromCharCode(p);
|
|
1702
|
+
}, x.prototype._decodeChar = function(u) {
|
|
1703
|
+
var p = T;
|
|
1704
|
+
return p += (42 - u & u - 44) >>> 8 & -T + u - 43 + 62, p += (46 - u & u - 48) >>> 8 & -T + u - 47 + 63, p += (47 - u & u - 58) >>> 8 & -T + u - 48 + 52, p += (64 - u & u - 91) >>> 8 & -T + u - 65 + 0, p += (96 - u & u - 123) >>> 8 & -T + u - 97 + 26, p;
|
|
1705
|
+
}, x.prototype._getPaddingLength = function(u) {
|
|
1706
|
+
var p = 0;
|
|
1704
1707
|
if (this._paddingCharacter) {
|
|
1705
1708
|
for (var C = u.length - 1; C >= 0 && u[C] === this._paddingCharacter; C--)
|
|
1706
|
-
|
|
1707
|
-
if (u.length < 4 ||
|
|
1709
|
+
p++;
|
|
1710
|
+
if (u.length < 4 || p > 2)
|
|
1708
1711
|
throw new Error("Base64Coder: incorrect padding");
|
|
1709
1712
|
}
|
|
1710
|
-
return
|
|
1711
|
-
},
|
|
1713
|
+
return p;
|
|
1714
|
+
}, x;
|
|
1712
1715
|
})()
|
|
1713
1716
|
);
|
|
1714
|
-
|
|
1715
|
-
var
|
|
1716
|
-
function
|
|
1717
|
-
return
|
|
1717
|
+
v.Coder = S;
|
|
1718
|
+
var j = new S();
|
|
1719
|
+
function E(x) {
|
|
1720
|
+
return j.encode(x);
|
|
1718
1721
|
}
|
|
1719
|
-
|
|
1720
|
-
function A(
|
|
1721
|
-
return
|
|
1722
|
+
v.encode = E;
|
|
1723
|
+
function A(x) {
|
|
1724
|
+
return j.decode(x);
|
|
1722
1725
|
}
|
|
1723
|
-
|
|
1724
|
-
var
|
|
1726
|
+
v.decode = A;
|
|
1727
|
+
var D = (
|
|
1725
1728
|
/** @class */
|
|
1726
|
-
(function(
|
|
1727
|
-
y(u,
|
|
1729
|
+
(function(x) {
|
|
1730
|
+
y(u, x);
|
|
1728
1731
|
function u() {
|
|
1729
|
-
return
|
|
1732
|
+
return x !== null && x.apply(this, arguments) || this;
|
|
1730
1733
|
}
|
|
1731
|
-
return u.prototype._encodeByte = function(
|
|
1732
|
-
var C =
|
|
1733
|
-
return C += 65, C += 25 -
|
|
1734
|
-
}, u.prototype._decodeChar = function(
|
|
1735
|
-
var C =
|
|
1736
|
-
return C += (44 -
|
|
1734
|
+
return u.prototype._encodeByte = function(p) {
|
|
1735
|
+
var C = p;
|
|
1736
|
+
return C += 65, C += 25 - p >>> 8 & 6, C += 51 - p >>> 8 & -75, C += 61 - p >>> 8 & -13, C += 62 - p >>> 8 & 49, String.fromCharCode(C);
|
|
1737
|
+
}, u.prototype._decodeChar = function(p) {
|
|
1738
|
+
var C = T;
|
|
1739
|
+
return C += (44 - p & p - 46) >>> 8 & -T + p - 45 + 62, C += (94 - p & p - 96) >>> 8 & -T + p - 95 + 63, C += (47 - p & p - 58) >>> 8 & -T + p - 48 + 52, C += (64 - p & p - 91) >>> 8 & -T + p - 65 + 0, C += (96 - p & p - 123) >>> 8 & -T + p - 97 + 26, C;
|
|
1737
1740
|
}, u;
|
|
1738
1741
|
})(S)
|
|
1739
1742
|
);
|
|
1740
|
-
|
|
1741
|
-
var
|
|
1742
|
-
function
|
|
1743
|
-
return
|
|
1743
|
+
v.URLSafeCoder = D;
|
|
1744
|
+
var U = new D();
|
|
1745
|
+
function B(x) {
|
|
1746
|
+
return U.encode(x);
|
|
1744
1747
|
}
|
|
1745
|
-
|
|
1746
|
-
function te(
|
|
1747
|
-
return
|
|
1748
|
+
v.encodeURLSafe = B;
|
|
1749
|
+
function te(x) {
|
|
1750
|
+
return U.decode(x);
|
|
1748
1751
|
}
|
|
1749
|
-
|
|
1750
|
-
return
|
|
1751
|
-
},
|
|
1752
|
-
return
|
|
1753
|
-
},
|
|
1754
|
-
return
|
|
1752
|
+
v.decodeURLSafe = te, v.encodedLength = function(x) {
|
|
1753
|
+
return j.encodedLength(x);
|
|
1754
|
+
}, v.maxDecodedLength = function(x) {
|
|
1755
|
+
return j.maxDecodedLength(x);
|
|
1756
|
+
}, v.decodedLength = function(x) {
|
|
1757
|
+
return j.decodedLength(x);
|
|
1755
1758
|
};
|
|
1756
1759
|
},
|
|
1757
1760
|
/***/
|
|
1758
|
-
978(m,
|
|
1761
|
+
978(m, v) {
|
|
1759
1762
|
var y = "utf8: invalid source encoding";
|
|
1760
|
-
function
|
|
1761
|
-
for (var
|
|
1762
|
-
var A = S[
|
|
1763
|
+
function T(S) {
|
|
1764
|
+
for (var j = [], E = 0; E < S.length; E++) {
|
|
1765
|
+
var A = S[E];
|
|
1763
1766
|
if (A & 128) {
|
|
1764
|
-
var
|
|
1767
|
+
var D = void 0;
|
|
1765
1768
|
if (A < 224) {
|
|
1766
|
-
if (
|
|
1769
|
+
if (E >= S.length)
|
|
1767
1770
|
throw new Error(y);
|
|
1768
|
-
var
|
|
1769
|
-
if ((
|
|
1771
|
+
var U = S[++E];
|
|
1772
|
+
if ((U & 192) !== 128)
|
|
1770
1773
|
throw new Error(y);
|
|
1771
|
-
A = (A & 31) << 6 |
|
|
1774
|
+
A = (A & 31) << 6 | U & 63, D = 128;
|
|
1772
1775
|
} else if (A < 240) {
|
|
1773
|
-
if (
|
|
1776
|
+
if (E >= S.length - 1)
|
|
1774
1777
|
throw new Error(y);
|
|
1775
|
-
var
|
|
1776
|
-
if ((
|
|
1778
|
+
var U = S[++E], B = S[++E];
|
|
1779
|
+
if ((U & 192) !== 128 || (B & 192) !== 128)
|
|
1777
1780
|
throw new Error(y);
|
|
1778
|
-
A = (A & 15) << 12 | (
|
|
1781
|
+
A = (A & 15) << 12 | (U & 63) << 6 | B & 63, D = 2048;
|
|
1779
1782
|
} else if (A < 248) {
|
|
1780
|
-
if (
|
|
1783
|
+
if (E >= S.length - 2)
|
|
1781
1784
|
throw new Error(y);
|
|
1782
|
-
var
|
|
1783
|
-
if ((
|
|
1785
|
+
var U = S[++E], B = S[++E], te = S[++E];
|
|
1786
|
+
if ((U & 192) !== 128 || (B & 192) !== 128 || (te & 192) !== 128)
|
|
1784
1787
|
throw new Error(y);
|
|
1785
|
-
A = (A & 15) << 18 | (
|
|
1788
|
+
A = (A & 15) << 18 | (U & 63) << 12 | (B & 63) << 6 | te & 63, D = 65536;
|
|
1786
1789
|
} else
|
|
1787
1790
|
throw new Error(y);
|
|
1788
|
-
if (A <
|
|
1791
|
+
if (A < D || A >= 55296 && A <= 57343)
|
|
1789
1792
|
throw new Error(y);
|
|
1790
1793
|
if (A >= 65536) {
|
|
1791
1794
|
if (A > 1114111)
|
|
1792
1795
|
throw new Error(y);
|
|
1793
|
-
A -= 65536,
|
|
1796
|
+
A -= 65536, j.push(String.fromCharCode(55296 | A >> 10)), A = 56320 | A & 1023;
|
|
1794
1797
|
}
|
|
1795
1798
|
}
|
|
1796
|
-
|
|
1799
|
+
j.push(String.fromCharCode(A));
|
|
1797
1800
|
}
|
|
1798
|
-
return
|
|
1801
|
+
return j.join("");
|
|
1799
1802
|
}
|
|
1800
|
-
|
|
1803
|
+
v.D4 = T;
|
|
1801
1804
|
},
|
|
1802
1805
|
/***/
|
|
1803
|
-
721(m,
|
|
1806
|
+
721(m, v, y) {
|
|
1804
1807
|
m.exports = y(207).default;
|
|
1805
1808
|
},
|
|
1806
1809
|
/***/
|
|
1807
|
-
207(m,
|
|
1808
|
-
y.d(
|
|
1810
|
+
207(m, v, y) {
|
|
1811
|
+
y.d(v, {
|
|
1809
1812
|
default: () => (
|
|
1810
1813
|
/* binding */
|
|
1811
|
-
|
|
1814
|
+
le
|
|
1812
1815
|
)
|
|
1813
1816
|
});
|
|
1814
|
-
class
|
|
1817
|
+
class T {
|
|
1815
1818
|
constructor(e, t) {
|
|
1816
1819
|
this.lastId = 0, this.prefix = e, this.name = t;
|
|
1817
1820
|
}
|
|
1818
1821
|
create(e) {
|
|
1819
1822
|
this.lastId++;
|
|
1820
|
-
var t = this.lastId, r = this.prefix + t, o = this.name + "[" + t + "]", c = !1,
|
|
1823
|
+
var t = this.lastId, r = this.prefix + t, o = this.name + "[" + t + "]", c = !1, d = function() {
|
|
1821
1824
|
c || (e.apply(null, arguments), c = !0);
|
|
1822
1825
|
};
|
|
1823
|
-
return this[t] =
|
|
1826
|
+
return this[t] = d, { number: t, id: r, name: o, callback: d };
|
|
1824
1827
|
}
|
|
1825
1828
|
remove(e) {
|
|
1826
1829
|
delete this[e.number];
|
|
1827
1830
|
}
|
|
1828
1831
|
}
|
|
1829
|
-
var S = new
|
|
1832
|
+
var S = new T("_pusher_script_", "Pusher.ScriptReceivers"), j = {
|
|
1830
1833
|
VERSION: "8.5.0",
|
|
1831
1834
|
PROTOCOL: 7,
|
|
1832
1835
|
wsPort: 80,
|
|
@@ -1854,7 +1857,7 @@ function Gi() {
|
|
|
1854
1857
|
cdn_https: "https://js.pusher.com",
|
|
1855
1858
|
dependency_suffix: ""
|
|
1856
1859
|
};
|
|
1857
|
-
const
|
|
1860
|
+
const E = j;
|
|
1858
1861
|
class A {
|
|
1859
1862
|
constructor(e) {
|
|
1860
1863
|
this.options = e, this.receivers = e.receivers || S, this.loading = {};
|
|
@@ -1865,17 +1868,17 @@ function Gi() {
|
|
|
1865
1868
|
o.loading[e].push(r);
|
|
1866
1869
|
else {
|
|
1867
1870
|
o.loading[e] = [r];
|
|
1868
|
-
var c = w.createScriptRequest(o.getPath(e, t)),
|
|
1869
|
-
if (o.receivers.remove(
|
|
1871
|
+
var c = w.createScriptRequest(o.getPath(e, t)), d = o.receivers.create(function(f) {
|
|
1872
|
+
if (o.receivers.remove(d), o.loading[e]) {
|
|
1870
1873
|
var b = o.loading[e];
|
|
1871
1874
|
delete o.loading[e];
|
|
1872
|
-
for (var
|
|
1873
|
-
|
|
1874
|
-
},
|
|
1875
|
-
b[
|
|
1875
|
+
for (var k = function(R) {
|
|
1876
|
+
R || c.cleanup();
|
|
1877
|
+
}, _ = 0; _ < b.length; _++)
|
|
1878
|
+
b[_](f, k);
|
|
1876
1879
|
}
|
|
1877
1880
|
});
|
|
1878
|
-
c.send(
|
|
1881
|
+
c.send(d);
|
|
1879
1882
|
}
|
|
1880
1883
|
}
|
|
1881
1884
|
getRoot(e) {
|
|
@@ -1886,14 +1889,14 @@ function Gi() {
|
|
|
1886
1889
|
return this.getRoot(t) + "/" + e + this.options.suffix + ".js";
|
|
1887
1890
|
}
|
|
1888
1891
|
}
|
|
1889
|
-
var
|
|
1890
|
-
cdn_http:
|
|
1891
|
-
cdn_https:
|
|
1892
|
-
version:
|
|
1893
|
-
suffix:
|
|
1894
|
-
receivers:
|
|
1892
|
+
var D = new T("_pusher_dependencies", "Pusher.DependenciesReceivers"), U = new A({
|
|
1893
|
+
cdn_http: E.cdn_http,
|
|
1894
|
+
cdn_https: E.cdn_https,
|
|
1895
|
+
version: E.VERSION,
|
|
1896
|
+
suffix: E.dependency_suffix,
|
|
1897
|
+
receivers: D
|
|
1895
1898
|
});
|
|
1896
|
-
const
|
|
1899
|
+
const B = {
|
|
1897
1900
|
baseUrl: "https://pusher.com",
|
|
1898
1901
|
urls: {
|
|
1899
1902
|
authenticationEndpoint: {
|
|
@@ -1912,18 +1915,18 @@ function Gi() {
|
|
|
1912
1915
|
fullUrl: "https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"
|
|
1913
1916
|
}
|
|
1914
1917
|
}
|
|
1915
|
-
},
|
|
1916
|
-
const e = "See:", t =
|
|
1918
|
+
}, x = { buildLogSuffix: function(n) {
|
|
1919
|
+
const e = "See:", t = B.urls[n];
|
|
1917
1920
|
if (!t)
|
|
1918
1921
|
return "";
|
|
1919
1922
|
let r;
|
|
1920
|
-
return t.fullUrl ? r = t.fullUrl : t.path && (r =
|
|
1923
|
+
return t.fullUrl ? r = t.fullUrl : t.path && (r = B.baseUrl + t.path), r ? `${e} ${r}` : "";
|
|
1921
1924
|
} };
|
|
1922
1925
|
var u;
|
|
1923
1926
|
(function(n) {
|
|
1924
1927
|
n.UserAuthentication = "user-authentication", n.ChannelAuthorization = "channel-authorization";
|
|
1925
1928
|
})(u || (u = {}));
|
|
1926
|
-
class
|
|
1929
|
+
class p extends Error {
|
|
1927
1930
|
constructor(e) {
|
|
1928
1931
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1929
1932
|
}
|
|
@@ -1938,27 +1941,27 @@ function Gi() {
|
|
|
1938
1941
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1939
1942
|
}
|
|
1940
1943
|
}
|
|
1941
|
-
class
|
|
1944
|
+
class O extends Error {
|
|
1942
1945
|
constructor(e) {
|
|
1943
1946
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1944
1947
|
}
|
|
1945
1948
|
}
|
|
1946
|
-
class
|
|
1949
|
+
class q extends Error {
|
|
1947
1950
|
constructor(e) {
|
|
1948
1951
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1949
1952
|
}
|
|
1950
1953
|
}
|
|
1951
|
-
class
|
|
1954
|
+
class W extends Error {
|
|
1952
1955
|
constructor(e) {
|
|
1953
1956
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1954
1957
|
}
|
|
1955
1958
|
}
|
|
1956
|
-
class
|
|
1959
|
+
class G extends Error {
|
|
1957
1960
|
constructor(e) {
|
|
1958
1961
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1959
1962
|
}
|
|
1960
1963
|
}
|
|
1961
|
-
class
|
|
1964
|
+
class M extends Error {
|
|
1962
1965
|
constructor(e) {
|
|
1963
1966
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1964
1967
|
}
|
|
@@ -1968,49 +1971,49 @@ function Gi() {
|
|
|
1968
1971
|
super(t), this.status = e, Object.setPrototypeOf(this, new.target.prototype);
|
|
1969
1972
|
}
|
|
1970
1973
|
}
|
|
1971
|
-
const
|
|
1974
|
+
const It = function(n, e, t, r, o) {
|
|
1972
1975
|
const c = w.createXHR();
|
|
1973
1976
|
c.open("POST", t.endpoint, !0), c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
1974
|
-
for (var
|
|
1975
|
-
c.setRequestHeader(
|
|
1977
|
+
for (var d in t.headers)
|
|
1978
|
+
c.setRequestHeader(d, t.headers[d]);
|
|
1976
1979
|
if (t.headersProvider != null) {
|
|
1977
|
-
let
|
|
1978
|
-
for (var
|
|
1979
|
-
c.setRequestHeader(
|
|
1980
|
+
let f = t.headersProvider();
|
|
1981
|
+
for (var d in f)
|
|
1982
|
+
c.setRequestHeader(d, f[d]);
|
|
1980
1983
|
}
|
|
1981
1984
|
return c.onreadystatechange = function() {
|
|
1982
1985
|
if (c.readyState === 4)
|
|
1983
1986
|
if (c.status === 200) {
|
|
1984
|
-
let
|
|
1987
|
+
let f, b = !1;
|
|
1985
1988
|
try {
|
|
1986
|
-
|
|
1989
|
+
f = JSON.parse(c.responseText), b = !0;
|
|
1987
1990
|
} catch {
|
|
1988
1991
|
o(new H(200, `JSON returned from ${r.toString()} endpoint was invalid, yet status code was 200. Data was: ${c.responseText}`), null);
|
|
1989
1992
|
}
|
|
1990
|
-
b && o(null,
|
|
1993
|
+
b && o(null, f);
|
|
1991
1994
|
} else {
|
|
1992
|
-
let
|
|
1995
|
+
let f = "";
|
|
1993
1996
|
switch (r) {
|
|
1994
1997
|
case u.UserAuthentication:
|
|
1995
|
-
|
|
1998
|
+
f = x.buildLogSuffix("authenticationEndpoint");
|
|
1996
1999
|
break;
|
|
1997
2000
|
case u.ChannelAuthorization:
|
|
1998
|
-
|
|
2001
|
+
f = `Clients must be authorized to join private or presence channels. ${x.buildLogSuffix("authorizationEndpoint")}`;
|
|
1999
2002
|
break;
|
|
2000
2003
|
}
|
|
2001
|
-
o(new H(c.status, `Unable to retrieve auth string from ${r.toString()} endpoint - received status: ${c.status} from ${t.endpoint}. ${
|
|
2004
|
+
o(new H(c.status, `Unable to retrieve auth string from ${r.toString()} endpoint - received status: ${c.status} from ${t.endpoint}. ${f}`), null);
|
|
2002
2005
|
}
|
|
2003
2006
|
}, c.send(e), c;
|
|
2004
2007
|
};
|
|
2005
|
-
function
|
|
2006
|
-
return qt(
|
|
2008
|
+
function jt(n) {
|
|
2009
|
+
return qt(Nt(n));
|
|
2007
2010
|
}
|
|
2008
|
-
var ne = String.fromCharCode, oe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
2011
|
+
var ne = String.fromCharCode, oe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ot = function(n) {
|
|
2009
2012
|
var e = n.charCodeAt(0);
|
|
2010
2013
|
return e < 128 ? n : e < 2048 ? ne(192 | e >>> 6) + ne(128 | e & 63) : ne(224 | e >>> 12 & 15) + ne(128 | e >>> 6 & 63) + ne(128 | e & 63);
|
|
2011
|
-
},
|
|
2012
|
-
return n.replace(/[^\x00-\x7F]/g,
|
|
2013
|
-
},
|
|
2014
|
+
}, Nt = function(n) {
|
|
2015
|
+
return n.replace(/[^\x00-\x7F]/g, Ot);
|
|
2016
|
+
}, Ut = function(n) {
|
|
2014
2017
|
var e = [0, 2, 1][n.length % 3], t = n.charCodeAt(0) << 16 | (n.length > 1 ? n.charCodeAt(1) : 0) << 8 | (n.length > 2 ? n.charCodeAt(2) : 0), r = [
|
|
2015
2018
|
oe.charAt(t >>> 18),
|
|
2016
2019
|
oe.charAt(t >>> 12 & 63),
|
|
@@ -2019,9 +2022,9 @@ function Gi() {
|
|
|
2019
2022
|
];
|
|
2020
2023
|
return r.join("");
|
|
2021
2024
|
}, qt = window.btoa || function(n) {
|
|
2022
|
-
return n.replace(/[\s\S]{1,3}/g,
|
|
2025
|
+
return n.replace(/[\s\S]{1,3}/g, Ut);
|
|
2023
2026
|
};
|
|
2024
|
-
class
|
|
2027
|
+
class zt {
|
|
2025
2028
|
constructor(e, t, r, o) {
|
|
2026
2029
|
this.clear = t, this.timer = e(() => {
|
|
2027
2030
|
this.timer && (this.timer = o(this.timer));
|
|
@@ -2034,33 +2037,33 @@ function Gi() {
|
|
|
2034
2037
|
this.timer && (this.clear(this.timer), this.timer = null);
|
|
2035
2038
|
}
|
|
2036
2039
|
}
|
|
2037
|
-
const
|
|
2038
|
-
function
|
|
2040
|
+
const We = zt;
|
|
2041
|
+
function Wt(n) {
|
|
2039
2042
|
window.clearTimeout(n);
|
|
2040
2043
|
}
|
|
2041
|
-
function
|
|
2044
|
+
function Ht(n) {
|
|
2042
2045
|
window.clearInterval(n);
|
|
2043
2046
|
}
|
|
2044
|
-
class
|
|
2047
|
+
class K extends We {
|
|
2045
2048
|
constructor(e, t) {
|
|
2046
|
-
super(setTimeout,
|
|
2049
|
+
super(setTimeout, Wt, e, function(r) {
|
|
2047
2050
|
return t(), null;
|
|
2048
2051
|
});
|
|
2049
2052
|
}
|
|
2050
2053
|
}
|
|
2051
|
-
class
|
|
2054
|
+
class Mt extends We {
|
|
2052
2055
|
constructor(e, t) {
|
|
2053
|
-
super(setInterval,
|
|
2056
|
+
super(setInterval, Ht, e, function(r) {
|
|
2054
2057
|
return t(), r;
|
|
2055
2058
|
});
|
|
2056
2059
|
}
|
|
2057
2060
|
}
|
|
2058
|
-
var
|
|
2061
|
+
var Dt = {
|
|
2059
2062
|
now() {
|
|
2060
2063
|
return Date.now ? Date.now() : (/* @__PURE__ */ new Date()).valueOf();
|
|
2061
2064
|
},
|
|
2062
2065
|
defer(n) {
|
|
2063
|
-
return new
|
|
2066
|
+
return new K(0, n);
|
|
2064
2067
|
},
|
|
2065
2068
|
method(n, ...e) {
|
|
2066
2069
|
var t = Array.prototype.slice.call(arguments, 1);
|
|
@@ -2069,16 +2072,16 @@ function Gi() {
|
|
|
2069
2072
|
};
|
|
2070
2073
|
}
|
|
2071
2074
|
};
|
|
2072
|
-
const
|
|
2073
|
-
function
|
|
2075
|
+
const N = Dt;
|
|
2076
|
+
function z(n, ...e) {
|
|
2074
2077
|
for (var t = 0; t < e.length; t++) {
|
|
2075
2078
|
var r = e[t];
|
|
2076
2079
|
for (var o in r)
|
|
2077
|
-
r[o] && r[o].constructor && r[o].constructor === Object ? n[o] =
|
|
2080
|
+
r[o] && r[o].constructor && r[o].constructor === Object ? n[o] = z(n[o] || {}, r[o]) : n[o] = r[o];
|
|
2078
2081
|
}
|
|
2079
2082
|
return n;
|
|
2080
2083
|
}
|
|
2081
|
-
function
|
|
2084
|
+
function Bt() {
|
|
2082
2085
|
for (var n = ["Pusher"], e = 0; e < arguments.length; e++)
|
|
2083
2086
|
typeof arguments[e] == "string" ? n.push(arguments[e]) : n.push(ae(arguments[e]));
|
|
2084
2087
|
return n.join(" : ");
|
|
@@ -2098,13 +2101,13 @@ function Gi() {
|
|
|
2098
2101
|
for (var t in n)
|
|
2099
2102
|
Object.prototype.hasOwnProperty.call(n, t) && e(n[t], t, n);
|
|
2100
2103
|
}
|
|
2101
|
-
function
|
|
2104
|
+
function Me(n) {
|
|
2102
2105
|
var e = [];
|
|
2103
2106
|
return $(n, function(t, r) {
|
|
2104
2107
|
e.push(r);
|
|
2105
2108
|
}), e;
|
|
2106
2109
|
}
|
|
2107
|
-
function
|
|
2110
|
+
function Ft(n) {
|
|
2108
2111
|
var e = [];
|
|
2109
2112
|
return $(n, function(t) {
|
|
2110
2113
|
e.push(t);
|
|
@@ -2114,18 +2117,18 @@ function Gi() {
|
|
|
2114
2117
|
for (var r = 0; r < n.length; r++)
|
|
2115
2118
|
e.call(t || window, n[r], r, n);
|
|
2116
2119
|
}
|
|
2117
|
-
function
|
|
2120
|
+
function De(n, e) {
|
|
2118
2121
|
for (var t = [], r = 0; r < n.length; r++)
|
|
2119
2122
|
t.push(e(n[r], r, n, t));
|
|
2120
2123
|
return t;
|
|
2121
2124
|
}
|
|
2122
|
-
function
|
|
2125
|
+
function $t(n, e) {
|
|
2123
2126
|
var t = {};
|
|
2124
2127
|
return $(n, function(r, o) {
|
|
2125
2128
|
t[o] = e(r);
|
|
2126
2129
|
}), t;
|
|
2127
2130
|
}
|
|
2128
|
-
function
|
|
2131
|
+
function Be(n, e) {
|
|
2129
2132
|
e = e || function(o) {
|
|
2130
2133
|
return !!o;
|
|
2131
2134
|
};
|
|
@@ -2133,13 +2136,13 @@ function Gi() {
|
|
|
2133
2136
|
e(n[r], r, n, t) && t.push(n[r]);
|
|
2134
2137
|
return t;
|
|
2135
2138
|
}
|
|
2136
|
-
function
|
|
2139
|
+
function Fe(n, e) {
|
|
2137
2140
|
var t = {};
|
|
2138
2141
|
return $(n, function(r, o) {
|
|
2139
2142
|
(e && e(r, o, n, t) || r) && (t[o] = r);
|
|
2140
2143
|
}), t;
|
|
2141
2144
|
}
|
|
2142
|
-
function
|
|
2145
|
+
function Vt(n) {
|
|
2143
2146
|
var e = [];
|
|
2144
2147
|
return $(n, function(t, r) {
|
|
2145
2148
|
e.push([r, t]);
|
|
@@ -2151,41 +2154,41 @@ function Gi() {
|
|
|
2151
2154
|
return !0;
|
|
2152
2155
|
return !1;
|
|
2153
2156
|
}
|
|
2154
|
-
function
|
|
2157
|
+
function Xt(n, e) {
|
|
2155
2158
|
for (var t = 0; t < n.length; t++)
|
|
2156
2159
|
if (!e(n[t], t, n))
|
|
2157
2160
|
return !1;
|
|
2158
2161
|
return !0;
|
|
2159
2162
|
}
|
|
2160
|
-
function
|
|
2161
|
-
return
|
|
2162
|
-
return typeof e == "object" && (e = ae(e)), encodeURIComponent(
|
|
2163
|
+
function Gt(n) {
|
|
2164
|
+
return $t(n, function(e) {
|
|
2165
|
+
return typeof e == "object" && (e = ae(e)), encodeURIComponent(jt(e.toString()));
|
|
2163
2166
|
});
|
|
2164
2167
|
}
|
|
2165
|
-
function
|
|
2166
|
-
var e =
|
|
2168
|
+
function Jt(n) {
|
|
2169
|
+
var e = Fe(n, function(r) {
|
|
2167
2170
|
return r !== void 0;
|
|
2168
|
-
}), t =
|
|
2171
|
+
}), t = De(Vt(Gt(e)), N.method("join", "=")).join("&");
|
|
2169
2172
|
return t;
|
|
2170
2173
|
}
|
|
2171
|
-
function
|
|
2174
|
+
function Kt(n) {
|
|
2172
2175
|
var e = [], t = [];
|
|
2173
2176
|
return (function r(o, c) {
|
|
2174
|
-
var
|
|
2177
|
+
var d, f, b;
|
|
2175
2178
|
switch (typeof o) {
|
|
2176
2179
|
case "object":
|
|
2177
2180
|
if (!o)
|
|
2178
2181
|
return null;
|
|
2179
|
-
for (
|
|
2180
|
-
if (e[
|
|
2181
|
-
return { $ref: t[
|
|
2182
|
+
for (d = 0; d < e.length; d += 1)
|
|
2183
|
+
if (e[d] === o)
|
|
2184
|
+
return { $ref: t[d] };
|
|
2182
2185
|
if (e.push(o), t.push(c), Object.prototype.toString.apply(o) === "[object Array]")
|
|
2183
|
-
for (b = [],
|
|
2184
|
-
b[
|
|
2186
|
+
for (b = [], d = 0; d < o.length; d += 1)
|
|
2187
|
+
b[d] = r(o[d], c + "[" + d + "]");
|
|
2185
2188
|
else {
|
|
2186
2189
|
b = {};
|
|
2187
|
-
for (
|
|
2188
|
-
Object.prototype.hasOwnProperty.call(o,
|
|
2190
|
+
for (f in o)
|
|
2191
|
+
Object.prototype.hasOwnProperty.call(o, f) && (b[f] = r(o[f], c + "[" + JSON.stringify(f) + "]"));
|
|
2189
2192
|
}
|
|
2190
2193
|
return b;
|
|
2191
2194
|
case "number":
|
|
@@ -2199,10 +2202,10 @@ function Gi() {
|
|
|
2199
2202
|
try {
|
|
2200
2203
|
return JSON.stringify(n);
|
|
2201
2204
|
} catch {
|
|
2202
|
-
return JSON.stringify(
|
|
2205
|
+
return JSON.stringify(Kt(n));
|
|
2203
2206
|
}
|
|
2204
2207
|
}
|
|
2205
|
-
class
|
|
2208
|
+
class Yt {
|
|
2206
2209
|
constructor() {
|
|
2207
2210
|
this.globalLog = (e) => {
|
|
2208
2211
|
window.console && window.console.log && window.console.log(e);
|
|
@@ -2224,26 +2227,26 @@ function Gi() {
|
|
|
2224
2227
|
window.console && window.console.error ? window.console.error(e) : this.globalLogWarn(e);
|
|
2225
2228
|
}
|
|
2226
2229
|
log(e, ...t) {
|
|
2227
|
-
var r =
|
|
2228
|
-
|
|
2230
|
+
var r = Bt.apply(this, arguments);
|
|
2231
|
+
le.log ? le.log(r) : le.logToConsole && e.bind(this)(r);
|
|
2229
2232
|
}
|
|
2230
2233
|
}
|
|
2231
|
-
const
|
|
2232
|
-
var
|
|
2233
|
-
(t.headers !== void 0 || t.headersProvider != null) &&
|
|
2234
|
+
const P = new Yt();
|
|
2235
|
+
var Qt = function(n, e, t, r, o) {
|
|
2236
|
+
(t.headers !== void 0 || t.headersProvider != null) && P.warn(`To send headers with the ${r.toString()} request, you must use AJAX, rather than JSONP.`);
|
|
2234
2237
|
var c = n.nextAuthCallbackID.toString();
|
|
2235
2238
|
n.nextAuthCallbackID++;
|
|
2236
|
-
var
|
|
2237
|
-
n.auth_callbacks[c] = function(
|
|
2238
|
-
o(null,
|
|
2239
|
+
var d = n.getDocument(), f = d.createElement("script");
|
|
2240
|
+
n.auth_callbacks[c] = function(_) {
|
|
2241
|
+
o(null, _);
|
|
2239
2242
|
};
|
|
2240
2243
|
var b = "Pusher.auth_callbacks['" + c + "']";
|
|
2241
|
-
|
|
2242
|
-
var
|
|
2243
|
-
|
|
2244
|
+
f.src = t.endpoint + "?callback=" + encodeURIComponent(b) + "&" + e;
|
|
2245
|
+
var k = d.getElementsByTagName("head")[0] || d.documentElement;
|
|
2246
|
+
k.insertBefore(f, k.firstChild);
|
|
2244
2247
|
};
|
|
2245
|
-
const
|
|
2246
|
-
class
|
|
2248
|
+
const Zt = Qt;
|
|
2249
|
+
class en {
|
|
2247
2250
|
constructor(e) {
|
|
2248
2251
|
this.src = e;
|
|
2249
2252
|
}
|
|
@@ -2263,13 +2266,13 @@ function Gi() {
|
|
|
2263
2266
|
this.script && (this.script.onload = this.script.onerror = null, this.script.onreadystatechange = null), this.script && this.script.parentNode && this.script.parentNode.removeChild(this.script), this.errorScript && this.errorScript.parentNode && this.errorScript.parentNode.removeChild(this.errorScript), this.script = null, this.errorScript = null;
|
|
2264
2267
|
}
|
|
2265
2268
|
}
|
|
2266
|
-
class
|
|
2269
|
+
class tn {
|
|
2267
2270
|
constructor(e, t) {
|
|
2268
2271
|
this.url = e, this.data = t;
|
|
2269
2272
|
}
|
|
2270
2273
|
send(e) {
|
|
2271
2274
|
if (!this.request) {
|
|
2272
|
-
var t =
|
|
2275
|
+
var t = Jt(this.data), r = this.url + "/" + e.number + "?" + t;
|
|
2273
2276
|
this.request = w.createScriptRequest(r), this.request.send(e);
|
|
2274
2277
|
}
|
|
2275
2278
|
}
|
|
@@ -2277,37 +2280,37 @@ function Gi() {
|
|
|
2277
2280
|
this.request && this.request.cleanup();
|
|
2278
2281
|
}
|
|
2279
2282
|
}
|
|
2280
|
-
var
|
|
2283
|
+
var nn = function(n, e) {
|
|
2281
2284
|
return function(t, r) {
|
|
2282
|
-
var o = "http" + (e ? "s" : "") + "://", c = o + (n.host || n.options.host) + n.options.path,
|
|
2283
|
-
S.remove(
|
|
2285
|
+
var o = "http" + (e ? "s" : "") + "://", c = o + (n.host || n.options.host) + n.options.path, d = w.createJSONPRequest(c, t), f = w.ScriptReceivers.create(function(b, k) {
|
|
2286
|
+
S.remove(f), d.cleanup(), k && k.host && (n.host = k.host), r && r(b, k);
|
|
2284
2287
|
});
|
|
2285
|
-
|
|
2288
|
+
d.send(f);
|
|
2286
2289
|
};
|
|
2287
|
-
},
|
|
2290
|
+
}, rn = {
|
|
2288
2291
|
name: "jsonp",
|
|
2289
|
-
getAgent:
|
|
2292
|
+
getAgent: nn
|
|
2290
2293
|
};
|
|
2291
|
-
const
|
|
2294
|
+
const sn = rn;
|
|
2292
2295
|
function ye(n, e, t) {
|
|
2293
2296
|
var r = n + (e.useTLS ? "s" : ""), o = e.useTLS ? e.hostTLS : e.hostNonTLS;
|
|
2294
2297
|
return r + "://" + o + t;
|
|
2295
2298
|
}
|
|
2296
2299
|
function be(n, e) {
|
|
2297
|
-
var t = "/app/" + n, r = "?protocol=" +
|
|
2300
|
+
var t = "/app/" + n, r = "?protocol=" + E.PROTOCOL + "&client=js&version=" + E.VERSION + (e ? "&" + e : "");
|
|
2298
2301
|
return t + r;
|
|
2299
2302
|
}
|
|
2300
|
-
var
|
|
2303
|
+
var on = {
|
|
2301
2304
|
getInitial: function(n, e) {
|
|
2302
2305
|
var t = (e.httpPath || "") + be(n, "flash=false");
|
|
2303
2306
|
return ye("ws", e, t);
|
|
2304
2307
|
}
|
|
2305
|
-
},
|
|
2308
|
+
}, an = {
|
|
2306
2309
|
getInitial: function(n, e) {
|
|
2307
2310
|
var t = (e.httpPath || "/pusher") + be(n);
|
|
2308
2311
|
return ye("http", e, t);
|
|
2309
2312
|
}
|
|
2310
|
-
},
|
|
2313
|
+
}, cn = {
|
|
2311
2314
|
getInitial: function(n, e) {
|
|
2312
2315
|
return ye("http", e, e.httpPath || "/pusher");
|
|
2313
2316
|
},
|
|
@@ -2315,7 +2318,7 @@ function Gi() {
|
|
|
2315
2318
|
return be(n);
|
|
2316
2319
|
}
|
|
2317
2320
|
};
|
|
2318
|
-
class
|
|
2321
|
+
class hn {
|
|
2319
2322
|
constructor() {
|
|
2320
2323
|
this._callbacks = {};
|
|
2321
2324
|
}
|
|
@@ -2334,12 +2337,12 @@ function Gi() {
|
|
|
2334
2337
|
this._callbacks = {};
|
|
2335
2338
|
return;
|
|
2336
2339
|
}
|
|
2337
|
-
var o = e ? [we(e)] :
|
|
2340
|
+
var o = e ? [we(e)] : Me(this._callbacks);
|
|
2338
2341
|
t || r ? this.removeCallback(o, t, r) : this.removeAllCallbacks(o);
|
|
2339
2342
|
}
|
|
2340
2343
|
removeCallback(e, t, r) {
|
|
2341
2344
|
ie(e, function(o) {
|
|
2342
|
-
this._callbacks[o] =
|
|
2345
|
+
this._callbacks[o] = Be(this._callbacks[o] || [], function(c) {
|
|
2343
2346
|
return t && t !== c.fn || r && r !== c.context;
|
|
2344
2347
|
}), this._callbacks[o].length === 0 && delete this._callbacks[o];
|
|
2345
2348
|
}, this);
|
|
@@ -2355,7 +2358,7 @@ function Gi() {
|
|
|
2355
2358
|
}
|
|
2356
2359
|
class V {
|
|
2357
2360
|
constructor(e) {
|
|
2358
|
-
this.callbacks = new
|
|
2361
|
+
this.callbacks = new hn(), this.global_callbacks = [], this.failThrough = e;
|
|
2359
2362
|
}
|
|
2360
2363
|
bind(e, t, r) {
|
|
2361
2364
|
return this.callbacks.add(e, t, r), this;
|
|
@@ -2367,7 +2370,7 @@ function Gi() {
|
|
|
2367
2370
|
return this.callbacks.remove(e, t, r), this;
|
|
2368
2371
|
}
|
|
2369
2372
|
unbind_global(e) {
|
|
2370
|
-
return e ? (this.global_callbacks =
|
|
2373
|
+
return e ? (this.global_callbacks = Be(this.global_callbacks || [], (t) => t !== e), this) : (this.global_callbacks = [], this);
|
|
2371
2374
|
}
|
|
2372
2375
|
unbind_all() {
|
|
2373
2376
|
return this.unbind(), this.unbind_global(), this;
|
|
@@ -2375,15 +2378,15 @@ function Gi() {
|
|
|
2375
2378
|
emit(e, t, r) {
|
|
2376
2379
|
for (var o = 0; o < this.global_callbacks.length; o++)
|
|
2377
2380
|
this.global_callbacks[o](e, t);
|
|
2378
|
-
var c = this.callbacks.get(e),
|
|
2379
|
-
if (r ?
|
|
2381
|
+
var c = this.callbacks.get(e), d = [];
|
|
2382
|
+
if (r ? d.push(t, r) : t && d.push(t), c && c.length > 0)
|
|
2380
2383
|
for (var o = 0; o < c.length; o++)
|
|
2381
|
-
c[o].fn.apply(c[o].context || window,
|
|
2384
|
+
c[o].fn.apply(c[o].context || window, d);
|
|
2382
2385
|
else this.failThrough && this.failThrough(e, t);
|
|
2383
2386
|
return this;
|
|
2384
2387
|
}
|
|
2385
2388
|
}
|
|
2386
|
-
class
|
|
2389
|
+
class dn extends V {
|
|
2387
2390
|
constructor(e, t, r, o, c) {
|
|
2388
2391
|
super(), this.initialize = w.transportConnectionInitializer, this.hooks = e, this.name = t, this.priority = r, this.key = o, this.options = c, this.state = "new", this.timeline = c.timeline, this.activityTimeout = c.activityTimeout, this.id = this.timeline.generateUniqueID();
|
|
2389
2392
|
}
|
|
@@ -2400,17 +2403,17 @@ function Gi() {
|
|
|
2400
2403
|
try {
|
|
2401
2404
|
this.socket = this.hooks.getSocket(e, this.options);
|
|
2402
2405
|
} catch (t) {
|
|
2403
|
-
return
|
|
2406
|
+
return N.defer(() => {
|
|
2404
2407
|
this.onError(t), this.changeState("closed");
|
|
2405
2408
|
}), !1;
|
|
2406
2409
|
}
|
|
2407
|
-
return this.bindListeners(),
|
|
2410
|
+
return this.bindListeners(), P.debug("Connecting", { transport: this.name, url: e }), this.changeState("connecting"), !0;
|
|
2408
2411
|
}
|
|
2409
2412
|
close() {
|
|
2410
2413
|
return this.socket ? (this.socket.close(), !0) : !1;
|
|
2411
2414
|
}
|
|
2412
2415
|
send(e) {
|
|
2413
|
-
return this.state === "open" ? (
|
|
2416
|
+
return this.state === "open" ? (N.defer(() => {
|
|
2414
2417
|
this.socket && this.socket.send(e);
|
|
2415
2418
|
}), !0) : !1;
|
|
2416
2419
|
}
|
|
@@ -2459,7 +2462,7 @@ function Gi() {
|
|
|
2459
2462
|
})), this.emit(e, t);
|
|
2460
2463
|
}
|
|
2461
2464
|
buildTimelineMessage(e) {
|
|
2462
|
-
return
|
|
2465
|
+
return z({ cid: this.id }, e);
|
|
2463
2466
|
}
|
|
2464
2467
|
}
|
|
2465
2468
|
class ee {
|
|
@@ -2470,11 +2473,11 @@ function Gi() {
|
|
|
2470
2473
|
return this.hooks.isSupported(e);
|
|
2471
2474
|
}
|
|
2472
2475
|
createConnection(e, t, r, o) {
|
|
2473
|
-
return new
|
|
2476
|
+
return new dn(this.hooks, e, t, r, o);
|
|
2474
2477
|
}
|
|
2475
2478
|
}
|
|
2476
|
-
var
|
|
2477
|
-
urls:
|
|
2479
|
+
var ln = new ee({
|
|
2480
|
+
urls: on,
|
|
2478
2481
|
handlesActivityChecks: !1,
|
|
2479
2482
|
supportsPing: !1,
|
|
2480
2483
|
isInitialized: function() {
|
|
@@ -2487,33 +2490,33 @@ function Gi() {
|
|
|
2487
2490
|
return w.createWebSocket(n);
|
|
2488
2491
|
}
|
|
2489
2492
|
}), Ve = {
|
|
2490
|
-
urls:
|
|
2493
|
+
urls: an,
|
|
2491
2494
|
handlesActivityChecks: !1,
|
|
2492
2495
|
supportsPing: !0,
|
|
2493
2496
|
isInitialized: function() {
|
|
2494
2497
|
return !0;
|
|
2495
2498
|
}
|
|
2496
|
-
}, Xe =
|
|
2499
|
+
}, Xe = z({
|
|
2497
2500
|
getSocket: function(n) {
|
|
2498
2501
|
return w.HTTPFactory.createStreamingSocket(n);
|
|
2499
2502
|
}
|
|
2500
|
-
}, Ve),
|
|
2503
|
+
}, Ve), Ge = z({
|
|
2501
2504
|
getSocket: function(n) {
|
|
2502
2505
|
return w.HTTPFactory.createPollingSocket(n);
|
|
2503
2506
|
}
|
|
2504
|
-
}, Ve),
|
|
2507
|
+
}, Ve), Je = {
|
|
2505
2508
|
isSupported: function() {
|
|
2506
2509
|
return w.isXHRSupported();
|
|
2507
2510
|
}
|
|
2508
|
-
},
|
|
2509
|
-
ws:
|
|
2510
|
-
xhr_streaming:
|
|
2511
|
-
xhr_polling:
|
|
2511
|
+
}, un = new ee(z({}, Xe, Je)), pn = new ee(z({}, Ge, Je)), fn = {
|
|
2512
|
+
ws: ln,
|
|
2513
|
+
xhr_streaming: un,
|
|
2514
|
+
xhr_polling: pn
|
|
2512
2515
|
};
|
|
2513
|
-
const ce =
|
|
2514
|
-
var
|
|
2516
|
+
const ce = fn;
|
|
2517
|
+
var mn = new ee({
|
|
2515
2518
|
file: "sockjs",
|
|
2516
|
-
urls:
|
|
2519
|
+
urls: cn,
|
|
2517
2520
|
handlesActivityChecks: !0,
|
|
2518
2521
|
supportsPing: !1,
|
|
2519
2522
|
isSupported: function() {
|
|
@@ -2524,7 +2527,7 @@ function Gi() {
|
|
|
2524
2527
|
},
|
|
2525
2528
|
getSocket: function(n, e) {
|
|
2526
2529
|
return new window.SockJS(n, null, {
|
|
2527
|
-
js_path:
|
|
2530
|
+
js_path: U.getPath("sockjs", {
|
|
2528
2531
|
useTLS: e.useTLS
|
|
2529
2532
|
}),
|
|
2530
2533
|
ignore_null_origin: e.ignoreNullOrigin
|
|
@@ -2535,15 +2538,15 @@ function Gi() {
|
|
|
2535
2538
|
path: e
|
|
2536
2539
|
}));
|
|
2537
2540
|
}
|
|
2538
|
-
}),
|
|
2541
|
+
}), Ke = {
|
|
2539
2542
|
isSupported: function(n) {
|
|
2540
2543
|
var e = w.isXDRSupported(n.useTLS);
|
|
2541
2544
|
return e;
|
|
2542
2545
|
}
|
|
2543
|
-
},
|
|
2544
|
-
ce.xdr_streaming =
|
|
2545
|
-
const
|
|
2546
|
-
class
|
|
2546
|
+
}, gn = new ee(z({}, Xe, Ke)), vn = new ee(z({}, Ge, Ke));
|
|
2547
|
+
ce.xdr_streaming = gn, ce.xdr_polling = vn, ce.sockjs = mn;
|
|
2548
|
+
const yn = ce;
|
|
2549
|
+
class bn extends V {
|
|
2547
2550
|
constructor() {
|
|
2548
2551
|
super();
|
|
2549
2552
|
var e = this;
|
|
@@ -2557,32 +2560,32 @@ function Gi() {
|
|
|
2557
2560
|
return window.navigator.onLine === void 0 ? !0 : window.navigator.onLine;
|
|
2558
2561
|
}
|
|
2559
2562
|
}
|
|
2560
|
-
var
|
|
2561
|
-
class
|
|
2563
|
+
var wn = new bn();
|
|
2564
|
+
class Cn {
|
|
2562
2565
|
constructor(e, t, r) {
|
|
2563
2566
|
this.manager = e, this.transport = t, this.minPingDelay = r.minPingDelay, this.maxPingDelay = r.maxPingDelay, this.pingDelay = void 0;
|
|
2564
2567
|
}
|
|
2565
2568
|
createConnection(e, t, r, o) {
|
|
2566
|
-
o =
|
|
2569
|
+
o = z({}, o, {
|
|
2567
2570
|
activityTimeout: this.pingDelay
|
|
2568
2571
|
});
|
|
2569
|
-
var c = this.transport.createConnection(e, t, r, o),
|
|
2570
|
-
c.unbind("open",
|
|
2571
|
-
}, b = (
|
|
2572
|
-
if (c.unbind("closed", b),
|
|
2572
|
+
var c = this.transport.createConnection(e, t, r, o), d = null, f = function() {
|
|
2573
|
+
c.unbind("open", f), c.bind("closed", b), d = N.now();
|
|
2574
|
+
}, b = (k) => {
|
|
2575
|
+
if (c.unbind("closed", b), k.code === 1002 || k.code === 1003)
|
|
2573
2576
|
this.manager.reportDeath();
|
|
2574
|
-
else if (!
|
|
2575
|
-
var
|
|
2576
|
-
|
|
2577
|
+
else if (!k.wasClean && d) {
|
|
2578
|
+
var _ = N.now() - d;
|
|
2579
|
+
_ < 2 * this.maxPingDelay && (this.manager.reportDeath(), this.pingDelay = Math.max(_ / 2, this.minPingDelay));
|
|
2577
2580
|
}
|
|
2578
2581
|
};
|
|
2579
|
-
return c.bind("open",
|
|
2582
|
+
return c.bind("open", f), c;
|
|
2580
2583
|
}
|
|
2581
2584
|
isSupported(e) {
|
|
2582
2585
|
return this.manager.isAlive() && this.transport.isSupported(e);
|
|
2583
2586
|
}
|
|
2584
2587
|
}
|
|
2585
|
-
const
|
|
2588
|
+
const Ye = {
|
|
2586
2589
|
decodeMessage: function(n) {
|
|
2587
2590
|
try {
|
|
2588
2591
|
var e = JSON.parse(n.data), t = e.data;
|
|
@@ -2605,7 +2608,7 @@ function Gi() {
|
|
|
2605
2608
|
return JSON.stringify(n);
|
|
2606
2609
|
},
|
|
2607
2610
|
processHandshake: function(n) {
|
|
2608
|
-
var e =
|
|
2611
|
+
var e = Ye.decodeMessage(n);
|
|
2609
2612
|
if (e.event === "pusher:connection_established") {
|
|
2610
2613
|
if (!e.data.activity_timeout)
|
|
2611
2614
|
throw "No activity timeout specified in handshake";
|
|
@@ -2635,8 +2638,8 @@ function Gi() {
|
|
|
2635
2638
|
}
|
|
2636
2639
|
} : null;
|
|
2637
2640
|
}
|
|
2638
|
-
},
|
|
2639
|
-
class
|
|
2641
|
+
}, Y = Ye;
|
|
2642
|
+
class Sn extends V {
|
|
2640
2643
|
constructor(e, t) {
|
|
2641
2644
|
super(), this.id = e, this.transport = t, this.activityTimeout = t.activityTimeout, this.bindListeners();
|
|
2642
2645
|
}
|
|
@@ -2648,7 +2651,7 @@ function Gi() {
|
|
|
2648
2651
|
}
|
|
2649
2652
|
send_event(e, t, r) {
|
|
2650
2653
|
var o = { event: e, data: t };
|
|
2651
|
-
return r && (o.channel = r),
|
|
2654
|
+
return r && (o.channel = r), P.debug("Event sent", o), this.send(Y.encodeMessage(o));
|
|
2652
2655
|
}
|
|
2653
2656
|
ping() {
|
|
2654
2657
|
this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
|
|
@@ -2661,7 +2664,7 @@ function Gi() {
|
|
|
2661
2664
|
message: (r) => {
|
|
2662
2665
|
var o;
|
|
2663
2666
|
try {
|
|
2664
|
-
o =
|
|
2667
|
+
o = Y.decodeMessage(r);
|
|
2665
2668
|
} catch (c) {
|
|
2666
2669
|
this.emit("error", {
|
|
2667
2670
|
type: "MessageParseError",
|
|
@@ -2670,7 +2673,7 @@ function Gi() {
|
|
|
2670
2673
|
});
|
|
2671
2674
|
}
|
|
2672
2675
|
if (o !== void 0) {
|
|
2673
|
-
switch (
|
|
2676
|
+
switch (P.debug("Event recd", o), o.event) {
|
|
2674
2677
|
case "pusher:error":
|
|
2675
2678
|
this.emit("error", {
|
|
2676
2679
|
type: "PusherError",
|
|
@@ -2706,11 +2709,11 @@ function Gi() {
|
|
|
2706
2709
|
});
|
|
2707
2710
|
}
|
|
2708
2711
|
handleCloseEvent(e) {
|
|
2709
|
-
var t =
|
|
2712
|
+
var t = Y.getCloseAction(e), r = Y.getCloseError(e);
|
|
2710
2713
|
r && this.emit("error", r), t && this.emit(t, { action: t, error: r });
|
|
2711
2714
|
}
|
|
2712
2715
|
}
|
|
2713
|
-
class
|
|
2716
|
+
class En {
|
|
2714
2717
|
constructor(e, t) {
|
|
2715
2718
|
this.transport = e, this.callback = t, this.bindListeners();
|
|
2716
2719
|
}
|
|
@@ -2722,18 +2725,18 @@ function Gi() {
|
|
|
2722
2725
|
this.unbindListeners();
|
|
2723
2726
|
var t;
|
|
2724
2727
|
try {
|
|
2725
|
-
t =
|
|
2728
|
+
t = Y.processHandshake(e);
|
|
2726
2729
|
} catch (r) {
|
|
2727
2730
|
this.finish("error", { error: r }), this.transport.close();
|
|
2728
2731
|
return;
|
|
2729
2732
|
}
|
|
2730
2733
|
t.action === "connected" ? this.finish("connected", {
|
|
2731
|
-
connection: new
|
|
2734
|
+
connection: new Sn(t.id, this.transport),
|
|
2732
2735
|
activityTimeout: t.activityTimeout
|
|
2733
2736
|
}) : (this.finish(t.action, { error: t.error }), this.transport.close());
|
|
2734
2737
|
}, this.onClosed = (e) => {
|
|
2735
2738
|
this.unbindListeners();
|
|
2736
|
-
var t =
|
|
2739
|
+
var t = Y.getCloseAction(e) || "backoff", r = Y.getCloseError(e);
|
|
2737
2740
|
this.finish(t, { error: r });
|
|
2738
2741
|
}, this.transport.bind("message", this.onMessage), this.transport.bind("closed", this.onClosed);
|
|
2739
2742
|
}
|
|
@@ -2741,10 +2744,10 @@ function Gi() {
|
|
|
2741
2744
|
this.transport.unbind("message", this.onMessage), this.transport.unbind("closed", this.onClosed);
|
|
2742
2745
|
}
|
|
2743
2746
|
finish(e, t) {
|
|
2744
|
-
this.callback(
|
|
2747
|
+
this.callback(z({ transport: this.transport, action: e }, t));
|
|
2745
2748
|
}
|
|
2746
2749
|
}
|
|
2747
|
-
class
|
|
2750
|
+
class xn {
|
|
2748
2751
|
constructor(e, t) {
|
|
2749
2752
|
this.timeline = e, this.options = t || {};
|
|
2750
2753
|
}
|
|
@@ -2755,7 +2758,7 @@ function Gi() {
|
|
|
2755
2758
|
class Ce extends V {
|
|
2756
2759
|
constructor(e, t) {
|
|
2757
2760
|
super(function(r, o) {
|
|
2758
|
-
|
|
2761
|
+
P.debug("No callbacks on " + e + " for " + r);
|
|
2759
2762
|
}), this.name = e, this.pusher = t, this.subscribed = !1, this.subscriptionPending = !1, this.subscriptionCancelled = !1;
|
|
2760
2763
|
}
|
|
2761
2764
|
authorize(e, t) {
|
|
@@ -2763,10 +2766,10 @@ function Gi() {
|
|
|
2763
2766
|
}
|
|
2764
2767
|
trigger(e, t) {
|
|
2765
2768
|
if (e.indexOf("client-") !== 0)
|
|
2766
|
-
throw new
|
|
2769
|
+
throw new p("Event '" + e + "' does not start with 'client-'");
|
|
2767
2770
|
if (!this.subscribed) {
|
|
2768
|
-
var r =
|
|
2769
|
-
|
|
2771
|
+
var r = x.buildLogSuffix("triggeringClientEvents");
|
|
2772
|
+
P.warn(`Client event triggered before channel 'subscription_succeeded' event . ${r}`);
|
|
2770
2773
|
}
|
|
2771
2774
|
return this.pusher.send_event(e, t, this.name);
|
|
2772
2775
|
}
|
|
@@ -2792,7 +2795,7 @@ function Gi() {
|
|
|
2792
2795
|
}
|
|
2793
2796
|
subscribe() {
|
|
2794
2797
|
this.subscribed || (this.subscriptionPending = !0, this.subscriptionCancelled = !1, this.authorize(this.pusher.connection.socket_id, (e, t) => {
|
|
2795
|
-
e ? (this.subscriptionPending = !1,
|
|
2798
|
+
e ? (this.subscriptionPending = !1, P.error(e.toString()), this.emit("pusher:subscription_error", Object.assign({}, {
|
|
2796
2799
|
type: "AuthError",
|
|
2797
2800
|
error: e.message
|
|
2798
2801
|
}, e instanceof H ? { status: e.status } : {}))) : this.pusher.send_event("pusher:subscribe", {
|
|
@@ -2822,7 +2825,7 @@ function Gi() {
|
|
|
2822
2825
|
}, t);
|
|
2823
2826
|
}
|
|
2824
2827
|
}
|
|
2825
|
-
class
|
|
2828
|
+
class Tn {
|
|
2826
2829
|
constructor() {
|
|
2827
2830
|
this.reset();
|
|
2828
2831
|
}
|
|
@@ -2854,39 +2857,39 @@ function Gi() {
|
|
|
2854
2857
|
this.members = {}, this.count = 0, this.myID = null, this.me = null;
|
|
2855
2858
|
}
|
|
2856
2859
|
}
|
|
2857
|
-
var
|
|
2860
|
+
var kn = function(n, e, t, r) {
|
|
2858
2861
|
function o(c) {
|
|
2859
|
-
return c instanceof t ? c : new t(function(
|
|
2860
|
-
|
|
2862
|
+
return c instanceof t ? c : new t(function(d) {
|
|
2863
|
+
d(c);
|
|
2861
2864
|
});
|
|
2862
2865
|
}
|
|
2863
|
-
return new (t || (t = Promise))(function(c,
|
|
2864
|
-
function
|
|
2866
|
+
return new (t || (t = Promise))(function(c, d) {
|
|
2867
|
+
function f(_) {
|
|
2865
2868
|
try {
|
|
2866
|
-
|
|
2867
|
-
} catch (
|
|
2868
|
-
|
|
2869
|
+
k(r.next(_));
|
|
2870
|
+
} catch (R) {
|
|
2871
|
+
d(R);
|
|
2869
2872
|
}
|
|
2870
2873
|
}
|
|
2871
|
-
function b(
|
|
2874
|
+
function b(_) {
|
|
2872
2875
|
try {
|
|
2873
|
-
|
|
2874
|
-
} catch (
|
|
2875
|
-
|
|
2876
|
+
k(r.throw(_));
|
|
2877
|
+
} catch (R) {
|
|
2878
|
+
d(R);
|
|
2876
2879
|
}
|
|
2877
2880
|
}
|
|
2878
|
-
function _
|
|
2879
|
-
|
|
2881
|
+
function k(_) {
|
|
2882
|
+
_.done ? c(_.value) : o(_.value).then(f, b);
|
|
2880
2883
|
}
|
|
2881
|
-
|
|
2884
|
+
k((r = r.apply(n, e || [])).next());
|
|
2882
2885
|
});
|
|
2883
2886
|
};
|
|
2884
|
-
class
|
|
2887
|
+
class _n extends Se {
|
|
2885
2888
|
constructor(e, t) {
|
|
2886
|
-
super(e, t), this.members = new
|
|
2889
|
+
super(e, t), this.members = new Tn();
|
|
2887
2890
|
}
|
|
2888
2891
|
authorize(e, t) {
|
|
2889
|
-
super.authorize(e, (r, o) =>
|
|
2892
|
+
super.authorize(e, (r, o) => kn(this, void 0, void 0, function* () {
|
|
2890
2893
|
if (!r)
|
|
2891
2894
|
if (o = o, o.channel_data != null) {
|
|
2892
2895
|
var c = JSON.parse(o.channel_data);
|
|
@@ -2894,8 +2897,8 @@ function Gi() {
|
|
|
2894
2897
|
} else if (yield this.pusher.user.signinDonePromise, this.pusher.user.user_data != null)
|
|
2895
2898
|
this.members.setMyID(this.pusher.user.user_data.id);
|
|
2896
2899
|
else {
|
|
2897
|
-
let
|
|
2898
|
-
|
|
2900
|
+
let d = x.buildLogSuffix("authorizationEndpoint");
|
|
2901
|
+
P.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${d}, or the user should be signed in.`), t("Invalid auth response");
|
|
2899
2902
|
return;
|
|
2900
2903
|
}
|
|
2901
2904
|
t(r, o);
|
|
@@ -2936,8 +2939,8 @@ function Gi() {
|
|
|
2936
2939
|
this.members.reset(), super.disconnect();
|
|
2937
2940
|
}
|
|
2938
2941
|
}
|
|
2939
|
-
var
|
|
2940
|
-
class
|
|
2942
|
+
var An = y(978), Ee = y(594);
|
|
2943
|
+
class Ln extends Se {
|
|
2941
2944
|
constructor(e, t, r) {
|
|
2942
2945
|
super(e, t), this.key = null, this.nacl = r;
|
|
2943
2946
|
}
|
|
@@ -2952,11 +2955,11 @@ function Gi() {
|
|
|
2952
2955
|
t(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`), null);
|
|
2953
2956
|
return;
|
|
2954
2957
|
}
|
|
2955
|
-
this.key = (0,
|
|
2958
|
+
this.key = (0, Ee.decode)(c), delete o.shared_secret, t(null, o);
|
|
2956
2959
|
});
|
|
2957
2960
|
}
|
|
2958
2961
|
trigger(e, t) {
|
|
2959
|
-
throw new
|
|
2962
|
+
throw new W("Client events are not currently supported for encrypted channels");
|
|
2960
2963
|
}
|
|
2961
2964
|
handleEvent(e) {
|
|
2962
2965
|
var t = e.event, r = e.data;
|
|
@@ -2968,32 +2971,32 @@ function Gi() {
|
|
|
2968
2971
|
}
|
|
2969
2972
|
handleEncryptedEvent(e, t) {
|
|
2970
2973
|
if (!this.key) {
|
|
2971
|
-
|
|
2974
|
+
P.debug("Received encrypted event before key has been retrieved from the authEndpoint");
|
|
2972
2975
|
return;
|
|
2973
2976
|
}
|
|
2974
2977
|
if (!t.ciphertext || !t.nonce) {
|
|
2975
|
-
|
|
2978
|
+
P.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: " + t);
|
|
2976
2979
|
return;
|
|
2977
2980
|
}
|
|
2978
|
-
let r = (0,
|
|
2981
|
+
let r = (0, Ee.decode)(t.ciphertext);
|
|
2979
2982
|
if (r.length < this.nacl.secretbox.overheadLength) {
|
|
2980
|
-
|
|
2983
|
+
P.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${r.length}`);
|
|
2981
2984
|
return;
|
|
2982
2985
|
}
|
|
2983
|
-
let o = (0,
|
|
2986
|
+
let o = (0, Ee.decode)(t.nonce);
|
|
2984
2987
|
if (o.length < this.nacl.secretbox.nonceLength) {
|
|
2985
|
-
|
|
2988
|
+
P.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${o.length}`);
|
|
2986
2989
|
return;
|
|
2987
2990
|
}
|
|
2988
2991
|
let c = this.nacl.secretbox.open(r, o, this.key);
|
|
2989
2992
|
if (c === null) {
|
|
2990
|
-
|
|
2991
|
-
if (
|
|
2992
|
-
|
|
2993
|
+
P.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."), this.authorize(this.pusher.connection.socket_id, (d, f) => {
|
|
2994
|
+
if (d) {
|
|
2995
|
+
P.error(`Failed to make a request to the authEndpoint: ${f}. Unable to fetch new key, so dropping encrypted event`);
|
|
2993
2996
|
return;
|
|
2994
2997
|
}
|
|
2995
2998
|
if (c = this.nacl.secretbox.open(r, o, this.key), c === null) {
|
|
2996
|
-
|
|
2999
|
+
P.error("Failed to decrypt event with new key. Dropping encrypted event");
|
|
2997
3000
|
return;
|
|
2998
3001
|
}
|
|
2999
3002
|
this.emit(e, this.getDataToEmit(c));
|
|
@@ -3003,7 +3006,7 @@ function Gi() {
|
|
|
3003
3006
|
this.emit(e, this.getDataToEmit(c));
|
|
3004
3007
|
}
|
|
3005
3008
|
getDataToEmit(e) {
|
|
3006
|
-
let t = (0,
|
|
3009
|
+
let t = (0, An.D4)(e);
|
|
3007
3010
|
try {
|
|
3008
3011
|
return JSON.parse(t);
|
|
3009
3012
|
} catch {
|
|
@@ -3011,7 +3014,7 @@ function Gi() {
|
|
|
3011
3014
|
}
|
|
3012
3015
|
}
|
|
3013
3016
|
}
|
|
3014
|
-
class
|
|
3017
|
+
class Pn extends V {
|
|
3015
3018
|
constructor(e, t) {
|
|
3016
3019
|
super(), this.state = "initialized", this.connection = null, this.key = e, this.options = t, this.timeline = this.options.timeline, this.usingTLS = this.options.useTLS, this.errorCallbacks = this.buildErrorCallbacks(), this.connectionCallbacks = this.buildConnectionCallbacks(this.errorCallbacks), this.handshakeCallbacks = this.buildHandshakeCallbacks(this.errorCallbacks);
|
|
3017
3020
|
var r = w.getNetwork();
|
|
@@ -3071,7 +3074,7 @@ function Gi() {
|
|
|
3071
3074
|
});
|
|
3072
3075
|
}
|
|
3073
3076
|
retryIn(e) {
|
|
3074
|
-
this.timeline.info({ action: "retry", delay: e }), e > 0 && this.emit("connecting_in", Math.round(e / 1e3)), this.retryTimer = new
|
|
3077
|
+
this.timeline.info({ action: "retry", delay: e }), e > 0 && this.emit("connecting_in", Math.round(e / 1e3)), this.retryTimer = new K(e || 0, () => {
|
|
3075
3078
|
this.disconnectInternally(), this.connect();
|
|
3076
3079
|
});
|
|
3077
3080
|
}
|
|
@@ -3079,7 +3082,7 @@ function Gi() {
|
|
|
3079
3082
|
this.retryTimer && (this.retryTimer.ensureAborted(), this.retryTimer = null);
|
|
3080
3083
|
}
|
|
3081
3084
|
setUnavailableTimer() {
|
|
3082
|
-
this.unavailableTimer = new
|
|
3085
|
+
this.unavailableTimer = new K(this.options.unavailableTimeout, () => {
|
|
3083
3086
|
this.updateState("unavailable");
|
|
3084
3087
|
});
|
|
3085
3088
|
}
|
|
@@ -3087,12 +3090,12 @@ function Gi() {
|
|
|
3087
3090
|
this.unavailableTimer && this.unavailableTimer.ensureAborted();
|
|
3088
3091
|
}
|
|
3089
3092
|
sendActivityCheck() {
|
|
3090
|
-
this.stopActivityCheck(), this.connection.ping(), this.activityTimer = new
|
|
3093
|
+
this.stopActivityCheck(), this.connection.ping(), this.activityTimer = new K(this.options.pongTimeout, () => {
|
|
3091
3094
|
this.timeline.error({ pong_timed_out: this.options.pongTimeout }), this.retryIn(0);
|
|
3092
3095
|
});
|
|
3093
3096
|
}
|
|
3094
3097
|
resetActivityCheck() {
|
|
3095
|
-
this.stopActivityCheck(), this.connection && !this.connection.handlesActivityChecks() && (this.activityTimer = new
|
|
3098
|
+
this.stopActivityCheck(), this.connection && !this.connection.handlesActivityChecks() && (this.activityTimer = new K(this.activityTimeout, () => {
|
|
3096
3099
|
this.sendActivityCheck();
|
|
3097
3100
|
}));
|
|
3098
3101
|
}
|
|
@@ -3100,7 +3103,7 @@ function Gi() {
|
|
|
3100
3103
|
this.activityTimer && this.activityTimer.ensureAborted();
|
|
3101
3104
|
}
|
|
3102
3105
|
buildConnectionCallbacks(e) {
|
|
3103
|
-
return
|
|
3106
|
+
return z({}, e, {
|
|
3104
3107
|
message: (t) => {
|
|
3105
3108
|
this.resetActivityCheck(), this.emit("message", t);
|
|
3106
3109
|
},
|
|
@@ -3119,7 +3122,7 @@ function Gi() {
|
|
|
3119
3122
|
});
|
|
3120
3123
|
}
|
|
3121
3124
|
buildHandshakeCallbacks(e) {
|
|
3122
|
-
return
|
|
3125
|
+
return z({}, e, {
|
|
3123
3126
|
connected: (t) => {
|
|
3124
3127
|
this.activityTimeout = Math.min(this.options.activityTimeout, t.activityTimeout, t.connection.activityTimeout || 1 / 0), this.clearUnavailableTimer(), this.setConnection(t.connection), this.socket_id = this.connection.id, this.updateState("connected", { socket_id: this.socket_id });
|
|
3125
3128
|
}
|
|
@@ -3163,22 +3166,22 @@ function Gi() {
|
|
|
3163
3166
|
var r = this.state;
|
|
3164
3167
|
if (this.state = e, r !== e) {
|
|
3165
3168
|
var o = e;
|
|
3166
|
-
o === "connected" && (o += " with new socket ID " + t.socket_id),
|
|
3169
|
+
o === "connected" && (o += " with new socket ID " + t.socket_id), P.debug("State changed", r + " -> " + o), this.timeline.info({ state: e, params: t }), this.emit("state_change", { previous: r, current: e }), this.emit(e, t);
|
|
3167
3170
|
}
|
|
3168
3171
|
}
|
|
3169
3172
|
shouldRetry() {
|
|
3170
3173
|
return this.state === "connecting" || this.state === "connected";
|
|
3171
3174
|
}
|
|
3172
3175
|
}
|
|
3173
|
-
class
|
|
3176
|
+
class Rn {
|
|
3174
3177
|
constructor() {
|
|
3175
3178
|
this.channels = {};
|
|
3176
3179
|
}
|
|
3177
3180
|
add(e, t) {
|
|
3178
|
-
return this.channels[e] || (this.channels[e] =
|
|
3181
|
+
return this.channels[e] || (this.channels[e] = In(e, t)), this.channels[e];
|
|
3179
3182
|
}
|
|
3180
3183
|
all() {
|
|
3181
|
-
return
|
|
3184
|
+
return Ft(this.channels);
|
|
3182
3185
|
}
|
|
3183
3186
|
find(e) {
|
|
3184
3187
|
return this.channels[e];
|
|
@@ -3193,12 +3196,12 @@ function Gi() {
|
|
|
3193
3196
|
});
|
|
3194
3197
|
}
|
|
3195
3198
|
}
|
|
3196
|
-
function
|
|
3199
|
+
function In(n, e) {
|
|
3197
3200
|
if (n.indexOf("private-encrypted-") === 0) {
|
|
3198
3201
|
if (e.config.nacl)
|
|
3199
3202
|
return X.createEncryptedChannel(n, e, e.config.nacl);
|
|
3200
|
-
let t = "Tried to subscribe to a private-encrypted- channel but no nacl implementation available", r =
|
|
3201
|
-
throw new
|
|
3203
|
+
let t = "Tried to subscribe to a private-encrypted- channel but no nacl implementation available", r = x.buildLogSuffix("encryptedChannelSupport");
|
|
3204
|
+
throw new W(`${t}. ${r}`);
|
|
3202
3205
|
} else {
|
|
3203
3206
|
if (n.indexOf("private-") === 0)
|
|
3204
3207
|
return X.createPrivateChannel(n, e);
|
|
@@ -3209,12 +3212,12 @@ function Gi() {
|
|
|
3209
3212
|
return X.createChannel(n, e);
|
|
3210
3213
|
}
|
|
3211
3214
|
}
|
|
3212
|
-
var
|
|
3215
|
+
var jn = {
|
|
3213
3216
|
createChannels() {
|
|
3214
|
-
return new
|
|
3217
|
+
return new Rn();
|
|
3215
3218
|
},
|
|
3216
3219
|
createConnectionManager(n, e) {
|
|
3217
|
-
return new
|
|
3220
|
+
return new Pn(n, e);
|
|
3218
3221
|
},
|
|
3219
3222
|
createChannel(n, e) {
|
|
3220
3223
|
return new Ce(n, e);
|
|
@@ -3223,22 +3226,22 @@ function Gi() {
|
|
|
3223
3226
|
return new Se(n, e);
|
|
3224
3227
|
},
|
|
3225
3228
|
createPresenceChannel(n, e) {
|
|
3226
|
-
return new
|
|
3229
|
+
return new _n(n, e);
|
|
3227
3230
|
},
|
|
3228
3231
|
createEncryptedChannel(n, e, t) {
|
|
3229
|
-
return new
|
|
3232
|
+
return new Ln(n, e, t);
|
|
3230
3233
|
},
|
|
3231
3234
|
createTimelineSender(n, e) {
|
|
3232
|
-
return new
|
|
3235
|
+
return new xn(n, e);
|
|
3233
3236
|
},
|
|
3234
3237
|
createHandshake(n, e) {
|
|
3235
|
-
return new
|
|
3238
|
+
return new En(n, e);
|
|
3236
3239
|
},
|
|
3237
3240
|
createAssistantToTheTransportManager(n, e, t) {
|
|
3238
|
-
return new
|
|
3241
|
+
return new Cn(n, e, t);
|
|
3239
3242
|
}
|
|
3240
3243
|
};
|
|
3241
|
-
const X =
|
|
3244
|
+
const X = jn;
|
|
3242
3245
|
class Qe {
|
|
3243
3246
|
constructor(e) {
|
|
3244
3247
|
this.options = e || {}, this.livesLeft = this.options.lives || 1 / 0;
|
|
@@ -3261,65 +3264,65 @@ function Gi() {
|
|
|
3261
3264
|
this.strategies = e, this.loop = !!t.loop, this.failFast = !!t.failFast, this.timeout = t.timeout, this.timeoutLimit = t.timeoutLimit;
|
|
3262
3265
|
}
|
|
3263
3266
|
isSupported() {
|
|
3264
|
-
return $e(this.strategies,
|
|
3267
|
+
return $e(this.strategies, N.method("isSupported"));
|
|
3265
3268
|
}
|
|
3266
3269
|
connect(e, t) {
|
|
3267
|
-
var r = this.strategies, o = 0, c = this.timeout,
|
|
3268
|
-
|
|
3270
|
+
var r = this.strategies, o = 0, c = this.timeout, d = null, f = (b, k) => {
|
|
3271
|
+
k ? t(null, k) : (o = o + 1, this.loop && (o = o % r.length), o < r.length ? (c && (c = c * 2, this.timeoutLimit && (c = Math.min(c, this.timeoutLimit))), d = this.tryStrategy(r[o], e, { timeout: c, failFast: this.failFast }, f)) : t(!0));
|
|
3269
3272
|
};
|
|
3270
|
-
return
|
|
3273
|
+
return d = this.tryStrategy(r[o], e, { timeout: c, failFast: this.failFast }, f), {
|
|
3271
3274
|
abort: function() {
|
|
3272
|
-
|
|
3275
|
+
d.abort();
|
|
3273
3276
|
},
|
|
3274
3277
|
forceMinPriority: function(b) {
|
|
3275
|
-
e = b,
|
|
3278
|
+
e = b, d && d.forceMinPriority(b);
|
|
3276
3279
|
}
|
|
3277
3280
|
};
|
|
3278
3281
|
}
|
|
3279
3282
|
tryStrategy(e, t, r, o) {
|
|
3280
|
-
var c = null,
|
|
3281
|
-
return r.timeout > 0 && (c = new
|
|
3282
|
-
|
|
3283
|
-
})),
|
|
3284
|
-
|
|
3283
|
+
var c = null, d = null;
|
|
3284
|
+
return r.timeout > 0 && (c = new K(r.timeout, function() {
|
|
3285
|
+
d.abort(), o(!0);
|
|
3286
|
+
})), d = e.connect(t, function(f, b) {
|
|
3287
|
+
f && c && c.isRunning() && !r.failFast || (c && c.ensureAborted(), o(f, b));
|
|
3285
3288
|
}), {
|
|
3286
3289
|
abort: function() {
|
|
3287
|
-
c && c.ensureAborted(),
|
|
3290
|
+
c && c.ensureAborted(), d.abort();
|
|
3288
3291
|
},
|
|
3289
|
-
forceMinPriority: function(
|
|
3290
|
-
|
|
3292
|
+
forceMinPriority: function(f) {
|
|
3293
|
+
d.forceMinPriority(f);
|
|
3291
3294
|
}
|
|
3292
3295
|
};
|
|
3293
3296
|
}
|
|
3294
3297
|
}
|
|
3295
|
-
class
|
|
3298
|
+
class xe {
|
|
3296
3299
|
constructor(e) {
|
|
3297
3300
|
this.strategies = e;
|
|
3298
3301
|
}
|
|
3299
3302
|
isSupported() {
|
|
3300
|
-
return $e(this.strategies,
|
|
3303
|
+
return $e(this.strategies, N.method("isSupported"));
|
|
3301
3304
|
}
|
|
3302
3305
|
connect(e, t) {
|
|
3303
|
-
return
|
|
3304
|
-
return function(c,
|
|
3306
|
+
return On(this.strategies, e, function(r, o) {
|
|
3307
|
+
return function(c, d) {
|
|
3305
3308
|
if (o[r].error = c, c) {
|
|
3306
|
-
|
|
3309
|
+
Nn(o) && t(!0);
|
|
3307
3310
|
return;
|
|
3308
3311
|
}
|
|
3309
|
-
ie(o, function(
|
|
3310
|
-
|
|
3311
|
-
}), t(null,
|
|
3312
|
+
ie(o, function(f) {
|
|
3313
|
+
f.forceMinPriority(d.transport.priority);
|
|
3314
|
+
}), t(null, d);
|
|
3312
3315
|
};
|
|
3313
3316
|
});
|
|
3314
3317
|
}
|
|
3315
3318
|
}
|
|
3316
|
-
function
|
|
3317
|
-
var r =
|
|
3318
|
-
return o.connect(e, t(c,
|
|
3319
|
+
function On(n, e, t) {
|
|
3320
|
+
var r = De(n, function(o, c, d, f) {
|
|
3321
|
+
return o.connect(e, t(c, f));
|
|
3319
3322
|
});
|
|
3320
3323
|
return {
|
|
3321
3324
|
abort: function() {
|
|
3322
|
-
ie(r,
|
|
3325
|
+
ie(r, Un);
|
|
3323
3326
|
},
|
|
3324
3327
|
forceMinPriority: function(o) {
|
|
3325
3328
|
ie(r, function(c) {
|
|
@@ -3328,12 +3331,12 @@ function Gi() {
|
|
|
3328
3331
|
}
|
|
3329
3332
|
};
|
|
3330
3333
|
}
|
|
3331
|
-
function
|
|
3332
|
-
return
|
|
3334
|
+
function Nn(n) {
|
|
3335
|
+
return Xt(n, function(e) {
|
|
3333
3336
|
return !!e.error;
|
|
3334
3337
|
});
|
|
3335
3338
|
}
|
|
3336
|
-
function
|
|
3339
|
+
function Un(n) {
|
|
3337
3340
|
!n.error && !n.aborted && (n.abort(), n.aborted = !0);
|
|
3338
3341
|
}
|
|
3339
3342
|
class qn {
|
|
@@ -3344,39 +3347,39 @@ function Gi() {
|
|
|
3344
3347
|
return this.strategy.isSupported();
|
|
3345
3348
|
}
|
|
3346
3349
|
connect(e, t) {
|
|
3347
|
-
var r = this.usingTLS, o =
|
|
3348
|
-
if (o && o.timestamp + this.ttl >=
|
|
3349
|
-
var
|
|
3350
|
-
|
|
3350
|
+
var r = this.usingTLS, o = zn(r), c = o && o.cacheSkipCount ? o.cacheSkipCount : 0, d = [this.strategy];
|
|
3351
|
+
if (o && o.timestamp + this.ttl >= N.now()) {
|
|
3352
|
+
var f = this.transports[o.transport];
|
|
3353
|
+
f && (["ws", "wss"].includes(o.transport) || c > 3 ? (this.timeline.info({
|
|
3351
3354
|
cached: !0,
|
|
3352
3355
|
transport: o.transport,
|
|
3353
3356
|
latency: o.latency
|
|
3354
|
-
}),
|
|
3357
|
+
}), d.push(new Q([f], {
|
|
3355
3358
|
timeout: o.latency * 2 + 1e3,
|
|
3356
3359
|
failFast: !0
|
|
3357
3360
|
}))) : c++);
|
|
3358
3361
|
}
|
|
3359
|
-
var b =
|
|
3360
|
-
|
|
3362
|
+
var b = N.now(), k = d.pop().connect(e, function _(R, ue) {
|
|
3363
|
+
R ? (Ze(r), d.length > 0 ? (b = N.now(), k = d.pop().connect(e, _)) : t(R)) : (Wn(r, ue.transport.name, N.now() - b, c), t(null, ue));
|
|
3361
3364
|
});
|
|
3362
3365
|
return {
|
|
3363
3366
|
abort: function() {
|
|
3364
|
-
|
|
3367
|
+
k.abort();
|
|
3365
3368
|
},
|
|
3366
|
-
forceMinPriority: function(
|
|
3367
|
-
e =
|
|
3369
|
+
forceMinPriority: function(_) {
|
|
3370
|
+
e = _, k && k.forceMinPriority(_);
|
|
3368
3371
|
}
|
|
3369
3372
|
};
|
|
3370
3373
|
}
|
|
3371
3374
|
}
|
|
3372
|
-
function
|
|
3375
|
+
function Te(n) {
|
|
3373
3376
|
return "pusherTransport" + (n ? "TLS" : "NonTLS");
|
|
3374
3377
|
}
|
|
3375
|
-
function
|
|
3378
|
+
function zn(n) {
|
|
3376
3379
|
var e = w.getLocalStorage();
|
|
3377
3380
|
if (e)
|
|
3378
3381
|
try {
|
|
3379
|
-
var t = e[
|
|
3382
|
+
var t = e[Te(n)];
|
|
3380
3383
|
if (t)
|
|
3381
3384
|
return JSON.parse(t);
|
|
3382
3385
|
} catch {
|
|
@@ -3384,12 +3387,12 @@ function Gi() {
|
|
|
3384
3387
|
}
|
|
3385
3388
|
return null;
|
|
3386
3389
|
}
|
|
3387
|
-
function
|
|
3390
|
+
function Wn(n, e, t, r) {
|
|
3388
3391
|
var o = w.getLocalStorage();
|
|
3389
3392
|
if (o)
|
|
3390
3393
|
try {
|
|
3391
|
-
o[
|
|
3392
|
-
timestamp:
|
|
3394
|
+
o[Te(n)] = ae({
|
|
3395
|
+
timestamp: N.now(),
|
|
3393
3396
|
transport: e,
|
|
3394
3397
|
latency: t,
|
|
3395
3398
|
cacheSkipCount: r
|
|
@@ -3401,7 +3404,7 @@ function Gi() {
|
|
|
3401
3404
|
var e = w.getLocalStorage();
|
|
3402
3405
|
if (e)
|
|
3403
3406
|
try {
|
|
3404
|
-
delete e[
|
|
3407
|
+
delete e[Te(n)];
|
|
3405
3408
|
} catch {
|
|
3406
3409
|
}
|
|
3407
3410
|
}
|
|
@@ -3413,15 +3416,15 @@ function Gi() {
|
|
|
3413
3416
|
return this.strategy.isSupported();
|
|
3414
3417
|
}
|
|
3415
3418
|
connect(e, t) {
|
|
3416
|
-
var r = this.strategy, o, c = new
|
|
3419
|
+
var r = this.strategy, o, c = new K(this.options.delay, function() {
|
|
3417
3420
|
o = r.connect(e, t);
|
|
3418
3421
|
});
|
|
3419
3422
|
return {
|
|
3420
3423
|
abort: function() {
|
|
3421
3424
|
c.ensureAborted(), o && o.abort();
|
|
3422
3425
|
},
|
|
3423
|
-
forceMinPriority: function(
|
|
3424
|
-
e =
|
|
3426
|
+
forceMinPriority: function(d) {
|
|
3427
|
+
e = d, o && o.forceMinPriority(d);
|
|
3425
3428
|
}
|
|
3426
3429
|
};
|
|
3427
3430
|
}
|
|
@@ -3439,7 +3442,7 @@ function Gi() {
|
|
|
3439
3442
|
return r.connect(e, t);
|
|
3440
3443
|
}
|
|
3441
3444
|
}
|
|
3442
|
-
class
|
|
3445
|
+
class Hn {
|
|
3443
3446
|
constructor(e) {
|
|
3444
3447
|
this.strategy = e;
|
|
3445
3448
|
}
|
|
@@ -3458,19 +3461,19 @@ function Gi() {
|
|
|
3458
3461
|
return n.isSupported();
|
|
3459
3462
|
};
|
|
3460
3463
|
}
|
|
3461
|
-
var
|
|
3464
|
+
var Mn = function(n, e, t) {
|
|
3462
3465
|
var r = {};
|
|
3463
|
-
function o(ut,
|
|
3464
|
-
var
|
|
3465
|
-
return r[ut] =
|
|
3466
|
+
function o(ut, zi, Wi, Hi, Mi) {
|
|
3467
|
+
var pt = t(n, ut, zi, Wi, Hi, Mi);
|
|
3468
|
+
return r[ut] = pt, pt;
|
|
3466
3469
|
}
|
|
3467
3470
|
var c = Object.assign({}, e, {
|
|
3468
3471
|
hostNonTLS: n.wsHost + ":" + n.wsPort,
|
|
3469
3472
|
hostTLS: n.wsHost + ":" + n.wssPort,
|
|
3470
3473
|
httpPath: n.wsPath
|
|
3471
|
-
}),
|
|
3474
|
+
}), d = Object.assign({}, c, {
|
|
3472
3475
|
useTLS: !0
|
|
3473
|
-
}),
|
|
3476
|
+
}), f = Object.assign({}, e, {
|
|
3474
3477
|
hostNonTLS: n.httpHost + ":" + n.httpPort,
|
|
3475
3478
|
hostTLS: n.httpHost + ":" + n.httpsPort,
|
|
3476
3479
|
httpPath: n.httpPath
|
|
@@ -3478,46 +3481,46 @@ function Gi() {
|
|
|
3478
3481
|
loop: !0,
|
|
3479
3482
|
timeout: 15e3,
|
|
3480
3483
|
timeoutLimit: 6e4
|
|
3481
|
-
},
|
|
3484
|
+
}, k = new Qe({
|
|
3482
3485
|
minPingDelay: 1e4,
|
|
3483
3486
|
maxPingDelay: n.activityTimeout
|
|
3484
|
-
}),
|
|
3487
|
+
}), _ = new Qe({
|
|
3485
3488
|
lives: 2,
|
|
3486
3489
|
minPingDelay: 1e4,
|
|
3487
3490
|
maxPingDelay: n.activityTimeout
|
|
3488
|
-
}),
|
|
3489
|
-
new re(se(ot), ot,
|
|
3490
|
-
], b), lt = new Q([
|
|
3491
|
-
new re(se(at), at, Ii)
|
|
3491
|
+
}), R = o("ws", "ws", 3, c, k), ue = o("wss", "ws", 3, d, k), ji = o("sockjs", "sockjs", 1, f), ot = o("xhr_streaming", "xhr_streaming", 1, f, _), Oi = o("xdr_streaming", "xdr_streaming", 1, f, _), at = o("xhr_polling", "xhr_polling", 1, f), Ni = o("xdr_polling", "xdr_polling", 1, f), ct = new Q([R], b), Ui = new Q([ue], b), qi = new Q([ji], b), ht = new Q([
|
|
3492
|
+
new re(se(ot), ot, Oi)
|
|
3492
3493
|
], b), dt = new Q([
|
|
3493
|
-
new re(se(
|
|
3494
|
+
new re(se(at), at, Ni)
|
|
3495
|
+
], b), lt = new Q([
|
|
3496
|
+
new re(se(ht), new xe([
|
|
3494
3497
|
ht,
|
|
3495
|
-
new he(
|
|
3496
|
-
]),
|
|
3497
|
-
], b), Ae = new re(se(
|
|
3498
|
-
return e.useTLS ? Le = new
|
|
3498
|
+
new he(dt, { delay: 4e3 })
|
|
3499
|
+
]), dt)
|
|
3500
|
+
], b), Ae = new re(se(lt), lt, qi), Le;
|
|
3501
|
+
return e.useTLS ? Le = new xe([
|
|
3499
3502
|
ct,
|
|
3500
3503
|
new he(Ae, { delay: 2e3 })
|
|
3501
|
-
]) : Le = new
|
|
3504
|
+
]) : Le = new xe([
|
|
3502
3505
|
ct,
|
|
3503
|
-
new he(
|
|
3506
|
+
new he(Ui, { delay: 2e3 }),
|
|
3504
3507
|
new he(Ae, { delay: 5e3 })
|
|
3505
|
-
]), new qn(new
|
|
3508
|
+
]), new qn(new Hn(new re(se(R), Le, Ae)), r, {
|
|
3506
3509
|
ttl: 18e5,
|
|
3507
3510
|
timeline: e.timeline,
|
|
3508
3511
|
useTLS: e.useTLS
|
|
3509
3512
|
});
|
|
3510
3513
|
};
|
|
3511
|
-
const
|
|
3512
|
-
function
|
|
3514
|
+
const Dn = Mn;
|
|
3515
|
+
function Bn() {
|
|
3513
3516
|
var n = this;
|
|
3514
3517
|
n.timeline.info(n.buildTimelineMessage({
|
|
3515
3518
|
transport: n.name + (n.options.useTLS ? "s" : "")
|
|
3516
|
-
})), n.hooks.isInitialized() ? n.changeState("initialized") : n.hooks.file ? (n.changeState("initializing"),
|
|
3519
|
+
})), n.hooks.isInitialized() ? n.changeState("initialized") : n.hooks.file ? (n.changeState("initializing"), U.load(n.hooks.file, { useTLS: n.options.useTLS }, function(e, t) {
|
|
3517
3520
|
n.hooks.isInitialized() ? (n.changeState("initialized"), t(!0)) : (e && n.onError(e), n.onClose(), t(!1));
|
|
3518
3521
|
})) : n.onClose();
|
|
3519
3522
|
}
|
|
3520
|
-
var
|
|
3523
|
+
var Fn = {
|
|
3521
3524
|
getRequest: function(n) {
|
|
3522
3525
|
var e = new window.XDomainRequest();
|
|
3523
3526
|
return e.ontimeout = function() {
|
|
@@ -3534,8 +3537,8 @@ function Gi() {
|
|
|
3534
3537
|
n.ontimeout = n.onerror = n.onprogress = n.onload = null, n.abort();
|
|
3535
3538
|
}
|
|
3536
3539
|
};
|
|
3537
|
-
const
|
|
3538
|
-
class
|
|
3540
|
+
const $n = Fn, Vn = 256 * 1024;
|
|
3541
|
+
class Xn extends V {
|
|
3539
3542
|
constructor(e, t, r) {
|
|
3540
3543
|
super(), this.hooks = e, this.method = t, this.url = r;
|
|
3541
3544
|
}
|
|
@@ -3563,18 +3566,18 @@ function Gi() {
|
|
|
3563
3566
|
return r !== -1 ? (this.position += r + 1, t.slice(0, r)) : null;
|
|
3564
3567
|
}
|
|
3565
3568
|
isBufferTooLong(e) {
|
|
3566
|
-
return this.position === e.length && e.length >
|
|
3569
|
+
return this.position === e.length && e.length > Vn;
|
|
3567
3570
|
}
|
|
3568
3571
|
}
|
|
3569
|
-
var
|
|
3572
|
+
var ke;
|
|
3570
3573
|
(function(n) {
|
|
3571
3574
|
n[n.CONNECTING = 0] = "CONNECTING", n[n.OPEN = 1] = "OPEN", n[n.CLOSED = 3] = "CLOSED";
|
|
3572
|
-
})(
|
|
3573
|
-
const Z =
|
|
3574
|
-
var
|
|
3575
|
-
class
|
|
3575
|
+
})(ke || (ke = {}));
|
|
3576
|
+
const Z = ke;
|
|
3577
|
+
var Gn = 1;
|
|
3578
|
+
class Jn {
|
|
3576
3579
|
constructor(e, t) {
|
|
3577
|
-
this.hooks = e, this.session = tt(1e3) + "/" +
|
|
3580
|
+
this.hooks = e, this.session = tt(1e3) + "/" + Zn(8), this.location = Kn(t), this.readyState = Z.CONNECTING, this.openStream();
|
|
3578
3581
|
}
|
|
3579
3582
|
send(e) {
|
|
3580
3583
|
return this.sendRaw(JSON.stringify([e]));
|
|
@@ -3588,7 +3591,7 @@ function Gi() {
|
|
|
3588
3591
|
sendRaw(e) {
|
|
3589
3592
|
if (this.readyState === Z.OPEN)
|
|
3590
3593
|
try {
|
|
3591
|
-
return w.createSocketRequest("POST", et(
|
|
3594
|
+
return w.createSocketRequest("POST", et(Yn(this.location, this.session))).start(e), !0;
|
|
3592
3595
|
} catch {
|
|
3593
3596
|
return !1;
|
|
3594
3597
|
}
|
|
@@ -3631,7 +3634,7 @@ function Gi() {
|
|
|
3631
3634
|
}
|
|
3632
3635
|
}
|
|
3633
3636
|
onOpen(e) {
|
|
3634
|
-
this.readyState === Z.CONNECTING ? (e && e.hostname && (this.location.base =
|
|
3637
|
+
this.readyState === Z.CONNECTING ? (e && e.hostname && (this.location.base = Qn(this.location.base, e.hostname)), this.readyState = Z.OPEN, this.onopen && this.onopen()) : this.onClose(1006, "Server lost session", !0);
|
|
3635
3638
|
}
|
|
3636
3639
|
onEvent(e) {
|
|
3637
3640
|
this.readyState === Z.OPEN && this.onmessage && this.onmessage({ data: e });
|
|
@@ -3653,7 +3656,7 @@ function Gi() {
|
|
|
3653
3656
|
try {
|
|
3654
3657
|
this.stream.start();
|
|
3655
3658
|
} catch (e) {
|
|
3656
|
-
|
|
3659
|
+
N.defer(() => {
|
|
3657
3660
|
this.onError(e), this.onClose(1006, "Could not start streaming", !1);
|
|
3658
3661
|
});
|
|
3659
3662
|
}
|
|
@@ -3662,34 +3665,34 @@ function Gi() {
|
|
|
3662
3665
|
this.stream && (this.stream.unbind_all(), this.stream.close(), this.stream = null);
|
|
3663
3666
|
}
|
|
3664
3667
|
}
|
|
3665
|
-
function
|
|
3668
|
+
function Kn(n) {
|
|
3666
3669
|
var e = /([^\?]*)\/*(\??.*)/.exec(n);
|
|
3667
3670
|
return {
|
|
3668
3671
|
base: e[1],
|
|
3669
3672
|
queryString: e[2]
|
|
3670
3673
|
};
|
|
3671
3674
|
}
|
|
3672
|
-
function
|
|
3675
|
+
function Yn(n, e) {
|
|
3673
3676
|
return n.base + "/" + e + "/xhr_send";
|
|
3674
3677
|
}
|
|
3675
3678
|
function et(n) {
|
|
3676
3679
|
var e = n.indexOf("?") === -1 ? "?" : "&";
|
|
3677
|
-
return n + e + "t=" + +/* @__PURE__ */ new Date() + "&n=" +
|
|
3680
|
+
return n + e + "t=" + +/* @__PURE__ */ new Date() + "&n=" + Gn++;
|
|
3678
3681
|
}
|
|
3679
|
-
function
|
|
3682
|
+
function Qn(n, e) {
|
|
3680
3683
|
var t = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(n);
|
|
3681
3684
|
return t[1] + e + t[3];
|
|
3682
3685
|
}
|
|
3683
3686
|
function tt(n) {
|
|
3684
3687
|
return w.randomInt(n);
|
|
3685
3688
|
}
|
|
3686
|
-
function
|
|
3689
|
+
function Zn(n) {
|
|
3687
3690
|
for (var e = [], t = 0; t < n; t++)
|
|
3688
3691
|
e.push(tt(32).toString(32));
|
|
3689
3692
|
return e.join("");
|
|
3690
3693
|
}
|
|
3691
|
-
const
|
|
3692
|
-
var
|
|
3694
|
+
const ei = Jn;
|
|
3695
|
+
var ti = {
|
|
3693
3696
|
getReceiveURL: function(n, e) {
|
|
3694
3697
|
return n.base + "/" + e + "/xhr_streaming" + n.queryString;
|
|
3695
3698
|
},
|
|
@@ -3703,8 +3706,8 @@ function Gi() {
|
|
|
3703
3706
|
n.onClose(1006, "Connection interrupted (" + e + ")", !1);
|
|
3704
3707
|
}
|
|
3705
3708
|
};
|
|
3706
|
-
const
|
|
3707
|
-
var
|
|
3709
|
+
const ni = ti;
|
|
3710
|
+
var ii = {
|
|
3708
3711
|
getReceiveURL: function(n, e) {
|
|
3709
3712
|
return n.base + "/" + e + "/xhr" + n.queryString;
|
|
3710
3713
|
},
|
|
@@ -3717,8 +3720,8 @@ function Gi() {
|
|
|
3717
3720
|
e === 200 ? n.reconnect() : n.onClose(1006, "Connection interrupted (" + e + ")", !1);
|
|
3718
3721
|
}
|
|
3719
3722
|
};
|
|
3720
|
-
const
|
|
3721
|
-
var
|
|
3723
|
+
const ri = ii;
|
|
3724
|
+
var si = {
|
|
3722
3725
|
getRequest: function(n) {
|
|
3723
3726
|
var e = w.getXHRAPI(), t = new e();
|
|
3724
3727
|
return t.onreadystatechange = t.onprogress = function() {
|
|
@@ -3736,38 +3739,38 @@ function Gi() {
|
|
|
3736
3739
|
n.onreadystatechange = null, n.abort();
|
|
3737
3740
|
}
|
|
3738
3741
|
};
|
|
3739
|
-
const
|
|
3740
|
-
var
|
|
3742
|
+
const oi = si;
|
|
3743
|
+
var ai = {
|
|
3741
3744
|
createStreamingSocket(n) {
|
|
3742
|
-
return this.createSocket(
|
|
3745
|
+
return this.createSocket(ni, n);
|
|
3743
3746
|
},
|
|
3744
3747
|
createPollingSocket(n) {
|
|
3745
|
-
return this.createSocket(
|
|
3748
|
+
return this.createSocket(ri, n);
|
|
3746
3749
|
},
|
|
3747
3750
|
createSocket(n, e) {
|
|
3748
|
-
return new
|
|
3751
|
+
return new ei(n, e);
|
|
3749
3752
|
},
|
|
3750
3753
|
createXHR(n, e) {
|
|
3751
|
-
return this.createRequest(
|
|
3754
|
+
return this.createRequest(oi, n, e);
|
|
3752
3755
|
},
|
|
3753
3756
|
createRequest(n, e, t) {
|
|
3754
|
-
return new
|
|
3757
|
+
return new Xn(n, e, t);
|
|
3755
3758
|
}
|
|
3756
3759
|
};
|
|
3757
|
-
const nt =
|
|
3760
|
+
const nt = ai;
|
|
3758
3761
|
nt.createXDR = function(n, e) {
|
|
3759
|
-
return this.createRequest(
|
|
3762
|
+
return this.createRequest($n, n, e);
|
|
3760
3763
|
};
|
|
3761
|
-
var
|
|
3764
|
+
var ci = {
|
|
3762
3765
|
nextAuthCallbackID: 1,
|
|
3763
3766
|
auth_callbacks: {},
|
|
3764
3767
|
ScriptReceivers: S,
|
|
3765
|
-
DependenciesReceivers:
|
|
3766
|
-
getDefaultStrategy:
|
|
3767
|
-
Transports:
|
|
3768
|
-
transportConnectionInitializer:
|
|
3768
|
+
DependenciesReceivers: D,
|
|
3769
|
+
getDefaultStrategy: Dn,
|
|
3770
|
+
Transports: yn,
|
|
3771
|
+
transportConnectionInitializer: Bn,
|
|
3769
3772
|
HTTPFactory: nt,
|
|
3770
|
-
TimelineTransport:
|
|
3773
|
+
TimelineTransport: sn,
|
|
3771
3774
|
getXHRAPI() {
|
|
3772
3775
|
return window.XMLHttpRequest;
|
|
3773
3776
|
},
|
|
@@ -3779,7 +3782,7 @@ function Gi() {
|
|
|
3779
3782
|
var e = () => {
|
|
3780
3783
|
this.onDocumentBody(n.ready);
|
|
3781
3784
|
};
|
|
3782
|
-
window.JSON ? e() :
|
|
3785
|
+
window.JSON ? e() : U.load("json2", {}, e);
|
|
3783
3786
|
},
|
|
3784
3787
|
getDocument() {
|
|
3785
3788
|
return document;
|
|
@@ -3788,7 +3791,7 @@ function Gi() {
|
|
|
3788
3791
|
return this.getDocument().location.protocol;
|
|
3789
3792
|
},
|
|
3790
3793
|
getAuthorizers() {
|
|
3791
|
-
return { ajax:
|
|
3794
|
+
return { ajax: It, jsonp: Zt };
|
|
3792
3795
|
},
|
|
3793
3796
|
onDocumentBody(n) {
|
|
3794
3797
|
document.body ? n() : setTimeout(() => {
|
|
@@ -3796,10 +3799,10 @@ function Gi() {
|
|
|
3796
3799
|
}, 0);
|
|
3797
3800
|
},
|
|
3798
3801
|
createJSONPRequest(n, e) {
|
|
3799
|
-
return new
|
|
3802
|
+
return new tn(n, e);
|
|
3800
3803
|
},
|
|
3801
3804
|
createScriptRequest(n) {
|
|
3802
|
-
return new
|
|
3805
|
+
return new en(n);
|
|
3803
3806
|
},
|
|
3804
3807
|
getLocalStorage() {
|
|
3805
3808
|
try {
|
|
@@ -3819,7 +3822,7 @@ function Gi() {
|
|
|
3819
3822
|
return new ActiveXObject("Microsoft.XMLHTTP");
|
|
3820
3823
|
},
|
|
3821
3824
|
getNetwork() {
|
|
3822
|
-
return
|
|
3825
|
+
return wn;
|
|
3823
3826
|
},
|
|
3824
3827
|
createWebSocket(n) {
|
|
3825
3828
|
var e = this.getWebSocketAPI();
|
|
@@ -3852,33 +3855,33 @@ function Gi() {
|
|
|
3852
3855
|
}() * n);
|
|
3853
3856
|
}
|
|
3854
3857
|
};
|
|
3855
|
-
const w =
|
|
3856
|
-
var
|
|
3858
|
+
const w = ci;
|
|
3859
|
+
var _e;
|
|
3857
3860
|
(function(n) {
|
|
3858
3861
|
n[n.ERROR = 3] = "ERROR", n[n.INFO = 6] = "INFO", n[n.DEBUG = 7] = "DEBUG";
|
|
3859
|
-
})(
|
|
3860
|
-
const
|
|
3861
|
-
class
|
|
3862
|
+
})(_e || (_e = {}));
|
|
3863
|
+
const de = _e;
|
|
3864
|
+
class hi {
|
|
3862
3865
|
constructor(e, t, r) {
|
|
3863
3866
|
this.key = e, this.session = t, this.events = [], this.options = r || {}, this.sent = 0, this.uniqueID = 0;
|
|
3864
3867
|
}
|
|
3865
3868
|
log(e, t) {
|
|
3866
|
-
e <= this.options.level && (this.events.push(
|
|
3869
|
+
e <= this.options.level && (this.events.push(z({}, t, { timestamp: N.now() })), this.options.limit && this.events.length > this.options.limit && this.events.shift());
|
|
3867
3870
|
}
|
|
3868
3871
|
error(e) {
|
|
3869
|
-
this.log(
|
|
3872
|
+
this.log(de.ERROR, e);
|
|
3870
3873
|
}
|
|
3871
3874
|
info(e) {
|
|
3872
|
-
this.log(
|
|
3875
|
+
this.log(de.INFO, e);
|
|
3873
3876
|
}
|
|
3874
3877
|
debug(e) {
|
|
3875
|
-
this.log(
|
|
3878
|
+
this.log(de.DEBUG, e);
|
|
3876
3879
|
}
|
|
3877
3880
|
isEmpty() {
|
|
3878
3881
|
return this.events.length === 0;
|
|
3879
3882
|
}
|
|
3880
3883
|
send(e, t) {
|
|
3881
|
-
var r =
|
|
3884
|
+
var r = z({
|
|
3882
3885
|
session: this.session,
|
|
3883
3886
|
bundle: this.sent + 1,
|
|
3884
3887
|
key: this.key,
|
|
@@ -3896,7 +3899,7 @@ function Gi() {
|
|
|
3896
3899
|
return this.uniqueID++, this.uniqueID;
|
|
3897
3900
|
}
|
|
3898
3901
|
}
|
|
3899
|
-
class
|
|
3902
|
+
class di {
|
|
3900
3903
|
constructor(e, t, r, o) {
|
|
3901
3904
|
this.name = e, this.priority = t, this.transport = r, this.options = o || {};
|
|
3902
3905
|
}
|
|
@@ -3908,35 +3911,35 @@ function Gi() {
|
|
|
3908
3911
|
connect(e, t) {
|
|
3909
3912
|
if (this.isSupported()) {
|
|
3910
3913
|
if (this.priority < e)
|
|
3911
|
-
return it(new
|
|
3912
|
-
} else return it(new
|
|
3913
|
-
var r = !1, o = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), c = null,
|
|
3914
|
-
o.unbind("initialized",
|
|
3915
|
-
},
|
|
3916
|
-
c = X.createHandshake(o, function(
|
|
3917
|
-
r = !0,
|
|
3914
|
+
return it(new O(), t);
|
|
3915
|
+
} else return it(new M(), t);
|
|
3916
|
+
var r = !1, o = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), c = null, d = function() {
|
|
3917
|
+
o.unbind("initialized", d), o.connect();
|
|
3918
|
+
}, f = function() {
|
|
3919
|
+
c = X.createHandshake(o, function(R) {
|
|
3920
|
+
r = !0, _(), t(null, R);
|
|
3918
3921
|
});
|
|
3919
|
-
}, b = function(
|
|
3920
|
-
|
|
3921
|
-
}, _ = function() {
|
|
3922
|
-
k();
|
|
3923
|
-
var P;
|
|
3924
|
-
P = ae(o), t(new M(P));
|
|
3922
|
+
}, b = function(R) {
|
|
3923
|
+
_(), t(R);
|
|
3925
3924
|
}, k = function() {
|
|
3926
|
-
|
|
3925
|
+
_();
|
|
3926
|
+
var R;
|
|
3927
|
+
R = ae(o), t(new q(R));
|
|
3928
|
+
}, _ = function() {
|
|
3929
|
+
o.unbind("initialized", d), o.unbind("open", f), o.unbind("error", b), o.unbind("closed", k);
|
|
3927
3930
|
};
|
|
3928
|
-
return o.bind("initialized",
|
|
3931
|
+
return o.bind("initialized", d), o.bind("open", f), o.bind("error", b), o.bind("closed", k), o.initialize(), {
|
|
3929
3932
|
abort: () => {
|
|
3930
|
-
r || (
|
|
3933
|
+
r || (_(), c ? c.close() : o.close());
|
|
3931
3934
|
},
|
|
3932
|
-
forceMinPriority: (
|
|
3933
|
-
r || this.priority <
|
|
3935
|
+
forceMinPriority: (R) => {
|
|
3936
|
+
r || this.priority < R && (c ? c.close() : o.close());
|
|
3934
3937
|
}
|
|
3935
3938
|
};
|
|
3936
3939
|
}
|
|
3937
3940
|
}
|
|
3938
3941
|
function it(n, e) {
|
|
3939
|
-
return
|
|
3942
|
+
return N.defer(function() {
|
|
3940
3943
|
e(n);
|
|
3941
3944
|
}), {
|
|
3942
3945
|
abort: function() {
|
|
@@ -3945,20 +3948,20 @@ function Gi() {
|
|
|
3945
3948
|
}
|
|
3946
3949
|
};
|
|
3947
3950
|
}
|
|
3948
|
-
const { Transports:
|
|
3949
|
-
var
|
|
3950
|
-
var
|
|
3951
|
-
if (!
|
|
3952
|
-
throw new
|
|
3953
|
-
var
|
|
3954
|
-
return
|
|
3955
|
-
},
|
|
3951
|
+
const { Transports: li } = w;
|
|
3952
|
+
var ui = function(n, e, t, r, o, c) {
|
|
3953
|
+
var d = li[t];
|
|
3954
|
+
if (!d)
|
|
3955
|
+
throw new G(t);
|
|
3956
|
+
var f = (!n.enabledTransports || He(n.enabledTransports, e) !== -1) && (!n.disabledTransports || He(n.disabledTransports, e) === -1), b;
|
|
3957
|
+
return f ? (o = Object.assign({ ignoreNullOrigin: n.ignoreNullOrigin }, o), b = new di(e, r, c ? c.getAssistant(d) : d, o)) : b = pi, b;
|
|
3958
|
+
}, pi = {
|
|
3956
3959
|
isSupported: function() {
|
|
3957
3960
|
return !1;
|
|
3958
3961
|
},
|
|
3959
3962
|
connect: function(n, e) {
|
|
3960
|
-
var t =
|
|
3961
|
-
e(new
|
|
3963
|
+
var t = N.defer(function() {
|
|
3964
|
+
e(new M());
|
|
3962
3965
|
});
|
|
3963
3966
|
return {
|
|
3964
3967
|
abort: function() {
|
|
@@ -3969,14 +3972,14 @@ function Gi() {
|
|
|
3969
3972
|
};
|
|
3970
3973
|
}
|
|
3971
3974
|
};
|
|
3972
|
-
function
|
|
3975
|
+
function fi(n) {
|
|
3973
3976
|
if (n == null)
|
|
3974
3977
|
throw "You must pass an options object";
|
|
3975
3978
|
if (n.cluster == null)
|
|
3976
3979
|
throw "Options object must provide a cluster";
|
|
3977
|
-
"disableStats" in n &&
|
|
3980
|
+
"disableStats" in n && P.warn("The disableStats option is deprecated in favor of enableStats");
|
|
3978
3981
|
}
|
|
3979
|
-
const
|
|
3982
|
+
const mi = (n, e) => {
|
|
3980
3983
|
var t = "socket_id=" + encodeURIComponent(n.socketId);
|
|
3981
3984
|
for (var r in e.params)
|
|
3982
3985
|
t += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(e.params[r]);
|
|
@@ -3986,14 +3989,14 @@ function Gi() {
|
|
|
3986
3989
|
t += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(o[r]);
|
|
3987
3990
|
}
|
|
3988
3991
|
return t;
|
|
3989
|
-
},
|
|
3992
|
+
}, gi = (n) => {
|
|
3990
3993
|
if (typeof w.getAuthorizers()[n.transport] > "u")
|
|
3991
3994
|
throw `'${n.transport}' is not a recognized auth transport`;
|
|
3992
3995
|
return (e, t) => {
|
|
3993
|
-
const r =
|
|
3996
|
+
const r = mi(e, n);
|
|
3994
3997
|
w.getAuthorizers()[n.transport](w, r, n, u.UserAuthentication, t);
|
|
3995
3998
|
};
|
|
3996
|
-
},
|
|
3999
|
+
}, vi = (n, e) => {
|
|
3997
4000
|
var t = "socket_id=" + encodeURIComponent(n.socketId);
|
|
3998
4001
|
t += "&channel_name=" + encodeURIComponent(n.channelName);
|
|
3999
4002
|
for (var r in e.params)
|
|
@@ -4004,14 +4007,14 @@ function Gi() {
|
|
|
4004
4007
|
t += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(o[r]);
|
|
4005
4008
|
}
|
|
4006
4009
|
return t;
|
|
4007
|
-
},
|
|
4010
|
+
}, yi = (n) => {
|
|
4008
4011
|
if (typeof w.getAuthorizers()[n.transport] > "u")
|
|
4009
4012
|
throw `'${n.transport}' is not a recognized auth transport`;
|
|
4010
4013
|
return (e, t) => {
|
|
4011
|
-
const r =
|
|
4014
|
+
const r = vi(e, n);
|
|
4012
4015
|
w.getAuthorizers()[n.transport](w, r, n, u.ChannelAuthorization, t);
|
|
4013
4016
|
};
|
|
4014
|
-
},
|
|
4017
|
+
}, bi = (n, e, t) => {
|
|
4015
4018
|
const r = {
|
|
4016
4019
|
authTransport: e.transport,
|
|
4017
4020
|
authEndpoint: e.endpoint,
|
|
@@ -4021,73 +4024,73 @@ function Gi() {
|
|
|
4021
4024
|
}
|
|
4022
4025
|
};
|
|
4023
4026
|
return (o, c) => {
|
|
4024
|
-
const
|
|
4025
|
-
t(
|
|
4027
|
+
const d = n.channel(o.channelName);
|
|
4028
|
+
t(d, r).authorize(o.socketId, c);
|
|
4026
4029
|
};
|
|
4027
4030
|
};
|
|
4028
4031
|
function rt(n, e) {
|
|
4029
4032
|
let t = {
|
|
4030
|
-
activityTimeout: n.activityTimeout ||
|
|
4033
|
+
activityTimeout: n.activityTimeout || E.activityTimeout,
|
|
4031
4034
|
cluster: n.cluster,
|
|
4032
|
-
httpPath: n.httpPath ||
|
|
4033
|
-
httpPort: n.httpPort ||
|
|
4034
|
-
httpsPort: n.httpsPort ||
|
|
4035
|
-
pongTimeout: n.pongTimeout ||
|
|
4036
|
-
statsHost: n.statsHost ||
|
|
4037
|
-
unavailableTimeout: n.unavailableTimeout ||
|
|
4038
|
-
wsPath: n.wsPath ||
|
|
4039
|
-
wsPort: n.wsPort ||
|
|
4040
|
-
wssPort: n.wssPort ||
|
|
4041
|
-
enableStats:
|
|
4042
|
-
httpHost:
|
|
4043
|
-
useTLS:
|
|
4044
|
-
wsHost:
|
|
4045
|
-
userAuthenticator:
|
|
4046
|
-
channelAuthorizer:
|
|
4035
|
+
httpPath: n.httpPath || E.httpPath,
|
|
4036
|
+
httpPort: n.httpPort || E.httpPort,
|
|
4037
|
+
httpsPort: n.httpsPort || E.httpsPort,
|
|
4038
|
+
pongTimeout: n.pongTimeout || E.pongTimeout,
|
|
4039
|
+
statsHost: n.statsHost || E.stats_host,
|
|
4040
|
+
unavailableTimeout: n.unavailableTimeout || E.unavailableTimeout,
|
|
4041
|
+
wsPath: n.wsPath || E.wsPath,
|
|
4042
|
+
wsPort: n.wsPort || E.wsPort,
|
|
4043
|
+
wssPort: n.wssPort || E.wssPort,
|
|
4044
|
+
enableStats: xi(n),
|
|
4045
|
+
httpHost: wi(n),
|
|
4046
|
+
useTLS: Ei(n),
|
|
4047
|
+
wsHost: Ci(n),
|
|
4048
|
+
userAuthenticator: Ti(n),
|
|
4049
|
+
channelAuthorizer: _i(n, e)
|
|
4047
4050
|
};
|
|
4048
4051
|
return "disabledTransports" in n && (t.disabledTransports = n.disabledTransports), "enabledTransports" in n && (t.enabledTransports = n.enabledTransports), "ignoreNullOrigin" in n && (t.ignoreNullOrigin = n.ignoreNullOrigin), "timelineParams" in n && (t.timelineParams = n.timelineParams), "nacl" in n && (t.nacl = n.nacl), t;
|
|
4049
4052
|
}
|
|
4050
|
-
function
|
|
4051
|
-
return n.httpHost ? n.httpHost : n.cluster ? `sockjs-${n.cluster}.pusher.com` :
|
|
4053
|
+
function wi(n) {
|
|
4054
|
+
return n.httpHost ? n.httpHost : n.cluster ? `sockjs-${n.cluster}.pusher.com` : E.httpHost;
|
|
4052
4055
|
}
|
|
4053
|
-
function
|
|
4054
|
-
return n.wsHost ? n.wsHost :
|
|
4056
|
+
function Ci(n) {
|
|
4057
|
+
return n.wsHost ? n.wsHost : Si(n.cluster);
|
|
4055
4058
|
}
|
|
4056
|
-
function
|
|
4059
|
+
function Si(n) {
|
|
4057
4060
|
return `ws-${n}.pusher.com`;
|
|
4058
4061
|
}
|
|
4059
|
-
function
|
|
4062
|
+
function Ei(n) {
|
|
4060
4063
|
return w.getProtocol() === "https:" ? !0 : n.forceTLS !== !1;
|
|
4061
4064
|
}
|
|
4062
|
-
function
|
|
4065
|
+
function xi(n) {
|
|
4063
4066
|
return "enableStats" in n ? n.enableStats : "disableStats" in n ? !n.disableStats : !1;
|
|
4064
4067
|
}
|
|
4065
4068
|
const st = (n) => "customHandler" in n && n.customHandler != null;
|
|
4066
|
-
function
|
|
4067
|
-
const e = Object.assign(Object.assign({},
|
|
4068
|
-
return st(e) ? e.customHandler :
|
|
4069
|
+
function Ti(n) {
|
|
4070
|
+
const e = Object.assign(Object.assign({}, E.userAuthentication), n.userAuthentication);
|
|
4071
|
+
return st(e) ? e.customHandler : gi(e);
|
|
4069
4072
|
}
|
|
4070
|
-
function
|
|
4073
|
+
function ki(n, e) {
|
|
4071
4074
|
let t;
|
|
4072
4075
|
if ("channelAuthorization" in n)
|
|
4073
|
-
t = Object.assign(Object.assign({},
|
|
4076
|
+
t = Object.assign(Object.assign({}, E.channelAuthorization), n.channelAuthorization);
|
|
4074
4077
|
else if (t = {
|
|
4075
|
-
transport: n.authTransport ||
|
|
4076
|
-
endpoint: n.authEndpoint ||
|
|
4078
|
+
transport: n.authTransport || E.authTransport,
|
|
4079
|
+
endpoint: n.authEndpoint || E.authEndpoint
|
|
4077
4080
|
}, "auth" in n && ("params" in n.auth && (t.params = n.auth.params), "headers" in n.auth && (t.headers = n.auth.headers)), "authorizer" in n)
|
|
4078
4081
|
return {
|
|
4079
|
-
customHandler:
|
|
4082
|
+
customHandler: bi(e, t, n.authorizer)
|
|
4080
4083
|
};
|
|
4081
4084
|
return t;
|
|
4082
4085
|
}
|
|
4083
|
-
function
|
|
4084
|
-
const t =
|
|
4085
|
-
return st(t) ? t.customHandler :
|
|
4086
|
+
function _i(n, e) {
|
|
4087
|
+
const t = ki(n, e);
|
|
4088
|
+
return st(t) ? t.customHandler : yi(t);
|
|
4086
4089
|
}
|
|
4087
|
-
class
|
|
4090
|
+
class Ai extends V {
|
|
4088
4091
|
constructor(e) {
|
|
4089
4092
|
super(function(t, r) {
|
|
4090
|
-
|
|
4093
|
+
P.debug(`No callbacks on watchlist events for ${t}`);
|
|
4091
4094
|
}), this.pusher = e, this.bindWatchlistInternalEvent();
|
|
4092
4095
|
}
|
|
4093
4096
|
handleEvent(e) {
|
|
@@ -4102,20 +4105,20 @@ function Gi() {
|
|
|
4102
4105
|
});
|
|
4103
4106
|
}
|
|
4104
4107
|
}
|
|
4105
|
-
function
|
|
4108
|
+
function Li() {
|
|
4106
4109
|
let n, e;
|
|
4107
4110
|
return { promise: new Promise((r, o) => {
|
|
4108
4111
|
n = r, e = o;
|
|
4109
4112
|
}), resolve: n, reject: e };
|
|
4110
4113
|
}
|
|
4111
|
-
const
|
|
4112
|
-
class
|
|
4114
|
+
const Pi = Li;
|
|
4115
|
+
class Ri extends V {
|
|
4113
4116
|
constructor(e) {
|
|
4114
4117
|
super(function(t, r) {
|
|
4115
|
-
|
|
4118
|
+
P.debug("No callbacks on user for " + t);
|
|
4116
4119
|
}), this.signin_requested = !1, this.user_data = null, this.serverToUserChannel = null, this.signinDonePromise = null, this._signinDoneResolve = null, this._onAuthorize = (t, r) => {
|
|
4117
4120
|
if (t) {
|
|
4118
|
-
|
|
4121
|
+
P.warn(`Error during signin: ${t}`), this._cleanup();
|
|
4119
4122
|
return;
|
|
4120
4123
|
}
|
|
4121
4124
|
this.pusher.send_event("pusher:signin", {
|
|
@@ -4124,7 +4127,7 @@ function Gi() {
|
|
|
4124
4127
|
});
|
|
4125
4128
|
}, this.pusher = e, this.pusher.connection.bind("state_change", ({ previous: t, current: r }) => {
|
|
4126
4129
|
t !== "connected" && r === "connected" && this._signin(), t === "connected" && r !== "connected" && (this._cleanup(), this._newSigninPromiseIfNeeded());
|
|
4127
|
-
}), this.watchlist = new
|
|
4130
|
+
}), this.watchlist = new Ai(e), this.pusher.connection.bind("message", (t) => {
|
|
4128
4131
|
var r = t.event;
|
|
4129
4132
|
r === "pusher:signin_success" && this._onSigninSuccess(t.data), this.serverToUserChannel && this.serverToUserChannel.name === t.channel && this.serverToUserChannel.handleEvent(t);
|
|
4130
4133
|
});
|
|
@@ -4141,11 +4144,11 @@ function Gi() {
|
|
|
4141
4144
|
try {
|
|
4142
4145
|
this.user_data = JSON.parse(e.user_data);
|
|
4143
4146
|
} catch {
|
|
4144
|
-
|
|
4147
|
+
P.error(`Failed parsing user data after signin: ${e.user_data}`), this._cleanup();
|
|
4145
4148
|
return;
|
|
4146
4149
|
}
|
|
4147
4150
|
if (typeof this.user_data.id != "string" || this.user_data.id === "") {
|
|
4148
|
-
|
|
4151
|
+
P.error(`user_data doesn't contain an id. user_data: ${this.user_data}`), this._cleanup();
|
|
4149
4152
|
return;
|
|
4150
4153
|
}
|
|
4151
4154
|
this._signinDoneResolve(), this._subscribeChannels();
|
|
@@ -4164,7 +4167,7 @@ function Gi() {
|
|
|
4164
4167
|
_newSigninPromiseIfNeeded() {
|
|
4165
4168
|
if (!this.signin_requested || this.signinDonePromise && !this.signinDonePromise.done)
|
|
4166
4169
|
return;
|
|
4167
|
-
const { promise: e, resolve: t } =
|
|
4170
|
+
const { promise: e, resolve: t } = Pi();
|
|
4168
4171
|
e.done = !1;
|
|
4169
4172
|
const r = () => {
|
|
4170
4173
|
e.done = !0;
|
|
@@ -4179,23 +4182,23 @@ function Gi() {
|
|
|
4179
4182
|
I.instances[e].connect();
|
|
4180
4183
|
}
|
|
4181
4184
|
static getClientFeatures() {
|
|
4182
|
-
return
|
|
4185
|
+
return Me(Fe({ ws: w.Transports.ws }, function(e) {
|
|
4183
4186
|
return e.isSupported({});
|
|
4184
4187
|
}));
|
|
4185
4188
|
}
|
|
4186
4189
|
constructor(e, t) {
|
|
4187
|
-
|
|
4190
|
+
Ii(e), fi(t), this.key = e, this.options = t, this.config = rt(this.options, this), this.channels = X.createChannels(), this.global_emitter = new V(), this.sessionID = w.randomInt(1e9), this.timeline = new hi(this.key, this.sessionID, {
|
|
4188
4191
|
cluster: this.config.cluster,
|
|
4189
4192
|
features: I.getClientFeatures(),
|
|
4190
4193
|
params: this.config.timelineParams || {},
|
|
4191
4194
|
limit: 50,
|
|
4192
|
-
level:
|
|
4193
|
-
version:
|
|
4195
|
+
level: de.INFO,
|
|
4196
|
+
version: E.VERSION
|
|
4194
4197
|
}), this.config.enableStats && (this.timelineSender = X.createTimelineSender(this.timeline, {
|
|
4195
4198
|
host: this.config.statsHost,
|
|
4196
4199
|
path: "/timeline/v2/" + w.TimelineTransport.name
|
|
4197
4200
|
}));
|
|
4198
|
-
var r = (o) => w.getDefaultStrategy(this.config, o,
|
|
4201
|
+
var r = (o) => w.getDefaultStrategy(this.config, o, ui);
|
|
4199
4202
|
this.connection = X.createConnectionManager(this.key, {
|
|
4200
4203
|
getStrategy: r,
|
|
4201
4204
|
timeline: this.timeline,
|
|
@@ -4206,19 +4209,19 @@ function Gi() {
|
|
|
4206
4209
|
}), this.connection.bind("connected", () => {
|
|
4207
4210
|
this.subscribeAll(), this.timelineSender && this.timelineSender.send(this.connection.isUsingTLS());
|
|
4208
4211
|
}), this.connection.bind("message", (o) => {
|
|
4209
|
-
var c = o.event,
|
|
4212
|
+
var c = o.event, d = c.indexOf("pusher_internal:") === 0;
|
|
4210
4213
|
if (o.channel) {
|
|
4211
|
-
var
|
|
4212
|
-
|
|
4214
|
+
var f = this.channel(o.channel);
|
|
4215
|
+
f && f.handleEvent(o);
|
|
4213
4216
|
}
|
|
4214
|
-
|
|
4217
|
+
d || this.global_emitter.emit(o.event, o.data);
|
|
4215
4218
|
}), this.connection.bind("connecting", () => {
|
|
4216
4219
|
this.channels.disconnect();
|
|
4217
4220
|
}), this.connection.bind("disconnected", () => {
|
|
4218
4221
|
this.channels.disconnect();
|
|
4219
4222
|
}), this.connection.bind("error", (o) => {
|
|
4220
|
-
|
|
4221
|
-
}), I.instances.push(this), this.timeline.info({ instances: I.instances.length }), this.user = new
|
|
4223
|
+
P.warn(o);
|
|
4224
|
+
}), I.instances.push(this), this.timeline.info({ instances: I.instances.length }), this.user = new Ri(this), I.isReady && this.connect();
|
|
4222
4225
|
}
|
|
4223
4226
|
switchCluster(e) {
|
|
4224
4227
|
const { appKey: t, cluster: r } = e;
|
|
@@ -4233,7 +4236,7 @@ function Gi() {
|
|
|
4233
4236
|
connect() {
|
|
4234
4237
|
if (this.connection.connect(), this.timelineSender && !this.timelineSenderTimer) {
|
|
4235
4238
|
var e = this.connection.isUsingTLS(), t = this.timelineSender;
|
|
4236
|
-
this.timelineSenderTimer = new
|
|
4239
|
+
this.timelineSenderTimer = new Mt(6e4, function() {
|
|
4237
4240
|
t.send(e);
|
|
4238
4241
|
});
|
|
4239
4242
|
}
|
|
@@ -4280,8 +4283,8 @@ function Gi() {
|
|
|
4280
4283
|
}
|
|
4281
4284
|
}
|
|
4282
4285
|
I.instances = [], I.isReady = !1, I.logToConsole = !1, I.Runtime = w, I.ScriptReceivers = w.ScriptReceivers, I.DependenciesReceivers = w.DependenciesReceivers, I.auth_callbacks = w.auth_callbacks;
|
|
4283
|
-
const
|
|
4284
|
-
function
|
|
4286
|
+
const le = I;
|
|
4287
|
+
function Ii(n) {
|
|
4285
4288
|
if (n == null)
|
|
4286
4289
|
throw "You must pass your app key when you instantiate Pusher.";
|
|
4287
4290
|
}
|
|
@@ -4290,9 +4293,9 @@ function Gi() {
|
|
|
4290
4293
|
/******/
|
|
4291
4294
|
}, a = {};
|
|
4292
4295
|
function h(m) {
|
|
4293
|
-
var
|
|
4294
|
-
if (
|
|
4295
|
-
return
|
|
4296
|
+
var v = a[m];
|
|
4297
|
+
if (v !== void 0)
|
|
4298
|
+
return v.exports;
|
|
4296
4299
|
var y = a[m] = {
|
|
4297
4300
|
/******/
|
|
4298
4301
|
// no module.id needed
|
|
@@ -4304,18 +4307,18 @@ function Gi() {
|
|
|
4304
4307
|
};
|
|
4305
4308
|
return s[m].call(y.exports, y, y.exports, h), y.exports;
|
|
4306
4309
|
}
|
|
4307
|
-
h.d = (m,
|
|
4308
|
-
for (var y in
|
|
4309
|
-
h.o(
|
|
4310
|
-
}, h.o = (m,
|
|
4311
|
-
var
|
|
4312
|
-
return
|
|
4310
|
+
h.d = (m, v) => {
|
|
4311
|
+
for (var y in v)
|
|
4312
|
+
h.o(v, y) && !h.o(m, y) && Object.defineProperty(m, y, { enumerable: !0, get: v[y] });
|
|
4313
|
+
}, h.o = (m, v) => Object.prototype.hasOwnProperty.call(m, v);
|
|
4314
|
+
var l = h(721);
|
|
4315
|
+
return l;
|
|
4313
4316
|
})()
|
|
4314
4317
|
));
|
|
4315
|
-
})(
|
|
4318
|
+
})(Pe)), Pe.exports;
|
|
4316
4319
|
}
|
|
4317
|
-
var
|
|
4318
|
-
const
|
|
4320
|
+
var Zi = Qi();
|
|
4321
|
+
const er = /* @__PURE__ */ Yi(Zi), Re = "/vendor/sendity-client/tailwind.css", Pt = {
|
|
4319
4322
|
labels: {
|
|
4320
4323
|
email: "Email",
|
|
4321
4324
|
whatsapp: "WhatsApp"
|
|
@@ -4338,7 +4341,7 @@ const Ki = /* @__PURE__ */ Ji(Yi), Pe = "/vendor/sendity-client/tailwind.css", Q
|
|
|
4338
4341
|
Code: (Code)`,
|
|
4339
4342
|
whatsappText: "Sign me into (Host) with this code: (Code)"
|
|
4340
4343
|
}
|
|
4341
|
-
},
|
|
4344
|
+
}, tr = {
|
|
4342
4345
|
labels: {
|
|
4343
4346
|
email: "E-Mail",
|
|
4344
4347
|
whatsapp: "WhatsApp"
|
|
@@ -4361,7 +4364,7 @@ Code: (Code)`,
|
|
|
4361
4364
|
Code: (Code)`,
|
|
4362
4365
|
whatsappText: "Melde mich bei (Host) mit diesem Code an: (Code)"
|
|
4363
4366
|
}
|
|
4364
|
-
},
|
|
4367
|
+
}, nr = {
|
|
4365
4368
|
labels: {
|
|
4366
4369
|
email: "E-mail",
|
|
4367
4370
|
whatsapp: "WhatsApp"
|
|
@@ -4384,57 +4387,304 @@ Code: (Code)`,
|
|
|
4384
4387
|
Code : (Code)`,
|
|
4385
4388
|
whatsappText: "Connectez-moi à (Host) avec ce code : (Code)"
|
|
4386
4389
|
}
|
|
4387
|
-
}
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4390
|
+
}, ir = {
|
|
4391
|
+
labels: {
|
|
4392
|
+
email: "Correo electrónico",
|
|
4393
|
+
whatsapp: "WhatsApp"
|
|
4394
|
+
},
|
|
4395
|
+
ui: {
|
|
4396
|
+
sendCodePrompt: "Envía este código para continuar",
|
|
4397
|
+
successGreeting: "Hola, (Name)",
|
|
4398
|
+
by: "por",
|
|
4399
|
+
toPrefix: "a",
|
|
4400
|
+
footerWaiting: "Listo para recibir tu código…",
|
|
4401
|
+
footerWaitingUntil: "Listo para recibir tu código…",
|
|
4402
|
+
footerReturnedWaiting: "Esperando a que llegue tu mensaje…",
|
|
4403
|
+
codeExpired: "El código ha caducado, solicita uno nuevo.",
|
|
4404
|
+
getNewCode: "Solicitar nuevo código"
|
|
4405
|
+
},
|
|
4406
|
+
templates: {
|
|
4407
|
+
emailSubject: "Iniciar sesión en (Host) con este código: (Code)",
|
|
4408
|
+
emailBody: `Para autenticarte en (Host), envía este correo sin hacer cambios.
|
|
4409
|
+
|
|
4410
|
+
Código: (Code)`,
|
|
4411
|
+
whatsappText: "Iniciar sesión en (Host) con este código: (Code)"
|
|
4412
|
+
}
|
|
4413
|
+
}, rr = {
|
|
4414
|
+
labels: {
|
|
4415
|
+
email: "E-mail",
|
|
4416
|
+
whatsapp: "WhatsApp"
|
|
4417
|
+
},
|
|
4418
|
+
ui: {
|
|
4419
|
+
sendCodePrompt: "Invia questo codice per continuare",
|
|
4420
|
+
successGreeting: "Ciao, (Name)",
|
|
4421
|
+
by: "via",
|
|
4422
|
+
toPrefix: "a",
|
|
4423
|
+
footerWaiting: "Pronto a ricevere il tuo codice…",
|
|
4424
|
+
footerWaitingUntil: "Pronto a ricevere il tuo codice…",
|
|
4425
|
+
footerReturnedWaiting: "In attesa che arrivi il tuo messaggio…",
|
|
4426
|
+
codeExpired: "Codice scaduto, richiedine uno nuovo.",
|
|
4427
|
+
getNewCode: "Ottieni un nuovo codice"
|
|
4428
|
+
},
|
|
4429
|
+
templates: {
|
|
4430
|
+
emailSubject: "Accedi a (Host) con questo codice: (Code)",
|
|
4431
|
+
emailBody: `Per autenticarti con (Host), invia questa e-mail senza modifiche.
|
|
4432
|
+
|
|
4433
|
+
Codice: (Code)`,
|
|
4434
|
+
whatsappText: "Accedi a (Host) con questo codice: (Code)"
|
|
4435
|
+
}
|
|
4436
|
+
}, sr = {
|
|
4437
|
+
labels: {
|
|
4438
|
+
email: "E-mail",
|
|
4439
|
+
whatsapp: "WhatsApp"
|
|
4440
|
+
},
|
|
4441
|
+
ui: {
|
|
4442
|
+
sendCodePrompt: "Wyślij ten kod, aby kontynuować",
|
|
4443
|
+
successGreeting: "Cześć, (Name)",
|
|
4444
|
+
by: "przez",
|
|
4445
|
+
toPrefix: "do",
|
|
4446
|
+
footerWaiting: "Gotowe na odebranie Twojego kodu…",
|
|
4447
|
+
footerWaitingUntil: "Gotowe na odebranie Twojego kodu…",
|
|
4448
|
+
footerReturnedWaiting: "Czekamy, aż dotrze Twoja wiadomość…",
|
|
4449
|
+
codeExpired: "Kod wygasł, poproś o nowy.",
|
|
4450
|
+
getNewCode: "Pobierz nowy kod"
|
|
4451
|
+
},
|
|
4452
|
+
templates: {
|
|
4453
|
+
emailSubject: "Zaloguj mnie do (Host) tym kodem: (Code)",
|
|
4454
|
+
emailBody: `Aby uwierzytelnić się w (Host), wyślij tę wiadomość bez zmian.
|
|
4455
|
+
|
|
4456
|
+
Kod: (Code)`,
|
|
4457
|
+
whatsappText: "Zaloguj mnie do (Host) tym kodem: (Code)"
|
|
4458
|
+
}
|
|
4459
|
+
}, or = {
|
|
4460
|
+
labels: {
|
|
4461
|
+
email: "E-mail",
|
|
4462
|
+
whatsapp: "WhatsApp"
|
|
4463
|
+
},
|
|
4464
|
+
ui: {
|
|
4465
|
+
sendCodePrompt: "Pošli tento kód a pokračuj",
|
|
4466
|
+
successGreeting: "Ahoj, (Name)",
|
|
4467
|
+
by: "přes",
|
|
4468
|
+
toPrefix: "na",
|
|
4469
|
+
footerWaiting: "Připraveno přijmout tvůj kód…",
|
|
4470
|
+
footerWaitingUntil: "Připraveno přijmout tvůj kód…",
|
|
4471
|
+
footerReturnedWaiting: "Čekáme, až dorazí tvoje zpráva…",
|
|
4472
|
+
codeExpired: "Kód vypršel, vyžádej si nový.",
|
|
4473
|
+
getNewCode: "Získat nový kód"
|
|
4474
|
+
},
|
|
4475
|
+
templates: {
|
|
4476
|
+
emailSubject: "Přihlas mě do (Host) tímto kódem: (Code)",
|
|
4477
|
+
emailBody: `Pro ověření v (Host) odešli tento e-mail beze změn.
|
|
4478
|
+
|
|
4479
|
+
Kód: (Code)`,
|
|
4480
|
+
whatsappText: "Přihlas mě do (Host) tímto kódem: (Code)"
|
|
4481
|
+
}
|
|
4482
|
+
}, ar = {
|
|
4483
|
+
labels: {
|
|
4484
|
+
email: "E-mail",
|
|
4485
|
+
whatsapp: "WhatsApp"
|
|
4486
|
+
},
|
|
4487
|
+
ui: {
|
|
4488
|
+
sendCodePrompt: "Send denne kode for at fortsætte",
|
|
4489
|
+
successGreeting: "Hej, (Name)",
|
|
4490
|
+
by: "via",
|
|
4491
|
+
toPrefix: "til",
|
|
4492
|
+
footerWaiting: "Klar til at modtage din kode…",
|
|
4493
|
+
footerWaitingUntil: "Klar til at modtage din kode…",
|
|
4494
|
+
footerReturnedWaiting: "Venter på, at din besked ankommer…",
|
|
4495
|
+
codeExpired: "Koden er udløbet, anmod om en ny.",
|
|
4496
|
+
getNewCode: "Hent ny kode"
|
|
4497
|
+
},
|
|
4498
|
+
templates: {
|
|
4499
|
+
emailSubject: "Log mig ind på (Host) med denne kode: (Code)",
|
|
4500
|
+
emailBody: `For at godkende dig hos (Host), send denne e-mail uden ændringer.
|
|
4501
|
+
|
|
4502
|
+
Kode: (Code)`,
|
|
4503
|
+
whatsappText: "Log mig ind på (Host) med denne kode: (Code)"
|
|
4504
|
+
}
|
|
4505
|
+
}, cr = {
|
|
4506
|
+
labels: {
|
|
4507
|
+
email: "E-mail",
|
|
4508
|
+
whatsapp: "WhatsApp"
|
|
4509
|
+
},
|
|
4510
|
+
ui: {
|
|
4511
|
+
sendCodePrompt: "Stuur deze code om door te gaan",
|
|
4512
|
+
successGreeting: "Hallo, (Name)",
|
|
4513
|
+
by: "via",
|
|
4514
|
+
toPrefix: "naar",
|
|
4515
|
+
footerWaiting: "Klaar om je code te ontvangen…",
|
|
4516
|
+
footerWaitingUntil: "Klaar om je code te ontvangen…",
|
|
4517
|
+
footerReturnedWaiting: "Wachten tot je bericht aankomt…",
|
|
4518
|
+
codeExpired: "Code verlopen, vraag een nieuwe aan.",
|
|
4519
|
+
getNewCode: "Nieuwe code ophalen"
|
|
4520
|
+
},
|
|
4521
|
+
templates: {
|
|
4522
|
+
emailSubject: "Log me in bij (Host) met deze code: (Code)",
|
|
4523
|
+
emailBody: `Om je bij (Host) te authenticeren, verstuur je deze e-mail zonder wijzigingen.
|
|
4524
|
+
|
|
4525
|
+
Code: (Code)`,
|
|
4526
|
+
whatsappText: "Log me in bij (Host) met deze code: (Code)"
|
|
4527
|
+
}
|
|
4528
|
+
}, hr = {
|
|
4529
|
+
labels: {
|
|
4530
|
+
email: "E-pošta",
|
|
4531
|
+
whatsapp: "WhatsApp"
|
|
4532
|
+
},
|
|
4533
|
+
ui: {
|
|
4534
|
+
sendCodePrompt: "Pošalji ovaj kod za nastavak",
|
|
4535
|
+
successGreeting: "Bok, (Name)",
|
|
4536
|
+
by: "putem",
|
|
4537
|
+
toPrefix: "na",
|
|
4538
|
+
footerWaiting: "Spremno za primanje tvog koda…",
|
|
4539
|
+
footerWaitingUntil: "Spremno za primanje tvog koda…",
|
|
4540
|
+
footerReturnedWaiting: "Čekamo da stigne tvoja poruka…",
|
|
4541
|
+
codeExpired: "Kod je istekao, zatraži novi.",
|
|
4542
|
+
getNewCode: "Dohvati novi kod"
|
|
4543
|
+
},
|
|
4544
|
+
templates: {
|
|
4545
|
+
emailSubject: "Prijavi me u (Host) ovim kodom: (Code)",
|
|
4546
|
+
emailBody: `Za autentikaciju u (Host), pošalji ovu e-poštu bez izmjena.
|
|
4547
|
+
|
|
4548
|
+
Kod: (Code)`,
|
|
4549
|
+
whatsappText: "Prijavi me u (Host) ovim kodom: (Code)"
|
|
4396
4550
|
}
|
|
4551
|
+
}, dr = {
|
|
4552
|
+
labels: {
|
|
4553
|
+
email: "Ηλεκτρονικό ταχυδρομείο",
|
|
4554
|
+
whatsapp: "WhatsApp"
|
|
4555
|
+
},
|
|
4556
|
+
ui: {
|
|
4557
|
+
sendCodePrompt: "Στείλε αυτόν τον κωδικό για να συνεχίσεις",
|
|
4558
|
+
successGreeting: "Γεια σου, (Name)",
|
|
4559
|
+
by: "μέσω",
|
|
4560
|
+
toPrefix: "προς",
|
|
4561
|
+
footerWaiting: "Έτοιμο για λήψη του κωδικού σου…",
|
|
4562
|
+
footerWaitingUntil: "Έτοιμο για λήψη του κωδικού σου…",
|
|
4563
|
+
footerReturnedWaiting: "Περιμένουμε να φτάσει το μήνυμά σου…",
|
|
4564
|
+
codeExpired: "Ο κωδικός έληξε, ζήτησε νέο.",
|
|
4565
|
+
getNewCode: "Λήψη νέου κωδικού"
|
|
4566
|
+
},
|
|
4567
|
+
templates: {
|
|
4568
|
+
emailSubject: "Σύνδεσέ με στο (Host) με αυτόν τον κωδικό: (Code)",
|
|
4569
|
+
emailBody: `Για έλεγχο ταυτότητας στο (Host), στείλε αυτό το email χωρίς αλλαγές.
|
|
4570
|
+
|
|
4571
|
+
Κωδικός: (Code)`,
|
|
4572
|
+
whatsappText: "Σύνδεσέ με στο (Host) με αυτόν τον κωδικό: (Code)"
|
|
4573
|
+
}
|
|
4574
|
+
}, lr = {
|
|
4575
|
+
labels: {
|
|
4576
|
+
email: "E-posta",
|
|
4577
|
+
whatsapp: "WhatsApp"
|
|
4578
|
+
},
|
|
4579
|
+
ui: {
|
|
4580
|
+
sendCodePrompt: "Devam etmek için bu kodu gönder",
|
|
4581
|
+
successGreeting: "Merhaba, (Name)",
|
|
4582
|
+
by: "ile",
|
|
4583
|
+
toPrefix: "şuraya",
|
|
4584
|
+
footerWaiting: "Kodunu almaya hazır…",
|
|
4585
|
+
footerWaitingUntil: "Kodunu almaya hazır…",
|
|
4586
|
+
footerReturnedWaiting: "Mesajının gelmesi bekleniyor…",
|
|
4587
|
+
codeExpired: "Kodun süresi doldu, yeni bir tane iste.",
|
|
4588
|
+
getNewCode: "Yeni kod al"
|
|
4589
|
+
},
|
|
4590
|
+
templates: {
|
|
4591
|
+
emailSubject: "(Host) oturumumu bu kodla aç: (Code)",
|
|
4592
|
+
emailBody: `(Host) ile kimlik doğrulamak için bu e-postayı değiştirmeden gönder.
|
|
4593
|
+
|
|
4594
|
+
Kod: (Code)`,
|
|
4595
|
+
whatsappText: "(Host) oturumumu bu kodla aç: (Code)"
|
|
4596
|
+
}
|
|
4597
|
+
}, ur = {
|
|
4598
|
+
labels: {
|
|
4599
|
+
email: "E-Mail",
|
|
4600
|
+
whatsapp: "WhatsApp"
|
|
4601
|
+
},
|
|
4602
|
+
ui: {
|
|
4603
|
+
sendCodePrompt: "Schick de Code, dann geht’s weider",
|
|
4604
|
+
successGreeting: "Ei Gude, (Name)",
|
|
4605
|
+
by: "per",
|
|
4606
|
+
toPrefix: "an",
|
|
4607
|
+
footerWaiting: "Bereit fer dein Code…",
|
|
4608
|
+
footerWaitingUntil: "Bereit fer dein Code…",
|
|
4609
|
+
footerReturnedWaiting: "Mir warte, bis dei Nachricht kimmt…",
|
|
4610
|
+
codeExpired: "De Code is abgelaafe, hol der en neue.",
|
|
4611
|
+
getNewCode: "Neie Code hole"
|
|
4612
|
+
},
|
|
4613
|
+
templates: {
|
|
4614
|
+
emailSubject: "Logg misch bei (Host) mit dem Code oi: (Code)",
|
|
4615
|
+
emailBody: `Zum Oilogge bei (Host) schick die E-Mail ohne ebbes zu ännere.
|
|
4616
|
+
|
|
4617
|
+
Code: (Code)`,
|
|
4618
|
+
whatsappText: "Logg misch bei (Host) mit dem Code oi: (Code)"
|
|
4619
|
+
}
|
|
4620
|
+
}, pr = ["en", "de", "fr", "es", "it", "pl", "cs", "da", "nl", "hr", "el", "tr", "de-he"], fr = {
|
|
4621
|
+
en: Pt,
|
|
4622
|
+
de: tr,
|
|
4623
|
+
fr: nr,
|
|
4624
|
+
es: ir,
|
|
4625
|
+
it: rr,
|
|
4626
|
+
pl: sr,
|
|
4627
|
+
cs: or,
|
|
4628
|
+
da: ar,
|
|
4629
|
+
nl: cr,
|
|
4630
|
+
hr,
|
|
4631
|
+
el: dr,
|
|
4632
|
+
tr: lr,
|
|
4633
|
+
"de-he": ur
|
|
4634
|
+
};
|
|
4635
|
+
function vt(g) {
|
|
4636
|
+
return pr.includes(g);
|
|
4637
|
+
}
|
|
4638
|
+
function yt(g) {
|
|
4639
|
+
if (!g) return null;
|
|
4640
|
+
const i = g.trim().toLowerCase().replace("_", "-");
|
|
4641
|
+
if (vt(i)) return i;
|
|
4642
|
+
const s = i.split("-")[0];
|
|
4643
|
+
return vt(s) ? s : null;
|
|
4644
|
+
}
|
|
4645
|
+
function F(g) {
|
|
4646
|
+
return fr[g] ?? Pt;
|
|
4397
4647
|
}
|
|
4398
|
-
const
|
|
4399
|
-
`,
|
|
4400
|
-
function
|
|
4401
|
-
return `sendity:auth-request:${encodeURIComponent(
|
|
4648
|
+
const bt = `<svg role="img" viewBox="0 0 512 512" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>Email</title><path d="M64 112c-8.8 0-16 7.2-16 16l0 22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1l0-22.1c0-8.8-7.2-16-16-16L64 112zM48 212.2L48 384c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-171.8L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128z"/></svg>
|
|
4649
|
+
`, wt = '<svg role="img" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>WhatsApp</title><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>', mr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.998 9.332A5.002 5.002 0 0 1 13.2 5.5H11a1 1 0 1 0 0 2h4.5a1 1 0 0 0 1-1V2a1 1 0 1 0-2 0v1.74A7.002 7.002 0 0 0 3 9.332a1 1 0 1 0 1.998 0ZM15.002 10.668A5.002 5.002 0 0 1 6.8 14.5H9a1 1 0 1 0 0-2H4.5a1 1 0 0 0-1 1V18a1 1 0 1 0 2 0v-1.74a7.002 7.002 0 0 0 11.5-5.592 1 1 0 1 0-1.998 0Z" clip-rule="evenodd" /></svg>', gr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM7.22 6.22a.75.75 0 0 0-1.06 1.06L8.88 10l-2.72 2.72a.75.75 0 1 0 1.06 1.06L9.94 11.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L11 10l2.72-2.72a.75.75 0 0 0-1.06-1.06L9.94 8.94 7.22 6.22Z" clip-rule="evenodd" /></svg>', qe = "sendityAuthRequest", vr = "https://sendity.io/api/sendity", yr = 600 * 1e3, br = 5e3, wr = 15e3, Cr = 1e3, Ie = 2e3, fe = 220, Rt = 0;
|
|
4650
|
+
function ze(g, i) {
|
|
4651
|
+
return `sendity:auth-request:${encodeURIComponent(g)}:${encodeURIComponent(i)}`;
|
|
4402
4652
|
}
|
|
4403
|
-
function
|
|
4404
|
-
|
|
4405
|
-
const h =
|
|
4406
|
-
if (!
|
|
4653
|
+
function Ct(g, i, s, a = Date.now()) {
|
|
4654
|
+
g.removeItem(qe);
|
|
4655
|
+
const h = ze(i, s), l = g.getItem(h);
|
|
4656
|
+
if (!l) return null;
|
|
4407
4657
|
try {
|
|
4408
|
-
const m = JSON.parse(
|
|
4658
|
+
const m = JSON.parse(l);
|
|
4409
4659
|
if (typeof m.id != "string" || typeof m.clientSecret != "string" || typeof m.createdAt != "number")
|
|
4410
4660
|
throw new Error("invalid stored auth request");
|
|
4411
|
-
return a - m.createdAt >=
|
|
4661
|
+
return a - m.createdAt >= yr ? (g.removeItem(h), null) : { id: m.id, clientSecret: m.clientSecret };
|
|
4412
4662
|
} catch {
|
|
4413
|
-
return
|
|
4663
|
+
return g.removeItem(h), null;
|
|
4414
4664
|
}
|
|
4415
4665
|
}
|
|
4416
|
-
function
|
|
4417
|
-
|
|
4666
|
+
function Sr(g, i, s, a, h = Date.now()) {
|
|
4667
|
+
g.setItem(ze(i, s), JSON.stringify({ ...a, createdAt: h }));
|
|
4418
4668
|
}
|
|
4419
|
-
function
|
|
4420
|
-
|
|
4669
|
+
function St(g, i, s) {
|
|
4670
|
+
g.removeItem(ze(i, s)), g.removeItem(qe);
|
|
4421
4671
|
}
|
|
4422
4672
|
function me() {
|
|
4423
|
-
return window.localStorage.removeItem(
|
|
4673
|
+
return window.localStorage.removeItem(qe), window.sessionStorage;
|
|
4424
4674
|
}
|
|
4425
|
-
function
|
|
4426
|
-
return
|
|
4675
|
+
function Er(g, i = window.location.origin) {
|
|
4676
|
+
return g.filter((s) => xr(s, i));
|
|
4427
4677
|
}
|
|
4428
|
-
function
|
|
4678
|
+
function xr(g, i) {
|
|
4429
4679
|
try {
|
|
4430
|
-
const s = new URL(
|
|
4680
|
+
const s = new URL(g, i);
|
|
4431
4681
|
return ["http:", "https:", "mailto:", "whatsapp:"].includes(s.protocol);
|
|
4432
4682
|
} catch {
|
|
4433
4683
|
return !1;
|
|
4434
4684
|
}
|
|
4435
4685
|
}
|
|
4436
|
-
function
|
|
4437
|
-
return
|
|
4686
|
+
function Tr(g, i, s) {
|
|
4687
|
+
return g === "push" ? { start: !1, delayMs: 0 } : g === "polling" || !i || !s ? { start: !0, delayMs: 0 } : { start: !0, delayMs: Rt };
|
|
4438
4688
|
}
|
|
4439
4689
|
const ve = class ve extends HTMLElement {
|
|
4440
4690
|
constructor() {
|
|
@@ -4444,9 +4694,9 @@ const ve = class ve extends HTMLElement {
|
|
|
4444
4694
|
const i = this.attachShadow({ mode: "open" });
|
|
4445
4695
|
this.injectTailwind(i);
|
|
4446
4696
|
const s = document.createElement("div");
|
|
4447
|
-
s.innerHTML =
|
|
4448
|
-
const a = s.querySelector("template"), h = a ? a.content.cloneNode(!0) : document.createRange().createContextualFragment(
|
|
4449
|
-
|
|
4697
|
+
s.innerHTML = ft;
|
|
4698
|
+
const a = s.querySelector("template"), h = a ? a.content.cloneNode(!0) : document.createRange().createContextualFragment(ft), l = document.createElement("style");
|
|
4699
|
+
l.textContent = Di, i.appendChild(l), i.appendChild(h);
|
|
4450
4700
|
}
|
|
4451
4701
|
static get observedAttributes() {
|
|
4452
4702
|
return ["server-url", "public-key", "lang", "transport", "hide-footer", "footer", "authenticated-event-delay-ms", "variant", "no-card"];
|
|
@@ -4514,11 +4764,11 @@ const ve = class ve extends HTMLElement {
|
|
|
4514
4764
|
s.textContent = a.tailwindCssText;
|
|
4515
4765
|
else {
|
|
4516
4766
|
const h = document.createElement("link");
|
|
4517
|
-
h.rel = "stylesheet", h.href =
|
|
4767
|
+
h.rel = "stylesheet", h.href = Re, i.insertBefore(h, s);
|
|
4518
4768
|
}
|
|
4519
4769
|
return;
|
|
4520
4770
|
}
|
|
4521
|
-
a.tailwindLoading || (a.tailwindLoading = fetch(
|
|
4771
|
+
a.tailwindLoading || (a.tailwindLoading = fetch(Re).then((h) => h.ok ? h.text() : Promise.reject(new Error(`HTTP ${h.status}`))).then((h) => {
|
|
4522
4772
|
a.tailwindCssText = h;
|
|
4523
4773
|
}).catch((h) => {
|
|
4524
4774
|
console.warn("[sendity-auth] Failed to load Tailwind CSS for Shadow DOM", h), a.tailwindCssText = "";
|
|
@@ -4528,7 +4778,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4528
4778
|
s.textContent = a.tailwindCssText;
|
|
4529
4779
|
else {
|
|
4530
4780
|
const h = document.createElement("link");
|
|
4531
|
-
h.rel = "stylesheet", h.href =
|
|
4781
|
+
h.rel = "stylesheet", h.href = Re, i.insertBefore(h, s);
|
|
4532
4782
|
}
|
|
4533
4783
|
});
|
|
4534
4784
|
}
|
|
@@ -4547,7 +4797,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4547
4797
|
scheduleBrowserReturnCheck() {
|
|
4548
4798
|
this.destroyed || this.authenticated || !this.activeAuthRequestId || !this.activeAuthRequestSecret || document.visibilityState && document.visibilityState !== "visible" || (this.returnWaitTimer !== null && clearTimeout(this.returnWaitTimer), this.returnWaitTimer = window.setTimeout(() => {
|
|
4549
4799
|
this.returnWaitTimer = null, !(this.destroyed || this.authenticated) && (this.showFooterWaitingState({ returnedFromClient: !0 }), this.step().catch((i) => console.warn("[sendity-auth] return check failed", i)));
|
|
4550
|
-
},
|
|
4800
|
+
}, Cr));
|
|
4551
4801
|
}
|
|
4552
4802
|
isFooterHidden() {
|
|
4553
4803
|
const i = (this.getAttribute("footer") ?? "").trim().toLowerCase();
|
|
@@ -4561,18 +4811,18 @@ const ve = class ve extends HTMLElement {
|
|
|
4561
4811
|
scheduleFooterWaitingState() {
|
|
4562
4812
|
this.footerWaitTimer !== null || this.isFooterHidden() || (this.footerWaitTimer = window.setTimeout(() => {
|
|
4563
4813
|
this.footerWaitTimer = null, this.showFooterWaitingState();
|
|
4564
|
-
},
|
|
4814
|
+
}, wr));
|
|
4565
4815
|
}
|
|
4566
4816
|
setFooterIndicatorWaiting() {
|
|
4567
4817
|
this.footerIndicatorEl && (this.footerIndicatorEl.classList.remove("footer-indicator--error"), this.footerIndicatorEl.innerHTML = "", this.footerIndicatorEl.removeAttribute("hidden"));
|
|
4568
4818
|
}
|
|
4569
4819
|
setFooterIndicatorError() {
|
|
4570
|
-
this.footerIndicatorEl && (this.footerIndicatorEl.classList.add("footer-indicator--error"), this.footerIndicatorEl.innerHTML =
|
|
4820
|
+
this.footerIndicatorEl && (this.footerIndicatorEl.classList.add("footer-indicator--error"), this.footerIndicatorEl.innerHTML = gr, this.footerIndicatorEl.removeAttribute("hidden"));
|
|
4571
4821
|
}
|
|
4572
4822
|
showFooterWaitingState(i = {}) {
|
|
4573
|
-
this.isFooterHidden() || (this.currentConfig && this.footerMessageEl && (this.footerMessageEl.textContent = i.returnedFromClient ?
|
|
4823
|
+
this.isFooterHidden() || (this.currentConfig && this.footerMessageEl && (this.footerMessageEl.textContent = i.returnedFromClient ? F(this.currentConfig.lang).ui.footerReturnedWaiting : this.waitingFooterMessage()), this.setFooterIndicatorWaiting(), this.footerEl?.classList.add("footer--waiting", "footer--transitioning"), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.removeAttribute("hidden"), this.footerTransitionTimer !== null && clearTimeout(this.footerTransitionTimer), this.footerTransitionTimer = window.setTimeout(() => {
|
|
4574
4824
|
this.footerTransitionTimer = null, this.footerEl?.classList.remove("footer--transitioning"), this.footerBrandEl?.setAttribute("hidden", "");
|
|
4575
|
-
},
|
|
4825
|
+
}, fe), this.startCountdown());
|
|
4576
4826
|
}
|
|
4577
4827
|
startCountdown() {
|
|
4578
4828
|
if (this.timerInterval !== null || !this.footerTimerEl) return;
|
|
@@ -4587,8 +4837,8 @@ const ve = class ve extends HTMLElement {
|
|
|
4587
4837
|
this.footerTimerEl.setAttribute("hidden", "");
|
|
4588
4838
|
return;
|
|
4589
4839
|
}
|
|
4590
|
-
const a = Math.max(0, Math.floor((s - Date.now()) / 1e3)), h = Math.floor(a / 60),
|
|
4591
|
-
this.footerTimerEl.textContent = `${h}:${
|
|
4840
|
+
const a = Math.max(0, Math.floor((s - Date.now()) / 1e3)), h = Math.floor(a / 60), l = String(a % 60).padStart(2, "0");
|
|
4841
|
+
this.footerTimerEl.textContent = `${h}:${l}`, this.footerTimerEl.classList.toggle("low", a > 0 && a <= 60), this.footerTimerEl.removeAttribute("hidden"), a <= 0 && this.timerInterval !== null && (clearInterval(this.timerInterval), this.timerInterval = null, this.showExpiredState());
|
|
4592
4842
|
};
|
|
4593
4843
|
i(), this.timerInterval = window.setInterval(i, 1e3);
|
|
4594
4844
|
}
|
|
@@ -4598,26 +4848,26 @@ const ve = class ve extends HTMLElement {
|
|
|
4598
4848
|
showExpiredState() {
|
|
4599
4849
|
if (!(this.authenticated || this.destroyed || !this.currentConfig)) {
|
|
4600
4850
|
if (this.stopAuthTransports(), this.rootEl?.classList.remove("sendity--verified"), this.rootEl?.classList.add("sendity--expired"), this.codeContainerEl?.classList.remove("code--active", "code--placeholder"), this.codeContainerEl?.classList.add("code--expired"), this.spinnerEl?.setAttribute("hidden", ""), this.codeEl?.removeAttribute("hidden"), !this.isFooterHidden()) {
|
|
4601
|
-
const i =
|
|
4851
|
+
const i = F(this.currentConfig.lang);
|
|
4602
4852
|
this.footerMessageEl && (this.footerMessageEl.textContent = i.ui.codeExpired), this.setFooterIndicatorError(), this.footerEl?.classList.add("footer--waiting", "footer--transitioning"), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.removeAttribute("hidden"), this.footerTimerEl?.setAttribute("hidden", ""), this.footerTransitionTimer !== null && clearTimeout(this.footerTransitionTimer), this.footerTransitionTimer = window.setTimeout(() => {
|
|
4603
4853
|
this.footerTransitionTimer = null, this.footerEl?.classList.remove("footer--transitioning"), this.footerBrandEl?.setAttribute("hidden", "");
|
|
4604
|
-
},
|
|
4854
|
+
}, fe);
|
|
4605
4855
|
}
|
|
4606
4856
|
this.renderExpiredAction();
|
|
4607
4857
|
}
|
|
4608
4858
|
}
|
|
4609
4859
|
renderExpiredAction() {
|
|
4610
4860
|
if (!this.verifiersEl || !this.currentConfig) return;
|
|
4611
|
-
const i =
|
|
4861
|
+
const i = F(this.currentConfig.lang);
|
|
4612
4862
|
this.verifiersEl.innerHTML = "", this.verifiersEl.classList.remove("is-two", "verifiers--exiting"), this.verifiersEl.removeAttribute("aria-hidden");
|
|
4613
4863
|
const s = document.createElement("button");
|
|
4614
4864
|
s.type = "button", s.className = "chan error", s.addEventListener("click", () => {
|
|
4615
|
-
s.disabled = !0, this.requestNewAuthRequest().catch((
|
|
4616
|
-
console.warn("[sendity-auth] failed to request a new code",
|
|
4865
|
+
s.disabled = !0, this.requestNewAuthRequest().catch((l) => {
|
|
4866
|
+
console.warn("[sendity-auth] failed to request a new code", l), s.disabled = !1;
|
|
4617
4867
|
});
|
|
4618
4868
|
});
|
|
4619
4869
|
const a = document.createElement("span");
|
|
4620
|
-
a.className = "icon", a.setAttribute("aria-hidden", "true"), a.innerHTML =
|
|
4870
|
+
a.className = "icon", a.setAttribute("aria-hidden", "true"), a.innerHTML = mr, s.appendChild(a);
|
|
4621
4871
|
const h = document.createElement("span");
|
|
4622
4872
|
h.className = "label", h.textContent = i.ui.getNewCode, s.appendChild(h), this.verifiersEl.appendChild(s);
|
|
4623
4873
|
}
|
|
@@ -4639,15 +4889,13 @@ const ve = class ve extends HTMLElement {
|
|
|
4639
4889
|
}
|
|
4640
4890
|
resolveConfig() {
|
|
4641
4891
|
const i = {
|
|
4642
|
-
lang:
|
|
4892
|
+
lang: yt(navigator.language) ?? "en",
|
|
4643
4893
|
transport: "auto"
|
|
4644
|
-
}, s = (
|
|
4894
|
+
}, s = (T) => this.getAttribute(T) ?? void 0, a = s("server-url")?.trim() || vr, h = s("public-key")?.trim();
|
|
4645
4895
|
if (!h)
|
|
4646
4896
|
throw new Error("Missing required sendity-auth attribute: public-key");
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
const m = s("transport"), g = m === "push" || m === "polling" ? m : i.transport, y = this.parseAuthenticatedEventDelayMs(s("authenticated-event-delay-ms"));
|
|
4650
|
-
return { serverUrl: a, publicKey: h, lang: d, transport: g, authenticatedEventDelayMs: y };
|
|
4897
|
+
const l = yt(s("lang")) ?? i.lang, m = s("transport"), v = m === "push" || m === "polling" ? m : i.transport, y = this.parseAuthenticatedEventDelayMs(s("authenticated-event-delay-ms"));
|
|
4898
|
+
return { serverUrl: a, publicKey: h, lang: l, transport: v, authenticatedEventDelayMs: y };
|
|
4651
4899
|
}
|
|
4652
4900
|
parseAuthenticatedEventDelayMs(i) {
|
|
4653
4901
|
if (i === void 0 || i.trim() === "") return Ie;
|
|
@@ -4665,51 +4913,51 @@ const ve = class ve extends HTMLElement {
|
|
|
4665
4913
|
body: JSON.stringify({ public_key: s })
|
|
4666
4914
|
});
|
|
4667
4915
|
if (!h.ok) throw new Error(`Auth request creation failed: ${h.status}`);
|
|
4668
|
-
const
|
|
4669
|
-
if (!
|
|
4670
|
-
const m = this.extractClientSecret(
|
|
4916
|
+
const l = await h.json();
|
|
4917
|
+
if (!l.id) throw new Error("Missing id from server response");
|
|
4918
|
+
const m = this.extractClientSecret(l);
|
|
4671
4919
|
if (!m) throw new Error("Missing client secret from server response");
|
|
4672
|
-
return
|
|
4673
|
-
verificationId: String(
|
|
4674
|
-
code:
|
|
4920
|
+
return Sr(a, i, s, { id: String(l.id), clientSecret: m }), this.activeAuthRequestId = String(l.id), this.activeAuthRequestSecret = m, this.updateActiveAuthRequestExpiry(l), this.applyVerifyUrlsFromResponse(l), this.updateCode(l.formattedCode ?? l.code), this.dispatchPublicEvent("sendity:challenge-created", {
|
|
4921
|
+
verificationId: String(l.id),
|
|
4922
|
+
code: l.formattedCode ?? l.code ?? "",
|
|
4675
4923
|
channel: this.primaryChannel(this.activeVerifyUrls)
|
|
4676
|
-
}),
|
|
4924
|
+
}), l;
|
|
4677
4925
|
}
|
|
4678
4926
|
async step() {
|
|
4679
4927
|
this.currentConfig || (this.currentConfig = this.resolveConfig());
|
|
4680
|
-
const { serverUrl: i, publicKey: s } = this.currentConfig, a = me(), h =
|
|
4681
|
-
if (!
|
|
4928
|
+
const { serverUrl: i, publicKey: s } = this.currentConfig, a = me(), h = Ct(a, i, s), l = h?.id;
|
|
4929
|
+
if (!l)
|
|
4682
4930
|
return await this.createAuthRequest(i, s, a);
|
|
4683
|
-
this.activeAuthRequestId =
|
|
4931
|
+
this.activeAuthRequestId = l, this.activeAuthRequestSecret = h.clientSecret;
|
|
4684
4932
|
const m = await fetch(
|
|
4685
|
-
this.authRequestStatusUrl(i,
|
|
4933
|
+
this.authRequestStatusUrl(i, l),
|
|
4686
4934
|
this.authRequestStatusInit(h.clientSecret)
|
|
4687
4935
|
);
|
|
4688
4936
|
if (m.status !== 200)
|
|
4689
|
-
return
|
|
4690
|
-
const
|
|
4691
|
-
if (this.applyVerifyUrlsFromResponse(
|
|
4692
|
-
return this.handleAuthenticated(
|
|
4693
|
-
if (
|
|
4694
|
-
return this.updateActiveAuthRequestExpiry(
|
|
4695
|
-
|
|
4696
|
-
const y = this.extractClientSecret(
|
|
4697
|
-
return y && (this.activeAuthRequestSecret = y), this.updateActiveAuthRequestExpiry(
|
|
4937
|
+
return St(a, i, s), await this.step();
|
|
4938
|
+
const v = await m.json();
|
|
4939
|
+
if (this.applyVerifyUrlsFromResponse(v), v.status === "verified")
|
|
4940
|
+
return this.handleAuthenticated(v), v;
|
|
4941
|
+
if (v.status === "expired")
|
|
4942
|
+
return this.updateActiveAuthRequestExpiry(v), this.updateCode(v.formattedCode ?? v.code), this.showExpiredState(), v;
|
|
4943
|
+
v.id && (this.activeAuthRequestId = String(v.id));
|
|
4944
|
+
const y = this.extractClientSecret(v);
|
|
4945
|
+
return y && (this.activeAuthRequestSecret = y), this.updateActiveAuthRequestExpiry(v), this.updateCode(v.formattedCode ?? v.code), v;
|
|
4698
4946
|
}
|
|
4699
4947
|
configureRealtime(i) {
|
|
4700
4948
|
this.currentConfig || (this.currentConfig = this.resolveConfig());
|
|
4701
4949
|
const { transport: s } = this.currentConfig, a = i?.broadcasting, h = !!(a?.key && a.channel && a.authEndpoint);
|
|
4702
|
-
let
|
|
4703
|
-
s !== "polling" && h && a ?
|
|
4704
|
-
const m =
|
|
4950
|
+
let l = !1;
|
|
4951
|
+
s !== "polling" && h && a ? l = this.subscribeToBroadcasting(a) : s === "push" && console.warn("[sendity-auth] Push transport requested, but server response does not contain broadcasting metadata");
|
|
4952
|
+
const m = Tr(s, h, l);
|
|
4705
4953
|
m.start && this.startPolling(m.delayMs);
|
|
4706
4954
|
}
|
|
4707
4955
|
subscribeToBroadcasting(i) {
|
|
4708
4956
|
if (!this.currentConfig || !i.key || !i.channel || !i.authEndpoint) return !1;
|
|
4709
4957
|
try {
|
|
4710
|
-
window.Pusher =
|
|
4958
|
+
window.Pusher = er;
|
|
4711
4959
|
const s = (i.scheme ?? "https") === "https", a = i.port ?? (s ? 443 : 80);
|
|
4712
|
-
return this.echo = new
|
|
4960
|
+
return this.echo = new Ki({
|
|
4713
4961
|
broadcaster: "reverb",
|
|
4714
4962
|
key: i.key,
|
|
4715
4963
|
wsHost: i.host ?? new URL(this.currentConfig.serverUrl).hostname,
|
|
@@ -4732,7 +4980,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4732
4980
|
this.handleAuthenticated(h);
|
|
4733
4981
|
}), !0;
|
|
4734
4982
|
} catch (s) {
|
|
4735
|
-
return console.warn("[sendity-auth] realtime subscription failed, falling back to polling if enabled", s), this.currentConfig.transport === "auto" && this.startPolling(
|
|
4983
|
+
return console.warn("[sendity-auth] realtime subscription failed, falling back to polling if enabled", s), this.currentConfig.transport === "auto" && this.startPolling(Rt), !1;
|
|
4736
4984
|
}
|
|
4737
4985
|
}
|
|
4738
4986
|
startPolling(i) {
|
|
@@ -4740,7 +4988,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4740
4988
|
const s = () => {
|
|
4741
4989
|
this.pollTimer !== null || this.authenticated || this.destroyed || (this.pollTimer = window.setInterval(() => {
|
|
4742
4990
|
this.step().catch((a) => console.warn("[sendity-auth] poll failed", a));
|
|
4743
|
-
},
|
|
4991
|
+
}, br));
|
|
4744
4992
|
};
|
|
4745
4993
|
i > 0 ? this.fallbackPollTimer = window.setTimeout(() => {
|
|
4746
4994
|
this.fallbackPollTimer = null, s();
|
|
@@ -4754,7 +5002,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4754
5002
|
});
|
|
4755
5003
|
return;
|
|
4756
5004
|
}
|
|
4757
|
-
this.authenticated = !0, this.currentConfig &&
|
|
5005
|
+
this.authenticated = !0, this.currentConfig && St(me(), this.currentConfig.serverUrl, this.currentConfig.publicKey), this.stopAuthTransports(), this.showSuccess(i);
|
|
4758
5006
|
const s = this.toPublicAuthenticatedDetail(i), a = this.currentConfig?.authenticatedEventDelayMs ?? Ie;
|
|
4759
5007
|
this.authenticatedEventTimer = window.setTimeout(() => {
|
|
4760
5008
|
this.authenticatedEventTimer = null, !this.destroyed && this.dispatchPublicEvent("sendity:authenticated", s);
|
|
@@ -4782,7 +5030,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4782
5030
|
return s.startsWith("mailto:") ? "email" : s.startsWith("whatsapp:") || s.startsWith("whatsapp://") ? "whatsapp" : "unknown";
|
|
4783
5031
|
}
|
|
4784
5032
|
applyVerifyUrlsFromResponse(i) {
|
|
4785
|
-
const s = Array.isArray(i.verify_urls) ? i.verify_urls : Array.isArray(i.verifyUrls) ? i.verifyUrls : [], a = Array.isArray(i.verification_endpoints) ? i.verification_endpoints.map((
|
|
5033
|
+
const s = Array.isArray(i.verify_urls) ? i.verify_urls : Array.isArray(i.verifyUrls) ? i.verifyUrls : [], a = Array.isArray(i.verification_endpoints) ? i.verification_endpoints.map((l) => typeof l.url == "string" ? l.url : typeof l.scheme == "string" && typeof l.recipient == "string" ? `${l.scheme}:${l.recipient}` : "") : [], h = Er([...s, ...a].map(String));
|
|
4786
5034
|
h.length !== 0 && (this.activeVerifyUrls = [...new Set(h)], this.renderVerifiers(this.activeVerifyUrls));
|
|
4787
5035
|
}
|
|
4788
5036
|
authRequestStatusUrl(i, s) {
|
|
@@ -4807,7 +5055,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4807
5055
|
}
|
|
4808
5056
|
waitingFooterMessage() {
|
|
4809
5057
|
if (!this.currentConfig) return "";
|
|
4810
|
-
const i =
|
|
5058
|
+
const i = F(this.currentConfig.lang), s = this.formatExpiryTime(this.activeAuthRequestExpiresAt, this.currentConfig.lang);
|
|
4811
5059
|
return s ? i.ui.footerWaitingUntil.replace("(Time)", s) : i.ui.footerWaiting;
|
|
4812
5060
|
}
|
|
4813
5061
|
formatExpiryTime(i, s) {
|
|
@@ -4818,16 +5066,35 @@ const ve = class ve extends HTMLElement {
|
|
|
4818
5066
|
localeForLang(i) {
|
|
4819
5067
|
switch (i) {
|
|
4820
5068
|
case "de":
|
|
5069
|
+
case "de-he":
|
|
4821
5070
|
return "de-DE";
|
|
4822
5071
|
case "fr":
|
|
4823
5072
|
return "fr-FR";
|
|
5073
|
+
case "es":
|
|
5074
|
+
return "es-ES";
|
|
5075
|
+
case "it":
|
|
5076
|
+
return "it-IT";
|
|
5077
|
+
case "pl":
|
|
5078
|
+
return "pl-PL";
|
|
5079
|
+
case "cs":
|
|
5080
|
+
return "cs-CZ";
|
|
5081
|
+
case "da":
|
|
5082
|
+
return "da-DK";
|
|
5083
|
+
case "nl":
|
|
5084
|
+
return "nl-NL";
|
|
5085
|
+
case "hr":
|
|
5086
|
+
return "hr-HR";
|
|
5087
|
+
case "el":
|
|
5088
|
+
return "el-GR";
|
|
5089
|
+
case "tr":
|
|
5090
|
+
return "tr-TR";
|
|
4824
5091
|
default:
|
|
4825
5092
|
return "en-US";
|
|
4826
5093
|
}
|
|
4827
5094
|
}
|
|
4828
5095
|
async fetchAuthorizationAfterAuthenticatedSignal() {
|
|
4829
5096
|
this.currentConfig || (this.currentConfig = this.resolveConfig());
|
|
4830
|
-
const i =
|
|
5097
|
+
const i = Ct(me(), this.currentConfig.serverUrl, this.currentConfig.publicKey), s = this.activeAuthRequestId ?? i?.id, a = this.activeAuthRequestSecret ?? i?.clientSecret;
|
|
4831
5098
|
if (!s || !a)
|
|
4832
5099
|
throw new Error("Cannot fetch authorization without an active auth request id and client secret");
|
|
4833
5100
|
const h = await fetch(
|
|
@@ -4836,9 +5103,9 @@ const ve = class ve extends HTMLElement {
|
|
|
4836
5103
|
);
|
|
4837
5104
|
if (!h.ok)
|
|
4838
5105
|
throw new Error(`Authorization fetch failed: ${h.status}`);
|
|
4839
|
-
const
|
|
4840
|
-
if (
|
|
4841
|
-
this.handleAuthenticated(
|
|
5106
|
+
const l = await h.json();
|
|
5107
|
+
if (l.status === "verified" && l.authorization) {
|
|
5108
|
+
this.handleAuthenticated(l);
|
|
4842
5109
|
return;
|
|
4843
5110
|
}
|
|
4844
5111
|
throw new Error("Verified auth request did not include authorization");
|
|
@@ -4867,7 +5134,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4867
5134
|
}
|
|
4868
5135
|
showCodeState() {
|
|
4869
5136
|
if (this.spinnerEl?.setAttribute("hidden", ""), this.rootEl?.classList.remove("sendity--expired", "sendity--verified"), this.codeContainerEl?.classList.remove("code--verified", "code--placeholder"), this.codeContainerEl?.classList.remove("code--exiting"), this.codeContainerEl?.classList.add("code--active"), this.codeContainerEl?.removeAttribute("aria-hidden"), this.verifiersEl?.classList.remove("verifiers--exiting"), this.verifiersEl?.removeAttribute("aria-hidden"), this.codeEl?.removeAttribute("hidden"), this.currentConfig && this.promptEl) {
|
|
4870
|
-
const i =
|
|
5137
|
+
const i = F(this.currentConfig.lang);
|
|
4871
5138
|
this.promptEl.textContent = i.ui.sendCodePrompt, this.promptEl.classList.remove("prompt--exiting"), this.promptEl.removeAttribute("aria-hidden"), this.promptEl.removeAttribute("hidden");
|
|
4872
5139
|
}
|
|
4873
5140
|
this.successEl?.setAttribute("hidden", "");
|
|
@@ -4877,12 +5144,12 @@ const ve = class ve extends HTMLElement {
|
|
|
4877
5144
|
const s = this.isFooterHidden();
|
|
4878
5145
|
if (this.footerEl && (this.footerEl.hidden = s, this.footerEl.classList.remove("footer--leaving"), s || (this.footerEl.classList.add("footer--waiting", "footer--transitioning", "footer--verified"), window.setTimeout(() => {
|
|
4879
5146
|
this.footerEl?.classList.remove("footer--transitioning"), this.footerBrandEl && (this.footerBrandEl.hidden = !0);
|
|
4880
|
-
},
|
|
5147
|
+
}, fe))), this.footerStatusEl && (this.footerStatusEl.hidden = s), this.footerMessageEl) {
|
|
4881
5148
|
const a = i.channel ?? this.primaryChannel(this.activeVerifyUrls);
|
|
4882
5149
|
this.footerMessageEl.textContent = this.verifiedSigningInMessage(a);
|
|
4883
5150
|
}
|
|
4884
5151
|
if (this.footerTimerEl && (this.footerTimerEl.hidden = !0, this.footerTimerEl.classList.remove("low"), this.footerTimerEl.textContent = ""), this.verifiersEl?.classList.add("verifiers--exiting"), this.currentConfig && this.successEl) {
|
|
4885
|
-
const a =
|
|
5152
|
+
const a = F(this.currentConfig.lang), h = i.name && i.name.trim().length > 0 ? a.ui.successGreeting.replace("(Name)", i.name) : "You're in!";
|
|
4886
5153
|
this.successEl.innerHTML = `
|
|
4887
5154
|
<span class="success-check" aria-hidden="true">
|
|
4888
5155
|
<svg viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>
|
|
@@ -4892,7 +5159,7 @@ const ve = class ve extends HTMLElement {
|
|
|
4892
5159
|
}
|
|
4893
5160
|
this.successTransitionTimer !== null && clearTimeout(this.successTransitionTimer), this.successTransitionTimer = window.setTimeout(() => {
|
|
4894
5161
|
this.successTransitionTimer = null, this.verifiersEl && this.verifiersEl.setAttribute("aria-hidden", "true"), this.codeContainerEl?.setAttribute("aria-hidden", "true"), this.promptEl?.setAttribute("aria-hidden", "true");
|
|
4895
|
-
},
|
|
5162
|
+
}, fe);
|
|
4896
5163
|
}
|
|
4897
5164
|
verifiedSigningInMessage(i) {
|
|
4898
5165
|
return `Verified ${i === "whatsapp" ? "your phone number" : "your email address"} · signing you in...`;
|
|
@@ -4905,8 +5172,8 @@ const ve = class ve extends HTMLElement {
|
|
|
4905
5172
|
if (h.protocol === "mailto:")
|
|
4906
5173
|
return decodeURIComponent(h.pathname || h.href.replace(/^mailto:/, "").split("?")[0]) || null;
|
|
4907
5174
|
if (h.protocol === "whatsapp:" || h.protocol === "whatsapp://") {
|
|
4908
|
-
const
|
|
4909
|
-
return
|
|
5175
|
+
const l = h.searchParams.get("phone") || h.pathname.replace(/^\/+/, "");
|
|
5176
|
+
return l ? `+${l.replace(/^\+/, "")}` : null;
|
|
4910
5177
|
}
|
|
4911
5178
|
} catch {
|
|
4912
5179
|
if (a.startsWith("mailto:")) return a.replace(/^mailto:/, "").split("?")[0] || null;
|
|
@@ -4917,6 +5184,35 @@ const ve = class ve extends HTMLElement {
|
|
|
4917
5184
|
escapeHtml(i) {
|
|
4918
5185
|
return i.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4919
5186
|
}
|
|
5187
|
+
orLabel(i) {
|
|
5188
|
+
switch (i) {
|
|
5189
|
+
case "de":
|
|
5190
|
+
case "de-he":
|
|
5191
|
+
return "oder";
|
|
5192
|
+
case "fr":
|
|
5193
|
+
return "ou";
|
|
5194
|
+
case "es":
|
|
5195
|
+
return "o";
|
|
5196
|
+
case "it":
|
|
5197
|
+
return "o";
|
|
5198
|
+
case "pl":
|
|
5199
|
+
return "lub";
|
|
5200
|
+
case "cs":
|
|
5201
|
+
return "nebo";
|
|
5202
|
+
case "da":
|
|
5203
|
+
return "eller";
|
|
5204
|
+
case "nl":
|
|
5205
|
+
return "of";
|
|
5206
|
+
case "hr":
|
|
5207
|
+
return "ili";
|
|
5208
|
+
case "el":
|
|
5209
|
+
return "ή";
|
|
5210
|
+
case "tr":
|
|
5211
|
+
return "veya";
|
|
5212
|
+
default:
|
|
5213
|
+
return "or";
|
|
5214
|
+
}
|
|
5215
|
+
}
|
|
4920
5216
|
renderVerifiers(i) {
|
|
4921
5217
|
if (!this.verifiersEl) return;
|
|
4922
5218
|
this.verifiersEl.innerHTML = "", this.verifiersEl.classList.toggle("is-two", i.length === 2);
|
|
@@ -4925,28 +5221,28 @@ const ve = class ve extends HTMLElement {
|
|
|
4925
5221
|
if (h > 0 && i.length === 2) {
|
|
4926
5222
|
const S = document.createElement("div");
|
|
4927
5223
|
S.className = "divider", S.setAttribute("aria-hidden", "true");
|
|
4928
|
-
const
|
|
4929
|
-
|
|
5224
|
+
const j = document.createElement("span");
|
|
5225
|
+
j.textContent = this.orLabel(s.lang), S.appendChild(j), this.verifiersEl.appendChild(S);
|
|
4930
5226
|
}
|
|
4931
|
-
const
|
|
4932
|
-
|
|
5227
|
+
const l = document.createElement("div");
|
|
5228
|
+
l.className = "opt";
|
|
4933
5229
|
const m = document.createElement("a");
|
|
4934
5230
|
m.className = "chan " + this.channelClass(a), m.href = this.buildLink(a, s.lang), m.target = "_blank", m.rel = "noopener noreferrer", m.addEventListener("click", () => {
|
|
4935
5231
|
this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.showFooterWaitingState();
|
|
4936
5232
|
});
|
|
4937
|
-
const
|
|
4938
|
-
if (
|
|
5233
|
+
const v = this.iconForUrl(a);
|
|
5234
|
+
if (v) {
|
|
4939
5235
|
const S = document.createElement("span");
|
|
4940
|
-
S.className = "icon", S.setAttribute("aria-hidden", "true"), S.innerHTML =
|
|
5236
|
+
S.className = "icon", S.setAttribute("aria-hidden", "true"), S.innerHTML = v, m.appendChild(S);
|
|
4941
5237
|
}
|
|
4942
5238
|
const y = document.createElement("span");
|
|
4943
|
-
y.className = "label", y.textContent = this.channelLabel(a, s.lang), m.appendChild(y),
|
|
4944
|
-
const
|
|
4945
|
-
if (
|
|
5239
|
+
y.className = "label", y.textContent = this.channelLabel(a, s.lang), m.appendChild(y), l.appendChild(m);
|
|
5240
|
+
const T = this.destinationText(a, s.lang);
|
|
5241
|
+
if (T) {
|
|
4946
5242
|
const S = document.createElement("a");
|
|
4947
|
-
S.className = "dest", S.href = m.href, S.target = "_blank", S.rel = "noopener noreferrer", S.textContent =
|
|
5243
|
+
S.className = "dest", S.href = m.href, S.target = "_blank", S.rel = "noopener noreferrer", S.textContent = T, l.appendChild(S);
|
|
4948
5244
|
}
|
|
4949
|
-
this.verifiersEl.appendChild(
|
|
5245
|
+
this.verifiersEl.appendChild(l);
|
|
4950
5246
|
});
|
|
4951
5247
|
}
|
|
4952
5248
|
channelClass(i) {
|
|
@@ -4961,30 +5257,30 @@ const ve = class ve extends HTMLElement {
|
|
|
4961
5257
|
return "generic";
|
|
4962
5258
|
}
|
|
4963
5259
|
channelLabel(i, s) {
|
|
4964
|
-
const a =
|
|
5260
|
+
const a = F(s), h = this.channelClass(i);
|
|
4965
5261
|
if (h === "email") return a.labels.email;
|
|
4966
5262
|
if (h === "whatsapp") return a.labels.whatsapp;
|
|
4967
5263
|
try {
|
|
4968
|
-
const
|
|
4969
|
-
return
|
|
5264
|
+
const l = new URL(i, window.location.origin);
|
|
5265
|
+
return l.protocol.startsWith("http") ? l.hostname : l.protocol.replace(":", "");
|
|
4970
5266
|
} catch {
|
|
4971
5267
|
return i;
|
|
4972
5268
|
}
|
|
4973
5269
|
}
|
|
4974
5270
|
destinationText(i, s) {
|
|
4975
|
-
const h =
|
|
5271
|
+
const h = F(s).ui.toPrefix ?? "to";
|
|
4976
5272
|
try {
|
|
4977
|
-
const
|
|
4978
|
-
if (
|
|
4979
|
-
const m = decodeURIComponent(
|
|
5273
|
+
const l = new URL(i, window.location.origin);
|
|
5274
|
+
if (l.protocol === "mailto:") {
|
|
5275
|
+
const m = decodeURIComponent(l.pathname || l.href.replace(/^mailto:/, "").split("?")[0]);
|
|
4980
5276
|
return m ? `${h} ${m}` : null;
|
|
4981
5277
|
}
|
|
4982
|
-
if (
|
|
4983
|
-
const m =
|
|
5278
|
+
if (l.protocol === "whatsapp:" || l.protocol === "whatsapp://") {
|
|
5279
|
+
const m = l.searchParams.get("phone") || l.pathname.replace(/^\/+/, "");
|
|
4984
5280
|
return m ? `${h} +${m.replace(/^\+/, "")}` : null;
|
|
4985
5281
|
}
|
|
4986
|
-
if (
|
|
4987
|
-
const m =
|
|
5282
|
+
if (l.protocol.startsWith("http") && (l.hostname === "wa.me" || l.hostname === "api.whatsapp.com")) {
|
|
5283
|
+
const m = l.pathname.replace(/^\/+/, "").replace(/[^0-9]/g, "");
|
|
4988
5284
|
return m ? `${h} +${m}` : null;
|
|
4989
5285
|
}
|
|
4990
5286
|
} catch {
|
|
@@ -4994,16 +5290,16 @@ const ve = class ve extends HTMLElement {
|
|
|
4994
5290
|
iconForUrl(i) {
|
|
4995
5291
|
try {
|
|
4996
5292
|
const s = new URL(i, window.location.origin);
|
|
4997
|
-
if (s.protocol === "mailto:") return
|
|
4998
|
-
if (s.protocol === "whatsapp:" || s.protocol === "whatsapp://") return
|
|
5293
|
+
if (s.protocol === "mailto:") return bt;
|
|
5294
|
+
if (s.protocol === "whatsapp:" || s.protocol === "whatsapp://") return wt;
|
|
4999
5295
|
} catch {
|
|
5000
|
-
if (i.startsWith("mailto:")) return
|
|
5001
|
-
if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) return
|
|
5296
|
+
if (i.startsWith("mailto:")) return bt;
|
|
5297
|
+
if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) return wt;
|
|
5002
5298
|
}
|
|
5003
5299
|
return null;
|
|
5004
5300
|
}
|
|
5005
5301
|
labelForUrl(i, s) {
|
|
5006
|
-
const a =
|
|
5302
|
+
const a = F(s);
|
|
5007
5303
|
try {
|
|
5008
5304
|
const h = new URL(i, window.location.origin);
|
|
5009
5305
|
return h.protocol === "mailto:" ? `${a.ui.by} ${a.labels.email}` : h.protocol.startsWith("http") ? h.hostname : h.protocol === "whatsapp:" ? `${a.ui.by} ${a.labels.whatsapp}` : h.protocol.replace(":", "");
|
|
@@ -5012,17 +5308,17 @@ const ve = class ve extends HTMLElement {
|
|
|
5012
5308
|
}
|
|
5013
5309
|
}
|
|
5014
5310
|
buildLink(i, s) {
|
|
5015
|
-
const a = this.lastCode, h =
|
|
5311
|
+
const a = this.lastCode, h = F(s), l = window.location.host;
|
|
5016
5312
|
if (!a) return i;
|
|
5017
5313
|
if (i.startsWith("mailto:")) {
|
|
5018
|
-
const [m,
|
|
5019
|
-
y.set("subject",
|
|
5020
|
-
const
|
|
5021
|
-
return `${m}?${
|
|
5314
|
+
const [m, v = ""] = i.split("?"), y = new URLSearchParams(v), T = this.applyTemplate(h.templates.emailSubject, l, a), S = this.applyTemplate(h.templates.emailBody, l, a);
|
|
5315
|
+
y.set("subject", T), y.set("body", S);
|
|
5316
|
+
const j = this.toQuery(y);
|
|
5317
|
+
return `${m}?${j}`;
|
|
5022
5318
|
}
|
|
5023
5319
|
if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) {
|
|
5024
|
-
const [m,
|
|
5025
|
-
y.set("text",
|
|
5320
|
+
const [m, v = ""] = i.split("?"), y = new URLSearchParams(v), T = this.applyTemplate(h.templates.whatsappText, l, a);
|
|
5321
|
+
y.set("text", T);
|
|
5026
5322
|
const S = this.toQuery(y);
|
|
5027
5323
|
return `${m}?${S}`;
|
|
5028
5324
|
}
|
|
@@ -5037,8 +5333,8 @@ const ve = class ve extends HTMLElement {
|
|
|
5037
5333
|
toQuery(i) {
|
|
5038
5334
|
const s = [];
|
|
5039
5335
|
return i.forEach((a, h) => {
|
|
5040
|
-
const
|
|
5041
|
-
s.push(`${
|
|
5336
|
+
const l = encodeURIComponent(h), m = encodeURIComponent(a);
|
|
5337
|
+
s.push(`${l}=${m}`);
|
|
5042
5338
|
}), s.join("&");
|
|
5043
5339
|
}
|
|
5044
5340
|
joinUrl(i, s) {
|
|
@@ -5046,8 +5342,8 @@ const ve = class ve extends HTMLElement {
|
|
|
5046
5342
|
}
|
|
5047
5343
|
};
|
|
5048
5344
|
ve.tailwindCssText = null, ve.tailwindLoading = null;
|
|
5049
|
-
let
|
|
5050
|
-
customElements.get("sendity-auth") || customElements.define("sendity-auth",
|
|
5345
|
+
let je = ve;
|
|
5346
|
+
customElements.get("sendity-auth") || customElements.define("sendity-auth", je);
|
|
5051
5347
|
export {
|
|
5052
|
-
|
|
5348
|
+
je as Sendity
|
|
5053
5349
|
};
|