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