diff --git a/README.md b/README.md
index b36e02c..4d795a9 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,7 @@ Having troubles? Please report in [Issues](https://github.com/altcha-org/wordpre
## Supported Integrations
* Contact Form 7
+* Elementor Pro Forms
* Forminator
* GravityForms
* HTML Forms
diff --git a/altcha.php b/altcha.php
index a6b408a..56dfd4e 100644
--- a/altcha.php
+++ b/altcha.php
@@ -7,8 +7,8 @@
* Description: ALTCHA is a free, open-source CAPTCHA alternative that offers robust protection without using cookies, ensuring full GDPR compliance by design. It also provides invisible anti-spam and anti-bot protection through ALTCHA's API.
* Author: Altcha.org
* Author URI: https://altcha.org
- * Version: 1.3.1
- * Stable tag: 1.3.1
+ * Version: 1.4.0
+ * Stable tag: 1.4.0
* Requires at least: 5.0
* Requires PHP: 7.3
* Tested up to: 6.6
@@ -16,9 +16,9 @@
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
-define('ALTCHA_VERSION', '1.3.1');
+define('ALTCHA_VERSION', '1.4.0');
define('ALTCHA_WEBSITE', 'https://altcha.org/');
-define('ALTCHA_WIDGET_VERSION', '0.6.4');
+define('ALTCHA_WIDGET_VERSION', '0.6.7');
define('ALTCHA_LANGUAGES', [
"bg" => "Bulgarian",
"ca" => "Catalan",
@@ -62,6 +62,7 @@
require plugin_dir_path( __FILE__ ) . './integrations/contact-form-7.php';
require plugin_dir_path( __FILE__ ) . './integrations/custom.php';
+require plugin_dir_path( __FILE__ ) . './integrations/elementor.php';
require plugin_dir_path( __FILE__ ) . './integrations/forminator.php';
require plugin_dir_path( __FILE__ ) . './integrations/html-forms.php';
require plugin_dir_path( __FILE__ ) . './integrations/gravityforms.php';
diff --git a/includes/core.php b/includes/core.php
index 0dd5f27..6a458df 100644
--- a/includes/core.php
+++ b/includes/core.php
@@ -54,6 +54,8 @@ class AltchaPlugin
public static $option_integration_custom = "altcha_integration_custom";
+ public static $option_integration_elementor = "altcha_integration_elementor";
+
public static $option_integration_forminator = "altcha_integration_forminator";
public static $option_integration_gravityforms = "altcha_integration_gravityforms";
@@ -84,12 +86,15 @@ class AltchaPlugin
),
'div' => array(
'class' => array(),
+ 'style' => array(),
),
'input' => array(
+ 'class' => array(),
'id' => array(),
'name' => array(),
'type' => array(),
'value' => array(),
+ 'style' => array(),
),
'noscript' => array(),
);
@@ -186,6 +191,11 @@ public function get_integration_custom()
return trim(get_option(AltchaPlugin::$option_integration_custom));
}
+ public function get_integration_elementor()
+ {
+ return trim(get_option(AltchaPlugin::$option_integration_elementor));
+ }
+
public function get_integration_forminator()
{
return trim(get_option(AltchaPlugin::$option_integration_forminator));
diff --git a/includes/helpers.php b/includes/helpers.php
index 94afa69..4bd92a5 100644
--- a/includes/helpers.php
+++ b/includes/helpers.php
@@ -4,6 +4,8 @@
function altcha_plugin_active($name) {
switch ($name) {
+ case 'elementor':
+ return is_plugin_active('elementor/elementor.php');
case 'forminator':
return is_plugin_active('forminator/forminator.php');
case 'gravityforms':
diff --git a/includes/settings.php b/includes/settings.php
index d9c71dd..5ec921e 100644
--- a/includes/settings.php
+++ b/includes/settings.php
@@ -87,6 +87,11 @@ function altcha_settings_init()
AltchaPlugin::$option_integration_custom
);
+ register_setting(
+ 'altcha_options',
+ AltchaPlugin::$option_integration_elementor
+ );
+
register_setting(
'altcha_options',
AltchaPlugin::$option_integration_forminator
@@ -388,6 +393,27 @@ function altcha_settings_init()
)
);
+ add_settings_field(
+ 'altcha_settings_elementor_integration_field',
+ 'Elementor Pro Forms',
+ 'altcha_settings_select_callback',
+ 'altcha_admin',
+ 'altcha_integrations_settings_section',
+ array(
+ "name" => AltchaPlugin::$option_integration_elementor,
+ "disabled" => !altcha_plugin_active('elementor'),
+ "spamfilter_options" => array(
+ "spamfilter",
+ "captcha_spamfilter",
+ ),
+ "options" => array(
+ "" => "Disable",
+ "captcha" => "Captcha",
+ "captcha_spamfilter" => "Captcha + Spam Filter",
+ ),
+ )
+ );
+
add_settings_field(
'altcha_settings_forminator_integration_field',
'Forminator',
diff --git a/integrations/elementor.php b/integrations/elementor.php
new file mode 100644
index 0000000..8a1e370
--- /dev/null
+++ b/integrations/elementor.php
@@ -0,0 +1,16 @@
+register(new \Elementor_Form_Altcha_Field());
+ }
+ $plugin = AltchaPlugin::$instance;
+ $mode = $plugin->get_integration_elementor();
+ if ($mode === 'captcha' || $mode === 'captcha_spamfilter') {
+ add_action('elementor_pro/forms/fields/register', 'altcha_register_form_field');
+ }
+}
\ No newline at end of file
diff --git a/integrations/elementor/field.php b/integrations/elementor/field.php
new file mode 100644
index 0000000..35c3a85
--- /dev/null
+++ b/integrations/elementor/field.php
@@ -0,0 +1,57 @@
+get_integration_elementor();
+ if (empty($mode) || $mode === 'spamfilter') {
+ return '';
+ }
+ echo wp_kses(wp_nonce_field('altcha_verification', '_altchanonce', true, false), AltchaPlugin::$html_espace_allowed_tags);
+ echo wp_kses("
" . $plugin->render_widget($mode, false) . "
", AltchaPlugin::$html_espace_allowed_tags);
+ // shadow element for error reporting
+ echo wp_kses('get_render_attribute_string('input' . $item_index) . '>', AltchaPlugin::$html_espace_allowed_tags);
+ }
+
+ public function validation($field, $record, $ajax_handler)
+ {
+ $plugin = AltchaPlugin::$instance;
+ $mode = $plugin->get_integration_elementor();
+ if (!empty($mode)) {
+ if ($mode === "captcha" || $mode === "captcha_spamfilter") {
+ if (wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_altchanonce'])), 'altcha_verification') === false) {
+ $ajax_handler->add_error(
+ $field['id'],
+ esc_html__('Nonce verification failed.', 'altcha-spam-protection')
+ );
+ } else {
+ $altcha = isset($_POST['altcha']) ? trim(sanitize_text_field($_POST['altcha'])) : '';
+ if ($plugin->verify($altcha) === false) {
+ $ajax_handler->add_error(
+ $field['id'],
+ esc_html__('Verification failed.', 'altcha-spam-protection')
+ );
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/public/altcha.js b/public/altcha.js
index 3366b2b..65863e4 100644
--- a/public/altcha.js
+++ b/public/altcha.js
@@ -10,16 +10,16 @@
var _t = Object.defineProperty;
var kt = (r, e, t) => e in r ? _t(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
var U = (r, e, t) => kt(r, typeof e != "symbol" ? e + "" : e, t);
-const tt = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGQoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBwKGUsdCxvKXtyZXR1cm4gZChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChvLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGcoZSx0LG89IlNIQS0yNTYiLGw9MWU2LGM9MCl7Y29uc3QgYT1uZXcgQWJvcnRDb250cm9sbGVyLGk9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgbj1jO248PWw7bis9MSl7aWYoYS5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCBwKHQsbixvKT09PWUpcmV0dXJue251bWJlcjpuLHRvb2s6RGF0ZS5ub3coKS1pfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjphfX1sZXQgcjtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOm99PWUuZGF0YTtpZih0PT09ImFib3J0IilyPT1udWxsfHxyLmFib3J0KCkscj12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtjb25zdHthbGc6bCxjaGFsbGVuZ2U6YyxtYXg6YSxzYWx0Omksc3RhcnQ6dX09b3x8e30sbj1nKGMsaSxsLGEsdSk7cj1uLmNvbnRyb2xsZXIsbi5wcm9taXNlLnRoZW4ocz0+e3NlbGYucG9zdE1lc3NhZ2UocyYmey4uLnMsd29ya2VyOiEwfSl9KX19fSkoKTsK", xt = (r) => Uint8Array.from(atob(r), (e) => e.charCodeAt(0)), Be = typeof window < "u" && window.Blob && new Blob([xt(tt)], { type: "text/javascript;charset=utf-8" });
+const tt = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGQoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBwKGUsdCxvKXtyZXR1cm4gZChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChvLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGcoZSx0LG89IlNIQS0yNTYiLGw9MWU2LGM9MCl7Y29uc3QgYT1uZXcgQWJvcnRDb250cm9sbGVyLGk9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgbj1jO248PWw7bis9MSl7aWYoYS5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCBwKHQsbixvKT09PWUpcmV0dXJue251bWJlcjpuLHRvb2s6RGF0ZS5ub3coKS1pfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjphfX1sZXQgcjtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOm99PWUuZGF0YTtpZih0PT09ImFib3J0IilyPT1udWxsfHxyLmFib3J0KCkscj12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtjb25zdHthbGc6bCxjaGFsbGVuZ2U6YyxtYXg6YSxzYWx0Omksc3RhcnQ6dX09b3x8e30sbj1nKGMsaSxsLGEsdSk7cj1uLmNvbnRyb2xsZXIsbi5wcm9taXNlLnRoZW4ocz0+e3NlbGYucG9zdE1lc3NhZ2UocyYmey4uLnMsd29ya2VyOiEwfSl9KX19fSkoKTsK", xt = (r) => Uint8Array.from(atob(r), (e) => e.charCodeAt(0)), Be = typeof self < "u" && self.Blob && new Blob([xt(tt)], { type: "text/javascript;charset=utf-8" });
function Et(r) {
let e;
try {
- if (e = Be && (window.URL || window.webkitURL).createObjectURL(Be), !e) throw "";
+ if (e = Be && (self.URL || self.webkitURL).createObjectURL(Be), !e) throw "";
const t = new Worker(e, {
name: r == null ? void 0 : r.name
});
return t.addEventListener("error", () => {
- (window.URL || window.webkitURL).revokeObjectURL(e);
+ (self.URL || self.webkitURL).revokeObjectURL(e);
}), t;
} catch {
return new Worker(
@@ -29,7 +29,7 @@ function Et(r) {
}
);
} finally {
- e && (window.URL || window.webkitURL).revokeObjectURL(e);
+ e && (self.URL || self.webkitURL).revokeObjectURL(e);
}
}
function ie() {
@@ -78,7 +78,7 @@ function zt(r, e) {
e
), e.sheet;
}
-function D(r, e, t) {
+function $(r, e, t) {
r.insertBefore(e, t || null);
}
function j(r) {
@@ -175,7 +175,7 @@ function y() {
try {
for (; te < re.length; ) {
const e = re[te];
- te++, ce(e), Dt(e.$$);
+ te++, ce(e), $t(e.$$);
}
} catch (e) {
throw re.length = 0, te = 0, e;
@@ -191,20 +191,20 @@ function y() {
We.pop()();
Ce = !1, Ee.clear(), ce(r);
}
-function Dt(r) {
+function $t(r) {
if (r.fragment !== null) {
r.update(), fe(r.before_update);
const e = r.dirty;
r.dirty = [-1], r.fragment && r.fragment.p(r.ctx, e), r.after_update.forEach(Le);
}
}
-function Ft(r) {
+function Dt(r) {
const e = [], t = [];
ne.forEach((i) => r.indexOf(i) === -1 ? e.push(i) : t.push(i)), t.forEach((i) => i()), ne = e;
}
-const $t = /* @__PURE__ */ new Set();
+const Ft = /* @__PURE__ */ new Set();
function Ut(r, e) {
- r && r.i && ($t.delete(r), r.i(e));
+ r && r.i && (Ft.delete(r), r.i(e));
}
function Gt(r, e, t) {
const { fragment: i, after_update: o } = r.$$;
@@ -215,7 +215,7 @@ function Gt(r, e, t) {
}
function Xt(r, e) {
const t = r.$$;
- t.fragment !== null && (Ft(t.after_update), fe(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
+ t.fragment !== null && (Dt(t.after_update), fe(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
}
function Bt(r, e) {
r.$$.dirty[0] === -1 && (re.push(r), ot(), r.$$.dirty.fill(0)), r.$$.dirty[e / 31 | 0] |= 1 << e % 31;
@@ -245,11 +245,11 @@ function Ht(r, e, t, i, o, l, c = null, a = [-1]) {
root: e.target || d.$$.root
};
c && c(f.root);
- let $ = !1;
- if (f.ctx = t ? t(r, e.props || {}, (N, G, ...F) => {
- const k = F.length ? F[0] : G;
- return f.ctx && o(f.ctx[N], f.ctx[N] = k) && (!f.skip_bound && f.bound[N] && f.bound[N](k), $ && Bt(r, N)), G;
- }) : [], f.update(), $ = !0, fe(f.before_update), f.fragment = i ? i(f.ctx) : !1, e.target) {
+ let F = !1;
+ if (f.ctx = t ? t(r, e.props || {}, (N, G, ...D) => {
+ const k = D.length ? D[0] : G;
+ return f.ctx && o(f.ctx[N], f.ctx[N] = k) && (!f.skip_bound && f.bound[N] && f.bound[N](k), F && Bt(r, N)), G;
+ }) : [], f.update(), F = !0, fe(f.before_update), f.fragment = i ? i(f.ctx) : !1, e.target) {
if (e.hydrate) {
const N = St(e.target);
f.fragment && f.fragment.l(N), N.forEach(j);
@@ -309,8 +309,8 @@ typeof HTMLElement == "function" && (lt = class extends HTMLElement {
* @param {HTMLElement} target
* @param {HTMLElement} [anchor]
*/
- m: function(f, $) {
- D(f, c, $);
+ m: function(f, F) {
+ $(f, c, F);
},
d: function(f) {
f && j(c);
@@ -370,7 +370,7 @@ typeof HTMLElement == "function" && (lt = class extends HTMLElement {
}
disconnectedCallback() {
this.$$cn = !1, Promise.resolve().then(() => {
- this.$$cn || (this.$$c.$destroy(), this.$$c = void 0);
+ !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$c = void 0);
});
}
$$g_p(e) {
@@ -437,7 +437,7 @@ function Ot(r, e, t, i, o, l) {
return (d = this.$$c) == null ? void 0 : d[a];
}
});
- }), l && (c = l(c)), r.element = /** @type {any} */
+ }), r.element = /** @type {any} */
c, c;
}
class Wt {
@@ -540,7 +540,7 @@ function Pe(r) {
e = O("svg"), t = O("path"), i = O("path"), s(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"), s(t, "fill", "currentColor"), s(t, "opacity", ".25"), s(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"), s(i, "fill", "currentColor"), s(i, "class", "altcha-spinner svelte-ddsc3z"), s(e, "width", "24"), s(e, "height", "24"), s(e, "viewBox", "0 0 24 24"), s(e, "xmlns", "http://www.w3.org/2000/svg");
},
m(o, l) {
- D(o, e, l), _(e, t), _(e, i);
+ $(o, e, l), _(e, t), _(e, i);
},
d(o) {
o && j(e);
@@ -558,7 +558,7 @@ function er(r) {
r[4] + "_checkbox"), s(e, "class", "svelte-ddsc3z");
},
m(o, l) {
- D(o, e, l), e.innerHTML = t;
+ $(o, e, l), e.innerHTML = t;
},
p(o, l) {
l[0] & /*_strings*/
@@ -582,7 +582,7 @@ function tr(r) {
e = A("span");
},
m(i, o) {
- D(i, e, o), e.innerHTML = t;
+ $(i, e, o), e.innerHTML = t;
},
p(i, o) {
o[0] & /*_strings*/
@@ -610,7 +610,7 @@ function rr(r) {
r[5];
},
m(l, c) {
- D(l, e, c), e.innerHTML = t, D(l, i, c), D(l, o, c);
+ $(l, e, c), e.innerHTML = t, $(l, i, c), $(l, o, c);
},
p(l, c) {
c[0] & /*_strings*/
@@ -638,7 +638,7 @@ function Ye(r) {
r[11].ariaLinkLabel);
},
m(d, f) {
- D(d, e, f), _(e, t), _(t, i), _(i, o), _(i, l), _(i, c);
+ $(d, e, f), _(e, t), _(t, i), _(i, o), _(i, l), _(i, c);
},
p(d, f) {
f[0] & /*_strings*/
@@ -664,7 +664,7 @@ function Ke(r) {
e = A("div"), t = O("svg"), i = O("path"), o = Y(), a.c(), s(i, "stroke-linecap", "round"), s(i, "stroke-linejoin", "round"), s(i, "d", "M6 18L18 6M6 6l12 12"), s(t, "width", "14"), s(t, "height", "14"), s(t, "xmlns", "http://www.w3.org/2000/svg"), s(t, "fill", "none"), s(t, "viewBox", "0 0 24 24"), s(t, "stroke-width", "1.5"), s(t, "stroke", "currentColor"), s(e, "class", "altcha-error svelte-ddsc3z");
},
m(d, f) {
- D(d, e, f), _(e, t), _(t, i), _(e, o), a.m(e, null);
+ $(d, e, f), _(e, t), _(t, i), _(e, o), a.m(e, null);
},
p(d, f) {
c === (c = l(d)) && a ? a.p(d, f) : (a.d(1), a = c(d), a && (a.c(), a.m(e, null)));
@@ -689,7 +689,7 @@ function nr(r) {
);
},
m(i, o) {
- D(i, e, o), e.innerHTML = t;
+ $(i, e, o), e.innerHTML = t;
},
p(i, o) {
o[0] & /*_strings*/
@@ -722,7 +722,7 @@ function ir(r) {
);
},
m(i, o) {
- D(i, e, o), e.innerHTML = t;
+ $(i, e, o), e.innerHTML = t;
},
p(i, o) {
o[0] & /*_strings*/
@@ -750,7 +750,7 @@ function Je(r) {
e = A("div"), t = A("div"), s(t, "class", "svelte-ddsc3z"), s(e, "class", "altcha-footer svelte-ddsc3z");
},
m(o, l) {
- D(o, e, l), _(e, t), t.innerHTML = i;
+ $(o, e, l), _(e, t), t.innerHTML = i;
},
p(o, l) {
l[0] & /*_strings*/
@@ -769,7 +769,7 @@ function qe(r) {
e = A("div"), s(e, "class", "altcha-anchor-arrow svelte-ddsc3z");
},
m(t, i) {
- D(t, e, i), r[37](e);
+ $(t, e, i), r[37](e);
},
p: ie,
d(t) {
@@ -778,7 +778,7 @@ function qe(r) {
};
}
function or(r) {
- let e, t, i, o, l, c, a, d, f, $, N, G, F, k, W, S = (
+ let e, t, i, o, l, c, a, d, f, F, N, G, D, k, W, S = (
/*state*/
r[6] === b.VERIFYING && Pe()
);
@@ -810,7 +810,7 @@ function or(r) {
);
return {
c() {
- e = A("div"), t = A("div"), S && S.c(), i = Y(), o = A("div"), l = A("input"), d = Y(), f = A("div"), M.c(), $ = Y(), E && E.c(), N = Y(), R && R.c(), G = Y(), I && I.c(), F = Y(), w && w.c(), s(l, "type", "checkbox"), s(l, "id", c = /*name*/
+ e = A("div"), t = A("div"), S && S.c(), i = Y(), o = A("div"), l = A("input"), d = Y(), f = A("div"), M.c(), F = Y(), E && E.c(), N = Y(), R && R.c(), G = Y(), I && I.c(), D = Y(), w && w.c(), s(l, "type", "checkbox"), s(l, "id", c = /*name*/
r[4] + "_checkbox"), l.required = a = /*auto*/
r[0] !== "onsubmit", s(l, "class", "svelte-ddsc3z"), s(o, "class", "altcha-checkbox svelte-ddsc3z"), Oe(
o,
@@ -830,8 +830,8 @@ function or(r) {
);
},
m(h, v) {
- D(h, e, v), _(e, t), S && S.m(t, null), _(t, i), _(t, o), _(o, l), l.checked = /*checked*/
- r[7], _(t, d), _(t, f), M.m(f, null), _(t, $), E && E.m(t, null), _(e, N), R && R.m(e, null), _(e, G), I && I.m(e, null), _(e, F), w && w.m(e, null), r[38](e), k || (W = [
+ $(h, e, v), _(e, t), S && S.m(t, null), _(t, i), _(t, o), _(o, l), l.checked = /*checked*/
+ r[7], _(t, d), _(t, f), M.m(f, null), _(t, F), E && E.m(t, null), _(e, N), R && R.m(e, null), _(e, G), I && I.m(e, null), _(e, D), w && w.m(e, null), r[38](e), k || (W = [
xe(
l,
"change",
@@ -873,7 +873,7 @@ function or(r) {
h[6] === b.EXPIRED ? R ? R.p(h, v) : (R = Ke(h), R.c(), R.m(e, G)) : R && (R.d(1), R = null), /*_strings*/
h[11].footer && /*hidefooter*/
(h[2] !== !0 || /*isFreeSaaS*/
- h[12]) ? I ? I.p(h, v) : (I = Je(h), I.c(), I.m(e, F)) : I && (I.d(1), I = null), /*floating*/
+ h[12]) ? I ? I.p(h, v) : (I = Je(h), I.c(), I.m(e, D)) : I && (I.d(1), I = null), /*floating*/
h[1] ? w ? w.p(h, v) : (w = qe(h), w.c(), w.m(e, null)) : w && (w.d(1), w = null), v[0] & /*state*/
64 && s(
e,
@@ -907,13 +907,13 @@ function lr() {
}
function sr(r, e, t) {
var Ge, Xe;
- let i, o, l, c, { auto: a = void 0 } = e, { blockspam: d = void 0 } = e, { challengeurl: f = void 0 } = e, { challengejson: $ = void 0 } = e, { debug: N = !1 } = e, { delay: G = 0 } = e, { expire: F = void 0 } = e, { floating: k = void 0 } = e, { floatinganchor: W = void 0 } = e, { floatingoffset: S = void 0 } = e, { hidefooter: K = !1 } = e, { hidelogo: H = !1 } = e, { name: M = "altcha" } = e, { maxnumber: E = 1e6 } = e, { mockerror: R = !1 } = e, { refetchonexpire: I = !0 } = e, { spamfilter: w = !1 } = e, { strings: h = void 0 } = e, { test: v = !1 } = e, { verifyurl: J = void 0 } = e, { workers: oe = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ue = void 0 } = e;
+ let i, o, l, c, { auto: a = void 0 } = e, { blockspam: d = void 0 } = e, { challengeurl: f = void 0 } = e, { challengejson: F = void 0 } = e, { debug: N = !1 } = e, { delay: G = 0 } = e, { expire: D = void 0 } = e, { floating: k = void 0 } = e, { floatinganchor: W = void 0 } = e, { floatingoffset: S = void 0 } = e, { hidefooter: K = !1 } = e, { hidelogo: H = !1 } = e, { name: M = "altcha" } = e, { maxnumber: E = 1e6 } = e, { mockerror: R = !1 } = e, { refetchonexpire: I = !0 } = e, { spamfilter: w = !1 } = e, { strings: h = void 0 } = e, { test: v = !1 } = e, { verifyurl: J = void 0 } = e, { workers: oe = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ue = void 0 } = e;
const ye = Tt(), Ie = ["SHA-256", "SHA-384", "SHA-512"], ze = (Xe = (Ge = document.documentElement.lang) == null ? void 0 : Ge.split("-")) == null ? void 0 : Xe[0];
let P = !1, C, q = null, de = null, m = null, pe = null, Q = null, T = b.UNVERIFIED, X = null;
Mt(() => {
- m && (m.removeEventListener("submit", Se), m.removeEventListener("reset", Ne), m.removeEventListener("focusin", Ae), m = null), X && (clearTimeout(X), X = null), document.removeEventListener("click", Te), document.removeEventListener("scroll", Ve), window.removeEventListener("resize", Fe);
+ m && (m.removeEventListener("submit", Se), m.removeEventListener("reset", Ne), m.removeEventListener("focusin", Ae), m = null), X && (clearTimeout(X), X = null), document.removeEventListener("click", Te), document.removeEventListener("scroll", Ve), window.removeEventListener("resize", De);
}), jt(() => {
- x("mounted", "0.6.4"), x("workers", oe), v && x("using test mode"), F && he(F), a !== void 0 && x("auto", a), k !== void 0 && $e(k), m = C.closest("form"), m && (m.addEventListener("submit", Se, { capture: !0 }), m.addEventListener("reset", Ne), a === "onfocus" && m.addEventListener("focusin", Ae)), a === "onload" && ee(), i && (K || H) && x("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.");
+ x("mounted", "0.6.7"), x("workers", oe), v && x("using test mode"), D && he(D), a !== void 0 && x("auto", a), k !== void 0 && Fe(k), m = C.closest("form"), m && (m.addEventListener("submit", Se, { capture: !0 }), m.addEventListener("reset", Ne), a === "onfocus" && m.addEventListener("focusin", Ae)), a === "onload" && ee(), i && (K || H) && x("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.");
});
function x(...n) {
(N || n.some((u) => u instanceof Error)) && console[n[0] instanceof Error ? "error" : "log"]("ALTCHA", ...n);
@@ -924,7 +924,7 @@ function sr(r, e, t) {
function Se(n) {
m && a === "onsubmit" && (T === b.UNVERIFIED ? (n.preventDefault(), n.stopPropagation(), ee().then(() => {
m == null || m.requestSubmit();
- })) : T !== b.VERIFIED && (n.preventDefault(), n.stopPropagation(), T === b.VERIFYING && De()));
+ })) : T !== b.VERIFIED && (n.preventDefault(), n.stopPropagation(), T === b.VERIFYING && $e()));
}
function Ne() {
ge();
@@ -983,7 +983,7 @@ function sr(r, e, t) {
} catch (p) {
x("unable to configure from X-Altcha-Config", p);
}
- if (!F && (g != null && g.length)) {
+ if (!D && (g != null && g.length)) {
const p = Date.parse(g);
if (p) {
const L = p - Date.now();
@@ -1051,7 +1051,7 @@ function sr(r, e, t) {
function Ve() {
k && _e();
}
- function De() {
+ function $e() {
T === b.VERIFYING && c.waitAlert && alert(c.waitAlert);
}
function ht(n) {
@@ -1059,14 +1059,14 @@ function sr(r, e, t) {
_e();
});
}
- function Fe() {
+ function De() {
k && _e();
}
function he(n) {
x("expire", n), X && (clearTimeout(X), X = null), n < 1 ? Me() : X = setTimeout(Me, n);
}
- function $e(n) {
- x("floating", n), k !== n && (t(8, C.style.left = "", C), t(8, C.style.top = "", C)), t(1, k = n === !0 || n === "" ? "auto" : n === !1 || n === "false" ? void 0 : k), k ? (a || t(0, a = "onsubmit"), document.addEventListener("scroll", Ve), document.addEventListener("click", Te), window.addEventListener("resize", Fe)) : a === "onsubmit" && t(0, a = void 0);
+ function Fe(n) {
+ x("floating", n), k !== n && (t(8, C.style.left = "", C), t(8, C.style.top = "", C)), t(1, k = n === !0 || n === "" ? "auto" : n === !1 || n === "false" ? void 0 : k), k ? (a || t(0, a = "onsubmit"), document.addEventListener("scroll", Ve), document.addEventListener("click", Te), window.addEventListener("resize", De)) : a === "onsubmit" && t(0, a = void 0);
}
function gt(n) {
var g;
@@ -1142,7 +1142,7 @@ function sr(r, e, t) {
x("unable to find floating anchor element");
}
function Ue(n) {
- n.auto !== void 0 && (t(0, a = n.auto), a === "onload" && ee()), n.floatinganchor !== void 0 && t(19, W = n.floatinganchor), n.delay !== void 0 && t(17, G = n.delay), n.floatingoffset !== void 0 && t(20, S = n.floatingoffset), n.floating !== void 0 && $e(n.floating), n.expire !== void 0 && (he(n.expire), t(18, F = n.expire)), n.challenge && (je(n.challenge), o = n.challenge), n.challengeurl !== void 0 && t(15, f = n.challengeurl), n.debug !== void 0 && t(16, N = !!n.debug), n.hidefooter !== void 0 && t(2, K = !!n.hidefooter), n.hidelogo !== void 0 && t(3, H = !!n.hidelogo), n.maxnumber !== void 0 && t(21, E = +n.maxnumber), n.mockerror !== void 0 && t(22, R = !!n.mockerror), n.name !== void 0 && t(4, M = n.name), n.refetchonexpire !== void 0 && t(23, I = !!n.refetchonexpire), n.spamfilter !== void 0 && t(24, w = typeof n.spamfilter == "object" ? n.spamfilter : !!n.spamfilter), n.strings && t(35, l = n.strings), n.test !== void 0 && t(25, v = typeof n.test == "number" ? n.test : !!n.test), n.verifyurl !== void 0 && t(26, J = n.verifyurl), n.workers !== void 0 && t(27, oe = +n.workers), n.workerurl !== void 0 && t(28, ue = n.workerurl);
+ n.auto !== void 0 && (t(0, a = n.auto), a === "onload" && ee()), n.floatinganchor !== void 0 && t(19, W = n.floatinganchor), n.delay !== void 0 && t(17, G = n.delay), n.floatingoffset !== void 0 && t(20, S = n.floatingoffset), n.floating !== void 0 && Fe(n.floating), n.expire !== void 0 && (he(n.expire), t(18, D = n.expire)), n.challenge && (je(n.challenge), o = n.challenge), n.challengeurl !== void 0 && t(15, f = n.challengeurl), n.debug !== void 0 && t(16, N = !!n.debug), n.hidefooter !== void 0 && t(2, K = !!n.hidefooter), n.hidelogo !== void 0 && t(3, H = !!n.hidelogo), n.maxnumber !== void 0 && t(21, E = +n.maxnumber), n.mockerror !== void 0 && t(22, R = !!n.mockerror), n.name !== void 0 && t(4, M = n.name), n.refetchonexpire !== void 0 && t(23, I = !!n.refetchonexpire), n.spamfilter !== void 0 && t(24, w = typeof n.spamfilter == "object" ? n.spamfilter : !!n.spamfilter), n.strings && t(35, l = n.strings), n.test !== void 0 && t(25, v = typeof n.test == "number" ? n.test : !!n.test), n.verifyurl !== void 0 && t(26, J = n.verifyurl), n.workers !== void 0 && t(27, oe = +n.workers), n.workerurl !== void 0 && t(28, ue = n.workerurl);
}
function ge(n = b.UNVERIFIED, u = null) {
X && (clearTimeout(X), X = null), t(7, P = !1), t(10, pe = u), t(5, Q = null), t(6, T = n);
@@ -1177,11 +1177,11 @@ function sr(r, e, t) {
});
}
return r.$$set = (n) => {
- "auto" in n && t(0, a = n.auto), "blockspam" in n && t(29, d = n.blockspam), "challengeurl" in n && t(15, f = n.challengeurl), "challengejson" in n && t(30, $ = n.challengejson), "debug" in n && t(16, N = n.debug), "delay" in n && t(17, G = n.delay), "expire" in n && t(18, F = n.expire), "floating" in n && t(1, k = n.floating), "floatinganchor" in n && t(19, W = n.floatinganchor), "floatingoffset" in n && t(20, S = n.floatingoffset), "hidefooter" in n && t(2, K = n.hidefooter), "hidelogo" in n && t(3, H = n.hidelogo), "name" in n && t(4, M = n.name), "maxnumber" in n && t(21, E = n.maxnumber), "mockerror" in n && t(22, R = n.mockerror), "refetchonexpire" in n && t(23, I = n.refetchonexpire), "spamfilter" in n && t(24, w = n.spamfilter), "strings" in n && t(31, h = n.strings), "test" in n && t(25, v = n.test), "verifyurl" in n && t(26, J = n.verifyurl), "workers" in n && t(27, oe = n.workers), "workerurl" in n && t(28, ue = n.workerurl);
+ "auto" in n && t(0, a = n.auto), "blockspam" in n && t(29, d = n.blockspam), "challengeurl" in n && t(15, f = n.challengeurl), "challengejson" in n && t(30, F = n.challengejson), "debug" in n && t(16, N = n.debug), "delay" in n && t(17, G = n.delay), "expire" in n && t(18, D = n.expire), "floating" in n && t(1, k = n.floating), "floatinganchor" in n && t(19, W = n.floatinganchor), "floatingoffset" in n && t(20, S = n.floatingoffset), "hidefooter" in n && t(2, K = n.hidefooter), "hidelogo" in n && t(3, H = n.hidelogo), "name" in n && t(4, M = n.name), "maxnumber" in n && t(21, E = n.maxnumber), "mockerror" in n && t(22, R = n.mockerror), "refetchonexpire" in n && t(23, I = n.refetchonexpire), "spamfilter" in n && t(24, w = n.spamfilter), "strings" in n && t(31, h = n.strings), "test" in n && t(25, v = n.test), "verifyurl" in n && t(26, J = n.verifyurl), "workers" in n && t(27, oe = n.workers), "workerurl" in n && t(28, ue = n.workerurl);
}, r.$$.update = () => {
r.$$.dirty[0] & /*challengeurl*/
32768 && t(12, i = !!(f != null && f.includes(".altcha.org")) && !!(f != null && f.includes("apiKey=ckey_"))), r.$$.dirty[0] & /*challengejson*/
- 1073741824 && (o = $ ? et($) : void 0), r.$$.dirty[1] & /*strings*/
+ 1073741824 && (o = F ? et(F) : void 0), r.$$.dirty[1] & /*strings*/
1 && t(35, l = h ? et(h) : {}), r.$$.dirty[1] & /*parsedStrings*/
16 && t(11, c = {
ariaLinkLabel: Qe,
@@ -1211,11 +1211,11 @@ function sr(r, e, t) {
c,
i,
dt,
- De,
+ $e,
f,
N,
G,
- F,
+ D,
W,
S,
E,
@@ -1227,7 +1227,7 @@ function sr(r, e, t) {
oe,
ue,
d,
- $,
+ F,
h,
Ue,
ge,
diff --git a/public/altcha.min.js b/public/altcha.min.js
index 729a5c6..b78e69d 100644
--- a/public/altcha.min.js
+++ b/public/altcha.min.js
@@ -1,5 +1,5 @@
/**
- * Version: 0.6.4
- * Source: https://github.com/altcha-org/altcha/tree/0.6.4
+ * Version: 0.6.7
+ * Source: https://github.com/altcha-org/altcha/tree/0.6.7
*/
-var _t=Object.defineProperty,kt=(e,t,n)=>t in e?_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t,n)=>kt(e,"symbol"!=typeof t?t+"":t,n);const tt="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGQoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBwKGUsdCxvKXtyZXR1cm4gZChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChvLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGcoZSx0LG89IlNIQS0yNTYiLGw9MWU2LGM9MCl7Y29uc3QgYT1uZXcgQWJvcnRDb250cm9sbGVyLGk9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgbj1jO248PWw7bis9MSl7aWYoYS5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCBwKHQsbixvKT09PWUpcmV0dXJue251bWJlcjpuLHRvb2s6RGF0ZS5ub3coKS1pfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjphfX1sZXQgcjtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOm99PWUuZGF0YTtpZih0PT09ImFib3J0IilyPT1udWxsfHxyLmFib3J0KCkscj12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtjb25zdHthbGc6bCxjaGFsbGVuZ2U6YyxtYXg6YSxzYWx0Omksc3RhcnQ6dX09b3x8e30sbj1nKGMsaSxsLGEsdSk7cj1uLmNvbnRyb2xsZXIsbi5wcm9taXNlLnRoZW4ocz0+e3NlbGYucG9zdE1lc3NhZ2UocyYmey4uLnMsd29ya2VyOiEwfSl9KX19fSkoKTsK",xt=e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))),Be=typeof window<"u"&&window.Blob&&new Blob([xt(tt)],{type:"text/javascript;charset=utf-8"});function Et(e){let t;try{if(t=Be&&(window.URL||window.webkitURL).createObjectURL(Be),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),n}catch{return new Worker("data:text/javascript;base64,"+tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}function ie(){}function rt(e){return e()}function He(){return Object.create(null)}function fe(e){e.forEach(rt)}function nt(e){return"function"==typeof e}function Ct(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function Lt(e){return 0===Object.keys(e).length}function _(e,t){e.appendChild(t)}function Rt(e,t,n){const r=It(e);if(!r.getElementById(t)){const e=A("style");e.id=t,e.textContent=n,zt(r,e)}}function It(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function zt(e,t){return _(e.head||e,t),t.sheet}function D(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode&&e.parentNode.removeChild(e)}function A(e){return document.createElement(e)}function O(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function At(e){return document.createTextNode(e)}function Y(){return At(" ")}function xe(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function s(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function St(e){return Array.from(e.childNodes)}function Oe(e,t,n){e.classList.toggle(t,!!n)}function Nt(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Zt(e){const t={};return e.childNodes.forEach((e=>{t[e.slot||"default"]=!0})),t}let ae;function ce(e){ae=e}function Re(){if(!ae)throw new Error("Function called outside component initialization");return ae}function jt(e){Re().$$.on_mount.push(e)}function Mt(e){Re().$$.on_destroy.push(e)}function Tt(){const e=Re();return(t,n,{cancelable:r=!1}={})=>{const o=e.$$.callbacks[t];if(o){const i=Nt(t,n,{cancelable:r});return o.slice().forEach((t=>{t.call(e,i)})),!i.defaultPrevented}return!0}}const re=[],we=[];let ne=[];const We=[],it=Promise.resolve();let Ce=!1;function ot(){Ce||(Ce=!0,it.then(y))}function Vt(){return ot(),it}function Le(e){ne.push(e)}const Ee=new Set;let te=0;function y(){if(0!==te)return;const e=ae;do{try{for(;te-1===e.indexOf(r)?t.push(r):n.push(r))),n.forEach((e=>e())),ne=t}const $t=new Set;function Ut(e,t){e&&e.i&&($t.delete(e),e.i(t))}function Gt(e,t,n){const{fragment:r,after_update:o}=e.$$;r&&r.m(t,n),Le((()=>{const t=e.$$.on_mount.map(rt).filter(nt);e.$$.on_destroy?e.$$.on_destroy.push(...t):fe(t),e.$$.on_mount=[]})),o.forEach(Le)}function Xt(e,t){const n=e.$$;null!==n.fragment&&(Ft(n.after_update),fe(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Bt(e,t){-1===e.$$.dirty[0]&&(re.push(e),ot(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const i=r.length?r[0]:n;return c.ctx&&o(c.ctx[t],c.ctx[t]=i)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](i),d&&Bt(e,t)),n})):[],c.update(),d=!0,fe(c.before_update),c.fragment=!!r&&r(c.ctx),t.target){if(t.hydrate){const e=St(t.target);c.fragment&&c.fragment.l(e),e.forEach(j)}else c.fragment&&c.fragment.c();t.intro&&Ut(e.$$.fragment),Gt(e,t.target,t.anchor),y()}ce(a)}let lt;function ve(e,t,n,r){var o;const i=null==(o=n[e])?void 0:o.type;if(t="Boolean"===i&&"boolean"!=typeof t?null!=t:t,!r||!n[e])return t;if("toAttribute"===r)switch(i){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}function Ot(e,t,n,r,o,i){let s=class extends lt{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return Object.keys(t).map((e=>(t[e].attribute||e).toLowerCase()))}};return Object.keys(t).forEach((e=>{Object.defineProperty(s.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){var r;n=ve(e,n,t),this.$$d[e]=n,null==(r=this.$$c)||r.$set({[e]:n})}})})),r.forEach((e=>{Object.defineProperty(s.prototype,e,{get(){var t;return null==(t=this.$$c)?void 0:t[e]}})})),i&&(s=i(s)),e.element=s,s}"function"==typeof HTMLElement&&(lt=class extends HTMLElement{constructor(e,t,n){super(),U(this,"$$ctor"),U(this,"$$s"),U(this,"$$c"),U(this,"$$cn",!1),U(this,"$$d",{}),U(this,"$$r",!1),U(this,"$$p_d",{}),U(this,"$$l",{}),U(this,"$$l_u",new Map),this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(e){return()=>{let t;return{c:function(){t=A("slot"),"default"!==e&&s(t,"name",e)},m:function(e,n){D(e,t,n)},d:function(e){e&&j(t)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=Zt(this);for(const r of this.$$s)r in n&&(t[r]=[e(r)]);for(const e of this.attributes){const t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=ve(t,e.value,this.$$p_d,"toProp"))}for(const e in this.$$p_d)!(e in this.$$d)&&void 0!==this[e]&&(this.$$d[e]=this[e],delete this[e]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});const r=()=>{this.$$r=!0;for(const e in this.$$p_d)if(this.$$d[e]=this.$$c.$$.ctx[this.$$c.$$.props[e]],this.$$p_d[e].reflect){const t=ve(e,this.$$d[e],this.$$p_d,"toAttribute");null==t?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1};this.$$c.$$.after_update.push(r),r();for(const e in this.$$l)for(const t of this.$$l[e]){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=ve(e,n,this.$$p_d,"toProp"),null==(r=this.$$c)||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class Wt{constructor(){U(this,"$$"),U(this,"$$set")}$destroy(){Xt(this,1),this.$destroy=ie}$on(e,t){if(!nt(t))return ie;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){this.$$set&&!Lt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Pt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Pt);const Yt=new TextEncoder;function Kt(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}async function Jt(e,t="SHA-256",n=1e5){const r=Date.now().toString(16);e||(e=Math.round(Math.random()*n));return{algorithm:t,challenge:await st(r,e,t),salt:r,signature:""}}async function st(e,t,n){return Kt(await crypto.subtle.digest(n.toUpperCase(),Yt.encode(e+t)))}function qt(e,t,n="SHA-256",r=1e6,o=0){const i=new AbortController,s=Date.now();return{promise:(async()=>{for(let l=o;l<=r;l+=1){if(i.signal.aborted)return null;if(await st(t,l,n)===e)return{number:l,took:Date.now()-s}}return null})(),controller:i}}var b=(e=>(e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(b||{});function Qt(e){Rt(e,"svelte-ddsc3z",'.altcha.svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left}.altcha.svelte-ddsc3z.svelte-ddsc3z:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow.svelte-ddsc3z{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z:not([data-state=unverified]){display:block}.altcha-anchor-arrow.svelte-ddsc3z.svelte-ddsc3z{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main.svelte-ddsc3z.svelte-ddsc3z{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-ddsc3z.svelte-ddsc3z{flex-grow:1}.altcha-label.svelte-ddsc3z label.svelte-ddsc3z{cursor:pointer}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z{color:currentColor;opacity:0.3}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-error.svelte-ddsc3z.svelte-ddsc3z{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-footer.svelte-ddsc3z>.svelte-ddsc3z:first-child{flex-grow:1}.altcha-footer.svelte-ddsc3z a{color:currentColor}.altcha-checkbox.svelte-ddsc3z.svelte-ddsc3z{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-ddsc3z input.svelte-ddsc3z{width:18px;height:18px;margin:0}.altcha-hidden.svelte-ddsc3z.svelte-ddsc3z{display:none}.altcha-spinner.svelte-ddsc3z.svelte-ddsc3z{animation:svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-ddsc3z-altcha-spinner{100%{transform:rotate(360deg)}}')}function Pe(e){let t,n,r;return{c(){t=O("svg"),n=O("path"),r=O("path"),s(n,"d","M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"),s(n,"fill","currentColor"),s(n,"opacity",".25"),s(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"),s(r,"fill","currentColor"),s(r,"class","altcha-spinner svelte-ddsc3z"),s(t,"width","24"),s(t,"height","24"),s(t,"viewBox","0 0 24 24"),s(t,"xmlns","http://www.w3.org/2000/svg")},m(e,o){D(e,t,o),_(t,n),_(t,r)},d(e){e&&j(t)}}}function er(e){let t,n,r=e[11].label+"";return{c(){t=A("label"),s(t,"for",n=e[4]+"_checkbox"),s(t,"class","svelte-ddsc3z")},m(e,n){D(e,t,n),t.innerHTML=r},p(e,o){2048&o[0]&&r!==(r=e[11].label+"")&&(t.innerHTML=r),16&o[0]&&n!==(n=e[4]+"_checkbox")&&s(t,"for",n)},d(e){e&&j(t)}}}function tr(e){let t,n=e[11].verifying+"";return{c(){t=A("span")},m(e,r){D(e,t,r),t.innerHTML=n},p(e,r){2048&r[0]&&n!==(n=e[11].verifying+"")&&(t.innerHTML=n)},d(e){e&&j(t)}}}function rr(e){let t,n,r,o=e[11].verified+"";return{c(){t=A("span"),n=Y(),r=A("input"),s(r,"type","hidden"),s(r,"name",e[4]),r.value=e[5]},m(e,i){D(e,t,i),t.innerHTML=o,D(e,n,i),D(e,r,i)},p(e,n){2048&n[0]&&o!==(o=e[11].verified+"")&&(t.innerHTML=o),16&n[0]&&s(r,"name",e[4]),32&n[0]&&(r.value=e[5])},d(e){e&&(j(t),j(n),j(r))}}}function Ye(e){let t,n,r,o,i,l,a;return{c(){t=A("div"),n=A("a"),r=O("svg"),o=O("path"),i=O("path"),l=O("path"),s(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"),s(o,"fill","currentColor"),s(i,"d","M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"),s(i,"fill","currentColor"),s(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"),s(l,"fill","currentColor"),s(r,"width","22"),s(r,"height","22"),s(r,"viewBox","0 0 20 20"),s(r,"fill","none"),s(r,"xmlns","http://www.w3.org/2000/svg"),s(n,"href",ct),s(n,"target","_blank"),s(n,"class","altcha-logo svelte-ddsc3z"),s(n,"aria-label",a=e[11].ariaLinkLabel)},m(e,s){D(e,t,s),_(t,n),_(n,r),_(r,o),_(r,i),_(r,l)},p(e,t){2048&t[0]&&a!==(a=e[11].ariaLinkLabel)&&s(n,"aria-label",a)},d(e){e&&j(t)}}}function Ke(e){let t,n,r,o;function i(e,t){return e[6]===b.EXPIRED?ir:nr}let l=i(e),a=l(e);return{c(){t=A("div"),n=O("svg"),r=O("path"),o=Y(),a.c(),s(r,"stroke-linecap","round"),s(r,"stroke-linejoin","round"),s(r,"d","M6 18L18 6M6 6l12 12"),s(n,"width","14"),s(n,"height","14"),s(n,"xmlns","http://www.w3.org/2000/svg"),s(n,"fill","none"),s(n,"viewBox","0 0 24 24"),s(n,"stroke-width","1.5"),s(n,"stroke","currentColor"),s(t,"class","altcha-error svelte-ddsc3z")},m(e,i){D(e,t,i),_(t,n),_(n,r),_(t,o),a.m(t,null)},p(e,n){l===(l=i(e))&&a?a.p(e,n):(a.d(1),a=l(e),a&&(a.c(),a.m(t,null)))},d(e){e&&j(t),a.d()}}}function nr(e){let t,n=e[11].error+"";return{c(){t=A("div"),s(t,"title",e[10])},m(e,r){D(e,t,r),t.innerHTML=n},p(e,r){2048&r[0]&&n!==(n=e[11].error+"")&&(t.innerHTML=n),1024&r[0]&&s(t,"title",e[10])},d(e){e&&j(t)}}}function ir(e){let t,n=e[11].expired+"";return{c(){t=A("div"),s(t,"title",e[10])},m(e,r){D(e,t,r),t.innerHTML=n},p(e,r){2048&r[0]&&n!==(n=e[11].expired+"")&&(t.innerHTML=n),1024&r[0]&&s(t,"title",e[10])},d(e){e&&j(t)}}}function Je(e){let t,n,r=e[11].footer+"";return{c(){t=A("div"),n=A("div"),s(n,"class","svelte-ddsc3z"),s(t,"class","altcha-footer svelte-ddsc3z")},m(e,o){D(e,t,o),_(t,n),n.innerHTML=r},p(e,t){2048&t[0]&&r!==(r=e[11].footer+"")&&(n.innerHTML=r)},d(e){e&&j(t)}}}function qe(e){let t;return{c(){t=A("div"),s(t,"class","altcha-anchor-arrow svelte-ddsc3z")},m(n,r){D(n,t,r),e[37](t)},p:ie,d(n){n&&j(t),e[37](null)}}}function or(e){let t,n,r,o,i,l,a,c,d,u,h,f,p,$,g,m=e[6]===b.VERIFYING&&Pe();function v(e,t){return e[6]===b.VERIFIED?rr:e[6]===b.VERIFYING?tr:er}let y=v(e),w=y(e),x=(!0!==e[3]||e[12])&&Ye(e),k=(e[10]||e[6]===b.EXPIRED)&&Ke(e),E=e[11].footer&&(!0!==e[2]||e[12])&&Je(e),L=e[1]&&qe(e);return{c(){t=A("div"),n=A("div"),m&&m.c(),r=Y(),o=A("div"),i=A("input"),c=Y(),d=A("div"),w.c(),u=Y(),x&&x.c(),h=Y(),k&&k.c(),f=Y(),E&&E.c(),p=Y(),L&&L.c(),s(i,"type","checkbox"),s(i,"id",l=e[4]+"_checkbox"),i.required=a="onsubmit"!==e[0],s(i,"class","svelte-ddsc3z"),s(o,"class","altcha-checkbox svelte-ddsc3z"),Oe(o,"altcha-hidden",e[6]===b.VERIFYING),s(d,"class","altcha-label svelte-ddsc3z"),s(n,"class","altcha-main svelte-ddsc3z"),s(t,"class","altcha svelte-ddsc3z"),s(t,"data-state",e[6]),s(t,"data-floating",e[1])},m(s,l){D(s,t,l),_(t,n),m&&m.m(n,null),_(n,r),_(n,o),_(o,i),i.checked=e[7],_(n,c),_(n,d),w.m(d,null),_(n,u),x&&x.m(n,null),_(t,h),k&&k.m(t,null),_(t,f),E&&E.m(t,null),_(t,p),L&&L.m(t,null),e[38](t),$||(g=[xe(i,"change",e[36]),xe(i,"change",e[13]),xe(i,"invalid",e[14])],$=!0)},p(e,c){e[6]===b.VERIFYING?m||(m=Pe(),m.c(),m.m(n,r)):m&&(m.d(1),m=null),16&c[0]&&l!==(l=e[4]+"_checkbox")&&s(i,"id",l),1&c[0]&&a!==(a="onsubmit"!==e[0])&&(i.required=a),128&c[0]&&(i.checked=e[7]),64&c[0]&&Oe(o,"altcha-hidden",e[6]===b.VERIFYING),y===(y=v(e))&&w?w.p(e,c):(w.d(1),w=y(e),w&&(w.c(),w.m(d,null))),!0!==e[3]||e[12]?x?x.p(e,c):(x=Ye(e),x.c(),x.m(n,null)):x&&(x.d(1),x=null),e[10]||e[6]===b.EXPIRED?k?k.p(e,c):(k=Ke(e),k.c(),k.m(t,f)):k&&(k.d(1),k=null),e[11].footer&&(!0!==e[2]||e[12])?E?E.p(e,c):(E=Je(e),E.c(),E.m(t,p)):E&&(E.d(1),E=null),e[1]?L?L.p(e,c):(L=qe(e),L.c(),L.m(t,null)):L&&(L.d(1),L=null),64&c[0]&&s(t,"data-state",e[6]),2&c[0]&&s(t,"data-floating",e[1])},i:ie,o:ie,d(n){n&&j(t),m&&m.d(),w.d(),x&&x.d(),k&&k.d(),E&&E.d(),L&&L.d(),e[38](null),$=!1,fe(g)}}}const Qe="Visit Altcha.org",ct="https://altcha.org/";function et(e){return JSON.parse(e)}function lr(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function sr(e,t,n){var r,o;let i,s,l,a,{auto:c}=t,{blockspam:d}=t,{challengeurl:u}=t,{challengejson:h}=t,{debug:f=!1}=t,{delay:p=0}=t,{expire:$}=t,{floating:g}=t,{floatinganchor:m}=t,{floatingoffset:v}=t,{hidefooter:y=!1}=t,{hidelogo:w=!1}=t,{name:x="altcha"}=t,{maxnumber:k=1e6}=t,{mockerror:E=!1}=t,{refetchonexpire:L=!0}=t,{spamfilter:R=!1}=t,{strings:C}=t,{test:_=!1}=t,{verifyurl:z}=t,{workers:A=Math.min(16,navigator.hardwareConcurrency||8)}=t,{workerurl:I}=t;const j=Tt(),N=["SHA-256","SHA-384","SHA-512"],D=null==(o=null==(r=document.documentElement.lang)?void 0:r.split("-"))?void 0:o[0];let S,U=!1,Z=null,M=null,O=null,Y=null,V=null,T=b.UNVERIFIED,F=null;function G(...e){(f||e.some((e=>e instanceof Error)))&&console[e[0]instanceof Error?"error":"log"]("ALTCHA",...e)}function H(e){T===b.UNVERIFIED&&ae()}function P(e){O&&"onsubmit"===c&&(T===b.UNVERIFIED?(e.preventDefault(),e.stopPropagation(),ae().then((()=>{null==O||O.requestSubmit()}))):T!==b.VERIFIED&&(e.preventDefault(),e.stopPropagation(),T===b.VERIFYING&&ee()))}function X(){le()}function B(e,t){return btoa(JSON.stringify({algorithm:e.algorithm,challenge:e.challenge,number:t.number,salt:e.salt,signature:e.signature,test:!!_||void 0,took:t.took}))}function W(e){if(!e.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(void 0===e.signature)throw new Error("Invalid challenge. Property signature is missing.");if(!N.includes(e.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${N.join(", ")}`);if(!e.challenge||e.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!e.salt||e.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}function K(){u&&L&&T===b.VERIFIED?ae():le(b.EXPIRED,a.expired)}async function J(e){let t=null;if("Worker"in window){try{t=await async function(e,t,n,r=("number"==typeof _?_:k),o=Math.ceil(A)){const i=[];o=Math.min(16,Math.max(1,o));for(let e=0;e{const l=o*s;return new Promise((o=>{r.addEventListener("message",(e=>{if(e.data)for(const e of i)e!==r&&e.postMessage({type:"abort"});o(e.data)})),r.postMessage({payload:{alg:n,challenge:e,max:l+s,salt:t,start:l},type:"work"})}))})));for(const e of i)e.terminate();return l.find((e=>!!e))||null}(e.challenge,e.salt,e.algorithm,e.maxnumber)}catch(e){G(e)}if(void 0!==(null==t?void 0:t.number))return{data:e,solution:t}}return{data:e,solution:await qt(e.challenge,e.salt,e.algorithm,e.maxnumber||k).promise}}function q(e){const t=e.target;g&&t&&!S.contains(t)&&T===b.VERIFIED&&n(8,S.style.display="none",S)}function Q(){g&&ie()}function ee(){T===b.VERIFYING&&a.waitAlert&&alert(a.waitAlert)}function te(){g&&ie()}function ne(e){G("expire",e),F&&(clearTimeout(F),F=null),e<1?K():F=setTimeout(K,e)}function re(e){G("floating",e),g!==e&&(n(8,S.style.left="",S),n(8,S.style.top="",S)),n(1,g=!0===e||""===e?"auto":!1===e||"false"===e?void 0:g),g?(c||n(0,c="onsubmit"),document.addEventListener("scroll",Q),document.addEventListener("click",q),window.addEventListener("resize",te)):"onsubmit"===c&&n(0,c=void 0)}async function oe(e){if(!z)throw new Error("Attribute verifyurl not set.");G("requesting server verification from",z);const t={payload:e};if(R){const{blockedCountries:e,classifier:n,disableRules:r,email:o,expectedLanguages:i,expectedCountries:s,fields:l,ipAddress:a,text:c,timeZone:d}="ipAddress"===R?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:"object"==typeof R?R:{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0};t.blockedCountries=e,t.classifier=n,t.disableRules=r,t.email=!1===o?void 0:function(e){var t;const n=null==O?void 0:O.querySelector("string"==typeof e?`input[name="${e}"]`:'input[type="email"]:not([data-no-spamfilter])');return(null==(t=null==n?void 0:n.value)?void 0:t.slice(n.value.indexOf("@")))||void 0}(o),t.expectedCountries=s,t.expectedLanguages=i||(D?[D]:void 0),t.fields=!1===l?void 0:function(e){return[...(null==O?void 0:O.querySelectorAll(null!=e&&e.length?e.map((e=>`input[name="${e}"]`)).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce(((e,t)=>{const n=t.name,r=t.value;return n&&r&&(e[n]=/\n/.test(r)?r.replace(new RegExp("(?i:"top"===g,a=Math.max(e,Math.min(s-e-o.width,r.left+r.width/2-o.width/2));if(n(8,S.style.top=l?r.top-(o.height+t)+"px":`${r.bottom+t}px`,S),n(8,S.style.left=`${a}px`,S),S.setAttribute("data-floating",l?"top":"bottom"),Z){const e=Z.getBoundingClientRect();n(9,Z.style.left=r.left-a+r.width/2-e.width/2+"px",Z)}}else G("unable to find floating anchor element")}function se(e){void 0!==e.auto&&(n(0,c=e.auto),"onload"===c&&ae()),void 0!==e.floatinganchor&&n(19,m=e.floatinganchor),void 0!==e.delay&&n(17,p=e.delay),void 0!==e.floatingoffset&&n(20,v=e.floatingoffset),void 0!==e.floating&&re(e.floating),void 0!==e.expire&&(ne(e.expire),n(18,$=e.expire)),e.challenge&&(W(e.challenge),s=e.challenge),void 0!==e.challengeurl&&n(15,u=e.challengeurl),void 0!==e.debug&&n(16,f=!!e.debug),void 0!==e.hidefooter&&n(2,y=!!e.hidefooter),void 0!==e.hidelogo&&n(3,w=!!e.hidelogo),void 0!==e.maxnumber&&n(21,k=+e.maxnumber),void 0!==e.mockerror&&n(22,E=!!e.mockerror),void 0!==e.name&&n(4,x=e.name),void 0!==e.refetchonexpire&&n(23,L=!!e.refetchonexpire),void 0!==e.spamfilter&&n(24,R="object"==typeof e.spamfilter?e.spamfilter:!!e.spamfilter),e.strings&&n(35,l=e.strings),void 0!==e.test&&n(25,_="number"==typeof e.test?e.test:!!e.test),void 0!==e.verifyurl&&n(26,z=e.verifyurl),void 0!==e.workers&&n(27,A=+e.workers),void 0!==e.workerurl&&n(28,I=e.workerurl)}function le(e=b.UNVERIFIED,t=null){F&&(clearTimeout(F),F=null),n(7,U=!1),n(10,Y=t),n(5,V=null),n(6,T=e)}async function ae(){return le(b.VERIFYING),await new Promise((e=>setTimeout(e,p||0))),async function(){var e;if(E)throw G("mocking error"),new Error("Mocked error.");if(s)return G("using provided json data"),s;if(_)return G("generating test challenge",{test:_}),Jt("boolean"!=typeof _?+_:void 0);{if(!u)throw new Error("Attribute challengeurl not set.");G("fetching challenge from",u);const t=await fetch(u,{headers:{"x-altcha-spam-filter":R?"1":"0"}});if(200!==t.status)throw new Error(`Server responded with ${t.status}.`);const n=t.headers.get("Expires"),r=t.headers.get("X-Altcha-Config"),o=await t.json(),i=new URLSearchParams(null==(e=o.salt.split("?"))?void 0:e[1]),s=i.get("expires")||i.get("expire");if(s){const e=new Date(1e3*+s),t=isNaN(e.getTime())?0:e.getTime()-Date.now();t>0&&ne(t)}if(r)try{const e=JSON.parse(r);e&&"object"==typeof e&&(e.verifyurl&&(e.verifyurl=new URL(e.verifyurl,new URL(u)).toString()),se(e))}catch(e){G("unable to configure from X-Altcha-Config",e)}if(!$&&null!=n&&n.length){const e=Date.parse(n);if(e){const t=e-Date.now();t>0&&ne(t)}}return o}}().then((e=>(W(e),G("challenge",e),J(e)))).then((({data:e,solution:t})=>{if(G("solution",t),void 0===(null==t?void 0:t.number))throw G("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.");if(z)return oe(B(e,t));n(5,V=B(e,t)),G("payload",V)})).then((()=>{Vt().then((()=>{n(6,T=b.VERIFIED),n(7,U=!0),G("verified"),j("verified",{payload:V})}))})).catch((e=>{G(e),n(6,T=b.ERROR),n(7,U=!1),n(10,Y=e.message)}))}return Mt((()=>{O&&(O.removeEventListener("submit",P),O.removeEventListener("reset",X),O.removeEventListener("focusin",H),O=null),F&&(clearTimeout(F),F=null),document.removeEventListener("click",q),document.removeEventListener("scroll",Q),window.removeEventListener("resize",te)})),jt((()=>{G("mounted","0.6.4"),G("workers",A),_&&G("using test mode"),$&&ne($),void 0!==c&&G("auto",c),void 0!==g&&re(g),O=S.closest("form"),O&&(O.addEventListener("submit",P,{capture:!0}),O.addEventListener("reset",X),"onfocus"===c&&O.addEventListener("focusin",H)),"onload"===c&&ae(),i&&(y||w)&&G("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.")})),e.$$set=e=>{"auto"in e&&n(0,c=e.auto),"blockspam"in e&&n(29,d=e.blockspam),"challengeurl"in e&&n(15,u=e.challengeurl),"challengejson"in e&&n(30,h=e.challengejson),"debug"in e&&n(16,f=e.debug),"delay"in e&&n(17,p=e.delay),"expire"in e&&n(18,$=e.expire),"floating"in e&&n(1,g=e.floating),"floatinganchor"in e&&n(19,m=e.floatinganchor),"floatingoffset"in e&&n(20,v=e.floatingoffset),"hidefooter"in e&&n(2,y=e.hidefooter),"hidelogo"in e&&n(3,w=e.hidelogo),"name"in e&&n(4,x=e.name),"maxnumber"in e&&n(21,k=e.maxnumber),"mockerror"in e&&n(22,E=e.mockerror),"refetchonexpire"in e&&n(23,L=e.refetchonexpire),"spamfilter"in e&&n(24,R=e.spamfilter),"strings"in e&&n(31,C=e.strings),"test"in e&&n(25,_=e.test),"verifyurl"in e&&n(26,z=e.verifyurl),"workers"in e&&n(27,A=e.workers),"workerurl"in e&&n(28,I=e.workerurl)},e.$$.update=()=>{32768&e.$$.dirty[0]&&n(12,i=!(null==u||!u.includes(".altcha.org")||null==u||!u.includes("apiKey=ckey_"))),1073741824&e.$$.dirty[0]&&(s=h?et(h):void 0),1&e.$$.dirty[1]&&n(35,l=C?et(C):{}),16&e.$$.dirty[1]&&n(11,a={ariaLinkLabel:Qe,error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:`Protected by ALTCHA`,label:"I'm not a robot",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait.",...l}),96&e.$$.dirty[0]&&j("statechange",{payload:V,state:T}),64&e.$$.dirty[0]&&g&&T!==b.UNVERIFIED&&requestAnimationFrame((()=>{ie()}))},[c,g,y,w,x,V,T,U,S,Z,Y,a,i,function(){[b.UNVERIFIED,b.ERROR,b.EXPIRED].includes(T)?R&&!1===(null==O?void 0:O.reportValidity())?n(7,U=!1):ae():n(7,U=!0)},ee,u,f,p,$,m,v,k,E,L,R,_,z,A,I,d,h,C,se,le,ae,l,function(){U=this.checked,n(7,U)},function(e){we[e?"unshift":"push"]((()=>{Z=e,n(9,Z)}))},function(e){we[e?"unshift":"push"]((()=>{S=e,n(8,S)}))}]}class cr extends Wt{constructor(e){super(),Ht(this,e,sr,or,Ct,{auto:0,blockspam:29,challengeurl:15,challengejson:30,debug:16,delay:17,expire:18,floating:1,floatinganchor:19,floatingoffset:20,hidefooter:2,hidelogo:3,name:4,maxnumber:21,mockerror:22,refetchonexpire:23,spamfilter:24,strings:31,test:25,verifyurl:26,workers:27,workerurl:28,configure:32,reset:33,verify:34},Qt,[-1,-1,-1])}get auto(){return this.$$.ctx[0]}set auto(e){this.$$set({auto:e}),y()}get blockspam(){return this.$$.ctx[29]}set blockspam(e){this.$$set({blockspam:e}),y()}get challengeurl(){return this.$$.ctx[15]}set challengeurl(e){this.$$set({challengeurl:e}),y()}get challengejson(){return this.$$.ctx[30]}set challengejson(e){this.$$set({challengejson:e}),y()}get debug(){return this.$$.ctx[16]}set debug(e){this.$$set({debug:e}),y()}get delay(){return this.$$.ctx[17]}set delay(e){this.$$set({delay:e}),y()}get expire(){return this.$$.ctx[18]}set expire(e){this.$$set({expire:e}),y()}get floating(){return this.$$.ctx[1]}set floating(e){this.$$set({floating:e}),y()}get floatinganchor(){return this.$$.ctx[19]}set floatinganchor(e){this.$$set({floatinganchor:e}),y()}get floatingoffset(){return this.$$.ctx[20]}set floatingoffset(e){this.$$set({floatingoffset:e}),y()}get hidefooter(){return this.$$.ctx[2]}set hidefooter(e){this.$$set({hidefooter:e}),y()}get hidelogo(){return this.$$.ctx[3]}set hidelogo(e){this.$$set({hidelogo:e}),y()}get name(){return this.$$.ctx[4]}set name(e){this.$$set({name:e}),y()}get maxnumber(){return this.$$.ctx[21]}set maxnumber(e){this.$$set({maxnumber:e}),y()}get mockerror(){return this.$$.ctx[22]}set mockerror(e){this.$$set({mockerror:e}),y()}get refetchonexpire(){return this.$$.ctx[23]}set refetchonexpire(e){this.$$set({refetchonexpire:e}),y()}get spamfilter(){return this.$$.ctx[24]}set spamfilter(e){this.$$set({spamfilter:e}),y()}get strings(){return this.$$.ctx[31]}set strings(e){this.$$set({strings:e}),y()}get test(){return this.$$.ctx[25]}set test(e){this.$$set({test:e}),y()}get verifyurl(){return this.$$.ctx[26]}set verifyurl(e){this.$$set({verifyurl:e}),y()}get workers(){return this.$$.ctx[27]}set workers(e){this.$$set({workers:e}),y()}get workerurl(){return this.$$.ctx[28]}set workerurl(e){this.$$set({workerurl:e}),y()}get configure(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get verify(){return this.$$.ctx[34]}}customElements.define("altcha-widget",Ot(cr,{auto:{},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)),globalThis.createAltchaWorker=e=>e?new Worker(new URL(e)):new Et;export{cr as Altcha};
\ No newline at end of file
+var _t=Object.defineProperty,kt=(e,t,n)=>t in e?_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t,n)=>kt(e,"symbol"!=typeof t?t+"":t,n);const tt="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGQoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBwKGUsdCxvKXtyZXR1cm4gZChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChvLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGcoZSx0LG89IlNIQS0yNTYiLGw9MWU2LGM9MCl7Y29uc3QgYT1uZXcgQWJvcnRDb250cm9sbGVyLGk9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgbj1jO248PWw7bis9MSl7aWYoYS5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCBwKHQsbixvKT09PWUpcmV0dXJue251bWJlcjpuLHRvb2s6RGF0ZS5ub3coKS1pfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjphfX1sZXQgcjtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOm99PWUuZGF0YTtpZih0PT09ImFib3J0IilyPT1udWxsfHxyLmFib3J0KCkscj12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtjb25zdHthbGc6bCxjaGFsbGVuZ2U6YyxtYXg6YSxzYWx0Omksc3RhcnQ6dX09b3x8e30sbj1nKGMsaSxsLGEsdSk7cj1uLmNvbnRyb2xsZXIsbi5wcm9taXNlLnRoZW4ocz0+e3NlbGYucG9zdE1lc3NhZ2UocyYmey4uLnMsd29ya2VyOiEwfSl9KX19fSkoKTsK",xt=e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))),Be=typeof self<"u"&&self.Blob&&new Blob([xt(tt)],{type:"text/javascript;charset=utf-8"});function Et(e){let t;try{if(t=Be&&(self.URL||self.webkitURL).createObjectURL(Be),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),n}catch{return new Worker("data:text/javascript;base64,"+tt,{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}function ie(){}function rt(e){return e()}function He(){return Object.create(null)}function fe(e){e.forEach(rt)}function nt(e){return"function"==typeof e}function Ct(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function Lt(e){return 0===Object.keys(e).length}function _(e,t){e.appendChild(t)}function Rt(e,t,n){const r=It(e);if(!r.getElementById(t)){const e=A("style");e.id=t,e.textContent=n,zt(r,e)}}function It(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function zt(e,t){return _(e.head||e,t),t.sheet}function $(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode&&e.parentNode.removeChild(e)}function A(e){return document.createElement(e)}function O(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function At(e){return document.createTextNode(e)}function Y(){return At(" ")}function xe(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function s(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function St(e){return Array.from(e.childNodes)}function Oe(e,t,n){e.classList.toggle(t,!!n)}function Nt(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Zt(e){const t={};return e.childNodes.forEach((e=>{t[e.slot||"default"]=!0})),t}let ae;function ce(e){ae=e}function Re(){if(!ae)throw new Error("Function called outside component initialization");return ae}function jt(e){Re().$$.on_mount.push(e)}function Mt(e){Re().$$.on_destroy.push(e)}function Tt(){const e=Re();return(t,n,{cancelable:r=!1}={})=>{const o=e.$$.callbacks[t];if(o){const i=Nt(t,n,{cancelable:r});return o.slice().forEach((t=>{t.call(e,i)})),!i.defaultPrevented}return!0}}const re=[],we=[];let ne=[];const We=[],it=Promise.resolve();let Ce=!1;function ot(){Ce||(Ce=!0,it.then(y))}function Vt(){return ot(),it}function Le(e){ne.push(e)}const Ee=new Set;let te=0;function y(){if(0!==te)return;const e=ae;do{try{for(;te-1===e.indexOf(r)?t.push(r):n.push(r))),n.forEach((e=>e())),ne=t}const Ft=new Set;function Ut(e,t){e&&e.i&&(Ft.delete(e),e.i(t))}function Gt(e,t,n){const{fragment:r,after_update:o}=e.$$;r&&r.m(t,n),Le((()=>{const t=e.$$.on_mount.map(rt).filter(nt);e.$$.on_destroy?e.$$.on_destroy.push(...t):fe(t),e.$$.on_mount=[]})),o.forEach(Le)}function Xt(e,t){const n=e.$$;null!==n.fragment&&(Dt(n.after_update),fe(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Bt(e,t){-1===e.$$.dirty[0]&&(re.push(e),ot(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const i=r.length?r[0]:n;return c.ctx&&o(c.ctx[t],c.ctx[t]=i)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](i),d&&Bt(e,t)),n})):[],c.update(),d=!0,fe(c.before_update),c.fragment=!!r&&r(c.ctx),t.target){if(t.hydrate){const e=St(t.target);c.fragment&&c.fragment.l(e),e.forEach(j)}else c.fragment&&c.fragment.c();t.intro&&Ut(e.$$.fragment),Gt(e,t.target,t.anchor),y()}ce(a)}let lt;function ve(e,t,n,r){var o;const i=null==(o=n[e])?void 0:o.type;if(t="Boolean"===i&&"boolean"!=typeof t?null!=t:t,!r||!n[e])return t;if("toAttribute"===r)switch(i){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}function Ot(e,t,n,r,o,i){let s=class extends lt{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return Object.keys(t).map((e=>(t[e].attribute||e).toLowerCase()))}};return Object.keys(t).forEach((e=>{Object.defineProperty(s.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){var r;n=ve(e,n,t),this.$$d[e]=n,null==(r=this.$$c)||r.$set({[e]:n})}})})),r.forEach((e=>{Object.defineProperty(s.prototype,e,{get(){var t;return null==(t=this.$$c)?void 0:t[e]}})})),e.element=s,s}"function"==typeof HTMLElement&&(lt=class extends HTMLElement{constructor(e,t,n){super(),U(this,"$$ctor"),U(this,"$$s"),U(this,"$$c"),U(this,"$$cn",!1),U(this,"$$d",{}),U(this,"$$r",!1),U(this,"$$p_d",{}),U(this,"$$l",{}),U(this,"$$l_u",new Map),this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(e){return()=>{let t;return{c:function(){t=A("slot"),"default"!==e&&s(t,"name",e)},m:function(e,n){$(e,t,n)},d:function(e){e&&j(t)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=Zt(this);for(const r of this.$$s)r in n&&(t[r]=[e(r)]);for(const e of this.attributes){const t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=ve(t,e.value,this.$$p_d,"toProp"))}for(const e in this.$$p_d)!(e in this.$$d)&&void 0!==this[e]&&(this.$$d[e]=this[e],delete this[e]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});const r=()=>{this.$$r=!0;for(const e in this.$$p_d)if(this.$$d[e]=this.$$c.$$.ctx[this.$$c.$$.props[e]],this.$$p_d[e].reflect){const t=ve(e,this.$$d[e],this.$$p_d,"toAttribute");null==t?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1};this.$$c.$$.after_update.push(r),r();for(const e in this.$$l)for(const t of this.$$l[e]){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=ve(e,n,this.$$p_d,"toProp"),null==(r=this.$$c)||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class Wt{constructor(){U(this,"$$"),U(this,"$$set")}$destroy(){Xt(this,1),this.$destroy=ie}$on(e,t){if(!nt(t))return ie;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){this.$$set&&!Lt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Pt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Pt);const Yt=new TextEncoder;function Kt(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}async function Jt(e,t="SHA-256",n=1e5){const r=Date.now().toString(16);e||(e=Math.round(Math.random()*n));return{algorithm:t,challenge:await st(r,e,t),salt:r,signature:""}}async function st(e,t,n){return Kt(await crypto.subtle.digest(n.toUpperCase(),Yt.encode(e+t)))}function qt(e,t,n="SHA-256",r=1e6,o=0){const i=new AbortController,s=Date.now();return{promise:(async()=>{for(let l=o;l<=r;l+=1){if(i.signal.aborted)return null;if(await st(t,l,n)===e)return{number:l,took:Date.now()-s}}return null})(),controller:i}}var b=(e=>(e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(b||{});function Qt(e){Rt(e,"svelte-ddsc3z",'.altcha.svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left}.altcha.svelte-ddsc3z.svelte-ddsc3z:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow.svelte-ddsc3z{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z:not([data-state=unverified]){display:block}.altcha-anchor-arrow.svelte-ddsc3z.svelte-ddsc3z{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main.svelte-ddsc3z.svelte-ddsc3z{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-ddsc3z.svelte-ddsc3z{flex-grow:1}.altcha-label.svelte-ddsc3z label.svelte-ddsc3z{cursor:pointer}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z{color:currentColor;opacity:0.3}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-error.svelte-ddsc3z.svelte-ddsc3z{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-footer.svelte-ddsc3z>.svelte-ddsc3z:first-child{flex-grow:1}.altcha-footer.svelte-ddsc3z a{color:currentColor}.altcha-checkbox.svelte-ddsc3z.svelte-ddsc3z{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-ddsc3z input.svelte-ddsc3z{width:18px;height:18px;margin:0}.altcha-hidden.svelte-ddsc3z.svelte-ddsc3z{display:none}.altcha-spinner.svelte-ddsc3z.svelte-ddsc3z{animation:svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-ddsc3z-altcha-spinner{100%{transform:rotate(360deg)}}')}function Pe(e){let t,n,r;return{c(){t=O("svg"),n=O("path"),r=O("path"),s(n,"d","M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"),s(n,"fill","currentColor"),s(n,"opacity",".25"),s(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"),s(r,"fill","currentColor"),s(r,"class","altcha-spinner svelte-ddsc3z"),s(t,"width","24"),s(t,"height","24"),s(t,"viewBox","0 0 24 24"),s(t,"xmlns","http://www.w3.org/2000/svg")},m(e,o){$(e,t,o),_(t,n),_(t,r)},d(e){e&&j(t)}}}function er(e){let t,n,r=e[11].label+"";return{c(){t=A("label"),s(t,"for",n=e[4]+"_checkbox"),s(t,"class","svelte-ddsc3z")},m(e,n){$(e,t,n),t.innerHTML=r},p(e,o){2048&o[0]&&r!==(r=e[11].label+"")&&(t.innerHTML=r),16&o[0]&&n!==(n=e[4]+"_checkbox")&&s(t,"for",n)},d(e){e&&j(t)}}}function tr(e){let t,n=e[11].verifying+"";return{c(){t=A("span")},m(e,r){$(e,t,r),t.innerHTML=n},p(e,r){2048&r[0]&&n!==(n=e[11].verifying+"")&&(t.innerHTML=n)},d(e){e&&j(t)}}}function rr(e){let t,n,r,o=e[11].verified+"";return{c(){t=A("span"),n=Y(),r=A("input"),s(r,"type","hidden"),s(r,"name",e[4]),r.value=e[5]},m(e,i){$(e,t,i),t.innerHTML=o,$(e,n,i),$(e,r,i)},p(e,n){2048&n[0]&&o!==(o=e[11].verified+"")&&(t.innerHTML=o),16&n[0]&&s(r,"name",e[4]),32&n[0]&&(r.value=e[5])},d(e){e&&(j(t),j(n),j(r))}}}function Ye(e){let t,n,r,o,i,l,a;return{c(){t=A("div"),n=A("a"),r=O("svg"),o=O("path"),i=O("path"),l=O("path"),s(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"),s(o,"fill","currentColor"),s(i,"d","M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"),s(i,"fill","currentColor"),s(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"),s(l,"fill","currentColor"),s(r,"width","22"),s(r,"height","22"),s(r,"viewBox","0 0 20 20"),s(r,"fill","none"),s(r,"xmlns","http://www.w3.org/2000/svg"),s(n,"href",ct),s(n,"target","_blank"),s(n,"class","altcha-logo svelte-ddsc3z"),s(n,"aria-label",a=e[11].ariaLinkLabel)},m(e,s){$(e,t,s),_(t,n),_(n,r),_(r,o),_(r,i),_(r,l)},p(e,t){2048&t[0]&&a!==(a=e[11].ariaLinkLabel)&&s(n,"aria-label",a)},d(e){e&&j(t)}}}function Ke(e){let t,n,r,o;function i(e,t){return e[6]===b.EXPIRED?ir:nr}let l=i(e),a=l(e);return{c(){t=A("div"),n=O("svg"),r=O("path"),o=Y(),a.c(),s(r,"stroke-linecap","round"),s(r,"stroke-linejoin","round"),s(r,"d","M6 18L18 6M6 6l12 12"),s(n,"width","14"),s(n,"height","14"),s(n,"xmlns","http://www.w3.org/2000/svg"),s(n,"fill","none"),s(n,"viewBox","0 0 24 24"),s(n,"stroke-width","1.5"),s(n,"stroke","currentColor"),s(t,"class","altcha-error svelte-ddsc3z")},m(e,i){$(e,t,i),_(t,n),_(n,r),_(t,o),a.m(t,null)},p(e,n){l===(l=i(e))&&a?a.p(e,n):(a.d(1),a=l(e),a&&(a.c(),a.m(t,null)))},d(e){e&&j(t),a.d()}}}function nr(e){let t,n=e[11].error+"";return{c(){t=A("div"),s(t,"title",e[10])},m(e,r){$(e,t,r),t.innerHTML=n},p(e,r){2048&r[0]&&n!==(n=e[11].error+"")&&(t.innerHTML=n),1024&r[0]&&s(t,"title",e[10])},d(e){e&&j(t)}}}function ir(e){let t,n=e[11].expired+"";return{c(){t=A("div"),s(t,"title",e[10])},m(e,r){$(e,t,r),t.innerHTML=n},p(e,r){2048&r[0]&&n!==(n=e[11].expired+"")&&(t.innerHTML=n),1024&r[0]&&s(t,"title",e[10])},d(e){e&&j(t)}}}function Je(e){let t,n,r=e[11].footer+"";return{c(){t=A("div"),n=A("div"),s(n,"class","svelte-ddsc3z"),s(t,"class","altcha-footer svelte-ddsc3z")},m(e,o){$(e,t,o),_(t,n),n.innerHTML=r},p(e,t){2048&t[0]&&r!==(r=e[11].footer+"")&&(n.innerHTML=r)},d(e){e&&j(t)}}}function qe(e){let t;return{c(){t=A("div"),s(t,"class","altcha-anchor-arrow svelte-ddsc3z")},m(n,r){$(n,t,r),e[37](t)},p:ie,d(n){n&&j(t),e[37](null)}}}function or(e){let t,n,r,o,i,l,a,c,d,u,h,f,p,g,m,v=e[6]===b.VERIFYING&&Pe();function y(e,t){return e[6]===b.VERIFIED?rr:e[6]===b.VERIFYING?tr:er}let w=y(e),x=w(e),k=(!0!==e[3]||e[12])&&Ye(e),E=(e[10]||e[6]===b.EXPIRED)&&Ke(e),L=e[11].footer&&(!0!==e[2]||e[12])&&Je(e),R=e[1]&&qe(e);return{c(){t=A("div"),n=A("div"),v&&v.c(),r=Y(),o=A("div"),i=A("input"),c=Y(),d=A("div"),x.c(),u=Y(),k&&k.c(),h=Y(),E&&E.c(),f=Y(),L&&L.c(),p=Y(),R&&R.c(),s(i,"type","checkbox"),s(i,"id",l=e[4]+"_checkbox"),i.required=a="onsubmit"!==e[0],s(i,"class","svelte-ddsc3z"),s(o,"class","altcha-checkbox svelte-ddsc3z"),Oe(o,"altcha-hidden",e[6]===b.VERIFYING),s(d,"class","altcha-label svelte-ddsc3z"),s(n,"class","altcha-main svelte-ddsc3z"),s(t,"class","altcha svelte-ddsc3z"),s(t,"data-state",e[6]),s(t,"data-floating",e[1])},m(s,l){$(s,t,l),_(t,n),v&&v.m(n,null),_(n,r),_(n,o),_(o,i),i.checked=e[7],_(n,c),_(n,d),x.m(d,null),_(n,u),k&&k.m(n,null),_(t,h),E&&E.m(t,null),_(t,f),L&&L.m(t,null),_(t,p),R&&R.m(t,null),e[38](t),g||(m=[xe(i,"change",e[36]),xe(i,"change",e[13]),xe(i,"invalid",e[14])],g=!0)},p(e,c){e[6]===b.VERIFYING?v||(v=Pe(),v.c(),v.m(n,r)):v&&(v.d(1),v=null),16&c[0]&&l!==(l=e[4]+"_checkbox")&&s(i,"id",l),1&c[0]&&a!==(a="onsubmit"!==e[0])&&(i.required=a),128&c[0]&&(i.checked=e[7]),64&c[0]&&Oe(o,"altcha-hidden",e[6]===b.VERIFYING),w===(w=y(e))&&x?x.p(e,c):(x.d(1),x=w(e),x&&(x.c(),x.m(d,null))),!0!==e[3]||e[12]?k?k.p(e,c):(k=Ye(e),k.c(),k.m(n,null)):k&&(k.d(1),k=null),e[10]||e[6]===b.EXPIRED?E?E.p(e,c):(E=Ke(e),E.c(),E.m(t,f)):E&&(E.d(1),E=null),e[11].footer&&(!0!==e[2]||e[12])?L?L.p(e,c):(L=Je(e),L.c(),L.m(t,p)):L&&(L.d(1),L=null),e[1]?R?R.p(e,c):(R=qe(e),R.c(),R.m(t,null)):R&&(R.d(1),R=null),64&c[0]&&s(t,"data-state",e[6]),2&c[0]&&s(t,"data-floating",e[1])},i:ie,o:ie,d(n){n&&j(t),v&&v.d(),x.d(),k&&k.d(),E&&E.d(),L&&L.d(),R&&R.d(),e[38](null),g=!1,fe(m)}}}const Qe="Visit Altcha.org",ct="https://altcha.org/";function et(e){return JSON.parse(e)}function lr(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function sr(e,t,n){var r,o;let i,s,l,a,{auto:c}=t,{blockspam:d}=t,{challengeurl:u}=t,{challengejson:h}=t,{debug:f=!1}=t,{delay:p=0}=t,{expire:$}=t,{floating:g}=t,{floatinganchor:m}=t,{floatingoffset:v}=t,{hidefooter:y=!1}=t,{hidelogo:w=!1}=t,{name:x="altcha"}=t,{maxnumber:k=1e6}=t,{mockerror:E=!1}=t,{refetchonexpire:L=!0}=t,{spamfilter:R=!1}=t,{strings:C}=t,{test:_=!1}=t,{verifyurl:z}=t,{workers:A=Math.min(16,navigator.hardwareConcurrency||8)}=t,{workerurl:I}=t;const j=Tt(),N=["SHA-256","SHA-384","SHA-512"],S=null==(o=null==(r=document.documentElement.lang)?void 0:r.split("-"))?void 0:o[0];let U,Z=!1,M=null,O=null,Y=null,V=null,T=null,F=b.UNVERIFIED,G=null;function D(...e){(f||e.some((e=>e instanceof Error)))&&console[e[0]instanceof Error?"error":"log"]("ALTCHA",...e)}function H(e){F===b.UNVERIFIED&&ae()}function P(e){Y&&"onsubmit"===c&&(F===b.UNVERIFIED?(e.preventDefault(),e.stopPropagation(),ae().then((()=>{null==Y||Y.requestSubmit()}))):F!==b.VERIFIED&&(e.preventDefault(),e.stopPropagation(),F===b.VERIFYING&&ee()))}function X(){le()}function B(e,t){return btoa(JSON.stringify({algorithm:e.algorithm,challenge:e.challenge,number:t.number,salt:e.salt,signature:e.signature,test:!!_||void 0,took:t.took}))}function W(e){if(!e.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(void 0===e.signature)throw new Error("Invalid challenge. Property signature is missing.");if(!N.includes(e.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${N.join(", ")}`);if(!e.challenge||e.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!e.salt||e.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}function K(){u&&L&&F===b.VERIFIED?ae():le(b.EXPIRED,a.expired)}async function J(e){let t=null;if("Worker"in window){try{t=await async function(e,t,n,r=("number"==typeof _?_:k),o=Math.ceil(A)){const i=[];o=Math.min(16,Math.max(1,o));for(let e=0;e{const l=o*s;return new Promise((o=>{r.addEventListener("message",(e=>{if(e.data)for(const e of i)e!==r&&e.postMessage({type:"abort"});o(e.data)})),r.postMessage({payload:{alg:n,challenge:e,max:l+s,salt:t,start:l},type:"work"})}))})));for(const e of i)e.terminate();return l.find((e=>!!e))||null}(e.challenge,e.salt,e.algorithm,e.maxnumber)}catch(e){D(e)}if(void 0!==(null==t?void 0:t.number))return{data:e,solution:t}}return{data:e,solution:await qt(e.challenge,e.salt,e.algorithm,e.maxnumber||k).promise}}function q(e){const t=e.target;g&&t&&!U.contains(t)&&F===b.VERIFIED&&n(8,U.style.display="none",U)}function Q(){g&&ie()}function ee(){F===b.VERIFYING&&a.waitAlert&&alert(a.waitAlert)}function te(){g&&ie()}function ne(e){D("expire",e),G&&(clearTimeout(G),G=null),e<1?K():G=setTimeout(K,e)}function re(e){D("floating",e),g!==e&&(n(8,U.style.left="",U),n(8,U.style.top="",U)),n(1,g=!0===e||""===e?"auto":!1===e||"false"===e?void 0:g),g?(c||n(0,c="onsubmit"),document.addEventListener("scroll",Q),document.addEventListener("click",q),window.addEventListener("resize",te)):"onsubmit"===c&&n(0,c=void 0)}async function oe(e){if(!z)throw new Error("Attribute verifyurl not set.");D("requesting server verification from",z);const t={payload:e};if(R){const{blockedCountries:e,classifier:n,disableRules:r,email:o,expectedLanguages:i,expectedCountries:s,fields:l,ipAddress:a,text:c,timeZone:d}="ipAddress"===R?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:"object"==typeof R?R:{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0};t.blockedCountries=e,t.classifier=n,t.disableRules=r,t.email=!1===o?void 0:function(e){var t;const n=null==Y?void 0:Y.querySelector("string"==typeof e?`input[name="${e}"]`:'input[type="email"]:not([data-no-spamfilter])');return(null==(t=null==n?void 0:n.value)?void 0:t.slice(n.value.indexOf("@")))||void 0}(o),t.expectedCountries=s,t.expectedLanguages=i||(S?[S]:void 0),t.fields=!1===l?void 0:function(e){return[...(null==Y?void 0:Y.querySelectorAll(null!=e&&e.length?e.map((e=>`input[name="${e}"]`)).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce(((e,t)=>{const n=t.name,r=t.value;return n&&r&&(e[n]=/\n/.test(r)?r.replace(new RegExp("(?i:"top"===g,a=Math.max(e,Math.min(s-e-o.width,r.left+r.width/2-o.width/2));if(n(8,U.style.top=l?r.top-(o.height+t)+"px":`${r.bottom+t}px`,U),n(8,U.style.left=`${a}px`,U),U.setAttribute("data-floating",l?"top":"bottom"),M){const e=M.getBoundingClientRect();n(9,M.style.left=r.left-a+r.width/2-e.width/2+"px",M)}}else D("unable to find floating anchor element")}function se(e){void 0!==e.auto&&(n(0,c=e.auto),"onload"===c&&ae()),void 0!==e.floatinganchor&&n(19,m=e.floatinganchor),void 0!==e.delay&&n(17,p=e.delay),void 0!==e.floatingoffset&&n(20,v=e.floatingoffset),void 0!==e.floating&&re(e.floating),void 0!==e.expire&&(ne(e.expire),n(18,$=e.expire)),e.challenge&&(W(e.challenge),s=e.challenge),void 0!==e.challengeurl&&n(15,u=e.challengeurl),void 0!==e.debug&&n(16,f=!!e.debug),void 0!==e.hidefooter&&n(2,y=!!e.hidefooter),void 0!==e.hidelogo&&n(3,w=!!e.hidelogo),void 0!==e.maxnumber&&n(21,k=+e.maxnumber),void 0!==e.mockerror&&n(22,E=!!e.mockerror),void 0!==e.name&&n(4,x=e.name),void 0!==e.refetchonexpire&&n(23,L=!!e.refetchonexpire),void 0!==e.spamfilter&&n(24,R="object"==typeof e.spamfilter?e.spamfilter:!!e.spamfilter),e.strings&&n(35,l=e.strings),void 0!==e.test&&n(25,_="number"==typeof e.test?e.test:!!e.test),void 0!==e.verifyurl&&n(26,z=e.verifyurl),void 0!==e.workers&&n(27,A=+e.workers),void 0!==e.workerurl&&n(28,I=e.workerurl)}function le(e=b.UNVERIFIED,t=null){G&&(clearTimeout(G),G=null),n(7,Z=!1),n(10,V=t),n(5,T=null),n(6,F=e)}async function ae(){return le(b.VERIFYING),await new Promise((e=>setTimeout(e,p||0))),async function(){var e;if(E)throw D("mocking error"),new Error("Mocked error.");if(s)return D("using provided json data"),s;if(_)return D("generating test challenge",{test:_}),Jt("boolean"!=typeof _?+_:void 0);{if(!u)throw new Error("Attribute challengeurl not set.");D("fetching challenge from",u);const t=await fetch(u,{headers:{"x-altcha-spam-filter":R?"1":"0"}});if(200!==t.status)throw new Error(`Server responded with ${t.status}.`);const n=t.headers.get("Expires"),r=t.headers.get("X-Altcha-Config"),o=await t.json(),i=new URLSearchParams(null==(e=o.salt.split("?"))?void 0:e[1]),s=i.get("expires")||i.get("expire");if(s){const e=new Date(1e3*+s),t=isNaN(e.getTime())?0:e.getTime()-Date.now();t>0&&ne(t)}if(r)try{const e=JSON.parse(r);e&&"object"==typeof e&&(e.verifyurl&&(e.verifyurl=new URL(e.verifyurl,new URL(u)).toString()),se(e))}catch(e){D("unable to configure from X-Altcha-Config",e)}if(!$&&null!=n&&n.length){const e=Date.parse(n);if(e){const t=e-Date.now();t>0&&ne(t)}}return o}}().then((e=>(W(e),D("challenge",e),J(e)))).then((({data:e,solution:t})=>{if(D("solution",t),void 0===(null==t?void 0:t.number))throw D("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.");if(z)return oe(B(e,t));n(5,T=B(e,t)),D("payload",T)})).then((()=>{Vt().then((()=>{n(6,F=b.VERIFIED),n(7,Z=!0),D("verified"),j("verified",{payload:T})}))})).catch((e=>{D(e),n(6,F=b.ERROR),n(7,Z=!1),n(10,V=e.message)}))}return Mt((()=>{Y&&(Y.removeEventListener("submit",P),Y.removeEventListener("reset",X),Y.removeEventListener("focusin",H),Y=null),G&&(clearTimeout(G),G=null),document.removeEventListener("click",q),document.removeEventListener("scroll",Q),window.removeEventListener("resize",te)})),jt((()=>{D("mounted","0.6.7"),D("workers",A),_&&D("using test mode"),$&&ne($),void 0!==c&&D("auto",c),void 0!==g&&re(g),Y=U.closest("form"),Y&&(Y.addEventListener("submit",P,{capture:!0}),Y.addEventListener("reset",X),"onfocus"===c&&Y.addEventListener("focusin",H)),"onload"===c&&ae(),i&&(y||w)&&D("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.")})),e.$$set=e=>{"auto"in e&&n(0,c=e.auto),"blockspam"in e&&n(29,d=e.blockspam),"challengeurl"in e&&n(15,u=e.challengeurl),"challengejson"in e&&n(30,h=e.challengejson),"debug"in e&&n(16,f=e.debug),"delay"in e&&n(17,p=e.delay),"expire"in e&&n(18,$=e.expire),"floating"in e&&n(1,g=e.floating),"floatinganchor"in e&&n(19,m=e.floatinganchor),"floatingoffset"in e&&n(20,v=e.floatingoffset),"hidefooter"in e&&n(2,y=e.hidefooter),"hidelogo"in e&&n(3,w=e.hidelogo),"name"in e&&n(4,x=e.name),"maxnumber"in e&&n(21,k=e.maxnumber),"mockerror"in e&&n(22,E=e.mockerror),"refetchonexpire"in e&&n(23,L=e.refetchonexpire),"spamfilter"in e&&n(24,R=e.spamfilter),"strings"in e&&n(31,C=e.strings),"test"in e&&n(25,_=e.test),"verifyurl"in e&&n(26,z=e.verifyurl),"workers"in e&&n(27,A=e.workers),"workerurl"in e&&n(28,I=e.workerurl)},e.$$.update=()=>{32768&e.$$.dirty[0]&&n(12,i=!(null==u||!u.includes(".altcha.org")||null==u||!u.includes("apiKey=ckey_"))),1073741824&e.$$.dirty[0]&&(s=h?et(h):void 0),1&e.$$.dirty[1]&&n(35,l=C?et(C):{}),16&e.$$.dirty[1]&&n(11,a={ariaLinkLabel:Qe,error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:`Protected by ALTCHA`,label:"I'm not a robot",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait.",...l}),96&e.$$.dirty[0]&&j("statechange",{payload:T,state:F}),64&e.$$.dirty[0]&&g&&F!==b.UNVERIFIED&&requestAnimationFrame((()=>{ie()}))},[c,g,y,w,x,T,F,Z,U,M,V,a,i,function(){[b.UNVERIFIED,b.ERROR,b.EXPIRED].includes(F)?R&&!1===(null==Y?void 0:Y.reportValidity())?n(7,Z=!1):ae():n(7,Z=!0)},ee,u,f,p,$,m,v,k,E,L,R,_,z,A,I,d,h,C,se,le,ae,l,function(){Z=this.checked,n(7,Z)},function(e){we[e?"unshift":"push"]((()=>{M=e,n(9,M)}))},function(e){we[e?"unshift":"push"]((()=>{U=e,n(8,U)}))}]}class cr extends Wt{constructor(e){super(),Ht(this,e,sr,or,Ct,{auto:0,blockspam:29,challengeurl:15,challengejson:30,debug:16,delay:17,expire:18,floating:1,floatinganchor:19,floatingoffset:20,hidefooter:2,hidelogo:3,name:4,maxnumber:21,mockerror:22,refetchonexpire:23,spamfilter:24,strings:31,test:25,verifyurl:26,workers:27,workerurl:28,configure:32,reset:33,verify:34},Qt,[-1,-1,-1])}get auto(){return this.$$.ctx[0]}set auto(e){this.$$set({auto:e}),y()}get blockspam(){return this.$$.ctx[29]}set blockspam(e){this.$$set({blockspam:e}),y()}get challengeurl(){return this.$$.ctx[15]}set challengeurl(e){this.$$set({challengeurl:e}),y()}get challengejson(){return this.$$.ctx[30]}set challengejson(e){this.$$set({challengejson:e}),y()}get debug(){return this.$$.ctx[16]}set debug(e){this.$$set({debug:e}),y()}get delay(){return this.$$.ctx[17]}set delay(e){this.$$set({delay:e}),y()}get expire(){return this.$$.ctx[18]}set expire(e){this.$$set({expire:e}),y()}get floating(){return this.$$.ctx[1]}set floating(e){this.$$set({floating:e}),y()}get floatinganchor(){return this.$$.ctx[19]}set floatinganchor(e){this.$$set({floatinganchor:e}),y()}get floatingoffset(){return this.$$.ctx[20]}set floatingoffset(e){this.$$set({floatingoffset:e}),y()}get hidefooter(){return this.$$.ctx[2]}set hidefooter(e){this.$$set({hidefooter:e}),y()}get hidelogo(){return this.$$.ctx[3]}set hidelogo(e){this.$$set({hidelogo:e}),y()}get name(){return this.$$.ctx[4]}set name(e){this.$$set({name:e}),y()}get maxnumber(){return this.$$.ctx[21]}set maxnumber(e){this.$$set({maxnumber:e}),y()}get mockerror(){return this.$$.ctx[22]}set mockerror(e){this.$$set({mockerror:e}),y()}get refetchonexpire(){return this.$$.ctx[23]}set refetchonexpire(e){this.$$set({refetchonexpire:e}),y()}get spamfilter(){return this.$$.ctx[24]}set spamfilter(e){this.$$set({spamfilter:e}),y()}get strings(){return this.$$.ctx[31]}set strings(e){this.$$set({strings:e}),y()}get test(){return this.$$.ctx[25]}set test(e){this.$$set({test:e}),y()}get verifyurl(){return this.$$.ctx[26]}set verifyurl(e){this.$$set({verifyurl:e}),y()}get workers(){return this.$$.ctx[27]}set workers(e){this.$$set({workers:e}),y()}get workerurl(){return this.$$.ctx[28]}set workerurl(e){this.$$set({workerurl:e}),y()}get configure(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get verify(){return this.$$.ctx[34]}}customElements.define("altcha-widget",Ot(cr,{auto:{},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)),globalThis.createAltchaWorker=e=>e?new Worker(new URL(e)):new Et;export{cr as Altcha};
\ No newline at end of file
diff --git a/readme.txt b/readme.txt
index 3ffc805..06abc49 100644
--- a/readme.txt
+++ b/readme.txt
@@ -2,8 +2,8 @@
Tags: altcha, captcha, spam, anti-spam, anti-bot, antispam, recaptcha, hcaptcha, gdpr
Author: Altcha.org
Author URI: https://altcha.org
-Version: 1.3.1
-Stable tag: 1.3.1
+Version: 1.4.0
+Stable tag: 1.4.0
Requires at least: 5.0
Requires PHP: 7.3
Tested up to: 6.6
@@ -63,6 +63,7 @@ This plugin requires the WordPress REST API. If you are using any "Disable REST
== Supported Integrations ==
* Contact Form 7
+* Elementor Pro Forms
* Forminator
* GravityForms
* HTML Forms
@@ -93,6 +94,10 @@ All source code for the plugin, and the ALTCHA widget is available on GitHub. In
== Changelog ==
+= 1.4.0 =
+* Support for Elementor Pro Forms
+* Widget updated to 0.6.7
+
= 1.3.1 =
* Fix site_url parsing issue [#11]