altcha 0.1.6 → 0.1.8

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