@sendity/client 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/sendity.d.ts +11 -1
- package/dist/i18n/sendity.en.d.ts +1 -0
- package/dist/sendity-client.js +1458 -1108
- package/dist/tailwind.css +1 -1
- package/package.json +1 -1
package/dist/sendity-client.js
CHANGED
|
@@ -1,289 +1,533 @@
|
|
|
1
|
-
const
|
|
2
|
-
<div class="sendity
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
1
|
+
const ft = `<template id="sendity-tpl">
|
|
2
|
+
<div class="sendity" role="region" aria-label="Sendity authentication">
|
|
3
|
+
<div class="sendity-body">
|
|
4
|
+
<slot id="prompt">
|
|
5
|
+
<p class="prompt" aria-live="polite" aria-atomic="true" hidden></p>
|
|
6
|
+
</slot>
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
<div class="code" aria-live="polite" aria-atomic="true">
|
|
9
|
+
<span class="spinner" aria-hidden="true"></span>
|
|
10
|
+
<span class="formatted-code" data-placeholder="••••" hidden> </span>
|
|
11
|
+
</div>
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
<div class="success" aria-live="polite" aria-atomic="true" hidden></div>
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
<div class="verifiers" role="group" aria-label="Send the code">
|
|
16
|
+
<!-- Channel options inserted by component -->
|
|
17
|
+
</div>
|
|
16
18
|
</div>
|
|
17
19
|
|
|
18
20
|
<footer class="sendity-footer" aria-live="polite" aria-atomic="true">
|
|
19
|
-
<span class="footer-brand">
|
|
21
|
+
<span class="footer-brand">You send, you're in · <a class="footer-logo" href="https://sendity.io" target="_blank" rel="noopener noreferrer">sendity.io</a></span>
|
|
20
22
|
<span class="footer-status" hidden>
|
|
21
|
-
<span class="footer-
|
|
22
|
-
|
|
23
|
+
<span class="footer-status-left">
|
|
24
|
+
<span class="footer-spinner" aria-hidden="true"></span>
|
|
25
|
+
<span class="footer-message"></span>
|
|
26
|
+
</span>
|
|
27
|
+
<span class="footer-timer" hidden></span>
|
|
23
28
|
</span>
|
|
24
29
|
</footer>
|
|
25
30
|
</div>
|
|
26
31
|
</template>
|
|
27
|
-
`,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
`, Mi = `/* Sendity client — passwordless channel-control authentication widget.
|
|
33
|
+
Design tokens mirror the Sendity Design System (emerald accent, stone neutral,
|
|
34
|
+
Zilla Slab display / Geist UI / Geist Mono). All values are overridable via
|
|
35
|
+
CSS custom properties so the host page can theme the widget.
|
|
36
|
+
*/
|
|
37
|
+
:host {
|
|
38
|
+
/* --- Tokens --- */
|
|
39
|
+
/* Brand accent: Tailwind emerald 500. Cool-accent against warm neutral. */
|
|
40
|
+
--sendity-primary-color: #10b981; /* emerald-500 */
|
|
41
|
+
--sendity-primary-hover: #059669; /* emerald-600 */
|
|
42
|
+
--sendity-primary-soft: #d1fae5; /* emerald-100 */
|
|
43
|
+
--sendity-success-color: #10b981; /* emerald-500 */
|
|
44
|
+
--sendity-success-bg: #d1fae5; /* emerald-100 */
|
|
45
|
+
--sendity-success-fg: #065f46; /* emerald-800 */
|
|
46
|
+
--sendity-error-color: #f43f5e; /* rose-500 */
|
|
47
|
+
--sendity-error-bg: #fee2e2; /* rose-100 */
|
|
48
|
+
--sendity-error-fg: #9f1239; /* rose-800 */
|
|
49
|
+
|
|
50
|
+
/* Stone neutral ramp (warm). */
|
|
51
|
+
--sendity-stone-50: #fafaf9;
|
|
52
|
+
--sendity-stone-100: #f5f5f4;
|
|
53
|
+
--sendity-stone-200: #e7e5e4;
|
|
54
|
+
--sendity-stone-300: #d6d3d1;
|
|
55
|
+
--sendity-stone-400: #a8a29e;
|
|
56
|
+
--sendity-stone-500: #78716c;
|
|
57
|
+
--sendity-stone-700: #44403c;
|
|
58
|
+
--sendity-stone-900: #1c1917;
|
|
59
|
+
|
|
60
|
+
--sendity-bg: #ffffff;
|
|
61
|
+
--sendity-bg-subtle: var(--sendity-stone-100);
|
|
62
|
+
--sendity-border: var(--sendity-stone-200);
|
|
63
|
+
--sendity-border-strong:var(--sendity-stone-300);
|
|
64
|
+
--sendity-color: var(--sendity-stone-900);
|
|
65
|
+
--sendity-fg-2: var(--sendity-stone-700);
|
|
66
|
+
--sendity-fg-3: var(--sendity-stone-500);
|
|
33
67
|
|
|
34
|
-
--sendity-font-
|
|
35
|
-
--sendity-font-
|
|
36
|
-
--sendity-font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
|
|
68
|
+
--sendity-font-family: 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
69
|
+
--sendity-code-font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
37
70
|
|
|
38
|
-
--sendity-
|
|
71
|
+
--sendity-font-size: 1rem; /* 16 */
|
|
72
|
+
--sendity-font-size-sm: 0.875rem; /* 14 */
|
|
73
|
+
--sendity-font-size-xs: 0.75rem; /* 12 */
|
|
74
|
+
|
|
75
|
+
--sendity-code-font-size: 1.625rem; /* 26 */
|
|
39
76
|
--sendity-code-font-weight: 600;
|
|
40
|
-
--sendity-code-
|
|
41
|
-
--sendity-code-
|
|
42
|
-
--sendity-code-
|
|
43
|
-
--sendity-code-
|
|
44
|
-
--sendity-code-border-
|
|
45
|
-
--sendity-code-border-
|
|
46
|
-
--sendity-code-
|
|
47
|
-
|
|
77
|
+
--sendity-code-bg: var(--sendity-bg-subtle);
|
|
78
|
+
--sendity-code-color: var(--sendity-color);
|
|
79
|
+
--sendity-code-border-size: 1px;
|
|
80
|
+
--sendity-code-border-style:dashed;
|
|
81
|
+
--sendity-code-border-color:var(--sendity-border-strong);
|
|
82
|
+
--sendity-code-border-radius: 0.75rem; /* 12 — radius-lg */
|
|
83
|
+
--sendity-code-padding: 0.95rem 0.75rem;
|
|
84
|
+
|
|
85
|
+
/* Channel buttons: muted Sky for Email, brand Emerald for WhatsApp. */
|
|
86
|
+
--sendity-email-bg: #e0f2fe; /* sky-100 */
|
|
87
|
+
--sendity-email-fg: #0369a1; /* sky-700 */
|
|
88
|
+
--sendity-email-border: #bae6fd; /* sky-200 */
|
|
89
|
+
--sendity-email-icon: #0284c7; /* sky-600 */
|
|
90
|
+
--sendity-email-bg-hover:#cfe9fc;
|
|
91
|
+
--sendity-whatsapp-bg: var(--sendity-primary-soft);
|
|
92
|
+
--sendity-whatsapp-fg: #065f46; /* emerald-800 */
|
|
93
|
+
--sendity-whatsapp-border: #a7f3d0; /* emerald-200 */
|
|
94
|
+
--sendity-whatsapp-icon: var(--sendity-primary-hover);
|
|
95
|
+
--sendity-whatsapp-bg-hover:#bbf3d6;
|
|
96
|
+
|
|
97
|
+
--sendity-btn-font-size: var(--sendity-font-size-sm);
|
|
98
|
+
--sendity-btn-padding: 0.5rem 0.5rem;
|
|
99
|
+
--sendity-btn-border-radius: 0.5625rem; /* 9 */
|
|
100
|
+
--sendity-btn-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.7), 0 1px 2px 0 rgb(28 25 23 / 0.10);
|
|
101
|
+
|
|
102
|
+
--sendity-success-check-bg: var(--sendity-success-bg);
|
|
103
|
+
--sendity-success-check-color: var(--sendity-success-color);
|
|
104
|
+
|
|
105
|
+
--sendity-radius: 1rem; /* 16 — radius-xl */
|
|
106
|
+
--sendity-surface: #ffffff;
|
|
107
|
+
--sendity-shadow: 0 12px 28px -6px rgb(28 25 23 / 0.14), 0 6px 12px -6px rgb(28 25 23 / 0.08);
|
|
108
|
+
--sendity-shadow-accent: 0 8px 24px -6px rgb(16 185 129 / 0.35);
|
|
109
|
+
|
|
110
|
+
/* Card layout */
|
|
111
|
+
--sendity-width: 320px;
|
|
112
|
+
--sendity-crossfade-duration: 220ms;
|
|
48
113
|
|
|
49
|
-
|
|
50
|
-
--sendity-btn-border-size: 0px;
|
|
51
|
-
--sendity-btn-border-color: transparent;
|
|
52
|
-
--sendity-btn-border-radius: 0.375rem;
|
|
53
|
-
--sendity-btn-padding: 0.5rem 0.75rem;
|
|
54
|
-
--sendity-btn-bg: var(--sendity-primary-color);
|
|
55
|
-
--sendity-btn-color: #fff;
|
|
56
|
-
--sendity-success-check-bg: var(--sendity-success-color);
|
|
57
|
-
--sendity-success-check-color: #ffffff;
|
|
114
|
+
color-scheme: light;
|
|
58
115
|
}
|
|
59
116
|
|
|
60
117
|
.sendity {
|
|
118
|
+
width: var(--sendity-width);
|
|
119
|
+
max-width: 100%;
|
|
61
120
|
display: inline-flex;
|
|
62
121
|
flex-direction: column;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
122
|
+
background: var(--sendity-surface);
|
|
123
|
+
border: 1px solid var(--sendity-border);
|
|
124
|
+
border-radius: var(--sendity-radius);
|
|
125
|
+
box-shadow: var(--sendity-shadow);
|
|
66
126
|
font-family: var(--sendity-font-family);
|
|
67
127
|
font-size: var(--sendity-font-size);
|
|
68
128
|
color: var(--sendity-color);
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
transition: box-shadow .35s ease;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.sendity:has(.code--verified) {
|
|
134
|
+
box-shadow: var(--sendity-shadow-accent), var(--sendity-shadow);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.sendity-body {
|
|
138
|
+
position: relative;
|
|
139
|
+
flex: 1;
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
padding: 1.25rem 1.25rem 1rem;
|
|
143
|
+
gap: 0.875rem;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.sendity .prompt {
|
|
147
|
+
margin: 0;
|
|
69
148
|
text-align: center;
|
|
149
|
+
font-size: var(--sendity-font-size-sm);
|
|
150
|
+
color: var(--sendity-fg-2);
|
|
151
|
+
line-height: 1.4;
|
|
152
|
+
transition: opacity var(--sendity-crossfade-duration) ease, transform var(--sendity-crossfade-duration) ease;
|
|
70
153
|
}
|
|
71
154
|
|
|
72
|
-
.sendity .
|
|
73
|
-
|
|
155
|
+
.sendity .prompt[hidden] { display: none !important; }
|
|
156
|
+
|
|
157
|
+
.sendity .prompt--exiting {
|
|
158
|
+
opacity: 0;
|
|
159
|
+
transform: translateY(-0.25rem) scale(0.98);
|
|
74
160
|
}
|
|
75
161
|
|
|
76
162
|
.sendity .code {
|
|
77
163
|
position: relative;
|
|
78
|
-
font-variant-numeric: tabular-nums;
|
|
164
|
+
font-variant-numeric: tabular-nums;
|
|
79
165
|
font-feature-settings: "tnum";
|
|
80
166
|
padding: var(--sendity-code-padding);
|
|
81
167
|
border-radius: var(--sendity-code-border-radius);
|
|
82
168
|
background: var(--sendity-code-bg);
|
|
83
169
|
color: var(--sendity-code-color);
|
|
84
|
-
border: var(--sendity-code-border-size)
|
|
85
|
-
min-height: 2rem;
|
|
86
|
-
max-height: 4rem;
|
|
170
|
+
border: var(--sendity-code-border-size) var(--sendity-code-border-style) var(--sendity-code-border-color);
|
|
87
171
|
display: inline-grid;
|
|
88
172
|
place-items: center;
|
|
89
173
|
text-align: center;
|
|
90
174
|
gap: 0.5rem;
|
|
91
175
|
overflow: hidden;
|
|
92
|
-
transition: opacity
|
|
176
|
+
transition: opacity var(--sendity-crossfade-duration) ease, transform var(--sendity-crossfade-duration) ease, background-color var(--sendity-crossfade-duration) ease, border-color var(--sendity-crossfade-duration) ease, color var(--sendity-crossfade-duration) ease, max-height var(--sendity-crossfade-duration) ease, padding var(--sendity-crossfade-duration) ease;
|
|
93
177
|
}
|
|
94
178
|
|
|
95
|
-
.sendity .code--
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
right: 0;
|
|
100
|
-
bottom: 0;
|
|
101
|
-
height: 3px;
|
|
102
|
-
border-radius: 0 0 var(--sendity-code-border-radius) var(--sendity-code-border-radius);
|
|
103
|
-
background: var(--sendity-primary-color);
|
|
104
|
-
transform-origin: left center;
|
|
105
|
-
animation: sendity-code-validity var(--sendity-code-validity-duration) linear forwards;
|
|
179
|
+
.sendity .code--exiting {
|
|
180
|
+
opacity: 0;
|
|
181
|
+
transform: translateY(-0.25rem) scale(0.98);
|
|
182
|
+
pointer-events: none;
|
|
106
183
|
}
|
|
107
184
|
|
|
108
|
-
.sendity .code--
|
|
109
|
-
opacity: 0;
|
|
110
|
-
transform: translateY(-0.125rem) scale(0.98);
|
|
185
|
+
.sendity .code--collapsed {
|
|
111
186
|
max-height: 0;
|
|
112
187
|
min-height: 0;
|
|
113
188
|
padding-top: 0;
|
|
114
189
|
padding-bottom: 0;
|
|
115
190
|
margin: 0;
|
|
116
|
-
|
|
191
|
+
border-width: 0;
|
|
117
192
|
}
|
|
118
193
|
|
|
119
194
|
.sendity .spinner {
|
|
120
|
-
width:
|
|
121
|
-
height:
|
|
122
|
-
border: 2px solid rgba(0, 0, 0, 0.
|
|
195
|
+
width: 1.125rem;
|
|
196
|
+
height: 1.125rem;
|
|
197
|
+
border: 2px solid rgba(0, 0, 0, 0.12);
|
|
123
198
|
border-top-color: var(--sendity-primary-color);
|
|
124
199
|
border-radius: 50%;
|
|
125
200
|
animation: sendity-spin 0.8s linear infinite;
|
|
126
201
|
}
|
|
127
202
|
|
|
128
|
-
@keyframes sendity-spin {
|
|
129
|
-
to {
|
|
130
|
-
transform: rotate(360deg);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
203
|
+
@keyframes sendity-spin { to { transform: rotate(360deg); } }
|
|
133
204
|
|
|
134
205
|
.sendity .formatted-code {
|
|
135
|
-
letter-spacing: 0.
|
|
206
|
+
letter-spacing: 0.06em;
|
|
136
207
|
line-height: 1;
|
|
137
208
|
font-size: var(--sendity-code-font-size);
|
|
138
209
|
font-weight: var(--sendity-code-font-weight);
|
|
139
210
|
font-family: var(--sendity-code-font-family);
|
|
140
211
|
}
|
|
141
212
|
|
|
142
|
-
.sendity .
|
|
143
|
-
|
|
213
|
+
.sendity .verifiers {
|
|
214
|
+
display: grid;
|
|
215
|
+
grid-template-columns: 1fr;
|
|
216
|
+
column-gap: 1.375rem;
|
|
217
|
+
align-items: stretch;
|
|
218
|
+
transition: opacity var(--sendity-crossfade-duration) ease, transform var(--sendity-crossfade-duration) ease;
|
|
144
219
|
}
|
|
145
220
|
|
|
146
|
-
.sendity .
|
|
221
|
+
.sendity .verifiers--exiting {
|
|
222
|
+
opacity: 0;
|
|
223
|
+
transform: translateY(-0.25rem) scale(0.98);
|
|
224
|
+
pointer-events: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.sendity .verifiers.is-two {
|
|
228
|
+
grid-template-columns: 1fr 1px 1fr;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.sendity .verifiers .opt {
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-direction: column;
|
|
234
|
+
align-items: stretch;
|
|
235
|
+
text-align: center;
|
|
236
|
+
gap: 0.5rem;
|
|
237
|
+
min-width: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.sendity .verifiers a.chan {
|
|
147
241
|
display: inline-flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
justify-content: center;
|
|
244
|
+
gap: 0.4375rem;
|
|
245
|
+
font-family: var(--sendity-font-family);
|
|
246
|
+
font-size: var(--sendity-btn-font-size);
|
|
247
|
+
font-weight: 500;
|
|
248
|
+
line-height: 1;
|
|
249
|
+
text-decoration: none;
|
|
250
|
+
border: 1px solid;
|
|
251
|
+
border-radius: var(--sendity-btn-border-radius);
|
|
252
|
+
padding: var(--sendity-btn-padding);
|
|
253
|
+
box-shadow: var(--sendity-btn-shadow);
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.sendity .verifiers a.chan:active { transform: scale(0.98); }
|
|
259
|
+
.sendity .verifiers a.chan:focus-visible { outline: 2px solid var(--sendity-primary-color); outline-offset: 2px; }
|
|
260
|
+
|
|
261
|
+
.sendity .verifiers a.chan .icon {
|
|
262
|
+
width: 1em;
|
|
263
|
+
height: 1em;
|
|
264
|
+
display: inline-flex;
|
|
265
|
+
flex: none;
|
|
266
|
+
}
|
|
267
|
+
.sendity .verifiers a.chan .icon svg { width: 100%; height: 100%; display: block; }
|
|
268
|
+
|
|
269
|
+
.sendity .verifiers a.chan.email {
|
|
270
|
+
color: var(--sendity-email-fg);
|
|
271
|
+
background: var(--sendity-email-bg);
|
|
272
|
+
border-color: var(--sendity-email-border);
|
|
273
|
+
}
|
|
274
|
+
.sendity .verifiers a.chan.email:hover { background: var(--sendity-email-bg-hover); }
|
|
275
|
+
.sendity .verifiers a.chan.email .icon { color: var(--sendity-email-icon); }
|
|
276
|
+
|
|
277
|
+
.sendity .verifiers a.chan.whatsapp {
|
|
278
|
+
color: var(--sendity-whatsapp-fg);
|
|
279
|
+
background: var(--sendity-whatsapp-bg);
|
|
280
|
+
border-color: var(--sendity-whatsapp-border);
|
|
281
|
+
}
|
|
282
|
+
.sendity .verifiers a.chan.whatsapp:hover { background: var(--sendity-whatsapp-bg-hover); }
|
|
283
|
+
.sendity .verifiers a.chan.whatsapp .icon { color: var(--sendity-whatsapp-icon); }
|
|
284
|
+
|
|
285
|
+
.sendity .verifiers a.chan.generic {
|
|
286
|
+
color: var(--sendity-fg-2);
|
|
287
|
+
background: var(--sendity-surface);
|
|
288
|
+
border-color: var(--sendity-border-strong);
|
|
289
|
+
}
|
|
290
|
+
.sendity .verifiers a.chan.generic:hover { background: var(--sendity-bg-subtle); color: var(--sendity-color); }
|
|
291
|
+
|
|
292
|
+
.sendity .verifiers a.dest {
|
|
293
|
+
font-size: var(--sendity-font-size-xs);
|
|
294
|
+
color: var(--sendity-fg-3);
|
|
295
|
+
line-height: 1.3;
|
|
296
|
+
text-decoration: none;
|
|
297
|
+
overflow: hidden;
|
|
298
|
+
text-overflow: ellipsis;
|
|
299
|
+
white-space: nowrap;
|
|
300
|
+
}
|
|
301
|
+
.sendity .verifiers a.dest:hover { color: var(--sendity-fg-2); text-decoration: underline; }
|
|
302
|
+
|
|
303
|
+
.sendity .verifiers .divider {
|
|
304
|
+
position: relative;
|
|
305
|
+
width: 1px;
|
|
306
|
+
background: var(--sendity-border);
|
|
307
|
+
justify-self: center;
|
|
308
|
+
align-self: stretch;
|
|
309
|
+
}
|
|
310
|
+
.sendity .verifiers .divider span {
|
|
311
|
+
position: absolute;
|
|
312
|
+
top: 50%;
|
|
313
|
+
left: 50%;
|
|
314
|
+
transform: translate(-50%, -50%);
|
|
315
|
+
background: var(--sendity-surface);
|
|
316
|
+
color: var(--sendity-fg-3);
|
|
317
|
+
font-size: 0.6875rem;
|
|
318
|
+
line-height: 1;
|
|
319
|
+
padding: 0.25rem 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.sendity .success {
|
|
323
|
+
position: absolute;
|
|
324
|
+
inset: 1.25rem 1.25rem 1rem;
|
|
325
|
+
display: flex;
|
|
148
326
|
flex-direction: column;
|
|
149
327
|
align-items: center;
|
|
150
328
|
justify-content: center;
|
|
151
|
-
gap: 0.
|
|
152
|
-
color: var(--sendity-
|
|
153
|
-
font-weight: 700;
|
|
329
|
+
gap: 0.6rem;
|
|
330
|
+
color: var(--sendity-color);
|
|
154
331
|
text-align: center;
|
|
332
|
+
padding: 0.5rem 0 0.5rem;
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
opacity: 0;
|
|
335
|
+
transform: translateY(0.25rem) scale(0.98);
|
|
336
|
+
transition: opacity var(--sendity-crossfade-duration) ease, transform var(--sendity-crossfade-duration) ease;
|
|
155
337
|
}
|
|
156
338
|
|
|
157
|
-
.sendity .success[hidden] {
|
|
158
|
-
|
|
339
|
+
.sendity .success[hidden] { display: none !important; }
|
|
340
|
+
|
|
341
|
+
.sendity .success:not([hidden]) {
|
|
342
|
+
opacity: 1;
|
|
343
|
+
transform: translateY(0) scale(1);
|
|
159
344
|
}
|
|
160
345
|
|
|
161
346
|
.sendity .success-check {
|
|
347
|
+
position: relative;
|
|
348
|
+
isolation: isolate;
|
|
162
349
|
display: inline-grid;
|
|
163
350
|
place-items: center;
|
|
164
|
-
width:
|
|
165
|
-
height:
|
|
351
|
+
width: 3.25rem;
|
|
352
|
+
height: 3.25rem;
|
|
166
353
|
border-radius: 999px;
|
|
167
354
|
background: var(--sendity-success-check-bg);
|
|
168
355
|
color: var(--sendity-success-check-color);
|
|
169
|
-
box-shadow: 0 10px
|
|
170
|
-
animation: sendity-success-bounce
|
|
356
|
+
box-shadow: 0 10px 28px -8px rgb(16 185 129 / 0.4);
|
|
357
|
+
animation: sendity-success-bounce 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.sendity .success-check::before,
|
|
361
|
+
.sendity .success-check::after {
|
|
362
|
+
content: '';
|
|
363
|
+
position: absolute;
|
|
364
|
+
inset: -0.35rem;
|
|
365
|
+
z-index: -1;
|
|
366
|
+
border-radius: inherit;
|
|
367
|
+
background: rgb(167 243 208 / 0.8);
|
|
368
|
+
animation: sendity-success-ping 1.35s cubic-bezier(0, 0, 0.2, 1) infinite;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.sendity .success-check::after {
|
|
372
|
+
animation-delay: 180ms;
|
|
373
|
+
background: rgb(209 250 229 / 0.72);
|
|
171
374
|
}
|
|
172
375
|
|
|
173
376
|
.sendity .success-check svg {
|
|
174
|
-
width: 1.
|
|
175
|
-
height: 1.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
fill: none;
|
|
179
|
-
stroke-linecap: round;
|
|
180
|
-
stroke-linejoin: round;
|
|
377
|
+
width: 1.85rem;
|
|
378
|
+
height: 1.85rem;
|
|
379
|
+
display: block;
|
|
380
|
+
fill: currentColor;
|
|
181
381
|
}
|
|
182
382
|
|
|
183
383
|
.sendity .success-message {
|
|
184
384
|
color: var(--sendity-color);
|
|
385
|
+
font-weight: 600;
|
|
386
|
+
font-size: 1.0625rem;
|
|
387
|
+
letter-spacing: -0.01em;
|
|
388
|
+
margin: 0;
|
|
185
389
|
}
|
|
186
390
|
|
|
187
391
|
@keyframes sendity-success-bounce {
|
|
188
|
-
0% {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
70% {
|
|
193
|
-
opacity: 1;
|
|
194
|
-
transform: scale(1.08);
|
|
195
|
-
}
|
|
196
|
-
100% {
|
|
197
|
-
opacity: 1;
|
|
198
|
-
transform: scale(1);
|
|
199
|
-
}
|
|
392
|
+
0% { opacity: 0; transform: scale(.62); }
|
|
393
|
+
60% { opacity: 1; transform: scale(1.14); }
|
|
394
|
+
100% { opacity: 1; transform: scale(1); }
|
|
200
395
|
}
|
|
201
396
|
|
|
202
|
-
@keyframes sendity-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
to {
|
|
207
|
-
transform: scaleX(0);
|
|
208
|
-
}
|
|
397
|
+
@keyframes sendity-success-ping {
|
|
398
|
+
0% { opacity: 0.7; transform: scale(0.86); }
|
|
399
|
+
80%, 100% { opacity: 0; transform: scale(1.85); }
|
|
209
400
|
}
|
|
210
401
|
|
|
211
|
-
.sendity .
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
402
|
+
.sendity .sendity-footer {
|
|
403
|
+
border-top: 1px solid var(--sendity-border);
|
|
404
|
+
padding: 0.8125rem 1.125rem;
|
|
405
|
+
display: grid;
|
|
406
|
+
grid-template-columns: minmax(0, 1fr);
|
|
407
|
+
align-items: center;
|
|
408
|
+
justify-content: stretch;
|
|
215
409
|
gap: 0.5rem;
|
|
410
|
+
min-height: 1.125rem;
|
|
411
|
+
color: var(--sendity-fg-3);
|
|
412
|
+
font-size: var(--sendity-font-size-xs);
|
|
413
|
+
line-height: 1rem;
|
|
414
|
+
letter-spacing: 0.005em;
|
|
415
|
+
text-align: center;
|
|
416
|
+
user-select: none;
|
|
216
417
|
}
|
|
217
418
|
|
|
218
|
-
.sendity .
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
419
|
+
.sendity .sendity-footer[hidden],
|
|
420
|
+
.sendity .sendity-footer [hidden] { display: none !important; }
|
|
421
|
+
|
|
422
|
+
.sendity .footer-brand {
|
|
423
|
+
color: var(--sendity-fg-3);
|
|
424
|
+
grid-area: 1 / 1;
|
|
425
|
+
justify-self: center;
|
|
426
|
+
transition: opacity var(--sendity-crossfade-duration) ease, transform var(--sendity-crossfade-duration) ease;
|
|
427
|
+
}
|
|
428
|
+
.sendity .footer-logo {
|
|
429
|
+
font-weight: 600;
|
|
430
|
+
color: var(--sendity-fg-2);
|
|
222
431
|
text-decoration: none;
|
|
223
|
-
color: var(--sendity-btn-color);
|
|
224
|
-
background: var(--sendity-btn-bg);
|
|
225
|
-
padding: var(--sendity-btn-padding);
|
|
226
|
-
border-radius: var(--sendity-btn-border-radius);
|
|
227
|
-
border: var(--sendity-btn-border-size) solid var(--sendity-btn-border-color);
|
|
228
|
-
font-size: var(--sendity-btn-font-size);
|
|
229
432
|
}
|
|
433
|
+
.sendity .footer-logo:hover { text-decoration: underline; }
|
|
230
434
|
|
|
231
|
-
.sendity .
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
435
|
+
.sendity .footer-status {
|
|
436
|
+
grid-area: 1 / 1;
|
|
437
|
+
width: 100%;
|
|
438
|
+
min-width: 0;
|
|
439
|
+
display: flex;
|
|
440
|
+
align-items: center;
|
|
441
|
+
justify-content: space-between;
|
|
442
|
+
gap: 0.5rem;
|
|
443
|
+
opacity: 0;
|
|
444
|
+
transform: translateY(0.25rem);
|
|
445
|
+
transition: opacity var(--sendity-crossfade-duration) ease, transform var(--sendity-crossfade-duration) ease;
|
|
235
446
|
}
|
|
236
447
|
|
|
237
|
-
.sendity .
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
448
|
+
.sendity .sendity-footer.footer--transitioning .footer-brand,
|
|
449
|
+
.sendity .sendity-footer.footer--leaving .footer-brand {
|
|
450
|
+
opacity: 0;
|
|
451
|
+
transform: translateY(-0.25rem);
|
|
241
452
|
}
|
|
242
453
|
|
|
243
|
-
.sendity .
|
|
244
|
-
|
|
454
|
+
.sendity .sendity-footer.footer--waiting .footer-status {
|
|
455
|
+
opacity: 1;
|
|
456
|
+
transform: translateY(0);
|
|
245
457
|
}
|
|
246
458
|
|
|
247
|
-
.sendity .sendity-footer {
|
|
459
|
+
.sendity .sendity-footer.footer--verified .footer-spinner {
|
|
460
|
+
display: none;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.sendity .footer-status-left {
|
|
248
464
|
display: inline-flex;
|
|
249
465
|
align-items: center;
|
|
250
|
-
|
|
251
|
-
min-
|
|
252
|
-
color: rgba(17, 24, 39, 0.55);
|
|
253
|
-
font-size: 0.6875rem;
|
|
254
|
-
line-height: 1rem;
|
|
255
|
-
letter-spacing: 0.01em;
|
|
256
|
-
text-align: center;
|
|
257
|
-
user-select: none;
|
|
466
|
+
gap: 0.5rem;
|
|
467
|
+
min-width: 0;
|
|
258
468
|
}
|
|
259
469
|
|
|
260
|
-
.sendity .
|
|
261
|
-
.sendity .
|
|
262
|
-
|
|
470
|
+
.sendity .footer-message { white-space: nowrap; }
|
|
471
|
+
.sendity .footer-timer {
|
|
472
|
+
margin-left: auto;
|
|
473
|
+
flex: none;
|
|
474
|
+
font-variant-numeric: tabular-nums;
|
|
475
|
+
font-feature-settings: "tnum";
|
|
476
|
+
color: var(--sendity-fg-3);
|
|
263
477
|
}
|
|
478
|
+
.sendity .footer-timer.low { color: #b45309; /* amber-700 */ }
|
|
264
479
|
|
|
265
|
-
.sendity .footer-
|
|
266
|
-
|
|
267
|
-
|
|
480
|
+
.sendity .footer-spinner {
|
|
481
|
+
width: 0.5rem;
|
|
482
|
+
height: 0.5rem;
|
|
483
|
+
border-radius: 999px;
|
|
484
|
+
background: var(--sendity-primary-color);
|
|
485
|
+
position: relative;
|
|
486
|
+
flex: none;
|
|
268
487
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
488
|
+
.sendity .footer-spinner::after {
|
|
489
|
+
content: '';
|
|
490
|
+
position: absolute;
|
|
491
|
+
inset: -3px;
|
|
492
|
+
border-radius: 999px;
|
|
493
|
+
border: 2px solid var(--sendity-primary-color);
|
|
494
|
+
opacity: .5;
|
|
495
|
+
animation: sendity-pulse 1.6s ease-out infinite;
|
|
275
496
|
}
|
|
276
497
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
498
|
+
@keyframes sendity-pulse { to { transform: scale(2.4); opacity: 0; } }
|
|
499
|
+
|
|
500
|
+
/* Inherit dark surfaces when consumer page enables a dark theme on the host. */
|
|
501
|
+
:host([data-theme="dark"]),
|
|
502
|
+
:host(.dark),
|
|
503
|
+
:host-context(.dark),
|
|
504
|
+
:host-context([data-theme="dark"]) {
|
|
505
|
+
--sendity-bg: #1c1917;
|
|
506
|
+
--sendity-bg-subtle: #0c0a09;
|
|
507
|
+
--sendity-surface: #1c1917;
|
|
508
|
+
--sendity-border: #2c2825;
|
|
509
|
+
--sendity-border-strong: #44403c;
|
|
510
|
+
--sendity-color: #f5f5f4;
|
|
511
|
+
--sendity-fg-2: #a8a29e;
|
|
512
|
+
--sendity-fg-3: #78716c;
|
|
513
|
+
--sendity-primary-soft: rgb(16 185 129 / 0.16);
|
|
514
|
+
--sendity-success-bg: rgb(16 185 129 / 0.18);
|
|
515
|
+
--sendity-success-fg: #6ee7b7;
|
|
516
|
+
--sendity-email-bg: rgb(14 165 233 / 0.18);
|
|
517
|
+
--sendity-email-fg: #7dd3fc;
|
|
518
|
+
--sendity-email-border: rgb(14 165 233 / 0.4);
|
|
519
|
+
--sendity-email-icon: #38bdf8;
|
|
520
|
+
--sendity-email-bg-hover: rgb(14 165 233 / 0.28);
|
|
521
|
+
--sendity-whatsapp-bg: rgb(16 185 129 / 0.16);
|
|
522
|
+
--sendity-whatsapp-fg: #6ee7b7;
|
|
523
|
+
--sendity-whatsapp-border: rgb(16 185 129 / 0.4);
|
|
524
|
+
--sendity-whatsapp-icon: #34d399;
|
|
525
|
+
--sendity-whatsapp-bg-hover: rgb(16 185 129 / 0.26);
|
|
526
|
+
--sendity-btn-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.06), 0 1px 2px 0 rgb(0 0 0 / 0.4);
|
|
527
|
+
--sendity-shadow: 0 12px 28px -6px rgb(0 0 0 / 0.55), 0 6px 12px -6px rgb(0 0 0 / 0.4);
|
|
284
528
|
}
|
|
285
529
|
`;
|
|
286
|
-
class
|
|
530
|
+
class qe {
|
|
287
531
|
constructor() {
|
|
288
532
|
this.notificationCreatedEvent = ".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated";
|
|
289
533
|
}
|
|
@@ -312,7 +556,7 @@ class Oe {
|
|
|
312
556
|
return this.stopListening(".client-" + i, o);
|
|
313
557
|
}
|
|
314
558
|
}
|
|
315
|
-
class
|
|
559
|
+
class Ct {
|
|
316
560
|
/**
|
|
317
561
|
* Create a new class instance.
|
|
318
562
|
*/
|
|
@@ -332,19 +576,19 @@ class wt {
|
|
|
332
576
|
this.namespace = i;
|
|
333
577
|
}
|
|
334
578
|
}
|
|
335
|
-
function
|
|
579
|
+
function Di(v) {
|
|
336
580
|
try {
|
|
337
|
-
return Reflect.construct(String, [],
|
|
581
|
+
return Reflect.construct(String, [], v), !0;
|
|
338
582
|
} catch {
|
|
339
583
|
return !1;
|
|
340
584
|
}
|
|
341
585
|
}
|
|
342
|
-
class
|
|
586
|
+
class Ue extends qe {
|
|
343
587
|
/**
|
|
344
588
|
* Create a new class instance.
|
|
345
589
|
*/
|
|
346
|
-
constructor(i, o,
|
|
347
|
-
super(), this.name = o, this.pusher = i, this.options =
|
|
590
|
+
constructor(i, o, a) {
|
|
591
|
+
super(), this.name = o, this.pusher = i, this.options = a, this.eventFormatter = new Ct(this.options.namespace), this.subscribe();
|
|
348
592
|
}
|
|
349
593
|
/**
|
|
350
594
|
* Subscribe to a Pusher channel.
|
|
@@ -368,14 +612,14 @@ class qe extends Oe {
|
|
|
368
612
|
* Listen for all events on the channel instance.
|
|
369
613
|
*/
|
|
370
614
|
listenToAll(i) {
|
|
371
|
-
return this.subscription.bind_global((o,
|
|
615
|
+
return this.subscription.bind_global((o, a) => {
|
|
372
616
|
if (o.startsWith("pusher:"))
|
|
373
617
|
return;
|
|
374
618
|
let h = String(this.options.namespace ?? "").replace(
|
|
375
619
|
/\./g,
|
|
376
620
|
"\\"
|
|
377
|
-
),
|
|
378
|
-
i(
|
|
621
|
+
), u = o.startsWith(h) ? o.substring(h.length + 1) : "." + o;
|
|
622
|
+
i(u, a);
|
|
379
623
|
}), this;
|
|
380
624
|
}
|
|
381
625
|
/**
|
|
@@ -416,7 +660,7 @@ class qe extends Oe {
|
|
|
416
660
|
return this.subscription.bind(i, o), this;
|
|
417
661
|
}
|
|
418
662
|
}
|
|
419
|
-
class
|
|
663
|
+
class St extends Ue {
|
|
420
664
|
/**
|
|
421
665
|
* Send a whisper event to other clients in the channel.
|
|
422
666
|
*/
|
|
@@ -427,7 +671,7 @@ class Ct extends qe {
|
|
|
427
671
|
), this;
|
|
428
672
|
}
|
|
429
673
|
}
|
|
430
|
-
class
|
|
674
|
+
class Hi extends Ue {
|
|
431
675
|
/**
|
|
432
676
|
* Send a whisper event to other clients in the channel.
|
|
433
677
|
*/
|
|
@@ -438,13 +682,13 @@ class zi extends qe {
|
|
|
438
682
|
), this;
|
|
439
683
|
}
|
|
440
684
|
}
|
|
441
|
-
class
|
|
685
|
+
class Wi extends St {
|
|
442
686
|
/**
|
|
443
687
|
* Register a callback to be called anytime the member list changes.
|
|
444
688
|
*/
|
|
445
689
|
here(i) {
|
|
446
690
|
return this.on("pusher:subscription_succeeded", (o) => {
|
|
447
|
-
i(Object.keys(o.members).map((
|
|
691
|
+
i(Object.keys(o.members).map((a) => o.members[a]));
|
|
448
692
|
}), this;
|
|
449
693
|
}
|
|
450
694
|
/**
|
|
@@ -473,12 +717,12 @@ class Hi extends Ct {
|
|
|
473
717
|
}), this;
|
|
474
718
|
}
|
|
475
719
|
}
|
|
476
|
-
class
|
|
720
|
+
class Tt extends qe {
|
|
477
721
|
/**
|
|
478
722
|
* Create a new class instance.
|
|
479
723
|
*/
|
|
480
|
-
constructor(i, o,
|
|
481
|
-
super(), this.events = {}, this.listeners = {}, this.name = o, this.socket = i, this.options =
|
|
724
|
+
constructor(i, o, a) {
|
|
725
|
+
super(), this.events = {}, this.listeners = {}, this.name = o, this.socket = i, this.options = a, this.eventFormatter = new Ct(this.options.namespace), this.subscribe();
|
|
482
726
|
}
|
|
483
727
|
/**
|
|
484
728
|
* Subscribe to a Socket.io channel.
|
|
@@ -528,8 +772,8 @@ class St extends Oe {
|
|
|
528
772
|
* Bind the channel's socket to an event and store the callback.
|
|
529
773
|
*/
|
|
530
774
|
on(i, o) {
|
|
531
|
-
return this.listeners[i] = this.listeners[i] || [], this.events[i] || (this.events[i] = (
|
|
532
|
-
this.name ===
|
|
775
|
+
return this.listeners[i] = this.listeners[i] || [], this.events[i] || (this.events[i] = (a, h) => {
|
|
776
|
+
this.name === a && this.listeners[i] && this.listeners[i].forEach((u) => u(h));
|
|
533
777
|
}, this.socket.on(i, this.events[i])), this.listeners[i].push(o), this;
|
|
534
778
|
}
|
|
535
779
|
/**
|
|
@@ -545,11 +789,11 @@ class St extends Oe {
|
|
|
545
789
|
*/
|
|
546
790
|
unbindEvent(i, o) {
|
|
547
791
|
this.listeners[i] = this.listeners[i] || [], o && (this.listeners[i] = this.listeners[i].filter(
|
|
548
|
-
(
|
|
792
|
+
(a) => a !== o
|
|
549
793
|
)), (!o || this.listeners[i].length === 0) && (this.events[i] && (this.socket.removeListener(i, this.events[i]), delete this.events[i]), delete this.listeners[i]);
|
|
550
794
|
}
|
|
551
795
|
}
|
|
552
|
-
class _t extends
|
|
796
|
+
class _t extends Tt {
|
|
553
797
|
/**
|
|
554
798
|
* Send a whisper event to other clients in the channel.
|
|
555
799
|
*/
|
|
@@ -561,13 +805,13 @@ class _t extends St {
|
|
|
561
805
|
}), this;
|
|
562
806
|
}
|
|
563
807
|
}
|
|
564
|
-
class
|
|
808
|
+
class Fi extends _t {
|
|
565
809
|
/**
|
|
566
810
|
* Register a callback to be called anytime the member list changes.
|
|
567
811
|
*/
|
|
568
812
|
here(i) {
|
|
569
813
|
return this.on("presence:subscribed", (o) => {
|
|
570
|
-
i(o.map((
|
|
814
|
+
i(o.map((a) => a.user_info));
|
|
571
815
|
}), this;
|
|
572
816
|
}
|
|
573
817
|
/**
|
|
@@ -599,7 +843,7 @@ class Di extends _t {
|
|
|
599
843
|
), this;
|
|
600
844
|
}
|
|
601
845
|
}
|
|
602
|
-
class fe extends
|
|
846
|
+
class fe extends qe {
|
|
603
847
|
/**
|
|
604
848
|
* Subscribe to a channel.
|
|
605
849
|
*/
|
|
@@ -647,7 +891,7 @@ class fe extends Oe {
|
|
|
647
891
|
return this;
|
|
648
892
|
}
|
|
649
893
|
}
|
|
650
|
-
class
|
|
894
|
+
class xt extends fe {
|
|
651
895
|
/**
|
|
652
896
|
* Send a whisper event to other clients in the channel.
|
|
653
897
|
*/
|
|
@@ -655,7 +899,7 @@ class Tt extends fe {
|
|
|
655
899
|
return this;
|
|
656
900
|
}
|
|
657
901
|
}
|
|
658
|
-
class
|
|
902
|
+
class Bi extends fe {
|
|
659
903
|
/**
|
|
660
904
|
* Send a whisper event to other clients in the channel.
|
|
661
905
|
*/
|
|
@@ -663,7 +907,7 @@ class Wi extends fe {
|
|
|
663
907
|
return this;
|
|
664
908
|
}
|
|
665
909
|
}
|
|
666
|
-
class
|
|
910
|
+
class $i extends xt {
|
|
667
911
|
/**
|
|
668
912
|
* Register a callback to be called anytime the member list changes.
|
|
669
913
|
*/
|
|
@@ -731,8 +975,8 @@ kt._defaultOptions = {
|
|
|
731
975
|
key: null,
|
|
732
976
|
namespace: "App.Events"
|
|
733
977
|
};
|
|
734
|
-
let
|
|
735
|
-
class pe extends
|
|
978
|
+
let je = kt;
|
|
979
|
+
class pe extends je {
|
|
736
980
|
constructor() {
|
|
737
981
|
super(...arguments), this.channels = {};
|
|
738
982
|
}
|
|
@@ -763,14 +1007,14 @@ class pe extends Ue {
|
|
|
763
1007
|
/**
|
|
764
1008
|
* Listen for an event on a channel instance.
|
|
765
1009
|
*/
|
|
766
|
-
listen(i, o,
|
|
767
|
-
return this.channel(i).listen(o,
|
|
1010
|
+
listen(i, o, a) {
|
|
1011
|
+
return this.channel(i).listen(o, a);
|
|
768
1012
|
}
|
|
769
1013
|
/**
|
|
770
1014
|
* Get a channel instance by name.
|
|
771
1015
|
*/
|
|
772
1016
|
channel(i) {
|
|
773
|
-
return this.channels[i] || (this.channels[i] = new
|
|
1017
|
+
return this.channels[i] || (this.channels[i] = new Ue(
|
|
774
1018
|
this.pusher,
|
|
775
1019
|
i,
|
|
776
1020
|
this.options
|
|
@@ -780,7 +1024,7 @@ class pe extends Ue {
|
|
|
780
1024
|
* Get a private channel instance by name.
|
|
781
1025
|
*/
|
|
782
1026
|
privateChannel(i) {
|
|
783
|
-
return this.channels["private-" + i] || (this.channels["private-" + i] = new
|
|
1027
|
+
return this.channels["private-" + i] || (this.channels["private-" + i] = new St(
|
|
784
1028
|
this.pusher,
|
|
785
1029
|
"private-" + i,
|
|
786
1030
|
this.options
|
|
@@ -790,7 +1034,7 @@ class pe extends Ue {
|
|
|
790
1034
|
* Get a private encrypted channel instance by name.
|
|
791
1035
|
*/
|
|
792
1036
|
encryptedPrivateChannel(i) {
|
|
793
|
-
return this.channels["private-encrypted-" + i] || (this.channels["private-encrypted-" + i] = new
|
|
1037
|
+
return this.channels["private-encrypted-" + i] || (this.channels["private-encrypted-" + i] = new Hi(
|
|
794
1038
|
this.pusher,
|
|
795
1039
|
"private-encrypted-" + i,
|
|
796
1040
|
this.options
|
|
@@ -800,7 +1044,7 @@ class pe extends Ue {
|
|
|
800
1044
|
* Get a presence channel instance by name.
|
|
801
1045
|
*/
|
|
802
1046
|
presenceChannel(i) {
|
|
803
|
-
return this.channels["presence-" + i] || (this.channels["presence-" + i] = new
|
|
1047
|
+
return this.channels["presence-" + i] || (this.channels["presence-" + i] = new Wi(
|
|
804
1048
|
this.pusher,
|
|
805
1049
|
"presence-" + i,
|
|
806
1050
|
this.options
|
|
@@ -853,11 +1097,11 @@ class pe extends Ue {
|
|
|
853
1097
|
onConnectionChange(i) {
|
|
854
1098
|
const o = () => {
|
|
855
1099
|
i(this.connectionStatus());
|
|
856
|
-
},
|
|
857
|
-
return
|
|
1100
|
+
}, a = ["state_change", "connected", "disconnected"];
|
|
1101
|
+
return a.forEach((h) => {
|
|
858
1102
|
this.pusher.connection.bind(h, o);
|
|
859
1103
|
}), () => {
|
|
860
|
-
|
|
1104
|
+
a.forEach((h) => {
|
|
861
1105
|
this.pusher.connection.unbind(h, o);
|
|
862
1106
|
});
|
|
863
1107
|
};
|
|
@@ -869,7 +1113,7 @@ class pe extends Ue {
|
|
|
869
1113
|
this.pusher.disconnect();
|
|
870
1114
|
}
|
|
871
1115
|
}
|
|
872
|
-
class
|
|
1116
|
+
class Xi extends je {
|
|
873
1117
|
constructor() {
|
|
874
1118
|
super(...arguments), this.channels = {};
|
|
875
1119
|
}
|
|
@@ -902,14 +1146,14 @@ class Bi extends Ue {
|
|
|
902
1146
|
/**
|
|
903
1147
|
* Listen for an event on a channel instance.
|
|
904
1148
|
*/
|
|
905
|
-
listen(i, o,
|
|
906
|
-
return this.channel(i).listen(o,
|
|
1149
|
+
listen(i, o, a) {
|
|
1150
|
+
return this.channel(i).listen(o, a);
|
|
907
1151
|
}
|
|
908
1152
|
/**
|
|
909
1153
|
* Get a channel instance by name.
|
|
910
1154
|
*/
|
|
911
1155
|
channel(i) {
|
|
912
|
-
return this.channels[i] || (this.channels[i] = new
|
|
1156
|
+
return this.channels[i] || (this.channels[i] = new Tt(
|
|
913
1157
|
this.socket,
|
|
914
1158
|
i,
|
|
915
1159
|
this.options
|
|
@@ -929,7 +1173,7 @@ class Bi extends Ue {
|
|
|
929
1173
|
* Get a presence channel instance by name.
|
|
930
1174
|
*/
|
|
931
1175
|
presenceChannel(i) {
|
|
932
|
-
return this.channels["presence-" + i] || (this.channels["presence-" + i] = new
|
|
1176
|
+
return this.channels["presence-" + i] || (this.channels["presence-" + i] = new Fi(
|
|
933
1177
|
this.socket,
|
|
934
1178
|
"presence-" + i,
|
|
935
1179
|
this.options
|
|
@@ -967,7 +1211,7 @@ class Bi extends Ue {
|
|
|
967
1211
|
onConnectionChange(i) {
|
|
968
1212
|
const o = () => {
|
|
969
1213
|
i(this.connectionStatus());
|
|
970
|
-
},
|
|
1214
|
+
}, a = [
|
|
971
1215
|
"connect",
|
|
972
1216
|
"disconnect",
|
|
973
1217
|
"connect_error",
|
|
@@ -976,10 +1220,10 @@ class Bi extends Ue {
|
|
|
976
1220
|
"reconnect_error",
|
|
977
1221
|
"reconnect_failed"
|
|
978
1222
|
];
|
|
979
|
-
return
|
|
1223
|
+
return a.forEach((h) => {
|
|
980
1224
|
this.socket.on(h, o);
|
|
981
1225
|
}), () => {
|
|
982
|
-
|
|
1226
|
+
a.forEach((h) => {
|
|
983
1227
|
this.socket.off(h, o);
|
|
984
1228
|
});
|
|
985
1229
|
};
|
|
@@ -991,7 +1235,7 @@ class Bi extends Ue {
|
|
|
991
1235
|
this.socket.disconnect();
|
|
992
1236
|
}
|
|
993
1237
|
}
|
|
994
|
-
class
|
|
1238
|
+
class mt extends je {
|
|
995
1239
|
constructor() {
|
|
996
1240
|
super(...arguments), this.channels = {};
|
|
997
1241
|
}
|
|
@@ -1003,7 +1247,7 @@ class ft extends Ue {
|
|
|
1003
1247
|
/**
|
|
1004
1248
|
* Listen for an event on a channel instance.
|
|
1005
1249
|
*/
|
|
1006
|
-
listen(i, o,
|
|
1250
|
+
listen(i, o, a) {
|
|
1007
1251
|
return new fe();
|
|
1008
1252
|
}
|
|
1009
1253
|
/**
|
|
@@ -1016,19 +1260,19 @@ class ft extends Ue {
|
|
|
1016
1260
|
* Get a private channel instance by name.
|
|
1017
1261
|
*/
|
|
1018
1262
|
privateChannel(i) {
|
|
1019
|
-
return new
|
|
1263
|
+
return new xt();
|
|
1020
1264
|
}
|
|
1021
1265
|
/**
|
|
1022
1266
|
* Get a private encrypted channel instance by name.
|
|
1023
1267
|
*/
|
|
1024
1268
|
encryptedPrivateChannel(i) {
|
|
1025
|
-
return new
|
|
1269
|
+
return new Bi();
|
|
1026
1270
|
}
|
|
1027
1271
|
/**
|
|
1028
1272
|
* Get a presence channel instance by name.
|
|
1029
1273
|
*/
|
|
1030
1274
|
presenceChannel(i) {
|
|
1031
|
-
return new
|
|
1275
|
+
return new $i();
|
|
1032
1276
|
}
|
|
1033
1277
|
/**
|
|
1034
1278
|
* Leave the given channel, as well as its private and presence variants.
|
|
@@ -1065,7 +1309,7 @@ class ft extends Ue {
|
|
|
1065
1309
|
disconnect() {
|
|
1066
1310
|
}
|
|
1067
1311
|
}
|
|
1068
|
-
class
|
|
1312
|
+
class Ji {
|
|
1069
1313
|
/**
|
|
1070
1314
|
* Create a new class instance.
|
|
1071
1315
|
*/
|
|
@@ -1096,10 +1340,10 @@ class $i {
|
|
|
1096
1340
|
broadcaster: "pusher"
|
|
1097
1341
|
});
|
|
1098
1342
|
else if (this.options.broadcaster === "socket.io")
|
|
1099
|
-
this.connector = new
|
|
1343
|
+
this.connector = new Xi(this.options);
|
|
1100
1344
|
else if (this.options.broadcaster === "null")
|
|
1101
|
-
this.connector = new
|
|
1102
|
-
else if (typeof this.options.broadcaster == "function" &&
|
|
1345
|
+
this.connector = new mt(this.options);
|
|
1346
|
+
else if (typeof this.options.broadcaster == "function" && Di(this.options.broadcaster))
|
|
1103
1347
|
this.connector = new this.options.broadcaster(this.options);
|
|
1104
1348
|
else
|
|
1105
1349
|
throw new Error(
|
|
@@ -1140,8 +1384,8 @@ class $i {
|
|
|
1140
1384
|
/**
|
|
1141
1385
|
* Listen for an event on a channel instance.
|
|
1142
1386
|
*/
|
|
1143
|
-
listen(i, o,
|
|
1144
|
-
return this.connector.listen(i, o,
|
|
1387
|
+
listen(i, o, a) {
|
|
1388
|
+
return this.connector.listen(i, o, a);
|
|
1145
1389
|
}
|
|
1146
1390
|
/**
|
|
1147
1391
|
* Get a private channel instance by name.
|
|
@@ -1162,7 +1406,7 @@ class $i {
|
|
|
1162
1406
|
);
|
|
1163
1407
|
}
|
|
1164
1408
|
connectorSupportsEncryptedPrivateChannels(i) {
|
|
1165
|
-
return i instanceof pe || i instanceof
|
|
1409
|
+
return i instanceof pe || i instanceof mt;
|
|
1166
1410
|
}
|
|
1167
1411
|
/**
|
|
1168
1412
|
* Get the Socket ID for the connection.
|
|
@@ -1206,8 +1450,8 @@ class $i {
|
|
|
1206
1450
|
*/
|
|
1207
1451
|
registerjQueryAjaxSetup() {
|
|
1208
1452
|
typeof jQuery.ajax < "u" && jQuery.ajaxPrefilter(
|
|
1209
|
-
(i, o,
|
|
1210
|
-
this.socketId() &&
|
|
1453
|
+
(i, o, a) => {
|
|
1454
|
+
this.socketId() && a.setRequestHeader("X-Socket-Id", this.socketId());
|
|
1211
1455
|
}
|
|
1212
1456
|
);
|
|
1213
1457
|
}
|
|
@@ -1223,203 +1467,203 @@ class $i {
|
|
|
1223
1467
|
);
|
|
1224
1468
|
}
|
|
1225
1469
|
}
|
|
1226
|
-
function
|
|
1227
|
-
return
|
|
1470
|
+
function Vi(v) {
|
|
1471
|
+
return v && v.__esModule && Object.prototype.hasOwnProperty.call(v, "default") ? v.default : v;
|
|
1228
1472
|
}
|
|
1229
1473
|
var Ae = { exports: {} };
|
|
1230
1474
|
var gt;
|
|
1231
|
-
function
|
|
1232
|
-
return gt || (gt = 1, (function(
|
|
1233
|
-
(function(
|
|
1234
|
-
|
|
1475
|
+
function Gi() {
|
|
1476
|
+
return gt || (gt = 1, (function(v, i) {
|
|
1477
|
+
(function(a, h) {
|
|
1478
|
+
v.exports = h();
|
|
1235
1479
|
})(self, () => (
|
|
1236
1480
|
/******/
|
|
1237
1481
|
(() => {
|
|
1238
1482
|
var o = {
|
|
1239
1483
|
/***/
|
|
1240
|
-
594(
|
|
1241
|
-
var
|
|
1242
|
-
var
|
|
1243
|
-
return
|
|
1244
|
-
|
|
1245
|
-
} || function(
|
|
1246
|
-
for (var q in P) P.hasOwnProperty(q) && (
|
|
1247
|
-
},
|
|
1484
|
+
594(m, g) {
|
|
1485
|
+
var y = this && this.__extends || /* @__PURE__ */ (function() {
|
|
1486
|
+
var _ = function(d, p) {
|
|
1487
|
+
return _ = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(S, P) {
|
|
1488
|
+
S.__proto__ = P;
|
|
1489
|
+
} || function(S, P) {
|
|
1490
|
+
for (var q in P) P.hasOwnProperty(q) && (S[q] = P[q]);
|
|
1491
|
+
}, _(d, p);
|
|
1248
1492
|
};
|
|
1249
|
-
return function(
|
|
1250
|
-
|
|
1251
|
-
function
|
|
1252
|
-
this.constructor =
|
|
1493
|
+
return function(d, p) {
|
|
1494
|
+
_(d, p);
|
|
1495
|
+
function S() {
|
|
1496
|
+
this.constructor = d;
|
|
1253
1497
|
}
|
|
1254
|
-
|
|
1498
|
+
d.prototype = p === null ? Object.create(p) : (S.prototype = p.prototype, new S());
|
|
1255
1499
|
};
|
|
1256
1500
|
})();
|
|
1257
|
-
Object.defineProperty(
|
|
1258
|
-
var
|
|
1501
|
+
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
1502
|
+
var x = 256, w = (
|
|
1259
1503
|
/** @class */
|
|
1260
1504
|
(function() {
|
|
1261
|
-
function
|
|
1262
|
-
|
|
1505
|
+
function _(d) {
|
|
1506
|
+
d === void 0 && (d = "="), this._paddingCharacter = d;
|
|
1263
1507
|
}
|
|
1264
|
-
return
|
|
1265
|
-
return this._paddingCharacter ? (
|
|
1266
|
-
},
|
|
1267
|
-
for (var
|
|
1268
|
-
var P =
|
|
1269
|
-
|
|
1508
|
+
return _.prototype.encodedLength = function(d) {
|
|
1509
|
+
return this._paddingCharacter ? (d + 2) / 3 * 4 | 0 : (d * 8 + 5) / 6 | 0;
|
|
1510
|
+
}, _.prototype.encode = function(d) {
|
|
1511
|
+
for (var p = "", S = 0; S < d.length - 2; S += 3) {
|
|
1512
|
+
var P = d[S] << 16 | d[S + 1] << 8 | d[S + 2];
|
|
1513
|
+
p += this._encodeByte(P >>> 18 & 63), p += this._encodeByte(P >>> 12 & 63), p += this._encodeByte(P >>> 6 & 63), p += this._encodeByte(P >>> 0 & 63);
|
|
1270
1514
|
}
|
|
1271
|
-
var q =
|
|
1515
|
+
var q = d.length - S;
|
|
1272
1516
|
if (q > 0) {
|
|
1273
|
-
var P =
|
|
1274
|
-
|
|
1517
|
+
var P = d[S] << 16 | (q === 2 ? d[S + 1] << 8 : 0);
|
|
1518
|
+
p += this._encodeByte(P >>> 18 & 63), p += this._encodeByte(P >>> 12 & 63), q === 2 ? p += this._encodeByte(P >>> 6 & 63) : p += this._paddingCharacter || "", p += this._paddingCharacter || "";
|
|
1275
1519
|
}
|
|
1276
|
-
return
|
|
1277
|
-
},
|
|
1278
|
-
return this._paddingCharacter ?
|
|
1279
|
-
},
|
|
1280
|
-
return this.maxDecodedLength(
|
|
1281
|
-
},
|
|
1282
|
-
if (
|
|
1520
|
+
return p;
|
|
1521
|
+
}, _.prototype.maxDecodedLength = function(d) {
|
|
1522
|
+
return this._paddingCharacter ? d / 4 * 3 | 0 : (d * 6 + 7) / 8 | 0;
|
|
1523
|
+
}, _.prototype.decodedLength = function(d) {
|
|
1524
|
+
return this.maxDecodedLength(d.length - this._getPaddingLength(d));
|
|
1525
|
+
}, _.prototype.decode = function(d) {
|
|
1526
|
+
if (d.length === 0)
|
|
1283
1527
|
return new Uint8Array(0);
|
|
1284
|
-
for (var
|
|
1285
|
-
|
|
1286
|
-
if (N <
|
|
1528
|
+
for (var p = this._getPaddingLength(d), S = d.length - p, P = new Uint8Array(this.maxDecodedLength(S)), q = 0, N = 0, M = 0, J = 0, H = 0, D = 0, V = 0; N < S - 4; N += 4)
|
|
1529
|
+
J = this._decodeChar(d.charCodeAt(N + 0)), H = this._decodeChar(d.charCodeAt(N + 1)), D = this._decodeChar(d.charCodeAt(N + 2)), V = this._decodeChar(d.charCodeAt(N + 3)), P[q++] = J << 2 | H >>> 4, P[q++] = H << 4 | D >>> 2, P[q++] = D << 6 | V, M |= J & x, M |= H & x, M |= D & x, M |= V & x;
|
|
1530
|
+
if (N < S - 1 && (J = this._decodeChar(d.charCodeAt(N)), H = this._decodeChar(d.charCodeAt(N + 1)), P[q++] = J << 2 | H >>> 4, M |= J & x, M |= H & x), N < S - 2 && (D = this._decodeChar(d.charCodeAt(N + 2)), P[q++] = H << 4 | D >>> 2, M |= D & x), N < S - 3 && (V = this._decodeChar(d.charCodeAt(N + 3)), P[q++] = D << 6 | V, M |= V & x), M !== 0)
|
|
1287
1531
|
throw new Error("Base64Coder: incorrect characters for decoding");
|
|
1288
1532
|
return P;
|
|
1289
|
-
},
|
|
1290
|
-
var
|
|
1291
|
-
return
|
|
1292
|
-
},
|
|
1293
|
-
var
|
|
1294
|
-
return
|
|
1295
|
-
},
|
|
1296
|
-
var
|
|
1533
|
+
}, _.prototype._encodeByte = function(d) {
|
|
1534
|
+
var p = d;
|
|
1535
|
+
return p += 65, p += 25 - d >>> 8 & 6, p += 51 - d >>> 8 & -75, p += 61 - d >>> 8 & -15, p += 62 - d >>> 8 & 3, String.fromCharCode(p);
|
|
1536
|
+
}, _.prototype._decodeChar = function(d) {
|
|
1537
|
+
var p = x;
|
|
1538
|
+
return p += (42 - d & d - 44) >>> 8 & -x + d - 43 + 62, p += (46 - d & d - 48) >>> 8 & -x + d - 47 + 63, p += (47 - d & d - 58) >>> 8 & -x + d - 48 + 52, p += (64 - d & d - 91) >>> 8 & -x + d - 65 + 0, p += (96 - d & d - 123) >>> 8 & -x + d - 97 + 26, p;
|
|
1539
|
+
}, _.prototype._getPaddingLength = function(d) {
|
|
1540
|
+
var p = 0;
|
|
1297
1541
|
if (this._paddingCharacter) {
|
|
1298
|
-
for (var
|
|
1299
|
-
|
|
1300
|
-
if (
|
|
1542
|
+
for (var S = d.length - 1; S >= 0 && d[S] === this._paddingCharacter; S--)
|
|
1543
|
+
p++;
|
|
1544
|
+
if (d.length < 4 || p > 2)
|
|
1301
1545
|
throw new Error("Base64Coder: incorrect padding");
|
|
1302
1546
|
}
|
|
1303
|
-
return
|
|
1304
|
-
},
|
|
1547
|
+
return p;
|
|
1548
|
+
}, _;
|
|
1305
1549
|
})()
|
|
1306
1550
|
);
|
|
1307
|
-
|
|
1308
|
-
var
|
|
1309
|
-
function _
|
|
1310
|
-
return
|
|
1551
|
+
g.Coder = w;
|
|
1552
|
+
var R = new w();
|
|
1553
|
+
function T(_) {
|
|
1554
|
+
return R.encode(_);
|
|
1311
1555
|
}
|
|
1312
|
-
|
|
1313
|
-
function A(
|
|
1314
|
-
return
|
|
1556
|
+
g.encode = T;
|
|
1557
|
+
function A(_) {
|
|
1558
|
+
return R.decode(_);
|
|
1315
1559
|
}
|
|
1316
|
-
|
|
1560
|
+
g.decode = A;
|
|
1317
1561
|
var W = (
|
|
1318
1562
|
/** @class */
|
|
1319
|
-
(function(
|
|
1320
|
-
|
|
1321
|
-
function
|
|
1322
|
-
return
|
|
1563
|
+
(function(_) {
|
|
1564
|
+
y(d, _);
|
|
1565
|
+
function d() {
|
|
1566
|
+
return _ !== null && _.apply(this, arguments) || this;
|
|
1323
1567
|
}
|
|
1324
|
-
return
|
|
1325
|
-
var
|
|
1326
|
-
return
|
|
1327
|
-
},
|
|
1328
|
-
var
|
|
1329
|
-
return
|
|
1330
|
-
},
|
|
1331
|
-
})(
|
|
1568
|
+
return d.prototype._encodeByte = function(p) {
|
|
1569
|
+
var S = p;
|
|
1570
|
+
return S += 65, S += 25 - p >>> 8 & 6, S += 51 - p >>> 8 & -75, S += 61 - p >>> 8 & -13, S += 62 - p >>> 8 & 49, String.fromCharCode(S);
|
|
1571
|
+
}, d.prototype._decodeChar = function(p) {
|
|
1572
|
+
var S = x;
|
|
1573
|
+
return S += (44 - p & p - 46) >>> 8 & -x + p - 45 + 62, S += (94 - p & p - 96) >>> 8 & -x + p - 95 + 63, S += (47 - p & p - 58) >>> 8 & -x + p - 48 + 52, S += (64 - p & p - 91) >>> 8 & -x + p - 65 + 0, S += (96 - p & p - 123) >>> 8 & -x + p - 97 + 26, S;
|
|
1574
|
+
}, d;
|
|
1575
|
+
})(w)
|
|
1332
1576
|
);
|
|
1333
|
-
|
|
1577
|
+
g.URLSafeCoder = W;
|
|
1334
1578
|
var j = new W();
|
|
1335
|
-
function F(
|
|
1336
|
-
return j.encode(
|
|
1579
|
+
function F(_) {
|
|
1580
|
+
return j.encode(_);
|
|
1337
1581
|
}
|
|
1338
|
-
|
|
1339
|
-
function
|
|
1340
|
-
return j.decode(
|
|
1582
|
+
g.encodeURLSafe = F;
|
|
1583
|
+
function te(_) {
|
|
1584
|
+
return j.decode(_);
|
|
1341
1585
|
}
|
|
1342
|
-
|
|
1343
|
-
return
|
|
1344
|
-
},
|
|
1345
|
-
return
|
|
1346
|
-
},
|
|
1347
|
-
return
|
|
1586
|
+
g.decodeURLSafe = te, g.encodedLength = function(_) {
|
|
1587
|
+
return R.encodedLength(_);
|
|
1588
|
+
}, g.maxDecodedLength = function(_) {
|
|
1589
|
+
return R.maxDecodedLength(_);
|
|
1590
|
+
}, g.decodedLength = function(_) {
|
|
1591
|
+
return R.decodedLength(_);
|
|
1348
1592
|
};
|
|
1349
1593
|
},
|
|
1350
1594
|
/***/
|
|
1351
|
-
978(
|
|
1352
|
-
var
|
|
1353
|
-
function
|
|
1354
|
-
for (var
|
|
1355
|
-
var A =
|
|
1595
|
+
978(m, g) {
|
|
1596
|
+
var y = "utf8: invalid source encoding";
|
|
1597
|
+
function x(w) {
|
|
1598
|
+
for (var R = [], T = 0; T < w.length; T++) {
|
|
1599
|
+
var A = w[T];
|
|
1356
1600
|
if (A & 128) {
|
|
1357
1601
|
var W = void 0;
|
|
1358
1602
|
if (A < 224) {
|
|
1359
|
-
if (
|
|
1360
|
-
throw new Error(
|
|
1361
|
-
var j =
|
|
1603
|
+
if (T >= w.length)
|
|
1604
|
+
throw new Error(y);
|
|
1605
|
+
var j = w[++T];
|
|
1362
1606
|
if ((j & 192) !== 128)
|
|
1363
|
-
throw new Error(
|
|
1607
|
+
throw new Error(y);
|
|
1364
1608
|
A = (A & 31) << 6 | j & 63, W = 128;
|
|
1365
1609
|
} else if (A < 240) {
|
|
1366
|
-
if (
|
|
1367
|
-
throw new Error(
|
|
1368
|
-
var j =
|
|
1610
|
+
if (T >= w.length - 1)
|
|
1611
|
+
throw new Error(y);
|
|
1612
|
+
var j = w[++T], F = w[++T];
|
|
1369
1613
|
if ((j & 192) !== 128 || (F & 192) !== 128)
|
|
1370
|
-
throw new Error(
|
|
1614
|
+
throw new Error(y);
|
|
1371
1615
|
A = (A & 15) << 12 | (j & 63) << 6 | F & 63, W = 2048;
|
|
1372
1616
|
} else if (A < 248) {
|
|
1373
|
-
if (
|
|
1374
|
-
throw new Error(
|
|
1375
|
-
var j =
|
|
1376
|
-
if ((j & 192) !== 128 || (F & 192) !== 128 || (
|
|
1377
|
-
throw new Error(
|
|
1378
|
-
A = (A & 15) << 18 | (j & 63) << 12 | (F & 63) << 6 |
|
|
1617
|
+
if (T >= w.length - 2)
|
|
1618
|
+
throw new Error(y);
|
|
1619
|
+
var j = w[++T], F = w[++T], te = w[++T];
|
|
1620
|
+
if ((j & 192) !== 128 || (F & 192) !== 128 || (te & 192) !== 128)
|
|
1621
|
+
throw new Error(y);
|
|
1622
|
+
A = (A & 15) << 18 | (j & 63) << 12 | (F & 63) << 6 | te & 63, W = 65536;
|
|
1379
1623
|
} else
|
|
1380
|
-
throw new Error(
|
|
1624
|
+
throw new Error(y);
|
|
1381
1625
|
if (A < W || A >= 55296 && A <= 57343)
|
|
1382
|
-
throw new Error(
|
|
1626
|
+
throw new Error(y);
|
|
1383
1627
|
if (A >= 65536) {
|
|
1384
1628
|
if (A > 1114111)
|
|
1385
|
-
throw new Error(
|
|
1386
|
-
A -= 65536,
|
|
1629
|
+
throw new Error(y);
|
|
1630
|
+
A -= 65536, R.push(String.fromCharCode(55296 | A >> 10)), A = 56320 | A & 1023;
|
|
1387
1631
|
}
|
|
1388
1632
|
}
|
|
1389
|
-
|
|
1633
|
+
R.push(String.fromCharCode(A));
|
|
1390
1634
|
}
|
|
1391
|
-
return
|
|
1635
|
+
return R.join("");
|
|
1392
1636
|
}
|
|
1393
|
-
|
|
1637
|
+
g.D4 = x;
|
|
1394
1638
|
},
|
|
1395
1639
|
/***/
|
|
1396
|
-
721(
|
|
1397
|
-
|
|
1640
|
+
721(m, g, y) {
|
|
1641
|
+
m.exports = y(207).default;
|
|
1398
1642
|
},
|
|
1399
1643
|
/***/
|
|
1400
|
-
207(
|
|
1401
|
-
|
|
1644
|
+
207(m, g, y) {
|
|
1645
|
+
y.d(g, {
|
|
1402
1646
|
default: () => (
|
|
1403
1647
|
/* binding */
|
|
1404
|
-
|
|
1648
|
+
ue
|
|
1405
1649
|
)
|
|
1406
1650
|
});
|
|
1407
|
-
class
|
|
1651
|
+
class x {
|
|
1408
1652
|
constructor(e, t) {
|
|
1409
1653
|
this.lastId = 0, this.prefix = e, this.name = t;
|
|
1410
1654
|
}
|
|
1411
1655
|
create(e) {
|
|
1412
1656
|
this.lastId++;
|
|
1413
|
-
var t = this.lastId, r = this.prefix + t, s = this.name + "[" + t + "]",
|
|
1414
|
-
|
|
1657
|
+
var t = this.lastId, r = this.prefix + t, s = this.name + "[" + t + "]", c = !1, l = function() {
|
|
1658
|
+
c || (e.apply(null, arguments), c = !0);
|
|
1415
1659
|
};
|
|
1416
|
-
return this[t] =
|
|
1660
|
+
return this[t] = l, { number: t, id: r, name: s, callback: l };
|
|
1417
1661
|
}
|
|
1418
1662
|
remove(e) {
|
|
1419
1663
|
delete this[e.number];
|
|
1420
1664
|
}
|
|
1421
1665
|
}
|
|
1422
|
-
var
|
|
1666
|
+
var w = new x("_pusher_script_", "Pusher.ScriptReceivers"), R = {
|
|
1423
1667
|
VERSION: "8.5.0",
|
|
1424
1668
|
PROTOCOL: 7,
|
|
1425
1669
|
wsPort: 80,
|
|
@@ -1447,10 +1691,10 @@ function Vi() {
|
|
|
1447
1691
|
cdn_https: "https://js.pusher.com",
|
|
1448
1692
|
dependency_suffix: ""
|
|
1449
1693
|
};
|
|
1450
|
-
const
|
|
1694
|
+
const T = R;
|
|
1451
1695
|
class A {
|
|
1452
1696
|
constructor(e) {
|
|
1453
|
-
this.options = e, this.receivers = e.receivers ||
|
|
1697
|
+
this.options = e, this.receivers = e.receivers || w, this.loading = {};
|
|
1454
1698
|
}
|
|
1455
1699
|
load(e, t, r) {
|
|
1456
1700
|
var s = this;
|
|
@@ -1458,32 +1702,32 @@ function Vi() {
|
|
|
1458
1702
|
s.loading[e].push(r);
|
|
1459
1703
|
else {
|
|
1460
1704
|
s.loading[e] = [r];
|
|
1461
|
-
var
|
|
1462
|
-
if (s.receivers.remove(
|
|
1463
|
-
var
|
|
1705
|
+
var c = C.createScriptRequest(s.getPath(e, t)), l = s.receivers.create(function(f) {
|
|
1706
|
+
if (s.receivers.remove(l), s.loading[e]) {
|
|
1707
|
+
var b = s.loading[e];
|
|
1464
1708
|
delete s.loading[e];
|
|
1465
|
-
for (var
|
|
1466
|
-
I ||
|
|
1467
|
-
},
|
|
1468
|
-
|
|
1709
|
+
for (var k = function(I) {
|
|
1710
|
+
I || c.cleanup();
|
|
1711
|
+
}, E = 0; E < b.length; E++)
|
|
1712
|
+
b[E](f, k);
|
|
1469
1713
|
}
|
|
1470
1714
|
});
|
|
1471
|
-
|
|
1715
|
+
c.send(l);
|
|
1472
1716
|
}
|
|
1473
1717
|
}
|
|
1474
1718
|
getRoot(e) {
|
|
1475
|
-
var t, r =
|
|
1719
|
+
var t, r = C.getDocument().location.protocol;
|
|
1476
1720
|
return e && e.useTLS || r === "https:" ? t = this.options.cdn_https : t = this.options.cdn_http, t.replace(/\/*$/, "") + "/" + this.options.version;
|
|
1477
1721
|
}
|
|
1478
1722
|
getPath(e, t) {
|
|
1479
1723
|
return this.getRoot(t) + "/" + e + this.options.suffix + ".js";
|
|
1480
1724
|
}
|
|
1481
1725
|
}
|
|
1482
|
-
var W = new
|
|
1483
|
-
cdn_http:
|
|
1484
|
-
cdn_https:
|
|
1485
|
-
version:
|
|
1486
|
-
suffix:
|
|
1726
|
+
var W = new x("_pusher_dependencies", "Pusher.DependenciesReceivers"), j = new A({
|
|
1727
|
+
cdn_http: T.cdn_http,
|
|
1728
|
+
cdn_https: T.cdn_https,
|
|
1729
|
+
version: T.VERSION,
|
|
1730
|
+
suffix: T.dependency_suffix,
|
|
1487
1731
|
receivers: W
|
|
1488
1732
|
});
|
|
1489
1733
|
const F = {
|
|
@@ -1505,23 +1749,23 @@ function Vi() {
|
|
|
1505
1749
|
fullUrl: "https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"
|
|
1506
1750
|
}
|
|
1507
1751
|
}
|
|
1508
|
-
},
|
|
1752
|
+
}, _ = { buildLogSuffix: function(n) {
|
|
1509
1753
|
const e = "See:", t = F.urls[n];
|
|
1510
1754
|
if (!t)
|
|
1511
1755
|
return "";
|
|
1512
1756
|
let r;
|
|
1513
1757
|
return t.fullUrl ? r = t.fullUrl : t.path && (r = F.baseUrl + t.path), r ? `${e} ${r}` : "";
|
|
1514
1758
|
} };
|
|
1515
|
-
var
|
|
1759
|
+
var d;
|
|
1516
1760
|
(function(n) {
|
|
1517
1761
|
n.UserAuthentication = "user-authentication", n.ChannelAuthorization = "channel-authorization";
|
|
1518
|
-
})(
|
|
1519
|
-
class
|
|
1762
|
+
})(d || (d = {}));
|
|
1763
|
+
class p extends Error {
|
|
1520
1764
|
constructor(e) {
|
|
1521
1765
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1522
1766
|
}
|
|
1523
1767
|
}
|
|
1524
|
-
class
|
|
1768
|
+
class S extends Error {
|
|
1525
1769
|
constructor(e) {
|
|
1526
1770
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1527
1771
|
}
|
|
@@ -1541,69 +1785,69 @@ function Vi() {
|
|
|
1541
1785
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1542
1786
|
}
|
|
1543
1787
|
}
|
|
1544
|
-
class
|
|
1788
|
+
class M extends Error {
|
|
1545
1789
|
constructor(e) {
|
|
1546
1790
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1547
1791
|
}
|
|
1548
1792
|
}
|
|
1549
|
-
class
|
|
1793
|
+
class J extends Error {
|
|
1550
1794
|
constructor(e) {
|
|
1551
1795
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1552
1796
|
}
|
|
1553
1797
|
}
|
|
1554
|
-
class
|
|
1798
|
+
class H extends Error {
|
|
1555
1799
|
constructor(e) {
|
|
1556
1800
|
super(e), Object.setPrototypeOf(this, new.target.prototype);
|
|
1557
1801
|
}
|
|
1558
1802
|
}
|
|
1559
|
-
class
|
|
1803
|
+
class D extends Error {
|
|
1560
1804
|
constructor(e, t) {
|
|
1561
1805
|
super(t), this.status = e, Object.setPrototypeOf(this, new.target.prototype);
|
|
1562
1806
|
}
|
|
1563
1807
|
}
|
|
1564
|
-
const
|
|
1565
|
-
const
|
|
1566
|
-
|
|
1567
|
-
for (var
|
|
1568
|
-
|
|
1808
|
+
const Pt = function(n, e, t, r, s) {
|
|
1809
|
+
const c = C.createXHR();
|
|
1810
|
+
c.open("POST", t.endpoint, !0), c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
1811
|
+
for (var l in t.headers)
|
|
1812
|
+
c.setRequestHeader(l, t.headers[l]);
|
|
1569
1813
|
if (t.headersProvider != null) {
|
|
1570
|
-
let
|
|
1571
|
-
for (var
|
|
1572
|
-
|
|
1573
|
-
}
|
|
1574
|
-
return
|
|
1575
|
-
if (
|
|
1576
|
-
if (
|
|
1577
|
-
let
|
|
1814
|
+
let f = t.headersProvider();
|
|
1815
|
+
for (var l in f)
|
|
1816
|
+
c.setRequestHeader(l, f[l]);
|
|
1817
|
+
}
|
|
1818
|
+
return c.onreadystatechange = function() {
|
|
1819
|
+
if (c.readyState === 4)
|
|
1820
|
+
if (c.status === 200) {
|
|
1821
|
+
let f, b = !1;
|
|
1578
1822
|
try {
|
|
1579
|
-
|
|
1823
|
+
f = JSON.parse(c.responseText), b = !0;
|
|
1580
1824
|
} catch {
|
|
1581
|
-
s(new
|
|
1825
|
+
s(new D(200, `JSON returned from ${r.toString()} endpoint was invalid, yet status code was 200. Data was: ${c.responseText}`), null);
|
|
1582
1826
|
}
|
|
1583
|
-
|
|
1827
|
+
b && s(null, f);
|
|
1584
1828
|
} else {
|
|
1585
|
-
let
|
|
1829
|
+
let f = "";
|
|
1586
1830
|
switch (r) {
|
|
1587
|
-
case
|
|
1588
|
-
|
|
1831
|
+
case d.UserAuthentication:
|
|
1832
|
+
f = _.buildLogSuffix("authenticationEndpoint");
|
|
1589
1833
|
break;
|
|
1590
|
-
case
|
|
1591
|
-
|
|
1834
|
+
case d.ChannelAuthorization:
|
|
1835
|
+
f = `Clients must be authorized to join private or presence channels. ${_.buildLogSuffix("authorizationEndpoint")}`;
|
|
1592
1836
|
break;
|
|
1593
1837
|
}
|
|
1594
|
-
s(new
|
|
1838
|
+
s(new D(c.status, `Unable to retrieve auth string from ${r.toString()} endpoint - received status: ${c.status} from ${t.endpoint}. ${f}`), null);
|
|
1595
1839
|
}
|
|
1596
|
-
},
|
|
1840
|
+
}, c.send(e), c;
|
|
1597
1841
|
};
|
|
1598
|
-
function
|
|
1599
|
-
return It(
|
|
1842
|
+
function Lt(n) {
|
|
1843
|
+
return qt(It(n));
|
|
1600
1844
|
}
|
|
1601
|
-
var
|
|
1845
|
+
var ne = String.fromCharCode, oe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Rt = function(n) {
|
|
1602
1846
|
var e = n.charCodeAt(0);
|
|
1603
|
-
return e < 128 ? n : e < 2048 ?
|
|
1604
|
-
},
|
|
1605
|
-
return n.replace(/[^\x00-\x7F]/g,
|
|
1606
|
-
},
|
|
1847
|
+
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);
|
|
1848
|
+
}, It = function(n) {
|
|
1849
|
+
return n.replace(/[^\x00-\x7F]/g, Rt);
|
|
1850
|
+
}, Ot = function(n) {
|
|
1607
1851
|
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 = [
|
|
1608
1852
|
oe.charAt(t >>> 18),
|
|
1609
1853
|
oe.charAt(t >>> 12 & 63),
|
|
@@ -1611,10 +1855,10 @@ function Vi() {
|
|
|
1611
1855
|
e >= 1 ? "=" : oe.charAt(t & 63)
|
|
1612
1856
|
];
|
|
1613
1857
|
return r.join("");
|
|
1614
|
-
},
|
|
1615
|
-
return n.replace(/[\s\S]{1,3}/g,
|
|
1858
|
+
}, qt = window.btoa || function(n) {
|
|
1859
|
+
return n.replace(/[\s\S]{1,3}/g, Ot);
|
|
1616
1860
|
};
|
|
1617
|
-
class
|
|
1861
|
+
class Ut {
|
|
1618
1862
|
constructor(e, t, r, s) {
|
|
1619
1863
|
this.clear = t, this.timer = e(() => {
|
|
1620
1864
|
this.timer && (this.timer = s(this.timer));
|
|
@@ -1627,28 +1871,28 @@ function Vi() {
|
|
|
1627
1871
|
this.timer && (this.clear(this.timer), this.timer = null);
|
|
1628
1872
|
}
|
|
1629
1873
|
}
|
|
1630
|
-
const Me =
|
|
1631
|
-
function
|
|
1874
|
+
const Me = Ut;
|
|
1875
|
+
function jt(n) {
|
|
1632
1876
|
window.clearTimeout(n);
|
|
1633
1877
|
}
|
|
1634
|
-
function
|
|
1878
|
+
function Nt(n) {
|
|
1635
1879
|
window.clearInterval(n);
|
|
1636
1880
|
}
|
|
1637
1881
|
class G extends Me {
|
|
1638
1882
|
constructor(e, t) {
|
|
1639
|
-
super(setTimeout,
|
|
1883
|
+
super(setTimeout, jt, e, function(r) {
|
|
1640
1884
|
return t(), null;
|
|
1641
1885
|
});
|
|
1642
1886
|
}
|
|
1643
1887
|
}
|
|
1644
|
-
class
|
|
1888
|
+
class zt extends Me {
|
|
1645
1889
|
constructor(e, t) {
|
|
1646
|
-
super(setInterval,
|
|
1890
|
+
super(setInterval, Nt, e, function(r) {
|
|
1647
1891
|
return t(), r;
|
|
1648
1892
|
});
|
|
1649
1893
|
}
|
|
1650
1894
|
}
|
|
1651
|
-
var
|
|
1895
|
+
var Mt = {
|
|
1652
1896
|
now() {
|
|
1653
1897
|
return Date.now ? Date.now() : (/* @__PURE__ */ new Date()).valueOf();
|
|
1654
1898
|
},
|
|
@@ -1662,21 +1906,21 @@ function Vi() {
|
|
|
1662
1906
|
};
|
|
1663
1907
|
}
|
|
1664
1908
|
};
|
|
1665
|
-
const U =
|
|
1666
|
-
function
|
|
1909
|
+
const U = Mt;
|
|
1910
|
+
function z(n, ...e) {
|
|
1667
1911
|
for (var t = 0; t < e.length; t++) {
|
|
1668
1912
|
var r = e[t];
|
|
1669
1913
|
for (var s in r)
|
|
1670
|
-
r[s] && r[s].constructor && r[s].constructor === Object ? n[s] =
|
|
1914
|
+
r[s] && r[s].constructor && r[s].constructor === Object ? n[s] = z(n[s] || {}, r[s]) : n[s] = r[s];
|
|
1671
1915
|
}
|
|
1672
1916
|
return n;
|
|
1673
1917
|
}
|
|
1674
|
-
function
|
|
1918
|
+
function Dt() {
|
|
1675
1919
|
for (var n = ["Pusher"], e = 0; e < arguments.length; e++)
|
|
1676
1920
|
typeof arguments[e] == "string" ? n.push(arguments[e]) : n.push(ae(arguments[e]));
|
|
1677
1921
|
return n.join(" : ");
|
|
1678
1922
|
}
|
|
1679
|
-
function
|
|
1923
|
+
function De(n, e) {
|
|
1680
1924
|
var t = Array.prototype.indexOf;
|
|
1681
1925
|
if (n === null)
|
|
1682
1926
|
return -1;
|
|
@@ -1697,28 +1941,28 @@ function Vi() {
|
|
|
1697
1941
|
e.push(r);
|
|
1698
1942
|
}), e;
|
|
1699
1943
|
}
|
|
1700
|
-
function
|
|
1944
|
+
function Ht(n) {
|
|
1701
1945
|
var e = [];
|
|
1702
1946
|
return B(n, function(t) {
|
|
1703
1947
|
e.push(t);
|
|
1704
1948
|
}), e;
|
|
1705
1949
|
}
|
|
1706
|
-
function
|
|
1950
|
+
function ie(n, e, t) {
|
|
1707
1951
|
for (var r = 0; r < n.length; r++)
|
|
1708
1952
|
e.call(t || window, n[r], r, n);
|
|
1709
1953
|
}
|
|
1710
|
-
function
|
|
1954
|
+
function We(n, e) {
|
|
1711
1955
|
for (var t = [], r = 0; r < n.length; r++)
|
|
1712
1956
|
t.push(e(n[r], r, n, t));
|
|
1713
1957
|
return t;
|
|
1714
1958
|
}
|
|
1715
|
-
function
|
|
1959
|
+
function Wt(n, e) {
|
|
1716
1960
|
var t = {};
|
|
1717
1961
|
return B(n, function(r, s) {
|
|
1718
1962
|
t[s] = e(r);
|
|
1719
1963
|
}), t;
|
|
1720
1964
|
}
|
|
1721
|
-
function
|
|
1965
|
+
function Fe(n, e) {
|
|
1722
1966
|
e = e || function(s) {
|
|
1723
1967
|
return !!s;
|
|
1724
1968
|
};
|
|
@@ -1726,61 +1970,61 @@ function Vi() {
|
|
|
1726
1970
|
e(n[r], r, n, t) && t.push(n[r]);
|
|
1727
1971
|
return t;
|
|
1728
1972
|
}
|
|
1729
|
-
function
|
|
1973
|
+
function Be(n, e) {
|
|
1730
1974
|
var t = {};
|
|
1731
1975
|
return B(n, function(r, s) {
|
|
1732
1976
|
(e && e(r, s, n, t) || r) && (t[s] = r);
|
|
1733
1977
|
}), t;
|
|
1734
1978
|
}
|
|
1735
|
-
function
|
|
1979
|
+
function Ft(n) {
|
|
1736
1980
|
var e = [];
|
|
1737
1981
|
return B(n, function(t, r) {
|
|
1738
1982
|
e.push([r, t]);
|
|
1739
1983
|
}), e;
|
|
1740
1984
|
}
|
|
1741
|
-
function
|
|
1985
|
+
function $e(n, e) {
|
|
1742
1986
|
for (var t = 0; t < n.length; t++)
|
|
1743
1987
|
if (e(n[t], t, n))
|
|
1744
1988
|
return !0;
|
|
1745
1989
|
return !1;
|
|
1746
1990
|
}
|
|
1747
|
-
function
|
|
1991
|
+
function Bt(n, e) {
|
|
1748
1992
|
for (var t = 0; t < n.length; t++)
|
|
1749
1993
|
if (!e(n[t], t, n))
|
|
1750
1994
|
return !1;
|
|
1751
1995
|
return !0;
|
|
1752
1996
|
}
|
|
1753
|
-
function
|
|
1754
|
-
return
|
|
1755
|
-
return typeof e == "object" && (e = ae(e)), encodeURIComponent(
|
|
1997
|
+
function $t(n) {
|
|
1998
|
+
return Wt(n, function(e) {
|
|
1999
|
+
return typeof e == "object" && (e = ae(e)), encodeURIComponent(Lt(e.toString()));
|
|
1756
2000
|
});
|
|
1757
2001
|
}
|
|
1758
|
-
function
|
|
1759
|
-
var e =
|
|
2002
|
+
function Xt(n) {
|
|
2003
|
+
var e = Be(n, function(r) {
|
|
1760
2004
|
return r !== void 0;
|
|
1761
|
-
}), t =
|
|
2005
|
+
}), t = We(Ft($t(e)), U.method("join", "=")).join("&");
|
|
1762
2006
|
return t;
|
|
1763
2007
|
}
|
|
1764
|
-
function
|
|
2008
|
+
function Jt(n) {
|
|
1765
2009
|
var e = [], t = [];
|
|
1766
|
-
return (function r(s,
|
|
1767
|
-
var
|
|
2010
|
+
return (function r(s, c) {
|
|
2011
|
+
var l, f, b;
|
|
1768
2012
|
switch (typeof s) {
|
|
1769
2013
|
case "object":
|
|
1770
2014
|
if (!s)
|
|
1771
2015
|
return null;
|
|
1772
|
-
for (
|
|
1773
|
-
if (e[
|
|
1774
|
-
return { $ref: t[
|
|
1775
|
-
if (e.push(s), t.push(
|
|
1776
|
-
for (
|
|
1777
|
-
|
|
2016
|
+
for (l = 0; l < e.length; l += 1)
|
|
2017
|
+
if (e[l] === s)
|
|
2018
|
+
return { $ref: t[l] };
|
|
2019
|
+
if (e.push(s), t.push(c), Object.prototype.toString.apply(s) === "[object Array]")
|
|
2020
|
+
for (b = [], l = 0; l < s.length; l += 1)
|
|
2021
|
+
b[l] = r(s[l], c + "[" + l + "]");
|
|
1778
2022
|
else {
|
|
1779
|
-
|
|
1780
|
-
for (
|
|
1781
|
-
Object.prototype.hasOwnProperty.call(s,
|
|
2023
|
+
b = {};
|
|
2024
|
+
for (f in s)
|
|
2025
|
+
Object.prototype.hasOwnProperty.call(s, f) && (b[f] = r(s[f], c + "[" + JSON.stringify(f) + "]"));
|
|
1782
2026
|
}
|
|
1783
|
-
return
|
|
2027
|
+
return b;
|
|
1784
2028
|
case "number":
|
|
1785
2029
|
case "string":
|
|
1786
2030
|
case "boolean":
|
|
@@ -1792,10 +2036,10 @@ function Vi() {
|
|
|
1792
2036
|
try {
|
|
1793
2037
|
return JSON.stringify(n);
|
|
1794
2038
|
} catch {
|
|
1795
|
-
return JSON.stringify(
|
|
2039
|
+
return JSON.stringify(Jt(n));
|
|
1796
2040
|
}
|
|
1797
2041
|
}
|
|
1798
|
-
class
|
|
2042
|
+
class Vt {
|
|
1799
2043
|
constructor() {
|
|
1800
2044
|
this.globalLog = (e) => {
|
|
1801
2045
|
window.console && window.console.log && window.console.log(e);
|
|
@@ -1817,26 +2061,26 @@ function Vi() {
|
|
|
1817
2061
|
window.console && window.console.error ? window.console.error(e) : this.globalLogWarn(e);
|
|
1818
2062
|
}
|
|
1819
2063
|
log(e, ...t) {
|
|
1820
|
-
var r =
|
|
1821
|
-
|
|
2064
|
+
var r = Dt.apply(this, arguments);
|
|
2065
|
+
ue.log ? ue.log(r) : ue.logToConsole && e.bind(this)(r);
|
|
1822
2066
|
}
|
|
1823
2067
|
}
|
|
1824
|
-
const
|
|
1825
|
-
var
|
|
1826
|
-
(t.headers !== void 0 || t.headersProvider != null) &&
|
|
1827
|
-
var
|
|
2068
|
+
const L = new Vt();
|
|
2069
|
+
var Gt = function(n, e, t, r, s) {
|
|
2070
|
+
(t.headers !== void 0 || t.headersProvider != null) && L.warn(`To send headers with the ${r.toString()} request, you must use AJAX, rather than JSONP.`);
|
|
2071
|
+
var c = n.nextAuthCallbackID.toString();
|
|
1828
2072
|
n.nextAuthCallbackID++;
|
|
1829
|
-
var
|
|
1830
|
-
n.auth_callbacks[
|
|
1831
|
-
s(null,
|
|
2073
|
+
var l = n.getDocument(), f = l.createElement("script");
|
|
2074
|
+
n.auth_callbacks[c] = function(E) {
|
|
2075
|
+
s(null, E);
|
|
1832
2076
|
};
|
|
1833
|
-
var
|
|
1834
|
-
|
|
1835
|
-
var
|
|
1836
|
-
|
|
2077
|
+
var b = "Pusher.auth_callbacks['" + c + "']";
|
|
2078
|
+
f.src = t.endpoint + "?callback=" + encodeURIComponent(b) + "&" + e;
|
|
2079
|
+
var k = l.getElementsByTagName("head")[0] || l.documentElement;
|
|
2080
|
+
k.insertBefore(f, k.firstChild);
|
|
1837
2081
|
};
|
|
1838
|
-
const
|
|
1839
|
-
class
|
|
2082
|
+
const Yt = Gt;
|
|
2083
|
+
class Qt {
|
|
1840
2084
|
constructor(e) {
|
|
1841
2085
|
this.src = e;
|
|
1842
2086
|
}
|
|
@@ -1862,61 +2106,61 @@ function Vi() {
|
|
|
1862
2106
|
}
|
|
1863
2107
|
send(e) {
|
|
1864
2108
|
if (!this.request) {
|
|
1865
|
-
var t =
|
|
1866
|
-
this.request =
|
|
2109
|
+
var t = Xt(this.data), r = this.url + "/" + e.number + "?" + t;
|
|
2110
|
+
this.request = C.createScriptRequest(r), this.request.send(e);
|
|
1867
2111
|
}
|
|
1868
2112
|
}
|
|
1869
2113
|
cleanup() {
|
|
1870
2114
|
this.request && this.request.cleanup();
|
|
1871
2115
|
}
|
|
1872
2116
|
}
|
|
1873
|
-
var
|
|
2117
|
+
var Zt = function(n, e) {
|
|
1874
2118
|
return function(t, r) {
|
|
1875
|
-
var s = "http" + (e ? "s" : "") + "://",
|
|
1876
|
-
|
|
2119
|
+
var s = "http" + (e ? "s" : "") + "://", c = s + (n.host || n.options.host) + n.options.path, l = C.createJSONPRequest(c, t), f = C.ScriptReceivers.create(function(b, k) {
|
|
2120
|
+
w.remove(f), l.cleanup(), k && k.host && (n.host = k.host), r && r(b, k);
|
|
1877
2121
|
});
|
|
1878
|
-
|
|
2122
|
+
l.send(f);
|
|
1879
2123
|
};
|
|
1880
|
-
},
|
|
2124
|
+
}, en = {
|
|
1881
2125
|
name: "jsonp",
|
|
1882
|
-
getAgent:
|
|
2126
|
+
getAgent: Zt
|
|
1883
2127
|
};
|
|
1884
|
-
const
|
|
1885
|
-
function
|
|
2128
|
+
const tn = en;
|
|
2129
|
+
function ge(n, e, t) {
|
|
1886
2130
|
var r = n + (e.useTLS ? "s" : ""), s = e.useTLS ? e.hostTLS : e.hostNonTLS;
|
|
1887
2131
|
return r + "://" + s + t;
|
|
1888
2132
|
}
|
|
1889
2133
|
function ve(n, e) {
|
|
1890
|
-
var t = "/app/" + n, r = "?protocol=" +
|
|
2134
|
+
var t = "/app/" + n, r = "?protocol=" + T.PROTOCOL + "&client=js&version=" + T.VERSION + (e ? "&" + e : "");
|
|
1891
2135
|
return t + r;
|
|
1892
2136
|
}
|
|
1893
|
-
var
|
|
2137
|
+
var nn = {
|
|
1894
2138
|
getInitial: function(n, e) {
|
|
1895
2139
|
var t = (e.httpPath || "") + ve(n, "flash=false");
|
|
1896
|
-
return
|
|
2140
|
+
return ge("ws", e, t);
|
|
1897
2141
|
}
|
|
1898
|
-
},
|
|
2142
|
+
}, rn = {
|
|
1899
2143
|
getInitial: function(n, e) {
|
|
1900
2144
|
var t = (e.httpPath || "/pusher") + ve(n);
|
|
1901
|
-
return
|
|
2145
|
+
return ge("http", e, t);
|
|
1902
2146
|
}
|
|
1903
|
-
},
|
|
2147
|
+
}, sn = {
|
|
1904
2148
|
getInitial: function(n, e) {
|
|
1905
|
-
return
|
|
2149
|
+
return ge("http", e, e.httpPath || "/pusher");
|
|
1906
2150
|
},
|
|
1907
2151
|
getPath: function(n, e) {
|
|
1908
2152
|
return ve(n);
|
|
1909
2153
|
}
|
|
1910
2154
|
};
|
|
1911
|
-
class
|
|
2155
|
+
class on {
|
|
1912
2156
|
constructor() {
|
|
1913
2157
|
this._callbacks = {};
|
|
1914
2158
|
}
|
|
1915
2159
|
get(e) {
|
|
1916
|
-
return this._callbacks[
|
|
2160
|
+
return this._callbacks[ye(e)];
|
|
1917
2161
|
}
|
|
1918
2162
|
add(e, t, r) {
|
|
1919
|
-
var s =
|
|
2163
|
+
var s = ye(e);
|
|
1920
2164
|
this._callbacks[s] = this._callbacks[s] || [], this._callbacks[s].push({
|
|
1921
2165
|
fn: t,
|
|
1922
2166
|
context: r
|
|
@@ -1927,28 +2171,28 @@ function Vi() {
|
|
|
1927
2171
|
this._callbacks = {};
|
|
1928
2172
|
return;
|
|
1929
2173
|
}
|
|
1930
|
-
var s = e ? [
|
|
2174
|
+
var s = e ? [ye(e)] : He(this._callbacks);
|
|
1931
2175
|
t || r ? this.removeCallback(s, t, r) : this.removeAllCallbacks(s);
|
|
1932
2176
|
}
|
|
1933
2177
|
removeCallback(e, t, r) {
|
|
1934
|
-
|
|
1935
|
-
this._callbacks[s] =
|
|
1936
|
-
return t && t !==
|
|
2178
|
+
ie(e, function(s) {
|
|
2179
|
+
this._callbacks[s] = Fe(this._callbacks[s] || [], function(c) {
|
|
2180
|
+
return t && t !== c.fn || r && r !== c.context;
|
|
1937
2181
|
}), this._callbacks[s].length === 0 && delete this._callbacks[s];
|
|
1938
2182
|
}, this);
|
|
1939
2183
|
}
|
|
1940
2184
|
removeAllCallbacks(e) {
|
|
1941
|
-
|
|
2185
|
+
ie(e, function(t) {
|
|
1942
2186
|
delete this._callbacks[t];
|
|
1943
2187
|
}, this);
|
|
1944
2188
|
}
|
|
1945
2189
|
}
|
|
1946
|
-
function
|
|
2190
|
+
function ye(n) {
|
|
1947
2191
|
return "_" + n;
|
|
1948
2192
|
}
|
|
1949
2193
|
class $ {
|
|
1950
2194
|
constructor(e) {
|
|
1951
|
-
this.callbacks = new
|
|
2195
|
+
this.callbacks = new on(), this.global_callbacks = [], this.failThrough = e;
|
|
1952
2196
|
}
|
|
1953
2197
|
bind(e, t, r) {
|
|
1954
2198
|
return this.callbacks.add(e, t, r), this;
|
|
@@ -1960,7 +2204,7 @@ function Vi() {
|
|
|
1960
2204
|
return this.callbacks.remove(e, t, r), this;
|
|
1961
2205
|
}
|
|
1962
2206
|
unbind_global(e) {
|
|
1963
|
-
return e ? (this.global_callbacks =
|
|
2207
|
+
return e ? (this.global_callbacks = Fe(this.global_callbacks || [], (t) => t !== e), this) : (this.global_callbacks = [], this);
|
|
1964
2208
|
}
|
|
1965
2209
|
unbind_all() {
|
|
1966
2210
|
return this.unbind(), this.unbind_global(), this;
|
|
@@ -1968,17 +2212,17 @@ function Vi() {
|
|
|
1968
2212
|
emit(e, t, r) {
|
|
1969
2213
|
for (var s = 0; s < this.global_callbacks.length; s++)
|
|
1970
2214
|
this.global_callbacks[s](e, t);
|
|
1971
|
-
var
|
|
1972
|
-
if (r ?
|
|
1973
|
-
for (var s = 0; s <
|
|
1974
|
-
|
|
2215
|
+
var c = this.callbacks.get(e), l = [];
|
|
2216
|
+
if (r ? l.push(t, r) : t && l.push(t), c && c.length > 0)
|
|
2217
|
+
for (var s = 0; s < c.length; s++)
|
|
2218
|
+
c[s].fn.apply(c[s].context || window, l);
|
|
1975
2219
|
else this.failThrough && this.failThrough(e, t);
|
|
1976
2220
|
return this;
|
|
1977
2221
|
}
|
|
1978
2222
|
}
|
|
1979
|
-
class
|
|
1980
|
-
constructor(e, t, r, s,
|
|
1981
|
-
super(), this.initialize =
|
|
2223
|
+
class an extends $ {
|
|
2224
|
+
constructor(e, t, r, s, c) {
|
|
2225
|
+
super(), this.initialize = C.transportConnectionInitializer, this.hooks = e, this.name = t, this.priority = r, this.key = s, this.options = c, this.state = "new", this.timeline = c.timeline, this.activityTimeout = c.activityTimeout, this.id = this.timeline.generateUniqueID();
|
|
1982
2226
|
}
|
|
1983
2227
|
handlesActivityChecks() {
|
|
1984
2228
|
return !!this.hooks.handlesActivityChecks;
|
|
@@ -1997,7 +2241,7 @@ function Vi() {
|
|
|
1997
2241
|
this.onError(t), this.changeState("closed");
|
|
1998
2242
|
}), !1;
|
|
1999
2243
|
}
|
|
2000
|
-
return this.bindListeners(),
|
|
2244
|
+
return this.bindListeners(), L.debug("Connecting", { transport: this.name, url: e }), this.changeState("connecting"), !0;
|
|
2001
2245
|
}
|
|
2002
2246
|
close() {
|
|
2003
2247
|
return this.socket ? (this.socket.close(), !0) : !1;
|
|
@@ -2052,10 +2296,10 @@ function Vi() {
|
|
|
2052
2296
|
})), this.emit(e, t);
|
|
2053
2297
|
}
|
|
2054
2298
|
buildTimelineMessage(e) {
|
|
2055
|
-
return
|
|
2299
|
+
return z({ cid: this.id }, e);
|
|
2056
2300
|
}
|
|
2057
2301
|
}
|
|
2058
|
-
class
|
|
2302
|
+
class ee {
|
|
2059
2303
|
constructor(e) {
|
|
2060
2304
|
this.hooks = e;
|
|
2061
2305
|
}
|
|
@@ -2063,50 +2307,50 @@ function Vi() {
|
|
|
2063
2307
|
return this.hooks.isSupported(e);
|
|
2064
2308
|
}
|
|
2065
2309
|
createConnection(e, t, r, s) {
|
|
2066
|
-
return new
|
|
2310
|
+
return new an(this.hooks, e, t, r, s);
|
|
2067
2311
|
}
|
|
2068
2312
|
}
|
|
2069
|
-
var
|
|
2070
|
-
urls:
|
|
2313
|
+
var cn = new ee({
|
|
2314
|
+
urls: nn,
|
|
2071
2315
|
handlesActivityChecks: !1,
|
|
2072
2316
|
supportsPing: !1,
|
|
2073
2317
|
isInitialized: function() {
|
|
2074
|
-
return !!
|
|
2318
|
+
return !!C.getWebSocketAPI();
|
|
2075
2319
|
},
|
|
2076
2320
|
isSupported: function() {
|
|
2077
|
-
return !!
|
|
2321
|
+
return !!C.getWebSocketAPI();
|
|
2078
2322
|
},
|
|
2079
2323
|
getSocket: function(n) {
|
|
2080
|
-
return
|
|
2324
|
+
return C.createWebSocket(n);
|
|
2081
2325
|
}
|
|
2082
|
-
}),
|
|
2083
|
-
urls:
|
|
2326
|
+
}), Xe = {
|
|
2327
|
+
urls: rn,
|
|
2084
2328
|
handlesActivityChecks: !1,
|
|
2085
2329
|
supportsPing: !0,
|
|
2086
2330
|
isInitialized: function() {
|
|
2087
2331
|
return !0;
|
|
2088
2332
|
}
|
|
2089
|
-
},
|
|
2333
|
+
}, Je = z({
|
|
2090
2334
|
getSocket: function(n) {
|
|
2091
|
-
return
|
|
2335
|
+
return C.HTTPFactory.createStreamingSocket(n);
|
|
2092
2336
|
}
|
|
2093
|
-
},
|
|
2337
|
+
}, Xe), Ve = z({
|
|
2094
2338
|
getSocket: function(n) {
|
|
2095
|
-
return
|
|
2339
|
+
return C.HTTPFactory.createPollingSocket(n);
|
|
2096
2340
|
}
|
|
2097
|
-
},
|
|
2341
|
+
}, Xe), Ge = {
|
|
2098
2342
|
isSupported: function() {
|
|
2099
|
-
return
|
|
2343
|
+
return C.isXHRSupported();
|
|
2100
2344
|
}
|
|
2101
|
-
},
|
|
2102
|
-
ws:
|
|
2103
|
-
xhr_streaming:
|
|
2104
|
-
xhr_polling:
|
|
2345
|
+
}, hn = new ee(z({}, Je, Ge)), ln = new ee(z({}, Ve, Ge)), un = {
|
|
2346
|
+
ws: cn,
|
|
2347
|
+
xhr_streaming: hn,
|
|
2348
|
+
xhr_polling: ln
|
|
2105
2349
|
};
|
|
2106
|
-
const ce =
|
|
2107
|
-
var
|
|
2350
|
+
const ce = un;
|
|
2351
|
+
var dn = new ee({
|
|
2108
2352
|
file: "sockjs",
|
|
2109
|
-
urls:
|
|
2353
|
+
urls: sn,
|
|
2110
2354
|
handlesActivityChecks: !0,
|
|
2111
2355
|
supportsPing: !1,
|
|
2112
2356
|
isSupported: function() {
|
|
@@ -2128,15 +2372,15 @@ function Vi() {
|
|
|
2128
2372
|
path: e
|
|
2129
2373
|
}));
|
|
2130
2374
|
}
|
|
2131
|
-
}),
|
|
2375
|
+
}), Ye = {
|
|
2132
2376
|
isSupported: function(n) {
|
|
2133
|
-
var e =
|
|
2377
|
+
var e = C.isXDRSupported(n.useTLS);
|
|
2134
2378
|
return e;
|
|
2135
2379
|
}
|
|
2136
|
-
},
|
|
2137
|
-
ce.xdr_streaming =
|
|
2138
|
-
const
|
|
2139
|
-
class
|
|
2380
|
+
}, pn = new ee(z({}, Je, Ye)), fn = new ee(z({}, Ve, Ye));
|
|
2381
|
+
ce.xdr_streaming = pn, ce.xdr_polling = fn, ce.sockjs = dn;
|
|
2382
|
+
const mn = ce;
|
|
2383
|
+
class gn extends $ {
|
|
2140
2384
|
constructor() {
|
|
2141
2385
|
super();
|
|
2142
2386
|
var e = this;
|
|
@@ -2150,32 +2394,32 @@ function Vi() {
|
|
|
2150
2394
|
return window.navigator.onLine === void 0 ? !0 : window.navigator.onLine;
|
|
2151
2395
|
}
|
|
2152
2396
|
}
|
|
2153
|
-
var
|
|
2154
|
-
class
|
|
2397
|
+
var vn = new gn();
|
|
2398
|
+
class yn {
|
|
2155
2399
|
constructor(e, t, r) {
|
|
2156
2400
|
this.manager = e, this.transport = t, this.minPingDelay = r.minPingDelay, this.maxPingDelay = r.maxPingDelay, this.pingDelay = void 0;
|
|
2157
2401
|
}
|
|
2158
2402
|
createConnection(e, t, r, s) {
|
|
2159
|
-
s =
|
|
2403
|
+
s = z({}, s, {
|
|
2160
2404
|
activityTimeout: this.pingDelay
|
|
2161
2405
|
});
|
|
2162
|
-
var
|
|
2163
|
-
|
|
2164
|
-
},
|
|
2165
|
-
if (
|
|
2406
|
+
var c = this.transport.createConnection(e, t, r, s), l = null, f = function() {
|
|
2407
|
+
c.unbind("open", f), c.bind("closed", b), l = U.now();
|
|
2408
|
+
}, b = (k) => {
|
|
2409
|
+
if (c.unbind("closed", b), k.code === 1002 || k.code === 1003)
|
|
2166
2410
|
this.manager.reportDeath();
|
|
2167
|
-
else if (!
|
|
2168
|
-
var
|
|
2169
|
-
|
|
2411
|
+
else if (!k.wasClean && l) {
|
|
2412
|
+
var E = U.now() - l;
|
|
2413
|
+
E < 2 * this.maxPingDelay && (this.manager.reportDeath(), this.pingDelay = Math.max(E / 2, this.minPingDelay));
|
|
2170
2414
|
}
|
|
2171
2415
|
};
|
|
2172
|
-
return
|
|
2416
|
+
return c.bind("open", f), c;
|
|
2173
2417
|
}
|
|
2174
2418
|
isSupported(e) {
|
|
2175
2419
|
return this.manager.isAlive() && this.transport.isSupported(e);
|
|
2176
2420
|
}
|
|
2177
2421
|
}
|
|
2178
|
-
const
|
|
2422
|
+
const Qe = {
|
|
2179
2423
|
decodeMessage: function(n) {
|
|
2180
2424
|
try {
|
|
2181
2425
|
var e = JSON.parse(n.data), t = e.data;
|
|
@@ -2198,7 +2442,7 @@ function Vi() {
|
|
|
2198
2442
|
return JSON.stringify(n);
|
|
2199
2443
|
},
|
|
2200
2444
|
processHandshake: function(n) {
|
|
2201
|
-
var e =
|
|
2445
|
+
var e = Qe.decodeMessage(n);
|
|
2202
2446
|
if (e.event === "pusher:connection_established") {
|
|
2203
2447
|
if (!e.data.activity_timeout)
|
|
2204
2448
|
throw "No activity timeout specified in handshake";
|
|
@@ -2228,8 +2472,8 @@ function Vi() {
|
|
|
2228
2472
|
}
|
|
2229
2473
|
} : null;
|
|
2230
2474
|
}
|
|
2231
|
-
},
|
|
2232
|
-
class
|
|
2475
|
+
}, Y = Qe;
|
|
2476
|
+
class bn extends $ {
|
|
2233
2477
|
constructor(e, t) {
|
|
2234
2478
|
super(), this.id = e, this.transport = t, this.activityTimeout = t.activityTimeout, this.bindListeners();
|
|
2235
2479
|
}
|
|
@@ -2241,7 +2485,7 @@ function Vi() {
|
|
|
2241
2485
|
}
|
|
2242
2486
|
send_event(e, t, r) {
|
|
2243
2487
|
var s = { event: e, data: t };
|
|
2244
|
-
return r && (s.channel = r),
|
|
2488
|
+
return r && (s.channel = r), L.debug("Event sent", s), this.send(Y.encodeMessage(s));
|
|
2245
2489
|
}
|
|
2246
2490
|
ping() {
|
|
2247
2491
|
this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
|
|
@@ -2254,16 +2498,16 @@ function Vi() {
|
|
|
2254
2498
|
message: (r) => {
|
|
2255
2499
|
var s;
|
|
2256
2500
|
try {
|
|
2257
|
-
s =
|
|
2258
|
-
} catch (
|
|
2501
|
+
s = Y.decodeMessage(r);
|
|
2502
|
+
} catch (c) {
|
|
2259
2503
|
this.emit("error", {
|
|
2260
2504
|
type: "MessageParseError",
|
|
2261
|
-
error:
|
|
2505
|
+
error: c,
|
|
2262
2506
|
data: r.data
|
|
2263
2507
|
});
|
|
2264
2508
|
}
|
|
2265
2509
|
if (s !== void 0) {
|
|
2266
|
-
switch (
|
|
2510
|
+
switch (L.debug("Event recd", s), s.event) {
|
|
2267
2511
|
case "pusher:error":
|
|
2268
2512
|
this.emit("error", {
|
|
2269
2513
|
type: "PusherError",
|
|
@@ -2299,11 +2543,11 @@ function Vi() {
|
|
|
2299
2543
|
});
|
|
2300
2544
|
}
|
|
2301
2545
|
handleCloseEvent(e) {
|
|
2302
|
-
var t =
|
|
2546
|
+
var t = Y.getCloseAction(e), r = Y.getCloseError(e);
|
|
2303
2547
|
r && this.emit("error", r), t && this.emit(t, { action: t, error: r });
|
|
2304
2548
|
}
|
|
2305
2549
|
}
|
|
2306
|
-
class
|
|
2550
|
+
class wn {
|
|
2307
2551
|
constructor(e, t) {
|
|
2308
2552
|
this.transport = e, this.callback = t, this.bindListeners();
|
|
2309
2553
|
}
|
|
@@ -2315,18 +2559,18 @@ function Vi() {
|
|
|
2315
2559
|
this.unbindListeners();
|
|
2316
2560
|
var t;
|
|
2317
2561
|
try {
|
|
2318
|
-
t =
|
|
2562
|
+
t = Y.processHandshake(e);
|
|
2319
2563
|
} catch (r) {
|
|
2320
2564
|
this.finish("error", { error: r }), this.transport.close();
|
|
2321
2565
|
return;
|
|
2322
2566
|
}
|
|
2323
2567
|
t.action === "connected" ? this.finish("connected", {
|
|
2324
|
-
connection: new
|
|
2568
|
+
connection: new bn(t.id, this.transport),
|
|
2325
2569
|
activityTimeout: t.activityTimeout
|
|
2326
2570
|
}) : (this.finish(t.action, { error: t.error }), this.transport.close());
|
|
2327
2571
|
}, this.onClosed = (e) => {
|
|
2328
2572
|
this.unbindListeners();
|
|
2329
|
-
var t =
|
|
2573
|
+
var t = Y.getCloseAction(e) || "backoff", r = Y.getCloseError(e);
|
|
2330
2574
|
this.finish(t, { error: r });
|
|
2331
2575
|
}, this.transport.bind("message", this.onMessage), this.transport.bind("closed", this.onClosed);
|
|
2332
2576
|
}
|
|
@@ -2334,21 +2578,21 @@ function Vi() {
|
|
|
2334
2578
|
this.transport.unbind("message", this.onMessage), this.transport.unbind("closed", this.onClosed);
|
|
2335
2579
|
}
|
|
2336
2580
|
finish(e, t) {
|
|
2337
|
-
this.callback(
|
|
2581
|
+
this.callback(z({ transport: this.transport, action: e }, t));
|
|
2338
2582
|
}
|
|
2339
2583
|
}
|
|
2340
|
-
class
|
|
2584
|
+
class Cn {
|
|
2341
2585
|
constructor(e, t) {
|
|
2342
2586
|
this.timeline = e, this.options = t || {};
|
|
2343
2587
|
}
|
|
2344
2588
|
send(e, t) {
|
|
2345
|
-
this.timeline.isEmpty() || this.timeline.send(
|
|
2589
|
+
this.timeline.isEmpty() || this.timeline.send(C.TimelineTransport.getAgent(this, e), t);
|
|
2346
2590
|
}
|
|
2347
2591
|
}
|
|
2348
|
-
class
|
|
2592
|
+
class be extends $ {
|
|
2349
2593
|
constructor(e, t) {
|
|
2350
2594
|
super(function(r, s) {
|
|
2351
|
-
|
|
2595
|
+
L.debug("No callbacks on " + e + " for " + r);
|
|
2352
2596
|
}), this.name = e, this.pusher = t, this.subscribed = !1, this.subscriptionPending = !1, this.subscriptionCancelled = !1;
|
|
2353
2597
|
}
|
|
2354
2598
|
authorize(e, t) {
|
|
@@ -2356,10 +2600,10 @@ function Vi() {
|
|
|
2356
2600
|
}
|
|
2357
2601
|
trigger(e, t) {
|
|
2358
2602
|
if (e.indexOf("client-") !== 0)
|
|
2359
|
-
throw new
|
|
2603
|
+
throw new p("Event '" + e + "' does not start with 'client-'");
|
|
2360
2604
|
if (!this.subscribed) {
|
|
2361
|
-
var r =
|
|
2362
|
-
|
|
2605
|
+
var r = _.buildLogSuffix("triggeringClientEvents");
|
|
2606
|
+
L.warn(`Client event triggered before channel 'subscription_succeeded' event . ${r}`);
|
|
2363
2607
|
}
|
|
2364
2608
|
return this.pusher.send_event(e, t, this.name);
|
|
2365
2609
|
}
|
|
@@ -2385,10 +2629,10 @@ function Vi() {
|
|
|
2385
2629
|
}
|
|
2386
2630
|
subscribe() {
|
|
2387
2631
|
this.subscribed || (this.subscriptionPending = !0, this.subscriptionCancelled = !1, this.authorize(this.pusher.connection.socket_id, (e, t) => {
|
|
2388
|
-
e ? (this.subscriptionPending = !1,
|
|
2632
|
+
e ? (this.subscriptionPending = !1, L.error(e.toString()), this.emit("pusher:subscription_error", Object.assign({}, {
|
|
2389
2633
|
type: "AuthError",
|
|
2390
2634
|
error: e.message
|
|
2391
|
-
}, e instanceof
|
|
2635
|
+
}, e instanceof D ? { status: e.status } : {}))) : this.pusher.send_event("pusher:subscribe", {
|
|
2392
2636
|
auth: t.auth,
|
|
2393
2637
|
channel_data: t.channel_data,
|
|
2394
2638
|
channel: this.name
|
|
@@ -2407,7 +2651,7 @@ function Vi() {
|
|
|
2407
2651
|
this.subscriptionCancelled = !1;
|
|
2408
2652
|
}
|
|
2409
2653
|
}
|
|
2410
|
-
class we extends
|
|
2654
|
+
class we extends be {
|
|
2411
2655
|
authorize(e, t) {
|
|
2412
2656
|
return this.pusher.config.channelAuthorizer({
|
|
2413
2657
|
channelName: this.name,
|
|
@@ -2415,7 +2659,7 @@ function Vi() {
|
|
|
2415
2659
|
}, t);
|
|
2416
2660
|
}
|
|
2417
2661
|
}
|
|
2418
|
-
class
|
|
2662
|
+
class Sn {
|
|
2419
2663
|
constructor() {
|
|
2420
2664
|
this.reset();
|
|
2421
2665
|
}
|
|
@@ -2447,48 +2691,48 @@ function Vi() {
|
|
|
2447
2691
|
this.members = {}, this.count = 0, this.myID = null, this.me = null;
|
|
2448
2692
|
}
|
|
2449
2693
|
}
|
|
2450
|
-
var
|
|
2451
|
-
function s(
|
|
2452
|
-
return
|
|
2453
|
-
|
|
2694
|
+
var Tn = function(n, e, t, r) {
|
|
2695
|
+
function s(c) {
|
|
2696
|
+
return c instanceof t ? c : new t(function(l) {
|
|
2697
|
+
l(c);
|
|
2454
2698
|
});
|
|
2455
2699
|
}
|
|
2456
|
-
return new (t || (t = Promise))(function(
|
|
2457
|
-
function
|
|
2700
|
+
return new (t || (t = Promise))(function(c, l) {
|
|
2701
|
+
function f(E) {
|
|
2458
2702
|
try {
|
|
2459
|
-
|
|
2703
|
+
k(r.next(E));
|
|
2460
2704
|
} catch (I) {
|
|
2461
|
-
|
|
2705
|
+
l(I);
|
|
2462
2706
|
}
|
|
2463
2707
|
}
|
|
2464
|
-
function
|
|
2708
|
+
function b(E) {
|
|
2465
2709
|
try {
|
|
2466
|
-
|
|
2710
|
+
k(r.throw(E));
|
|
2467
2711
|
} catch (I) {
|
|
2468
|
-
|
|
2712
|
+
l(I);
|
|
2469
2713
|
}
|
|
2470
2714
|
}
|
|
2471
|
-
function E
|
|
2472
|
-
|
|
2715
|
+
function k(E) {
|
|
2716
|
+
E.done ? c(E.value) : s(E.value).then(f, b);
|
|
2473
2717
|
}
|
|
2474
|
-
|
|
2718
|
+
k((r = r.apply(n, e || [])).next());
|
|
2475
2719
|
});
|
|
2476
2720
|
};
|
|
2477
|
-
class
|
|
2721
|
+
class _n extends we {
|
|
2478
2722
|
constructor(e, t) {
|
|
2479
|
-
super(e, t), this.members = new
|
|
2723
|
+
super(e, t), this.members = new Sn();
|
|
2480
2724
|
}
|
|
2481
2725
|
authorize(e, t) {
|
|
2482
|
-
super.authorize(e, (r, s) =>
|
|
2726
|
+
super.authorize(e, (r, s) => Tn(this, void 0, void 0, function* () {
|
|
2483
2727
|
if (!r)
|
|
2484
2728
|
if (s = s, s.channel_data != null) {
|
|
2485
|
-
var
|
|
2486
|
-
this.members.setMyID(
|
|
2729
|
+
var c = JSON.parse(s.channel_data);
|
|
2730
|
+
this.members.setMyID(c.user_id);
|
|
2487
2731
|
} else if (yield this.pusher.user.signinDonePromise, this.pusher.user.user_data != null)
|
|
2488
2732
|
this.members.setMyID(this.pusher.user.user_data.id);
|
|
2489
2733
|
else {
|
|
2490
|
-
let
|
|
2491
|
-
|
|
2734
|
+
let l = _.buildLogSuffix("authorizationEndpoint");
|
|
2735
|
+
L.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${l}, or the user should be signed in.`), t("Invalid auth response");
|
|
2492
2736
|
return;
|
|
2493
2737
|
}
|
|
2494
2738
|
t(r, s);
|
|
@@ -2517,8 +2761,8 @@ function Vi() {
|
|
|
2517
2761
|
this.emit("pusher:member_added", s);
|
|
2518
2762
|
break;
|
|
2519
2763
|
case "pusher_internal:member_removed":
|
|
2520
|
-
var
|
|
2521
|
-
|
|
2764
|
+
var c = this.members.removeMember(r);
|
|
2765
|
+
c && this.emit("pusher:member_removed", c);
|
|
2522
2766
|
break;
|
|
2523
2767
|
}
|
|
2524
2768
|
}
|
|
@@ -2529,8 +2773,8 @@ function Vi() {
|
|
|
2529
2773
|
this.members.reset(), super.disconnect();
|
|
2530
2774
|
}
|
|
2531
2775
|
}
|
|
2532
|
-
var
|
|
2533
|
-
class
|
|
2776
|
+
var xn = y(978), Ce = y(594);
|
|
2777
|
+
class kn extends we {
|
|
2534
2778
|
constructor(e, t, r) {
|
|
2535
2779
|
super(e, t), this.key = null, this.nacl = r;
|
|
2536
2780
|
}
|
|
@@ -2540,16 +2784,16 @@ function Vi() {
|
|
|
2540
2784
|
t(r, s);
|
|
2541
2785
|
return;
|
|
2542
2786
|
}
|
|
2543
|
-
let
|
|
2544
|
-
if (!
|
|
2787
|
+
let c = s.shared_secret;
|
|
2788
|
+
if (!c) {
|
|
2545
2789
|
t(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`), null);
|
|
2546
2790
|
return;
|
|
2547
2791
|
}
|
|
2548
|
-
this.key = (0, Ce.decode)(
|
|
2792
|
+
this.key = (0, Ce.decode)(c), delete s.shared_secret, t(null, s);
|
|
2549
2793
|
});
|
|
2550
2794
|
}
|
|
2551
2795
|
trigger(e, t) {
|
|
2552
|
-
throw new
|
|
2796
|
+
throw new M("Client events are not currently supported for encrypted channels");
|
|
2553
2797
|
}
|
|
2554
2798
|
handleEvent(e) {
|
|
2555
2799
|
var t = e.event, r = e.data;
|
|
@@ -2561,42 +2805,42 @@ function Vi() {
|
|
|
2561
2805
|
}
|
|
2562
2806
|
handleEncryptedEvent(e, t) {
|
|
2563
2807
|
if (!this.key) {
|
|
2564
|
-
|
|
2808
|
+
L.debug("Received encrypted event before key has been retrieved from the authEndpoint");
|
|
2565
2809
|
return;
|
|
2566
2810
|
}
|
|
2567
2811
|
if (!t.ciphertext || !t.nonce) {
|
|
2568
|
-
|
|
2812
|
+
L.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: " + t);
|
|
2569
2813
|
return;
|
|
2570
2814
|
}
|
|
2571
2815
|
let r = (0, Ce.decode)(t.ciphertext);
|
|
2572
2816
|
if (r.length < this.nacl.secretbox.overheadLength) {
|
|
2573
|
-
|
|
2817
|
+
L.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${r.length}`);
|
|
2574
2818
|
return;
|
|
2575
2819
|
}
|
|
2576
2820
|
let s = (0, Ce.decode)(t.nonce);
|
|
2577
2821
|
if (s.length < this.nacl.secretbox.nonceLength) {
|
|
2578
|
-
|
|
2822
|
+
L.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${s.length}`);
|
|
2579
2823
|
return;
|
|
2580
2824
|
}
|
|
2581
|
-
let
|
|
2582
|
-
if (
|
|
2583
|
-
|
|
2584
|
-
if (
|
|
2585
|
-
|
|
2825
|
+
let c = this.nacl.secretbox.open(r, s, this.key);
|
|
2826
|
+
if (c === null) {
|
|
2827
|
+
L.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, (l, f) => {
|
|
2828
|
+
if (l) {
|
|
2829
|
+
L.error(`Failed to make a request to the authEndpoint: ${f}. Unable to fetch new key, so dropping encrypted event`);
|
|
2586
2830
|
return;
|
|
2587
2831
|
}
|
|
2588
|
-
if (
|
|
2589
|
-
|
|
2832
|
+
if (c = this.nacl.secretbox.open(r, s, this.key), c === null) {
|
|
2833
|
+
L.error("Failed to decrypt event with new key. Dropping encrypted event");
|
|
2590
2834
|
return;
|
|
2591
2835
|
}
|
|
2592
|
-
this.emit(e, this.getDataToEmit(
|
|
2836
|
+
this.emit(e, this.getDataToEmit(c));
|
|
2593
2837
|
});
|
|
2594
2838
|
return;
|
|
2595
2839
|
}
|
|
2596
|
-
this.emit(e, this.getDataToEmit(
|
|
2840
|
+
this.emit(e, this.getDataToEmit(c));
|
|
2597
2841
|
}
|
|
2598
2842
|
getDataToEmit(e) {
|
|
2599
|
-
let t = (0,
|
|
2843
|
+
let t = (0, xn.D4)(e);
|
|
2600
2844
|
try {
|
|
2601
2845
|
return JSON.parse(t);
|
|
2602
2846
|
} catch {
|
|
@@ -2604,10 +2848,10 @@ function Vi() {
|
|
|
2604
2848
|
}
|
|
2605
2849
|
}
|
|
2606
2850
|
}
|
|
2607
|
-
class
|
|
2851
|
+
class En extends $ {
|
|
2608
2852
|
constructor(e, t) {
|
|
2609
2853
|
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);
|
|
2610
|
-
var r =
|
|
2854
|
+
var r = C.getNetwork();
|
|
2611
2855
|
r.bind("online", () => {
|
|
2612
2856
|
this.timeline.info({ netinfo: "online" }), (this.state === "connecting" || this.state === "unavailable") && this.retryIn(0);
|
|
2613
2857
|
}), r.bind("offline", () => {
|
|
@@ -2693,7 +2937,7 @@ function Vi() {
|
|
|
2693
2937
|
this.activityTimer && this.activityTimer.ensureAborted();
|
|
2694
2938
|
}
|
|
2695
2939
|
buildConnectionCallbacks(e) {
|
|
2696
|
-
return
|
|
2940
|
+
return z({}, e, {
|
|
2697
2941
|
message: (t) => {
|
|
2698
2942
|
this.resetActivityCheck(), this.emit("message", t);
|
|
2699
2943
|
},
|
|
@@ -2712,7 +2956,7 @@ function Vi() {
|
|
|
2712
2956
|
});
|
|
2713
2957
|
}
|
|
2714
2958
|
buildHandshakeCallbacks(e) {
|
|
2715
|
-
return
|
|
2959
|
+
return z({}, e, {
|
|
2716
2960
|
connected: (t) => {
|
|
2717
2961
|
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 });
|
|
2718
2962
|
}
|
|
@@ -2756,22 +3000,22 @@ function Vi() {
|
|
|
2756
3000
|
var r = this.state;
|
|
2757
3001
|
if (this.state = e, r !== e) {
|
|
2758
3002
|
var s = e;
|
|
2759
|
-
s === "connected" && (s += " with new socket ID " + t.socket_id),
|
|
3003
|
+
s === "connected" && (s += " with new socket ID " + t.socket_id), L.debug("State changed", r + " -> " + s), this.timeline.info({ state: e, params: t }), this.emit("state_change", { previous: r, current: e }), this.emit(e, t);
|
|
2760
3004
|
}
|
|
2761
3005
|
}
|
|
2762
3006
|
shouldRetry() {
|
|
2763
3007
|
return this.state === "connecting" || this.state === "connected";
|
|
2764
3008
|
}
|
|
2765
3009
|
}
|
|
2766
|
-
class
|
|
3010
|
+
class An {
|
|
2767
3011
|
constructor() {
|
|
2768
3012
|
this.channels = {};
|
|
2769
3013
|
}
|
|
2770
3014
|
add(e, t) {
|
|
2771
|
-
return this.channels[e] || (this.channels[e] =
|
|
3015
|
+
return this.channels[e] || (this.channels[e] = Pn(e, t)), this.channels[e];
|
|
2772
3016
|
}
|
|
2773
3017
|
all() {
|
|
2774
|
-
return
|
|
3018
|
+
return Ht(this.channels);
|
|
2775
3019
|
}
|
|
2776
3020
|
find(e) {
|
|
2777
3021
|
return this.channels[e];
|
|
@@ -2786,53 +3030,53 @@ function Vi() {
|
|
|
2786
3030
|
});
|
|
2787
3031
|
}
|
|
2788
3032
|
}
|
|
2789
|
-
function
|
|
3033
|
+
function Pn(n, e) {
|
|
2790
3034
|
if (n.indexOf("private-encrypted-") === 0) {
|
|
2791
3035
|
if (e.config.nacl)
|
|
2792
3036
|
return X.createEncryptedChannel(n, e, e.config.nacl);
|
|
2793
|
-
let t = "Tried to subscribe to a private-encrypted- channel but no nacl implementation available", r =
|
|
2794
|
-
throw new
|
|
3037
|
+
let t = "Tried to subscribe to a private-encrypted- channel but no nacl implementation available", r = _.buildLogSuffix("encryptedChannelSupport");
|
|
3038
|
+
throw new M(`${t}. ${r}`);
|
|
2795
3039
|
} else {
|
|
2796
3040
|
if (n.indexOf("private-") === 0)
|
|
2797
3041
|
return X.createPrivateChannel(n, e);
|
|
2798
3042
|
if (n.indexOf("presence-") === 0)
|
|
2799
3043
|
return X.createPresenceChannel(n, e);
|
|
2800
3044
|
if (n.indexOf("#") === 0)
|
|
2801
|
-
throw new
|
|
3045
|
+
throw new S('Cannot create a channel with name "' + n + '".');
|
|
2802
3046
|
return X.createChannel(n, e);
|
|
2803
3047
|
}
|
|
2804
3048
|
}
|
|
2805
|
-
var
|
|
3049
|
+
var Ln = {
|
|
2806
3050
|
createChannels() {
|
|
2807
|
-
return new
|
|
3051
|
+
return new An();
|
|
2808
3052
|
},
|
|
2809
3053
|
createConnectionManager(n, e) {
|
|
2810
|
-
return new
|
|
3054
|
+
return new En(n, e);
|
|
2811
3055
|
},
|
|
2812
3056
|
createChannel(n, e) {
|
|
2813
|
-
return new
|
|
3057
|
+
return new be(n, e);
|
|
2814
3058
|
},
|
|
2815
3059
|
createPrivateChannel(n, e) {
|
|
2816
3060
|
return new we(n, e);
|
|
2817
3061
|
},
|
|
2818
3062
|
createPresenceChannel(n, e) {
|
|
2819
|
-
return new
|
|
3063
|
+
return new _n(n, e);
|
|
2820
3064
|
},
|
|
2821
3065
|
createEncryptedChannel(n, e, t) {
|
|
2822
|
-
return new
|
|
3066
|
+
return new kn(n, e, t);
|
|
2823
3067
|
},
|
|
2824
3068
|
createTimelineSender(n, e) {
|
|
2825
|
-
return new
|
|
3069
|
+
return new Cn(n, e);
|
|
2826
3070
|
},
|
|
2827
3071
|
createHandshake(n, e) {
|
|
2828
|
-
return new
|
|
3072
|
+
return new wn(n, e);
|
|
2829
3073
|
},
|
|
2830
3074
|
createAssistantToTheTransportManager(n, e, t) {
|
|
2831
|
-
return new
|
|
3075
|
+
return new yn(n, e, t);
|
|
2832
3076
|
}
|
|
2833
3077
|
};
|
|
2834
|
-
const X =
|
|
2835
|
-
class
|
|
3078
|
+
const X = Ln;
|
|
3079
|
+
class Ke {
|
|
2836
3080
|
constructor(e) {
|
|
2837
3081
|
this.options = e || {}, this.livesLeft = this.options.lives || 1 / 0;
|
|
2838
3082
|
}
|
|
@@ -2854,33 +3098,33 @@ function Vi() {
|
|
|
2854
3098
|
this.strategies = e, this.loop = !!t.loop, this.failFast = !!t.failFast, this.timeout = t.timeout, this.timeoutLimit = t.timeoutLimit;
|
|
2855
3099
|
}
|
|
2856
3100
|
isSupported() {
|
|
2857
|
-
return
|
|
3101
|
+
return $e(this.strategies, U.method("isSupported"));
|
|
2858
3102
|
}
|
|
2859
3103
|
connect(e, t) {
|
|
2860
|
-
var r = this.strategies, s = 0,
|
|
2861
|
-
|
|
3104
|
+
var r = this.strategies, s = 0, c = this.timeout, l = null, f = (b, k) => {
|
|
3105
|
+
k ? t(null, k) : (s = s + 1, this.loop && (s = s % r.length), s < r.length ? (c && (c = c * 2, this.timeoutLimit && (c = Math.min(c, this.timeoutLimit))), l = this.tryStrategy(r[s], e, { timeout: c, failFast: this.failFast }, f)) : t(!0));
|
|
2862
3106
|
};
|
|
2863
|
-
return
|
|
3107
|
+
return l = this.tryStrategy(r[s], e, { timeout: c, failFast: this.failFast }, f), {
|
|
2864
3108
|
abort: function() {
|
|
2865
|
-
|
|
3109
|
+
l.abort();
|
|
2866
3110
|
},
|
|
2867
|
-
forceMinPriority: function(
|
|
2868
|
-
e =
|
|
3111
|
+
forceMinPriority: function(b) {
|
|
3112
|
+
e = b, l && l.forceMinPriority(b);
|
|
2869
3113
|
}
|
|
2870
3114
|
};
|
|
2871
3115
|
}
|
|
2872
3116
|
tryStrategy(e, t, r, s) {
|
|
2873
|
-
var
|
|
2874
|
-
return r.timeout > 0 && (
|
|
2875
|
-
|
|
2876
|
-
})),
|
|
2877
|
-
|
|
3117
|
+
var c = null, l = null;
|
|
3118
|
+
return r.timeout > 0 && (c = new G(r.timeout, function() {
|
|
3119
|
+
l.abort(), s(!0);
|
|
3120
|
+
})), l = e.connect(t, function(f, b) {
|
|
3121
|
+
f && c && c.isRunning() && !r.failFast || (c && c.ensureAborted(), s(f, b));
|
|
2878
3122
|
}), {
|
|
2879
3123
|
abort: function() {
|
|
2880
|
-
|
|
3124
|
+
c && c.ensureAborted(), l.abort();
|
|
2881
3125
|
},
|
|
2882
|
-
forceMinPriority: function(
|
|
2883
|
-
|
|
3126
|
+
forceMinPriority: function(f) {
|
|
3127
|
+
l.forceMinPriority(f);
|
|
2884
3128
|
}
|
|
2885
3129
|
};
|
|
2886
3130
|
}
|
|
@@ -2890,46 +3134,46 @@ function Vi() {
|
|
|
2890
3134
|
this.strategies = e;
|
|
2891
3135
|
}
|
|
2892
3136
|
isSupported() {
|
|
2893
|
-
return
|
|
3137
|
+
return $e(this.strategies, U.method("isSupported"));
|
|
2894
3138
|
}
|
|
2895
3139
|
connect(e, t) {
|
|
2896
|
-
return
|
|
2897
|
-
return function(
|
|
2898
|
-
if (s[r].error =
|
|
2899
|
-
|
|
3140
|
+
return Rn(this.strategies, e, function(r, s) {
|
|
3141
|
+
return function(c, l) {
|
|
3142
|
+
if (s[r].error = c, c) {
|
|
3143
|
+
In(s) && t(!0);
|
|
2900
3144
|
return;
|
|
2901
3145
|
}
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
}), t(null,
|
|
3146
|
+
ie(s, function(f) {
|
|
3147
|
+
f.forceMinPriority(l.transport.priority);
|
|
3148
|
+
}), t(null, l);
|
|
2905
3149
|
};
|
|
2906
3150
|
});
|
|
2907
3151
|
}
|
|
2908
3152
|
}
|
|
2909
|
-
function
|
|
2910
|
-
var r =
|
|
2911
|
-
return s.connect(e, t(
|
|
3153
|
+
function Rn(n, e, t) {
|
|
3154
|
+
var r = We(n, function(s, c, l, f) {
|
|
3155
|
+
return s.connect(e, t(c, f));
|
|
2912
3156
|
});
|
|
2913
3157
|
return {
|
|
2914
3158
|
abort: function() {
|
|
2915
|
-
|
|
3159
|
+
ie(r, On);
|
|
2916
3160
|
},
|
|
2917
3161
|
forceMinPriority: function(s) {
|
|
2918
|
-
|
|
2919
|
-
|
|
3162
|
+
ie(r, function(c) {
|
|
3163
|
+
c.forceMinPriority(s);
|
|
2920
3164
|
});
|
|
2921
3165
|
}
|
|
2922
3166
|
};
|
|
2923
3167
|
}
|
|
2924
|
-
function
|
|
2925
|
-
return
|
|
3168
|
+
function In(n) {
|
|
3169
|
+
return Bt(n, function(e) {
|
|
2926
3170
|
return !!e.error;
|
|
2927
3171
|
});
|
|
2928
3172
|
}
|
|
2929
|
-
function
|
|
3173
|
+
function On(n) {
|
|
2930
3174
|
!n.error && !n.aborted && (n.abort(), n.aborted = !0);
|
|
2931
3175
|
}
|
|
2932
|
-
class
|
|
3176
|
+
class qn {
|
|
2933
3177
|
constructor(e, t, r) {
|
|
2934
3178
|
this.strategy = e, this.transports = t, this.ttl = r.ttl || 18e5, this.usingTLS = r.useTLS, this.timeline = r.timeline;
|
|
2935
3179
|
}
|
|
@@ -2937,51 +3181,51 @@ function Vi() {
|
|
|
2937
3181
|
return this.strategy.isSupported();
|
|
2938
3182
|
}
|
|
2939
3183
|
connect(e, t) {
|
|
2940
|
-
var r = this.usingTLS, s =
|
|
3184
|
+
var r = this.usingTLS, s = Un(r), c = s && s.cacheSkipCount ? s.cacheSkipCount : 0, l = [this.strategy];
|
|
2941
3185
|
if (s && s.timestamp + this.ttl >= U.now()) {
|
|
2942
|
-
var
|
|
2943
|
-
|
|
3186
|
+
var f = this.transports[s.transport];
|
|
3187
|
+
f && (["ws", "wss"].includes(s.transport) || c > 3 ? (this.timeline.info({
|
|
2944
3188
|
cached: !0,
|
|
2945
3189
|
transport: s.transport,
|
|
2946
3190
|
latency: s.latency
|
|
2947
|
-
}),
|
|
3191
|
+
}), l.push(new Q([f], {
|
|
2948
3192
|
timeout: s.latency * 2 + 1e3,
|
|
2949
3193
|
failFast: !0
|
|
2950
|
-
}))) :
|
|
3194
|
+
}))) : c++);
|
|
2951
3195
|
}
|
|
2952
|
-
var
|
|
2953
|
-
I ? (
|
|
3196
|
+
var b = U.now(), k = l.pop().connect(e, function E(I, de) {
|
|
3197
|
+
I ? (Ze(r), l.length > 0 ? (b = U.now(), k = l.pop().connect(e, E)) : t(I)) : (jn(r, de.transport.name, U.now() - b, c), t(null, de));
|
|
2954
3198
|
});
|
|
2955
3199
|
return {
|
|
2956
3200
|
abort: function() {
|
|
2957
|
-
|
|
3201
|
+
k.abort();
|
|
2958
3202
|
},
|
|
2959
|
-
forceMinPriority: function(
|
|
2960
|
-
e =
|
|
3203
|
+
forceMinPriority: function(E) {
|
|
3204
|
+
e = E, k && k.forceMinPriority(E);
|
|
2961
3205
|
}
|
|
2962
3206
|
};
|
|
2963
3207
|
}
|
|
2964
3208
|
}
|
|
2965
|
-
function
|
|
3209
|
+
function Te(n) {
|
|
2966
3210
|
return "pusherTransport" + (n ? "TLS" : "NonTLS");
|
|
2967
3211
|
}
|
|
2968
|
-
function
|
|
2969
|
-
var e =
|
|
3212
|
+
function Un(n) {
|
|
3213
|
+
var e = C.getLocalStorage();
|
|
2970
3214
|
if (e)
|
|
2971
3215
|
try {
|
|
2972
|
-
var t = e[
|
|
3216
|
+
var t = e[Te(n)];
|
|
2973
3217
|
if (t)
|
|
2974
3218
|
return JSON.parse(t);
|
|
2975
3219
|
} catch {
|
|
2976
|
-
|
|
3220
|
+
Ze(n);
|
|
2977
3221
|
}
|
|
2978
3222
|
return null;
|
|
2979
3223
|
}
|
|
2980
|
-
function
|
|
2981
|
-
var s =
|
|
3224
|
+
function jn(n, e, t, r) {
|
|
3225
|
+
var s = C.getLocalStorage();
|
|
2982
3226
|
if (s)
|
|
2983
3227
|
try {
|
|
2984
|
-
s[
|
|
3228
|
+
s[Te(n)] = ae({
|
|
2985
3229
|
timestamp: U.now(),
|
|
2986
3230
|
transport: e,
|
|
2987
3231
|
latency: t,
|
|
@@ -2990,11 +3234,11 @@ function Vi() {
|
|
|
2990
3234
|
} catch {
|
|
2991
3235
|
}
|
|
2992
3236
|
}
|
|
2993
|
-
function
|
|
2994
|
-
var e =
|
|
3237
|
+
function Ze(n) {
|
|
3238
|
+
var e = C.getLocalStorage();
|
|
2995
3239
|
if (e)
|
|
2996
3240
|
try {
|
|
2997
|
-
delete e[
|
|
3241
|
+
delete e[Te(n)];
|
|
2998
3242
|
} catch {
|
|
2999
3243
|
}
|
|
3000
3244
|
}
|
|
@@ -3006,20 +3250,20 @@ function Vi() {
|
|
|
3006
3250
|
return this.strategy.isSupported();
|
|
3007
3251
|
}
|
|
3008
3252
|
connect(e, t) {
|
|
3009
|
-
var r = this.strategy, s,
|
|
3253
|
+
var r = this.strategy, s, c = new G(this.options.delay, function() {
|
|
3010
3254
|
s = r.connect(e, t);
|
|
3011
3255
|
});
|
|
3012
3256
|
return {
|
|
3013
3257
|
abort: function() {
|
|
3014
|
-
|
|
3258
|
+
c.ensureAborted(), s && s.abort();
|
|
3015
3259
|
},
|
|
3016
|
-
forceMinPriority: function(
|
|
3017
|
-
e =
|
|
3260
|
+
forceMinPriority: function(l) {
|
|
3261
|
+
e = l, s && s.forceMinPriority(l);
|
|
3018
3262
|
}
|
|
3019
3263
|
};
|
|
3020
3264
|
}
|
|
3021
3265
|
}
|
|
3022
|
-
class
|
|
3266
|
+
class re {
|
|
3023
3267
|
constructor(e, t, r) {
|
|
3024
3268
|
this.test = e, this.trueBranch = t, this.falseBranch = r;
|
|
3025
3269
|
}
|
|
@@ -3032,7 +3276,7 @@ function Vi() {
|
|
|
3032
3276
|
return r.connect(e, t);
|
|
3033
3277
|
}
|
|
3034
3278
|
}
|
|
3035
|
-
class
|
|
3279
|
+
class Nn {
|
|
3036
3280
|
constructor(e) {
|
|
3037
3281
|
this.strategy = e;
|
|
3038
3282
|
}
|
|
@@ -3040,69 +3284,69 @@ function Vi() {
|
|
|
3040
3284
|
return this.strategy.isSupported();
|
|
3041
3285
|
}
|
|
3042
3286
|
connect(e, t) {
|
|
3043
|
-
var r = this.strategy.connect(e, function(s,
|
|
3044
|
-
|
|
3287
|
+
var r = this.strategy.connect(e, function(s, c) {
|
|
3288
|
+
c && r.abort(), t(s, c);
|
|
3045
3289
|
});
|
|
3046
3290
|
return r;
|
|
3047
3291
|
}
|
|
3048
3292
|
}
|
|
3049
|
-
function
|
|
3293
|
+
function se(n) {
|
|
3050
3294
|
return function() {
|
|
3051
3295
|
return n.isSupported();
|
|
3052
3296
|
};
|
|
3053
3297
|
}
|
|
3054
|
-
var
|
|
3298
|
+
var zn = function(n, e, t) {
|
|
3055
3299
|
var r = {};
|
|
3056
|
-
function s(
|
|
3057
|
-
var
|
|
3058
|
-
return r[
|
|
3300
|
+
function s(dt, Ui, ji, Ni, zi) {
|
|
3301
|
+
var pt = t(n, dt, Ui, ji, Ni, zi);
|
|
3302
|
+
return r[dt] = pt, pt;
|
|
3059
3303
|
}
|
|
3060
|
-
var
|
|
3304
|
+
var c = Object.assign({}, e, {
|
|
3061
3305
|
hostNonTLS: n.wsHost + ":" + n.wsPort,
|
|
3062
3306
|
hostTLS: n.wsHost + ":" + n.wssPort,
|
|
3063
3307
|
httpPath: n.wsPath
|
|
3064
|
-
}),
|
|
3308
|
+
}), l = Object.assign({}, c, {
|
|
3065
3309
|
useTLS: !0
|
|
3066
|
-
}),
|
|
3310
|
+
}), f = Object.assign({}, e, {
|
|
3067
3311
|
hostNonTLS: n.httpHost + ":" + n.httpPort,
|
|
3068
3312
|
hostTLS: n.httpHost + ":" + n.httpsPort,
|
|
3069
3313
|
httpPath: n.httpPath
|
|
3070
|
-
}),
|
|
3314
|
+
}), b = {
|
|
3071
3315
|
loop: !0,
|
|
3072
3316
|
timeout: 15e3,
|
|
3073
3317
|
timeoutLimit: 6e4
|
|
3074
|
-
},
|
|
3318
|
+
}, k = new Ke({
|
|
3075
3319
|
minPingDelay: 1e4,
|
|
3076
3320
|
maxPingDelay: n.activityTimeout
|
|
3077
|
-
}),
|
|
3321
|
+
}), E = new Ke({
|
|
3078
3322
|
lives: 2,
|
|
3079
3323
|
minPingDelay: 1e4,
|
|
3080
3324
|
maxPingDelay: n.activityTimeout
|
|
3081
|
-
}), I = s("ws", "ws", 3,
|
|
3082
|
-
new
|
|
3083
|
-
],
|
|
3084
|
-
new
|
|
3085
|
-
],
|
|
3086
|
-
new
|
|
3087
|
-
|
|
3088
|
-
new he(
|
|
3089
|
-
]),
|
|
3090
|
-
],
|
|
3091
|
-
return e.useTLS ?
|
|
3092
|
-
|
|
3093
|
-
new he(
|
|
3094
|
-
]) :
|
|
3095
|
-
|
|
3096
|
-
new he(
|
|
3097
|
-
new he(
|
|
3098
|
-
]), new
|
|
3325
|
+
}), I = s("ws", "ws", 3, c, k), de = s("wss", "ws", 3, l, k), Li = s("sockjs", "sockjs", 1, f), ot = s("xhr_streaming", "xhr_streaming", 1, f, E), Ri = s("xdr_streaming", "xdr_streaming", 1, f, E), at = s("xhr_polling", "xhr_polling", 1, f), Ii = s("xdr_polling", "xdr_polling", 1, f), ct = new Q([I], b), Oi = new Q([de], b), qi = new Q([Li], b), ht = new Q([
|
|
3326
|
+
new re(se(ot), ot, Ri)
|
|
3327
|
+
], b), lt = new Q([
|
|
3328
|
+
new re(se(at), at, Ii)
|
|
3329
|
+
], b), ut = new Q([
|
|
3330
|
+
new re(se(ht), new Se([
|
|
3331
|
+
ht,
|
|
3332
|
+
new he(lt, { delay: 4e3 })
|
|
3333
|
+
]), lt)
|
|
3334
|
+
], b), ke = new re(se(ut), ut, qi), Ee;
|
|
3335
|
+
return e.useTLS ? Ee = new Se([
|
|
3336
|
+
ct,
|
|
3337
|
+
new he(ke, { delay: 2e3 })
|
|
3338
|
+
]) : Ee = new Se([
|
|
3339
|
+
ct,
|
|
3340
|
+
new he(Oi, { delay: 2e3 }),
|
|
3341
|
+
new he(ke, { delay: 5e3 })
|
|
3342
|
+
]), new qn(new Nn(new re(se(I), Ee, ke)), r, {
|
|
3099
3343
|
ttl: 18e5,
|
|
3100
3344
|
timeline: e.timeline,
|
|
3101
3345
|
useTLS: e.useTLS
|
|
3102
3346
|
});
|
|
3103
3347
|
};
|
|
3104
|
-
const
|
|
3105
|
-
function
|
|
3348
|
+
const Mn = zn;
|
|
3349
|
+
function Dn() {
|
|
3106
3350
|
var n = this;
|
|
3107
3351
|
n.timeline.info(n.buildTimelineMessage({
|
|
3108
3352
|
transport: n.name + (n.options.useTLS ? "s" : "")
|
|
@@ -3110,7 +3354,7 @@ function Vi() {
|
|
|
3110
3354
|
n.hooks.isInitialized() ? (n.changeState("initialized"), t(!0)) : (e && n.onError(e), n.onClose(), t(!1));
|
|
3111
3355
|
})) : n.onClose();
|
|
3112
3356
|
}
|
|
3113
|
-
var
|
|
3357
|
+
var Hn = {
|
|
3114
3358
|
getRequest: function(n) {
|
|
3115
3359
|
var e = new window.XDomainRequest();
|
|
3116
3360
|
return e.ontimeout = function() {
|
|
@@ -3127,18 +3371,18 @@ function Vi() {
|
|
|
3127
3371
|
n.ontimeout = n.onerror = n.onprogress = n.onload = null, n.abort();
|
|
3128
3372
|
}
|
|
3129
3373
|
};
|
|
3130
|
-
const
|
|
3131
|
-
class
|
|
3374
|
+
const Wn = Hn, Fn = 256 * 1024;
|
|
3375
|
+
class Bn extends $ {
|
|
3132
3376
|
constructor(e, t, r) {
|
|
3133
3377
|
super(), this.hooks = e, this.method = t, this.url = r;
|
|
3134
3378
|
}
|
|
3135
3379
|
start(e) {
|
|
3136
3380
|
this.position = 0, this.xhr = this.hooks.getRequest(this), this.unloader = () => {
|
|
3137
3381
|
this.close();
|
|
3138
|
-
},
|
|
3382
|
+
}, C.addUnloadListener(this.unloader), this.xhr.open(this.method, this.url, !0), this.xhr.setRequestHeader && this.xhr.setRequestHeader("Content-Type", "application/json"), this.xhr.send(e);
|
|
3139
3383
|
}
|
|
3140
3384
|
close() {
|
|
3141
|
-
this.unloader && (
|
|
3385
|
+
this.unloader && (C.removeUnloadListener(this.unloader), this.unloader = null), this.xhr && (this.hooks.abortRequest(this.xhr), this.xhr = null);
|
|
3142
3386
|
}
|
|
3143
3387
|
onChunk(e, t) {
|
|
3144
3388
|
for (; ; ) {
|
|
@@ -3156,18 +3400,18 @@ function Vi() {
|
|
|
3156
3400
|
return r !== -1 ? (this.position += r + 1, t.slice(0, r)) : null;
|
|
3157
3401
|
}
|
|
3158
3402
|
isBufferTooLong(e) {
|
|
3159
|
-
return this.position === e.length && e.length >
|
|
3403
|
+
return this.position === e.length && e.length > Fn;
|
|
3160
3404
|
}
|
|
3161
3405
|
}
|
|
3162
|
-
var
|
|
3406
|
+
var _e;
|
|
3163
3407
|
(function(n) {
|
|
3164
3408
|
n[n.CONNECTING = 0] = "CONNECTING", n[n.OPEN = 1] = "OPEN", n[n.CLOSED = 3] = "CLOSED";
|
|
3165
|
-
})(
|
|
3166
|
-
const
|
|
3167
|
-
var
|
|
3168
|
-
class
|
|
3409
|
+
})(_e || (_e = {}));
|
|
3410
|
+
const K = _e;
|
|
3411
|
+
var $n = 1;
|
|
3412
|
+
class Xn {
|
|
3169
3413
|
constructor(e, t) {
|
|
3170
|
-
this.hooks = e, this.session =
|
|
3414
|
+
this.hooks = e, this.session = tt(1e3) + "/" + Yn(8), this.location = Jn(t), this.readyState = K.CONNECTING, this.openStream();
|
|
3171
3415
|
}
|
|
3172
3416
|
send(e) {
|
|
3173
3417
|
return this.sendRaw(JSON.stringify([e]));
|
|
@@ -3179,9 +3423,9 @@ function Vi() {
|
|
|
3179
3423
|
this.onClose(e, t, !0);
|
|
3180
3424
|
}
|
|
3181
3425
|
sendRaw(e) {
|
|
3182
|
-
if (this.readyState ===
|
|
3426
|
+
if (this.readyState === K.OPEN)
|
|
3183
3427
|
try {
|
|
3184
|
-
return
|
|
3428
|
+
return C.createSocketRequest("POST", et(Vn(this.location, this.session))).start(e), !0;
|
|
3185
3429
|
} catch {
|
|
3186
3430
|
return !1;
|
|
3187
3431
|
}
|
|
@@ -3192,7 +3436,7 @@ function Vi() {
|
|
|
3192
3436
|
this.closeStream(), this.openStream();
|
|
3193
3437
|
}
|
|
3194
3438
|
onClose(e, t, r) {
|
|
3195
|
-
this.closeStream(), this.readyState =
|
|
3439
|
+
this.closeStream(), this.readyState = K.CLOSED, this.onclose && this.onclose({
|
|
3196
3440
|
code: e,
|
|
3197
3441
|
reason: t,
|
|
3198
3442
|
wasClean: r
|
|
@@ -3200,7 +3444,7 @@ function Vi() {
|
|
|
3200
3444
|
}
|
|
3201
3445
|
onChunk(e) {
|
|
3202
3446
|
if (e.status === 200) {
|
|
3203
|
-
this.readyState ===
|
|
3447
|
+
this.readyState === K.OPEN && this.onActivity();
|
|
3204
3448
|
var t, r = e.data.slice(0, 1);
|
|
3205
3449
|
switch (r) {
|
|
3206
3450
|
case "o":
|
|
@@ -3224,10 +3468,10 @@ function Vi() {
|
|
|
3224
3468
|
}
|
|
3225
3469
|
}
|
|
3226
3470
|
onOpen(e) {
|
|
3227
|
-
this.readyState ===
|
|
3471
|
+
this.readyState === K.CONNECTING ? (e && e.hostname && (this.location.base = Gn(this.location.base, e.hostname)), this.readyState = K.OPEN, this.onopen && this.onopen()) : this.onClose(1006, "Server lost session", !0);
|
|
3228
3472
|
}
|
|
3229
3473
|
onEvent(e) {
|
|
3230
|
-
this.readyState ===
|
|
3474
|
+
this.readyState === K.OPEN && this.onmessage && this.onmessage({ data: e });
|
|
3231
3475
|
}
|
|
3232
3476
|
onActivity() {
|
|
3233
3477
|
this.onactivity && this.onactivity();
|
|
@@ -3236,7 +3480,7 @@ function Vi() {
|
|
|
3236
3480
|
this.onerror && this.onerror(e);
|
|
3237
3481
|
}
|
|
3238
3482
|
openStream() {
|
|
3239
|
-
this.stream =
|
|
3483
|
+
this.stream = C.createSocketRequest("POST", et(this.hooks.getReceiveURL(this.location, this.session))), this.stream.bind("chunk", (e) => {
|
|
3240
3484
|
this.onChunk(e);
|
|
3241
3485
|
}), this.stream.bind("finished", (e) => {
|
|
3242
3486
|
this.hooks.onFinished(this, e);
|
|
@@ -3255,33 +3499,33 @@ function Vi() {
|
|
|
3255
3499
|
this.stream && (this.stream.unbind_all(), this.stream.close(), this.stream = null);
|
|
3256
3500
|
}
|
|
3257
3501
|
}
|
|
3258
|
-
function
|
|
3502
|
+
function Jn(n) {
|
|
3259
3503
|
var e = /([^\?]*)\/*(\??.*)/.exec(n);
|
|
3260
3504
|
return {
|
|
3261
3505
|
base: e[1],
|
|
3262
3506
|
queryString: e[2]
|
|
3263
3507
|
};
|
|
3264
3508
|
}
|
|
3265
|
-
function
|
|
3509
|
+
function Vn(n, e) {
|
|
3266
3510
|
return n.base + "/" + e + "/xhr_send";
|
|
3267
3511
|
}
|
|
3268
|
-
function
|
|
3512
|
+
function et(n) {
|
|
3269
3513
|
var e = n.indexOf("?") === -1 ? "?" : "&";
|
|
3270
|
-
return n + e + "t=" + +/* @__PURE__ */ new Date() + "&n=" +
|
|
3514
|
+
return n + e + "t=" + +/* @__PURE__ */ new Date() + "&n=" + $n++;
|
|
3271
3515
|
}
|
|
3272
|
-
function
|
|
3516
|
+
function Gn(n, e) {
|
|
3273
3517
|
var t = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(n);
|
|
3274
3518
|
return t[1] + e + t[3];
|
|
3275
3519
|
}
|
|
3276
|
-
function
|
|
3277
|
-
return
|
|
3520
|
+
function tt(n) {
|
|
3521
|
+
return C.randomInt(n);
|
|
3278
3522
|
}
|
|
3279
|
-
function
|
|
3523
|
+
function Yn(n) {
|
|
3280
3524
|
for (var e = [], t = 0; t < n; t++)
|
|
3281
|
-
e.push(
|
|
3525
|
+
e.push(tt(32).toString(32));
|
|
3282
3526
|
return e.join("");
|
|
3283
3527
|
}
|
|
3284
|
-
const
|
|
3528
|
+
const Qn = Xn;
|
|
3285
3529
|
var Kn = {
|
|
3286
3530
|
getReceiveURL: function(n, e) {
|
|
3287
3531
|
return n.base + "/" + e + "/xhr_streaming" + n.queryString;
|
|
@@ -3296,8 +3540,8 @@ function Vi() {
|
|
|
3296
3540
|
n.onClose(1006, "Connection interrupted (" + e + ")", !1);
|
|
3297
3541
|
}
|
|
3298
3542
|
};
|
|
3299
|
-
const
|
|
3300
|
-
var
|
|
3543
|
+
const Zn = Kn;
|
|
3544
|
+
var ei = {
|
|
3301
3545
|
getReceiveURL: function(n, e) {
|
|
3302
3546
|
return n.base + "/" + e + "/xhr" + n.queryString;
|
|
3303
3547
|
},
|
|
@@ -3310,10 +3554,10 @@ function Vi() {
|
|
|
3310
3554
|
e === 200 ? n.reconnect() : n.onClose(1006, "Connection interrupted (" + e + ")", !1);
|
|
3311
3555
|
}
|
|
3312
3556
|
};
|
|
3313
|
-
const
|
|
3314
|
-
var
|
|
3557
|
+
const ti = ei;
|
|
3558
|
+
var ni = {
|
|
3315
3559
|
getRequest: function(n) {
|
|
3316
|
-
var e =
|
|
3560
|
+
var e = C.getXHRAPI(), t = new e();
|
|
3317
3561
|
return t.onreadystatechange = t.onprogress = function() {
|
|
3318
3562
|
switch (t.readyState) {
|
|
3319
3563
|
case 3:
|
|
@@ -3329,38 +3573,38 @@ function Vi() {
|
|
|
3329
3573
|
n.onreadystatechange = null, n.abort();
|
|
3330
3574
|
}
|
|
3331
3575
|
};
|
|
3332
|
-
const
|
|
3333
|
-
var
|
|
3576
|
+
const ii = ni;
|
|
3577
|
+
var ri = {
|
|
3334
3578
|
createStreamingSocket(n) {
|
|
3335
|
-
return this.createSocket(
|
|
3579
|
+
return this.createSocket(Zn, n);
|
|
3336
3580
|
},
|
|
3337
3581
|
createPollingSocket(n) {
|
|
3338
|
-
return this.createSocket(
|
|
3582
|
+
return this.createSocket(ti, n);
|
|
3339
3583
|
},
|
|
3340
3584
|
createSocket(n, e) {
|
|
3341
|
-
return new
|
|
3585
|
+
return new Qn(n, e);
|
|
3342
3586
|
},
|
|
3343
3587
|
createXHR(n, e) {
|
|
3344
|
-
return this.createRequest(
|
|
3588
|
+
return this.createRequest(ii, n, e);
|
|
3345
3589
|
},
|
|
3346
3590
|
createRequest(n, e, t) {
|
|
3347
|
-
return new
|
|
3591
|
+
return new Bn(n, e, t);
|
|
3348
3592
|
}
|
|
3349
3593
|
};
|
|
3350
|
-
const
|
|
3351
|
-
|
|
3352
|
-
return this.createRequest(
|
|
3594
|
+
const nt = ri;
|
|
3595
|
+
nt.createXDR = function(n, e) {
|
|
3596
|
+
return this.createRequest(Wn, n, e);
|
|
3353
3597
|
};
|
|
3354
|
-
var
|
|
3598
|
+
var si = {
|
|
3355
3599
|
nextAuthCallbackID: 1,
|
|
3356
3600
|
auth_callbacks: {},
|
|
3357
|
-
ScriptReceivers:
|
|
3601
|
+
ScriptReceivers: w,
|
|
3358
3602
|
DependenciesReceivers: W,
|
|
3359
|
-
getDefaultStrategy:
|
|
3360
|
-
Transports:
|
|
3361
|
-
transportConnectionInitializer:
|
|
3362
|
-
HTTPFactory:
|
|
3363
|
-
TimelineTransport:
|
|
3603
|
+
getDefaultStrategy: Mn,
|
|
3604
|
+
Transports: mn,
|
|
3605
|
+
transportConnectionInitializer: Dn,
|
|
3606
|
+
HTTPFactory: nt,
|
|
3607
|
+
TimelineTransport: tn,
|
|
3364
3608
|
getXHRAPI() {
|
|
3365
3609
|
return window.XMLHttpRequest;
|
|
3366
3610
|
},
|
|
@@ -3381,7 +3625,7 @@ function Vi() {
|
|
|
3381
3625
|
return this.getDocument().location.protocol;
|
|
3382
3626
|
},
|
|
3383
3627
|
getAuthorizers() {
|
|
3384
|
-
return { ajax:
|
|
3628
|
+
return { ajax: Pt, jsonp: Yt };
|
|
3385
3629
|
},
|
|
3386
3630
|
onDocumentBody(n) {
|
|
3387
3631
|
document.body ? n() : setTimeout(() => {
|
|
@@ -3392,7 +3636,7 @@ function Vi() {
|
|
|
3392
3636
|
return new Kt(n, e);
|
|
3393
3637
|
},
|
|
3394
3638
|
createScriptRequest(n) {
|
|
3395
|
-
return new
|
|
3639
|
+
return new Qt(n);
|
|
3396
3640
|
},
|
|
3397
3641
|
getLocalStorage() {
|
|
3398
3642
|
try {
|
|
@@ -3412,7 +3656,7 @@ function Vi() {
|
|
|
3412
3656
|
return new ActiveXObject("Microsoft.XMLHTTP");
|
|
3413
3657
|
},
|
|
3414
3658
|
getNetwork() {
|
|
3415
|
-
return
|
|
3659
|
+
return vn;
|
|
3416
3660
|
},
|
|
3417
3661
|
createWebSocket(n) {
|
|
3418
3662
|
var e = this.getWebSocketAPI();
|
|
@@ -3445,33 +3689,33 @@ function Vi() {
|
|
|
3445
3689
|
}() * n);
|
|
3446
3690
|
}
|
|
3447
3691
|
};
|
|
3448
|
-
const
|
|
3449
|
-
var
|
|
3692
|
+
const C = si;
|
|
3693
|
+
var xe;
|
|
3450
3694
|
(function(n) {
|
|
3451
3695
|
n[n.ERROR = 3] = "ERROR", n[n.INFO = 6] = "INFO", n[n.DEBUG = 7] = "DEBUG";
|
|
3452
|
-
})(
|
|
3453
|
-
const
|
|
3454
|
-
class
|
|
3696
|
+
})(xe || (xe = {}));
|
|
3697
|
+
const le = xe;
|
|
3698
|
+
class oi {
|
|
3455
3699
|
constructor(e, t, r) {
|
|
3456
3700
|
this.key = e, this.session = t, this.events = [], this.options = r || {}, this.sent = 0, this.uniqueID = 0;
|
|
3457
3701
|
}
|
|
3458
3702
|
log(e, t) {
|
|
3459
|
-
e <= this.options.level && (this.events.push(
|
|
3703
|
+
e <= this.options.level && (this.events.push(z({}, t, { timestamp: U.now() })), this.options.limit && this.events.length > this.options.limit && this.events.shift());
|
|
3460
3704
|
}
|
|
3461
3705
|
error(e) {
|
|
3462
|
-
this.log(
|
|
3706
|
+
this.log(le.ERROR, e);
|
|
3463
3707
|
}
|
|
3464
3708
|
info(e) {
|
|
3465
|
-
this.log(
|
|
3709
|
+
this.log(le.INFO, e);
|
|
3466
3710
|
}
|
|
3467
3711
|
debug(e) {
|
|
3468
|
-
this.log(
|
|
3712
|
+
this.log(le.DEBUG, e);
|
|
3469
3713
|
}
|
|
3470
3714
|
isEmpty() {
|
|
3471
3715
|
return this.events.length === 0;
|
|
3472
3716
|
}
|
|
3473
3717
|
send(e, t) {
|
|
3474
|
-
var r =
|
|
3718
|
+
var r = z({
|
|
3475
3719
|
session: this.session,
|
|
3476
3720
|
bundle: this.sent + 1,
|
|
3477
3721
|
key: this.key,
|
|
@@ -3481,15 +3725,15 @@ function Vi() {
|
|
|
3481
3725
|
features: this.options.features,
|
|
3482
3726
|
timeline: this.events
|
|
3483
3727
|
}, this.options.params);
|
|
3484
|
-
return this.events = [], e(r, (s,
|
|
3485
|
-
s || this.sent++, t && t(s,
|
|
3728
|
+
return this.events = [], e(r, (s, c) => {
|
|
3729
|
+
s || this.sent++, t && t(s, c);
|
|
3486
3730
|
}), !0;
|
|
3487
3731
|
}
|
|
3488
3732
|
generateUniqueID() {
|
|
3489
3733
|
return this.uniqueID++, this.uniqueID;
|
|
3490
3734
|
}
|
|
3491
3735
|
}
|
|
3492
|
-
class
|
|
3736
|
+
class ai {
|
|
3493
3737
|
constructor(e, t, r, s) {
|
|
3494
3738
|
this.name = e, this.priority = t, this.transport = r, this.options = s || {};
|
|
3495
3739
|
}
|
|
@@ -3501,34 +3745,34 @@ function Vi() {
|
|
|
3501
3745
|
connect(e, t) {
|
|
3502
3746
|
if (this.isSupported()) {
|
|
3503
3747
|
if (this.priority < e)
|
|
3504
|
-
return
|
|
3505
|
-
} else return
|
|
3506
|
-
var r = !1, s = this.transport.createConnection(this.name, this.priority, this.options.key, this.options),
|
|
3507
|
-
s.unbind("initialized",
|
|
3508
|
-
},
|
|
3509
|
-
|
|
3510
|
-
r = !0,
|
|
3748
|
+
return it(new q(), t);
|
|
3749
|
+
} else return it(new H(), t);
|
|
3750
|
+
var r = !1, s = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), c = null, l = function() {
|
|
3751
|
+
s.unbind("initialized", l), s.connect();
|
|
3752
|
+
}, f = function() {
|
|
3753
|
+
c = X.createHandshake(s, function(I) {
|
|
3754
|
+
r = !0, E(), t(null, I);
|
|
3511
3755
|
});
|
|
3512
|
-
},
|
|
3513
|
-
|
|
3514
|
-
},
|
|
3515
|
-
|
|
3756
|
+
}, b = function(I) {
|
|
3757
|
+
E(), t(I);
|
|
3758
|
+
}, k = function() {
|
|
3759
|
+
E();
|
|
3516
3760
|
var I;
|
|
3517
3761
|
I = ae(s), t(new N(I));
|
|
3518
|
-
},
|
|
3519
|
-
s.unbind("initialized",
|
|
3762
|
+
}, E = function() {
|
|
3763
|
+
s.unbind("initialized", l), s.unbind("open", f), s.unbind("error", b), s.unbind("closed", k);
|
|
3520
3764
|
};
|
|
3521
|
-
return s.bind("initialized",
|
|
3765
|
+
return s.bind("initialized", l), s.bind("open", f), s.bind("error", b), s.bind("closed", k), s.initialize(), {
|
|
3522
3766
|
abort: () => {
|
|
3523
|
-
r || (
|
|
3767
|
+
r || (E(), c ? c.close() : s.close());
|
|
3524
3768
|
},
|
|
3525
3769
|
forceMinPriority: (I) => {
|
|
3526
|
-
r || this.priority < I && (
|
|
3770
|
+
r || this.priority < I && (c ? c.close() : s.close());
|
|
3527
3771
|
}
|
|
3528
3772
|
};
|
|
3529
3773
|
}
|
|
3530
3774
|
}
|
|
3531
|
-
function
|
|
3775
|
+
function it(n, e) {
|
|
3532
3776
|
return U.defer(function() {
|
|
3533
3777
|
e(n);
|
|
3534
3778
|
}), {
|
|
@@ -3538,20 +3782,20 @@ function Vi() {
|
|
|
3538
3782
|
}
|
|
3539
3783
|
};
|
|
3540
3784
|
}
|
|
3541
|
-
const { Transports:
|
|
3542
|
-
var
|
|
3543
|
-
var
|
|
3544
|
-
if (!
|
|
3545
|
-
throw new
|
|
3546
|
-
var
|
|
3547
|
-
return
|
|
3548
|
-
},
|
|
3785
|
+
const { Transports: ci } = C;
|
|
3786
|
+
var hi = function(n, e, t, r, s, c) {
|
|
3787
|
+
var l = ci[t];
|
|
3788
|
+
if (!l)
|
|
3789
|
+
throw new J(t);
|
|
3790
|
+
var f = (!n.enabledTransports || De(n.enabledTransports, e) !== -1) && (!n.disabledTransports || De(n.disabledTransports, e) === -1), b;
|
|
3791
|
+
return f ? (s = Object.assign({ ignoreNullOrigin: n.ignoreNullOrigin }, s), b = new ai(e, r, c ? c.getAssistant(l) : l, s)) : b = li, b;
|
|
3792
|
+
}, li = {
|
|
3549
3793
|
isSupported: function() {
|
|
3550
3794
|
return !1;
|
|
3551
3795
|
},
|
|
3552
3796
|
connect: function(n, e) {
|
|
3553
3797
|
var t = U.defer(function() {
|
|
3554
|
-
e(new
|
|
3798
|
+
e(new H());
|
|
3555
3799
|
});
|
|
3556
3800
|
return {
|
|
3557
3801
|
abort: function() {
|
|
@@ -3562,14 +3806,14 @@ function Vi() {
|
|
|
3562
3806
|
};
|
|
3563
3807
|
}
|
|
3564
3808
|
};
|
|
3565
|
-
function
|
|
3809
|
+
function ui(n) {
|
|
3566
3810
|
if (n == null)
|
|
3567
3811
|
throw "You must pass an options object";
|
|
3568
3812
|
if (n.cluster == null)
|
|
3569
3813
|
throw "Options object must provide a cluster";
|
|
3570
|
-
"disableStats" in n &&
|
|
3814
|
+
"disableStats" in n && L.warn("The disableStats option is deprecated in favor of enableStats");
|
|
3571
3815
|
}
|
|
3572
|
-
const
|
|
3816
|
+
const di = (n, e) => {
|
|
3573
3817
|
var t = "socket_id=" + encodeURIComponent(n.socketId);
|
|
3574
3818
|
for (var r in e.params)
|
|
3575
3819
|
t += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(e.params[r]);
|
|
@@ -3579,14 +3823,14 @@ function Vi() {
|
|
|
3579
3823
|
t += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(s[r]);
|
|
3580
3824
|
}
|
|
3581
3825
|
return t;
|
|
3582
|
-
},
|
|
3583
|
-
if (typeof
|
|
3826
|
+
}, pi = (n) => {
|
|
3827
|
+
if (typeof C.getAuthorizers()[n.transport] > "u")
|
|
3584
3828
|
throw `'${n.transport}' is not a recognized auth transport`;
|
|
3585
3829
|
return (e, t) => {
|
|
3586
|
-
const r =
|
|
3587
|
-
|
|
3830
|
+
const r = di(e, n);
|
|
3831
|
+
C.getAuthorizers()[n.transport](C, r, n, d.UserAuthentication, t);
|
|
3588
3832
|
};
|
|
3589
|
-
},
|
|
3833
|
+
}, fi = (n, e) => {
|
|
3590
3834
|
var t = "socket_id=" + encodeURIComponent(n.socketId);
|
|
3591
3835
|
t += "&channel_name=" + encodeURIComponent(n.channelName);
|
|
3592
3836
|
for (var r in e.params)
|
|
@@ -3597,14 +3841,14 @@ function Vi() {
|
|
|
3597
3841
|
t += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(s[r]);
|
|
3598
3842
|
}
|
|
3599
3843
|
return t;
|
|
3600
|
-
},
|
|
3601
|
-
if (typeof
|
|
3844
|
+
}, mi = (n) => {
|
|
3845
|
+
if (typeof C.getAuthorizers()[n.transport] > "u")
|
|
3602
3846
|
throw `'${n.transport}' is not a recognized auth transport`;
|
|
3603
3847
|
return (e, t) => {
|
|
3604
|
-
const r =
|
|
3605
|
-
|
|
3848
|
+
const r = fi(e, n);
|
|
3849
|
+
C.getAuthorizers()[n.transport](C, r, n, d.ChannelAuthorization, t);
|
|
3606
3850
|
};
|
|
3607
|
-
},
|
|
3851
|
+
}, gi = (n, e, t) => {
|
|
3608
3852
|
const r = {
|
|
3609
3853
|
authTransport: e.transport,
|
|
3610
3854
|
authEndpoint: e.endpoint,
|
|
@@ -3613,74 +3857,74 @@ function Vi() {
|
|
|
3613
3857
|
headers: e.headers
|
|
3614
3858
|
}
|
|
3615
3859
|
};
|
|
3616
|
-
return (s,
|
|
3617
|
-
const
|
|
3618
|
-
t(
|
|
3860
|
+
return (s, c) => {
|
|
3861
|
+
const l = n.channel(s.channelName);
|
|
3862
|
+
t(l, r).authorize(s.socketId, c);
|
|
3619
3863
|
};
|
|
3620
3864
|
};
|
|
3621
|
-
function
|
|
3865
|
+
function rt(n, e) {
|
|
3622
3866
|
let t = {
|
|
3623
|
-
activityTimeout: n.activityTimeout ||
|
|
3867
|
+
activityTimeout: n.activityTimeout || T.activityTimeout,
|
|
3624
3868
|
cluster: n.cluster,
|
|
3625
|
-
httpPath: n.httpPath ||
|
|
3626
|
-
httpPort: n.httpPort ||
|
|
3627
|
-
httpsPort: n.httpsPort ||
|
|
3628
|
-
pongTimeout: n.pongTimeout ||
|
|
3629
|
-
statsHost: n.statsHost ||
|
|
3630
|
-
unavailableTimeout: n.unavailableTimeout ||
|
|
3631
|
-
wsPath: n.wsPath ||
|
|
3632
|
-
wsPort: n.wsPort ||
|
|
3633
|
-
wssPort: n.wssPort ||
|
|
3634
|
-
enableStats:
|
|
3635
|
-
httpHost:
|
|
3636
|
-
useTLS:
|
|
3637
|
-
wsHost:
|
|
3638
|
-
userAuthenticator:
|
|
3639
|
-
channelAuthorizer:
|
|
3869
|
+
httpPath: n.httpPath || T.httpPath,
|
|
3870
|
+
httpPort: n.httpPort || T.httpPort,
|
|
3871
|
+
httpsPort: n.httpsPort || T.httpsPort,
|
|
3872
|
+
pongTimeout: n.pongTimeout || T.pongTimeout,
|
|
3873
|
+
statsHost: n.statsHost || T.stats_host,
|
|
3874
|
+
unavailableTimeout: n.unavailableTimeout || T.unavailableTimeout,
|
|
3875
|
+
wsPath: n.wsPath || T.wsPath,
|
|
3876
|
+
wsPort: n.wsPort || T.wsPort,
|
|
3877
|
+
wssPort: n.wssPort || T.wssPort,
|
|
3878
|
+
enableStats: Ci(n),
|
|
3879
|
+
httpHost: vi(n),
|
|
3880
|
+
useTLS: wi(n),
|
|
3881
|
+
wsHost: yi(n),
|
|
3882
|
+
userAuthenticator: Si(n),
|
|
3883
|
+
channelAuthorizer: _i(n, e)
|
|
3640
3884
|
};
|
|
3641
3885
|
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;
|
|
3642
3886
|
}
|
|
3643
|
-
function
|
|
3644
|
-
return n.httpHost ? n.httpHost : n.cluster ? `sockjs-${n.cluster}.pusher.com` :
|
|
3887
|
+
function vi(n) {
|
|
3888
|
+
return n.httpHost ? n.httpHost : n.cluster ? `sockjs-${n.cluster}.pusher.com` : T.httpHost;
|
|
3645
3889
|
}
|
|
3646
|
-
function
|
|
3647
|
-
return n.wsHost ? n.wsHost :
|
|
3890
|
+
function yi(n) {
|
|
3891
|
+
return n.wsHost ? n.wsHost : bi(n.cluster);
|
|
3648
3892
|
}
|
|
3649
|
-
function
|
|
3893
|
+
function bi(n) {
|
|
3650
3894
|
return `ws-${n}.pusher.com`;
|
|
3651
3895
|
}
|
|
3652
|
-
function
|
|
3653
|
-
return
|
|
3896
|
+
function wi(n) {
|
|
3897
|
+
return C.getProtocol() === "https:" ? !0 : n.forceTLS !== !1;
|
|
3654
3898
|
}
|
|
3655
|
-
function
|
|
3899
|
+
function Ci(n) {
|
|
3656
3900
|
return "enableStats" in n ? n.enableStats : "disableStats" in n ? !n.disableStats : !1;
|
|
3657
3901
|
}
|
|
3658
|
-
const
|
|
3659
|
-
function
|
|
3660
|
-
const e = Object.assign(Object.assign({},
|
|
3661
|
-
return
|
|
3902
|
+
const st = (n) => "customHandler" in n && n.customHandler != null;
|
|
3903
|
+
function Si(n) {
|
|
3904
|
+
const e = Object.assign(Object.assign({}, T.userAuthentication), n.userAuthentication);
|
|
3905
|
+
return st(e) ? e.customHandler : pi(e);
|
|
3662
3906
|
}
|
|
3663
|
-
function
|
|
3907
|
+
function Ti(n, e) {
|
|
3664
3908
|
let t;
|
|
3665
3909
|
if ("channelAuthorization" in n)
|
|
3666
|
-
t = Object.assign(Object.assign({},
|
|
3910
|
+
t = Object.assign(Object.assign({}, T.channelAuthorization), n.channelAuthorization);
|
|
3667
3911
|
else if (t = {
|
|
3668
|
-
transport: n.authTransport ||
|
|
3669
|
-
endpoint: n.authEndpoint ||
|
|
3912
|
+
transport: n.authTransport || T.authTransport,
|
|
3913
|
+
endpoint: n.authEndpoint || T.authEndpoint
|
|
3670
3914
|
}, "auth" in n && ("params" in n.auth && (t.params = n.auth.params), "headers" in n.auth && (t.headers = n.auth.headers)), "authorizer" in n)
|
|
3671
3915
|
return {
|
|
3672
|
-
customHandler:
|
|
3916
|
+
customHandler: gi(e, t, n.authorizer)
|
|
3673
3917
|
};
|
|
3674
3918
|
return t;
|
|
3675
3919
|
}
|
|
3676
|
-
function
|
|
3677
|
-
const t =
|
|
3678
|
-
return
|
|
3920
|
+
function _i(n, e) {
|
|
3921
|
+
const t = Ti(n, e);
|
|
3922
|
+
return st(t) ? t.customHandler : mi(t);
|
|
3679
3923
|
}
|
|
3680
|
-
class
|
|
3924
|
+
class xi extends $ {
|
|
3681
3925
|
constructor(e) {
|
|
3682
3926
|
super(function(t, r) {
|
|
3683
|
-
|
|
3927
|
+
L.debug(`No callbacks on watchlist events for ${t}`);
|
|
3684
3928
|
}), this.pusher = e, this.bindWatchlistInternalEvent();
|
|
3685
3929
|
}
|
|
3686
3930
|
handleEvent(e) {
|
|
@@ -3695,20 +3939,20 @@ function Vi() {
|
|
|
3695
3939
|
});
|
|
3696
3940
|
}
|
|
3697
3941
|
}
|
|
3698
|
-
function
|
|
3942
|
+
function ki() {
|
|
3699
3943
|
let n, e;
|
|
3700
3944
|
return { promise: new Promise((r, s) => {
|
|
3701
3945
|
n = r, e = s;
|
|
3702
3946
|
}), resolve: n, reject: e };
|
|
3703
3947
|
}
|
|
3704
|
-
const
|
|
3705
|
-
class
|
|
3948
|
+
const Ei = ki;
|
|
3949
|
+
class Ai extends $ {
|
|
3706
3950
|
constructor(e) {
|
|
3707
3951
|
super(function(t, r) {
|
|
3708
|
-
|
|
3952
|
+
L.debug("No callbacks on user for " + t);
|
|
3709
3953
|
}), this.signin_requested = !1, this.user_data = null, this.serverToUserChannel = null, this.signinDonePromise = null, this._signinDoneResolve = null, this._onAuthorize = (t, r) => {
|
|
3710
3954
|
if (t) {
|
|
3711
|
-
|
|
3955
|
+
L.warn(`Error during signin: ${t}`), this._cleanup();
|
|
3712
3956
|
return;
|
|
3713
3957
|
}
|
|
3714
3958
|
this.pusher.send_event("pusher:signin", {
|
|
@@ -3717,7 +3961,7 @@ function Vi() {
|
|
|
3717
3961
|
});
|
|
3718
3962
|
}, this.pusher = e, this.pusher.connection.bind("state_change", ({ previous: t, current: r }) => {
|
|
3719
3963
|
t !== "connected" && r === "connected" && this._signin(), t === "connected" && r !== "connected" && (this._cleanup(), this._newSigninPromiseIfNeeded());
|
|
3720
|
-
}), this.watchlist = new
|
|
3964
|
+
}), this.watchlist = new xi(e), this.pusher.connection.bind("message", (t) => {
|
|
3721
3965
|
var r = t.event;
|
|
3722
3966
|
r === "pusher:signin_success" && this._onSigninSuccess(t.data), this.serverToUserChannel && this.serverToUserChannel.name === t.channel && this.serverToUserChannel.handleEvent(t);
|
|
3723
3967
|
});
|
|
@@ -3734,11 +3978,11 @@ function Vi() {
|
|
|
3734
3978
|
try {
|
|
3735
3979
|
this.user_data = JSON.parse(e.user_data);
|
|
3736
3980
|
} catch {
|
|
3737
|
-
|
|
3981
|
+
L.error(`Failed parsing user data after signin: ${e.user_data}`), this._cleanup();
|
|
3738
3982
|
return;
|
|
3739
3983
|
}
|
|
3740
3984
|
if (typeof this.user_data.id != "string" || this.user_data.id === "") {
|
|
3741
|
-
|
|
3985
|
+
L.error(`user_data doesn't contain an id. user_data: ${this.user_data}`), this._cleanup();
|
|
3742
3986
|
return;
|
|
3743
3987
|
}
|
|
3744
3988
|
this._signinDoneResolve(), this._subscribeChannels();
|
|
@@ -3747,7 +3991,7 @@ function Vi() {
|
|
|
3747
3991
|
const e = (t) => {
|
|
3748
3992
|
t.subscriptionPending && t.subscriptionCancelled ? t.reinstateSubscription() : !t.subscriptionPending && this.pusher.connection.state === "connected" && t.subscribe();
|
|
3749
3993
|
};
|
|
3750
|
-
this.serverToUserChannel = new
|
|
3994
|
+
this.serverToUserChannel = new be(`#server-to-user-${this.user_data.id}`, this.pusher), this.serverToUserChannel.bind_global((t, r) => {
|
|
3751
3995
|
t.indexOf("pusher_internal:") === 0 || t.indexOf("pusher:") === 0 || this.emit(t, r);
|
|
3752
3996
|
}), e(this.serverToUserChannel);
|
|
3753
3997
|
}
|
|
@@ -3757,7 +4001,7 @@ function Vi() {
|
|
|
3757
4001
|
_newSigninPromiseIfNeeded() {
|
|
3758
4002
|
if (!this.signin_requested || this.signinDonePromise && !this.signinDonePromise.done)
|
|
3759
4003
|
return;
|
|
3760
|
-
const { promise: e, resolve: t } =
|
|
4004
|
+
const { promise: e, resolve: t } = Ei();
|
|
3761
4005
|
e.done = !1;
|
|
3762
4006
|
const r = () => {
|
|
3763
4007
|
e.done = !0;
|
|
@@ -3772,23 +4016,23 @@ function Vi() {
|
|
|
3772
4016
|
O.instances[e].connect();
|
|
3773
4017
|
}
|
|
3774
4018
|
static getClientFeatures() {
|
|
3775
|
-
return He(
|
|
4019
|
+
return He(Be({ ws: C.Transports.ws }, function(e) {
|
|
3776
4020
|
return e.isSupported({});
|
|
3777
4021
|
}));
|
|
3778
4022
|
}
|
|
3779
4023
|
constructor(e, t) {
|
|
3780
|
-
|
|
4024
|
+
Pi(e), ui(t), this.key = e, this.options = t, this.config = rt(this.options, this), this.channels = X.createChannels(), this.global_emitter = new $(), this.sessionID = C.randomInt(1e9), this.timeline = new oi(this.key, this.sessionID, {
|
|
3781
4025
|
cluster: this.config.cluster,
|
|
3782
4026
|
features: O.getClientFeatures(),
|
|
3783
4027
|
params: this.config.timelineParams || {},
|
|
3784
4028
|
limit: 50,
|
|
3785
|
-
level:
|
|
3786
|
-
version:
|
|
4029
|
+
level: le.INFO,
|
|
4030
|
+
version: T.VERSION
|
|
3787
4031
|
}), this.config.enableStats && (this.timelineSender = X.createTimelineSender(this.timeline, {
|
|
3788
4032
|
host: this.config.statsHost,
|
|
3789
|
-
path: "/timeline/v2/" +
|
|
4033
|
+
path: "/timeline/v2/" + C.TimelineTransport.name
|
|
3790
4034
|
}));
|
|
3791
|
-
var r = (s) =>
|
|
4035
|
+
var r = (s) => C.getDefaultStrategy(this.config, s, hi);
|
|
3792
4036
|
this.connection = X.createConnectionManager(this.key, {
|
|
3793
4037
|
getStrategy: r,
|
|
3794
4038
|
timeline: this.timeline,
|
|
@@ -3799,23 +4043,23 @@ function Vi() {
|
|
|
3799
4043
|
}), this.connection.bind("connected", () => {
|
|
3800
4044
|
this.subscribeAll(), this.timelineSender && this.timelineSender.send(this.connection.isUsingTLS());
|
|
3801
4045
|
}), this.connection.bind("message", (s) => {
|
|
3802
|
-
var
|
|
4046
|
+
var c = s.event, l = c.indexOf("pusher_internal:") === 0;
|
|
3803
4047
|
if (s.channel) {
|
|
3804
|
-
var
|
|
3805
|
-
|
|
4048
|
+
var f = this.channel(s.channel);
|
|
4049
|
+
f && f.handleEvent(s);
|
|
3806
4050
|
}
|
|
3807
|
-
|
|
4051
|
+
l || this.global_emitter.emit(s.event, s.data);
|
|
3808
4052
|
}), this.connection.bind("connecting", () => {
|
|
3809
4053
|
this.channels.disconnect();
|
|
3810
4054
|
}), this.connection.bind("disconnected", () => {
|
|
3811
4055
|
this.channels.disconnect();
|
|
3812
4056
|
}), this.connection.bind("error", (s) => {
|
|
3813
|
-
|
|
3814
|
-
}), O.instances.push(this), this.timeline.info({ instances: O.instances.length }), this.user = new
|
|
4057
|
+
L.warn(s);
|
|
4058
|
+
}), O.instances.push(this), this.timeline.info({ instances: O.instances.length }), this.user = new Ai(this), O.isReady && this.connect();
|
|
3815
4059
|
}
|
|
3816
4060
|
switchCluster(e) {
|
|
3817
4061
|
const { appKey: t, cluster: r } = e;
|
|
3818
|
-
this.key = t, this.options = Object.assign(Object.assign({}, this.options), { cluster: r }), this.config =
|
|
4062
|
+
this.key = t, this.options = Object.assign(Object.assign({}, this.options), { cluster: r }), this.config = rt(this.options, this), this.connection.switchCluster(this.key);
|
|
3819
4063
|
}
|
|
3820
4064
|
channel(e) {
|
|
3821
4065
|
return this.channels.find(e);
|
|
@@ -3826,7 +4070,7 @@ function Vi() {
|
|
|
3826
4070
|
connect() {
|
|
3827
4071
|
if (this.connection.connect(), this.timelineSender && !this.timelineSenderTimer) {
|
|
3828
4072
|
var e = this.connection.isUsingTLS(), t = this.timelineSender;
|
|
3829
|
-
this.timelineSenderTimer = new
|
|
4073
|
+
this.timelineSenderTimer = new zt(6e4, function() {
|
|
3830
4074
|
t.send(e);
|
|
3831
4075
|
});
|
|
3832
4076
|
}
|
|
@@ -3872,21 +4116,21 @@ function Vi() {
|
|
|
3872
4116
|
this.user.signin();
|
|
3873
4117
|
}
|
|
3874
4118
|
}
|
|
3875
|
-
O.instances = [], O.isReady = !1, O.logToConsole = !1, O.Runtime =
|
|
3876
|
-
const
|
|
3877
|
-
function
|
|
4119
|
+
O.instances = [], O.isReady = !1, O.logToConsole = !1, O.Runtime = C, O.ScriptReceivers = C.ScriptReceivers, O.DependenciesReceivers = C.DependenciesReceivers, O.auth_callbacks = C.auth_callbacks;
|
|
4120
|
+
const ue = O;
|
|
4121
|
+
function Pi(n) {
|
|
3878
4122
|
if (n == null)
|
|
3879
4123
|
throw "You must pass your app key when you instantiate Pusher.";
|
|
3880
4124
|
}
|
|
3881
|
-
|
|
4125
|
+
C.setup(O);
|
|
3882
4126
|
}
|
|
3883
4127
|
/******/
|
|
3884
|
-
},
|
|
3885
|
-
function h(
|
|
3886
|
-
var
|
|
3887
|
-
if (
|
|
3888
|
-
return
|
|
3889
|
-
var
|
|
4128
|
+
}, a = {};
|
|
4129
|
+
function h(m) {
|
|
4130
|
+
var g = a[m];
|
|
4131
|
+
if (g !== void 0)
|
|
4132
|
+
return g.exports;
|
|
4133
|
+
var y = a[m] = {
|
|
3890
4134
|
/******/
|
|
3891
4135
|
// no module.id needed
|
|
3892
4136
|
/******/
|
|
@@ -3895,30 +4139,31 @@ function Vi() {
|
|
|
3895
4139
|
exports: {}
|
|
3896
4140
|
/******/
|
|
3897
4141
|
};
|
|
3898
|
-
return o[
|
|
4142
|
+
return o[m].call(y.exports, y, y.exports, h), y.exports;
|
|
3899
4143
|
}
|
|
3900
|
-
h.d = (
|
|
3901
|
-
for (var
|
|
3902
|
-
h.o(
|
|
3903
|
-
}, h.o = (
|
|
3904
|
-
var
|
|
3905
|
-
return
|
|
4144
|
+
h.d = (m, g) => {
|
|
4145
|
+
for (var y in g)
|
|
4146
|
+
h.o(g, y) && !h.o(m, y) && Object.defineProperty(m, y, { enumerable: !0, get: g[y] });
|
|
4147
|
+
}, h.o = (m, g) => Object.prototype.hasOwnProperty.call(m, g);
|
|
4148
|
+
var u = h(721);
|
|
4149
|
+
return u;
|
|
3906
4150
|
})()
|
|
3907
4151
|
));
|
|
3908
4152
|
})(Ae)), Ae.exports;
|
|
3909
4153
|
}
|
|
3910
|
-
var
|
|
3911
|
-
const
|
|
4154
|
+
var Yi = Gi();
|
|
4155
|
+
const Qi = /* @__PURE__ */ Vi(Yi), Pe = "/vendor/sendity-client/tailwind.css", Ki = {
|
|
3912
4156
|
labels: {
|
|
3913
4157
|
email: "Email",
|
|
3914
4158
|
whatsapp: "WhatsApp"
|
|
3915
4159
|
},
|
|
3916
4160
|
ui: {
|
|
3917
|
-
sendCodePrompt: "Send this code to
|
|
3918
|
-
successGreeting: "(Name)
|
|
4161
|
+
sendCodePrompt: "Send this code to continue",
|
|
4162
|
+
successGreeting: "Hello, (Name)",
|
|
3919
4163
|
by: "by",
|
|
3920
|
-
|
|
3921
|
-
|
|
4164
|
+
toPrefix: "to",
|
|
4165
|
+
footerWaiting: "Ready to receive your code…",
|
|
4166
|
+
footerWaitingUntil: "Ready to receive your code…"
|
|
3922
4167
|
},
|
|
3923
4168
|
templates: {
|
|
3924
4169
|
emailSubject: "Sign me into (Host) with this code: (Code)",
|
|
@@ -3927,17 +4172,18 @@ const Gi = /* @__PURE__ */ Xi(Ji), Pe = "/vendor/sendity-client/tailwind.css", K
|
|
|
3927
4172
|
Code: (Code)`,
|
|
3928
4173
|
whatsappText: "Sign me into (Host) with this code: (Code)"
|
|
3929
4174
|
}
|
|
3930
|
-
},
|
|
4175
|
+
}, Zi = {
|
|
3931
4176
|
labels: {
|
|
3932
4177
|
email: "E-Mail",
|
|
3933
4178
|
whatsapp: "WhatsApp"
|
|
3934
4179
|
},
|
|
3935
4180
|
ui: {
|
|
3936
|
-
sendCodePrompt: "Sende diesen Code, um
|
|
4181
|
+
sendCodePrompt: "Sende diesen Code, um fortzufahren",
|
|
3937
4182
|
successGreeting: "(Name), du bist drin!",
|
|
3938
4183
|
by: "per",
|
|
3939
|
-
|
|
3940
|
-
|
|
4184
|
+
toPrefix: "an",
|
|
4185
|
+
footerWaiting: "Bereit zum Empfangen Deines Codes …",
|
|
4186
|
+
footerWaitingUntil: "Bereit zum Empfangen Deines Codes …"
|
|
3941
4187
|
},
|
|
3942
4188
|
templates: {
|
|
3943
4189
|
emailSubject: "Melde mich bei (Host) mit diesem Code an: (Code)",
|
|
@@ -3946,17 +4192,18 @@ Code: (Code)`,
|
|
|
3946
4192
|
Code: (Code)`,
|
|
3947
4193
|
whatsappText: "Melde mich bei (Host) mit diesem Code an: (Code)"
|
|
3948
4194
|
}
|
|
3949
|
-
},
|
|
4195
|
+
}, er = {
|
|
3950
4196
|
labels: {
|
|
3951
4197
|
email: "E-mail",
|
|
3952
4198
|
whatsapp: "WhatsApp"
|
|
3953
4199
|
},
|
|
3954
4200
|
ui: {
|
|
3955
|
-
sendCodePrompt: "Envoyez ce code pour
|
|
4201
|
+
sendCodePrompt: "Envoyez ce code pour continuer",
|
|
3956
4202
|
successGreeting: "(Name), vous êtes connecté !",
|
|
3957
4203
|
by: "par",
|
|
3958
|
-
|
|
3959
|
-
|
|
4204
|
+
toPrefix: "à",
|
|
4205
|
+
footerWaiting: "Prêt à recevoir votre code…",
|
|
4206
|
+
footerWaitingUntil: "Prêt à recevoir votre code…"
|
|
3960
4207
|
},
|
|
3961
4208
|
templates: {
|
|
3962
4209
|
emailSubject: "Connectez-moi à (Host) avec ce code : (Code)",
|
|
@@ -3966,75 +4213,72 @@ Code : (Code)`,
|
|
|
3966
4213
|
whatsappText: "Connectez-moi à (Host) avec ce code : (Code)"
|
|
3967
4214
|
}
|
|
3968
4215
|
};
|
|
3969
|
-
function
|
|
3970
|
-
switch (
|
|
4216
|
+
function Z(v) {
|
|
4217
|
+
switch (v) {
|
|
3971
4218
|
case "de":
|
|
3972
|
-
return
|
|
4219
|
+
return Zi;
|
|
3973
4220
|
case "fr":
|
|
3974
|
-
return
|
|
4221
|
+
return er;
|
|
3975
4222
|
default:
|
|
3976
4223
|
return Ki;
|
|
3977
4224
|
}
|
|
3978
4225
|
}
|
|
3979
|
-
const
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
`, vt = '<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>', je = "sendityAuthRequest", Zi = "https://sendity.io/api", er = ["mailto:verify@sendity.io"], tr = 600 * 1e3, nr = 5e3, ir = 15e3, Re = 2e3, rr = 0;
|
|
3984
|
-
function Ne(g, i) {
|
|
3985
|
-
return `sendity:auth-request:${encodeURIComponent(g)}:${encodeURIComponent(i)}`;
|
|
4226
|
+
const vt = `<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>
|
|
4227
|
+
`, yt = '<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>', Ne = "sendityAuthRequest", tr = "https://sendity.io/api", nr = ["mailto:verify@sendity.io"], ir = 600 * 1e3, rr = 5e3, sr = 15e3, Le = 2e3, Re = 220, At = 0;
|
|
4228
|
+
function ze(v, i) {
|
|
4229
|
+
return `sendity:auth-request:${encodeURIComponent(v)}:${encodeURIComponent(i)}`;
|
|
3986
4230
|
}
|
|
3987
|
-
function bt(
|
|
3988
|
-
|
|
3989
|
-
const h =
|
|
3990
|
-
if (!
|
|
4231
|
+
function bt(v, i, o, a = Date.now()) {
|
|
4232
|
+
v.removeItem(Ne);
|
|
4233
|
+
const h = ze(i, o), u = v.getItem(h);
|
|
4234
|
+
if (!u) return null;
|
|
3991
4235
|
try {
|
|
3992
|
-
const
|
|
3993
|
-
if (typeof
|
|
4236
|
+
const m = JSON.parse(u);
|
|
4237
|
+
if (typeof m.id != "string" || typeof m.clientSecret != "string" || typeof m.createdAt != "number")
|
|
3994
4238
|
throw new Error("invalid stored auth request");
|
|
3995
|
-
return
|
|
4239
|
+
return a - m.createdAt >= ir ? (v.removeItem(h), null) : { id: m.id, clientSecret: m.clientSecret };
|
|
3996
4240
|
} catch {
|
|
3997
|
-
return
|
|
4241
|
+
return v.removeItem(h), null;
|
|
3998
4242
|
}
|
|
3999
4243
|
}
|
|
4000
|
-
function
|
|
4001
|
-
|
|
4244
|
+
function or(v, i, o, a, h = Date.now()) {
|
|
4245
|
+
v.setItem(ze(i, o), JSON.stringify({ ...a, createdAt: h }));
|
|
4002
4246
|
}
|
|
4003
|
-
function
|
|
4004
|
-
|
|
4247
|
+
function wt(v, i, o) {
|
|
4248
|
+
v.removeItem(ze(i, o)), v.removeItem(Ne);
|
|
4005
4249
|
}
|
|
4006
|
-
function
|
|
4007
|
-
return window.localStorage.removeItem(
|
|
4250
|
+
function Ie() {
|
|
4251
|
+
return window.localStorage.removeItem(Ne), window.sessionStorage;
|
|
4008
4252
|
}
|
|
4009
|
-
function
|
|
4010
|
-
return
|
|
4253
|
+
function ar(v, i = window.location.origin) {
|
|
4254
|
+
return v.filter((o) => cr(o, i));
|
|
4011
4255
|
}
|
|
4012
|
-
function
|
|
4256
|
+
function cr(v, i) {
|
|
4013
4257
|
try {
|
|
4014
|
-
const o = new URL(
|
|
4258
|
+
const o = new URL(v, i);
|
|
4015
4259
|
return ["http:", "https:", "mailto:", "whatsapp:"].includes(o.protocol);
|
|
4016
4260
|
} catch {
|
|
4017
4261
|
return !1;
|
|
4018
4262
|
}
|
|
4019
4263
|
}
|
|
4020
|
-
function
|
|
4021
|
-
return
|
|
4264
|
+
function hr(v, i, o) {
|
|
4265
|
+
return v === "push" ? { start: !1, delayMs: 0 } : v === "polling" || !i || !o ? { start: !0, delayMs: 0 } : { start: !0, delayMs: At };
|
|
4022
4266
|
}
|
|
4023
|
-
const
|
|
4267
|
+
const me = class me extends HTMLElement {
|
|
4024
4268
|
constructor() {
|
|
4025
|
-
super(), this.pollTimer = null, this.fallbackPollTimer = null, this.authenticatedEventTimer = null, this.codeContainerEl = null, this.codeEl = null, this.promptEl = null, this.successEl = null, this.spinnerEl = null, this.verifiersEl = null, this.footerEl = null, this.footerBrandEl = null, this.footerStatusEl = null, this.footerMessageEl = null, this.footerObserver = null, this.footerWaitTimer = null, this.currentConfig = null, this.destroyed = !1, this.lastCode = void 0, this.echo = null, this.authenticated = !1;
|
|
4269
|
+
super(), this.pollTimer = null, this.fallbackPollTimer = null, this.authenticatedEventTimer = null, this.codeContainerEl = null, this.codeEl = null, this.promptEl = null, this.successEl = null, this.spinnerEl = null, this.verifiersEl = null, this.footerEl = null, this.footerBrandEl = null, this.footerStatusEl = null, this.footerMessageEl = null, this.footerTimerEl = null, this.footerObserver = null, this.footerWaitTimer = null, this.footerTransitionTimer = null, this.successTransitionTimer = null, this.timerInterval = null, this.currentConfig = null, this.destroyed = !1, this.lastCode = void 0, this.echo = null, this.authenticated = !1;
|
|
4026
4270
|
const i = this.attachShadow({ mode: "open" });
|
|
4027
4271
|
this.injectTailwind(i);
|
|
4028
4272
|
const o = document.createElement("div");
|
|
4029
|
-
o.innerHTML =
|
|
4030
|
-
const
|
|
4031
|
-
|
|
4273
|
+
o.innerHTML = ft;
|
|
4274
|
+
const a = o.querySelector("template"), h = a ? a.content.cloneNode(!0) : document.createRange().createContextualFragment(ft), u = document.createElement("style");
|
|
4275
|
+
u.textContent = Mi, i.appendChild(u), i.appendChild(h);
|
|
4032
4276
|
}
|
|
4033
4277
|
static get observedAttributes() {
|
|
4034
4278
|
return ["server-url", "public-key", "verify-urls", "lang", "transport", "hide-footer", "footer", "authenticated-event-delay-ms"];
|
|
4035
4279
|
}
|
|
4036
4280
|
connectedCallback() {
|
|
4037
|
-
this.codeContainerEl = this.shadowRoot?.querySelector(".code"), this.codeEl = this.shadowRoot?.querySelector(".formatted-code"), this.promptEl = this.shadowRoot?.querySelector(".prompt"), this.successEl = this.shadowRoot?.querySelector(".success"), this.spinnerEl = this.shadowRoot?.querySelector(".spinner"), this.verifiersEl = this.shadowRoot?.querySelector(".verifiers"), this.footerEl = this.shadowRoot?.querySelector(".sendity-footer"), this.footerBrandEl = this.shadowRoot?.querySelector(".footer-brand"), this.footerStatusEl = this.shadowRoot?.querySelector(".footer-status"), this.footerMessageEl = this.shadowRoot?.querySelector(".footer-message");
|
|
4281
|
+
this.codeContainerEl = this.shadowRoot?.querySelector(".code"), this.codeEl = this.shadowRoot?.querySelector(".formatted-code"), this.promptEl = this.shadowRoot?.querySelector(".prompt"), this.successEl = this.shadowRoot?.querySelector(".success"), this.spinnerEl = this.shadowRoot?.querySelector(".spinner"), this.verifiersEl = this.shadowRoot?.querySelector(".verifiers"), this.footerEl = this.shadowRoot?.querySelector(".sendity-footer"), this.footerBrandEl = this.shadowRoot?.querySelector(".footer-brand"), this.footerStatusEl = this.shadowRoot?.querySelector(".footer-status"), this.footerMessageEl = this.shadowRoot?.querySelector(".footer-message"), this.footerTimerEl = this.shadowRoot?.querySelector(".footer-timer");
|
|
4038
4282
|
try {
|
|
4039
4283
|
this.currentConfig = this.resolveConfig();
|
|
4040
4284
|
} catch (i) {
|
|
@@ -4060,7 +4304,7 @@ const ge = class ge extends HTMLElement {
|
|
|
4060
4304
|
});
|
|
4061
4305
|
}
|
|
4062
4306
|
stop() {
|
|
4063
|
-
this.pollTimer !== null && (clearInterval(this.pollTimer), this.pollTimer = null), this.fallbackPollTimer !== null && (clearTimeout(this.fallbackPollTimer), this.fallbackPollTimer = null), this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.authenticatedEventTimer !== null && (clearTimeout(this.authenticatedEventTimer), this.authenticatedEventTimer = null), this.footerObserver?.disconnect(), this.footerObserver = null, this.echo && this.activeAuthRequestId && this.echo.leave(`sendity.auth-requests.${this.activeAuthRequestId}`), this.echo?.disconnect(), this.echo = null;
|
|
4307
|
+
this.pollTimer !== null && (clearInterval(this.pollTimer), this.pollTimer = null), this.fallbackPollTimer !== null && (clearTimeout(this.fallbackPollTimer), this.fallbackPollTimer = null), this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.authenticatedEventTimer !== null && (clearTimeout(this.authenticatedEventTimer), this.authenticatedEventTimer = null), this.footerTransitionTimer !== null && (clearTimeout(this.footerTransitionTimer), this.footerTransitionTimer = null), this.successTransitionTimer !== null && (clearTimeout(this.successTransitionTimer), this.successTransitionTimer = null), this.stopCountdown(), this.footerObserver?.disconnect(), this.footerObserver = null, this.echo && this.activeAuthRequestId && this.echo.leave(`sendity.auth-requests.${this.activeAuthRequestId}`), this.echo?.disconnect(), this.echo = null;
|
|
4064
4308
|
}
|
|
4065
4309
|
// Inject Tailwind CSS into the Shadow DOM so Tailwind utility classes
|
|
4066
4310
|
// used in sendity.html work within the component. We cache the processed
|
|
@@ -4069,24 +4313,24 @@ const ge = class ge extends HTMLElement {
|
|
|
4069
4313
|
injectTailwind(i) {
|
|
4070
4314
|
const o = document.createElement("style");
|
|
4071
4315
|
o.setAttribute("data-sendity-tw", ""), i.appendChild(o);
|
|
4072
|
-
const
|
|
4073
|
-
if (
|
|
4074
|
-
if (
|
|
4075
|
-
o.textContent =
|
|
4316
|
+
const a = this.constructor;
|
|
4317
|
+
if (a.tailwindCssText !== null) {
|
|
4318
|
+
if (a.tailwindCssText)
|
|
4319
|
+
o.textContent = a.tailwindCssText;
|
|
4076
4320
|
else {
|
|
4077
4321
|
const h = document.createElement("link");
|
|
4078
4322
|
h.rel = "stylesheet", h.href = Pe, i.insertBefore(h, o);
|
|
4079
4323
|
}
|
|
4080
4324
|
return;
|
|
4081
4325
|
}
|
|
4082
|
-
|
|
4083
|
-
|
|
4326
|
+
a.tailwindLoading || (a.tailwindLoading = fetch(Pe).then((h) => h.ok ? h.text() : Promise.reject(new Error(`HTTP ${h.status}`))).then((h) => {
|
|
4327
|
+
a.tailwindCssText = h;
|
|
4084
4328
|
}).catch((h) => {
|
|
4085
|
-
console.warn("[sendity-auth] Failed to load Tailwind CSS for Shadow DOM", h),
|
|
4086
|
-
})),
|
|
4329
|
+
console.warn("[sendity-auth] Failed to load Tailwind CSS for Shadow DOM", h), a.tailwindCssText = "";
|
|
4330
|
+
})), a.tailwindLoading.then(() => {
|
|
4087
4331
|
if (!this.destroyed && i)
|
|
4088
|
-
if (
|
|
4089
|
-
o.textContent =
|
|
4332
|
+
if (a.tailwindCssText)
|
|
4333
|
+
o.textContent = a.tailwindCssText;
|
|
4090
4334
|
else {
|
|
4091
4335
|
const h = document.createElement("link");
|
|
4092
4336
|
h.rel = "stylesheet", h.href = Pe, i.insertBefore(h, o);
|
|
@@ -4099,7 +4343,7 @@ const ge = class ge extends HTMLElement {
|
|
|
4099
4343
|
this.footerEl.hidden = !0, this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.footerObserver?.disconnect(), this.footerObserver = null;
|
|
4100
4344
|
return;
|
|
4101
4345
|
}
|
|
4102
|
-
this.footerEl.hidden = !1, this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.setAttribute("hidden", ""), this.observeFooterVisibility();
|
|
4346
|
+
this.footerEl.hidden = !1, this.footerEl.classList.remove("footer--waiting", "footer--transitioning", "footer--leaving"), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.setAttribute("hidden", ""), this.observeFooterVisibility();
|
|
4103
4347
|
}
|
|
4104
4348
|
}
|
|
4105
4349
|
isFooterHidden() {
|
|
@@ -4108,16 +4352,39 @@ const ge = class ge extends HTMLElement {
|
|
|
4108
4352
|
}
|
|
4109
4353
|
observeFooterVisibility() {
|
|
4110
4354
|
!this.footerEl || this.footerObserver || !("IntersectionObserver" in window) || (this.footerObserver = new IntersectionObserver((i) => {
|
|
4111
|
-
i.some((
|
|
4355
|
+
i.some((a) => a.isIntersecting) ? this.scheduleFooterWaitingState() : this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null);
|
|
4112
4356
|
}), this.footerObserver.observe(this));
|
|
4113
4357
|
}
|
|
4114
4358
|
scheduleFooterWaitingState() {
|
|
4115
4359
|
this.footerWaitTimer !== null || this.isFooterHidden() || (this.footerWaitTimer = window.setTimeout(() => {
|
|
4116
4360
|
this.footerWaitTimer = null, this.showFooterWaitingState();
|
|
4117
|
-
},
|
|
4361
|
+
}, sr));
|
|
4118
4362
|
}
|
|
4119
4363
|
showFooterWaitingState() {
|
|
4120
|
-
this.isFooterHidden() || (this.
|
|
4364
|
+
this.isFooterHidden() || (this.currentConfig && this.footerMessageEl && (this.footerMessageEl.textContent = this.waitingFooterMessage()), 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(() => {
|
|
4365
|
+
this.footerTransitionTimer = null, this.footerEl?.classList.remove("footer--transitioning"), this.footerBrandEl?.setAttribute("hidden", "");
|
|
4366
|
+
}, Re), this.startCountdown());
|
|
4367
|
+
}
|
|
4368
|
+
startCountdown() {
|
|
4369
|
+
if (this.timerInterval !== null || !this.footerTimerEl) return;
|
|
4370
|
+
if (!this.activeAuthRequestExpiresAt) {
|
|
4371
|
+
this.footerTimerEl.setAttribute("hidden", "");
|
|
4372
|
+
return;
|
|
4373
|
+
}
|
|
4374
|
+
const i = () => {
|
|
4375
|
+
if (!this.footerTimerEl || !this.activeAuthRequestExpiresAt) return;
|
|
4376
|
+
const o = new Date(this.activeAuthRequestExpiresAt).getTime();
|
|
4377
|
+
if (Number.isNaN(o)) {
|
|
4378
|
+
this.footerTimerEl.setAttribute("hidden", "");
|
|
4379
|
+
return;
|
|
4380
|
+
}
|
|
4381
|
+
const a = Math.max(0, Math.floor((o - Date.now()) / 1e3)), h = Math.floor(a / 60), u = String(a % 60).padStart(2, "0");
|
|
4382
|
+
this.footerTimerEl.textContent = `${h}:${u}`, this.footerTimerEl.classList.toggle("low", a > 0 && a <= 60), this.footerTimerEl.removeAttribute("hidden"), a <= 0 && this.timerInterval !== null && (clearInterval(this.timerInterval), this.timerInterval = null);
|
|
4383
|
+
};
|
|
4384
|
+
i(), this.timerInterval = window.setInterval(i, 1e3);
|
|
4385
|
+
}
|
|
4386
|
+
stopCountdown() {
|
|
4387
|
+
this.timerInterval !== null && (clearInterval(this.timerInterval), this.timerInterval = null);
|
|
4121
4388
|
}
|
|
4122
4389
|
handleInitialError(i) {
|
|
4123
4390
|
console.error("[sendity-auth] Unable to initialize authentication", i), this.renderError("Unable to initialize authentication, see console for details"), this.dispatchEvent(
|
|
@@ -4132,87 +4399,89 @@ const ge = class ge extends HTMLElement {
|
|
|
4132
4399
|
const i = {
|
|
4133
4400
|
lang: navigator.language?.startsWith("de") ? "de" : navigator.language?.startsWith("fr") ? "fr" : "en",
|
|
4134
4401
|
transport: "auto"
|
|
4135
|
-
}, o = (
|
|
4402
|
+
}, o = (R) => this.getAttribute(R) ?? void 0, a = o("server-url")?.trim() || tr, h = o("public-key")?.trim();
|
|
4136
4403
|
if (!h)
|
|
4137
4404
|
throw new Error("Missing required sendity-auth attribute: public-key");
|
|
4138
|
-
let
|
|
4139
|
-
const
|
|
4140
|
-
if (
|
|
4405
|
+
let u = [...nr];
|
|
4406
|
+
const m = o("verify-urls");
|
|
4407
|
+
if (m)
|
|
4141
4408
|
try {
|
|
4142
|
-
if (
|
|
4143
|
-
|
|
4409
|
+
if (u = JSON.parse(m), !Array.isArray(u)) throw new Error("verify-urls not array");
|
|
4410
|
+
u = u.map(String);
|
|
4144
4411
|
} catch {
|
|
4145
|
-
|
|
4412
|
+
u = m.split(",").map((R) => R.trim()).filter(Boolean);
|
|
4146
4413
|
}
|
|
4147
|
-
if (
|
|
4414
|
+
if (u = ar(u), u.length === 0)
|
|
4148
4415
|
throw new Error("Missing required sendity-auth attribute: verify-urls");
|
|
4149
|
-
let
|
|
4150
|
-
|
|
4151
|
-
const
|
|
4152
|
-
return { serverUrl:
|
|
4416
|
+
let g = o("lang") || i.lang;
|
|
4417
|
+
g !== "en" && g !== "de" && g !== "fr" && (g = i.lang);
|
|
4418
|
+
const y = o("transport"), x = y === "push" || y === "polling" ? y : i.transport, w = this.parseAuthenticatedEventDelayMs(o("authenticated-event-delay-ms"));
|
|
4419
|
+
return { serverUrl: a, publicKey: h, verifyUrls: u, lang: g, transport: x, authenticatedEventDelayMs: w };
|
|
4153
4420
|
}
|
|
4154
4421
|
parseAuthenticatedEventDelayMs(i) {
|
|
4155
|
-
if (i === void 0 || i.trim() === "") return
|
|
4422
|
+
if (i === void 0 || i.trim() === "") return Le;
|
|
4156
4423
|
const o = Number(i);
|
|
4157
|
-
return !Number.isFinite(o) || o < 0 ?
|
|
4424
|
+
return !Number.isFinite(o) || o < 0 ? Le : Math.round(o);
|
|
4425
|
+
}
|
|
4426
|
+
async createAuthRequest(i, o, a) {
|
|
4427
|
+
const h = await fetch(this.joinUrl(i, "/auth-requests"), {
|
|
4428
|
+
method: "POST",
|
|
4429
|
+
mode: "cors",
|
|
4430
|
+
headers: {
|
|
4431
|
+
"Content-Type": "application/json",
|
|
4432
|
+
Accept: "application/json"
|
|
4433
|
+
},
|
|
4434
|
+
body: JSON.stringify({ public_key: o })
|
|
4435
|
+
});
|
|
4436
|
+
if (!h.ok) throw new Error(`Auth request creation failed: ${h.status}`);
|
|
4437
|
+
const u = await h.json();
|
|
4438
|
+
if (!u.id) throw new Error("Missing id from server response");
|
|
4439
|
+
const m = this.extractClientSecret(u);
|
|
4440
|
+
if (!m) throw new Error("Missing client secret from server response");
|
|
4441
|
+
return or(a, i, o, { id: String(u.id), clientSecret: m }), this.activeAuthRequestId = String(u.id), this.activeAuthRequestSecret = m, this.updateActiveAuthRequestExpiry(u), this.updateCode(u.formattedCode ?? u.code), this.dispatchPublicEvent("sendity:challenge-created", {
|
|
4442
|
+
verificationId: String(u.id),
|
|
4443
|
+
code: u.formattedCode ?? u.code ?? "",
|
|
4444
|
+
channel: this.primaryChannel(this.currentConfig?.verifyUrls ?? [])
|
|
4445
|
+
}), u;
|
|
4158
4446
|
}
|
|
4159
4447
|
async step() {
|
|
4160
4448
|
this.currentConfig || (this.currentConfig = this.resolveConfig());
|
|
4161
|
-
const { serverUrl: i, publicKey: o } = this.currentConfig,
|
|
4162
|
-
if (!
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
"Content-Type": "application/json",
|
|
4168
|
-
Accept: "application/json"
|
|
4169
|
-
},
|
|
4170
|
-
body: JSON.stringify({ public_key: o })
|
|
4171
|
-
});
|
|
4172
|
-
if (!k.ok) throw new Error(`Auth request creation failed: ${k.status}`);
|
|
4173
|
-
const S = await k.json();
|
|
4174
|
-
if (!S.id) throw new Error("Missing id from server response");
|
|
4175
|
-
const L = this.extractClientSecret(S);
|
|
4176
|
-
if (!L) throw new Error("Missing client secret from server response");
|
|
4177
|
-
return sr(c, i, o, { id: String(S.id), clientSecret: L }), this.activeAuthRequestId = String(S.id), this.activeAuthRequestSecret = L, this.updateActiveAuthRequestExpiry(S), this.updateCode(S.formattedCode ?? S.code), this.dispatchPublicEvent("sendity:challenge-created", {
|
|
4178
|
-
verificationId: String(S.id),
|
|
4179
|
-
code: S.formattedCode ?? S.code ?? "",
|
|
4180
|
-
channel: this.primaryChannel(this.currentConfig.verifyUrls)
|
|
4181
|
-
}), S;
|
|
4182
|
-
}
|
|
4183
|
-
this.activeAuthRequestId = C, this.activeAuthRequestSecret = h.clientSecret;
|
|
4184
|
-
const y = await fetch(
|
|
4185
|
-
this.authRequestStatusUrl(i, C),
|
|
4449
|
+
const { serverUrl: i, publicKey: o } = this.currentConfig, a = Ie(), h = bt(a, i, o), u = h?.id;
|
|
4450
|
+
if (!u)
|
|
4451
|
+
return await this.createAuthRequest(i, o, a);
|
|
4452
|
+
this.activeAuthRequestId = u, this.activeAuthRequestSecret = h.clientSecret;
|
|
4453
|
+
const m = await fetch(
|
|
4454
|
+
this.authRequestStatusUrl(i, u),
|
|
4186
4455
|
this.authRequestStatusInit(h.clientSecret)
|
|
4187
4456
|
);
|
|
4188
|
-
if (
|
|
4189
|
-
return
|
|
4190
|
-
const
|
|
4191
|
-
if (
|
|
4192
|
-
return this.handleAuthenticated(
|
|
4193
|
-
|
|
4194
|
-
const
|
|
4195
|
-
return
|
|
4457
|
+
if (m.status !== 200)
|
|
4458
|
+
return wt(a, i, o), await this.step();
|
|
4459
|
+
const g = await m.json();
|
|
4460
|
+
if (g.status === "verified")
|
|
4461
|
+
return this.handleAuthenticated(g), g;
|
|
4462
|
+
g.id && (this.activeAuthRequestId = String(g.id));
|
|
4463
|
+
const y = this.extractClientSecret(g);
|
|
4464
|
+
return y && (this.activeAuthRequestSecret = y), this.updateActiveAuthRequestExpiry(g), this.updateCode(g.formattedCode ?? g.code), g;
|
|
4196
4465
|
}
|
|
4197
4466
|
configureRealtime(i) {
|
|
4198
4467
|
this.currentConfig || (this.currentConfig = this.resolveConfig());
|
|
4199
|
-
const { transport: o } = this.currentConfig,
|
|
4200
|
-
let
|
|
4201
|
-
o !== "polling" && h &&
|
|
4202
|
-
const
|
|
4203
|
-
|
|
4468
|
+
const { transport: o } = this.currentConfig, a = i?.broadcasting, h = !!(a?.key && a.channel && a.authEndpoint);
|
|
4469
|
+
let u = !1;
|
|
4470
|
+
o !== "polling" && h && a ? u = this.subscribeToBroadcasting(a) : o === "push" && console.warn("[sendity-auth] Push transport requested, but server response does not contain broadcasting metadata");
|
|
4471
|
+
const m = hr(o, h, u);
|
|
4472
|
+
m.start && this.startPolling(m.delayMs);
|
|
4204
4473
|
}
|
|
4205
4474
|
subscribeToBroadcasting(i) {
|
|
4206
4475
|
if (!this.currentConfig || !i.key || !i.channel || !i.authEndpoint) return !1;
|
|
4207
4476
|
try {
|
|
4208
|
-
window.Pusher =
|
|
4209
|
-
const o = (i.scheme ?? "https") === "https",
|
|
4210
|
-
return this.echo = new
|
|
4477
|
+
window.Pusher = Qi;
|
|
4478
|
+
const o = (i.scheme ?? "https") === "https", a = i.port ?? (o ? 443 : 80);
|
|
4479
|
+
return this.echo = new Ji({
|
|
4211
4480
|
broadcaster: "reverb",
|
|
4212
4481
|
key: i.key,
|
|
4213
4482
|
wsHost: i.host ?? new URL(this.currentConfig.serverUrl).hostname,
|
|
4214
|
-
wsPort:
|
|
4215
|
-
wssPort:
|
|
4483
|
+
wsPort: a,
|
|
4484
|
+
wssPort: a,
|
|
4216
4485
|
wsPath: i.wsPath ?? "/ws",
|
|
4217
4486
|
forceTLS: o,
|
|
4218
4487
|
encrypted: o,
|
|
@@ -4221,21 +4490,24 @@ const ge = class ge extends HTMLElement {
|
|
|
4221
4490
|
auth: {
|
|
4222
4491
|
headers: {
|
|
4223
4492
|
Accept: "application/json"
|
|
4493
|
+
},
|
|
4494
|
+
params: {
|
|
4495
|
+
client_secret: this.activeAuthRequestSecret
|
|
4224
4496
|
}
|
|
4225
4497
|
}
|
|
4226
4498
|
}), this.echo.private(i.channel).listen(i.event ?? ".authenticated", (h) => {
|
|
4227
4499
|
this.handleAuthenticated(h);
|
|
4228
4500
|
}), !0;
|
|
4229
4501
|
} catch (o) {
|
|
4230
|
-
return console.warn("[sendity-auth] realtime subscription failed, falling back to polling if enabled", o), this.currentConfig.transport === "auto" && this.startPolling(
|
|
4502
|
+
return console.warn("[sendity-auth] realtime subscription failed, falling back to polling if enabled", o), this.currentConfig.transport === "auto" && this.startPolling(At), !1;
|
|
4231
4503
|
}
|
|
4232
4504
|
}
|
|
4233
4505
|
startPolling(i) {
|
|
4234
4506
|
if (this.pollTimer !== null || this.authenticated) return;
|
|
4235
4507
|
const o = () => {
|
|
4236
4508
|
this.pollTimer !== null || this.authenticated || this.destroyed || (this.pollTimer = window.setInterval(() => {
|
|
4237
|
-
this.step().catch((
|
|
4238
|
-
},
|
|
4509
|
+
this.step().catch((a) => console.warn("[sendity-auth] poll failed", a));
|
|
4510
|
+
}, rr));
|
|
4239
4511
|
};
|
|
4240
4512
|
i > 0 ? this.fallbackPollTimer = window.setTimeout(() => {
|
|
4241
4513
|
this.fallbackPollTimer = null, o();
|
|
@@ -4249,11 +4521,11 @@ const ge = class ge extends HTMLElement {
|
|
|
4249
4521
|
});
|
|
4250
4522
|
return;
|
|
4251
4523
|
}
|
|
4252
|
-
this.authenticated = !0, this.currentConfig &&
|
|
4253
|
-
const o = this.toPublicAuthenticatedDetail(i),
|
|
4524
|
+
this.authenticated = !0, this.currentConfig && wt(Ie(), this.currentConfig.serverUrl, this.currentConfig.publicKey), this.stopAuthTransports(), this.showSuccess(i);
|
|
4525
|
+
const o = this.toPublicAuthenticatedDetail(i), a = this.currentConfig?.authenticatedEventDelayMs ?? Le;
|
|
4254
4526
|
this.authenticatedEventTimer = window.setTimeout(() => {
|
|
4255
4527
|
this.authenticatedEventTimer = null, !this.destroyed && this.dispatchPublicEvent("sendity:authenticated", o);
|
|
4256
|
-
},
|
|
4528
|
+
}, a);
|
|
4257
4529
|
}
|
|
4258
4530
|
stopAuthTransports() {
|
|
4259
4531
|
this.pollTimer !== null && (clearInterval(this.pollTimer), this.pollTimer = null), this.fallbackPollTimer !== null && (clearTimeout(this.fallbackPollTimer), this.fallbackPollTimer = null), this.echo && this.activeAuthRequestId && this.echo.leave(`sendity.auth-requests.${this.activeAuthRequestId}`), this.echo?.disconnect(), this.echo = null;
|
|
@@ -4262,10 +4534,10 @@ const ge = class ge extends HTMLElement {
|
|
|
4262
4534
|
this.dispatchEvent(new CustomEvent(i, { bubbles: !0, composed: !0, detail: o }));
|
|
4263
4535
|
}
|
|
4264
4536
|
toPublicAuthenticatedDetail(i) {
|
|
4265
|
-
const o = String(i.auth_request_id ?? i.authRequestId ?? this.activeAuthRequestId ?? ""),
|
|
4537
|
+
const o = String(i.auth_request_id ?? i.authRequestId ?? this.activeAuthRequestId ?? ""), a = i.channel ?? this.primaryChannel(this.currentConfig?.verifyUrls ?? []), h = i.expires_at ?? i.expiresAt;
|
|
4266
4538
|
return {
|
|
4267
4539
|
sessionId: o,
|
|
4268
|
-
channel:
|
|
4540
|
+
channel: a,
|
|
4269
4541
|
...i.identifier ? { address: i.identifier } : {},
|
|
4270
4542
|
verificationId: o,
|
|
4271
4543
|
signedResult: String(i.authorization ?? ""),
|
|
@@ -4294,17 +4566,17 @@ const ge = class ge extends HTMLElement {
|
|
|
4294
4566
|
}
|
|
4295
4567
|
updateActiveAuthRequestExpiry(i) {
|
|
4296
4568
|
const o = i.expires_at ?? i.expiresAt;
|
|
4297
|
-
o && (this.activeAuthRequestExpiresAt = String(o)
|
|
4569
|
+
o && (this.activeAuthRequestExpiresAt = String(o));
|
|
4298
4570
|
}
|
|
4299
4571
|
waitingFooterMessage() {
|
|
4300
4572
|
if (!this.currentConfig) return "";
|
|
4301
|
-
const i =
|
|
4573
|
+
const i = Z(this.currentConfig.lang), o = this.formatExpiryTime(this.activeAuthRequestExpiresAt, this.currentConfig.lang);
|
|
4302
4574
|
return o ? i.ui.footerWaitingUntil.replace("(Time)", o) : i.ui.footerWaiting;
|
|
4303
4575
|
}
|
|
4304
4576
|
formatExpiryTime(i, o) {
|
|
4305
4577
|
if (!i) return null;
|
|
4306
|
-
const
|
|
4307
|
-
return Number.isNaN(
|
|
4578
|
+
const a = new Date(i);
|
|
4579
|
+
return Number.isNaN(a.getTime()) ? null : new Intl.DateTimeFormat(this.localeForLang(o), { timeStyle: "short" }).format(a);
|
|
4308
4580
|
}
|
|
4309
4581
|
localeForLang(i) {
|
|
4310
4582
|
switch (i) {
|
|
@@ -4316,27 +4588,20 @@ const ge = class ge extends HTMLElement {
|
|
|
4316
4588
|
return "en-US";
|
|
4317
4589
|
}
|
|
4318
4590
|
}
|
|
4319
|
-
updateCodeValidityDuration() {
|
|
4320
|
-
if (!this.codeContainerEl || !this.activeAuthRequestExpiresAt) return;
|
|
4321
|
-
const i = new Date(this.activeAuthRequestExpiresAt).getTime();
|
|
4322
|
-
if (Number.isNaN(i)) return;
|
|
4323
|
-
const o = Math.max(1, Math.round((i - Date.now()) / 1e3));
|
|
4324
|
-
this.codeContainerEl.style.setProperty("--sendity-code-validity-duration", `${o}s`);
|
|
4325
|
-
}
|
|
4326
4591
|
async fetchAuthorizationAfterAuthenticatedSignal() {
|
|
4327
4592
|
this.currentConfig || (this.currentConfig = this.resolveConfig());
|
|
4328
|
-
const i = bt(
|
|
4329
|
-
if (!o || !
|
|
4593
|
+
const i = bt(Ie(), this.currentConfig.serverUrl, this.currentConfig.publicKey), o = this.activeAuthRequestId ?? i?.id, a = this.activeAuthRequestSecret ?? i?.clientSecret;
|
|
4594
|
+
if (!o || !a)
|
|
4330
4595
|
throw new Error("Cannot fetch authorization without an active auth request id and client secret");
|
|
4331
4596
|
const h = await fetch(
|
|
4332
4597
|
this.authRequestStatusUrl(this.currentConfig.serverUrl, o),
|
|
4333
|
-
this.authRequestStatusInit(
|
|
4598
|
+
this.authRequestStatusInit(a)
|
|
4334
4599
|
);
|
|
4335
4600
|
if (!h.ok)
|
|
4336
4601
|
throw new Error(`Authorization fetch failed: ${h.status}`);
|
|
4337
|
-
const
|
|
4338
|
-
if (
|
|
4339
|
-
this.handleAuthenticated(
|
|
4602
|
+
const u = await h.json();
|
|
4603
|
+
if (u.status === "verified" && u.authorization) {
|
|
4604
|
+
this.handleAuthenticated(u);
|
|
4340
4605
|
return;
|
|
4341
4606
|
}
|
|
4342
4607
|
throw new Error("Verified auth request did not include authorization");
|
|
@@ -4344,12 +4609,12 @@ const ge = class ge extends HTMLElement {
|
|
|
4344
4609
|
updateCode(i) {
|
|
4345
4610
|
if (!this.codeEl) return;
|
|
4346
4611
|
if (!!(i && String(i).trim().length > 0)) {
|
|
4347
|
-
const
|
|
4348
|
-
this.lastCode =
|
|
4612
|
+
const a = String(i);
|
|
4613
|
+
this.lastCode = a, this.codeEl.textContent = a, this.showCodeState();
|
|
4349
4614
|
} else {
|
|
4350
4615
|
this.lastCode = void 0;
|
|
4351
|
-
const
|
|
4352
|
-
this.codeEl.textContent =
|
|
4616
|
+
const a = this.codeEl.getAttribute("data-placeholder") || "••••";
|
|
4617
|
+
this.codeEl.textContent = a, this.showLoading();
|
|
4353
4618
|
}
|
|
4354
4619
|
this.currentConfig && this.renderVerifiers(this.currentConfig.verifyUrls);
|
|
4355
4620
|
}
|
|
@@ -4360,100 +4625,185 @@ const ge = class ge extends HTMLElement {
|
|
|
4360
4625
|
this.spinnerEl?.removeAttribute("hidden"), this.codeContainerEl?.classList.remove("code--active", "code--verified"), this.codeEl?.setAttribute("hidden", ""), this.promptEl?.setAttribute("hidden", ""), this.successEl?.setAttribute("hidden", "");
|
|
4361
4626
|
}
|
|
4362
4627
|
showCodeState() {
|
|
4363
|
-
if (this.spinnerEl?.setAttribute("hidden", ""), this.codeContainerEl?.classList.remove("code--verified"), this.codeContainerEl?.classList.add("code--active"), this.codeEl?.removeAttribute("hidden"), this.currentConfig && this.promptEl) {
|
|
4364
|
-
const i =
|
|
4365
|
-
this.promptEl.textContent = i.ui.sendCodePrompt, this.promptEl.removeAttribute("hidden");
|
|
4628
|
+
if (this.spinnerEl?.setAttribute("hidden", ""), this.codeContainerEl?.classList.remove("code--verified"), this.codeContainerEl?.classList.remove("code--exiting", "code--collapsed"), 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) {
|
|
4629
|
+
const i = Z(this.currentConfig.lang);
|
|
4630
|
+
this.promptEl.textContent = i.ui.sendCodePrompt, this.promptEl.classList.remove("prompt--exiting"), this.promptEl.removeAttribute("aria-hidden"), this.promptEl.removeAttribute("hidden");
|
|
4366
4631
|
}
|
|
4367
4632
|
this.successEl?.setAttribute("hidden", "");
|
|
4368
4633
|
}
|
|
4369
4634
|
showSuccess(i) {
|
|
4370
|
-
|
|
4371
|
-
|
|
4635
|
+
this.spinnerEl?.setAttribute("hidden", ""), this.codeContainerEl?.classList.remove("code--active"), this.codeContainerEl?.classList.add("code--verified", "code--exiting"), this.promptEl?.classList.add("prompt--exiting"), this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.stopCountdown();
|
|
4636
|
+
const o = this.isFooterHidden();
|
|
4637
|
+
if (this.footerEl && (this.footerEl.hidden = o, this.footerEl.classList.remove("footer--leaving"), o || (this.footerEl.classList.add("footer--waiting", "footer--transitioning", "footer--verified"), window.setTimeout(() => {
|
|
4638
|
+
this.footerEl?.classList.remove("footer--transitioning"), this.footerBrandEl && (this.footerBrandEl.hidden = !0);
|
|
4639
|
+
}, Re))), this.footerStatusEl && (this.footerStatusEl.hidden = o), this.footerMessageEl) {
|
|
4640
|
+
const a = i.identifier && i.identifier.trim().length > 0 ? i.identifier.trim() : this.destinationAddressForChannel(i.channel ?? this.primaryChannel(this.currentConfig?.verifyUrls ?? []));
|
|
4641
|
+
this.footerMessageEl.textContent = a ? `Verified ${a}` : "Verified";
|
|
4642
|
+
}
|
|
4643
|
+
if (this.footerTimerEl && (this.footerTimerEl.hidden = !1, this.footerTimerEl.classList.remove("low"), this.footerTimerEl.textContent = "· Signing you in..."), this.verifiersEl?.classList.add("verifiers--exiting"), this.currentConfig && this.successEl) {
|
|
4644
|
+
const a = Z(this.currentConfig.lang), h = i.name && i.name.trim().length > 0 ? a.ui.successGreeting.replace("(Name)", i.name) : "You're in!";
|
|
4372
4645
|
this.successEl.innerHTML = `
|
|
4373
4646
|
<span class="success-check" aria-hidden="true">
|
|
4374
|
-
<svg viewBox="0 0
|
|
4647
|
+
<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>
|
|
4375
4648
|
</span>
|
|
4376
|
-
<
|
|
4649
|
+
<p class="success-message">${this.escapeHtml(h)}</p>
|
|
4377
4650
|
`, this.successEl.removeAttribute("hidden");
|
|
4378
4651
|
}
|
|
4652
|
+
this.successTransitionTimer !== null && clearTimeout(this.successTransitionTimer), this.successTransitionTimer = window.setTimeout(() => {
|
|
4653
|
+
this.successTransitionTimer = null, this.verifiersEl && this.verifiersEl.setAttribute("aria-hidden", "true"), this.codeContainerEl?.setAttribute("aria-hidden", "true"), this.promptEl?.setAttribute("aria-hidden", "true");
|
|
4654
|
+
}, Re);
|
|
4655
|
+
}
|
|
4656
|
+
destinationAddressForChannel(i) {
|
|
4657
|
+
const o = this.currentConfig?.verifyUrls ?? [], a = o.find((h) => this.channelClass(h) === i) ?? o[0];
|
|
4658
|
+
if (!a) return null;
|
|
4659
|
+
try {
|
|
4660
|
+
const h = new URL(a, window.location.origin);
|
|
4661
|
+
if (h.protocol === "mailto:")
|
|
4662
|
+
return decodeURIComponent(h.pathname || h.href.replace(/^mailto:/, "").split("?")[0]) || null;
|
|
4663
|
+
if (h.protocol === "whatsapp:" || h.protocol === "whatsapp://") {
|
|
4664
|
+
const u = h.searchParams.get("phone") || h.pathname.replace(/^\/+/, "");
|
|
4665
|
+
return u ? `+${u.replace(/^\+/, "")}` : null;
|
|
4666
|
+
}
|
|
4667
|
+
} catch {
|
|
4668
|
+
if (a.startsWith("mailto:")) return a.replace(/^mailto:/, "").split("?")[0] || null;
|
|
4669
|
+
if (a.startsWith("whatsapp:")) return a.replace(/^whatsapp:\/?\/?/, "").split("?")[0] || null;
|
|
4670
|
+
}
|
|
4671
|
+
return null;
|
|
4379
4672
|
}
|
|
4380
4673
|
escapeHtml(i) {
|
|
4381
4674
|
return i.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4382
4675
|
}
|
|
4383
4676
|
renderVerifiers(i) {
|
|
4384
4677
|
if (!this.verifiersEl) return;
|
|
4385
|
-
this.verifiersEl.innerHTML = "";
|
|
4678
|
+
this.verifiersEl.innerHTML = "", this.verifiersEl.classList.toggle("is-two", i.length === 2);
|
|
4386
4679
|
const o = this.currentConfig;
|
|
4387
|
-
i.forEach((
|
|
4388
|
-
|
|
4389
|
-
|
|
4680
|
+
i.forEach((a, h) => {
|
|
4681
|
+
if (h > 0 && i.length === 2) {
|
|
4682
|
+
const w = document.createElement("div");
|
|
4683
|
+
w.className = "divider", w.setAttribute("aria-hidden", "true");
|
|
4684
|
+
const R = document.createElement("span");
|
|
4685
|
+
R.textContent = o.lang === "de" ? "oder" : o.lang === "fr" ? "ou" : "or", w.appendChild(R), this.verifiersEl.appendChild(w);
|
|
4686
|
+
}
|
|
4687
|
+
const u = document.createElement("div");
|
|
4688
|
+
u.className = "opt";
|
|
4689
|
+
const m = document.createElement("a");
|
|
4690
|
+
m.className = "chan " + this.channelClass(a), m.href = this.buildLink(a, o.lang), m.target = "_blank", m.rel = "noopener noreferrer", m.addEventListener("click", () => {
|
|
4390
4691
|
this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.showFooterWaitingState();
|
|
4391
4692
|
});
|
|
4693
|
+
const g = this.iconForUrl(a);
|
|
4694
|
+
if (g) {
|
|
4695
|
+
const w = document.createElement("span");
|
|
4696
|
+
w.className = "icon", w.setAttribute("aria-hidden", "true"), w.innerHTML = g, m.appendChild(w);
|
|
4697
|
+
}
|
|
4392
4698
|
const y = document.createElement("span");
|
|
4393
|
-
y.className = "
|
|
4394
|
-
const
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4699
|
+
y.className = "label", y.textContent = this.channelLabel(a, o.lang), m.appendChild(y), u.appendChild(m);
|
|
4700
|
+
const x = this.destinationText(a, o.lang);
|
|
4701
|
+
if (x) {
|
|
4702
|
+
const w = document.createElement("a");
|
|
4703
|
+
w.className = "dest", w.href = m.href, w.target = "_blank", w.rel = "noopener noreferrer", w.textContent = x, u.appendChild(w);
|
|
4704
|
+
}
|
|
4705
|
+
this.verifiersEl.appendChild(u);
|
|
4398
4706
|
});
|
|
4399
4707
|
}
|
|
4708
|
+
channelClass(i) {
|
|
4709
|
+
try {
|
|
4710
|
+
const o = new URL(i, window.location.origin);
|
|
4711
|
+
if (o.protocol === "mailto:") return "email";
|
|
4712
|
+
if (o.protocol === "whatsapp:" || o.protocol === "whatsapp://") return "whatsapp";
|
|
4713
|
+
} catch {
|
|
4714
|
+
if (i.startsWith("mailto:")) return "email";
|
|
4715
|
+
if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) return "whatsapp";
|
|
4716
|
+
}
|
|
4717
|
+
return "generic";
|
|
4718
|
+
}
|
|
4719
|
+
channelLabel(i, o) {
|
|
4720
|
+
const a = Z(o), h = this.channelClass(i);
|
|
4721
|
+
if (h === "email") return a.labels.email;
|
|
4722
|
+
if (h === "whatsapp") return a.labels.whatsapp;
|
|
4723
|
+
try {
|
|
4724
|
+
const u = new URL(i, window.location.origin);
|
|
4725
|
+
return u.protocol.startsWith("http") ? u.hostname : u.protocol.replace(":", "");
|
|
4726
|
+
} catch {
|
|
4727
|
+
return i;
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
destinationText(i, o) {
|
|
4731
|
+
const h = Z(o).ui.toPrefix ?? "to";
|
|
4732
|
+
try {
|
|
4733
|
+
const u = new URL(i, window.location.origin);
|
|
4734
|
+
if (u.protocol === "mailto:") {
|
|
4735
|
+
const m = decodeURIComponent(u.pathname || u.href.replace(/^mailto:/, "").split("?")[0]);
|
|
4736
|
+
return m ? `${h} ${m}` : null;
|
|
4737
|
+
}
|
|
4738
|
+
if (u.protocol === "whatsapp:" || u.protocol === "whatsapp://") {
|
|
4739
|
+
const m = u.searchParams.get("phone") || u.pathname.replace(/^\/+/, "");
|
|
4740
|
+
return m ? `${h} +${m.replace(/^\+/, "")}` : null;
|
|
4741
|
+
}
|
|
4742
|
+
if (u.protocol.startsWith("http") && (u.hostname === "wa.me" || u.hostname === "api.whatsapp.com")) {
|
|
4743
|
+
const m = u.pathname.replace(/^\/+/, "").replace(/[^0-9]/g, "");
|
|
4744
|
+
return m ? `${h} +${m}` : null;
|
|
4745
|
+
}
|
|
4746
|
+
} catch {
|
|
4747
|
+
}
|
|
4748
|
+
return null;
|
|
4749
|
+
}
|
|
4400
4750
|
iconForUrl(i) {
|
|
4401
4751
|
try {
|
|
4402
4752
|
const o = new URL(i, window.location.origin);
|
|
4403
|
-
if (o.protocol === "mailto:") return
|
|
4404
|
-
if (o.protocol === "whatsapp:" || o.protocol === "whatsapp://") return
|
|
4753
|
+
if (o.protocol === "mailto:") return vt;
|
|
4754
|
+
if (o.protocol === "whatsapp:" || o.protocol === "whatsapp://") return yt;
|
|
4405
4755
|
} catch {
|
|
4406
|
-
if (i.startsWith("mailto:")) return
|
|
4407
|
-
if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) return
|
|
4756
|
+
if (i.startsWith("mailto:")) return vt;
|
|
4757
|
+
if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) return yt;
|
|
4408
4758
|
}
|
|
4409
4759
|
return null;
|
|
4410
4760
|
}
|
|
4411
4761
|
labelForUrl(i, o) {
|
|
4412
|
-
const
|
|
4762
|
+
const a = Z(o);
|
|
4413
4763
|
try {
|
|
4414
4764
|
const h = new URL(i, window.location.origin);
|
|
4415
|
-
return h.protocol === "mailto:" ? `${
|
|
4765
|
+
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(":", "");
|
|
4416
4766
|
} catch {
|
|
4417
|
-
return i.startsWith("mailto:") ? `${
|
|
4767
|
+
return i.startsWith("mailto:") ? `${a.ui.by} ${a.labels.email}` : i.startsWith("whatsapp:") || i.startsWith("whatsapp://") ? `${a.ui.by} ${a.labels.whatsapp}` : i;
|
|
4418
4768
|
}
|
|
4419
4769
|
}
|
|
4420
4770
|
buildLink(i, o) {
|
|
4421
|
-
const
|
|
4422
|
-
if (!
|
|
4771
|
+
const a = this.lastCode, h = Z(o), u = window.location.host;
|
|
4772
|
+
if (!a) return i;
|
|
4423
4773
|
if (i.startsWith("mailto:")) {
|
|
4424
|
-
const [
|
|
4425
|
-
|
|
4426
|
-
const
|
|
4427
|
-
return `${
|
|
4774
|
+
const [m, g = ""] = i.split("?"), y = new URLSearchParams(g), x = this.applyTemplate(h.templates.emailSubject, u, a), w = this.applyTemplate(h.templates.emailBody, u, a);
|
|
4775
|
+
y.set("subject", x), y.set("body", w);
|
|
4776
|
+
const R = this.toQuery(y);
|
|
4777
|
+
return `${m}?${R}`;
|
|
4428
4778
|
}
|
|
4429
4779
|
if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) {
|
|
4430
|
-
const [
|
|
4431
|
-
|
|
4432
|
-
const
|
|
4433
|
-
return `${
|
|
4780
|
+
const [m, g = ""] = i.split("?"), y = new URLSearchParams(g), x = this.applyTemplate(h.templates.whatsappText, u, a);
|
|
4781
|
+
y.set("text", x);
|
|
4782
|
+
const w = this.toQuery(y);
|
|
4783
|
+
return `${m}?${w}`;
|
|
4434
4784
|
}
|
|
4435
4785
|
return i;
|
|
4436
4786
|
}
|
|
4437
|
-
applyTemplate(i, o,
|
|
4438
|
-
return i.replaceAll("(Host)", o).replaceAll("(Code)",
|
|
4787
|
+
applyTemplate(i, o, a) {
|
|
4788
|
+
return i.replaceAll("(Host)", o).replaceAll("(Code)", a);
|
|
4439
4789
|
}
|
|
4440
4790
|
// Build query string without using URLSearchParams.toString() because it encodes
|
|
4441
4791
|
// spaces as '+', which breaks expectations for many mail clients handling mailto:
|
|
4442
4792
|
// We use encodeURIComponent so spaces become '%20' and follow RFC 3986 style.
|
|
4443
4793
|
toQuery(i) {
|
|
4444
4794
|
const o = [];
|
|
4445
|
-
return i.forEach((
|
|
4446
|
-
const
|
|
4447
|
-
o.push(`${
|
|
4795
|
+
return i.forEach((a, h) => {
|
|
4796
|
+
const u = encodeURIComponent(h), m = encodeURIComponent(a);
|
|
4797
|
+
o.push(`${u}=${m}`);
|
|
4448
4798
|
}), o.join("&");
|
|
4449
4799
|
}
|
|
4450
4800
|
joinUrl(i, o) {
|
|
4451
4801
|
return i.endsWith("/") && o.startsWith("/") ? i + o.slice(1) : !i.endsWith("/") && !o.startsWith("/") ? i + "/" + o : i + o;
|
|
4452
4802
|
}
|
|
4453
4803
|
};
|
|
4454
|
-
|
|
4455
|
-
let
|
|
4456
|
-
customElements.get("sendity-auth") || customElements.define("sendity-auth",
|
|
4804
|
+
me.tailwindCssText = null, me.tailwindLoading = null;
|
|
4805
|
+
let Oe = me;
|
|
4806
|
+
customElements.get("sendity-auth") || customElements.define("sendity-auth", Oe);
|
|
4457
4807
|
export {
|
|
4458
|
-
|
|
4808
|
+
Oe as Sendity
|
|
4459
4809
|
};
|