@sendity/client 0.1.0 → 0.1.2

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