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