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