altcha 0.4.0 → 0.4.1
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 +1 -1
- package/dist/altcha.css +99 -0
- package/dist/altcha.iife.js +1 -2
- package/dist/altcha.js +362 -363
- package/dist/altcha.umd.cjs +1 -2
- package/package.json +6 -1
package/dist/altcha.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
var nt = Object.defineProperty;
|
|
2
2
|
var it = (r, e, t) => e in r ? nt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var T = (r, e, t) => (it(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
4
|
function Q() {
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function Ve(r) {
|
|
7
7
|
return r();
|
|
8
8
|
}
|
|
9
9
|
function Ie() {
|
|
10
10
|
return /* @__PURE__ */ Object.create(null);
|
|
11
11
|
}
|
|
12
12
|
function te(r) {
|
|
13
|
-
r.forEach(
|
|
13
|
+
r.forEach(Ve);
|
|
14
14
|
}
|
|
15
15
|
function Ue(r) {
|
|
16
16
|
return typeof r == "function";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function ot(r, e) {
|
|
19
19
|
return r != r ? e == e : r !== e || r && typeof r == "object" || typeof r == "function";
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function lt(r) {
|
|
22
22
|
return Object.keys(r).length === 0;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function v(r, e) {
|
|
25
25
|
r.appendChild(e);
|
|
26
26
|
}
|
|
27
27
|
function st(r, e, t) {
|
|
28
28
|
const i = ct(r);
|
|
29
29
|
if (!i.getElementById(e)) {
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const o = R("style");
|
|
31
|
+
o.id = e, o.textContent = t, at(i, o);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
function ct(r) {
|
|
@@ -42,28 +42,28 @@ function ct(r) {
|
|
|
42
42
|
) : r.ownerDocument;
|
|
43
43
|
}
|
|
44
44
|
function at(r, e) {
|
|
45
|
-
return
|
|
45
|
+
return v(
|
|
46
46
|
/** @type {Document} */
|
|
47
47
|
r.head || r,
|
|
48
48
|
e
|
|
49
49
|
), e.sheet;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function j(r, e, t) {
|
|
52
52
|
r.insertBefore(e, t || null);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function N(r) {
|
|
55
55
|
r.parentNode && r.parentNode.removeChild(r);
|
|
56
56
|
}
|
|
57
57
|
function R(r) {
|
|
58
58
|
return document.createElement(r);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function X(r) {
|
|
61
61
|
return document.createElementNS("http://www.w3.org/2000/svg", r);
|
|
62
62
|
}
|
|
63
63
|
function ft(r) {
|
|
64
64
|
return document.createTextNode(r);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function W() {
|
|
67
67
|
return ft(" ");
|
|
68
68
|
}
|
|
69
69
|
function ae(r, e, t, i) {
|
|
@@ -75,7 +75,7 @@ function c(r, e, t) {
|
|
|
75
75
|
function ut(r) {
|
|
76
76
|
return Array.from(r.childNodes);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ze(r, e, t) {
|
|
79
79
|
r.classList.toggle(e, !!t);
|
|
80
80
|
}
|
|
81
81
|
function ht(r, e, { bubbles: t = !1, cancelable: i = !1 } = {}) {
|
|
@@ -94,114 +94,114 @@ let ee;
|
|
|
94
94
|
function q(r) {
|
|
95
95
|
ee = r;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function me() {
|
|
98
98
|
if (!ee)
|
|
99
99
|
throw new Error("Function called outside component initialization");
|
|
100
100
|
return ee;
|
|
101
101
|
}
|
|
102
|
-
function gt(r) {
|
|
103
|
-
ge().$$.on_mount.push(r);
|
|
104
|
-
}
|
|
105
102
|
function mt(r) {
|
|
106
|
-
|
|
103
|
+
me().$$.on_mount.push(r);
|
|
104
|
+
}
|
|
105
|
+
function gt(r) {
|
|
106
|
+
me().$$.on_destroy.push(r);
|
|
107
107
|
}
|
|
108
108
|
function bt() {
|
|
109
|
-
const r =
|
|
109
|
+
const r = me();
|
|
110
110
|
return (e, t, { cancelable: i = !1 } = {}) => {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
111
|
+
const o = r.$$.callbacks[e];
|
|
112
|
+
if (o) {
|
|
113
|
+
const l = ht(
|
|
114
114
|
/** @type {string} */
|
|
115
115
|
e,
|
|
116
116
|
t,
|
|
117
117
|
{ cancelable: i }
|
|
118
118
|
);
|
|
119
|
-
return
|
|
120
|
-
s.call(r,
|
|
121
|
-
}), !
|
|
119
|
+
return o.slice().forEach((s) => {
|
|
120
|
+
s.call(r, l);
|
|
121
|
+
}), !l.defaultPrevented;
|
|
122
122
|
}
|
|
123
123
|
return !0;
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
const
|
|
127
|
-
let
|
|
128
|
-
const
|
|
126
|
+
const K = [], ue = [];
|
|
127
|
+
let J = [];
|
|
128
|
+
const Ne = [], Ge = /* @__PURE__ */ Promise.resolve();
|
|
129
129
|
let he = !1;
|
|
130
130
|
function De() {
|
|
131
|
-
he || (he = !0,
|
|
131
|
+
he || (he = !0, Ge.then($));
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
return De(),
|
|
133
|
+
function yt() {
|
|
134
|
+
return De(), Ge;
|
|
135
135
|
}
|
|
136
136
|
function de(r) {
|
|
137
|
-
|
|
137
|
+
J.push(r);
|
|
138
138
|
}
|
|
139
139
|
const fe = /* @__PURE__ */ new Set();
|
|
140
|
-
let
|
|
140
|
+
let B = 0;
|
|
141
141
|
function $() {
|
|
142
|
-
if (
|
|
142
|
+
if (B !== 0)
|
|
143
143
|
return;
|
|
144
144
|
const r = ee;
|
|
145
145
|
do {
|
|
146
146
|
try {
|
|
147
|
-
for (;
|
|
148
|
-
const e =
|
|
149
|
-
|
|
147
|
+
for (; B < K.length; ) {
|
|
148
|
+
const e = K[B];
|
|
149
|
+
B++, q(e), vt(e.$$);
|
|
150
150
|
}
|
|
151
151
|
} catch (e) {
|
|
152
|
-
throw
|
|
152
|
+
throw K.length = 0, B = 0, e;
|
|
153
153
|
}
|
|
154
|
-
for (q(null),
|
|
154
|
+
for (q(null), K.length = 0, B = 0; ue.length; )
|
|
155
155
|
ue.pop()();
|
|
156
|
-
for (let e = 0; e <
|
|
157
|
-
const t =
|
|
156
|
+
for (let e = 0; e < J.length; e += 1) {
|
|
157
|
+
const t = J[e];
|
|
158
158
|
fe.has(t) || (fe.add(t), t());
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
} while (
|
|
162
|
-
for (;
|
|
163
|
-
|
|
160
|
+
J.length = 0;
|
|
161
|
+
} while (K.length);
|
|
162
|
+
for (; Ne.length; )
|
|
163
|
+
Ne.pop()();
|
|
164
164
|
he = !1, fe.clear(), q(r);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function vt(r) {
|
|
167
167
|
if (r.fragment !== null) {
|
|
168
168
|
r.update(), te(r.before_update);
|
|
169
169
|
const e = r.dirty;
|
|
170
170
|
r.dirty = [-1], r.fragment && r.fragment.p(r.ctx, e), r.after_update.forEach(de);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function wt(r) {
|
|
174
174
|
const e = [], t = [];
|
|
175
|
-
|
|
175
|
+
J.forEach((i) => r.indexOf(i) === -1 ? e.push(i) : t.push(i)), t.forEach((i) => i()), J = e;
|
|
176
176
|
}
|
|
177
|
-
const
|
|
177
|
+
const pt = /* @__PURE__ */ new Set();
|
|
178
178
|
function _t(r, e) {
|
|
179
|
-
r && r.i && (
|
|
179
|
+
r && r.i && (pt.delete(r), r.i(e));
|
|
180
180
|
}
|
|
181
181
|
function kt(r, e, t) {
|
|
182
|
-
const { fragment: i, after_update:
|
|
182
|
+
const { fragment: i, after_update: o } = r.$$;
|
|
183
183
|
i && i.m(e, t), de(() => {
|
|
184
|
-
const
|
|
185
|
-
r.$$.on_destroy ? r.$$.on_destroy.push(...
|
|
186
|
-
}),
|
|
184
|
+
const l = r.$$.on_mount.map(Ve).filter(Ue);
|
|
185
|
+
r.$$.on_destroy ? r.$$.on_destroy.push(...l) : te(l), r.$$.on_mount = [];
|
|
186
|
+
}), o.forEach(de);
|
|
187
187
|
}
|
|
188
188
|
function xt(r, e) {
|
|
189
189
|
const t = r.$$;
|
|
190
|
-
t.fragment !== null && (
|
|
190
|
+
t.fragment !== null && (wt(t.after_update), te(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
|
|
191
191
|
}
|
|
192
192
|
function Et(r, e) {
|
|
193
|
-
r.$$.dirty[0] === -1 && (
|
|
193
|
+
r.$$.dirty[0] === -1 && (K.push(r), De(), r.$$.dirty.fill(0)), r.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
194
194
|
}
|
|
195
|
-
function $t(r, e, t, i,
|
|
195
|
+
function $t(r, e, t, i, o, l, s = null, f = [-1]) {
|
|
196
196
|
const a = ee;
|
|
197
197
|
q(r);
|
|
198
198
|
const h = r.$$ = {
|
|
199
199
|
fragment: null,
|
|
200
200
|
ctx: [],
|
|
201
201
|
// state
|
|
202
|
-
props:
|
|
202
|
+
props: l,
|
|
203
203
|
update: Q,
|
|
204
|
-
not_equal:
|
|
204
|
+
not_equal: o,
|
|
205
205
|
bound: Ie(),
|
|
206
206
|
// lifecycle
|
|
207
207
|
on_mount: [],
|
|
@@ -217,75 +217,75 @@ function $t(r, e, t, i, l, o, s = null, f = [-1]) {
|
|
|
217
217
|
root: e.target || a.$$.root
|
|
218
218
|
};
|
|
219
219
|
s && s(h.root);
|
|
220
|
-
let
|
|
221
|
-
if (h.ctx = t ? t(r, e.props || {}, (C,
|
|
222
|
-
const
|
|
223
|
-
return h.ctx &&
|
|
224
|
-
}) : [], h.update(),
|
|
220
|
+
let Z = !1;
|
|
221
|
+
if (h.ctx = t ? t(r, e.props || {}, (C, M, ...V) => {
|
|
222
|
+
const G = V.length ? V[0] : M;
|
|
223
|
+
return h.ctx && o(h.ctx[C], h.ctx[C] = G) && (!h.skip_bound && h.bound[C] && h.bound[C](G), Z && Et(r, C)), M;
|
|
224
|
+
}) : [], h.update(), Z = !0, te(h.before_update), h.fragment = i ? i(h.ctx) : !1, e.target) {
|
|
225
225
|
if (e.hydrate) {
|
|
226
226
|
const C = ut(e.target);
|
|
227
|
-
h.fragment && h.fragment.l(C), C.forEach(
|
|
227
|
+
h.fragment && h.fragment.l(C), C.forEach(N);
|
|
228
228
|
} else
|
|
229
229
|
h.fragment && h.fragment.c();
|
|
230
230
|
e.intro && _t(r.$$.fragment), kt(r, e.target, e.anchor), $();
|
|
231
231
|
}
|
|
232
232
|
q(a);
|
|
233
233
|
}
|
|
234
|
-
let
|
|
235
|
-
typeof HTMLElement == "function" && (
|
|
234
|
+
let Xe;
|
|
235
|
+
typeof HTMLElement == "function" && (Xe = class extends HTMLElement {
|
|
236
236
|
constructor(e, t, i) {
|
|
237
237
|
super();
|
|
238
238
|
/** The Svelte component constructor */
|
|
239
|
-
|
|
239
|
+
T(this, "$$ctor");
|
|
240
240
|
/** Slots */
|
|
241
|
-
|
|
241
|
+
T(this, "$$s");
|
|
242
242
|
/** The Svelte component instance */
|
|
243
|
-
|
|
243
|
+
T(this, "$$c");
|
|
244
244
|
/** Whether or not the custom element is connected */
|
|
245
|
-
|
|
245
|
+
T(this, "$$cn", !1);
|
|
246
246
|
/** Component props data */
|
|
247
|
-
|
|
247
|
+
T(this, "$$d", {});
|
|
248
248
|
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
249
|
-
|
|
249
|
+
T(this, "$$r", !1);
|
|
250
250
|
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
251
|
-
|
|
251
|
+
T(this, "$$p_d", {});
|
|
252
252
|
/** @type {Record<string, Function[]>} Event listeners */
|
|
253
|
-
|
|
253
|
+
T(this, "$$l", {});
|
|
254
254
|
/** @type {Map<Function, Function>} Event listener unsubscribe functions */
|
|
255
|
-
|
|
255
|
+
T(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
256
256
|
this.$$ctor = e, this.$$s = t, i && this.attachShadow({ mode: "open" });
|
|
257
257
|
}
|
|
258
258
|
addEventListener(e, t, i) {
|
|
259
259
|
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
|
|
260
|
-
const
|
|
261
|
-
this.$$l_u.set(t,
|
|
260
|
+
const o = this.$$c.$on(e, t);
|
|
261
|
+
this.$$l_u.set(t, o);
|
|
262
262
|
}
|
|
263
263
|
super.addEventListener(e, t, i);
|
|
264
264
|
}
|
|
265
265
|
removeEventListener(e, t, i) {
|
|
266
266
|
if (super.removeEventListener(e, t, i), this.$$c) {
|
|
267
|
-
const
|
|
268
|
-
|
|
267
|
+
const o = this.$$l_u.get(t);
|
|
268
|
+
o && (o(), this.$$l_u.delete(t));
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
async connectedCallback() {
|
|
272
272
|
if (this.$$cn = !0, !this.$$c) {
|
|
273
|
-
let e = function(
|
|
273
|
+
let e = function(l) {
|
|
274
274
|
return () => {
|
|
275
275
|
let s;
|
|
276
276
|
return {
|
|
277
277
|
c: function() {
|
|
278
|
-
s = R("slot"),
|
|
278
|
+
s = R("slot"), l !== "default" && c(s, "name", l);
|
|
279
279
|
},
|
|
280
280
|
/**
|
|
281
281
|
* @param {HTMLElement} target
|
|
282
282
|
* @param {HTMLElement} [anchor]
|
|
283
283
|
*/
|
|
284
|
-
m: function(h,
|
|
285
|
-
|
|
284
|
+
m: function(h, Z) {
|
|
285
|
+
j(h, s, Z);
|
|
286
286
|
},
|
|
287
287
|
d: function(h) {
|
|
288
|
-
h &&
|
|
288
|
+
h && N(s);
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
291
|
};
|
|
@@ -293,14 +293,14 @@ typeof HTMLElement == "function" && (Oe = class extends HTMLElement {
|
|
|
293
293
|
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
294
294
|
return;
|
|
295
295
|
const t = {}, i = dt(this);
|
|
296
|
-
for (const
|
|
297
|
-
|
|
298
|
-
for (const
|
|
299
|
-
const s = this.$$g_p(
|
|
300
|
-
s in this.$$d || (this.$$d[s] =
|
|
296
|
+
for (const l of this.$$s)
|
|
297
|
+
l in i && (t[l] = [e(l)]);
|
|
298
|
+
for (const l of this.attributes) {
|
|
299
|
+
const s = this.$$g_p(l.name);
|
|
300
|
+
s in this.$$d || (this.$$d[s] = le(s, l.value, this.$$p_d, "toProp"));
|
|
301
301
|
}
|
|
302
|
-
for (const
|
|
303
|
-
!(
|
|
302
|
+
for (const l in this.$$p_d)
|
|
303
|
+
!(l in this.$$d) && this[l] !== void 0 && (this.$$d[l] = this[l], delete this[l]);
|
|
304
304
|
this.$$c = new this.$$ctor({
|
|
305
305
|
target: this.shadowRoot || this,
|
|
306
306
|
props: {
|
|
@@ -311,24 +311,24 @@ typeof HTMLElement == "function" && (Oe = class extends HTMLElement {
|
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
});
|
|
314
|
-
const
|
|
314
|
+
const o = () => {
|
|
315
315
|
this.$$r = !0;
|
|
316
|
-
for (const
|
|
317
|
-
if (this.$$d[
|
|
318
|
-
const s =
|
|
319
|
-
|
|
320
|
-
this.$$d[
|
|
316
|
+
for (const l in this.$$p_d)
|
|
317
|
+
if (this.$$d[l] = this.$$c.$$.ctx[this.$$c.$$.props[l]], this.$$p_d[l].reflect) {
|
|
318
|
+
const s = le(
|
|
319
|
+
l,
|
|
320
|
+
this.$$d[l],
|
|
321
321
|
this.$$p_d,
|
|
322
322
|
"toAttribute"
|
|
323
323
|
);
|
|
324
|
-
s == null ? this.removeAttribute(this.$$p_d[
|
|
324
|
+
s == null ? this.removeAttribute(this.$$p_d[l].attribute || l) : this.setAttribute(this.$$p_d[l].attribute || l, s);
|
|
325
325
|
}
|
|
326
326
|
this.$$r = !1;
|
|
327
327
|
};
|
|
328
|
-
this.$$c.$$.after_update.push(
|
|
329
|
-
for (const
|
|
330
|
-
for (const s of this.$$l[
|
|
331
|
-
const f = this.$$c.$on(
|
|
328
|
+
this.$$c.$$.after_update.push(o), o();
|
|
329
|
+
for (const l in this.$$l)
|
|
330
|
+
for (const s of this.$$l[l]) {
|
|
331
|
+
const f = this.$$c.$on(l, s);
|
|
332
332
|
this.$$l_u.set(s, f);
|
|
333
333
|
}
|
|
334
334
|
this.$$l = {};
|
|
@@ -337,8 +337,8 @@ typeof HTMLElement == "function" && (Oe = class extends HTMLElement {
|
|
|
337
337
|
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
338
338
|
// and setting attributes through setAttribute etc, this is helpful
|
|
339
339
|
attributeChangedCallback(e, t, i) {
|
|
340
|
-
var
|
|
341
|
-
this.$$r || (e = this.$$g_p(e), this.$$d[e] =
|
|
340
|
+
var o;
|
|
341
|
+
this.$$r || (e = this.$$g_p(e), this.$$d[e] = le(e, i, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [e]: this.$$d[e] }));
|
|
342
342
|
}
|
|
343
343
|
disconnectedCallback() {
|
|
344
344
|
this.$$cn = !1, Promise.resolve().then(() => {
|
|
@@ -351,13 +351,13 @@ typeof HTMLElement == "function" && (Oe = class extends HTMLElement {
|
|
|
351
351
|
) || e;
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
|
-
function
|
|
355
|
-
var
|
|
356
|
-
const
|
|
357
|
-
if (e =
|
|
354
|
+
function le(r, e, t, i) {
|
|
355
|
+
var l;
|
|
356
|
+
const o = (l = t[r]) == null ? void 0 : l.type;
|
|
357
|
+
if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !i || !t[r])
|
|
358
358
|
return e;
|
|
359
359
|
if (i === "toAttribute")
|
|
360
|
-
switch (
|
|
360
|
+
switch (o) {
|
|
361
361
|
case "Object":
|
|
362
362
|
case "Array":
|
|
363
363
|
return e == null ? null : JSON.stringify(e);
|
|
@@ -369,7 +369,7 @@ function oe(r, e, t, i) {
|
|
|
369
369
|
return e;
|
|
370
370
|
}
|
|
371
371
|
else
|
|
372
|
-
switch (
|
|
372
|
+
switch (o) {
|
|
373
373
|
case "Object":
|
|
374
374
|
case "Array":
|
|
375
375
|
return e && JSON.parse(e);
|
|
@@ -381,10 +381,10 @@ function oe(r, e, t, i) {
|
|
|
381
381
|
return e;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
function Ct(r, e, t, i,
|
|
385
|
-
let s = class extends
|
|
384
|
+
function Ct(r, e, t, i, o, l) {
|
|
385
|
+
let s = class extends Xe {
|
|
386
386
|
constructor() {
|
|
387
|
-
super(r, t,
|
|
387
|
+
super(r, t, o), this.$$p_d = e;
|
|
388
388
|
}
|
|
389
389
|
static get observedAttributes() {
|
|
390
390
|
return Object.keys(e).map(
|
|
@@ -399,7 +399,7 @@ function Ct(r, e, t, i, l, o) {
|
|
|
399
399
|
},
|
|
400
400
|
set(a) {
|
|
401
401
|
var h;
|
|
402
|
-
a =
|
|
402
|
+
a = le(f, a, e), this.$$d[f] = a, (h = this.$$c) == null || h.$set({ [f]: a });
|
|
403
403
|
}
|
|
404
404
|
});
|
|
405
405
|
}), i.forEach((f) => {
|
|
@@ -409,7 +409,7 @@ function Ct(r, e, t, i, l, o) {
|
|
|
409
409
|
return (a = this.$$c) == null ? void 0 : a[f];
|
|
410
410
|
}
|
|
411
411
|
});
|
|
412
|
-
}),
|
|
412
|
+
}), l && (s = l(s)), r.element = /** @type {any} */
|
|
413
413
|
s, s;
|
|
414
414
|
}
|
|
415
415
|
class Lt {
|
|
@@ -421,7 +421,7 @@ class Lt {
|
|
|
421
421
|
*
|
|
422
422
|
* @type {any}
|
|
423
423
|
*/
|
|
424
|
-
|
|
424
|
+
T(this, "$$");
|
|
425
425
|
/**
|
|
426
426
|
* ### PRIVATE API
|
|
427
427
|
*
|
|
@@ -429,7 +429,7 @@ class Lt {
|
|
|
429
429
|
*
|
|
430
430
|
* @type {any}
|
|
431
431
|
*/
|
|
432
|
-
|
|
432
|
+
T(this, "$$set");
|
|
433
433
|
}
|
|
434
434
|
/** @returns {void} */
|
|
435
435
|
$destroy() {
|
|
@@ -446,8 +446,8 @@ class Lt {
|
|
|
446
446
|
return Q;
|
|
447
447
|
const i = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
448
448
|
return i.push(t), () => {
|
|
449
|
-
const
|
|
450
|
-
|
|
449
|
+
const o = i.indexOf(t);
|
|
450
|
+
o !== -1 && i.splice(o, 1);
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
453
|
/**
|
|
@@ -455,16 +455,16 @@ class Lt {
|
|
|
455
455
|
* @returns {void}
|
|
456
456
|
*/
|
|
457
457
|
$set(e) {
|
|
458
|
-
this.$$set && !
|
|
458
|
+
this.$$set && !lt(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
const Rt = "4";
|
|
462
462
|
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Rt);
|
|
463
|
-
const
|
|
464
|
-
function
|
|
463
|
+
const Oe = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGQoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBwKGUsdCxvKXtyZXR1cm4gZChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChvLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGcoZSx0LG89IlNIQS0yNTYiLGw9MWU2LGM9MCl7Y29uc3QgYT1uZXcgQWJvcnRDb250cm9sbGVyLGk9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgbj1jO248PWw7bis9MSl7aWYoYS5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCBwKHQsbixvKT09PWUpcmV0dXJue251bWJlcjpuLHRvb2s6RGF0ZS5ub3coKS1pfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjphfX1sZXQgcjtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOm99PWUuZGF0YTtpZih0PT09ImFib3J0IilyPT1udWxsfHxyLmFib3J0KCkscj12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtjb25zdHthbGc6bCxjaGFsbGVuZ2U6YyxtYXg6YSxzYWx0Omksc3RhcnQ6dX09b3x8e30sbj1nKGMsaSxsLGEsdSk7cj1uLmNvbnRyb2xsZXIsbi5wcm9taXNlLnRoZW4ocz0+e3NlbGYucG9zdE1lc3NhZ2UocyYmey4uLnMsd29ya2VyOiEwfSl9KX19fSkoKTsK", It = (r) => Uint8Array.from(atob(r), (e) => e.charCodeAt(0)), Se = typeof window < "u" && window.Blob && new Blob([It(Oe)], { type: "text/javascript;charset=utf-8" });
|
|
464
|
+
function zt(r) {
|
|
465
465
|
let e;
|
|
466
466
|
try {
|
|
467
|
-
if (e =
|
|
467
|
+
if (e = Se && (window.URL || window.webkitURL).createObjectURL(Se), !e)
|
|
468
468
|
throw "";
|
|
469
469
|
const t = new Worker(e, {
|
|
470
470
|
name: r == null ? void 0 : r.name
|
|
@@ -474,7 +474,7 @@ function Nt(r) {
|
|
|
474
474
|
}), t;
|
|
475
475
|
} catch {
|
|
476
476
|
return new Worker(
|
|
477
|
-
"data:text/javascript;base64," +
|
|
477
|
+
"data:text/javascript;base64," + Oe,
|
|
478
478
|
{
|
|
479
479
|
name: r == null ? void 0 : r.name
|
|
480
480
|
}
|
|
@@ -483,37 +483,37 @@ function Nt(r) {
|
|
|
483
483
|
e && (window.URL || window.webkitURL).revokeObjectURL(e);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
const
|
|
487
|
-
function
|
|
486
|
+
const Nt = new TextEncoder();
|
|
487
|
+
function St(r) {
|
|
488
488
|
return [...new Uint8Array(r)].map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
489
489
|
}
|
|
490
|
-
async function
|
|
490
|
+
async function jt(r, e = "SHA-256", t = 1e5) {
|
|
491
491
|
const i = Date.now().toString(16);
|
|
492
492
|
r || (r = Math.round(Math.random() * t));
|
|
493
|
-
const
|
|
493
|
+
const o = await Fe(i, r, e);
|
|
494
494
|
return {
|
|
495
495
|
algorithm: e,
|
|
496
|
-
challenge:
|
|
496
|
+
challenge: o,
|
|
497
497
|
salt: i,
|
|
498
498
|
signature: ""
|
|
499
499
|
};
|
|
500
500
|
}
|
|
501
|
-
async function
|
|
502
|
-
return
|
|
501
|
+
async function Fe(r, e, t) {
|
|
502
|
+
return St(
|
|
503
503
|
await crypto.subtle.digest(
|
|
504
504
|
t.toUpperCase(),
|
|
505
|
-
|
|
505
|
+
Nt.encode(r + e)
|
|
506
506
|
)
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
const
|
|
509
|
+
function Zt(r, e, t = "SHA-256", i = 1e6, o = 0) {
|
|
510
|
+
const l = new AbortController(), s = Date.now();
|
|
511
511
|
return {
|
|
512
512
|
promise: (async () => {
|
|
513
|
-
for (let a =
|
|
514
|
-
if (
|
|
513
|
+
for (let a = o; a <= i; a += 1) {
|
|
514
|
+
if (l.signal.aborted)
|
|
515
515
|
return null;
|
|
516
|
-
if (await
|
|
516
|
+
if (await Fe(e, a, t) === r)
|
|
517
517
|
return {
|
|
518
518
|
number: a,
|
|
519
519
|
took: Date.now() - s
|
|
@@ -521,29 +521,28 @@ function At(r, e, t = "SHA-256", i = 1e6, l = 0) {
|
|
|
521
521
|
}
|
|
522
522
|
return null;
|
|
523
523
|
})(),
|
|
524
|
-
controller:
|
|
524
|
+
controller: l
|
|
525
525
|
};
|
|
526
526
|
}
|
|
527
|
-
var
|
|
528
|
-
function
|
|
529
|
-
st(r, "svelte-
|
|
530
|
-
var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);overflow:hidden;position:relative;text-align:left}.altcha.svelte-14ngypa.svelte-14ngypa:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha-main.svelte-14ngypa.svelte-14ngypa{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-14ngypa.svelte-14ngypa{flex-grow:1}.altcha-label.svelte-14ngypa label.svelte-14ngypa{cursor:pointer}.altcha-logo.svelte-14ngypa.svelte-14ngypa{color:currentColor;opacity:0.3}.altcha-logo.svelte-14ngypa.svelte-14ngypa:hover{opacity:1}.altcha-error.svelte-14ngypa.svelte-14ngypa{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-14ngypa.svelte-14ngypa{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-14ngypa.svelte-14ngypa:hover{opacity:1}.altcha-footer.svelte-14ngypa>.svelte-14ngypa:first-child{flex-grow:1}.altcha-footer.svelte-14ngypa a{color:currentColor}.altcha-checkbox.svelte-14ngypa.svelte-14ngypa{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-14ngypa input.svelte-14ngypa{width:18px;height:18px;margin:0}.altcha-hidden.svelte-14ngypa.svelte-14ngypa{display:none}.altcha-spinner.svelte-14ngypa.svelte-14ngypa{animation:svelte-14ngypa-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-14ngypa-altcha-spinner{100%{transform:rotate(360deg)}}`);
|
|
527
|
+
var b = /* @__PURE__ */ ((r) => (r.ERROR = "error", r.VERIFIED = "verified", r.VERIFYING = "verifying", r.UNVERIFIED = "unverified", r.EXPIRED = "expired", r))(b || {});
|
|
528
|
+
function At(r) {
|
|
529
|
+
st(r, "svelte-15co9zy", ".altcha.svelte-15co9zy.svelte-15co9zy{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);overflow:hidden;position:relative;text-align:left}.altcha.svelte-15co9zy.svelte-15co9zy:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha-main.svelte-15co9zy.svelte-15co9zy{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-15co9zy.svelte-15co9zy{flex-grow:1}.altcha-label.svelte-15co9zy label.svelte-15co9zy{cursor:pointer}.altcha-logo.svelte-15co9zy.svelte-15co9zy{color:currentColor;opacity:0.3}.altcha-logo.svelte-15co9zy.svelte-15co9zy:hover{opacity:1}.altcha-error.svelte-15co9zy.svelte-15co9zy{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-15co9zy.svelte-15co9zy{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-15co9zy.svelte-15co9zy:hover{opacity:1}.altcha-footer.svelte-15co9zy>.svelte-15co9zy:first-child{flex-grow:1}.altcha-footer.svelte-15co9zy a{color:currentColor}.altcha-checkbox.svelte-15co9zy.svelte-15co9zy{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-15co9zy input.svelte-15co9zy{width:18px;height:18px;margin:0}.altcha-hidden.svelte-15co9zy.svelte-15co9zy{display:none}.altcha-spinner.svelte-15co9zy.svelte-15co9zy{animation:svelte-15co9zy-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-15co9zy-altcha-spinner{100%{transform:rotate(360deg)}}");
|
|
531
530
|
}
|
|
532
|
-
function
|
|
531
|
+
function je(r) {
|
|
533
532
|
let e, t, i;
|
|
534
533
|
return {
|
|
535
534
|
c() {
|
|
536
|
-
e =
|
|
535
|
+
e = X("svg"), t = X("path"), i = X("path"), c(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"), c(t, "fill", "currentColor"), c(t, "opacity", ".25"), c(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"), c(i, "fill", "currentColor"), c(i, "class", "altcha-spinner svelte-15co9zy"), c(e, "width", "24"), c(e, "height", "24"), c(e, "viewBox", "0 0 24 24"), c(e, "xmlns", "http://www.w3.org/2000/svg");
|
|
537
536
|
},
|
|
538
|
-
m(
|
|
539
|
-
|
|
537
|
+
m(o, l) {
|
|
538
|
+
j(o, e, l), v(e, t), v(e, i);
|
|
540
539
|
},
|
|
541
|
-
d(
|
|
542
|
-
|
|
540
|
+
d(o) {
|
|
541
|
+
o && N(e);
|
|
543
542
|
}
|
|
544
543
|
};
|
|
545
544
|
}
|
|
546
|
-
function
|
|
545
|
+
function Tt(r) {
|
|
547
546
|
let e, t = (
|
|
548
547
|
/*_strings*/
|
|
549
548
|
r[9].label + ""
|
|
@@ -551,24 +550,24 @@ function Mt(r) {
|
|
|
551
550
|
return {
|
|
552
551
|
c() {
|
|
553
552
|
e = R("label"), c(e, "for", i = /*name*/
|
|
554
|
-
r[3] + "_checkbox"), c(e, "class", "svelte-
|
|
553
|
+
r[3] + "_checkbox"), c(e, "class", "svelte-15co9zy");
|
|
555
554
|
},
|
|
556
|
-
m(
|
|
557
|
-
|
|
555
|
+
m(o, l) {
|
|
556
|
+
j(o, e, l), e.innerHTML = t;
|
|
558
557
|
},
|
|
559
|
-
p(
|
|
560
|
-
|
|
558
|
+
p(o, l) {
|
|
559
|
+
l[0] & /*_strings*/
|
|
561
560
|
512 && t !== (t = /*_strings*/
|
|
562
|
-
|
|
561
|
+
o[9].label + "") && (e.innerHTML = t), l[0] & /*name*/
|
|
563
562
|
8 && i !== (i = /*name*/
|
|
564
|
-
|
|
563
|
+
o[3] + "_checkbox") && c(e, "for", i);
|
|
565
564
|
},
|
|
566
|
-
d(
|
|
567
|
-
|
|
565
|
+
d(o) {
|
|
566
|
+
o && N(e);
|
|
568
567
|
}
|
|
569
568
|
};
|
|
570
569
|
}
|
|
571
|
-
function
|
|
570
|
+
function Mt(r) {
|
|
572
571
|
let e, t = (
|
|
573
572
|
/*_strings*/
|
|
574
573
|
r[9].verifying + ""
|
|
@@ -577,91 +576,91 @@ function Vt(r) {
|
|
|
577
576
|
c() {
|
|
578
577
|
e = R("span");
|
|
579
578
|
},
|
|
580
|
-
m(i,
|
|
581
|
-
|
|
579
|
+
m(i, o) {
|
|
580
|
+
j(i, e, o), e.innerHTML = t;
|
|
582
581
|
},
|
|
583
|
-
p(i,
|
|
584
|
-
|
|
582
|
+
p(i, o) {
|
|
583
|
+
o[0] & /*_strings*/
|
|
585
584
|
512 && t !== (t = /*_strings*/
|
|
586
585
|
i[9].verifying + "") && (e.innerHTML = t);
|
|
587
586
|
},
|
|
588
587
|
d(i) {
|
|
589
|
-
i &&
|
|
588
|
+
i && N(e);
|
|
590
589
|
}
|
|
591
590
|
};
|
|
592
591
|
}
|
|
593
|
-
function
|
|
592
|
+
function Vt(r) {
|
|
594
593
|
let e, t = (
|
|
595
594
|
/*_strings*/
|
|
596
595
|
r[9].verified + ""
|
|
597
|
-
), i,
|
|
596
|
+
), i, o;
|
|
598
597
|
return {
|
|
599
598
|
c() {
|
|
600
|
-
e = R("span"), i =
|
|
601
|
-
|
|
599
|
+
e = R("span"), i = W(), o = R("input"), c(o, "type", "hidden"), c(
|
|
600
|
+
o,
|
|
602
601
|
"name",
|
|
603
602
|
/*name*/
|
|
604
603
|
r[3]
|
|
605
|
-
),
|
|
604
|
+
), o.value = /*payload*/
|
|
606
605
|
r[4];
|
|
607
606
|
},
|
|
608
|
-
m(
|
|
609
|
-
|
|
607
|
+
m(l, s) {
|
|
608
|
+
j(l, e, s), e.innerHTML = t, j(l, i, s), j(l, o, s);
|
|
610
609
|
},
|
|
611
|
-
p(
|
|
610
|
+
p(l, s) {
|
|
612
611
|
s[0] & /*_strings*/
|
|
613
612
|
512 && t !== (t = /*_strings*/
|
|
614
|
-
|
|
613
|
+
l[9].verified + "") && (e.innerHTML = t), s[0] & /*name*/
|
|
615
614
|
8 && c(
|
|
616
|
-
|
|
615
|
+
o,
|
|
617
616
|
"name",
|
|
618
617
|
/*name*/
|
|
619
|
-
|
|
618
|
+
l[3]
|
|
620
619
|
), s[0] & /*payload*/
|
|
621
|
-
16 && (
|
|
622
|
-
|
|
620
|
+
16 && (o.value = /*payload*/
|
|
621
|
+
l[4]);
|
|
623
622
|
},
|
|
624
|
-
d(
|
|
625
|
-
|
|
623
|
+
d(l) {
|
|
624
|
+
l && (N(e), N(i), N(o));
|
|
626
625
|
}
|
|
627
626
|
};
|
|
628
627
|
}
|
|
629
|
-
function
|
|
630
|
-
let e, t, i,
|
|
628
|
+
function Ze(r) {
|
|
629
|
+
let e, t, i, o, l, s;
|
|
631
630
|
return {
|
|
632
631
|
c() {
|
|
633
|
-
e = R("div"), t = R("a"), i =
|
|
632
|
+
e = R("div"), t = R("a"), i = X("svg"), o = X("path"), l = X("path"), s = X("path"), c(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"), c(o, "fill", "currentColor"), c(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"), c(l, "fill", "currentColor"), c(s, "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"), c(s, "fill", "currentColor"), c(i, "width", "22"), c(i, "height", "22"), c(i, "viewBox", "0 0 20 20"), c(i, "fill", "none"), c(i, "xmlns", "http://www.w3.org/2000/svg"), c(t, "href", He), c(t, "target", "_blank"), c(t, "class", "altcha-logo svelte-15co9zy");
|
|
634
633
|
},
|
|
635
634
|
m(f, a) {
|
|
636
|
-
|
|
635
|
+
j(f, e, a), v(e, t), v(t, i), v(i, o), v(i, l), v(i, s);
|
|
637
636
|
},
|
|
638
637
|
p: Q,
|
|
639
638
|
d(f) {
|
|
640
|
-
f &&
|
|
639
|
+
f && N(e);
|
|
641
640
|
}
|
|
642
641
|
};
|
|
643
642
|
}
|
|
644
|
-
function
|
|
645
|
-
let e, t, i,
|
|
646
|
-
function
|
|
643
|
+
function Ae(r) {
|
|
644
|
+
let e, t, i, o;
|
|
645
|
+
function l(a, h) {
|
|
647
646
|
return (
|
|
648
647
|
/*state*/
|
|
649
|
-
a[5] ===
|
|
648
|
+
a[5] === b.EXPIRED ? Gt : Ut
|
|
650
649
|
);
|
|
651
650
|
}
|
|
652
|
-
let s =
|
|
651
|
+
let s = l(r), f = s(r);
|
|
653
652
|
return {
|
|
654
653
|
c() {
|
|
655
|
-
e = R("div"), t =
|
|
654
|
+
e = R("div"), t = X("svg"), i = X("path"), o = W(), f.c(), c(i, "stroke-linecap", "round"), c(i, "stroke-linejoin", "round"), c(i, "d", "M6 18L18 6M6 6l12 12"), c(t, "width", "14"), c(t, "height", "14"), c(t, "xmlns", "http://www.w3.org/2000/svg"), c(t, "fill", "none"), c(t, "viewBox", "0 0 24 24"), c(t, "stroke-width", "1.5"), c(t, "stroke", "currentColor"), c(e, "class", "altcha-error svelte-15co9zy");
|
|
656
655
|
},
|
|
657
656
|
m(a, h) {
|
|
658
|
-
|
|
657
|
+
j(a, e, h), v(e, t), v(t, i), v(e, o), f.m(e, null);
|
|
659
658
|
},
|
|
660
659
|
p(a, h) {
|
|
661
|
-
s === (s =
|
|
660
|
+
s === (s = l(a)) && f ? f.p(a, h) : (f.d(1), f = s(a), f && (f.c(), f.m(e, null)));
|
|
662
661
|
},
|
|
663
662
|
d(a) {
|
|
664
|
-
a &&
|
|
663
|
+
a && N(e), f.d();
|
|
665
664
|
}
|
|
666
665
|
};
|
|
667
666
|
}
|
|
@@ -679,13 +678,13 @@ function Ut(r) {
|
|
|
679
678
|
r[8]
|
|
680
679
|
);
|
|
681
680
|
},
|
|
682
|
-
m(i,
|
|
683
|
-
|
|
681
|
+
m(i, o) {
|
|
682
|
+
j(i, e, o), e.innerHTML = t;
|
|
684
683
|
},
|
|
685
|
-
p(i,
|
|
686
|
-
|
|
684
|
+
p(i, o) {
|
|
685
|
+
o[0] & /*_strings*/
|
|
687
686
|
512 && t !== (t = /*_strings*/
|
|
688
|
-
i[9].error + "") && (e.innerHTML = t),
|
|
687
|
+
i[9].error + "") && (e.innerHTML = t), o[0] & /*error*/
|
|
689
688
|
256 && c(
|
|
690
689
|
e,
|
|
691
690
|
"title",
|
|
@@ -694,11 +693,11 @@ function Ut(r) {
|
|
|
694
693
|
);
|
|
695
694
|
},
|
|
696
695
|
d(i) {
|
|
697
|
-
i &&
|
|
696
|
+
i && N(e);
|
|
698
697
|
}
|
|
699
698
|
};
|
|
700
699
|
}
|
|
701
|
-
function
|
|
700
|
+
function Gt(r) {
|
|
702
701
|
let e, t = (
|
|
703
702
|
/*_strings*/
|
|
704
703
|
r[9].expired + ""
|
|
@@ -712,13 +711,13 @@ function Xt(r) {
|
|
|
712
711
|
r[8]
|
|
713
712
|
);
|
|
714
713
|
},
|
|
715
|
-
m(i,
|
|
716
|
-
|
|
714
|
+
m(i, o) {
|
|
715
|
+
j(i, e, o), e.innerHTML = t;
|
|
717
716
|
},
|
|
718
|
-
p(i,
|
|
719
|
-
|
|
717
|
+
p(i, o) {
|
|
718
|
+
o[0] & /*_strings*/
|
|
720
719
|
512 && t !== (t = /*_strings*/
|
|
721
|
-
i[9].expired + "") && (e.innerHTML = t),
|
|
720
|
+
i[9].expired + "") && (e.innerHTML = t), o[0] & /*error*/
|
|
722
721
|
256 && c(
|
|
723
722
|
e,
|
|
724
723
|
"title",
|
|
@@ -727,68 +726,68 @@ function Xt(r) {
|
|
|
727
726
|
);
|
|
728
727
|
},
|
|
729
728
|
d(i) {
|
|
730
|
-
i &&
|
|
729
|
+
i && N(e);
|
|
731
730
|
}
|
|
732
731
|
};
|
|
733
732
|
}
|
|
734
|
-
function
|
|
733
|
+
function Te(r) {
|
|
735
734
|
let e, t, i = (
|
|
736
735
|
/*_strings*/
|
|
737
736
|
r[9].footer + ""
|
|
738
737
|
);
|
|
739
738
|
return {
|
|
740
739
|
c() {
|
|
741
|
-
e = R("div"), t = R("div"), c(t, "class", "svelte-
|
|
740
|
+
e = R("div"), t = R("div"), c(t, "class", "svelte-15co9zy"), c(e, "class", "altcha-footer svelte-15co9zy");
|
|
742
741
|
},
|
|
743
|
-
m(
|
|
744
|
-
|
|
742
|
+
m(o, l) {
|
|
743
|
+
j(o, e, l), v(e, t), t.innerHTML = i;
|
|
745
744
|
},
|
|
746
|
-
p(
|
|
747
|
-
|
|
745
|
+
p(o, l) {
|
|
746
|
+
l[0] & /*_strings*/
|
|
748
747
|
512 && i !== (i = /*_strings*/
|
|
749
|
-
|
|
748
|
+
o[9].footer + "") && (t.innerHTML = i);
|
|
750
749
|
},
|
|
751
|
-
d(
|
|
752
|
-
|
|
750
|
+
d(o) {
|
|
751
|
+
o && N(e);
|
|
753
752
|
}
|
|
754
753
|
};
|
|
755
754
|
}
|
|
756
755
|
function Dt(r) {
|
|
757
|
-
let e, t, i,
|
|
756
|
+
let e, t, i, o, l, s, f, a, h, Z, C, M, V, G, p = (
|
|
758
757
|
/*state*/
|
|
759
|
-
r[5] ===
|
|
758
|
+
r[5] === b.VERIFYING && je()
|
|
760
759
|
);
|
|
761
|
-
function
|
|
760
|
+
function F(d, I) {
|
|
762
761
|
return (
|
|
763
762
|
/*state*/
|
|
764
|
-
d[5] ===
|
|
763
|
+
d[5] === b.VERIFIED ? Vt : (
|
|
765
764
|
/*state*/
|
|
766
|
-
d[5] ===
|
|
765
|
+
d[5] === b.VERIFYING ? Mt : Tt
|
|
767
766
|
)
|
|
768
767
|
);
|
|
769
768
|
}
|
|
770
|
-
let
|
|
769
|
+
let D = F(r), _ = D(r), k = (
|
|
771
770
|
/*hidelogo*/
|
|
772
|
-
r[2] !== !0 &&
|
|
773
|
-
),
|
|
771
|
+
r[2] !== !0 && Ze()
|
|
772
|
+
), m = (
|
|
774
773
|
/*error*/
|
|
775
774
|
(r[8] || /*state*/
|
|
776
|
-
r[5] ===
|
|
777
|
-
),
|
|
775
|
+
r[5] === b.EXPIRED) && Ae(r)
|
|
776
|
+
), y = (
|
|
778
777
|
/*_strings*/
|
|
779
778
|
r[9].footer && /*hidefooter*/
|
|
780
|
-
r[1] !== !0 &&
|
|
779
|
+
r[1] !== !0 && Te(r)
|
|
781
780
|
);
|
|
782
781
|
return {
|
|
783
782
|
c() {
|
|
784
|
-
e = R("div"), t = R("div"),
|
|
785
|
-
r[3] + "_checkbox"),
|
|
786
|
-
r[0] !== "onsubmit", c(
|
|
787
|
-
|
|
783
|
+
e = R("div"), t = R("div"), p && p.c(), i = W(), o = R("div"), l = R("input"), a = W(), h = R("div"), _.c(), Z = W(), k && k.c(), C = W(), m && m.c(), M = W(), y && y.c(), c(l, "type", "checkbox"), c(l, "id", s = /*name*/
|
|
784
|
+
r[3] + "_checkbox"), l.required = f = /*auto*/
|
|
785
|
+
r[0] !== "onsubmit", c(l, "class", "svelte-15co9zy"), c(o, "class", "altcha-checkbox svelte-15co9zy"), ze(
|
|
786
|
+
o,
|
|
788
787
|
"altcha-hidden",
|
|
789
788
|
/*state*/
|
|
790
|
-
r[5] ===
|
|
791
|
-
), c(h, "class", "altcha-label svelte-
|
|
789
|
+
r[5] === b.VERIFYING
|
|
790
|
+
), c(h, "class", "altcha-label svelte-15co9zy"), c(t, "class", "altcha-main svelte-15co9zy"), c(e, "class", "altcha svelte-15co9zy"), c(
|
|
792
791
|
e,
|
|
793
792
|
"data-state",
|
|
794
793
|
/*state*/
|
|
@@ -796,48 +795,48 @@ function Dt(r) {
|
|
|
796
795
|
);
|
|
797
796
|
},
|
|
798
797
|
m(d, I) {
|
|
799
|
-
|
|
800
|
-
r[6],
|
|
798
|
+
j(d, e, I), v(e, t), p && p.m(t, null), v(t, i), v(t, o), v(o, l), l.checked = /*checked*/
|
|
799
|
+
r[6], v(t, a), v(t, h), _.m(h, null), v(t, Z), k && k.m(t, null), v(e, C), m && m.m(e, null), v(e, M), y && y.m(e, null), r[30](e), V || (G = [
|
|
801
800
|
ae(
|
|
802
|
-
|
|
801
|
+
l,
|
|
803
802
|
"change",
|
|
804
803
|
/*input_change_handler*/
|
|
805
804
|
r[29]
|
|
806
805
|
),
|
|
807
806
|
ae(
|
|
808
|
-
|
|
807
|
+
l,
|
|
809
808
|
"change",
|
|
810
809
|
/*onCheckedChange*/
|
|
811
810
|
r[10]
|
|
812
811
|
),
|
|
813
812
|
ae(
|
|
814
|
-
|
|
813
|
+
l,
|
|
815
814
|
"invalid",
|
|
816
815
|
/*onInvalid*/
|
|
817
816
|
r[11]
|
|
818
817
|
)
|
|
819
|
-
],
|
|
818
|
+
], V = !0);
|
|
820
819
|
},
|
|
821
820
|
p(d, I) {
|
|
822
821
|
/*state*/
|
|
823
|
-
d[5] ===
|
|
822
|
+
d[5] === b.VERIFYING ? p || (p = je(), p.c(), p.m(t, i)) : p && (p.d(1), p = null), I[0] & /*name*/
|
|
824
823
|
8 && s !== (s = /*name*/
|
|
825
|
-
d[3] + "_checkbox") && c(
|
|
824
|
+
d[3] + "_checkbox") && c(l, "id", s), I[0] & /*auto*/
|
|
826
825
|
1 && f !== (f = /*auto*/
|
|
827
|
-
d[0] !== "onsubmit") && (
|
|
828
|
-
64 && (
|
|
826
|
+
d[0] !== "onsubmit") && (l.required = f), I[0] & /*checked*/
|
|
827
|
+
64 && (l.checked = /*checked*/
|
|
829
828
|
d[6]), I[0] & /*state*/
|
|
830
|
-
32 &&
|
|
831
|
-
|
|
829
|
+
32 && ze(
|
|
830
|
+
o,
|
|
832
831
|
"altcha-hidden",
|
|
833
832
|
/*state*/
|
|
834
|
-
d[5] ===
|
|
835
|
-
),
|
|
836
|
-
d[2] !== !0 ? k ? k.p(d, I) : (k =
|
|
833
|
+
d[5] === b.VERIFYING
|
|
834
|
+
), D === (D = F(d)) && _ ? _.p(d, I) : (_.d(1), _ = D(d), _ && (_.c(), _.m(h, null))), /*hidelogo*/
|
|
835
|
+
d[2] !== !0 ? k ? k.p(d, I) : (k = Ze(), k.c(), k.m(t, null)) : k && (k.d(1), k = null), /*error*/
|
|
837
836
|
d[8] || /*state*/
|
|
838
|
-
d[5] ===
|
|
837
|
+
d[5] === b.EXPIRED ? m ? m.p(d, I) : (m = Ae(d), m.c(), m.m(e, M)) : m && (m.d(1), m = null), /*_strings*/
|
|
839
838
|
d[9].footer && /*hidefooter*/
|
|
840
|
-
d[1] !== !0 ?
|
|
839
|
+
d[1] !== !0 ? y ? y.p(d, I) : (y = Te(d), y.c(), y.m(e, null)) : y && (y.d(1), y = null), I[0] & /*state*/
|
|
841
840
|
32 && c(
|
|
842
841
|
e,
|
|
843
842
|
"data-state",
|
|
@@ -848,52 +847,52 @@ function Dt(r) {
|
|
|
848
847
|
i: Q,
|
|
849
848
|
o: Q,
|
|
850
849
|
d(d) {
|
|
851
|
-
d &&
|
|
850
|
+
d && N(e), p && p.d(), _.d(), k && k.d(), m && m.d(), y && y.d(), r[30](null), V = !1, te(G);
|
|
852
851
|
}
|
|
853
852
|
};
|
|
854
853
|
}
|
|
855
|
-
const
|
|
856
|
-
function
|
|
854
|
+
const He = "https://altcha.org/";
|
|
855
|
+
function Me(r) {
|
|
857
856
|
return JSON.parse(r);
|
|
858
857
|
}
|
|
859
|
-
function
|
|
858
|
+
function Xt() {
|
|
860
859
|
try {
|
|
861
860
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
862
861
|
} catch {
|
|
863
862
|
}
|
|
864
863
|
}
|
|
865
|
-
function
|
|
864
|
+
function Ot(r, e, t) {
|
|
866
865
|
var Ee, $e;
|
|
867
|
-
let i,
|
|
868
|
-
const I = bt(),
|
|
869
|
-
let
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}),
|
|
873
|
-
L("mounted", "0.4.
|
|
866
|
+
let i, o, l, { auto: s = void 0 } = e, { blockspam: f = void 0 } = e, { challengeurl: a = void 0 } = e, { challengejson: h = void 0 } = e, { debug: Z = !1 } = e, { expire: C = void 0 } = e, { hidefooter: M = !1 } = e, { hidelogo: V = !1 } = e, { name: G = "altcha" } = e, { maxnumber: p = 1e6 } = e, { mockerror: F = !1 } = e, { refetchonexpire: D = !0 } = e, { spamfilter: _ = !1 } = e, { strings: k = void 0 } = e, { test: m = !1 } = e, { verifyurl: y = void 0 } = e, { workers: d = navigator.hardwareConcurrency || 8 } = e;
|
|
867
|
+
const I = bt(), ge = ["SHA-256", "SHA-384", "SHA-512"], be = ($e = (Ee = document.documentElement.lang) == null ? void 0 : Ee.split("-")) == null ? void 0 : $e[0];
|
|
868
|
+
let O = !1, re, g = null, se = null, H = null, U = b.UNVERIFIED, ce;
|
|
869
|
+
gt(() => {
|
|
870
|
+
g && (g.removeEventListener("submit", ve), g.removeEventListener("reset", we), g.removeEventListener("focusin", ye), g = null);
|
|
871
|
+
}), mt(() => {
|
|
872
|
+
L("mounted", "0.4.1"), L("workers", d), m && L("using test mode"), C && ne(C), s !== void 0 && L("auto", s), g = re.closest("form"), g && (g.addEventListener("submit", ve), g.addEventListener("reset", we), s === "onfocus" && g.addEventListener("focusin", ye)), s === "onload" && Y();
|
|
874
873
|
});
|
|
875
874
|
function L(...n) {
|
|
876
|
-
(
|
|
877
|
-
}
|
|
878
|
-
function pe(n) {
|
|
879
|
-
P();
|
|
875
|
+
(Z || n.some((u) => u instanceof Error)) && console[n[0] instanceof Error ? "error" : "log"]("ALTCHA", ...n);
|
|
880
876
|
}
|
|
881
877
|
function ye(n) {
|
|
882
|
-
|
|
883
|
-
|
|
878
|
+
U === b.UNVERIFIED && Y();
|
|
879
|
+
}
|
|
880
|
+
function ve(n) {
|
|
881
|
+
g && s === "onsubmit" && U === b.UNVERIFIED && (n.preventDefault(), n.stopPropagation(), Y().then(() => {
|
|
882
|
+
g == null || g.requestSubmit();
|
|
884
883
|
}));
|
|
885
884
|
}
|
|
886
|
-
function
|
|
885
|
+
function we() {
|
|
887
886
|
ie();
|
|
888
887
|
}
|
|
889
|
-
function
|
|
888
|
+
function pe(n, u) {
|
|
890
889
|
return btoa(JSON.stringify({
|
|
891
890
|
algorithm: n.algorithm,
|
|
892
891
|
challenge: n.challenge,
|
|
893
892
|
number: u.number,
|
|
894
893
|
salt: n.salt,
|
|
895
894
|
signature: n.signature,
|
|
896
|
-
test:
|
|
895
|
+
test: m ? !0 : void 0,
|
|
897
896
|
took: u.took
|
|
898
897
|
}));
|
|
899
898
|
}
|
|
@@ -902,21 +901,21 @@ function Ft(r, e, t) {
|
|
|
902
901
|
throw new Error("Invalid challenge. Property algorithm is missing.");
|
|
903
902
|
if (n.signature === void 0)
|
|
904
903
|
throw new Error("Invalid challenge. Property signature is missing.");
|
|
905
|
-
if (!
|
|
906
|
-
throw new Error(`Unknown algorithm value. Allowed values: ${
|
|
904
|
+
if (!ge.includes(n.algorithm.toUpperCase()))
|
|
905
|
+
throw new Error(`Unknown algorithm value. Allowed values: ${ge.join(", ")}`);
|
|
907
906
|
if (!n.challenge || n.challenge.length < 40)
|
|
908
907
|
throw new Error("Challenge is too short. Min. 40 chars.");
|
|
909
908
|
if (!n.salt || n.salt.length < 10)
|
|
910
909
|
throw new Error("Salt is too short. Min. 10 chars.");
|
|
911
910
|
}
|
|
912
|
-
async function
|
|
911
|
+
async function Ye() {
|
|
913
912
|
var n;
|
|
914
|
-
if (
|
|
913
|
+
if (F)
|
|
915
914
|
throw L("mocking error"), new Error("Mocked error.");
|
|
916
915
|
if (i)
|
|
917
916
|
return L("using provided json data"), i;
|
|
918
|
-
if (
|
|
919
|
-
return L("generating test challenge", { test:
|
|
917
|
+
if (m)
|
|
918
|
+
return L("generating test challenge", { test: m }), jt(typeof m != "boolean" ? +m : void 0);
|
|
920
919
|
{
|
|
921
920
|
if (!a)
|
|
922
921
|
throw new Error("Attribute challengeurl not set.");
|
|
@@ -928,68 +927,68 @@ function Ft(r, e, t) {
|
|
|
928
927
|
});
|
|
929
928
|
if (u.status !== 200)
|
|
930
929
|
throw new Error(`Server responded with ${u.status}.`);
|
|
931
|
-
const
|
|
932
|
-
if (
|
|
933
|
-
const x = new Date(+
|
|
930
|
+
const w = u.headers.get("Expires"), z = u.headers.get("X-Altcha-Config"), S = await u.json(), A = new URLSearchParams((n = S.salt.split("?")) == null ? void 0 : n[1]), P = A.get("expires") || A.get("expire");
|
|
931
|
+
if (P) {
|
|
932
|
+
const x = new Date(+P * 1e3), E = isNaN(x.getTime()) ? 0 : x.getTime() - Date.now();
|
|
934
933
|
E > 0 && ne(E);
|
|
935
934
|
}
|
|
936
|
-
if (
|
|
935
|
+
if (z)
|
|
937
936
|
try {
|
|
938
|
-
const x = JSON.parse(
|
|
937
|
+
const x = JSON.parse(z);
|
|
939
938
|
x && typeof x == "object" && (x.verifyurl && (x.verifyurl = new URL(x.verifyurl, new URL(a)).toString()), xe(x));
|
|
940
939
|
} catch (x) {
|
|
941
940
|
L("unable to configure from X-Altcha-Config", x);
|
|
942
941
|
}
|
|
943
|
-
if (!C && (
|
|
944
|
-
const x = Date.parse(
|
|
942
|
+
if (!C && (w != null && w.length)) {
|
|
943
|
+
const x = Date.parse(w);
|
|
945
944
|
if (x) {
|
|
946
945
|
const E = x - Date.now();
|
|
947
946
|
E > 0 && ne(E);
|
|
948
947
|
}
|
|
949
948
|
}
|
|
950
|
-
return
|
|
949
|
+
return S;
|
|
951
950
|
}
|
|
952
951
|
}
|
|
953
952
|
function ke() {
|
|
954
|
-
a &&
|
|
953
|
+
a && D && U === b.VERIFIED ? Y() : ie(b.EXPIRED, l.expired);
|
|
955
954
|
}
|
|
956
|
-
async function
|
|
955
|
+
async function Pe(n) {
|
|
957
956
|
let u = null;
|
|
958
957
|
if ("Worker" in window) {
|
|
959
958
|
try {
|
|
960
|
-
u = await
|
|
961
|
-
} catch (
|
|
962
|
-
L(
|
|
959
|
+
u = await We(n.challenge, n.salt, n.algorithm, n.maxnumber);
|
|
960
|
+
} catch (w) {
|
|
961
|
+
L(w);
|
|
963
962
|
}
|
|
964
963
|
if ((u == null ? void 0 : u.number) !== void 0)
|
|
965
964
|
return { data: n, solution: u };
|
|
966
965
|
}
|
|
967
966
|
return {
|
|
968
967
|
data: n,
|
|
969
|
-
solution: await
|
|
968
|
+
solution: await Zt(n.challenge, n.salt, n.algorithm, n.maxnumber || p).promise
|
|
970
969
|
};
|
|
971
970
|
}
|
|
972
|
-
async function
|
|
973
|
-
const
|
|
974
|
-
if (
|
|
971
|
+
async function We(n, u, w, z = typeof m == "number" ? m : p, S = Math.ceil(d)) {
|
|
972
|
+
const A = [];
|
|
973
|
+
if (S < 1)
|
|
975
974
|
throw new Error("Wrong number of workers configured.");
|
|
976
|
-
if (
|
|
975
|
+
if (S > 16)
|
|
977
976
|
throw new Error("Too many workers. Max. 16 allowed workers.");
|
|
978
|
-
for (let E = 0; E <
|
|
979
|
-
|
|
980
|
-
const
|
|
981
|
-
const Ce =
|
|
977
|
+
for (let E = 0; E < S; E++)
|
|
978
|
+
A.push(new zt());
|
|
979
|
+
const P = Math.ceil(z / S), x = await Promise.all(A.map((E, oe) => {
|
|
980
|
+
const Ce = oe * P;
|
|
982
981
|
return new Promise((rt) => {
|
|
983
982
|
E.addEventListener("message", (Le) => {
|
|
984
983
|
if (Le.data)
|
|
985
|
-
for (const Re of
|
|
984
|
+
for (const Re of A)
|
|
986
985
|
Re !== E && Re.postMessage({ type: "abort" });
|
|
987
986
|
rt(Le.data);
|
|
988
987
|
}), E.postMessage({
|
|
989
988
|
payload: {
|
|
990
|
-
alg:
|
|
989
|
+
alg: w,
|
|
991
990
|
challenge: n,
|
|
992
|
-
max: Ce +
|
|
991
|
+
max: Ce + P,
|
|
993
992
|
salt: u,
|
|
994
993
|
start: Ce
|
|
995
994
|
},
|
|
@@ -997,42 +996,42 @@ function Ft(r, e, t) {
|
|
|
997
996
|
});
|
|
998
997
|
});
|
|
999
998
|
}));
|
|
1000
|
-
for (const E of
|
|
999
|
+
for (const E of A)
|
|
1001
1000
|
E.terminate();
|
|
1002
1001
|
return x.find((E) => !!E) || null;
|
|
1003
1002
|
}
|
|
1004
|
-
function
|
|
1005
|
-
[
|
|
1003
|
+
function Be() {
|
|
1004
|
+
[b.UNVERIFIED, b.ERROR, b.EXPIRED].includes(U) ? _ && (g == null ? void 0 : g.reportValidity()) === !1 ? t(6, O = !1) : Y() : t(6, O = !0);
|
|
1006
1005
|
}
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1006
|
+
function Ke() {
|
|
1007
|
+
U === b.VERIFYING && alert(l.waitAlert);
|
|
1009
1008
|
}
|
|
1010
1009
|
function ne(n) {
|
|
1011
1010
|
L("expire", n), clearTimeout(ce), n < 1 ? ke() : ce = setTimeout(ke, n);
|
|
1012
1011
|
}
|
|
1013
|
-
function
|
|
1014
|
-
var
|
|
1015
|
-
const u =
|
|
1016
|
-
return ((
|
|
1012
|
+
function Je(n) {
|
|
1013
|
+
var w;
|
|
1014
|
+
const u = g == null ? void 0 : g.querySelector(typeof n == "string" ? `input[name="${n}"]` : 'input[type="email"]:not([data-no-spamfilter])');
|
|
1015
|
+
return ((w = u == null ? void 0 : u.value) == null ? void 0 : w.slice(u.value.indexOf("@"))) || void 0;
|
|
1017
1016
|
}
|
|
1018
1017
|
function Qe(n) {
|
|
1019
1018
|
return [
|
|
1020
|
-
...(
|
|
1019
|
+
...(g == null ? void 0 : g.querySelectorAll(n != null && n.length ? n.map((w) => `input[name="${w}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
|
|
1021
1020
|
].reduce(
|
|
1022
|
-
(
|
|
1023
|
-
const
|
|
1024
|
-
return
|
|
1021
|
+
(w, z) => {
|
|
1022
|
+
const S = z.name, A = z.value.trim();
|
|
1023
|
+
return S && A && (w[S] = A), w;
|
|
1025
1024
|
},
|
|
1026
1025
|
{}
|
|
1027
1026
|
);
|
|
1028
1027
|
}
|
|
1029
1028
|
async function qe(n) {
|
|
1030
|
-
if (!
|
|
1029
|
+
if (!y)
|
|
1031
1030
|
throw new Error("Attribute verifyurl not set.");
|
|
1032
|
-
L("requesting server verification from",
|
|
1031
|
+
L("requesting server verification from", y);
|
|
1033
1032
|
const u = { payload: n };
|
|
1034
1033
|
if (_) {
|
|
1035
|
-
const { email:
|
|
1034
|
+
const { email: S, expectedLanguages: A, expectedCountries: P, fields: x, ipAddress: E, timeZone: oe } = typeof _ == "object" ? _ : {
|
|
1036
1035
|
email: void 0,
|
|
1037
1036
|
expectedCountries: void 0,
|
|
1038
1037
|
expectedLanguages: void 0,
|
|
@@ -1040,43 +1039,43 @@ function Ft(r, e, t) {
|
|
|
1040
1039
|
ipAddress: void 0,
|
|
1041
1040
|
timeZone: void 0
|
|
1042
1041
|
};
|
|
1043
|
-
u.ipAddress = E === !1 ? void 0 : E || "auto", u.email =
|
|
1042
|
+
u.ipAddress = E === !1 ? void 0 : E || "auto", u.email = S === !1 ? void 0 : Je(S), u.fields = x === !1 ? void 0 : Qe(x), u.timeZone = oe === !1 ? void 0 : oe || Xt(), u.expectedCountries = P, u.expectedLanguages = A || (be ? [be] : void 0);
|
|
1044
1043
|
}
|
|
1045
|
-
const
|
|
1044
|
+
const w = await fetch(y, {
|
|
1046
1045
|
body: JSON.stringify(u),
|
|
1047
1046
|
headers: { "content-type": "application/json" },
|
|
1048
1047
|
method: "POST"
|
|
1049
1048
|
});
|
|
1050
|
-
if (
|
|
1051
|
-
throw new Error(`Server responded with ${
|
|
1052
|
-
const
|
|
1053
|
-
if (
|
|
1049
|
+
if (w.status !== 200)
|
|
1050
|
+
throw new Error(`Server responded with ${w.status}.`);
|
|
1051
|
+
const z = await w.json();
|
|
1052
|
+
if (z != null && z.payload && t(4, H = z.payload), I("serververification", z), f && z.classification === "BAD")
|
|
1054
1053
|
throw new Error("SpamFilter returned negative classification.");
|
|
1055
1054
|
}
|
|
1056
1055
|
function xe(n) {
|
|
1057
|
-
n.auto !== void 0 && (t(0, s = n.auto), s === "onload" &&
|
|
1056
|
+
n.auto !== void 0 && (t(0, s = n.auto), s === "onload" && Y()), n.expire !== void 0 && (ne(n.expire), t(14, C = n.expire)), n.challenge && (_e(n.challenge), i = n.challenge), n.challengeurl !== void 0 && t(12, a = n.challengeurl), n.debug !== void 0 && t(13, Z = !!n.debug), n.hidefooter !== void 0 && t(1, M = !!n.hidefooter), n.hidelogo !== void 0 && t(2, V = !!n.hidelogo), n.maxnumber !== void 0 && t(15, p = +n.maxnumber), n.mockerror !== void 0 && t(16, F = !!n.mockerror), n.name !== void 0 && t(3, G = n.name), n.refetchonexpire !== void 0 && t(17, D = !!n.refetchonexpire), n.spamfilter !== void 0 && t(18, _ = typeof n.spamfilter == "object" ? n.spamfilter : !!n.spamfilter), n.strings && t(28, o = n.strings), n.test !== void 0 && t(19, m = typeof n.test == "number" ? n.test : !!n.test), n.verifyurl !== void 0 && t(20, y = n.verifyurl), n.workers !== void 0 && t(21, d = +n.workers);
|
|
1058
1057
|
}
|
|
1059
|
-
function ie(n =
|
|
1060
|
-
clearTimeout(ce), t(6,
|
|
1058
|
+
function ie(n = b.UNVERIFIED, u = null) {
|
|
1059
|
+
clearTimeout(ce), t(6, O = !1), t(8, se = u), t(4, H = null), t(5, U = n);
|
|
1061
1060
|
}
|
|
1062
|
-
async function
|
|
1063
|
-
return ie(
|
|
1061
|
+
async function Y() {
|
|
1062
|
+
return ie(b.VERIFYING), Ye().then((n) => (_e(n), L("challenge", n), Pe(n))).then(({ data: n, solution: u }) => {
|
|
1064
1063
|
if (L("solution", u), (u == null ? void 0 : u.number) !== void 0) {
|
|
1065
|
-
if (
|
|
1066
|
-
return qe(
|
|
1067
|
-
t(4,
|
|
1064
|
+
if (y)
|
|
1065
|
+
return qe(pe(n, u));
|
|
1066
|
+
t(4, H = pe(n, u)), L("payload", H);
|
|
1068
1067
|
} else
|
|
1069
1068
|
throw L("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned.");
|
|
1070
1069
|
}).then(() => {
|
|
1071
|
-
|
|
1072
|
-
t(5,
|
|
1070
|
+
yt().then(() => {
|
|
1071
|
+
t(5, U = b.VERIFIED), t(6, O = !0), L("verified"), I("verified", { payload: H });
|
|
1073
1072
|
});
|
|
1074
1073
|
}).catch((n) => {
|
|
1075
|
-
L(n), t(5,
|
|
1074
|
+
L(n), t(5, U = b.ERROR), t(6, O = !1), t(8, se = n.message);
|
|
1076
1075
|
});
|
|
1077
1076
|
}
|
|
1078
1077
|
function et() {
|
|
1079
|
-
|
|
1078
|
+
O = this.checked, t(6, O);
|
|
1080
1079
|
}
|
|
1081
1080
|
function tt(n) {
|
|
1082
1081
|
ue[n ? "unshift" : "push"](() => {
|
|
@@ -1084,64 +1083,64 @@ function Ft(r, e, t) {
|
|
|
1084
1083
|
});
|
|
1085
1084
|
}
|
|
1086
1085
|
return r.$$set = (n) => {
|
|
1087
|
-
"auto" in n && t(0, s = n.auto), "blockspam" in n && t(22, f = n.blockspam), "challengeurl" in n && t(12, a = n.challengeurl), "challengejson" in n && t(23, h = n.challengejson), "debug" in n && t(13,
|
|
1086
|
+
"auto" in n && t(0, s = n.auto), "blockspam" in n && t(22, f = n.blockspam), "challengeurl" in n && t(12, a = n.challengeurl), "challengejson" in n && t(23, h = n.challengejson), "debug" in n && t(13, Z = n.debug), "expire" in n && t(14, C = n.expire), "hidefooter" in n && t(1, M = n.hidefooter), "hidelogo" in n && t(2, V = n.hidelogo), "name" in n && t(3, G = n.name), "maxnumber" in n && t(15, p = n.maxnumber), "mockerror" in n && t(16, F = n.mockerror), "refetchonexpire" in n && t(17, D = n.refetchonexpire), "spamfilter" in n && t(18, _ = n.spamfilter), "strings" in n && t(24, k = n.strings), "test" in n && t(19, m = n.test), "verifyurl" in n && t(20, y = n.verifyurl), "workers" in n && t(21, d = n.workers);
|
|
1088
1087
|
}, r.$$.update = () => {
|
|
1089
1088
|
r.$$.dirty[0] & /*challengejson*/
|
|
1090
|
-
8388608 && (i = h ?
|
|
1091
|
-
16777216 && t(28,
|
|
1092
|
-
268435456 && t(9,
|
|
1089
|
+
8388608 && (i = h ? Me(h) : void 0), r.$$.dirty[0] & /*strings*/
|
|
1090
|
+
16777216 && t(28, o = k ? Me(k) : {}), r.$$.dirty[0] & /*parsedStrings*/
|
|
1091
|
+
268435456 && t(9, l = {
|
|
1093
1092
|
error: "Verification failed. Try again later.",
|
|
1094
1093
|
expired: "Verification expired. Try again.",
|
|
1095
|
-
footer: `Protected by <a href="${
|
|
1094
|
+
footer: `Protected by <a href="${He}" target="_blank">ALTCHA</a>`,
|
|
1096
1095
|
label: "I'm not a robot",
|
|
1097
1096
|
verified: "Verified",
|
|
1098
1097
|
verifying: "Verifying...",
|
|
1099
1098
|
waitAlert: "Verifying... please wait.",
|
|
1100
|
-
...
|
|
1099
|
+
...o
|
|
1101
1100
|
}), r.$$.dirty[0] & /*payload, state*/
|
|
1102
|
-
48 && I("statechange", { payload:
|
|
1101
|
+
48 && I("statechange", { payload: H, state: U });
|
|
1103
1102
|
}, [
|
|
1104
1103
|
s,
|
|
1104
|
+
M,
|
|
1105
1105
|
V,
|
|
1106
1106
|
G,
|
|
1107
|
+
H,
|
|
1107
1108
|
U,
|
|
1108
|
-
|
|
1109
|
-
D,
|
|
1110
|
-
F,
|
|
1109
|
+
O,
|
|
1111
1110
|
re,
|
|
1112
1111
|
se,
|
|
1113
|
-
|
|
1112
|
+
l,
|
|
1113
|
+
Be,
|
|
1114
1114
|
Ke,
|
|
1115
|
-
Je,
|
|
1116
1115
|
a,
|
|
1117
|
-
|
|
1116
|
+
Z,
|
|
1118
1117
|
C,
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1118
|
+
p,
|
|
1119
|
+
F,
|
|
1120
|
+
D,
|
|
1122
1121
|
_,
|
|
1123
|
-
|
|
1124
|
-
|
|
1122
|
+
m,
|
|
1123
|
+
y,
|
|
1125
1124
|
d,
|
|
1126
1125
|
f,
|
|
1127
1126
|
h,
|
|
1128
1127
|
k,
|
|
1129
1128
|
xe,
|
|
1130
1129
|
ie,
|
|
1131
|
-
|
|
1132
|
-
|
|
1130
|
+
Y,
|
|
1131
|
+
o,
|
|
1133
1132
|
et,
|
|
1134
1133
|
tt
|
|
1135
1134
|
];
|
|
1136
1135
|
}
|
|
1137
|
-
class
|
|
1136
|
+
class Ft extends Lt {
|
|
1138
1137
|
constructor(e) {
|
|
1139
1138
|
super(), $t(
|
|
1140
1139
|
this,
|
|
1141
1140
|
e,
|
|
1142
|
-
|
|
1141
|
+
Ot,
|
|
1143
1142
|
Dt,
|
|
1144
|
-
|
|
1143
|
+
ot,
|
|
1145
1144
|
{
|
|
1146
1145
|
auto: 0,
|
|
1147
1146
|
blockspam: 22,
|
|
@@ -1164,7 +1163,7 @@ class Ht extends Lt {
|
|
|
1164
1163
|
reset: 26,
|
|
1165
1164
|
verify: 27
|
|
1166
1165
|
},
|
|
1167
|
-
|
|
1166
|
+
At,
|
|
1168
1167
|
[-1, -1]
|
|
1169
1168
|
);
|
|
1170
1169
|
}
|
|
@@ -1280,7 +1279,7 @@ class Ht extends Lt {
|
|
|
1280
1279
|
return this.$$.ctx[27];
|
|
1281
1280
|
}
|
|
1282
1281
|
}
|
|
1283
|
-
customElements.define("altcha-widget", Ct(
|
|
1282
|
+
customElements.define("altcha-widget", Ct(Ft, { auto: {}, blockspam: {}, challengeurl: {}, challengejson: {}, debug: { type: "Boolean" }, expire: {}, hidefooter: { type: "Boolean" }, hidelogo: { type: "Boolean" }, name: {}, maxnumber: {}, mockerror: { type: "Boolean" }, refetchonexpire: { type: "Boolean" }, spamfilter: { type: "Boolean" }, strings: {}, test: { type: "Boolean" }, verifyurl: {}, workers: {} }, [], ["configure", "reset", "verify"], !1));
|
|
1284
1283
|
export {
|
|
1285
|
-
|
|
1284
|
+
Ft as Altcha
|
|
1286
1285
|
};
|