altcha 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,116 +1,109 @@
1
- var Kt = Object.defineProperty;
2
- var ut = (n) => {
3
- throw TypeError(n);
4
- };
5
- var Qt = (n, e, t) => e in n ? Kt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
6
- var P = (n, e, t) => Qt(n, typeof e != "symbol" ? e + "" : e, t), ht = (n, e, t) => e.has(n) || ut("Cannot " + t);
7
- var G = (n, e, t) => (ht(n, e, "read from private field"), t ? t.call(n) : e.get(n)), fe = (n, e, t) => e.has(n) ? ut("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), dt = (n, e, t, r) => (ht(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t);
8
- function Me() {
1
+ var jt = Object.defineProperty;
2
+ var Ht = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var Z = (n, e, t) => Ht(n, typeof e != "symbol" ? e + "" : e, t);
4
+ function xe() {
9
5
  }
10
- function $t(n, e) {
6
+ function Ot(n, e) {
11
7
  for (const t in e) n[t] = e[t];
12
8
  return (
13
9
  /** @type {T & S} */
14
10
  n
15
11
  );
16
12
  }
17
- function At(n) {
13
+ function ht(n) {
18
14
  return n();
19
15
  }
20
- function mt() {
16
+ function nt() {
21
17
  return /* @__PURE__ */ Object.create(null);
22
18
  }
23
- function Ie(n) {
24
- n.forEach(At);
19
+ function pe(n) {
20
+ n.forEach(ht);
25
21
  }
26
- function xt(n) {
22
+ function dt(n) {
27
23
  return typeof n == "function";
28
24
  }
29
- function en(n, e) {
25
+ function Ut(n, e) {
30
26
  return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
31
27
  }
32
- function tn(n) {
28
+ function $t(n) {
33
29
  return Object.keys(n).length === 0;
34
30
  }
35
- function nn(n, e, t, r) {
31
+ function Bt(n, e, t, i) {
36
32
  if (n) {
37
- const o = Lt(n, e, t, r);
33
+ const o = gt(n, e, t, i);
38
34
  return n[0](o);
39
35
  }
40
36
  }
41
- function Lt(n, e, t, r) {
42
- return n[1] && r ? $t(t.ctx.slice(), n[1](r(e))) : t.ctx;
37
+ function gt(n, e, t, i) {
38
+ return n[1] && i ? Ot(t.ctx.slice(), n[1](i(e))) : t.ctx;
43
39
  }
44
- function rn(n, e, t, r) {
45
- if (n[2] && r) {
46
- const o = n[2](r(t));
40
+ function qt(n, e, t, i) {
41
+ if (n[2] && i) {
42
+ const o = n[2](i(t));
47
43
  if (e.dirty === void 0)
48
44
  return o;
49
45
  if (typeof o == "object") {
50
- const s = [], l = Math.max(e.dirty.length, o.length);
51
- for (let c = 0; c < l; c += 1)
52
- s[c] = e.dirty[c] | o[c];
53
- return s;
46
+ const l = [], s = Math.max(e.dirty.length, o.length);
47
+ for (let h = 0; h < s; h += 1)
48
+ l[h] = e.dirty[h] | o[h];
49
+ return l;
54
50
  }
55
51
  return e.dirty | o;
56
52
  }
57
53
  return e.dirty;
58
54
  }
59
- function on(n, e, t, r, o, s) {
55
+ function Zt(n, e, t, i, o, l) {
60
56
  if (o) {
61
- const l = Lt(e, t, r, s);
62
- n.p(l, o);
57
+ const s = gt(e, t, i, l);
58
+ n.p(s, o);
63
59
  }
64
60
  }
65
- function sn(n) {
61
+ function Gt(n) {
66
62
  if (n.ctx.length > 32) {
67
63
  const e = [], t = n.ctx.length / 32;
68
- for (let r = 0; r < t; r++)
69
- e[r] = -1;
64
+ for (let i = 0; i < t; i++)
65
+ e[i] = -1;
70
66
  return e;
71
67
  }
72
68
  return -1;
73
69
  }
74
- function I(n, e) {
70
+ function L(n, e) {
75
71
  n.appendChild(e);
76
72
  }
77
- function B(n, e, t) {
73
+ function H(n, e, t) {
78
74
  n.insertBefore(e, t || null);
79
75
  }
80
- function S(n) {
76
+ function j(n) {
81
77
  n.parentNode && n.parentNode.removeChild(n);
82
78
  }
83
- function M(n) {
79
+ function F(n) {
84
80
  return document.createElement(n);
85
81
  }
86
- function re(n) {
82
+ function K(n) {
87
83
  return document.createElementNS("http://www.w3.org/2000/svg", n);
88
84
  }
89
- function It(n) {
85
+ function Yt(n) {
90
86
  return document.createTextNode(n);
91
87
  }
92
- function Q() {
93
- return It(" ");
88
+ function z() {
89
+ return Yt(" ");
94
90
  }
95
- function ln() {
96
- return It("");
91
+ function Le(n, e, t, i) {
92
+ return n.addEventListener(e, t, i), () => n.removeEventListener(e, t, i);
97
93
  }
98
- function Pe(n, e, t, r) {
99
- return n.addEventListener(e, t, r), () => n.removeEventListener(e, t, r);
100
- }
101
- function u(n, e, t) {
94
+ function c(n, e, t) {
102
95
  t == null ? n.removeAttribute(e) : n.getAttribute(e) !== t && n.setAttribute(e, t);
103
96
  }
104
- function cn(n) {
97
+ function Wt(n) {
105
98
  return Array.from(n.childNodes);
106
99
  }
107
- function gt(n, e, t) {
100
+ function rt(n, e, t) {
108
101
  n.classList.toggle(e, !!t);
109
102
  }
110
- function an(n, e, { bubbles: t = !1, cancelable: r = !1 } = {}) {
111
- return new CustomEvent(n, { detail: e, bubbles: t, cancelable: r });
103
+ function Xt(n, e, { bubbles: t = !1, cancelable: i = !1 } = {}) {
104
+ return new CustomEvent(n, { detail: e, bubbles: t, cancelable: i });
112
105
  }
113
- function fn(n) {
106
+ function Jt(n) {
114
107
  const e = {};
115
108
  return n.childNodes.forEach(
116
109
  /** @param {Element} node */
@@ -119,224 +112,224 @@ function fn(n) {
119
112
  }
120
113
  ), e;
121
114
  }
122
- let pe;
123
- function ke(n) {
124
- pe = n;
115
+ let we;
116
+ function _e(n) {
117
+ we = n;
125
118
  }
126
- function qe() {
127
- if (!pe) throw new Error("Function called outside component initialization");
128
- return pe;
119
+ function Te() {
120
+ if (!we) throw new Error("Function called outside component initialization");
121
+ return we;
129
122
  }
130
- function un(n) {
131
- qe().$$.on_mount.push(n);
123
+ function zt(n) {
124
+ Te().$$.on_mount.push(n);
132
125
  }
133
- function hn(n) {
134
- qe().$$.on_destroy.push(n);
126
+ function Kt(n) {
127
+ Te().$$.on_destroy.push(n);
135
128
  }
136
- function dn() {
137
- const n = qe();
138
- return (e, t, { cancelable: r = !1 } = {}) => {
129
+ function Qt() {
130
+ const n = Te();
131
+ return (e, t, { cancelable: i = !1 } = {}) => {
139
132
  const o = n.$$.callbacks[e];
140
133
  if (o) {
141
- const s = an(
134
+ const l = Xt(
142
135
  /** @type {string} */
143
136
  e,
144
137
  t,
145
- { cancelable: r }
138
+ { cancelable: i }
146
139
  );
147
- return o.slice().forEach((l) => {
148
- l.call(n, s);
149
- }), !s.defaultPrevented;
140
+ return o.slice().forEach((s) => {
141
+ s.call(n, l);
142
+ }), !l.defaultPrevented;
150
143
  }
151
144
  return !0;
152
145
  };
153
146
  }
154
- const he = [], Ne = [];
155
- let de = [];
156
- const bt = [], Tt = /* @__PURE__ */ Promise.resolve();
157
- let Oe = !1;
158
- function Rt() {
159
- Oe || (Oe = !0, Tt.then(E));
147
+ const ce = [], Ae = [];
148
+ let ue = [];
149
+ const it = [], mt = /* @__PURE__ */ Promise.resolve();
150
+ let Se = !1;
151
+ function bt() {
152
+ Se || (Se = !0, mt.then(p));
160
153
  }
161
- function mn() {
162
- return Rt(), Tt;
154
+ function en() {
155
+ return bt(), mt;
163
156
  }
164
- function He(n) {
165
- de.push(n);
157
+ function De(n) {
158
+ ue.push(n);
166
159
  }
167
- const Be = /* @__PURE__ */ new Set();
168
- let ue = 0;
169
- function E() {
170
- if (ue !== 0)
160
+ const Re = /* @__PURE__ */ new Set();
161
+ let fe = 0;
162
+ function p() {
163
+ if (fe !== 0)
171
164
  return;
172
- const n = pe;
165
+ const n = we;
173
166
  do {
174
167
  try {
175
- for (; ue < he.length; ) {
176
- const e = he[ue];
177
- ue++, ke(e), gn(e.$$);
168
+ for (; fe < ce.length; ) {
169
+ const e = ce[fe];
170
+ fe++, _e(e), tn(e.$$);
178
171
  }
179
172
  } catch (e) {
180
- throw he.length = 0, ue = 0, e;
173
+ throw ce.length = 0, fe = 0, e;
181
174
  }
182
- for (ke(null), he.length = 0, ue = 0; Ne.length; ) Ne.pop()();
183
- for (let e = 0; e < de.length; e += 1) {
184
- const t = de[e];
185
- Be.has(t) || (Be.add(t), t());
175
+ for (_e(null), ce.length = 0, fe = 0; Ae.length; ) Ae.pop()();
176
+ for (let e = 0; e < ue.length; e += 1) {
177
+ const t = ue[e];
178
+ Re.has(t) || (Re.add(t), t());
186
179
  }
187
- de.length = 0;
188
- } while (he.length);
189
- for (; bt.length; )
190
- bt.pop()();
191
- Oe = !1, Be.clear(), ke(n);
180
+ ue.length = 0;
181
+ } while (ce.length);
182
+ for (; it.length; )
183
+ it.pop()();
184
+ Se = !1, Re.clear(), _e(n);
192
185
  }
193
- function gn(n) {
186
+ function tn(n) {
194
187
  if (n.fragment !== null) {
195
- n.update(), Ie(n.before_update);
188
+ n.update(), pe(n.before_update);
196
189
  const e = n.dirty;
197
- n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(He);
190
+ n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(De);
198
191
  }
199
192
  }
200
- function bn(n) {
193
+ function nn(n) {
201
194
  const e = [], t = [];
202
- de.forEach((r) => n.indexOf(r) === -1 ? e.push(r) : t.push(r)), t.forEach((r) => r()), de = e;
195
+ ue.forEach((i) => n.indexOf(i) === -1 ? e.push(i) : t.push(i)), t.forEach((i) => i()), ue = e;
203
196
  }
204
- const De = /* @__PURE__ */ new Set();
205
- let yn;
206
- function Ft(n, e) {
207
- n && n.i && (De.delete(n), n.i(e));
197
+ const ve = /* @__PURE__ */ new Set();
198
+ let rn;
199
+ function yt(n, e) {
200
+ n && n.i && (ve.delete(n), n.i(e));
208
201
  }
209
- function wn(n, e, t, r) {
202
+ function on(n, e, t, i) {
210
203
  if (n && n.o) {
211
- if (De.has(n)) return;
212
- De.add(n), yn.c.push(() => {
213
- De.delete(n);
204
+ if (ve.has(n)) return;
205
+ ve.add(n), rn.c.push(() => {
206
+ ve.delete(n);
214
207
  }), n.o(e);
215
208
  }
216
209
  }
217
- function _n(n, e, t) {
218
- const { fragment: r, after_update: o } = n.$$;
219
- r && r.m(e, t), He(() => {
220
- const s = n.$$.on_mount.map(At).filter(xt);
221
- n.$$.on_destroy ? n.$$.on_destroy.push(...s) : Ie(s), n.$$.on_mount = [];
222
- }), o.forEach(He);
210
+ function ln(n, e, t) {
211
+ const { fragment: i, after_update: o } = n.$$;
212
+ i && i.m(e, t), De(() => {
213
+ const l = n.$$.on_mount.map(ht).filter(dt);
214
+ n.$$.on_destroy ? n.$$.on_destroy.push(...l) : pe(l), n.$$.on_mount = [];
215
+ }), o.forEach(De);
223
216
  }
224
- function En(n, e) {
217
+ function sn(n, e) {
225
218
  const t = n.$$;
226
- t.fragment !== null && (bn(t.after_update), Ie(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
219
+ t.fragment !== null && (nn(t.after_update), pe(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
227
220
  }
228
- function vn(n, e) {
229
- n.$$.dirty[0] === -1 && (he.push(n), Rt(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
221
+ function fn(n, e) {
222
+ n.$$.dirty[0] === -1 && (ce.push(n), bt(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
230
223
  }
231
- function kn(n, e, t, r, o, s, l = null, c = [-1]) {
232
- const a = pe;
233
- ke(n);
234
- const h = n.$$ = {
224
+ function cn(n, e, t, i, o, l, s = null, h = [-1]) {
225
+ const d = we;
226
+ _e(n);
227
+ const u = n.$$ = {
235
228
  fragment: null,
236
229
  ctx: [],
237
230
  // state
238
- props: s,
239
- update: Me,
231
+ props: l,
232
+ update: xe,
240
233
  not_equal: o,
241
- bound: mt(),
234
+ bound: nt(),
242
235
  // lifecycle
243
236
  on_mount: [],
244
237
  on_destroy: [],
245
238
  on_disconnect: [],
246
239
  before_update: [],
247
240
  after_update: [],
248
- context: new Map(e.context || (a ? a.$$.context : [])),
241
+ context: new Map(e.context || (d ? d.$$.context : [])),
249
242
  // everything else
250
- callbacks: mt(),
251
- dirty: c,
243
+ callbacks: nt(),
244
+ dirty: h,
252
245
  skip_bound: !1,
253
- root: e.target || a.$$.root
246
+ root: e.target || d.$$.root
254
247
  };
255
- l && l(h.root);
256
- let w = !1;
257
- if (h.ctx = t ? t(n, e.props || {}, (x, $, ...k) => {
258
- const J = k.length ? k[0] : $;
259
- return h.ctx && o(h.ctx[x], h.ctx[x] = J) && (!h.skip_bound && h.bound[x] && h.bound[x](J), w && vn(n, x)), $;
260
- }) : [], h.update(), w = !0, Ie(h.before_update), h.fragment = r ? r(h.ctx) : !1, e.target) {
248
+ s && s(u.root);
249
+ let A = !1;
250
+ if (u.ctx = t ? t(n, e.props || {}, (b, Y, ...U) => {
251
+ const $ = U.length ? U[0] : Y;
252
+ return u.ctx && o(u.ctx[b], u.ctx[b] = $) && (!u.skip_bound && u.bound[b] && u.bound[b]($), A && fn(n, b)), Y;
253
+ }) : [], u.update(), A = !0, pe(u.before_update), u.fragment = i ? i(u.ctx) : !1, e.target) {
261
254
  if (e.hydrate) {
262
- const x = cn(e.target);
263
- h.fragment && h.fragment.l(x), x.forEach(S);
255
+ const b = Wt(e.target);
256
+ u.fragment && u.fragment.l(b), b.forEach(j);
264
257
  } else
265
- h.fragment && h.fragment.c();
266
- e.intro && Ft(n.$$.fragment), _n(n, e.target, e.anchor), E();
258
+ u.fragment && u.fragment.c();
259
+ e.intro && yt(n.$$.fragment), ln(n, e.target, e.anchor), p();
267
260
  }
268
- ke(a);
261
+ _e(d);
269
262
  }
270
- let Dt;
271
- typeof HTMLElement == "function" && (Dt = class extends HTMLElement {
272
- constructor(e, t, r) {
263
+ let _t;
264
+ typeof HTMLElement == "function" && (_t = class extends HTMLElement {
265
+ constructor(e, t, i) {
273
266
  super();
274
267
  /** The Svelte component constructor */
275
- P(this, "$$ctor");
268
+ Z(this, "$$ctor");
276
269
  /** Slots */
277
- P(this, "$$s");
270
+ Z(this, "$$s");
278
271
  /** The Svelte component instance */
279
- P(this, "$$c");
272
+ Z(this, "$$c");
280
273
  /** Whether or not the custom element is connected */
281
- P(this, "$$cn", !1);
274
+ Z(this, "$$cn", !1);
282
275
  /** Component props data */
283
- P(this, "$$d", {});
276
+ Z(this, "$$d", {});
284
277
  /** `true` if currently in the process of reflecting component props back to attributes */
285
- P(this, "$$r", !1);
278
+ Z(this, "$$r", !1);
286
279
  /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
287
- P(this, "$$p_d", {});
280
+ Z(this, "$$p_d", {});
288
281
  /** @type {Record<string, Function[]>} Event listeners */
289
- P(this, "$$l", {});
282
+ Z(this, "$$l", {});
290
283
  /** @type {Map<Function, Function>} Event listener unsubscribe functions */
291
- P(this, "$$l_u", /* @__PURE__ */ new Map());
292
- this.$$ctor = e, this.$$s = t, r && this.attachShadow({ mode: "open" });
284
+ Z(this, "$$l_u", /* @__PURE__ */ new Map());
285
+ this.$$ctor = e, this.$$s = t, i && this.attachShadow({ mode: "open" });
293
286
  }
294
- addEventListener(e, t, r) {
287
+ addEventListener(e, t, i) {
295
288
  if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
296
289
  const o = this.$$c.$on(e, t);
297
290
  this.$$l_u.set(t, o);
298
291
  }
299
- super.addEventListener(e, t, r);
292
+ super.addEventListener(e, t, i);
300
293
  }
301
- removeEventListener(e, t, r) {
302
- if (super.removeEventListener(e, t, r), this.$$c) {
294
+ removeEventListener(e, t, i) {
295
+ if (super.removeEventListener(e, t, i), this.$$c) {
303
296
  const o = this.$$l_u.get(t);
304
297
  o && (o(), this.$$l_u.delete(t));
305
298
  }
306
299
  }
307
300
  async connectedCallback() {
308
301
  if (this.$$cn = !0, !this.$$c) {
309
- let e = function(s) {
302
+ let e = function(l) {
310
303
  return () => {
311
- let l;
304
+ let s;
312
305
  return {
313
306
  c: function() {
314
- l = M("slot"), s !== "default" && u(l, "name", s);
307
+ s = F("slot"), l !== "default" && c(s, "name", l);
315
308
  },
316
309
  /**
317
310
  * @param {HTMLElement} target
318
311
  * @param {HTMLElement} [anchor]
319
312
  */
320
- m: function(h, w) {
321
- B(h, l, w);
313
+ m: function(u, A) {
314
+ H(u, s, A);
322
315
  },
323
- d: function(h) {
324
- h && S(l);
316
+ d: function(u) {
317
+ u && j(s);
325
318
  }
326
319
  };
327
320
  };
328
321
  };
329
322
  if (await Promise.resolve(), !this.$$cn || this.$$c)
330
323
  return;
331
- const t = {}, r = fn(this);
332
- for (const s of this.$$s)
333
- s in r && (t[s] = [e(s)]);
334
- for (const s of this.attributes) {
335
- const l = this.$$g_p(s.name);
336
- l in this.$$d || (this.$$d[l] = Se(l, s.value, this.$$p_d, "toProp"));
324
+ const t = {}, i = Jt(this);
325
+ for (const l of this.$$s)
326
+ l in i && (t[l] = [e(l)]);
327
+ for (const l of this.attributes) {
328
+ const s = this.$$g_p(l.name);
329
+ s in this.$$d || (this.$$d[s] = Ce(s, l.value, this.$$p_d, "toProp"));
337
330
  }
338
- for (const s in this.$$p_d)
339
- !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]);
331
+ for (const l in this.$$p_d)
332
+ !(l in this.$$d) && this[l] !== void 0 && (this.$$d[l] = this[l], delete this[l]);
340
333
  this.$$c = new this.$$ctor({
341
334
  target: this.shadowRoot || this,
342
335
  props: {
@@ -349,32 +342,32 @@ typeof HTMLElement == "function" && (Dt = class extends HTMLElement {
349
342
  });
350
343
  const o = () => {
351
344
  this.$$r = !0;
352
- for (const s in this.$$p_d)
353
- if (this.$$d[s] = this.$$c.$$.ctx[this.$$c.$$.props[s]], this.$$p_d[s].reflect) {
354
- const l = Se(
355
- s,
356
- this.$$d[s],
345
+ for (const l in this.$$p_d)
346
+ if (this.$$d[l] = this.$$c.$$.ctx[this.$$c.$$.props[l]], this.$$p_d[l].reflect) {
347
+ const s = Ce(
348
+ l,
349
+ this.$$d[l],
357
350
  this.$$p_d,
358
351
  "toAttribute"
359
352
  );
360
- l == null ? this.removeAttribute(this.$$p_d[s].attribute || s) : this.setAttribute(this.$$p_d[s].attribute || s, l);
353
+ s == null ? this.removeAttribute(this.$$p_d[l].attribute || l) : this.setAttribute(this.$$p_d[l].attribute || l, s);
361
354
  }
362
355
  this.$$r = !1;
363
356
  };
364
357
  this.$$c.$$.after_update.push(o), o();
365
- for (const s in this.$$l)
366
- for (const l of this.$$l[s]) {
367
- const c = this.$$c.$on(s, l);
368
- this.$$l_u.set(l, c);
358
+ for (const l in this.$$l)
359
+ for (const s of this.$$l[l]) {
360
+ const h = this.$$c.$on(l, s);
361
+ this.$$l_u.set(s, h);
369
362
  }
370
363
  this.$$l = {};
371
364
  }
372
365
  }
373
366
  // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
374
367
  // and setting attributes through setAttribute etc, this is helpful
375
- attributeChangedCallback(e, t, r) {
368
+ attributeChangedCallback(e, t, i) {
376
369
  var o;
377
- this.$$r || (e = this.$$g_p(e), this.$$d[e] = Se(e, r, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [e]: this.$$d[e] }));
370
+ this.$$r || (e = this.$$g_p(e), this.$$d[e] = Ce(e, i, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [e]: this.$$d[e] }));
378
371
  }
379
372
  disconnectedCallback() {
380
373
  this.$$cn = !1, Promise.resolve().then(() => {
@@ -387,12 +380,12 @@ typeof HTMLElement == "function" && (Dt = class extends HTMLElement {
387
380
  ) || e;
388
381
  }
389
382
  });
390
- function Se(n, e, t, r) {
391
- var s;
392
- const o = (s = t[n]) == null ? void 0 : s.type;
393
- if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !t[n])
383
+ function Ce(n, e, t, i) {
384
+ var l;
385
+ const o = (l = t[n]) == null ? void 0 : l.type;
386
+ if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !i || !t[n])
394
387
  return e;
395
- if (r === "toAttribute")
388
+ if (i === "toAttribute")
396
389
  switch (o) {
397
390
  case "Object":
398
391
  case "Array":
@@ -417,38 +410,38 @@ function Se(n, e, t, r) {
417
410
  return e;
418
411
  }
419
412
  }
420
- function pn(n, e, t, r, o, s) {
421
- let l = class extends Dt {
413
+ function un(n, e, t, i, o, l) {
414
+ let s = class extends _t {
422
415
  constructor() {
423
416
  super(n, t, o), this.$$p_d = e;
424
417
  }
425
418
  static get observedAttributes() {
426
419
  return Object.keys(e).map(
427
- (c) => (e[c].attribute || c).toLowerCase()
420
+ (h) => (e[h].attribute || h).toLowerCase()
428
421
  );
429
422
  }
430
423
  };
431
- return Object.keys(e).forEach((c) => {
432
- Object.defineProperty(l.prototype, c, {
424
+ return Object.keys(e).forEach((h) => {
425
+ Object.defineProperty(s.prototype, h, {
433
426
  get() {
434
- return this.$$c && c in this.$$c ? this.$$c[c] : this.$$d[c];
427
+ return this.$$c && h in this.$$c ? this.$$c[h] : this.$$d[h];
435
428
  },
436
- set(a) {
437
- var h;
438
- a = Se(c, a, e), this.$$d[c] = a, (h = this.$$c) == null || h.$set({ [c]: a });
429
+ set(d) {
430
+ var u;
431
+ d = Ce(h, d, e), this.$$d[h] = d, (u = this.$$c) == null || u.$set({ [h]: d });
439
432
  }
440
433
  });
441
- }), r.forEach((c) => {
442
- Object.defineProperty(l.prototype, c, {
434
+ }), i.forEach((h) => {
435
+ Object.defineProperty(s.prototype, h, {
443
436
  get() {
444
- var a;
445
- return (a = this.$$c) == null ? void 0 : a[c];
437
+ var d;
438
+ return (d = this.$$c) == null ? void 0 : d[h];
446
439
  }
447
440
  });
448
441
  }), n.element = /** @type {any} */
449
- l, l;
442
+ s, s;
450
443
  }
451
- class Cn {
444
+ class an {
452
445
  constructor() {
453
446
  /**
454
447
  * ### PRIVATE API
@@ -457,7 +450,7 @@ class Cn {
457
450
  *
458
451
  * @type {any}
459
452
  */
460
- P(this, "$$");
453
+ Z(this, "$$");
461
454
  /**
462
455
  * ### PRIVATE API
463
456
  *
@@ -465,11 +458,11 @@ class Cn {
465
458
  *
466
459
  * @type {any}
467
460
  */
468
- P(this, "$$set");
461
+ Z(this, "$$set");
469
462
  }
470
463
  /** @returns {void} */
471
464
  $destroy() {
472
- En(this, 1), this.$destroy = Me;
465
+ sn(this, 1), this.$destroy = xe;
473
466
  }
474
467
  /**
475
468
  * @template {Extract<keyof Events, string>} K
@@ -478,12 +471,12 @@ class Cn {
478
471
  * @returns {() => void}
479
472
  */
480
473
  $on(e, t) {
481
- if (!xt(t))
482
- return Me;
483
- const r = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
484
- return r.push(t), () => {
485
- const o = r.indexOf(t);
486
- o !== -1 && r.splice(o, 1);
474
+ if (!dt(t))
475
+ return xe;
476
+ const i = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
477
+ return i.push(t), () => {
478
+ const o = i.indexOf(t);
479
+ o !== -1 && i.splice(o, 1);
487
480
  };
488
481
  }
489
482
  /**
@@ -491,104 +484,104 @@ class Cn {
491
484
  * @returns {void}
492
485
  */
493
486
  $set(e) {
494
- this.$$set && !tn(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
487
+ this.$$set && !$t(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
495
488
  }
496
489
  }
497
- const An = "4";
498
- typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(An);
499
- const St = new TextEncoder();
500
- function xn(n) {
490
+ const hn = "4";
491
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(hn);
492
+ const wt = new TextEncoder();
493
+ function dn(n) {
501
494
  return [...new Uint8Array(n)].map((e) => e.toString(16).padStart(2, "0")).join("");
502
495
  }
503
- async function Ln(n, e = "SHA-256", t = 1e5) {
504
- const r = Date.now().toString(16);
496
+ async function gn(n, e = "SHA-256", t = 1e5) {
497
+ const i = Date.now().toString(16);
505
498
  n || (n = Math.round(Math.random() * t));
506
- const o = await Mt(r, n, e);
499
+ const o = await pt(i, n, e);
507
500
  return {
508
501
  algorithm: e,
509
502
  challenge: o,
510
- salt: r,
503
+ salt: i,
511
504
  signature: ""
512
505
  };
513
506
  }
514
- async function Mt(n, e, t) {
515
- return xn(
507
+ async function pt(n, e, t) {
508
+ return dn(
516
509
  await crypto.subtle.digest(
517
510
  t.toUpperCase(),
518
- St.encode(n + e)
511
+ wt.encode(n + e)
519
512
  )
520
513
  );
521
514
  }
522
- function In(n, e, t = "SHA-256", r = 1e6, o = 0) {
523
- const s = new AbortController(), l = Date.now();
515
+ function mn(n, e, t = "SHA-256", i = 1e6, o = 0) {
516
+ const l = new AbortController(), s = Date.now();
524
517
  return {
525
518
  promise: (async () => {
526
- for (let a = o; a <= r; a += 1) {
527
- if (s.signal.aborted)
519
+ for (let d = o; d <= i; d += 1) {
520
+ if (l.signal.aborted)
528
521
  return null;
529
- if (await Mt(e, a, t) === n)
522
+ if (await pt(e, d, t) === n)
530
523
  return {
531
- number: a,
532
- took: Date.now() - l
524
+ number: d,
525
+ took: Date.now() - s
533
526
  };
534
527
  }
535
528
  return null;
536
529
  })(),
537
- controller: s
530
+ controller: l
538
531
  };
539
532
  }
540
- function Nt() {
533
+ function bn() {
541
534
  try {
542
535
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
543
536
  } catch {
544
537
  }
545
538
  }
546
- function Tn(n) {
539
+ function yn(n) {
547
540
  const e = atob(n), t = new Uint8Array(e.length);
548
- for (let r = 0; r < e.length; r++)
549
- t[r] = e.charCodeAt(r);
541
+ for (let i = 0; i < e.length; i++)
542
+ t[i] = e.charCodeAt(i);
550
543
  return t;
551
544
  }
552
- function Rn(n, e = 12) {
545
+ function _n(n, e = 12) {
553
546
  const t = new Uint8Array(e);
554
- for (let r = 0; r < e; r++)
555
- t[r] = n % 256, n = Math.floor(n / 256);
547
+ for (let i = 0; i < e; i++)
548
+ t[i] = n % 256, n = Math.floor(n / 256);
556
549
  return t;
557
550
  }
558
- async function Fn(n, e = "", t = 1e6, r = 0) {
559
- const o = "AES-GCM", s = new AbortController(), l = Date.now(), c = async () => {
560
- for (let w = r; w <= t; w += 1) {
561
- if (s.signal.aborted || !a || !h)
551
+ async function wn(n, e = "", t = 1e6, i = 0) {
552
+ const o = "AES-GCM", l = new AbortController(), s = Date.now(), h = async () => {
553
+ for (let A = i; A <= t; A += 1) {
554
+ if (l.signal.aborted || !d || !u)
562
555
  return null;
563
556
  try {
564
- const x = await crypto.subtle.decrypt(
557
+ const b = await crypto.subtle.decrypt(
565
558
  {
566
559
  name: o,
567
- iv: Rn(w)
560
+ iv: _n(A)
568
561
  },
569
- a,
570
- h
562
+ d,
563
+ u
571
564
  );
572
- if (x)
565
+ if (b)
573
566
  return {
574
- clearText: new TextDecoder().decode(x),
575
- took: Date.now() - l
567
+ clearText: new TextDecoder().decode(b),
568
+ took: Date.now() - s
576
569
  };
577
570
  } catch {
578
571
  }
579
572
  }
580
573
  return null;
581
574
  };
582
- let a = null, h = null;
575
+ let d = null, u = null;
583
576
  try {
584
- h = Tn(n);
585
- const w = await crypto.subtle.digest(
577
+ u = yn(n);
578
+ const A = await crypto.subtle.digest(
586
579
  "SHA-256",
587
- St.encode(e)
580
+ wt.encode(e)
588
581
  );
589
- a = await crypto.subtle.importKey(
582
+ d = await crypto.subtle.importKey(
590
583
  "raw",
591
- w,
584
+ A,
592
585
  o,
593
586
  !1,
594
587
  ["decrypt"]
@@ -596,185 +589,84 @@ async function Fn(n, e = "", t = 1e6, r = 0) {
596
589
  } catch {
597
590
  return {
598
591
  promise: Promise.reject(),
599
- controller: s
592
+ controller: l
600
593
  };
601
594
  }
602
595
  return {
603
- promise: c(),
604
- controller: s
596
+ promise: h(),
597
+ controller: l
605
598
  };
606
599
  }
607
- var me, ge, Ce, Ae, xe, Le;
608
- class Dn {
609
- constructor(e) {
610
- P(this, "beaconUrl", null);
611
- P(this, "error", null);
612
- P(this, "loadTime", Date.now());
613
- P(this, "submitTime", null);
614
- P(this, "startTime", null);
615
- P(this, "viewTimeThresholdMs", 1500);
616
- fe(this, me, {});
617
- fe(this, ge, null);
618
- fe(this, Ce, this.onFormChange.bind(this));
619
- fe(this, Ae, this.onFormFocus.bind(this));
620
- fe(this, xe, this.onFormSubmit.bind(this));
621
- fe(this, Le, this.onUnload.bind(this));
622
- this.elForm = e, window.addEventListener("unload", G(this, Le)), this.elForm.addEventListener("change", G(this, Ce)), this.elForm.addEventListener("focusin", G(this, Ae)), this.elForm.addEventListener("submit", G(this, xe));
623
- }
624
- data() {
625
- const e = Object.entries(G(this, me));
626
- return {
627
- correction: e.length && e.filter(([t, r]) => r > 1).length / e.length || 0,
628
- dropoff: !this.submitTime && !this.error && G(this, ge) ? G(this, ge) : null,
629
- error: this.error,
630
- mobile: this.isMobile(),
631
- start: this.startTime,
632
- submit: this.submitTime,
633
- tz: Nt()
634
- };
635
- }
636
- dataAsBase64() {
637
- try {
638
- return btoa(
639
- JSON.stringify(this.data())
640
- );
641
- } catch (e) {
642
- console.error("failed to encode ALTCHA session data to base64", e);
643
- }
644
- return "";
645
- }
646
- destroy() {
647
- window.removeEventListener("unload", G(this, Le)), this.elForm.removeEventListener("change", G(this, Ce)), this.elForm.removeEventListener("focusin", G(this, Ae)), this.elForm.removeEventListener("submit", G(this, xe));
648
- }
649
- end() {
650
- this.submitTime || (this.submitTime = Date.now());
651
- }
652
- getFieldName(e, t = 40) {
653
- const r = e.getAttribute("data-group-label"), o = e.getAttribute("name") || e.getAttribute("aria-label");
654
- return ((r ? r + ": " : "") + o).slice(0, t);
655
- }
656
- isMobile() {
657
- const e = "userAgentData" in navigator && navigator.userAgentData ? navigator.userAgentData : {};
658
- return "mobile" in e ? e.mobile === !0 : /Mobi/i.test(window.navigator.userAgent);
659
- }
660
- isInput(e) {
661
- return ["INPUT", "SELECT", "TEXTAREA"].includes(e.tagName);
662
- }
663
- onFormFieldChange(e) {
664
- const t = this.getFieldName(e);
665
- t && this.trackFieldChange(t);
666
- }
667
- onFormChange(e) {
668
- const t = e.target;
669
- t && this.isInput(t) && this.onFormFieldChange(t);
670
- }
671
- onFormFocus(e) {
672
- const t = e.target;
673
- if (this.startTime || this.start(), t && this.isInput(t)) {
674
- const r = this.getFieldName(t);
675
- r && dt(this, ge, r);
676
- }
677
- }
678
- onFormSubmit() {
679
- this.end();
680
- }
681
- onUnload() {
682
- this.loadTime <= Date.now() - this.viewTimeThresholdMs && !this.submitTime && this.sendBeacon();
683
- }
684
- async sendBeacon() {
685
- if (this.beaconUrl && "sendBeacon" in navigator)
686
- try {
687
- navigator.sendBeacon(
688
- new URL(this.beaconUrl, location.origin),
689
- JSON.stringify(this.data())
690
- );
691
- } catch {
692
- }
693
- }
694
- start() {
695
- this.startTime = Date.now();
696
- }
697
- trackError(e) {
698
- this.error = e === null ? null : String(e);
699
- }
700
- trackFieldChange(e) {
701
- G(this, me)[e] = (G(this, me)[e] || 0) + 1;
702
- }
703
- }
704
- me = new WeakMap(), ge = new WeakMap(), Ce = new WeakMap(), Ae = new WeakMap(), xe = new WeakMap(), Le = new WeakMap();
705
- var y = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.VERIFIED = "verified", n.VERIFYING = "verifying", n.UNVERIFIED = "unverified", n.EXPIRED = "expired", n))(y || {});
706
- function yt(n) {
707
- let e, t, r;
600
+ var m = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.VERIFIED = "verified", n.VERIFYING = "verifying", n.UNVERIFIED = "unverified", n.EXPIRED = "expired", n))(m || {});
601
+ function ot(n) {
602
+ let e, t, i;
708
603
  return {
709
604
  c() {
710
- e = re("svg"), t = re("path"), r = re("path"), u(t, "d", "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"), u(t, "fill", "currentColor"), u(t, "opacity", ".25"), u(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"), u(r, "fill", "currentColor"), u(r, "class", "altcha-spinner"), u(e, "width", "24"), u(e, "height", "24"), u(e, "viewBox", "0 0 24 24"), u(e, "xmlns", "http://www.w3.org/2000/svg");
605
+ e = K("svg"), t = K("path"), i = K("path"), c(t, "d", "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"), c(t, "fill", "currentColor"), c(t, "opacity", ".25"), c(i, "d", "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"), c(i, "fill", "currentColor"), c(i, "class", "altcha-spinner"), c(e, "width", "24"), c(e, "height", "24"), c(e, "viewBox", "0 0 24 24"), c(e, "xmlns", "http://www.w3.org/2000/svg");
711
606
  },
712
- m(o, s) {
713
- B(o, e, s), I(e, t), I(e, r);
607
+ m(o, l) {
608
+ H(o, e, l), L(e, t), L(e, i);
714
609
  },
715
610
  d(o) {
716
- o && S(e);
611
+ o && j(e);
717
612
  }
718
613
  };
719
614
  }
720
- function Sn(n) {
615
+ function pn(n) {
721
616
  let e, t = (
722
617
  /*_strings*/
723
- n[13].label + ""
724
- ), r;
618
+ n[11].label + ""
619
+ ), i;
725
620
  return {
726
621
  c() {
727
- e = M("label"), u(e, "for", r = /*name*/
622
+ e = F("label"), c(e, "for", i = /*name*/
728
623
  n[4] + "_checkbox");
729
624
  },
730
- m(o, s) {
731
- B(o, e, s), e.innerHTML = t;
625
+ m(o, l) {
626
+ H(o, e, l), e.innerHTML = t;
732
627
  },
733
- p(o, s) {
734
- s[0] & /*_strings*/
735
- 8192 && t !== (t = /*_strings*/
736
- o[13].label + "") && (e.innerHTML = t), s[0] & /*name*/
737
- 16 && r !== (r = /*name*/
738
- o[4] + "_checkbox") && u(e, "for", r);
628
+ p(o, l) {
629
+ l[0] & /*_strings*/
630
+ 2048 && t !== (t = /*_strings*/
631
+ o[11].label + "") && (e.innerHTML = t), l[0] & /*name*/
632
+ 16 && i !== (i = /*name*/
633
+ o[4] + "_checkbox") && c(e, "for", i);
739
634
  },
740
635
  d(o) {
741
- o && S(e);
636
+ o && j(e);
742
637
  }
743
638
  };
744
639
  }
745
- function Mn(n) {
640
+ function En(n) {
746
641
  let e, t = (
747
642
  /*_strings*/
748
- n[13].verifying + ""
643
+ n[11].verifying + ""
749
644
  );
750
645
  return {
751
646
  c() {
752
- e = M("span");
647
+ e = F("span");
753
648
  },
754
- m(r, o) {
755
- B(r, e, o), e.innerHTML = t;
649
+ m(i, o) {
650
+ H(i, e, o), e.innerHTML = t;
756
651
  },
757
- p(r, o) {
652
+ p(i, o) {
758
653
  o[0] & /*_strings*/
759
- 8192 && t !== (t = /*_strings*/
760
- r[13].verifying + "") && (e.innerHTML = t);
654
+ 2048 && t !== (t = /*_strings*/
655
+ i[11].verifying + "") && (e.innerHTML = t);
761
656
  },
762
- d(r) {
763
- r && S(e);
657
+ d(i) {
658
+ i && j(e);
764
659
  }
765
660
  };
766
661
  }
767
- function Nn(n) {
662
+ function kn(n) {
768
663
  let e, t = (
769
664
  /*_strings*/
770
- n[13].verified + ""
771
- ), r, o, s, l, c = (
772
- /*session*/
773
- n[11] && wt(n)
774
- );
665
+ n[11].verified + ""
666
+ ), i, o;
775
667
  return {
776
668
  c() {
777
- e = M("span"), r = Q(), o = M("input"), s = Q(), c && c.c(), l = ln(), u(o, "type", "hidden"), u(
669
+ e = F("span"), i = z(), o = F("input"), c(o, "type", "hidden"), c(
778
670
  o,
779
671
  "name",
780
672
  /*name*/
@@ -782,585 +674,413 @@ function Nn(n) {
782
674
  ), o.value = /*payload*/
783
675
  n[6];
784
676
  },
785
- m(a, h) {
786
- B(a, e, h), e.innerHTML = t, B(a, r, h), B(a, o, h), B(a, s, h), c && c.m(a, h), B(a, l, h);
677
+ m(l, s) {
678
+ H(l, e, s), e.innerHTML = t, H(l, i, s), H(l, o, s);
787
679
  },
788
- p(a, h) {
789
- h[0] & /*_strings*/
790
- 8192 && t !== (t = /*_strings*/
791
- a[13].verified + "") && (e.innerHTML = t), h[0] & /*name*/
792
- 16 && u(
680
+ p(l, s) {
681
+ s[0] & /*_strings*/
682
+ 2048 && t !== (t = /*_strings*/
683
+ l[11].verified + "") && (e.innerHTML = t), s[0] & /*name*/
684
+ 16 && c(
793
685
  o,
794
686
  "name",
795
687
  /*name*/
796
- a[4]
797
- ), h[0] & /*payload*/
688
+ l[4]
689
+ ), s[0] & /*payload*/
798
690
  64 && (o.value = /*payload*/
799
- a[6]), /*session*/
800
- a[11] ? c ? c.p(a, h) : (c = wt(a), c.c(), c.m(l.parentNode, l)) : c && (c.d(1), c = null);
801
- },
802
- d(a) {
803
- a && (S(e), S(r), S(o), S(s), S(l)), c && c.d(a);
804
- }
805
- };
806
- }
807
- function wt(n) {
808
- let e;
809
- return {
810
- c() {
811
- e = M("input"), u(e, "type", "hidden"), u(e, "name", "__session"), e.value = /*sessionPayload*/
812
- n[12];
813
- },
814
- m(t, r) {
815
- B(t, e, r);
691
+ l[6]);
816
692
  },
817
- p(t, r) {
818
- r[0] & /*sessionPayload*/
819
- 4096 && (e.value = /*sessionPayload*/
820
- t[12]);
821
- },
822
- d(t) {
823
- t && S(e);
693
+ d(l) {
694
+ l && (j(e), j(i), j(o));
824
695
  }
825
696
  };
826
697
  }
827
- function _t(n) {
828
- let e, t, r, o, s, l, c;
698
+ function lt(n) {
699
+ let e, t, i, o, l, s, h;
829
700
  return {
830
701
  c() {
831
- e = M("div"), t = M("a"), r = re("svg"), o = re("path"), s = re("path"), l = re("path"), u(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), u(o, "fill", "currentColor"), u(s, "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"), u(s, "fill", "currentColor"), u(l, "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"), u(l, "fill", "currentColor"), u(r, "width", "22"), u(r, "height", "22"), u(r, "viewBox", "0 0 20 20"), u(r, "fill", "none"), u(r, "xmlns", "http://www.w3.org/2000/svg"), u(t, "href", Vt), u(t, "target", "_blank"), u(t, "class", "altcha-logo"), u(t, "aria-label", c = /*_strings*/
832
- n[13].ariaLinkLabel);
702
+ e = F("div"), t = F("a"), i = K("svg"), o = K("path"), l = K("path"), s = K("path"), c(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), c(o, "fill", "currentColor"), c(l, "d", "M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"), c(l, "fill", "currentColor"), c(s, "d", "M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"), c(s, "fill", "currentColor"), c(i, "width", "22"), c(i, "height", "22"), c(i, "viewBox", "0 0 20 20"), c(i, "fill", "none"), c(i, "xmlns", "http://www.w3.org/2000/svg"), c(t, "href", Et), c(t, "target", "_blank"), c(t, "class", "altcha-logo"), c(t, "aria-label", h = /*_strings*/
703
+ n[11].ariaLinkLabel);
833
704
  },
834
- m(a, h) {
835
- B(a, e, h), I(e, t), I(t, r), I(r, o), I(r, s), I(r, l);
705
+ m(d, u) {
706
+ H(d, e, u), L(e, t), L(t, i), L(i, o), L(i, l), L(i, s);
836
707
  },
837
- p(a, h) {
838
- h[0] & /*_strings*/
839
- 8192 && c !== (c = /*_strings*/
840
- a[13].ariaLinkLabel) && u(t, "aria-label", c);
708
+ p(d, u) {
709
+ u[0] & /*_strings*/
710
+ 2048 && h !== (h = /*_strings*/
711
+ d[11].ariaLinkLabel) && c(t, "aria-label", h);
841
712
  },
842
- d(a) {
843
- a && S(e);
713
+ d(d) {
714
+ d && j(e);
844
715
  }
845
716
  };
846
717
  }
847
- function Et(n) {
848
- let e, t, r, o;
849
- function s(a, h) {
718
+ function st(n) {
719
+ let e, t, i, o;
720
+ function l(d, u) {
850
721
  return (
851
722
  /*state*/
852
- a[7] === y.EXPIRED ? jn : Vn
723
+ d[7] === m.EXPIRED ? Cn : vn
853
724
  );
854
725
  }
855
- let l = s(n), c = l(n);
726
+ let s = l(n), h = s(n);
856
727
  return {
857
728
  c() {
858
- e = M("div"), t = re("svg"), r = re("path"), o = Q(), c.c(), u(r, "stroke-linecap", "round"), u(r, "stroke-linejoin", "round"), u(r, "d", "M6 18L18 6M6 6l12 12"), u(t, "width", "14"), u(t, "height", "14"), u(t, "xmlns", "http://www.w3.org/2000/svg"), u(t, "fill", "none"), u(t, "viewBox", "0 0 24 24"), u(t, "stroke-width", "1.5"), u(t, "stroke", "currentColor"), u(e, "class", "altcha-error");
729
+ e = F("div"), t = K("svg"), i = K("path"), o = z(), h.c(), c(i, "stroke-linecap", "round"), c(i, "stroke-linejoin", "round"), c(i, "d", "M6 18L18 6M6 6l12 12"), c(t, "width", "14"), c(t, "height", "14"), c(t, "xmlns", "http://www.w3.org/2000/svg"), c(t, "fill", "none"), c(t, "viewBox", "0 0 24 24"), c(t, "stroke-width", "1.5"), c(t, "stroke", "currentColor"), c(e, "class", "altcha-error");
859
730
  },
860
- m(a, h) {
861
- B(a, e, h), I(e, t), I(t, r), I(e, o), c.m(e, null);
731
+ m(d, u) {
732
+ H(d, e, u), L(e, t), L(t, i), L(e, o), h.m(e, null);
862
733
  },
863
- p(a, h) {
864
- l === (l = s(a)) && c ? c.p(a, h) : (c.d(1), c = l(a), c && (c.c(), c.m(e, null)));
734
+ p(d, u) {
735
+ s === (s = l(d)) && h ? h.p(d, u) : (h.d(1), h = s(d), h && (h.c(), h.m(e, null)));
865
736
  },
866
- d(a) {
867
- a && S(e), c.d();
737
+ d(d) {
738
+ d && j(e), h.d();
868
739
  }
869
740
  };
870
741
  }
871
- function Vn(n) {
742
+ function vn(n) {
872
743
  let e, t = (
873
744
  /*_strings*/
874
- n[13].error + ""
745
+ n[11].error + ""
875
746
  );
876
747
  return {
877
748
  c() {
878
- e = M("div"), u(
749
+ e = F("div"), c(
879
750
  e,
880
751
  "title",
881
752
  /*error*/
882
753
  n[5]
883
754
  );
884
755
  },
885
- m(r, o) {
886
- B(r, e, o), e.innerHTML = t;
756
+ m(i, o) {
757
+ H(i, e, o), e.innerHTML = t;
887
758
  },
888
- p(r, o) {
759
+ p(i, o) {
889
760
  o[0] & /*_strings*/
890
- 8192 && t !== (t = /*_strings*/
891
- r[13].error + "") && (e.innerHTML = t), o[0] & /*error*/
892
- 32 && u(
761
+ 2048 && t !== (t = /*_strings*/
762
+ i[11].error + "") && (e.innerHTML = t), o[0] & /*error*/
763
+ 32 && c(
893
764
  e,
894
765
  "title",
895
766
  /*error*/
896
- r[5]
767
+ i[5]
897
768
  );
898
769
  },
899
- d(r) {
900
- r && S(e);
770
+ d(i) {
771
+ i && j(e);
901
772
  }
902
773
  };
903
774
  }
904
- function jn(n) {
775
+ function Cn(n) {
905
776
  let e, t = (
906
777
  /*_strings*/
907
- n[13].expired + ""
778
+ n[11].expired + ""
908
779
  );
909
780
  return {
910
781
  c() {
911
- e = M("div"), u(
782
+ e = F("div"), c(
912
783
  e,
913
784
  "title",
914
785
  /*error*/
915
786
  n[5]
916
787
  );
917
788
  },
918
- m(r, o) {
919
- B(r, e, o), e.innerHTML = t;
789
+ m(i, o) {
790
+ H(i, e, o), e.innerHTML = t;
920
791
  },
921
- p(r, o) {
792
+ p(i, o) {
922
793
  o[0] & /*_strings*/
923
- 8192 && t !== (t = /*_strings*/
924
- r[13].expired + "") && (e.innerHTML = t), o[0] & /*error*/
925
- 32 && u(
794
+ 2048 && t !== (t = /*_strings*/
795
+ i[11].expired + "") && (e.innerHTML = t), o[0] & /*error*/
796
+ 32 && c(
926
797
  e,
927
798
  "title",
928
799
  /*error*/
929
- r[5]
800
+ i[5]
930
801
  );
931
802
  },
932
- d(r) {
933
- r && S(e);
803
+ d(i) {
804
+ i && j(e);
934
805
  }
935
806
  };
936
807
  }
937
- function vt(n) {
938
- let e, t, r = (
808
+ function ft(n) {
809
+ let e, t, i = (
939
810
  /*_strings*/
940
- n[13].footer + ""
811
+ n[11].footer + ""
941
812
  );
942
813
  return {
943
814
  c() {
944
- e = M("div"), t = M("div"), u(e, "class", "altcha-footer");
815
+ e = F("div"), t = F("div"), c(e, "class", "altcha-footer");
945
816
  },
946
- m(o, s) {
947
- B(o, e, s), I(e, t), t.innerHTML = r;
817
+ m(o, l) {
818
+ H(o, e, l), L(e, t), t.innerHTML = i;
948
819
  },
949
- p(o, s) {
950
- s[0] & /*_strings*/
951
- 8192 && r !== (r = /*_strings*/
952
- o[13].footer + "") && (t.innerHTML = r);
820
+ p(o, l) {
821
+ l[0] & /*_strings*/
822
+ 2048 && i !== (i = /*_strings*/
823
+ o[11].footer + "") && (t.innerHTML = i);
953
824
  },
954
825
  d(o) {
955
- o && S(e);
826
+ o && j(e);
956
827
  }
957
828
  };
958
829
  }
959
- function kt(n) {
830
+ function ct(n) {
960
831
  let e;
961
832
  return {
962
833
  c() {
963
- e = M("div"), u(e, "class", "altcha-anchor-arrow");
834
+ e = F("div"), c(e, "class", "altcha-anchor-arrow");
964
835
  },
965
- m(t, r) {
966
- B(t, e, r), n[46](e);
836
+ m(t, i) {
837
+ H(t, e, i), n[48](e);
967
838
  },
968
- p: Me,
839
+ p: xe,
969
840
  d(t) {
970
- t && S(e), n[46](null);
841
+ t && j(e), n[48](null);
971
842
  }
972
843
  };
973
844
  }
974
- function Un(n) {
975
- let e, t, r, o, s, l, c, a, h, w, x, $, k, J, H, ee, te;
976
- const R = (
845
+ function xn(n) {
846
+ let e, t, i, o, l, s, h, d, u, A, b, Y, U, $, D, R, X;
847
+ const J = (
977
848
  /*#slots*/
978
- n[44].default
979
- ), O = nn(
980
- R,
849
+ n[46].default
850
+ ), N = Bt(
851
+ J,
981
852
  n,
982
853
  /*$$scope*/
983
- n[43],
854
+ n[45],
984
855
  null
985
856
  );
986
- let N = (
857
+ let T = (
987
858
  /*state*/
988
- n[7] === y.VERIFYING && yt()
859
+ n[7] === m.VERIFYING && ot()
989
860
  );
990
- function oe(d, C) {
861
+ function Q(a, y) {
991
862
  return (
992
863
  /*state*/
993
- d[7] === y.VERIFIED ? Nn : (
864
+ a[7] === m.VERIFIED ? kn : (
994
865
  /*state*/
995
- d[7] === y.VERIFYING ? Mn : Sn
866
+ a[7] === m.VERIFYING ? En : pn
996
867
  )
997
868
  );
998
869
  }
999
- let ne = oe(n), Z = ne(n), L = (
870
+ let G = Q(n), V = G(n), v = (
1000
871
  /*hidelogo*/
1001
872
  (n[3] !== !0 || /*isFreeSaaS*/
1002
- n[14]) && _t(n)
1003
- ), F = (
873
+ n[12]) && lt(n)
874
+ ), P = (
1004
875
  /*error*/
1005
876
  (n[5] || /*state*/
1006
- n[7] === y.EXPIRED) && Et(n)
1007
- ), p = (
877
+ n[7] === m.EXPIRED) && st(n)
878
+ ), S = (
1008
879
  /*_strings*/
1009
- n[13].footer && /*hidefooter*/
880
+ n[11].footer && /*hidefooter*/
1010
881
  (n[2] !== !0 || /*isFreeSaaS*/
1011
- n[14]) && vt(n)
1012
- ), D = (
882
+ n[12]) && ft(n)
883
+ ), E = (
1013
884
  /*floating*/
1014
- n[1] && kt(n)
885
+ n[1] && ct(n)
1015
886
  );
1016
887
  return {
1017
888
  c() {
1018
- O && O.c(), e = Q(), t = M("div"), r = M("div"), N && N.c(), o = Q(), s = M("div"), l = M("input"), h = Q(), w = M("div"), Z.c(), x = Q(), L && L.c(), $ = Q(), F && F.c(), k = Q(), p && p.c(), J = Q(), D && D.c(), u(l, "type", "checkbox"), u(l, "id", c = /*name*/
1019
- n[4] + "_checkbox"), l.required = a = /*auto*/
1020
- n[0] !== "onsubmit", u(s, "class", "altcha-checkbox"), gt(
1021
- s,
889
+ N && N.c(), e = z(), t = F("div"), i = F("div"), T && T.c(), o = z(), l = F("div"), s = F("input"), u = z(), A = F("div"), V.c(), b = z(), v && v.c(), Y = z(), P && P.c(), U = z(), S && S.c(), $ = z(), E && E.c(), c(s, "type", "checkbox"), c(s, "id", h = /*name*/
890
+ n[4] + "_checkbox"), s.required = d = /*auto*/
891
+ n[0] !== "onsubmit" && (!/*floating*/
892
+ n[1] || /*auto*/
893
+ n[0] !== "off"), c(l, "class", "altcha-checkbox"), rt(
894
+ l,
1022
895
  "altcha-hidden",
1023
896
  /*state*/
1024
- n[7] === y.VERIFYING
1025
- ), u(w, "class", "altcha-label"), u(r, "class", "altcha-main"), u(t, "class", "altcha"), u(
897
+ n[7] === m.VERIFYING
898
+ ), c(A, "class", "altcha-label"), c(i, "class", "altcha-main"), c(t, "class", "altcha"), c(
1026
899
  t,
1027
900
  "data-state",
1028
901
  /*state*/
1029
902
  n[7]
1030
- ), u(
903
+ ), c(
1031
904
  t,
1032
905
  "data-floating",
1033
906
  /*floating*/
1034
907
  n[1]
1035
908
  );
1036
909
  },
1037
- m(d, C) {
1038
- O && O.m(d, C), B(d, e, C), B(d, t, C), I(t, r), N && N.m(r, null), I(r, o), I(r, s), I(s, l), l.checked = /*checked*/
1039
- n[8], I(r, h), I(r, w), Z.m(w, null), I(r, x), L && L.m(r, null), I(t, $), F && F.m(t, null), I(t, k), p && p.m(t, null), I(t, J), D && D.m(t, null), n[47](t), H = !0, ee || (te = [
1040
- Pe(
1041
- l,
910
+ m(a, y) {
911
+ N && N.m(a, y), H(a, e, y), H(a, t, y), L(t, i), T && T.m(i, null), L(i, o), L(i, l), L(l, s), s.checked = /*checked*/
912
+ n[8], L(i, u), L(i, A), V.m(A, null), L(i, b), v && v.m(i, null), L(t, Y), P && P.m(t, null), L(t, U), S && S.m(t, null), L(t, $), E && E.m(t, null), n[49](t), D = !0, R || (X = [
913
+ Le(
914
+ s,
1042
915
  "change",
1043
916
  /*input_change_handler*/
1044
- n[45]
917
+ n[47]
1045
918
  ),
1046
- Pe(
1047
- l,
919
+ Le(
920
+ s,
1048
921
  "change",
1049
922
  /*onCheckedChange*/
1050
- n[15]
923
+ n[13]
1051
924
  ),
1052
- Pe(
1053
- l,
925
+ Le(
926
+ s,
1054
927
  "invalid",
1055
928
  /*onInvalid*/
1056
- n[16]
929
+ n[14]
1057
930
  )
1058
- ], ee = !0);
931
+ ], R = !0);
1059
932
  },
1060
- p(d, C) {
1061
- O && O.p && (!H || C[1] & /*$$scope*/
1062
- 4096) && on(
1063
- O,
1064
- R,
1065
- d,
933
+ p(a, y) {
934
+ N && N.p && (!D || y[1] & /*$$scope*/
935
+ 16384) && Zt(
936
+ N,
937
+ J,
938
+ a,
1066
939
  /*$$scope*/
1067
- d[43],
1068
- H ? rn(
1069
- R,
940
+ a[45],
941
+ D ? qt(
942
+ J,
1070
943
  /*$$scope*/
1071
- d[43],
1072
- C,
944
+ a[45],
945
+ y,
1073
946
  null
1074
- ) : sn(
947
+ ) : Gt(
1075
948
  /*$$scope*/
1076
- d[43]
949
+ a[45]
1077
950
  ),
1078
951
  null
1079
952
  ), /*state*/
1080
- d[7] === y.VERIFYING ? N || (N = yt(), N.c(), N.m(r, o)) : N && (N.d(1), N = null), (!H || C[0] & /*name*/
1081
- 16 && c !== (c = /*name*/
1082
- d[4] + "_checkbox")) && u(l, "id", c), (!H || C[0] & /*auto*/
1083
- 1 && a !== (a = /*auto*/
1084
- d[0] !== "onsubmit")) && (l.required = a), C[0] & /*checked*/
1085
- 256 && (l.checked = /*checked*/
1086
- d[8]), (!H || C[0] & /*state*/
1087
- 128) && gt(
1088
- s,
953
+ a[7] === m.VERIFYING ? T || (T = ot(), T.c(), T.m(i, o)) : T && (T.d(1), T = null), (!D || y[0] & /*name*/
954
+ 16 && h !== (h = /*name*/
955
+ a[4] + "_checkbox")) && c(s, "id", h), (!D || y[0] & /*auto, floating*/
956
+ 3 && d !== (d = /*auto*/
957
+ a[0] !== "onsubmit" && (!/*floating*/
958
+ a[1] || /*auto*/
959
+ a[0] !== "off"))) && (s.required = d), y[0] & /*checked*/
960
+ 256 && (s.checked = /*checked*/
961
+ a[8]), (!D || y[0] & /*state*/
962
+ 128) && rt(
963
+ l,
1089
964
  "altcha-hidden",
1090
965
  /*state*/
1091
- d[7] === y.VERIFYING
1092
- ), ne === (ne = oe(d)) && Z ? Z.p(d, C) : (Z.d(1), Z = ne(d), Z && (Z.c(), Z.m(w, null))), /*hidelogo*/
1093
- d[3] !== !0 || /*isFreeSaaS*/
1094
- d[14] ? L ? L.p(d, C) : (L = _t(d), L.c(), L.m(r, null)) : L && (L.d(1), L = null), /*error*/
1095
- d[5] || /*state*/
1096
- d[7] === y.EXPIRED ? F ? F.p(d, C) : (F = Et(d), F.c(), F.m(t, k)) : F && (F.d(1), F = null), /*_strings*/
1097
- d[13].footer && /*hidefooter*/
1098
- (d[2] !== !0 || /*isFreeSaaS*/
1099
- d[14]) ? p ? p.p(d, C) : (p = vt(d), p.c(), p.m(t, J)) : p && (p.d(1), p = null), /*floating*/
1100
- d[1] ? D ? D.p(d, C) : (D = kt(d), D.c(), D.m(t, null)) : D && (D.d(1), D = null), (!H || C[0] & /*state*/
1101
- 128) && u(
966
+ a[7] === m.VERIFYING
967
+ ), G === (G = Q(a)) && V ? V.p(a, y) : (V.d(1), V = G(a), V && (V.c(), V.m(A, null))), /*hidelogo*/
968
+ a[3] !== !0 || /*isFreeSaaS*/
969
+ a[12] ? v ? v.p(a, y) : (v = lt(a), v.c(), v.m(i, null)) : v && (v.d(1), v = null), /*error*/
970
+ a[5] || /*state*/
971
+ a[7] === m.EXPIRED ? P ? P.p(a, y) : (P = st(a), P.c(), P.m(t, U)) : P && (P.d(1), P = null), /*_strings*/
972
+ a[11].footer && /*hidefooter*/
973
+ (a[2] !== !0 || /*isFreeSaaS*/
974
+ a[12]) ? S ? S.p(a, y) : (S = ft(a), S.c(), S.m(t, $)) : S && (S.d(1), S = null), /*floating*/
975
+ a[1] ? E ? E.p(a, y) : (E = ct(a), E.c(), E.m(t, null)) : E && (E.d(1), E = null), (!D || y[0] & /*state*/
976
+ 128) && c(
1102
977
  t,
1103
978
  "data-state",
1104
979
  /*state*/
1105
- d[7]
1106
- ), (!H || C[0] & /*floating*/
1107
- 2) && u(
980
+ a[7]
981
+ ), (!D || y[0] & /*floating*/
982
+ 2) && c(
1108
983
  t,
1109
984
  "data-floating",
1110
985
  /*floating*/
1111
- d[1]
986
+ a[1]
1112
987
  );
1113
988
  },
1114
- i(d) {
1115
- H || (Ft(O, d), H = !0);
989
+ i(a) {
990
+ D || (yt(N, a), D = !0);
1116
991
  },
1117
- o(d) {
1118
- wn(O, d), H = !1;
992
+ o(a) {
993
+ on(N, a), D = !1;
1119
994
  },
1120
- d(d) {
1121
- d && (S(e), S(t)), O && O.d(d), N && N.d(), Z.d(), L && L.d(), F && F.d(), p && p.d(), D && D.d(), n[47](null), ee = !1, Ie(te);
995
+ d(a) {
996
+ a && (j(e), j(t)), N && N.d(a), T && T.d(), V.d(), v && v.d(), P && P.d(), S && S.d(), E && E.d(), n[49](null), R = !1, pe(X);
1122
997
  }
1123
998
  };
1124
999
  }
1125
- const pt = "Visit Altcha.org", Vt = "https://altcha.org/";
1126
- function Ct(n) {
1000
+ const ut = "Visit Altcha.org", Et = "https://altcha.org/";
1001
+ function at(n) {
1127
1002
  return JSON.parse(n);
1128
1003
  }
1129
- function Pn(n, e, t) {
1130
- var ct, at;
1131
- let r, o, s, l, { $$slots: c = {}, $$scope: a } = e, { analytics: h = !1 } = e, { auto: w = void 0 } = e, { beaconurl: x = void 0 } = e, { blockspam: $ = void 0 } = e, { challengeurl: k = void 0 } = e, { challengejson: J = void 0 } = e, { debug: H = !1 } = e, { delay: ee = 0 } = e, { expire: te = void 0 } = e, { floating: R = void 0 } = e, { floatinganchor: O = void 0 } = e, { floatingoffset: N = void 0 } = e, { hidefooter: oe = !1 } = e, { hidelogo: ne = !1 } = e, { name: Z = "altcha" } = e, { maxnumber: L = 1e6 } = e, { mockerror: F = !1 } = e, { obfuscated: p = void 0 } = e, { refetchonexpire: D = !0 } = e, { spamfilter: d = !1 } = e, { strings: C = void 0 } = e, { test: X = !1 } = e, { verifyurl: se = void 0 } = e, { workers: be = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: Te = void 0 } = e;
1132
- const Ve = dn(), Ze = ["SHA-256", "SHA-384", "SHA-512"], Ge = (at = (ct = document.documentElement.lang) == null ? void 0 : ct.split("-")) == null ? void 0 : at[0];
1133
- let W = !1, z = null, v, le = null, Re = null, b = null, ie = null, ye = null, K = null, ce = null, q = null, Ye = null, T = y.UNVERIFIED;
1134
- hn(() => {
1135
- b && (b.removeEventListener("submit", We), b.removeEventListener("reset", ze), b.removeEventListener("focusin", Xe), b = null), ie && v.removeEventListener("click", Je), q && q.destroy(), K && (clearTimeout(K), K = null), document.removeEventListener("click", nt), document.removeEventListener("scroll", it), window.removeEventListener("resize", ot);
1136
- }), un(() => {
1137
- var i, f;
1138
- A("mounted", "0.8.0"), A("workers", be), X && A("using test mode"), te && Fe(te), w !== void 0 && A("auto", w), R !== void 0 && st(R), b = v.closest("form"), b && (b.addEventListener("submit", We, { capture: !0 }), b.addEventListener("reset", ze), w === "onfocus" && b.addEventListener("focusin", Xe)), ie = ((i = v.parentElement) == null ? void 0 : i.querySelector("[data-clarify-button]")) || ((f = v.parentElement) == null ? void 0 : f.querySelector("button, a")), ie && ie.addEventListener("click", Je), h && $e(), w === "onload" && (p ? _e() : ae()), r && (oe || ne) && A("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.");
1004
+ function An(n, e, t) {
1005
+ var Qe, et;
1006
+ let i, o, l, s, { $$slots: h = {}, $$scope: d } = e, { auto: u = void 0 } = e, { blockspam: A = void 0 } = e, { challengeurl: b = void 0 } = e, { challengejson: Y = void 0 } = e, { debug: U = !1 } = e, { delay: $ = 0 } = e, { expire: D = void 0 } = e, { floating: R = void 0 } = e, { floatinganchor: X = void 0 } = e, { floatingoffset: J = void 0 } = e, { hidefooter: N = !1 } = e, { hidelogo: T = !1 } = e, { name: Q = "altcha" } = e, { maxnumber: G = 1e6 } = e, { mockerror: V = !1 } = e, { obfuscated: v = void 0 } = e, { plugins: P = void 0 } = e, { refetchonexpire: S = !0 } = e, { spamfilter: E = !1 } = e, { strings: a = void 0 } = e, { test: y = !1 } = e, { verifyurl: ee = void 0 } = e, { workers: le = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ae = void 0 } = e;
1007
+ const he = Qt(), Pe = ["SHA-256", "SHA-384", "SHA-512"], Me = (et = (Qe = document.documentElement.lang) == null ? void 0 : Qe.split("-")) == null ? void 0 : et[0];
1008
+ let re = !1, C, ie = null, se = null, _ = null, de = null, W = null, oe = null, te = [], x = m.UNVERIFIED;
1009
+ Kt(() => {
1010
+ kt(), _ && (_.removeEventListener("submit", Oe), _.removeEventListener("reset", Ue), _.removeEventListener("focusin", He), _ = null), W && (clearTimeout(W), W = null), document.removeEventListener("click", Ve), document.removeEventListener("scroll", je), window.removeEventListener("resize", Be);
1011
+ }), zt(() => {
1012
+ k("mounted", "0.9.0"), k("workers", le), It(), k("plugins", te.length ? te.map((r) => r.constructor.pluginName).join(", ") : "none"), y && k("using test mode"), D && ke(D), u !== void 0 && k("auto", u), R !== void 0 && qe(R), _ = C.closest("form"), _ && (_.addEventListener("submit", Oe, { capture: !0 }), _.addEventListener("reset", Ue), u === "onfocus" && _.addEventListener("focusin", He)), u === "onload" && (v ? ge() : ne()), i && (N || T) && k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(() => {
1013
+ he("load");
1014
+ });
1139
1015
  });
1140
- function A(...i) {
1141
- (H || i.some((f) => f instanceof Error)) && console[i[0] instanceof Error ? "error" : "log"]("ALTCHA", ...i);
1142
- }
1143
- function Je(i) {
1144
- i.preventDefault(), T === y.UNVERIFIED && _e();
1145
- }
1146
- function Xe(i) {
1147
- T === y.UNVERIFIED && ae();
1148
- }
1149
- function We(i) {
1150
- b && q && T === y.VERIFIED && (q.end(), t(12, Ye = q.dataAsBase64())), b && w === "onsubmit" && (T === y.UNVERIFIED ? (i.preventDefault(), i.stopPropagation(), ae().then(() => {
1151
- b == null || b.requestSubmit();
1152
- })) : T !== y.VERIFIED && (i.preventDefault(), i.stopPropagation(), T === y.VERIFYING && rt()));
1153
- }
1154
- function ze() {
1155
- we();
1156
- }
1157
- function Ke(i, f) {
1016
+ function Fe(r, f) {
1158
1017
  return btoa(JSON.stringify({
1159
- algorithm: i.algorithm,
1160
- challenge: i.challenge,
1018
+ algorithm: r.algorithm,
1019
+ challenge: r.challenge,
1161
1020
  number: f.number,
1162
- salt: i.salt,
1163
- signature: i.signature,
1164
- test: X ? !0 : void 0,
1021
+ salt: r.salt,
1022
+ signature: r.signature,
1023
+ test: y ? !0 : void 0,
1165
1024
  took: f.took
1166
1025
  }));
1167
1026
  }
1168
- function Qe(i) {
1169
- if (!i.algorithm)
1170
- throw new Error("Invalid challenge. Property algorithm is missing.");
1171
- if (i.signature === void 0)
1172
- throw new Error("Invalid challenge. Property signature is missing.");
1173
- if (!Ze.includes(i.algorithm.toUpperCase()))
1174
- throw new Error(`Unknown algorithm value. Allowed values: ${Ze.join(", ")}`);
1175
- if (!i.challenge || i.challenge.length < 40)
1176
- throw new Error("Challenge is too short. Min. 40 chars.");
1177
- if (!i.salt || i.salt.length < 10)
1178
- throw new Error("Salt is too short. Min. 10 chars.");
1027
+ function kt() {
1028
+ for (const r of te)
1029
+ r.destroy();
1030
+ }
1031
+ function Ne() {
1032
+ b && S && x === m.VERIFIED ? ne() : me(m.EXPIRED, s.expired);
1179
1033
  }
1180
- async function jt() {
1181
- var i;
1182
- if (F)
1183
- throw A("mocking error"), new Error("Mocked error.");
1034
+ async function vt() {
1035
+ var r;
1036
+ if (V)
1037
+ throw k("mocking error"), new Error("Mocked error.");
1184
1038
  if (o)
1185
- return A("using provided json data"), o;
1186
- if (X)
1187
- return A("generating test challenge", { test: X }), Ln(typeof X != "boolean" ? +X : void 0);
1039
+ return k("using provided json data"), o;
1040
+ if (y)
1041
+ return k("generating test challenge", { test: y }), gn(typeof y != "boolean" ? +y : void 0);
1188
1042
  {
1189
- if (!k && b) {
1190
- const _ = b.getAttribute("action");
1191
- _ != null && _.includes("/form/") && t(17, k = _ + "/altcha");
1043
+ if (!b && _) {
1044
+ const w = _.getAttribute("action");
1045
+ w != null && w.includes("/form/") && t(15, b = w + "/altcha");
1192
1046
  }
1193
- if (!k)
1047
+ if (!b)
1194
1048
  throw new Error("Attribute challengeurl not set.");
1195
- A("fetching challenge from", k);
1196
- const f = await fetch(k, {
1197
- headers: d ? { "x-altcha-spam-filter": "1" } : {}
1049
+ k("fetching challenge from", b);
1050
+ const f = await fetch(b, {
1051
+ headers: E ? { "x-altcha-spam-filter": "1" } : {}
1198
1052
  });
1199
1053
  if (f.status !== 200)
1200
1054
  throw new Error(`Server responded with ${f.status}.`);
1201
- const m = f.headers.get("Expires"), g = f.headers.get("X-Altcha-Config"), V = await f.json(), j = new URLSearchParams((i = V.salt.split("?")) == null ? void 0 : i[1]), U = j.get("expires") || j.get("expire");
1202
- if (U) {
1203
- const _ = new Date(+U * 1e3), Y = isNaN(_.getTime()) ? 0 : _.getTime() - Date.now();
1204
- Y > 0 && Fe(Y);
1055
+ const g = f.headers.get("Expires"), I = f.headers.get("X-Altcha-Config"), B = await f.json(), O = new URLSearchParams((r = B.salt.split("?")) == null ? void 0 : r[1]), M = O.get("expires") || O.get("expire");
1056
+ if (M) {
1057
+ const w = new Date(+M * 1e3), q = isNaN(w.getTime()) ? 0 : w.getTime() - Date.now();
1058
+ q > 0 && ke(q);
1205
1059
  }
1206
- if (g)
1060
+ if (I)
1207
1061
  try {
1208
- const _ = JSON.parse(g);
1209
- _ && typeof _ == "object" && (_.verifyurl && (_.verifyurl = new URL(_.verifyurl, new URL(k)).toString()), lt(_));
1210
- } catch (_) {
1211
- A("unable to configure from X-Altcha-Config", _);
1062
+ const w = JSON.parse(I);
1063
+ w && typeof w == "object" && (w.verifyurl && (w.verifyurl = new URL(w.verifyurl, new URL(b)).toString()), Ye(w));
1064
+ } catch (w) {
1065
+ k("unable to configure from X-Altcha-Config", w);
1212
1066
  }
1213
- if (!te && (m != null && m.length)) {
1214
- const _ = Date.parse(m);
1215
- if (_) {
1216
- const Y = _ - Date.now();
1217
- Y > 0 && Fe(Y);
1067
+ if (!D && (g != null && g.length)) {
1068
+ const w = Date.parse(g);
1069
+ if (w) {
1070
+ const q = w - Date.now();
1071
+ q > 0 && ke(q);
1218
1072
  }
1219
1073
  }
1220
- return V;
1074
+ return B;
1221
1075
  }
1222
1076
  }
1223
- function $e() {
1224
- if (!q)
1225
- if (b) {
1226
- if (A("analytics enabled"), t(11, q = new Dn(b)), x === void 0) {
1227
- const i = b.getAttribute("action");
1228
- i && t(19, x = i + "/beacon");
1229
- }
1230
- t(11, q.beaconUrl = x || null, q);
1231
- } else
1232
- A("analytics cannot be enabled - form element not found");
1233
- }
1234
- function et() {
1235
- k && D && T === y.VERIFIED ? ae() : we(y.EXPIRED, l.expired);
1236
- }
1237
- async function tt(i) {
1238
- let f = null;
1239
- if ("Worker" in window) {
1240
- try {
1241
- f = await Ut(i, i.maxnumber);
1242
- } catch (m) {
1243
- A(m);
1244
- }
1245
- if ((f == null ? void 0 : f.number) !== void 0 || "obfuscated" in i)
1246
- return { data: i, solution: f };
1247
- }
1248
- if ("obfuscated" in i) {
1249
- const m = await Fn(i.obfuscated, i.key, i.maxnumber);
1250
- return { data: i, solution: await m.promise };
1251
- }
1252
- return {
1253
- data: i,
1254
- solution: await In(i.challenge, i.salt, i.algorithm, i.maxnumber || L).promise
1255
- };
1256
- }
1257
- async function Ut(i, f = typeof X == "number" ? X : L, m = Math.ceil(be)) {
1258
- const g = [];
1259
- m = Math.min(16, Math.max(1, m));
1260
- for (let U = 0; U < m; U++)
1261
- g.push(createAltchaWorker(Te));
1262
- const V = Math.ceil(f / m), j = await Promise.all(g.map((U, _) => {
1263
- const Y = _ * V;
1264
- return new Promise((Ue) => {
1265
- U.addEventListener("message", (Ee) => {
1266
- if (Ee.data)
1267
- for (const ve of g)
1268
- ve !== U && ve.postMessage({ type: "abort" });
1269
- Ue(Ee.data);
1270
- }), U.postMessage({
1271
- payload: i,
1272
- max: Y + V,
1273
- start: Y,
1274
- type: "work"
1275
- });
1276
- });
1277
- }));
1278
- for (const U of g)
1279
- U.terminate();
1280
- return j.find((U) => !!U) || null;
1281
- }
1282
- function Pt() {
1283
- [y.UNVERIFIED, y.ERROR, y.EXPIRED].includes(T) ? d && (b == null ? void 0 : b.reportValidity()) === !1 ? t(8, W = !1) : p ? _e() : ae() : t(8, W = !0);
1284
- }
1285
- function nt(i) {
1286
- const f = i.target;
1287
- R && f && !v.contains(f) && T === y.VERIFIED && t(9, v.style.display = "none", v);
1288
- }
1289
- function it() {
1290
- R && je();
1291
- }
1292
- function rt() {
1293
- T === y.VERIFYING && l.waitAlert && alert(l.waitAlert);
1294
- }
1295
- function Bt(i) {
1296
- var f;
1297
- if (z) {
1298
- const m = z.match(/^(mailto|tel|sms|https?):/);
1299
- let g;
1300
- if (m) {
1301
- const [V] = z.slice(z.indexOf(":") + 1).replace(/^\/\//, "").split("?");
1302
- g = document.createElement("a"), g.href = z, g.innerHTML = V;
1303
- } else
1304
- g = document.createTextNode(z);
1305
- ie && g && (ie.after(g), (f = ie.parentElement) == null || f.removeChild(ie));
1306
- }
1307
- }
1308
- function Ot(i) {
1309
- q && q.trackError(ye);
1310
- }
1311
- function Ht(i) {
1312
- R && T !== y.UNVERIFIED && requestAnimationFrame(() => {
1313
- je();
1314
- });
1315
- }
1316
- function ot() {
1317
- R && je();
1318
- }
1319
- function Fe(i) {
1320
- A("expire", i), K && (clearTimeout(K), K = null), i < 1 ? et() : K = setTimeout(et, i);
1077
+ function Ct(r) {
1078
+ var g;
1079
+ const f = _ == null ? void 0 : _.querySelector(typeof r == "string" ? `input[name="${r}"]` : 'input[type="email"]:not([data-no-spamfilter])');
1080
+ return ((g = f == null ? void 0 : f.value) == null ? void 0 : g.slice(f.value.indexOf("@"))) || void 0;
1321
1081
  }
1322
- function st(i) {
1323
- A("floating", i), R !== i && (t(9, v.style.left = "", v), t(9, v.style.top = "", v)), t(1, R = i === !0 || i === "" ? "auto" : i === !1 || i === "false" ? void 0 : R), R ? (w || t(0, w = "onsubmit"), document.addEventListener("scroll", it), document.addEventListener("click", nt), window.addEventListener("resize", ot)) : w === "onsubmit" && t(0, w = void 0);
1324
- }
1325
- function qt(i) {
1326
- var m;
1327
- const f = b == null ? void 0 : b.querySelector(typeof i == "string" ? `input[name="${i}"]` : 'input[type="email"]:not([data-no-spamfilter])');
1328
- return ((m = f == null ? void 0 : f.value) == null ? void 0 : m.slice(f.value.indexOf("@"))) || void 0;
1329
- }
1330
- function Zt(i) {
1331
- return [
1332
- ...(b == null ? void 0 : b.querySelectorAll(i != null && i.length ? i.map((m) => `input[name="${m}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
1333
- ].reduce(
1334
- (m, g) => {
1335
- const V = g.name, j = g.value;
1336
- return V && j && (m[V] = /\n/.test(j) ? j.replace(new RegExp("(?<!\\r)\\n", "g"), `\r
1337
- `) : j), m;
1338
- },
1339
- {}
1340
- );
1341
- }
1342
- async function Gt(i) {
1343
- if (!se)
1344
- throw new Error("Attribute verifyurl not set.");
1345
- A("requesting server verification from", se);
1346
- const f = { payload: i };
1347
- if (d) {
1348
- const { blockedCountries: V, classifier: j, disableRules: U, email: _, expectedLanguages: Y, expectedCountries: Ue, fields: Ee, ipAddress: ve, text: zt, timeZone: ft } = Yt();
1349
- f.blockedCountries = V, f.classifier = j, f.disableRules = U, f.email = _ === !1 ? void 0 : qt(_), f.expectedCountries = Ue, f.expectedLanguages = Y || (Ge ? [Ge] : void 0), f.fields = Ee === !1 ? void 0 : Zt(Ee), f.ipAddress = ve === !1 ? void 0 : ve || "auto", f.text = zt, f.timeZone = ft === !1 ? void 0 : ft || Nt();
1350
- }
1351
- const m = await fetch(se, {
1352
- body: JSON.stringify(f),
1353
- headers: { "content-type": "application/json" },
1354
- method: "POST"
1355
- });
1356
- if (m.status !== 200)
1357
- throw new Error(`Server responded with ${m.status}.`);
1358
- const g = await m.json();
1359
- if (g != null && g.payload && t(6, ce = g.payload), Ve("serververification", g), $ && g.classification === "BAD")
1360
- throw new Error("SpamFilter returned negative classification.");
1361
- }
1362
- function Yt() {
1363
- return d === "ipAddress" ? {
1082
+ function xt() {
1083
+ return E === "ipAddress" ? {
1364
1084
  blockedCountries: void 0,
1365
1085
  classifier: void 0,
1366
1086
  disableRules: void 0,
@@ -1371,7 +1091,7 @@ function Pn(n, e, t) {
1371
1091
  ipAddress: void 0,
1372
1092
  text: void 0,
1373
1093
  timeZone: void 0
1374
- } : typeof d == "object" ? d : {
1094
+ } : typeof E == "object" ? E : {
1375
1095
  blockedCountries: void 0,
1376
1096
  classifier: void 0,
1377
1097
  disableRules: void 0,
@@ -1384,350 +1104,578 @@ function Pn(n, e, t) {
1384
1104
  timeZone: void 0
1385
1105
  };
1386
1106
  }
1387
- function je(i = 20) {
1388
- if (v)
1389
- if (Re || (Re = (O ? document.querySelector(O) : b == null ? void 0 : b.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')) || b || ie), Re) {
1390
- const f = parseInt(N, 10) || 12, m = Re.getBoundingClientRect(), g = v.getBoundingClientRect(), V = document.documentElement.clientHeight, j = document.documentElement.clientWidth, U = R === "auto" ? m.bottom + g.height + f + i > V : R === "top", _ = Math.max(i, Math.min(j - i - g.width, m.left + m.width / 2 - g.width / 2));
1391
- if (U ? t(9, v.style.top = `${m.top - (g.height + f)}px`, v) : t(9, v.style.top = `${m.bottom + f}px`, v), t(9, v.style.left = `${_}px`, v), v.setAttribute("data-floating", U ? "top" : "bottom"), le) {
1392
- const Y = le.getBoundingClientRect();
1393
- t(10, le.style.left = m.left - _ + m.width / 2 - Y.width / 2 + "px", le);
1107
+ function At(r) {
1108
+ return [
1109
+ ...(_ == null ? void 0 : _.querySelectorAll(r != null && r.length ? r.map((g) => `input[name="${g}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
1110
+ ].reduce(
1111
+ (g, I) => {
1112
+ const B = I.name, O = I.value;
1113
+ return B && O && (g[B] = /\n/.test(O) ? O.replace(new RegExp("(?<!\\r)\\n", "g"), `\r
1114
+ `) : O), g;
1115
+ },
1116
+ {}
1117
+ );
1118
+ }
1119
+ function It() {
1120
+ const r = P !== void 0 ? P.split(",") : void 0;
1121
+ for (const f of globalThis.altchaPlugins)
1122
+ (!r || r.includes(f.pluginName)) && te.push(new f({
1123
+ el: C,
1124
+ clarify: ge,
1125
+ dispatch: he,
1126
+ getConfiguration: We,
1127
+ getFloatingAnchor: Xe,
1128
+ getState: Je,
1129
+ log: k,
1130
+ reset: me,
1131
+ solve: Ge,
1132
+ setState: Ke,
1133
+ setFloatingAnchor: ze,
1134
+ verify: ne
1135
+ }));
1136
+ }
1137
+ function k(...r) {
1138
+ (U || r.some((f) => f instanceof Error)) && console[r[0] instanceof Error ? "error" : "log"]("ALTCHA", `[name=${Q}]`, ...r);
1139
+ }
1140
+ function Lt() {
1141
+ [m.UNVERIFIED, m.ERROR, m.EXPIRED].includes(x) ? E && (_ == null ? void 0 : _.reportValidity()) === !1 ? t(8, re = !1) : v ? ge() : ne() : t(8, re = !0);
1142
+ }
1143
+ function Ve(r) {
1144
+ const f = r.target;
1145
+ R && f && !C.contains(f) && (x === m.VERIFIED || u === "off" && x === m.UNVERIFIED) && t(9, C.style.display = "none", C);
1146
+ }
1147
+ function je() {
1148
+ R && x !== m.UNVERIFIED && Ee();
1149
+ }
1150
+ function Rt(r) {
1151
+ for (const f of te)
1152
+ typeof f.onErrorChange == "function" && f.onErrorChange(de);
1153
+ }
1154
+ function He(r) {
1155
+ x === m.UNVERIFIED && ne();
1156
+ }
1157
+ function Oe(r) {
1158
+ _ && u === "onsubmit" ? x === m.UNVERIFIED ? (r.preventDefault(), r.stopPropagation(), ne().then(() => {
1159
+ _ == null || _.requestSubmit();
1160
+ })) : x !== m.VERIFIED && (r.preventDefault(), r.stopPropagation(), x === m.VERIFYING && $e()) : _ && R && u === "off" && x === m.UNVERIFIED && (r.preventDefault(), r.stopPropagation(), t(9, C.style.display = "block", C), Ee());
1161
+ }
1162
+ function Ue() {
1163
+ me();
1164
+ }
1165
+ function $e() {
1166
+ x === m.VERIFYING && s.waitAlert && alert(s.waitAlert);
1167
+ }
1168
+ function St(r) {
1169
+ for (const f of te)
1170
+ typeof f.onStateChange == "function" && f.onStateChange(x);
1171
+ R && x !== m.UNVERIFIED && requestAnimationFrame(() => {
1172
+ Ee();
1173
+ }), t(8, re = x === m.VERIFIED);
1174
+ }
1175
+ function Be() {
1176
+ R && Ee();
1177
+ }
1178
+ function Ee(r = 20) {
1179
+ if (C)
1180
+ if (se || (se = (X ? document.querySelector(X) : _ == null ? void 0 : _.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')) || _), se) {
1181
+ const f = parseInt(J, 10) || 12, g = se.getBoundingClientRect(), I = C.getBoundingClientRect(), B = document.documentElement.clientHeight, O = document.documentElement.clientWidth, M = R === "auto" ? g.bottom + I.height + f + r > B : R === "top", w = Math.max(r, Math.min(O - r - I.width, g.left + g.width / 2 - I.width / 2));
1182
+ if (M ? t(9, C.style.top = `${g.top - (I.height + f)}px`, C) : t(9, C.style.top = `${g.bottom + f}px`, C), t(9, C.style.left = `${w}px`, C), C.setAttribute("data-floating", M ? "top" : "bottom"), ie) {
1183
+ const q = ie.getBoundingClientRect();
1184
+ t(10, ie.style.left = g.left - w + g.width / 2 - q.width / 2 + "px", ie);
1394
1185
  }
1395
1186
  } else
1396
- A("unable to find floating anchor element");
1187
+ k("unable to find floating anchor element");
1188
+ }
1189
+ async function Dt(r) {
1190
+ if (!ee)
1191
+ throw new Error("Attribute verifyurl not set.");
1192
+ k("requesting server verification from", ee);
1193
+ const f = { payload: r };
1194
+ if (E) {
1195
+ const { blockedCountries: B, classifier: O, disableRules: M, email: w, expectedLanguages: q, expectedCountries: Ie, fields: be, ipAddress: ye, text: Vt, timeZone: tt } = xt();
1196
+ f.blockedCountries = B, f.classifier = O, f.disableRules = M, f.email = w === !1 ? void 0 : Ct(w), f.expectedCountries = Ie, f.expectedLanguages = q || (Me ? [Me] : void 0), f.fields = be === !1 ? void 0 : At(be), f.ipAddress = ye === !1 ? void 0 : ye || "auto", f.text = Vt, f.timeZone = tt === !1 ? void 0 : tt || bn();
1197
+ }
1198
+ const g = await fetch(ee, {
1199
+ body: JSON.stringify(f),
1200
+ headers: { "content-type": "application/json" },
1201
+ method: "POST"
1202
+ });
1203
+ if (g.status !== 200)
1204
+ throw new Error(`Server responded with ${g.status}.`);
1205
+ const I = await g.json();
1206
+ if (I != null && I.payload && t(6, oe = I.payload), he("serververification", I), A && I.classification === "BAD")
1207
+ throw new Error("SpamFilter returned negative classification.");
1397
1208
  }
1398
- function lt(i) {
1399
- i.analytics && (t(18, h = i.analytics), $e()), i.obfuscated !== void 0 && t(27, p = i.obfuscated), i.auto !== void 0 && (t(0, w = i.auto), w === "onload" && (p ? _e() : ae())), i.beaconurl && (t(19, x = i.beaconurl), q && t(11, q.beaconUrl = x, q)), i.floatinganchor !== void 0 && t(23, O = i.floatinganchor), i.delay !== void 0 && t(21, ee = i.delay), i.floatingoffset !== void 0 && t(24, N = i.floatingoffset), i.floating !== void 0 && st(i.floating), i.expire !== void 0 && (Fe(i.expire), t(22, te = i.expire)), i.challenge && (Qe(i.challenge), o = i.challenge), i.challengeurl !== void 0 && t(17, k = i.challengeurl), i.debug !== void 0 && t(20, H = !!i.debug), i.hidefooter !== void 0 && t(2, oe = !!i.hidefooter), i.hidelogo !== void 0 && t(3, ne = !!i.hidelogo), i.maxnumber !== void 0 && t(25, L = +i.maxnumber), i.mockerror !== void 0 && t(26, F = !!i.mockerror), i.name !== void 0 && t(4, Z = i.name), i.refetchonexpire !== void 0 && t(28, D = !!i.refetchonexpire), i.spamfilter !== void 0 && t(29, d = typeof i.spamfilter == "object" ? i.spamfilter : !!i.spamfilter), i.strings && t(42, s = i.strings), i.test !== void 0 && t(30, X = typeof i.test == "number" ? i.test : !!i.test), i.verifyurl !== void 0 && t(31, se = i.verifyurl), i.workers !== void 0 && t(32, be = +i.workers), i.workerurl !== void 0 && t(33, Te = i.workerurl);
1209
+ function ke(r) {
1210
+ k("expire", r), W && (clearTimeout(W), W = null), r < 1 ? Ne() : W = setTimeout(Ne, r);
1400
1211
  }
1401
- function we(i = y.UNVERIFIED, f = null) {
1402
- K && (clearTimeout(K), K = null), t(8, W = !1), t(5, ye = f), t(6, ce = null), t(7, T = i);
1212
+ function qe(r) {
1213
+ k("floating", r), R !== r && (t(9, C.style.left = "", C), t(9, C.style.top = "", C)), t(1, R = r === !0 || r === "" ? "auto" : r === !1 || r === "false" ? void 0 : R), R ? (u || t(0, u = "onsubmit"), document.addEventListener("scroll", je), document.addEventListener("click", Ve), window.addEventListener("resize", Be)) : u === "onsubmit" && t(0, u = void 0);
1403
1214
  }
1404
- async function ae() {
1405
- return we(y.VERIFYING), await new Promise((i) => setTimeout(i, ee || 0)), jt().then((i) => (Qe(i), A("challenge", i), tt(i))).then(({ data: i, solution: f }) => {
1406
- if (A("solution", f), "challenge" in i && f && !("clearText" in f))
1407
- if ((f == null ? void 0 : f.number) !== void 0) {
1408
- if (se)
1409
- return Gt(Ke(i, f));
1410
- t(6, ce = Ke(i, f)), A("payload", ce);
1411
- } else
1412
- throw A("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned.");
1413
- }).then(() => {
1414
- mn().then(() => {
1415
- t(7, T = y.VERIFIED), t(8, W = !0), A("verified"), Ve("verified", { payload: ce });
1215
+ function Ze(r) {
1216
+ if (!r.algorithm)
1217
+ throw new Error("Invalid challenge. Property algorithm is missing.");
1218
+ if (r.signature === void 0)
1219
+ throw new Error("Invalid challenge. Property signature is missing.");
1220
+ if (!Pe.includes(r.algorithm.toUpperCase()))
1221
+ throw new Error(`Unknown algorithm value. Allowed values: ${Pe.join(", ")}`);
1222
+ if (!r.challenge || r.challenge.length < 40)
1223
+ throw new Error("Challenge is too short. Min. 40 chars.");
1224
+ if (!r.salt || r.salt.length < 10)
1225
+ throw new Error("Salt is too short. Min. 10 chars.");
1226
+ }
1227
+ async function Ge(r) {
1228
+ let f = null;
1229
+ if ("Worker" in window) {
1230
+ try {
1231
+ f = await Tt(r, r.maxnumber);
1232
+ } catch (g) {
1233
+ k(g);
1234
+ }
1235
+ if ((f == null ? void 0 : f.number) !== void 0 || "obfuscated" in r)
1236
+ return { data: r, solution: f };
1237
+ }
1238
+ if ("obfuscated" in r) {
1239
+ const g = await wn(r.obfuscated, r.key, r.maxnumber);
1240
+ return { data: r, solution: await g.promise };
1241
+ }
1242
+ return {
1243
+ data: r,
1244
+ solution: await mn(r.challenge, r.salt, r.algorithm, r.maxnumber || G).promise
1245
+ };
1246
+ }
1247
+ async function Tt(r, f = typeof y == "number" ? y : G, g = Math.ceil(le)) {
1248
+ const I = [];
1249
+ g = Math.min(16, Math.max(1, g));
1250
+ for (let M = 0; M < g; M++)
1251
+ I.push(altchaCreateWorker(ae));
1252
+ const B = Math.ceil(f / g), O = await Promise.all(I.map((M, w) => {
1253
+ const q = w * B;
1254
+ return new Promise((Ie) => {
1255
+ M.addEventListener("message", (be) => {
1256
+ if (be.data)
1257
+ for (const ye of I)
1258
+ ye !== M && ye.postMessage({ type: "abort" });
1259
+ Ie(be.data);
1260
+ }), M.postMessage({
1261
+ payload: r,
1262
+ max: q + B,
1263
+ start: q,
1264
+ type: "work"
1265
+ });
1416
1266
  });
1417
- }).catch((i) => {
1418
- A(i), t(7, T = y.ERROR), t(8, W = !1), t(5, ye = i.message);
1419
- });
1267
+ }));
1268
+ for (const M of I)
1269
+ M.terminate();
1270
+ return O.find((M) => !!M) || null;
1420
1271
  }
1421
- async function _e() {
1422
- if (!p) {
1423
- t(7, T = y.ERROR);
1272
+ async function ge() {
1273
+ if (!v) {
1274
+ t(7, x = m.ERROR);
1424
1275
  return;
1425
1276
  }
1426
- we(y.VERIFYING), await new Promise((j) => setTimeout(j, ee || 0));
1427
- const [i, f] = p.split("?");
1428
- let g = new URLSearchParams(f || "").get("key") || void 0;
1429
- if (g) {
1430
- const j = g.match(/^\(prompt:?(.*)\)$/);
1431
- j && (g = prompt(j[1] || "Enter Key:") || void 0);
1277
+ const r = te.find((f) => f.constructor.pluginName === "obfuscation");
1278
+ if (!r || !("clarify" in r)) {
1279
+ t(7, x = m.ERROR), k("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");
1280
+ return;
1432
1281
  }
1433
- const { solution: V } = await tt({ obfuscated: i, key: g, maxnumber: L });
1434
- V && "clearText" in V ? (t(41, z = V.clearText), t(7, T = y.VERIFIED), t(8, W = !0), R && v && t(9, v.style.display = "none", v)) : (t(7, T = y.ERROR), t(8, W = !1), t(5, ye = "Unable to decrypt data."));
1282
+ if ("clarify" in r && typeof r.clarify == "function")
1283
+ return r.clarify();
1284
+ }
1285
+ function Ye(r) {
1286
+ r.obfuscated !== void 0 && t(24, v = r.obfuscated), r.auto !== void 0 && (t(0, u = r.auto), u === "onload" && (v ? ge() : ne())), r.blockspam !== void 0 && t(16, A = !!r.blockspam), r.floatinganchor !== void 0 && t(20, X = r.floatinganchor), r.delay !== void 0 && t(18, $ = r.delay), r.floatingoffset !== void 0 && t(21, J = r.floatingoffset), r.floating !== void 0 && qe(r.floating), r.expire !== void 0 && (ke(r.expire), t(19, D = r.expire)), r.challenge && (Ze(r.challenge), o = r.challenge), r.challengeurl !== void 0 && t(15, b = r.challengeurl), r.debug !== void 0 && t(17, U = !!r.debug), r.hidefooter !== void 0 && t(2, N = !!r.hidefooter), r.hidelogo !== void 0 && t(3, T = !!r.hidelogo), r.maxnumber !== void 0 && t(22, G = +r.maxnumber), r.mockerror !== void 0 && t(23, V = !!r.mockerror), r.name !== void 0 && t(4, Q = r.name), r.refetchonexpire !== void 0 && t(25, S = !!r.refetchonexpire), r.spamfilter !== void 0 && t(26, E = typeof r.spamfilter == "object" ? r.spamfilter : !!r.spamfilter), r.strings && t(44, l = r.strings), r.test !== void 0 && t(27, y = typeof r.test == "number" ? r.test : !!r.test), r.verifyurl !== void 0 && t(28, ee = r.verifyurl), r.workers !== void 0 && t(29, le = +r.workers), r.workerurl !== void 0 && t(30, ae = r.workerurl);
1287
+ }
1288
+ function We() {
1289
+ return {
1290
+ auto: u,
1291
+ blockspam: A,
1292
+ challengeurl: b,
1293
+ debug: U,
1294
+ delay: $,
1295
+ expire: D,
1296
+ floating: R,
1297
+ floatinganchor: X,
1298
+ floatingoffset: J,
1299
+ hidefooter: N,
1300
+ hidelogo: T,
1301
+ name: Q,
1302
+ maxnumber: G,
1303
+ mockerror: V,
1304
+ obfuscated: v,
1305
+ refetchonexpire: S,
1306
+ spamfilter: E,
1307
+ strings: s,
1308
+ test: y,
1309
+ verifyurl: ee,
1310
+ workers: le,
1311
+ workerurl: ae
1312
+ };
1313
+ }
1314
+ function Xe() {
1315
+ return se;
1316
+ }
1317
+ function Pt(r) {
1318
+ return te.find((f) => f.constructor.pluginName === r);
1319
+ }
1320
+ function Je() {
1321
+ return x;
1322
+ }
1323
+ function me(r = m.UNVERIFIED, f = null) {
1324
+ W && (clearTimeout(W), W = null), t(8, re = !1), t(5, de = f), t(6, oe = null), t(7, x = r);
1325
+ }
1326
+ function ze(r) {
1327
+ se = r;
1435
1328
  }
1436
- function Jt() {
1437
- W = this.checked, t(8, W);
1329
+ function Ke(r, f = null) {
1330
+ t(7, x = r), t(5, de = f);
1438
1331
  }
1439
- function Xt(i) {
1440
- Ne[i ? "unshift" : "push"](() => {
1441
- le = i, t(10, le);
1332
+ async function ne() {
1333
+ return me(m.VERIFYING), await new Promise((r) => setTimeout(r, $ || 0)), vt().then((r) => (Ze(r), k("challenge", r), Ge(r))).then(({ data: r, solution: f }) => {
1334
+ if (k("solution", f), "challenge" in r && f && !("clearText" in f))
1335
+ if ((f == null ? void 0 : f.number) !== void 0) {
1336
+ if (ee)
1337
+ return Dt(Fe(r, f));
1338
+ t(6, oe = Fe(r, f)), k("payload", oe);
1339
+ } else
1340
+ throw k("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned.");
1341
+ }).then(() => {
1342
+ en().then(() => {
1343
+ t(7, x = m.VERIFIED), k("verified"), he("verified", { payload: oe });
1344
+ });
1345
+ }).catch((r) => {
1346
+ k(r), t(7, x = m.ERROR), t(5, de = r.message);
1442
1347
  });
1443
1348
  }
1444
- function Wt(i) {
1445
- Ne[i ? "unshift" : "push"](() => {
1446
- v = i, t(9, v);
1349
+ function Mt() {
1350
+ re = this.checked, t(8, re);
1351
+ }
1352
+ function Ft(r) {
1353
+ Ae[r ? "unshift" : "push"](() => {
1354
+ ie = r, t(10, ie);
1355
+ });
1356
+ }
1357
+ function Nt(r) {
1358
+ Ae[r ? "unshift" : "push"](() => {
1359
+ C = r, t(9, C);
1447
1360
  });
1448
1361
  }
1449
- return n.$$set = (i) => {
1450
- "analytics" in i && t(18, h = i.analytics), "auto" in i && t(0, w = i.auto), "beaconurl" in i && t(19, x = i.beaconurl), "blockspam" in i && t(34, $ = i.blockspam), "challengeurl" in i && t(17, k = i.challengeurl), "challengejson" in i && t(35, J = i.challengejson), "debug" in i && t(20, H = i.debug), "delay" in i && t(21, ee = i.delay), "expire" in i && t(22, te = i.expire), "floating" in i && t(1, R = i.floating), "floatinganchor" in i && t(23, O = i.floatinganchor), "floatingoffset" in i && t(24, N = i.floatingoffset), "hidefooter" in i && t(2, oe = i.hidefooter), "hidelogo" in i && t(3, ne = i.hidelogo), "name" in i && t(4, Z = i.name), "maxnumber" in i && t(25, L = i.maxnumber), "mockerror" in i && t(26, F = i.mockerror), "obfuscated" in i && t(27, p = i.obfuscated), "refetchonexpire" in i && t(28, D = i.refetchonexpire), "spamfilter" in i && t(29, d = i.spamfilter), "strings" in i && t(36, C = i.strings), "test" in i && t(30, X = i.test), "verifyurl" in i && t(31, se = i.verifyurl), "workers" in i && t(32, be = i.workers), "workerurl" in i && t(33, Te = i.workerurl), "$$scope" in i && t(43, a = i.$$scope);
1362
+ return n.$$set = (r) => {
1363
+ "auto" in r && t(0, u = r.auto), "blockspam" in r && t(16, A = r.blockspam), "challengeurl" in r && t(15, b = r.challengeurl), "challengejson" in r && t(31, Y = r.challengejson), "debug" in r && t(17, U = r.debug), "delay" in r && t(18, $ = r.delay), "expire" in r && t(19, D = r.expire), "floating" in r && t(1, R = r.floating), "floatinganchor" in r && t(20, X = r.floatinganchor), "floatingoffset" in r && t(21, J = r.floatingoffset), "hidefooter" in r && t(2, N = r.hidefooter), "hidelogo" in r && t(3, T = r.hidelogo), "name" in r && t(4, Q = r.name), "maxnumber" in r && t(22, G = r.maxnumber), "mockerror" in r && t(23, V = r.mockerror), "obfuscated" in r && t(24, v = r.obfuscated), "plugins" in r && t(32, P = r.plugins), "refetchonexpire" in r && t(25, S = r.refetchonexpire), "spamfilter" in r && t(26, E = r.spamfilter), "strings" in r && t(33, a = r.strings), "test" in r && t(27, y = r.test), "verifyurl" in r && t(28, ee = r.verifyurl), "workers" in r && t(29, le = r.workers), "workerurl" in r && t(30, ae = r.workerurl), "$$scope" in r && t(45, d = r.$$scope);
1451
1364
  }, n.$$.update = () => {
1452
1365
  n.$$.dirty[0] & /*challengeurl*/
1453
- 131072 && t(14, r = !!(k != null && k.includes(".altcha.org")) && !!(k != null && k.includes("apiKey=ckey_"))), n.$$.dirty[1] & /*challengejson*/
1454
- 16 && (o = J ? Ct(J) : void 0), n.$$.dirty[1] & /*strings*/
1455
- 32 && t(42, s = C ? Ct(C) : {}), n.$$.dirty[1] & /*parsedStrings*/
1456
- 2048 && t(13, l = {
1457
- ariaLinkLabel: pt,
1366
+ 32768 && t(12, i = !!(b != null && b.includes(".altcha.org")) && !!(b != null && b.includes("apiKey=ckey_"))), n.$$.dirty[1] & /*challengejson*/
1367
+ 1 && (o = Y ? at(Y) : void 0), n.$$.dirty[1] & /*strings*/
1368
+ 4 && t(44, l = a ? at(a) : {}), n.$$.dirty[1] & /*parsedStrings*/
1369
+ 8192 && t(11, s = {
1370
+ ariaLinkLabel: ut,
1458
1371
  error: "Verification failed. Try again later.",
1459
1372
  expired: "Verification expired. Try again.",
1460
- footer: `Protected by <a href="${Vt}" target="_blank" aria-label="${s.ariaLinkLabel || pt}">ALTCHA</a>`,
1373
+ footer: `Protected by <a href="${Et}" target="_blank" aria-label="${l.ariaLinkLabel || ut}">ALTCHA</a>`,
1461
1374
  label: "I'm not a robot",
1462
1375
  verified: "Verified",
1463
1376
  verifying: "Verifying...",
1464
1377
  waitAlert: "Verifying... please wait.",
1465
- ...s
1466
- }), n.$$.dirty[0] & /*state, payload*/
1467
- 192 | n.$$.dirty[1] & /*clarifiedData*/
1468
- 1024 && Ve("statechange", z ? { clarifiedData: z, state: T } : { payload: ce, state: T }), n.$$.dirty[0] & /*error*/
1469
- 32 && Ot(), n.$$.dirty[0] & /*state*/
1470
- 128 && Ht(), n.$$.dirty[1] & /*clarifiedData*/
1471
- 1024 && Bt();
1378
+ ...l
1379
+ }), n.$$.dirty[0] & /*payload, state*/
1380
+ 192 && he("statechange", { payload: oe, state: x }), n.$$.dirty[0] & /*error*/
1381
+ 32 && Rt(), n.$$.dirty[0] & /*state*/
1382
+ 128 && St();
1472
1383
  }, [
1473
- w,
1384
+ u,
1474
1385
  R,
1475
- oe,
1476
- ne,
1477
- Z,
1478
- ye,
1479
- ce,
1386
+ N,
1480
1387
  T,
1481
- W,
1482
- v,
1483
- le,
1484
- q,
1485
- Ye,
1486
- l,
1487
- r,
1488
- Pt,
1489
- rt,
1490
- k,
1491
- h,
1388
+ Q,
1389
+ de,
1390
+ oe,
1492
1391
  x,
1493
- H,
1494
- ee,
1495
- te,
1496
- O,
1497
- N,
1498
- L,
1499
- F,
1500
- p,
1392
+ re,
1393
+ C,
1394
+ ie,
1395
+ s,
1396
+ i,
1397
+ Lt,
1398
+ $e,
1399
+ b,
1400
+ A,
1401
+ U,
1402
+ $,
1501
1403
  D,
1502
- d,
1503
1404
  X,
1504
- se,
1505
- be,
1506
- Te,
1507
- $,
1508
1405
  J,
1509
- C,
1510
- lt,
1511
- we,
1406
+ G,
1407
+ V,
1408
+ v,
1409
+ S,
1410
+ E,
1411
+ y,
1412
+ ee,
1413
+ le,
1512
1414
  ae,
1513
- _e,
1514
- z,
1515
- s,
1415
+ Y,
1416
+ P,
1516
1417
  a,
1517
- c,
1518
- Jt,
1519
- Xt,
1520
- Wt
1418
+ ge,
1419
+ Ye,
1420
+ We,
1421
+ Xe,
1422
+ Pt,
1423
+ Je,
1424
+ me,
1425
+ ze,
1426
+ Ke,
1427
+ ne,
1428
+ l,
1429
+ d,
1430
+ h,
1431
+ Mt,
1432
+ Ft,
1433
+ Nt
1521
1434
  ];
1522
1435
  }
1523
- class Bn extends Cn {
1436
+ class In extends an {
1524
1437
  constructor(e) {
1525
- super(), kn(
1438
+ super(), cn(
1526
1439
  this,
1527
1440
  e,
1528
- Pn,
1529
- Un,
1530
- en,
1441
+ An,
1442
+ xn,
1443
+ Ut,
1531
1444
  {
1532
- analytics: 18,
1533
1445
  auto: 0,
1534
- beaconurl: 19,
1535
- blockspam: 34,
1536
- challengeurl: 17,
1537
- challengejson: 35,
1538
- debug: 20,
1539
- delay: 21,
1540
- expire: 22,
1446
+ blockspam: 16,
1447
+ challengeurl: 15,
1448
+ challengejson: 31,
1449
+ debug: 17,
1450
+ delay: 18,
1451
+ expire: 19,
1541
1452
  floating: 1,
1542
- floatinganchor: 23,
1543
- floatingoffset: 24,
1453
+ floatinganchor: 20,
1454
+ floatingoffset: 21,
1544
1455
  hidefooter: 2,
1545
1456
  hidelogo: 3,
1546
1457
  name: 4,
1547
- maxnumber: 25,
1548
- mockerror: 26,
1549
- obfuscated: 27,
1550
- refetchonexpire: 28,
1551
- spamfilter: 29,
1552
- strings: 36,
1553
- test: 30,
1554
- verifyurl: 31,
1555
- workers: 32,
1556
- workerurl: 33,
1557
- configure: 37,
1558
- reset: 38,
1559
- verify: 39,
1560
- clarify: 40
1458
+ maxnumber: 22,
1459
+ mockerror: 23,
1460
+ obfuscated: 24,
1461
+ plugins: 32,
1462
+ refetchonexpire: 25,
1463
+ spamfilter: 26,
1464
+ strings: 33,
1465
+ test: 27,
1466
+ verifyurl: 28,
1467
+ workers: 29,
1468
+ workerurl: 30,
1469
+ clarify: 34,
1470
+ configure: 35,
1471
+ getConfiguration: 36,
1472
+ getFloatingAnchor: 37,
1473
+ getPlugin: 38,
1474
+ getState: 39,
1475
+ reset: 40,
1476
+ setFloatingAnchor: 41,
1477
+ setState: 42,
1478
+ verify: 43
1561
1479
  },
1562
1480
  null,
1563
1481
  [-1, -1, -1]
1564
1482
  );
1565
1483
  }
1566
- get analytics() {
1567
- return this.$$.ctx[18];
1568
- }
1569
- set analytics(e) {
1570
- this.$$set({ analytics: e }), E();
1571
- }
1572
1484
  get auto() {
1573
1485
  return this.$$.ctx[0];
1574
1486
  }
1575
1487
  set auto(e) {
1576
- this.$$set({ auto: e }), E();
1577
- }
1578
- get beaconurl() {
1579
- return this.$$.ctx[19];
1580
- }
1581
- set beaconurl(e) {
1582
- this.$$set({ beaconurl: e }), E();
1488
+ this.$$set({ auto: e }), p();
1583
1489
  }
1584
1490
  get blockspam() {
1585
- return this.$$.ctx[34];
1491
+ return this.$$.ctx[16];
1586
1492
  }
1587
1493
  set blockspam(e) {
1588
- this.$$set({ blockspam: e }), E();
1494
+ this.$$set({ blockspam: e }), p();
1589
1495
  }
1590
1496
  get challengeurl() {
1591
- return this.$$.ctx[17];
1497
+ return this.$$.ctx[15];
1592
1498
  }
1593
1499
  set challengeurl(e) {
1594
- this.$$set({ challengeurl: e }), E();
1500
+ this.$$set({ challengeurl: e }), p();
1595
1501
  }
1596
1502
  get challengejson() {
1597
- return this.$$.ctx[35];
1503
+ return this.$$.ctx[31];
1598
1504
  }
1599
1505
  set challengejson(e) {
1600
- this.$$set({ challengejson: e }), E();
1506
+ this.$$set({ challengejson: e }), p();
1601
1507
  }
1602
1508
  get debug() {
1603
- return this.$$.ctx[20];
1509
+ return this.$$.ctx[17];
1604
1510
  }
1605
1511
  set debug(e) {
1606
- this.$$set({ debug: e }), E();
1512
+ this.$$set({ debug: e }), p();
1607
1513
  }
1608
1514
  get delay() {
1609
- return this.$$.ctx[21];
1515
+ return this.$$.ctx[18];
1610
1516
  }
1611
1517
  set delay(e) {
1612
- this.$$set({ delay: e }), E();
1518
+ this.$$set({ delay: e }), p();
1613
1519
  }
1614
1520
  get expire() {
1615
- return this.$$.ctx[22];
1521
+ return this.$$.ctx[19];
1616
1522
  }
1617
1523
  set expire(e) {
1618
- this.$$set({ expire: e }), E();
1524
+ this.$$set({ expire: e }), p();
1619
1525
  }
1620
1526
  get floating() {
1621
1527
  return this.$$.ctx[1];
1622
1528
  }
1623
1529
  set floating(e) {
1624
- this.$$set({ floating: e }), E();
1530
+ this.$$set({ floating: e }), p();
1625
1531
  }
1626
1532
  get floatinganchor() {
1627
- return this.$$.ctx[23];
1533
+ return this.$$.ctx[20];
1628
1534
  }
1629
1535
  set floatinganchor(e) {
1630
- this.$$set({ floatinganchor: e }), E();
1536
+ this.$$set({ floatinganchor: e }), p();
1631
1537
  }
1632
1538
  get floatingoffset() {
1633
- return this.$$.ctx[24];
1539
+ return this.$$.ctx[21];
1634
1540
  }
1635
1541
  set floatingoffset(e) {
1636
- this.$$set({ floatingoffset: e }), E();
1542
+ this.$$set({ floatingoffset: e }), p();
1637
1543
  }
1638
1544
  get hidefooter() {
1639
1545
  return this.$$.ctx[2];
1640
1546
  }
1641
1547
  set hidefooter(e) {
1642
- this.$$set({ hidefooter: e }), E();
1548
+ this.$$set({ hidefooter: e }), p();
1643
1549
  }
1644
1550
  get hidelogo() {
1645
1551
  return this.$$.ctx[3];
1646
1552
  }
1647
1553
  set hidelogo(e) {
1648
- this.$$set({ hidelogo: e }), E();
1554
+ this.$$set({ hidelogo: e }), p();
1649
1555
  }
1650
1556
  get name() {
1651
1557
  return this.$$.ctx[4];
1652
1558
  }
1653
1559
  set name(e) {
1654
- this.$$set({ name: e }), E();
1560
+ this.$$set({ name: e }), p();
1655
1561
  }
1656
1562
  get maxnumber() {
1657
- return this.$$.ctx[25];
1563
+ return this.$$.ctx[22];
1658
1564
  }
1659
1565
  set maxnumber(e) {
1660
- this.$$set({ maxnumber: e }), E();
1566
+ this.$$set({ maxnumber: e }), p();
1661
1567
  }
1662
1568
  get mockerror() {
1663
- return this.$$.ctx[26];
1569
+ return this.$$.ctx[23];
1664
1570
  }
1665
1571
  set mockerror(e) {
1666
- this.$$set({ mockerror: e }), E();
1572
+ this.$$set({ mockerror: e }), p();
1667
1573
  }
1668
1574
  get obfuscated() {
1669
- return this.$$.ctx[27];
1575
+ return this.$$.ctx[24];
1670
1576
  }
1671
1577
  set obfuscated(e) {
1672
- this.$$set({ obfuscated: e }), E();
1578
+ this.$$set({ obfuscated: e }), p();
1579
+ }
1580
+ get plugins() {
1581
+ return this.$$.ctx[32];
1582
+ }
1583
+ set plugins(e) {
1584
+ this.$$set({ plugins: e }), p();
1673
1585
  }
1674
1586
  get refetchonexpire() {
1675
- return this.$$.ctx[28];
1587
+ return this.$$.ctx[25];
1676
1588
  }
1677
1589
  set refetchonexpire(e) {
1678
- this.$$set({ refetchonexpire: e }), E();
1590
+ this.$$set({ refetchonexpire: e }), p();
1679
1591
  }
1680
1592
  get spamfilter() {
1681
- return this.$$.ctx[29];
1593
+ return this.$$.ctx[26];
1682
1594
  }
1683
1595
  set spamfilter(e) {
1684
- this.$$set({ spamfilter: e }), E();
1596
+ this.$$set({ spamfilter: e }), p();
1685
1597
  }
1686
1598
  get strings() {
1687
- return this.$$.ctx[36];
1599
+ return this.$$.ctx[33];
1688
1600
  }
1689
1601
  set strings(e) {
1690
- this.$$set({ strings: e }), E();
1602
+ this.$$set({ strings: e }), p();
1691
1603
  }
1692
1604
  get test() {
1693
- return this.$$.ctx[30];
1605
+ return this.$$.ctx[27];
1694
1606
  }
1695
1607
  set test(e) {
1696
- this.$$set({ test: e }), E();
1608
+ this.$$set({ test: e }), p();
1697
1609
  }
1698
1610
  get verifyurl() {
1699
- return this.$$.ctx[31];
1611
+ return this.$$.ctx[28];
1700
1612
  }
1701
1613
  set verifyurl(e) {
1702
- this.$$set({ verifyurl: e }), E();
1614
+ this.$$set({ verifyurl: e }), p();
1703
1615
  }
1704
1616
  get workers() {
1705
- return this.$$.ctx[32];
1617
+ return this.$$.ctx[29];
1706
1618
  }
1707
1619
  set workers(e) {
1708
- this.$$set({ workers: e }), E();
1620
+ this.$$set({ workers: e }), p();
1709
1621
  }
1710
1622
  get workerurl() {
1711
- return this.$$.ctx[33];
1623
+ return this.$$.ctx[30];
1712
1624
  }
1713
1625
  set workerurl(e) {
1714
- this.$$set({ workerurl: e }), E();
1626
+ this.$$set({ workerurl: e }), p();
1627
+ }
1628
+ get clarify() {
1629
+ return this.$$.ctx[34];
1715
1630
  }
1716
1631
  get configure() {
1632
+ return this.$$.ctx[35];
1633
+ }
1634
+ get getConfiguration() {
1635
+ return this.$$.ctx[36];
1636
+ }
1637
+ get getFloatingAnchor() {
1717
1638
  return this.$$.ctx[37];
1718
1639
  }
1719
- get reset() {
1640
+ get getPlugin() {
1720
1641
  return this.$$.ctx[38];
1721
1642
  }
1722
- get verify() {
1643
+ get getState() {
1723
1644
  return this.$$.ctx[39];
1724
1645
  }
1725
- get clarify() {
1646
+ get reset() {
1726
1647
  return this.$$.ctx[40];
1727
1648
  }
1728
- }
1729
- customElements.define("altcha-widget", pn(Bn, { analytics: { type: "Boolean" }, auto: {}, beaconurl: {}, blockspam: {}, challengeurl: {}, challengejson: {}, debug: { type: "Boolean" }, delay: {}, expire: {}, floating: {}, floatinganchor: {}, floatingoffset: {}, hidefooter: { type: "Boolean" }, hidelogo: { type: "Boolean" }, name: {}, maxnumber: {}, mockerror: { type: "Boolean" }, obfuscated: {}, refetchonexpire: { type: "Boolean" }, spamfilter: { type: "Boolean" }, strings: {}, test: { type: "Boolean" }, verifyurl: {}, workers: {}, workerurl: {} }, ["default"], ["configure", "reset", "verify", "clarify"], !1));
1730
- globalThis.createAltchaWorker = (n) => new Worker(new URL(n || "./worker.js", import.meta.url));
1649
+ get setFloatingAnchor() {
1650
+ return this.$$.ctx[41];
1651
+ }
1652
+ get setState() {
1653
+ return this.$$.ctx[42];
1654
+ }
1655
+ get verify() {
1656
+ return this.$$.ctx[43];
1657
+ }
1658
+ }
1659
+ customElements.define("altcha-widget", un(
1660
+ In,
1661
+ { auto: {}, blockspam: {}, challengeurl: {}, challengejson: {}, debug: { type: "Boolean" }, delay: {}, expire: {}, floating: {}, floatinganchor: {}, floatingoffset: {}, hidefooter: { type: "Boolean" }, hidelogo: { type: "Boolean" }, name: {}, maxnumber: {}, mockerror: { type: "Boolean" }, obfuscated: {}, plugins: {}, refetchonexpire: { type: "Boolean" }, spamfilter: { type: "Boolean" }, strings: {}, test: { type: "Boolean" }, verifyurl: {}, workers: {}, workerurl: {} },
1662
+ ["default"],
1663
+ [
1664
+ "clarify",
1665
+ "configure",
1666
+ "getConfiguration",
1667
+ "getFloatingAnchor",
1668
+ "getPlugin",
1669
+ "getState",
1670
+ "reset",
1671
+ "setFloatingAnchor",
1672
+ "setState",
1673
+ "verify"
1674
+ ],
1675
+ !1
1676
+ ));
1677
+ globalThis.altchaCreateWorker = (n) => new Worker(new URL(n || "./worker.js", import.meta.url));
1678
+ globalThis.altchaPlugins = globalThis.altchaPlugins || [];
1731
1679
  export {
1732
- Bn as Altcha
1680
+ In as Altcha
1733
1681
  };