altcha 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -2
- package/dist/altcha.d.ts +54 -24
- package/dist/altcha.js +50 -50
- package/dist/altcha.umd.cjs +2 -2
- package/dist_external/altcha.d.ts +54 -24
- package/dist_external/altcha.js +136 -136
- package/dist_external/altcha.umd.cjs +2 -2
- package/package.json +1 -1
package/dist_external/altcha.js
CHANGED
|
@@ -83,17 +83,17 @@ function At(n) {
|
|
|
83
83
|
function Rt() {
|
|
84
84
|
const n = Ie();
|
|
85
85
|
return (e, t, { cancelable: i = !1 } = {}) => {
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
86
|
+
const o = n.$$.callbacks[e];
|
|
87
|
+
if (o) {
|
|
88
|
+
const l = Ct(
|
|
89
89
|
/** @type {string} */
|
|
90
90
|
e,
|
|
91
91
|
t,
|
|
92
92
|
{ cancelable: i }
|
|
93
93
|
);
|
|
94
|
-
return
|
|
95
|
-
f.call(n,
|
|
96
|
-
}), !
|
|
94
|
+
return o.slice().forEach((f) => {
|
|
95
|
+
f.call(n, l);
|
|
96
|
+
}), !l.defaultPrevented;
|
|
97
97
|
}
|
|
98
98
|
return !0;
|
|
99
99
|
};
|
|
@@ -153,11 +153,11 @@ function Dt(n, e) {
|
|
|
153
153
|
n && n.i && (Tt.delete(n), n.i(e));
|
|
154
154
|
}
|
|
155
155
|
function Nt(n, e, t) {
|
|
156
|
-
const { fragment: i, after_update:
|
|
156
|
+
const { fragment: i, after_update: o } = n.$$;
|
|
157
157
|
i && i.m(e, t), Le(() => {
|
|
158
|
-
const
|
|
159
|
-
n.$$.on_destroy ? n.$$.on_destroy.push(...
|
|
160
|
-
}),
|
|
158
|
+
const l = n.$$.on_mount.map(et).filter(tt);
|
|
159
|
+
n.$$.on_destroy ? n.$$.on_destroy.push(...l) : ue(l), n.$$.on_mount = [];
|
|
160
|
+
}), o.forEach(Le);
|
|
161
161
|
}
|
|
162
162
|
function jt(n, e) {
|
|
163
163
|
const t = n.$$;
|
|
@@ -166,16 +166,16 @@ function jt(n, e) {
|
|
|
166
166
|
function Vt(n, e) {
|
|
167
167
|
n.$$.dirty[0] === -1 && (ne.push(n), rt(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
168
168
|
}
|
|
169
|
-
function Ft(n, e, t, i,
|
|
169
|
+
function Ft(n, e, t, i, o, l, f = null, c = [-1]) {
|
|
170
170
|
const h = ce;
|
|
171
171
|
fe(n);
|
|
172
172
|
const u = n.$$ = {
|
|
173
173
|
fragment: null,
|
|
174
174
|
ctx: [],
|
|
175
175
|
// state
|
|
176
|
-
props:
|
|
176
|
+
props: l,
|
|
177
177
|
update: ie,
|
|
178
|
-
not_equal:
|
|
178
|
+
not_equal: o,
|
|
179
179
|
bound: qe(),
|
|
180
180
|
// lifecycle
|
|
181
181
|
on_mount: [],
|
|
@@ -194,7 +194,7 @@ function Ft(n, e, t, i, l, o, f = null, c = [-1]) {
|
|
|
194
194
|
let H = !1;
|
|
195
195
|
if (u.ctx = t ? t(n, e.props || {}, (S, B, ...P) => {
|
|
196
196
|
const k = P.length ? P[0] : B;
|
|
197
|
-
return u.ctx &&
|
|
197
|
+
return u.ctx && o(u.ctx[S], u.ctx[S] = k) && (!u.skip_bound && u.bound[S] && u.bound[S](k), H && Vt(n, S)), B;
|
|
198
198
|
}) : [], u.update(), H = !0, ue(u.before_update), u.fragment = i ? i(u.ctx) : !1, e.target) {
|
|
199
199
|
if (e.hydrate) {
|
|
200
200
|
const S = xt(e.target);
|
|
@@ -231,25 +231,25 @@ typeof HTMLElement == "function" && (it = class extends HTMLElement {
|
|
|
231
231
|
}
|
|
232
232
|
addEventListener(e, t, i) {
|
|
233
233
|
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
|
|
234
|
-
const
|
|
235
|
-
this.$$l_u.set(t,
|
|
234
|
+
const o = this.$$c.$on(e, t);
|
|
235
|
+
this.$$l_u.set(t, o);
|
|
236
236
|
}
|
|
237
237
|
super.addEventListener(e, t, i);
|
|
238
238
|
}
|
|
239
239
|
removeEventListener(e, t, i) {
|
|
240
240
|
if (super.removeEventListener(e, t, i), this.$$c) {
|
|
241
|
-
const
|
|
242
|
-
|
|
241
|
+
const o = this.$$l_u.get(t);
|
|
242
|
+
o && (o(), this.$$l_u.delete(t));
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
async connectedCallback() {
|
|
246
246
|
if (this.$$cn = !0, !this.$$c) {
|
|
247
|
-
let e = function(
|
|
247
|
+
let e = function(l) {
|
|
248
248
|
return () => {
|
|
249
249
|
let f;
|
|
250
250
|
return {
|
|
251
251
|
c: function() {
|
|
252
|
-
f = M("slot"),
|
|
252
|
+
f = M("slot"), l !== "default" && s(f, "name", l);
|
|
253
253
|
},
|
|
254
254
|
/**
|
|
255
255
|
* @param {HTMLElement} target
|
|
@@ -267,14 +267,14 @@ typeof HTMLElement == "function" && (it = class extends HTMLElement {
|
|
|
267
267
|
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
268
268
|
return;
|
|
269
269
|
const t = {}, i = Lt(this);
|
|
270
|
-
for (const
|
|
271
|
-
|
|
272
|
-
for (const
|
|
273
|
-
const f = this.$$g_p(
|
|
274
|
-
f in this.$$d || (this.$$d[f] = _e(f,
|
|
270
|
+
for (const l of this.$$s)
|
|
271
|
+
l in i && (t[l] = [e(l)]);
|
|
272
|
+
for (const l of this.attributes) {
|
|
273
|
+
const f = this.$$g_p(l.name);
|
|
274
|
+
f in this.$$d || (this.$$d[f] = _e(f, l.value, this.$$p_d, "toProp"));
|
|
275
275
|
}
|
|
276
|
-
for (const
|
|
277
|
-
!(
|
|
276
|
+
for (const l in this.$$p_d)
|
|
277
|
+
!(l in this.$$d) && this[l] !== void 0 && (this.$$d[l] = this[l], delete this[l]);
|
|
278
278
|
this.$$c = new this.$$ctor({
|
|
279
279
|
target: this.shadowRoot || this,
|
|
280
280
|
props: {
|
|
@@ -285,24 +285,24 @@ typeof HTMLElement == "function" && (it = class extends HTMLElement {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
|
-
const
|
|
288
|
+
const o = () => {
|
|
289
289
|
this.$$r = !0;
|
|
290
|
-
for (const
|
|
291
|
-
if (this.$$d[
|
|
290
|
+
for (const l in this.$$p_d)
|
|
291
|
+
if (this.$$d[l] = this.$$c.$$.ctx[this.$$c.$$.props[l]], this.$$p_d[l].reflect) {
|
|
292
292
|
const f = _e(
|
|
293
|
-
|
|
294
|
-
this.$$d[
|
|
293
|
+
l,
|
|
294
|
+
this.$$d[l],
|
|
295
295
|
this.$$p_d,
|
|
296
296
|
"toAttribute"
|
|
297
297
|
);
|
|
298
|
-
f == null ? this.removeAttribute(this.$$p_d[
|
|
298
|
+
f == null ? this.removeAttribute(this.$$p_d[l].attribute || l) : this.setAttribute(this.$$p_d[l].attribute || l, f);
|
|
299
299
|
}
|
|
300
300
|
this.$$r = !1;
|
|
301
301
|
};
|
|
302
|
-
this.$$c.$$.after_update.push(
|
|
303
|
-
for (const
|
|
304
|
-
for (const f of this.$$l[
|
|
305
|
-
const c = this.$$c.$on(
|
|
302
|
+
this.$$c.$$.after_update.push(o), o();
|
|
303
|
+
for (const l in this.$$l)
|
|
304
|
+
for (const f of this.$$l[l]) {
|
|
305
|
+
const c = this.$$c.$on(l, f);
|
|
306
306
|
this.$$l_u.set(f, c);
|
|
307
307
|
}
|
|
308
308
|
this.$$l = {};
|
|
@@ -311,12 +311,12 @@ typeof HTMLElement == "function" && (it = class extends HTMLElement {
|
|
|
311
311
|
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
312
312
|
// and setting attributes through setAttribute etc, this is helpful
|
|
313
313
|
attributeChangedCallback(e, t, i) {
|
|
314
|
-
var
|
|
315
|
-
this.$$r || (e = this.$$g_p(e), this.$$d[e] = _e(e, i, this.$$p_d, "toProp"), (
|
|
314
|
+
var o;
|
|
315
|
+
this.$$r || (e = this.$$g_p(e), this.$$d[e] = _e(e, i, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [e]: this.$$d[e] }));
|
|
316
316
|
}
|
|
317
317
|
disconnectedCallback() {
|
|
318
318
|
this.$$cn = !1, Promise.resolve().then(() => {
|
|
319
|
-
this.$$cn
|
|
319
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$c = void 0);
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
$$g_p(e) {
|
|
@@ -326,12 +326,12 @@ typeof HTMLElement == "function" && (it = class extends HTMLElement {
|
|
|
326
326
|
}
|
|
327
327
|
});
|
|
328
328
|
function _e(n, e, t, i) {
|
|
329
|
-
var
|
|
330
|
-
const
|
|
331
|
-
if (e =
|
|
329
|
+
var l;
|
|
330
|
+
const o = (l = t[n]) == null ? void 0 : l.type;
|
|
331
|
+
if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !i || !t[n])
|
|
332
332
|
return e;
|
|
333
333
|
if (i === "toAttribute")
|
|
334
|
-
switch (
|
|
334
|
+
switch (o) {
|
|
335
335
|
case "Object":
|
|
336
336
|
case "Array":
|
|
337
337
|
return e == null ? null : JSON.stringify(e);
|
|
@@ -343,7 +343,7 @@ function _e(n, e, t, i) {
|
|
|
343
343
|
return e;
|
|
344
344
|
}
|
|
345
345
|
else
|
|
346
|
-
switch (
|
|
346
|
+
switch (o) {
|
|
347
347
|
case "Object":
|
|
348
348
|
case "Array":
|
|
349
349
|
return e && JSON.parse(e);
|
|
@@ -355,10 +355,10 @@ function _e(n, e, t, i) {
|
|
|
355
355
|
return e;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
function Pt(n, e, t, i,
|
|
358
|
+
function Pt(n, e, t, i, o, l) {
|
|
359
359
|
let f = class extends it {
|
|
360
360
|
constructor() {
|
|
361
|
-
super(n, t,
|
|
361
|
+
super(n, t, o), this.$$p_d = e;
|
|
362
362
|
}
|
|
363
363
|
static get observedAttributes() {
|
|
364
364
|
return Object.keys(e).map(
|
|
@@ -383,7 +383,7 @@ function Pt(n, e, t, i, l, o) {
|
|
|
383
383
|
return (h = this.$$c) == null ? void 0 : h[c];
|
|
384
384
|
}
|
|
385
385
|
});
|
|
386
|
-
}),
|
|
386
|
+
}), n.element = /** @type {any} */
|
|
387
387
|
f, f;
|
|
388
388
|
}
|
|
389
389
|
class Ht {
|
|
@@ -420,8 +420,8 @@ class Ht {
|
|
|
420
420
|
return ie;
|
|
421
421
|
const i = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
422
422
|
return i.push(t), () => {
|
|
423
|
-
const
|
|
424
|
-
|
|
423
|
+
const o = i.indexOf(t);
|
|
424
|
+
o !== -1 && i.splice(o, 1);
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
427
|
/**
|
|
@@ -441,10 +441,10 @@ function Ut(n) {
|
|
|
441
441
|
async function qt(n, e = "SHA-256", t = 1e5) {
|
|
442
442
|
const i = Date.now().toString(16);
|
|
443
443
|
n || (n = Math.round(Math.random() * t));
|
|
444
|
-
const
|
|
444
|
+
const o = await ot(i, n, e);
|
|
445
445
|
return {
|
|
446
446
|
algorithm: e,
|
|
447
|
-
challenge:
|
|
447
|
+
challenge: o,
|
|
448
448
|
salt: i,
|
|
449
449
|
signature: ""
|
|
450
450
|
};
|
|
@@ -457,12 +457,12 @@ async function ot(n, e, t) {
|
|
|
457
457
|
)
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
|
-
function Zt(n, e, t = "SHA-256", i = 1e6,
|
|
461
|
-
const
|
|
460
|
+
function Zt(n, e, t = "SHA-256", i = 1e6, o = 0) {
|
|
461
|
+
const l = new AbortController(), f = Date.now();
|
|
462
462
|
return {
|
|
463
463
|
promise: (async () => {
|
|
464
|
-
for (let h =
|
|
465
|
-
if (
|
|
464
|
+
for (let h = o; h <= i; h += 1) {
|
|
465
|
+
if (l.signal.aborted)
|
|
466
466
|
return null;
|
|
467
467
|
if (await ot(e, h, t) === n)
|
|
468
468
|
return {
|
|
@@ -472,7 +472,7 @@ function Zt(n, e, t = "SHA-256", i = 1e6, l = 0) {
|
|
|
472
472
|
}
|
|
473
473
|
return null;
|
|
474
474
|
})(),
|
|
475
|
-
controller:
|
|
475
|
+
controller: l
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
478
|
var b = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.VERIFIED = "verified", n.VERIFYING = "verifying", n.UNVERIFIED = "unverified", n.EXPIRED = "expired", n))(b || {});
|
|
@@ -482,11 +482,11 @@ function Ge(n) {
|
|
|
482
482
|
c() {
|
|
483
483
|
e = Y("svg"), t = Y("path"), i = Y("path"), s(t, "d", "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"), s(t, "fill", "currentColor"), s(t, "opacity", ".25"), s(i, "d", "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"), s(i, "fill", "currentColor"), s(i, "class", "altcha-spinner"), s(e, "width", "24"), s(e, "height", "24"), s(e, "viewBox", "0 0 24 24"), s(e, "xmlns", "http://www.w3.org/2000/svg");
|
|
484
484
|
},
|
|
485
|
-
m(
|
|
486
|
-
F(
|
|
485
|
+
m(o, l) {
|
|
486
|
+
F(o, e, l), p(e, t), p(e, i);
|
|
487
487
|
},
|
|
488
|
-
d(
|
|
489
|
-
|
|
488
|
+
d(o) {
|
|
489
|
+
o && D(e);
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
492
|
}
|
|
@@ -500,18 +500,18 @@ function Yt(n) {
|
|
|
500
500
|
e = M("label"), s(e, "for", i = /*name*/
|
|
501
501
|
n[4] + "_checkbox");
|
|
502
502
|
},
|
|
503
|
-
m(
|
|
504
|
-
F(
|
|
503
|
+
m(o, l) {
|
|
504
|
+
F(o, e, l), e.innerHTML = t;
|
|
505
505
|
},
|
|
506
|
-
p(
|
|
507
|
-
|
|
506
|
+
p(o, l) {
|
|
507
|
+
l[0] & /*_strings*/
|
|
508
508
|
2048 && t !== (t = /*_strings*/
|
|
509
|
-
|
|
509
|
+
o[11].label + "") && (e.innerHTML = t), l[0] & /*name*/
|
|
510
510
|
16 && i !== (i = /*name*/
|
|
511
|
-
|
|
511
|
+
o[4] + "_checkbox") && s(e, "for", i);
|
|
512
512
|
},
|
|
513
|
-
d(
|
|
514
|
-
|
|
513
|
+
d(o) {
|
|
514
|
+
o && D(e);
|
|
515
515
|
}
|
|
516
516
|
};
|
|
517
517
|
}
|
|
@@ -524,11 +524,11 @@ function Gt(n) {
|
|
|
524
524
|
c() {
|
|
525
525
|
e = M("span");
|
|
526
526
|
},
|
|
527
|
-
m(i,
|
|
528
|
-
F(i, e,
|
|
527
|
+
m(i, o) {
|
|
528
|
+
F(i, e, o), e.innerHTML = t;
|
|
529
529
|
},
|
|
530
|
-
p(i,
|
|
531
|
-
|
|
530
|
+
p(i, o) {
|
|
531
|
+
o[0] & /*_strings*/
|
|
532
532
|
2048 && t !== (t = /*_strings*/
|
|
533
533
|
i[11].verifying + "") && (e.innerHTML = t);
|
|
534
534
|
},
|
|
@@ -541,47 +541,47 @@ function Wt(n) {
|
|
|
541
541
|
let e, t = (
|
|
542
542
|
/*_strings*/
|
|
543
543
|
n[11].verified + ""
|
|
544
|
-
), i,
|
|
544
|
+
), i, o;
|
|
545
545
|
return {
|
|
546
546
|
c() {
|
|
547
|
-
e = M("span"), i = X(),
|
|
548
|
-
|
|
547
|
+
e = M("span"), i = X(), o = M("input"), s(o, "type", "hidden"), s(
|
|
548
|
+
o,
|
|
549
549
|
"name",
|
|
550
550
|
/*name*/
|
|
551
551
|
n[4]
|
|
552
|
-
),
|
|
552
|
+
), o.value = /*payload*/
|
|
553
553
|
n[5];
|
|
554
554
|
},
|
|
555
|
-
m(
|
|
556
|
-
F(
|
|
555
|
+
m(l, f) {
|
|
556
|
+
F(l, e, f), e.innerHTML = t, F(l, i, f), F(l, o, f);
|
|
557
557
|
},
|
|
558
|
-
p(
|
|
558
|
+
p(l, f) {
|
|
559
559
|
f[0] & /*_strings*/
|
|
560
560
|
2048 && t !== (t = /*_strings*/
|
|
561
|
-
|
|
561
|
+
l[11].verified + "") && (e.innerHTML = t), f[0] & /*name*/
|
|
562
562
|
16 && s(
|
|
563
|
-
|
|
563
|
+
o,
|
|
564
564
|
"name",
|
|
565
565
|
/*name*/
|
|
566
|
-
|
|
566
|
+
l[4]
|
|
567
567
|
), f[0] & /*payload*/
|
|
568
|
-
32 && (
|
|
569
|
-
|
|
568
|
+
32 && (o.value = /*payload*/
|
|
569
|
+
l[5]);
|
|
570
570
|
},
|
|
571
|
-
d(
|
|
572
|
-
|
|
571
|
+
d(l) {
|
|
572
|
+
l && (D(e), D(i), D(o));
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
function We(n) {
|
|
577
|
-
let e, t, i,
|
|
577
|
+
let e, t, i, o, l, f, c;
|
|
578
578
|
return {
|
|
579
579
|
c() {
|
|
580
|
-
e = M("div"), t = M("a"), i = Y("svg"),
|
|
580
|
+
e = M("div"), t = M("a"), i = Y("svg"), o = Y("path"), l = Y("path"), f = Y("path"), s(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), s(o, "fill", "currentColor"), s(l, "d", "M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"), s(l, "fill", "currentColor"), s(f, "d", "M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"), s(f, "fill", "currentColor"), s(i, "width", "22"), s(i, "height", "22"), s(i, "viewBox", "0 0 20 20"), s(i, "fill", "none"), s(i, "xmlns", "http://www.w3.org/2000/svg"), s(t, "href", lt), s(t, "target", "_blank"), s(t, "class", "altcha-logo"), s(t, "aria-label", c = /*_strings*/
|
|
581
581
|
n[11].ariaLinkLabel);
|
|
582
582
|
},
|
|
583
583
|
m(h, u) {
|
|
584
|
-
F(h, e, u), p(e, t), p(t, i), p(i,
|
|
584
|
+
F(h, e, u), p(e, t), p(t, i), p(i, o), p(i, l), p(i, f);
|
|
585
585
|
},
|
|
586
586
|
p(h, u) {
|
|
587
587
|
u[0] & /*_strings*/
|
|
@@ -594,23 +594,23 @@ function We(n) {
|
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
596
|
function Xe(n) {
|
|
597
|
-
let e, t, i,
|
|
598
|
-
function
|
|
597
|
+
let e, t, i, o;
|
|
598
|
+
function l(h, u) {
|
|
599
599
|
return (
|
|
600
600
|
/*state*/
|
|
601
601
|
h[6] === b.EXPIRED ? Jt : Xt
|
|
602
602
|
);
|
|
603
603
|
}
|
|
604
|
-
let f =
|
|
604
|
+
let f = l(n), c = f(n);
|
|
605
605
|
return {
|
|
606
606
|
c() {
|
|
607
|
-
e = M("div"), t = Y("svg"), i = Y("path"),
|
|
607
|
+
e = M("div"), t = Y("svg"), i = Y("path"), o = X(), c.c(), s(i, "stroke-linecap", "round"), s(i, "stroke-linejoin", "round"), s(i, "d", "M6 18L18 6M6 6l12 12"), s(t, "width", "14"), s(t, "height", "14"), s(t, "xmlns", "http://www.w3.org/2000/svg"), s(t, "fill", "none"), s(t, "viewBox", "0 0 24 24"), s(t, "stroke-width", "1.5"), s(t, "stroke", "currentColor"), s(e, "class", "altcha-error");
|
|
608
608
|
},
|
|
609
609
|
m(h, u) {
|
|
610
|
-
F(h, e, u), p(e, t), p(t, i), p(e,
|
|
610
|
+
F(h, e, u), p(e, t), p(t, i), p(e, o), c.m(e, null);
|
|
611
611
|
},
|
|
612
612
|
p(h, u) {
|
|
613
|
-
f === (f =
|
|
613
|
+
f === (f = l(h)) && c ? c.p(h, u) : (c.d(1), c = f(h), c && (c.c(), c.m(e, null)));
|
|
614
614
|
},
|
|
615
615
|
d(h) {
|
|
616
616
|
h && D(e), c.d();
|
|
@@ -631,13 +631,13 @@ function Xt(n) {
|
|
|
631
631
|
n[10]
|
|
632
632
|
);
|
|
633
633
|
},
|
|
634
|
-
m(i,
|
|
635
|
-
F(i, e,
|
|
634
|
+
m(i, o) {
|
|
635
|
+
F(i, e, o), e.innerHTML = t;
|
|
636
636
|
},
|
|
637
|
-
p(i,
|
|
638
|
-
|
|
637
|
+
p(i, o) {
|
|
638
|
+
o[0] & /*_strings*/
|
|
639
639
|
2048 && t !== (t = /*_strings*/
|
|
640
|
-
i[11].error + "") && (e.innerHTML = t),
|
|
640
|
+
i[11].error + "") && (e.innerHTML = t), o[0] & /*error*/
|
|
641
641
|
1024 && s(
|
|
642
642
|
e,
|
|
643
643
|
"title",
|
|
@@ -664,13 +664,13 @@ function Jt(n) {
|
|
|
664
664
|
n[10]
|
|
665
665
|
);
|
|
666
666
|
},
|
|
667
|
-
m(i,
|
|
668
|
-
F(i, e,
|
|
667
|
+
m(i, o) {
|
|
668
|
+
F(i, e, o), e.innerHTML = t;
|
|
669
669
|
},
|
|
670
|
-
p(i,
|
|
671
|
-
|
|
670
|
+
p(i, o) {
|
|
671
|
+
o[0] & /*_strings*/
|
|
672
672
|
2048 && t !== (t = /*_strings*/
|
|
673
|
-
i[11].expired + "") && (e.innerHTML = t),
|
|
673
|
+
i[11].expired + "") && (e.innerHTML = t), o[0] & /*error*/
|
|
674
674
|
1024 && s(
|
|
675
675
|
e,
|
|
676
676
|
"title",
|
|
@@ -692,16 +692,16 @@ function Je(n) {
|
|
|
692
692
|
c() {
|
|
693
693
|
e = M("div"), t = M("div"), s(e, "class", "altcha-footer");
|
|
694
694
|
},
|
|
695
|
-
m(
|
|
696
|
-
F(
|
|
695
|
+
m(o, l) {
|
|
696
|
+
F(o, e, l), p(e, t), t.innerHTML = i;
|
|
697
697
|
},
|
|
698
|
-
p(
|
|
699
|
-
|
|
698
|
+
p(o, l) {
|
|
699
|
+
l[0] & /*_strings*/
|
|
700
700
|
2048 && i !== (i = /*_strings*/
|
|
701
|
-
|
|
701
|
+
o[11].footer + "") && (t.innerHTML = i);
|
|
702
702
|
},
|
|
703
|
-
d(
|
|
704
|
-
|
|
703
|
+
d(o) {
|
|
704
|
+
o && D(e);
|
|
705
705
|
}
|
|
706
706
|
};
|
|
707
707
|
}
|
|
@@ -721,7 +721,7 @@ function ze(n) {
|
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
function zt(n) {
|
|
724
|
-
let e, t, i,
|
|
724
|
+
let e, t, i, o, l, f, c, h, u, H, S, B, P, k, G, $ = (
|
|
725
725
|
/*state*/
|
|
726
726
|
n[6] === b.VERIFYING && Ge()
|
|
727
727
|
);
|
|
@@ -753,10 +753,10 @@ function zt(n) {
|
|
|
753
753
|
);
|
|
754
754
|
return {
|
|
755
755
|
c() {
|
|
756
|
-
e = M("div"), t = M("div"), $ && $.c(), i = X(),
|
|
757
|
-
n[4] + "_checkbox"),
|
|
758
|
-
n[0] !== "onsubmit", s(
|
|
759
|
-
|
|
756
|
+
e = M("div"), t = M("div"), $ && $.c(), i = X(), o = M("div"), l = M("input"), h = X(), u = M("div"), N.c(), H = X(), x && x.c(), S = X(), I && I.c(), B = X(), A && A.c(), P = X(), w && w.c(), s(l, "type", "checkbox"), s(l, "id", f = /*name*/
|
|
757
|
+
n[4] + "_checkbox"), l.required = c = /*auto*/
|
|
758
|
+
n[0] !== "onsubmit", s(o, "class", "altcha-checkbox"), Ze(
|
|
759
|
+
o,
|
|
760
760
|
"altcha-hidden",
|
|
761
761
|
/*state*/
|
|
762
762
|
n[6] === b.VERIFYING
|
|
@@ -773,22 +773,22 @@ function zt(n) {
|
|
|
773
773
|
);
|
|
774
774
|
},
|
|
775
775
|
m(d, _) {
|
|
776
|
-
F(d, e, _), p(e, t), $ && $.m(t, null), p(t, i), p(t,
|
|
776
|
+
F(d, e, _), p(e, t), $ && $.m(t, null), p(t, i), p(t, o), p(o, l), l.checked = /*checked*/
|
|
777
777
|
n[7], p(t, h), p(t, u), N.m(u, null), p(t, H), x && x.m(t, null), p(e, S), I && I.m(e, null), p(e, B), A && A.m(e, null), p(e, P), w && w.m(e, null), n[38](e), k || (G = [
|
|
778
778
|
pe(
|
|
779
|
-
|
|
779
|
+
l,
|
|
780
780
|
"change",
|
|
781
781
|
/*input_change_handler*/
|
|
782
782
|
n[36]
|
|
783
783
|
),
|
|
784
784
|
pe(
|
|
785
|
-
|
|
785
|
+
l,
|
|
786
786
|
"change",
|
|
787
787
|
/*onCheckedChange*/
|
|
788
788
|
n[13]
|
|
789
789
|
),
|
|
790
790
|
pe(
|
|
791
|
-
|
|
791
|
+
l,
|
|
792
792
|
"invalid",
|
|
793
793
|
/*onInvalid*/
|
|
794
794
|
n[14]
|
|
@@ -799,13 +799,13 @@ function zt(n) {
|
|
|
799
799
|
/*state*/
|
|
800
800
|
d[6] === b.VERIFYING ? $ || ($ = Ge(), $.c(), $.m(t, i)) : $ && ($.d(1), $ = null), _[0] & /*name*/
|
|
801
801
|
16 && f !== (f = /*name*/
|
|
802
|
-
d[4] + "_checkbox") && s(
|
|
802
|
+
d[4] + "_checkbox") && s(l, "id", f), _[0] & /*auto*/
|
|
803
803
|
1 && c !== (c = /*auto*/
|
|
804
|
-
d[0] !== "onsubmit") && (
|
|
805
|
-
128 && (
|
|
804
|
+
d[0] !== "onsubmit") && (l.required = c), _[0] & /*checked*/
|
|
805
|
+
128 && (l.checked = /*checked*/
|
|
806
806
|
d[7]), _[0] & /*state*/
|
|
807
807
|
64 && Ze(
|
|
808
|
-
|
|
808
|
+
o,
|
|
809
809
|
"altcha-hidden",
|
|
810
810
|
/*state*/
|
|
811
811
|
d[6] === b.VERIFYING
|
|
@@ -850,13 +850,13 @@ function Kt() {
|
|
|
850
850
|
}
|
|
851
851
|
function Qt(n, e, t) {
|
|
852
852
|
var Be, Ue;
|
|
853
|
-
let i,
|
|
853
|
+
let i, o, l, f, { auto: c = void 0 } = e, { blockspam: h = void 0 } = e, { challengeurl: u = void 0 } = e, { challengejson: H = void 0 } = e, { debug: S = !1 } = e, { delay: B = 0 } = e, { expire: P = void 0 } = e, { floating: k = void 0 } = e, { floatinganchor: G = void 0 } = e, { floatingoffset: $ = void 0 } = e, { hidefooter: J = !1 } = e, { hidelogo: Z = !1 } = e, { name: N = "altcha" } = e, { maxnumber: x = 1e6 } = e, { mockerror: I = !1 } = e, { refetchonexpire: A = !0 } = e, { spamfilter: w = !1 } = e, { strings: d = void 0 } = e, { test: _ = !1 } = e, { verifyurl: z = void 0 } = e, { workers: oe = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ae = void 0 } = e;
|
|
854
854
|
const ye = Rt(), Ae = ["SHA-256", "SHA-384", "SHA-512"], Re = (Ue = (Be = document.documentElement.lang) == null ? void 0 : Be.split("-")) == null ? void 0 : Ue[0];
|
|
855
855
|
let W = !1, C, K = null, he = null, m = null, ve = null, Q = null, j = b.UNVERIFIED, U = null;
|
|
856
856
|
At(() => {
|
|
857
857
|
m && (m.removeEventListener("submit", Me), m.removeEventListener("reset", Se), m.removeEventListener("focusin", $e), m = null), U && (clearTimeout(U), U = null), document.removeEventListener("click", je), document.removeEventListener("scroll", Ve), window.removeEventListener("resize", Pe);
|
|
858
858
|
}), It(() => {
|
|
859
|
-
E("mounted", "0.6.
|
|
859
|
+
E("mounted", "0.6.7"), E("workers", oe), _ && E("using test mode"), P && de(P), c !== void 0 && E("auto", c), k !== void 0 && He(k), m = C.closest("form"), m && (m.addEventListener("submit", Me, { capture: !0 }), m.addEventListener("reset", Se), c === "onfocus" && m.addEventListener("focusin", $e)), c === "onload" && ee(), i && (J || Z) && E("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.");
|
|
860
860
|
});
|
|
861
861
|
function E(...r) {
|
|
862
862
|
(S || r.some((a) => a instanceof Error)) && console[r[0] instanceof Error ? "error" : "log"]("ALTCHA", ...r);
|
|
@@ -899,8 +899,8 @@ function Qt(n, e, t) {
|
|
|
899
899
|
var r;
|
|
900
900
|
if (I)
|
|
901
901
|
throw E("mocking error"), new Error("Mocked error.");
|
|
902
|
-
if (
|
|
903
|
-
return E("using provided json data"),
|
|
902
|
+
if (o)
|
|
903
|
+
return E("using provided json data"), o;
|
|
904
904
|
if (_)
|
|
905
905
|
return E("generating test challenge", { test: _ }), qt(typeof _ != "boolean" ? +_ : void 0);
|
|
906
906
|
{
|
|
@@ -1085,7 +1085,7 @@ function Qt(n, e, t) {
|
|
|
1085
1085
|
E("unable to find floating anchor element");
|
|
1086
1086
|
}
|
|
1087
1087
|
function Oe(r) {
|
|
1088
|
-
r.auto !== void 0 && (t(0, c = r.auto), c === "onload" && ee()), r.floatinganchor !== void 0 && t(19, G = r.floatinganchor), r.delay !== void 0 && t(17, B = r.delay), r.floatingoffset !== void 0 && t(20, $ = r.floatingoffset), r.floating !== void 0 && He(r.floating), r.expire !== void 0 && (de(r.expire), t(18, P = r.expire)), r.challenge && (De(r.challenge),
|
|
1088
|
+
r.auto !== void 0 && (t(0, c = r.auto), c === "onload" && ee()), r.floatinganchor !== void 0 && t(19, G = r.floatinganchor), r.delay !== void 0 && t(17, B = r.delay), r.floatingoffset !== void 0 && t(20, $ = r.floatingoffset), r.floating !== void 0 && He(r.floating), r.expire !== void 0 && (de(r.expire), t(18, P = r.expire)), r.challenge && (De(r.challenge), o = r.challenge), r.challengeurl !== void 0 && t(15, u = r.challengeurl), r.debug !== void 0 && t(16, S = !!r.debug), r.hidefooter !== void 0 && t(2, J = !!r.hidefooter), r.hidelogo !== void 0 && t(3, Z = !!r.hidelogo), r.maxnumber !== void 0 && t(21, x = +r.maxnumber), r.mockerror !== void 0 && t(22, I = !!r.mockerror), r.name !== void 0 && t(4, N = r.name), r.refetchonexpire !== void 0 && t(23, A = !!r.refetchonexpire), r.spamfilter !== void 0 && t(24, w = typeof r.spamfilter == "object" ? r.spamfilter : !!r.spamfilter), r.strings && t(35, l = r.strings), r.test !== void 0 && t(25, _ = typeof r.test == "number" ? r.test : !!r.test), r.verifyurl !== void 0 && t(26, z = r.verifyurl), r.workers !== void 0 && t(27, oe = +r.workers), r.workerurl !== void 0 && t(28, ae = r.workerurl);
|
|
1089
1089
|
}
|
|
1090
1090
|
function ge(r = b.UNVERIFIED, a = null) {
|
|
1091
1091
|
U && (clearTimeout(U), U = null), t(7, W = !1), t(10, ve = a), t(5, Q = null), t(6, j = r);
|
|
@@ -1124,18 +1124,18 @@ function Qt(n, e, t) {
|
|
|
1124
1124
|
}, n.$$.update = () => {
|
|
1125
1125
|
n.$$.dirty[0] & /*challengeurl*/
|
|
1126
1126
|
32768 && t(12, i = !!(u != null && u.includes(".altcha.org")) && !!(u != null && u.includes("apiKey=ckey_"))), n.$$.dirty[0] & /*challengejson*/
|
|
1127
|
-
1073741824 && (
|
|
1128
|
-
1 && t(35,
|
|
1127
|
+
1073741824 && (o = H ? Qe(H) : void 0), n.$$.dirty[1] & /*strings*/
|
|
1128
|
+
1 && t(35, l = d ? Qe(d) : {}), n.$$.dirty[1] & /*parsedStrings*/
|
|
1129
1129
|
16 && t(11, f = {
|
|
1130
1130
|
ariaLinkLabel: Ke,
|
|
1131
1131
|
error: "Verification failed. Try again later.",
|
|
1132
1132
|
expired: "Verification expired. Try again.",
|
|
1133
|
-
footer: `Protected by <a href="${lt}" target="_blank" aria-label="${
|
|
1133
|
+
footer: `Protected by <a href="${lt}" target="_blank" aria-label="${l.ariaLinkLabel || Ke}">ALTCHA</a>`,
|
|
1134
1134
|
label: "I'm not a robot",
|
|
1135
1135
|
verified: "Verified",
|
|
1136
1136
|
verifying: "Verifying...",
|
|
1137
1137
|
waitAlert: "Verifying... please wait.",
|
|
1138
|
-
...
|
|
1138
|
+
...l
|
|
1139
1139
|
}), n.$$.dirty[0] & /*payload, state*/
|
|
1140
1140
|
96 && ye("statechange", { payload: Q, state: j }), n.$$.dirty[0] & /*state*/
|
|
1141
1141
|
64 && at();
|
|
@@ -1175,7 +1175,7 @@ function Qt(n, e, t) {
|
|
|
1175
1175
|
Oe,
|
|
1176
1176
|
ge,
|
|
1177
1177
|
ee,
|
|
1178
|
-
|
|
1178
|
+
l,
|
|
1179
1179
|
bt,
|
|
1180
1180
|
_t,
|
|
1181
1181
|
wt
|