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