From c312e2d21fe1999d81fa6b9da938299284a5d678 Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Tue, 10 Nov 2026 16:16:06 -0400 Subject: [PATCH 1/4] feat(captcha): add built-in ALTCHA support --- classes/controllers/FrmAltchaController.php | 314 +++++++++++++++ classes/controllers/FrmAppController.php | 1 + classes/controllers/FrmCronController.php | 2 + classes/controllers/FrmHooksController.php | 9 + classes/factories/FrmCaptchaFactory.php | 1 + classes/helpers/FrmAltchaChallengeHelper.php | 381 ++++++++++++++++++ classes/helpers/FrmAltchaHelper.php | 177 ++++++++ classes/helpers/FrmAltchaReplayHelper.php | 241 +++++++++++ classes/helpers/FrmAltchaSettingsHelper.php | 68 ++++ classes/helpers/FrmAltchaUsageHelper.php | 43 ++ classes/models/FrmAltchaSettings.php | 164 ++++++++ classes/models/FrmSettings.php | 71 +++- classes/models/fields/FrmFieldCaptcha.php | 15 +- .../frm-fields/back-end/field-captcha.php | 7 +- .../frm-settings/captcha/altcha-option.php | 45 +++ classes/views/frm-settings/captcha/altcha.php | 119 ++++++ .../views/frm-settings/captcha/captcha.php | 17 +- css/altcha.css | 1 + images/altcha-no-footer.svg | 1 + images/altcha.svg | 1 + js/altcha.js | 1 + js/altcha/THIRD-PARTY-NOTICES.txt | 28 ++ js/altcha/i18n/af.js | 1 + js/altcha/i18n/am.js | 1 + js/altcha/i18n/ar.js | 1 + js/altcha/i18n/az.js | 1 + js/altcha/i18n/be.js | 1 + js/altcha/i18n/bg.js | 1 + js/altcha/i18n/bn.js | 1 + js/altcha/i18n/bs.js | 1 + js/altcha/i18n/ca.js | 1 + js/altcha/i18n/cs.js | 1 + js/altcha/i18n/da.js | 1 + js/altcha/i18n/de.js | 1 + js/altcha/i18n/el.js | 1 + js/altcha/i18n/es-419.js | 1 + js/altcha/i18n/es-es.js | 1 + js/altcha/i18n/et.js | 1 + js/altcha/i18n/eu.js | 1 + js/altcha/i18n/fa.js | 1 + js/altcha/i18n/fi.js | 1 + js/altcha/i18n/fr-ca.js | 1 + js/altcha/i18n/fr-fr.js | 1 + js/altcha/i18n/ga.js | 1 + js/altcha/i18n/he.js | 1 + js/altcha/i18n/hi.js | 1 + js/altcha/i18n/hr.js | 1 + js/altcha/i18n/hu.js | 1 + js/altcha/i18n/hy.js | 1 + js/altcha/i18n/id.js | 1 + js/altcha/i18n/is.js | 1 + js/altcha/i18n/it.js | 1 + js/altcha/i18n/ja.js | 1 + js/altcha/i18n/ka.js | 1 + js/altcha/i18n/kk.js | 1 + js/altcha/i18n/ko.js | 1 + js/altcha/i18n/lb.js | 1 + js/altcha/i18n/lt.js | 1 + js/altcha/i18n/lv.js | 1 + js/altcha/i18n/me.js | 1 + js/altcha/i18n/mk.js | 1 + js/altcha/i18n/mr.js | 1 + js/altcha/i18n/mt.js | 1 + js/altcha/i18n/nb.js | 1 + js/altcha/i18n/nl.js | 1 + js/altcha/i18n/pl.js | 1 + js/altcha/i18n/pt-br.js | 1 + js/altcha/i18n/pt-pt.js | 1 + js/altcha/i18n/ro.js | 1 + js/altcha/i18n/ru.js | 1 + js/altcha/i18n/sk.js | 1 + js/altcha/i18n/sl.js | 1 + js/altcha/i18n/sq.js | 1 + js/altcha/i18n/sr.js | 1 + js/altcha/i18n/sv.js | 1 + js/altcha/i18n/sw.js | 1 + js/altcha/i18n/ta.js | 1 + js/altcha/i18n/te.js | 1 + js/altcha/i18n/th.js | 1 + js/altcha/i18n/tk.js | 1 + js/altcha/i18n/tr.js | 1 + js/altcha/i18n/uk.js | 1 + js/altcha/i18n/ur.js | 1 + js/altcha/i18n/uz.js | 1 + js/altcha/i18n/vi.js | 1 + js/altcha/i18n/yo.js | 1 + js/altcha/i18n/zh-cn.js | 1 + js/altcha/i18n/zh-hk.js | 1 + js/altcha/i18n/zh-tw.js | 1 + js/src/altcha-field.js | 270 +++++++++++++ package-lock.json | 16 + package.json | 1 + resources/scss/altcha.scss | 36 ++ tests/phpunit/altcha/FrmAltchaTestHelper.php | 85 ++++ tests/phpunit/altcha/test_FrmAltchaAssets.php | 92 +++++ .../altcha/test_FrmAltchaChallengeHelper.php | 194 +++++++++ .../phpunit/altcha/test_FrmAltchaDefaults.php | 101 +++++ .../altcha/test_FrmAltchaReplayHelper.php | 196 +++++++++ tests/phpunit/altcha/test_FrmAltchaSubmit.php | 279 +++++++++++++ .../altcha/test_FrmAltchaUsageHelper.php | 42 ++ .../altcha/test_FrmAltchaVisitorSettings.php | 58 +++ .../phpunit/fields/test_FrmFieldValidate.php | 3 +- webpack.config.js | 11 + 103 files changed, 3137 insertions(+), 21 deletions(-) create mode 100644 classes/controllers/FrmAltchaController.php create mode 100644 classes/helpers/FrmAltchaChallengeHelper.php create mode 100644 classes/helpers/FrmAltchaHelper.php create mode 100644 classes/helpers/FrmAltchaReplayHelper.php create mode 100644 classes/helpers/FrmAltchaSettingsHelper.php create mode 100644 classes/helpers/FrmAltchaUsageHelper.php create mode 100644 classes/models/FrmAltchaSettings.php create mode 100644 classes/views/frm-settings/captcha/altcha-option.php create mode 100644 classes/views/frm-settings/captcha/altcha.php create mode 100644 css/altcha.css create mode 100644 images/altcha-no-footer.svg create mode 100644 images/altcha.svg create mode 100644 js/altcha.js create mode 100644 js/altcha/THIRD-PARTY-NOTICES.txt create mode 100644 js/altcha/i18n/af.js create mode 100644 js/altcha/i18n/am.js create mode 100644 js/altcha/i18n/ar.js create mode 100644 js/altcha/i18n/az.js create mode 100644 js/altcha/i18n/be.js create mode 100644 js/altcha/i18n/bg.js create mode 100644 js/altcha/i18n/bn.js create mode 100644 js/altcha/i18n/bs.js create mode 100644 js/altcha/i18n/ca.js create mode 100644 js/altcha/i18n/cs.js create mode 100644 js/altcha/i18n/da.js create mode 100644 js/altcha/i18n/de.js create mode 100644 js/altcha/i18n/el.js create mode 100644 js/altcha/i18n/es-419.js create mode 100644 js/altcha/i18n/es-es.js create mode 100644 js/altcha/i18n/et.js create mode 100644 js/altcha/i18n/eu.js create mode 100644 js/altcha/i18n/fa.js create mode 100644 js/altcha/i18n/fi.js create mode 100644 js/altcha/i18n/fr-ca.js create mode 100644 js/altcha/i18n/fr-fr.js create mode 100644 js/altcha/i18n/ga.js create mode 100644 js/altcha/i18n/he.js create mode 100644 js/altcha/i18n/hi.js create mode 100644 js/altcha/i18n/hr.js create mode 100644 js/altcha/i18n/hu.js create mode 100644 js/altcha/i18n/hy.js create mode 100644 js/altcha/i18n/id.js create mode 100644 js/altcha/i18n/is.js create mode 100644 js/altcha/i18n/it.js create mode 100644 js/altcha/i18n/ja.js create mode 100644 js/altcha/i18n/ka.js create mode 100644 js/altcha/i18n/kk.js create mode 100644 js/altcha/i18n/ko.js create mode 100644 js/altcha/i18n/lb.js create mode 100644 js/altcha/i18n/lt.js create mode 100644 js/altcha/i18n/lv.js create mode 100644 js/altcha/i18n/me.js create mode 100644 js/altcha/i18n/mk.js create mode 100644 js/altcha/i18n/mr.js create mode 100644 js/altcha/i18n/mt.js create mode 100644 js/altcha/i18n/nb.js create mode 100644 js/altcha/i18n/nl.js create mode 100644 js/altcha/i18n/pl.js create mode 100644 js/altcha/i18n/pt-br.js create mode 100644 js/altcha/i18n/pt-pt.js create mode 100644 js/altcha/i18n/ro.js create mode 100644 js/altcha/i18n/ru.js create mode 100644 js/altcha/i18n/sk.js create mode 100644 js/altcha/i18n/sl.js create mode 100644 js/altcha/i18n/sq.js create mode 100644 js/altcha/i18n/sr.js create mode 100644 js/altcha/i18n/sv.js create mode 100644 js/altcha/i18n/sw.js create mode 100644 js/altcha/i18n/ta.js create mode 100644 js/altcha/i18n/te.js create mode 100644 js/altcha/i18n/th.js create mode 100644 js/altcha/i18n/tk.js create mode 100644 js/altcha/i18n/tr.js create mode 100644 js/altcha/i18n/uk.js create mode 100644 js/altcha/i18n/ur.js create mode 100644 js/altcha/i18n/uz.js create mode 100644 js/altcha/i18n/vi.js create mode 100644 js/altcha/i18n/yo.js create mode 100644 js/altcha/i18n/zh-cn.js create mode 100644 js/altcha/i18n/zh-hk.js create mode 100644 js/altcha/i18n/zh-tw.js create mode 100644 js/src/altcha-field.js create mode 100644 resources/scss/altcha.scss create mode 100644 tests/phpunit/altcha/FrmAltchaTestHelper.php create mode 100644 tests/phpunit/altcha/test_FrmAltchaAssets.php create mode 100644 tests/phpunit/altcha/test_FrmAltchaChallengeHelper.php create mode 100644 tests/phpunit/altcha/test_FrmAltchaDefaults.php create mode 100644 tests/phpunit/altcha/test_FrmAltchaReplayHelper.php create mode 100644 tests/phpunit/altcha/test_FrmAltchaSubmit.php create mode 100644 tests/phpunit/altcha/test_FrmAltchaUsageHelper.php create mode 100644 tests/phpunit/altcha/test_FrmAltchaVisitorSettings.php diff --git a/classes/controllers/FrmAltchaController.php b/classes/controllers/FrmAltchaController.php new file mode 100644 index 0000000000..952479a421 --- /dev/null +++ b/classes/controllers/FrmAltchaController.php @@ -0,0 +1,314 @@ + + */ + private static $pending = array(); + + /** + * Whether ALTCHA is the active captcha type. + * + * @since x.x + * + * @return bool + */ + public static function is_active() { + return FrmCaptchaFactory::get_settings_object() instanceof FrmAltchaSettings; + } + + /** + * Load the widget instead of a remote captcha script when ALTCHA is active. + * + * Lite registers the URL under its captcha-api handle, so the widget loads once however + * many captcha fields the page has. + * + * @since x.x + * + * @return string + */ + public static function api_url() { + self::styles(); + return self::script_url(); + } + + /** + * Verify the posted solution locally instead of calling a remote service. + * + * Lite reads the result like a siteverify response. Failures keep Lite's behavior, so + * the field's error message and the CAPTCHA spam handling setting apply as usual. + * + * @since x.x + * + * @param FrmAltchaSettings $captcha_settings The active captcha type's settings. + * @param array|object $field The captcha field. + * + * @return array + */ + public static function verify_response( $captcha_settings, $field ) { + $payload = FrmAppHelper::get_post_param( $captcha_settings->token_field, '', 'sanitize_text_field' ); + $result = FrmAltchaChallengeHelper::verify( $payload ); + + if ( $result['verified'] && FrmAltchaReplayHelper::is_used( $result['id'] ) ) { + $result['verified'] = false; + $result['reason'] = 'replayed'; + } + + if ( ! $result['verified'] ) { + $code = 'missing' === $result['reason'] ? 'missing-input-response' : 'altcha-' . $result['reason']; + + return array( + 'success' => false, + 'error-codes' => array( $code ), + ); + } + + $field_id = (int) ( is_object( $field ) ? $field->id : $field['id'] ); + $form_id = (int) ( is_object( $field ) ? $field->form_id : $field['form_id'] ); + + self::$pending[ $form_id ] = array( + 'id' => $result['id'], + 'expires' => $result['expires'], + 'field_id' => $field_id, + 'message' => self::invalid_message( $field ), + ); + + return array( 'success' => true ); + } + + /** + * Spend the verified solution once the entry has no other errors. + * + * If a parallel request with the same payload spent it first, the entry is rejected. + * + * @since x.x + * + * @param array $errors Validation errors so far. + * @param array $values Submitted values, including the form ID. + * + * @return array + */ + public static function claim_solution( $errors, $values ) { + $form_id = isset( $values['form_id'] ) ? (int) $values['form_id'] : 0; + $pending = self::$pending[ $form_id ] ?? null; + + unset( self::$pending[ $form_id ] ); + + if ( null === $pending || ! is_array( $errors ) || array() !== $errors ) { + return $errors; + } + + if ( ! FrmAltchaReplayHelper::claim( $pending['id'], $pending['expires'] ) ) { + /** + * Fires when an ALTCHA solution is rejected after the rest of the entry was valid. + * + * Other rejections go through Lite's frm_captcha_validation_failed action. + * + * @since x.x + * + * @param string $reason Always replayed. + * @param object|null $field The captcha field. + */ + do_action( 'frm_altcha_validation_failed', 'replayed', FrmField::getOne( $pending['field_id'] ) ); + $errors[ 'field' . $pending['field_id'] ] = $pending['message']; + } + + return $errors; + } + + /** + * Send a fresh challenge to the widget. + * + * Challenges are random and single use, so the response must never be cached. + * + * @since x.x + * + * @return void + */ + public static function send_challenge() { + nocache_headers(); + header( 'Cache-Control: no-store, no-cache, must-revalidate, max-age=0', true ); + wp_send_json( FrmAltchaChallengeHelper::create() ); + } + + /** + * Load the widget for a form with a captcha field anywhere, so it is ready when a later page loads over AJAX. + * + * @since x.x + * + * @param array $params Form parameters, including form_id. + * + * @return void + */ + public static function maybe_enqueue_for_form( $params ) { + $form_id = is_array( $params ) && isset( $params['form_id'] ) ? (int) $params['form_id'] : 0; + + if ( 0 === $form_id || ! self::is_active() ) { + return; + } + + $field = FrmField::get_all_types_in_form( $form_id, 'captcha', 1, 'include' ); + + if ( ! is_object( $field ) && array() === $field ) { + return; + } + + self::styles(); + // The same handle and dependency Lite uses, so the script is never loaded twice. + wp_enqueue_script( 'captcha-api', self::script_url(), array( 'formidable' ), '3', true ); + } + + /** + * The widget script, versioned so a new build is never served from cache. + * + * @since x.x + * + * @return string + */ + private static function script_url() { + $url = add_query_arg( 'v', FrmAppHelper::$plug_version, FrmAppHelper::plugin_url() . '/js/altcha.js' ); + $dependencies = array( 'formidable' ); + $language = self::translation_language(); + + if ( '' !== $language ) { + $handle = 'frm-altcha-language-' . $language; + wp_register_script( $handle, FrmAppHelper::plugin_url() . '/js/altcha/i18n/' . $language . '.js', array(), FrmAppHelper::$plug_version, true ); + $dependencies[] = $handle; + } + + // Register before Lite does, so both loading paths retain the translation dependency. + wp_register_script( 'captcha-api', $url, $dependencies, '3', true ); + + return $url; + } + + /** + * Find the selected translation, falling back to the base language and then English. + * + * @since x.x + * + * @return string Translation filename without its extension, or empty for built-in English. + */ + private static function translation_language() { + $language = strtolower( str_replace( '_', '-', self::language() ) ); + + if ( ! preg_match( '/^[a-z]{2}(?:-[a-z0-9]+)*$/D', $language ) ) { + return ''; + } + + $base = explode( '-', $language )[0]; + $path = FrmAppHelper::plugin_path() . '/js/altcha/i18n/'; + $variants = array( + 'es' => 'es-es', + 'fr' => 'fr-ca', + 'pt' => 'pt-pt', + 'zh' => 'zh-cn', + ); + $fallbacks = array( $language, $base, $variants[ $base ] ?? $base ); + + foreach ( $fallbacks as $candidate ) { + if ( 'en' !== $base && is_file( $path . $candidate . '.js' ) ) { + return $candidate; + } + } + + return ''; + } + + /** + * The stylesheet that maps the active form style onto the widget. + * + * @since x.x + * + * @return void + */ + public static function styles() { + $file = 'altcha.css'; + wp_enqueue_style( 'frm-altcha', FrmAppHelper::plugin_url() . '/css/' . $file, array(), FrmAppHelper::$plug_version ); + } + + /** + * Show an ALTCHA preview in the form builder instead of a missing image. + * + * @since x.x + * + * @param string $url Preview image URL. + * @param string $image_name Active captcha type. + * + * @return string + */ + public static function builder_image_url( $url, $image_name ) { + if ( FrmAltchaSettings::TYPE !== $image_name ) { + return $url; + } + + // Match the front end, which hides the footer link when the setting is on. + $settings = FrmAltchaHelper::get_settings(); + $image = 1 === $settings['hide_footer'] ? 'altcha-no-footer.svg' : 'altcha.svg'; + + return FrmAppHelper::plugin_url() . '/images/' . $image; + } + + /** + * The widget language, from the site locale. The widget falls back to the base language, then English. + * + * @since x.x + * + * @return string + */ + public static function language() { + $language = strtolower( str_replace( '_', '-', determine_locale() ) ); + + /** + * Filters the ALTCHA widget language, such as de or pt-br. + * + * @since x.x + * + * @param string $language Language code. + */ + $filtered = apply_filters( 'frm_altcha_language', $language ); + + return is_string( $filtered ) && '' !== $filtered ? $filtered : $language; + } + + /** + * The captcha field's own error message, or the global one, like Lite. + * + * @since x.x + * + * @param array|object $field The captcha field. + * + * @return string + */ + private static function invalid_message( $field ) { + $message = FrmField::get_option( $field, 'invalid' ); + + if ( is_string( $message ) && '' !== $message ) { + return $message; + } + + $frm_settings = FrmAppHelper::get_settings(); + + return is_string( $frm_settings->re_msg ) ? $frm_settings->re_msg : ''; + } +} diff --git a/classes/controllers/FrmAppController.php b/classes/controllers/FrmAppController.php index 1c97f794f2..068af5c5c0 100644 --- a/classes/controllers/FrmAppController.php +++ b/classes/controllers/FrmAppController.php @@ -1318,6 +1318,7 @@ public static function drop_tables( $tables ) { $tables[] = $wpdb->prefix . 'frm_payments'; $tables[] = $wpdb->prefix . 'frm_subscriptions'; $tables[] = $wpdb->prefix . 'frm_gated_tokens'; + $tables[] = $wpdb->prefix . 'frm_altcha_replays'; return $tables; } diff --git a/classes/controllers/FrmCronController.php b/classes/controllers/FrmCronController.php index e520d60575..7f3314c8f9 100644 --- a/classes/controllers/FrmCronController.php +++ b/classes/controllers/FrmCronController.php @@ -27,6 +27,7 @@ private static function get_events() { return array( 'formidable_send_usage' => 'weekly', 'frm_daily_event' => 'daily', + 'frm_altcha_purge_used' => 'hourly', 'frm_payment_cron' => 'daily', ); } @@ -44,6 +45,7 @@ public static function schedule_events() { // These are scheduled in another place. unset( $events['formidable_send_usage'] ); unset( $events['frm_payment_cron'] ); + unset( $events['frm_altcha_purge_used'] ); foreach ( $events as $event => $recurrence ) { if ( ! wp_next_scheduled( $event ) ) { diff --git a/classes/controllers/FrmHooksController.php b/classes/controllers/FrmHooksController.php index 09d40e4df2..69e47a41b6 100644 --- a/classes/controllers/FrmHooksController.php +++ b/classes/controllers/FrmHooksController.php @@ -65,6 +65,12 @@ public static function load_hooks() { add_action( 'rest_api_init', 'FrmAppController::create_rest_routes', 0 ); add_filter( 'widget_text', 'do_shortcode' ); + add_action( 'frm_enqueue_form_scripts', 'FrmAltchaController::maybe_enqueue_for_form' ); + add_filter( 'frm_validate_entry', 'FrmAltchaController::claim_solution', 999, 2 ); + add_filter( 'frm_usage_snapshot', 'FrmAltchaUsageHelper::add_snapshot_data' ); + add_action( FrmAltchaReplayHelper::PURGE_HOOK, 'FrmAltchaReplayHelper::purge' ); + add_action( 'frm_after_uninstall', 'FrmAltchaReplayHelper::uninstall' ); + // Entries controller. add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 ); add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 ); @@ -153,6 +159,7 @@ public static function load_hooks() { * @return void */ public static function load_admin_hooks() { + add_action( 'frm_update_settings', 'FrmAltchaSettingsHelper::update' ); add_action( 'admin_menu', 'FrmAppController::menu', 1 ); add_filter( 'admin_body_class', 'FrmAppController::add_admin_class', 999 ); add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' ); @@ -267,6 +274,8 @@ public static function load_admin_hooks() { * @return void */ public static function load_ajax_hooks() { + add_action( 'wp_ajax_frm_altcha_challenge', 'FrmAltchaController::send_challenge' ); + add_action( 'wp_ajax_nopriv_frm_altcha_challenge', 'FrmAltchaController::send_challenge' ); add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' ); add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' ); add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' ); diff --git a/classes/factories/FrmCaptchaFactory.php b/classes/factories/FrmCaptchaFactory.php index b20aa33421..0e17df1683 100644 --- a/classes/factories/FrmCaptchaFactory.php +++ b/classes/factories/FrmCaptchaFactory.php @@ -38,6 +38,7 @@ public static function get_settings_object( $captcha_type = 'active' ) { */ private static function get_settings_class( $active_captcha ) { $settings_classes = array( + 'altcha' => 'FrmAltchaSettings', 'recaptcha' => 'FrmRecaptchaSettings', 'hcaptcha' => 'FrmHcaptchaSettings', 'turnstile' => 'FrmTurnstileSettings', diff --git a/classes/helpers/FrmAltchaChallengeHelper.php b/classes/helpers/FrmAltchaChallengeHelper.php new file mode 100644 index 0000000000..466be44fce --- /dev/null +++ b/classes/helpers/FrmAltchaChallengeHelper.php @@ -0,0 +1,381 @@ +, signature: string} + */ + public static function create( $args = array() ) { + $settings = FrmAltchaHelper::get_settings(); + $levels = FrmAltchaHelper::difficulty_levels(); + $defaults = array( + 'max_number' => $levels[ $settings['difficulty'] ], + 'expires' => $settings['expires'] * MINUTE_IN_SECONDS, + 'cost' => self::COST, + ); + + /** + * Filters the proof-of-work settings for a new ALTCHA challenge. + * + * @since x.x + * + * @param array $args { + * + * @type int $max_number Largest secret counter. Visitors try about half of this on average. + * @type int $expires Seconds before the challenge expires. + * @type int $cost PBKDF2 iterations per guess. + * } + */ + $args = apply_filters( 'frm_altcha_challenge_args', array_merge( $defaults, $args ) ); + + $max_number = max( 1, min( self::MAX_COUNTER, (int) $args['max_number'] ) ); + $cost = max( 1, (int) $args['cost'] ); + $counter = isset( $args['counter'] ) ? (int) $args['counter'] : random_int( (int) ceil( $max_number / 2 ), $max_number ); + $nonce = random_bytes( 16 ); + $salt = random_bytes( 16 ); + $key = self::derive_key( $nonce, $salt, $counter, $cost ); + + $parameters = array( + 'algorithm' => self::ALGORITHM, + 'cost' => $cost, + 'expiresAt' => time() + max( 1, (int) $args['expires'] ), + 'keyLength' => self::KEY_LENGTH, + 'keyPrefix' => bin2hex( substr( $key, 0, intdiv( self::KEY_LENGTH, 2 ) ) ), + 'keySignature' => self::hmac( $key, 'key' ), + 'nonce' => bin2hex( $nonce ), + 'salt' => bin2hex( $salt ), + ); + + return array( + 'parameters' => $parameters, + 'signature' => self::hmac( self::canonical_json( $parameters ), 'signature' ), + ); + } + + /** + * Verify a payload submitted by the widget. + * + * This checks the signature, expiry and solution only. Replay protection is separate, see + * FrmAltchaReplayHelper, so a payload can be checked before it is spent. + * + * @since x.x + * + * @param mixed $payload Base64 encoded JSON from the widget's hidden input. + * + * @return array{verified: bool, reason: string, id: string, expires: int} + */ + public static function verify( $payload ) { + $result = array( + 'verified' => false, + 'reason' => 'malformed', + 'id' => '', + 'expires' => 0, + ); + + if ( ! is_string( $payload ) || '' === $payload ) { + $result['reason'] = 'missing'; + return $result; + } + + $data = self::decode_payload( $payload ); + + if ( false === $data ) { + return $result; + } + + $parameters = $data['challenge']['parameters']; + $signature = $data['challenge']['signature']; + $solution = $data['solution']; + + // The ID is derived from the signature, which is unique per challenge, for the replay guard. + $result['id'] = hash( 'sha256', $signature ); + $result['expires'] = (int) $parameters['expiresAt']; + + if ( ! hash_equals( self::hmac( self::canonical_json( $parameters ), 'signature' ), $signature ) ) { + $result['reason'] = 'invalid-signature'; + return $result; + } + + // Only reject an expired challenge after the signature proves the expiry is genuine. + if ( $result['expires'] < time() ) { + $result['reason'] = 'expired'; + return $result; + } + + $derived_key = hex2bin( $solution['derivedKey'] ); + + if ( false === $derived_key || ! hash_equals( (string) $parameters['keySignature'], self::hmac( $derived_key, 'key' ) ) ) { + $result['reason'] = 'invalid-solution'; + return $result; + } + + $result['verified'] = true; + $result['reason'] = ''; + + return $result; + } + + /** + * Decode and shape-check a payload. Anything unexpected is rejected before any HMAC work. + * + * @since x.x + * + * @param string $payload Base64 encoded JSON. + * + * @return array|false + */ + private static function decode_payload( $payload ) { + if ( strlen( $payload ) > self::MAX_PAYLOAD_LENGTH ) { + return false; + } + + $json = base64_decode( $payload, true ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + + if ( false === $json ) { + return false; + } + + $data = json_decode( $json, true, 5 ); + + if ( ! is_array( $data ) || ! isset( $data['challenge'], $data['solution'] ) || ! is_array( $data['challenge'] ) || ! is_array( $data['solution'] ) ) { + return false; + } + + $challenge = $data['challenge']; + + if ( ! isset( $challenge['parameters'], $challenge['signature'] ) || ! is_array( $challenge['parameters'] ) || ! self::is_hex( $challenge['signature'], 64 ) ) { + return false; + } + + if ( ! self::valid_parameters( $challenge['parameters'] ) ) { + return false; + } + + $solution = $data['solution']; + $counter = $solution['counter'] ?? null; + + if ( ! is_int( $counter ) || $counter < 0 || $counter > self::MAX_COUNTER || ! self::is_hex( $solution['derivedKey'] ?? null, self::KEY_LENGTH * 2 ) ) { + return false; + } + + return $data; + } + + /** + * Check that the parameters are the ones this class issues, with the expected types. + * + * The signature check is what proves they are genuine. This only stops type juggling. + * + * @since x.x + * + * @param array $parameters Challenge parameters from the payload. + * + * @return bool + */ + private static function valid_parameters( $parameters ) { + $expected = array( 'algorithm', 'cost', 'expiresAt', 'keyLength', 'keyPrefix', 'keySignature', 'nonce', 'salt' ); + $keys = array_keys( $parameters ); + sort( $keys ); + + if ( $keys !== $expected ) { + return false; + } + + return self::ALGORITHM === $parameters['algorithm'] + && self::KEY_LENGTH === $parameters['keyLength'] + && is_int( $parameters['cost'] ) + && is_int( $parameters['expiresAt'] ) + && self::is_hex( $parameters['keyPrefix'], self::KEY_LENGTH ) + && self::is_hex( $parameters['keySignature'], 64 ) + && self::is_hex( $parameters['nonce'], 32 ) + && self::is_hex( $parameters['salt'], 32 ); + } + + /** + * Whether a value is a lowercase hex string of an exact length. + * + * @since x.x + * + * @param mixed $value Value to check. + * @param int $length Expected number of hex characters. + * + * @return bool + */ + private static function is_hex( $value, $length ) { + return is_string( $value ) && strlen( $value ) === $length && 1 === preg_match( '/^[0-9a-f]+$/', $value ); + } + + /** + * Derive the key the widget searches for. Matches the widget's PBKDF2 worker in uint32 counter mode. + * + * @since x.x + * + * @param string $nonce Raw nonce bytes. + * @param string $salt Raw salt bytes. + * @param int $counter Secret counter. + * @param int $cost PBKDF2 iterations. + * + * @return string Raw key bytes. + */ + public static function derive_key( $nonce, $salt, $counter, $cost ) { + // The password is the nonce followed by the counter as a big-endian 32-bit integer. + return hash_pbkdf2( 'sha256', $nonce . pack( 'N', $counter ), $salt, $cost, self::KEY_LENGTH, true ); + } + + /** + * JSON with sorted keys, the same canonical form the ALTCHA libraries sign. + * + * @since x.x + * + * @param array $parameters Challenge parameters. + * + * @return string + */ + private static function canonical_json( $parameters ) { + ksort( $parameters ); + return (string) wp_json_encode( $parameters, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); + } + + /** + * HMAC-SHA256 as hex, with a purpose-specific key derived from the site secret. + * + * Separate keys for the parameter signature and the key signature mean one can never + * be passed off as the other. + * + * @since x.x + * + * @param string $data Data to sign. + * @param string $purpose Either 'signature' or 'key'. + * + * @return string + */ + private static function hmac( $data, $purpose ) { + $key = hash_hmac( 'sha256', 'frm-altcha-' . $purpose, self::secret(), true ); + return hash_hmac( 'sha256', $data, $key ); + } + + /** + * The site's master secret, created on first use. It is never output. + * + * @since x.x + * + * @return string + */ + private static function secret() { + $secret = get_option( self::SECRET_OPTION ); + + if ( is_string( $secret ) && 64 === strlen( $secret ) ) { + return $secret; + } + + $secret = bin2hex( random_bytes( 32 ) ); + + if ( add_option( self::SECRET_OPTION, $secret, '', false ) ) { + return $secret; + } + + // Another request created the secret first, so use that one. + wp_cache_delete( self::SECRET_OPTION, 'options' ); + $stored = get_option( self::SECRET_OPTION ); + + if ( is_string( $stored ) && 64 === strlen( $stored ) ) { + return $stored; + } + + // The stored value is unusable, so replace it. + update_option( self::SECRET_OPTION, $secret, false ); + + return $secret; + } +} diff --git a/classes/helpers/FrmAltchaHelper.php b/classes/helpers/FrmAltchaHelper.php new file mode 100644 index 0000000000..c81a5370d8 --- /dev/null +++ b/classes/helpers/FrmAltchaHelper.php @@ -0,0 +1,177 @@ + + */ + public static function difficulty_levels() { + return array( + 'low' => 8000, + 'medium' => 20000, + 'high' => 60000, + ); + } + + /** + * Labels for the difficulty presets. + * + * @since x.x + * + * @return array + */ + public static function difficulty_labels() { + return array( + 'low' => __( 'Low (fastest for visitors)', 'formidable' ), + 'medium' => __( 'Medium (recommended)', 'formidable' ), + 'high' => __( 'High (strongest, slower on old phones)', 'formidable' ), + ); + } + + /** + * Labels for the widget's automatic verification modes. + * + * @since x.x + * + * @return array + */ + public static function auto_modes() { + return array( + 'onfocus' => __( 'When the visitor starts filling out the form (recommended)', 'formidable' ), + 'onload' => __( 'As soon as the form loads', 'formidable' ), + 'onsubmit' => __( 'When the form is submitted', 'formidable' ), + 'off' => __( 'Only when the visitor clicks the checkbox', 'formidable' ), + ); + } + + /** + * Visitor-facing widget layouts supported by the bundled library. + * + * @since x.x + * + * @return array + */ + public static function display_modes() { + return array( + 'standard' => __( 'Inline (default)', 'formidable' ), + 'floating' => __( 'Floating near the Submit button', 'formidable' ), + 'overlay' => __( 'Overlay', 'formidable' ), + 'bar' => __( 'Bar at the bottom of the screen', 'formidable' ), + ); + } + + /** + * Interaction styles supported by the bundled widget. + * + * @since x.x + * + * @return array + */ + public static function widget_types() { + return array( + 'checkbox' => __( 'Checkbox (default)', 'formidable' ), + 'switch' => __( 'Toggle switch', 'formidable' ), + 'native' => __( 'Browser checkbox', 'formidable' ), + ); + } + + /** + * Default settings. + * + * @since x.x + * + * @return array{difficulty: string, expires: int, auto: string, hide_footer: int, display: string, widget_type: string, hide_logo: int} + */ + public static function default_settings() { + return array( + 'difficulty' => 'medium', + 'expires' => 20, + 'auto' => 'onfocus', + 'hide_footer' => 0, + 'display' => 'standard', + 'widget_type' => 'checkbox', + 'hide_logo' => 0, + ); + } + + /** + * Saved settings, validated and merged with the defaults. + * + * @since x.x + * + * @return array{difficulty: string, expires: int, auto: string, hide_footer: int, display: string, widget_type: string, hide_logo: int} + */ + public static function get_settings() { + $saved = get_option( self::SETTINGS_OPTION, array() ); + return self::sanitize_settings( is_array( $saved ) ? $saved : array() ); + } + + /** + * Clamp raw settings to allowed values, falling back to the defaults. + * + * @since x.x + * + * @param array $raw Unsanitized settings. + * + * @return array{difficulty: string, expires: int, auto: string, hide_footer: int, display: string, widget_type: string, hide_logo: int} + */ + public static function sanitize_settings( $raw ) { + $defaults = self::default_settings(); + $difficulty = isset( $raw['difficulty'] ) && is_string( $raw['difficulty'] ) ? $raw['difficulty'] : ''; + $auto = isset( $raw['auto'] ) && is_string( $raw['auto'] ) ? $raw['auto'] : ''; + $display = isset( $raw['display'] ) && is_string( $raw['display'] ) ? $raw['display'] : ''; + $type = isset( $raw['widget_type'] ) && is_string( $raw['widget_type'] ) ? $raw['widget_type'] : ''; + $expires = isset( $raw['expires'] ) && is_numeric( $raw['expires'] ) ? (int) $raw['expires'] : $defaults['expires']; + + return array( + 'difficulty' => array_key_exists( $difficulty, self::difficulty_levels() ) ? $difficulty : $defaults['difficulty'], + 'expires' => max( 1, min( 1440, $expires ) ), + 'auto' => array_key_exists( $auto, self::auto_modes() ) ? $auto : $defaults['auto'], + 'hide_footer' => 1 === (int) ( $raw['hide_footer'] ?? 0 ) ? 1 : 0, + 'display' => array_key_exists( $display, self::display_modes() ) ? $display : $defaults['display'], + 'widget_type' => array_key_exists( $type, self::widget_types() ) ? $type : $defaults['widget_type'], + 'hide_logo' => in_array( $raw['hide_logo'] ?? 0, array( 1, '1', true ), true ) ? 1 : 0, + ); + } + + /** + * URL the widget fetches a fresh challenge from. + * + * An admin-ajax endpoint is used rather than a REST route, because security plugins + * often block the REST API for visitors who are not logged in. + * + * @since x.x + * + * @return string + */ + public static function challenge_url() { + return add_query_arg( 'action', 'frm_altcha_challenge', admin_url( 'admin-ajax.php' ) ); + } +} diff --git a/classes/helpers/FrmAltchaReplayHelper.php b/classes/helpers/FrmAltchaReplayHelper.php new file mode 100644 index 0000000000..94f2b1975d --- /dev/null +++ b/classes/helpers/FrmAltchaReplayHelper.php @@ -0,0 +1,241 @@ + + */ + private static $ready_tables = array(); + + /** + * Get the replay table for the current site. + * + * @since x.x + * + * @return string + */ + public static function table_name() { + global $wpdb; + return $wpdb->prefix . 'frm_altcha_replays'; + } + + /** + * Check storage without creating a table on sites that have not used ALTCHA. + * + * @since x.x + * + * @return bool + */ + private static function table_exists() { + $table = self::table_name(); + + if ( isset( self::$ready_tables[ $table ] ) ) { + return true; + } + + global $wpdb; + $exists = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table ) ) ); + + if ( null !== $exists ) { + self::$ready_tables[ $table ] = true; + } + + return null !== $exists; + } + + /** + * Create replay storage only while claiming the first solved challenge. + * + * @since x.x + * + * @return bool + */ + private static function create_table() { + global $wpdb; + $table = self::table_name(); + $created = $wpdb->query( + $wpdb->prepare( + 'CREATE TABLE IF NOT EXISTS %i ( + challenge_hash binary(32) NOT NULL, + expires_at BIGINT UNSIGNED NOT NULL, + PRIMARY KEY (challenge_hash), + KEY expires_at (expires_at) + )', + $table + ) + ); + + if ( false === $created ) { + return false; + } + + self::$ready_tables[ $table ] = true; + return true; + } + + /** + * Whether a challenge was already spent. + * + * @since x.x + * + * @param string $id Challenge ID from FrmAltchaChallengeHelper::verify(). + * + * @return bool + */ + public static function is_used( $id ) { + if ( ! self::is_valid_id( $id ) ) { + return false; + } + + /** @var wpdb $wpdb */ + global $wpdb; + + if ( ! self::table_exists() ) { + return false; + } + + // Not FrmDb::get_var(), which caches the result. A challenge claimed earlier in the same + // request, or by a parallel request, must never read as unused. + + $found = $wpdb->get_var( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + $wpdb->prepare( 'SELECT 1 FROM %i WHERE challenge_hash = UNHEX(%s)', $wpdb->prefix . 'frm_altcha_replays', $id ) + ); + + return null !== $found; + } + + /** + * Mark a challenge as spent. + * + * @since x.x + * + * @param string $id Challenge ID from FrmAltchaChallengeHelper::verify(). + * @param int $expires Unix time the challenge expires. The row can be deleted after that. + * + * @return bool False when the challenge was already spent. + */ + public static function claim( $id, $expires ) { + if ( ! self::is_valid_id( $id ) ) { + return false; + } + + /** @var wpdb $wpdb */ + global $wpdb; + + if ( ! self::table_exists() && ! self::create_table() ) { + return false; + } + + $inserted = $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + $wpdb->prepare( + 'INSERT IGNORE INTO %i (challenge_hash, expires_at) VALUES (UNHEX(%s), %d)', + $wpdb->prefix . 'frm_altcha_replays', + $id, + $expires + ) + ); + + if ( 1 === $inserted && false === wp_next_scheduled( self::PURGE_HOOK ) ) { + wp_schedule_event( time() + HOUR_IN_SECONDS, 'hourly', self::PURGE_HOOK ); + } + + return 1 === $inserted; + } + + /** + * Delete expired challenges in indexed batches to keep each delete small. + * + * @since x.x + * + * @return void + */ + public static function purge() { + if ( ! self::table_exists() ) { + wp_clear_scheduled_hook( self::PURGE_HOOK ); + return; + } + + /** @var wpdb $wpdb */ + global $wpdb; + + $now = time(); + + do { + $deleted = $wpdb->query( + $wpdb->prepare( + 'DELETE FROM %i WHERE expires_at < %d ORDER BY expires_at LIMIT %d', + $wpdb->prefix . 'frm_altcha_replays', + $now, + self::PURGE_BATCH_SIZE + ) + ); + } while ( self::PURGE_BATCH_SIZE === $deleted ); + } + + /** + * Remove optional replay storage when Formidable is uninstalled. + * + * @since x.x + * + * @return void + */ + public static function uninstall() { + global $wpdb; + $table = self::table_name(); + $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $table ) ); + unset( self::$ready_tables[ $table ] ); + wp_clear_scheduled_hook( self::PURGE_HOOK ); + } + + /** + * Require a SHA-256 hex digest before converting it to a binary database key. + * + * @since x.x + * + * @param string $id Challenge ID from the verified payload. + * + * @return bool + */ + private static function is_valid_id( $id ) { + return is_string( $id ) && 1 === preg_match( '/^[0-9a-f]{64}$/D', $id ); + } +} diff --git a/classes/helpers/FrmAltchaSettingsHelper.php b/classes/helpers/FrmAltchaSettingsHelper.php new file mode 100644 index 0000000000..f0fe94a109 --- /dev/null +++ b/classes/helpers/FrmAltchaSettingsHelper.php @@ -0,0 +1,68 @@ + Captcha/Spam, with its settings panel. + * + * @since x.x + */ +class FrmAltchaSettingsHelper { + + /** + * Print the ALTCHA tab next to reCAPTCHA, hCaptcha and Turnstile. + * + * @since x.x + * + * @param FrmSettings $frm_settings Global settings. + * + * @return void + */ + public static function type_option( $frm_settings ) { + $is_active = FrmAltchaSettings::TYPE === $frm_settings->active_captcha; + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/altcha-option.php'; + } + + /** + * Print the ALTCHA settings panel, shown while ALTCHA is the selected captcha type. + * + * @since x.x + * + * @param FrmSettings $frm_settings Global settings. + * + * @return void + */ + public static function settings_panel( $frm_settings ) { + $is_active = FrmAltchaSettings::TYPE === $frm_settings->active_captcha; + $settings = FrmAltchaHelper::get_settings(); + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/altcha.php'; + } + + /** + * Save the settings with the rest of Global Settings. + * + * Lite checks the settings nonce and the frm_change_settings capability before this runs. + * + * @since x.x + * + * @param array $params Posted Global Settings. + * + * @return void + */ + public static function update( $params ) { + if ( ! is_array( $params ) || ! isset( $params['frm_altcha'] ) || ! is_array( $params['frm_altcha'] ) || ! current_user_can( 'frm_change_settings' ) ) { + return; + } + + // Lite passes the posted settings already unslashed. + $raw = map_deep( $params['frm_altcha'], 'sanitize_text_field' ); + update_option( FrmAltchaHelper::SETTINGS_OPTION, FrmAltchaHelper::sanitize_settings( $raw ), false ); + } +} diff --git a/classes/helpers/FrmAltchaUsageHelper.php b/classes/helpers/FrmAltchaUsageHelper.php new file mode 100644 index 0000000000..adcd3b0c69 --- /dev/null +++ b/classes/helpers/FrmAltchaUsageHelper.php @@ -0,0 +1,43 @@ + FrmAppHelper::$plug_version, + 'active' => FrmAltchaController::is_active() ? 1 : 0, + 'captcha_fields' => FrmDb::get_count( 'frm_fields', array( 'type' => 'captcha' ) ), + 'difficulty' => $settings['difficulty'], + 'expires' => $settings['expires'], + 'auto' => $settings['auto'], + 'hide_footer' => $settings['hide_footer'], + ); + + return $snapshot; + } +} diff --git a/classes/models/FrmAltchaSettings.php b/classes/models/FrmAltchaSettings.php new file mode 100644 index 0000000000..52e446334f --- /dev/null +++ b/classes/models/FrmAltchaSettings.php @@ -0,0 +1,164 @@ +secret = ''; + } + + /** + * @since x.x + * + * @return string + */ + public function get_name() { + return 'ALTCHA'; + } + + /** + * The element class, which also names the posted response: frm-altcha-response. + * + * @since x.x + * + * @return string + */ + public function get_element_class_name() { + return 'frm-altcha'; + } + + /** + * @since x.x + * + * @return string + */ + public function get_documentation_url() { + return 'https://altcha.org/'; + } + + /** + * @since x.x + * + * @return string + */ + public function get_settings_prefix() { + return 'altcha_'; + } + + /** + * ALTCHA needs no site key, so it is always ready. Lite only shows a captcha with a key. + * + * @since x.x + * + * @return string + */ + public function get_pubkey() { + return self::TYPE; + } + + /** + * The widget has a single size. + * + * @since x.x + * + * @return bool + */ + public function should_show_captcha_size() { + return false; + } + + /** + * The widget follows the form style instead of a light or dark theme. + * + * @since x.x + * + * @return bool + */ + public function should_show_captcha_theme() { + return false; + } + + /** + * Replace the site key attributes with what js/src/altcha-field.js needs to build the widget. + * + * @since x.x + * + * @param array $attributes Element attributes. + * @param array $field The captcha field. + * + * @return array + */ + public function add_front_end_element_attributes( $attributes, $field ) { + unset( $attributes['data-sitekey'] ); + + $settings = FrmAltchaHelper::get_settings(); + $configuration = array( + 'display' => $settings['display'], + 'type' => $settings['widget_type'], + 'hideLogo' => 1 === $settings['hide_logo'], + 'hideFooter' => 1 === $settings['hide_footer'], + 'validationMessage' => __( 'Please verify that you are not a robot.', 'formidable' ), + ); + + $attributes['data-name'] = $this->token_field; + $attributes['data-challenge'] = FrmAltchaHelper::challenge_url(); + $attributes['data-auto'] = $settings['auto']; + $attributes['data-language'] = FrmAltchaController::language(); + $attributes['data-configuration'] = (string) wp_json_encode( $configuration ); + + return $attributes; + } + + /** + * Explain ALTCHA's own failure codes in stored spam entries. + * + * @since x.x + * + * @return array + */ + public function get_error_code_messages() { + return array_merge( + parent::get_error_code_messages(), + array( + 'altcha-malformed' => __( 'The ALTCHA response was not in the expected format.', 'formidable' ), + 'altcha-invalid-signature' => __( 'The ALTCHA challenge was not issued by this site or was changed.', 'formidable' ), + 'altcha-expired' => __( 'The ALTCHA challenge expired.', 'formidable' ), + 'altcha-invalid-solution' => __( 'The ALTCHA proof of work was wrong.', 'formidable' ), + 'altcha-replayed' => __( 'The ALTCHA solution was already used.', 'formidable' ), + ) + ); + } +} diff --git a/classes/models/FrmSettings.php b/classes/models/FrmSettings.php index a5611e5d54..078ade30bb 100644 --- a/classes/models/FrmSettings.php +++ b/classes/models/FrmSettings.php @@ -91,6 +91,15 @@ class FrmSettings { */ public $active_captcha; + /** + * Whether a CAPTCHA type has been saved since ALTCHA became available. + * + * @since x.x + * + * @var bool + */ + public $captcha_type_selected = false; + /** * Settings for reCAPTCHA. */ @@ -507,6 +516,37 @@ private function fill_captcha_settings() { if ( ! isset( $this->re_threshold ) ) { $this->re_threshold = .5; } + + if ( ! $this->captcha_type_selected ) { + $this->maybe_default_to_altcha(); + } + } + + /** + * Use ALTCHA for older settings whose active provider has no configured keys. + * + * @since x.x + * + * @return void + */ + private function maybe_default_to_altcha() { + if ( 'altcha' === $this->active_captcha ) { + return; + } + + $prefixes = array( + 'recaptcha' => '', + 'hcaptcha' => 'hcaptcha_', + 'turnstile' => 'turnstile_', + ); + + $prefix = $prefixes[ $this->active_captcha ] ?? ''; + $pubkey = $prefix . 'pubkey'; + $privkey = $prefix . 'privkey'; + + if ( empty( $this->$pubkey ) && empty( $this->$privkey ) ) { + $this->active_captcha = 'altcha'; + } } /** @@ -612,21 +652,22 @@ private function keep_unposted_spam_handling( $params ) { * @return void */ private function update_settings( $params ) { - $this->active_captcha = $params['frm_active_captcha']; - $this->pubkey = trim( $params['frm_pubkey'] ); - $this->privkey = trim( $params['frm_privkey'] ); - $this->re_type = $params['frm_re_type']; - $this->re_lang = $params['frm_re_lang']; - $this->re_threshold = floatval( $params['frm_re_threshold'] ); - $this->hcaptcha_pubkey = trim( $params['frm_hcaptcha_pubkey'] ); - $this->hcaptcha_privkey = trim( $params['frm_hcaptcha_privkey'] ); - $this->turnstile_pubkey = trim( $params['frm_turnstile_pubkey'] ); - $this->turnstile_privkey = trim( $params['frm_turnstile_privkey'] ); - $this->load_style = $params['frm_load_style']; - $this->custom_css = $params['frm_custom_css']; - $this->default_email = $params['frm_default_email']; - $this->from_email = $params['frm_from_email']; - $this->currency = $params['frm_currency']; + $this->captcha_type_selected = true; + $this->active_captcha = $params['frm_active_captcha']; + $this->pubkey = trim( $params['frm_pubkey'] ); + $this->privkey = trim( $params['frm_privkey'] ); + $this->re_type = $params['frm_re_type']; + $this->re_lang = $params['frm_re_lang']; + $this->re_threshold = floatval( $params['frm_re_threshold'] ); + $this->hcaptcha_pubkey = trim( $params['frm_hcaptcha_pubkey'] ); + $this->hcaptcha_privkey = trim( $params['frm_hcaptcha_privkey'] ); + $this->turnstile_pubkey = trim( $params['frm_turnstile_pubkey'] ); + $this->turnstile_privkey = trim( $params['frm_turnstile_privkey'] ); + $this->load_style = $params['frm_load_style']; + $this->custom_css = $params['frm_custom_css']; + $this->default_email = $params['frm_default_email']; + $this->from_email = $params['frm_from_email']; + $this->currency = $params['frm_currency']; if ( isset( $params['frm_spam_handling'] ) ) { $this->spam_handling = FrmSpamEntriesHelper::sanitize_handling( $params['frm_spam_handling'] ); diff --git a/classes/models/fields/FrmFieldCaptcha.php b/classes/models/fields/FrmFieldCaptcha.php index 3ff7c7e906..705ca6383f 100644 --- a/classes/models/fields/FrmFieldCaptcha.php +++ b/classes/models/fields/FrmFieldCaptcha.php @@ -191,6 +191,10 @@ protected function api_url() { $frm_settings = FrmAppHelper::get_settings(); $active_mode = $frm_settings->active_captcha; + if ( 'altcha' === $active_mode ) { + return FrmAltchaController::api_url(); + } + if ( 'recaptcha' === $active_mode ) { return $this->recaptcha_api_url( $frm_settings ); } @@ -633,7 +637,16 @@ protected function should_validate() { */ protected function send_api_check() { $captcha_settings = FrmCaptchaFactory::get_settings_object(); - $arg_array = array( + + if ( $captcha_settings instanceof FrmAltchaSettings ) { + return array( + 'body' => wp_json_encode( + FrmAltchaController::verify_response( $captcha_settings, $this->field ) + ) + ); + } + + $arg_array = array( 'body' => array( 'secret' => $captcha_settings->secret, 'response' => FrmAppHelper::get_param( $captcha_settings->token_field, '', 'post', 'sanitize_text_field' ), diff --git a/classes/views/frm-fields/back-end/field-captcha.php b/classes/views/frm-fields/back-end/field-captcha.php index 36a9921da0..1b420e8b99 100644 --- a/classes/views/frm-fields/back-end/field-captcha.php +++ b/classes/views/frm-fields/back-end/field-captcha.php @@ -23,6 +23,11 @@ $image_name = FrmFieldCaptcha::get_captcha_image_name(); $extension = 'turnstile' === $image_name ? 'gif' : 'png'; +$image_url = FrmAppHelper::plugin_url() . '/images/' . $image_name . '.' . $extension; + +if ( 'altcha' === $image_name ) { + $image_url = FrmAltchaController::builder_image_url( $image_url, $image_name ); +} ?> -<?php echo esc_attr( $image_name ); ?> +<?php echo esc_attr( $image_name ); ?> diff --git a/classes/views/frm-settings/captcha/altcha-option.php b/classes/views/frm-settings/captcha/altcha-option.php new file mode 100644 index 0000000000..1c60903b41 --- /dev/null +++ b/classes/views/frm-settings/captcha/altcha-option.php @@ -0,0 +1,45 @@ + 'radio', + 'name' => 'frm_active_captcha', + 'id' => 'frm-altcha', + 'value' => FrmAltchaSettings::TYPE, + 'data-frmhide' => '#recaptcha_settings,#hcaptcha_settings,#turnstile_settings', + 'data-frmshow' => '#altcha_settings', +); + +if ( $is_active ) { + $radio_attrs['checked'] = 'checked'; +} + +$label_attrs = array( + 'for' => 'frm-altcha', + 'id' => 'frm-altcha-tab', + 'role' => 'tab', + 'tabindex' => $is_active ? '0' : '-1', + 'aria-selected' => $is_active ? 'true' : 'false', + 'aria-controls' => 'altcha_settings', +); +?> + /> +> + + + diff --git a/classes/views/frm-settings/captcha/altcha.php b/classes/views/frm-settings/captcha/altcha.php new file mode 100644 index 0000000000..c04b971c5c --- /dev/null +++ b/classes/views/frm-settings/captcha/altcha.php @@ -0,0 +1,119 @@ + 'altcha_settings', + 'class' => $is_active ? '' : 'frm_hidden', + 'role' => 'tabpanel', + 'aria-labelledby' => 'frm-altcha-tab', +); + +$hide_footer_attrs = array( + 'type' => 'checkbox', + 'name' => 'frm_altcha[hide_footer]', + 'id' => 'frm_altcha_hide_footer', + 'value' => '1', +); + +if ( 1 === $settings['hide_footer'] ) { + $hide_footer_attrs['checked'] = 'checked'; +} + +$hide_logo_attrs = array( + 'type' => 'checkbox', + 'name' => 'frm_altcha[hide_logo]', + 'id' => 'frm_altcha_hide_logo', + 'value' => '1', +); + +if ( 1 === $settings['hide_logo'] ) { + $hide_logo_attrs['checked'] = 'checked'; +} +?> +> +
+ + + + +

+ +

+
+

+ + +

+

+ + +

+ +

+ + +

+ +

+ + +

+ +

+ + +

+ +

+ +

+

+ +

+
+
+ diff --git a/classes/views/frm-settings/captcha/captcha.php b/classes/views/frm-settings/captcha/captcha.php index fe0eb6e741..f7d8390168 100644 --- a/classes/views/frm-settings/captcha/captcha.php +++ b/classes/views/frm-settings/captcha/captcha.php @@ -1,4 +1,12 @@

- active_captcha, 'recaptcha' ); ?> /> + + active_captcha, 'recaptcha' ); ?> /> - active_captcha, 'hcaptcha' ); ?> /> + active_captcha, 'hcaptcha' ); ?> /> - active_captcha, 'turnstile' ); ?> /> + active_captcha, 'turnstile' ); ?> />
'recaptcha_settings', 'role' => 'tabpanel', diff --git a/css/altcha.css b/css/altcha.css new file mode 100644 index 0000000000..13d08efe50 --- /dev/null +++ b/css/altcha.css @@ -0,0 +1 @@ +.with_frm_style .frm-altcha-widget{--altcha-border-color: var(--border-color, #d0d0d0);--altcha-border-radius: var(--border-radius, 6px);--altcha-color-base: var(--bg-color, #fff);--altcha-color-base-content: var(--text-color, #1e1e1e);--altcha-color-primary: var(--submit-bg-color, #2c4ccf);--altcha-color-primary-content: var(--submit-text-color, #fff);--altcha-color-error: var(--border-color-error, #b94a48);--altcha-checkbox-border-color: var(--border-color, #98a2b3);--altcha-max-width: 100%;display:block}.with_frm_style .frm_form_field .frm-altcha-widget .altcha-checkbox input[type=checkbox]:not(:checked){border-color:var(--altcha-checkbox-border-color);box-shadow:none}.with_frm_style .frm_form_field .frm-altcha-widget .altcha[data-state] .altcha-checkbox input[type=checkbox]:checked:focus{background-color:var(--altcha-color-success);border-color:var(--altcha-color-success)} diff --git a/images/altcha-no-footer.svg b/images/altcha-no-footer.svg new file mode 100644 index 0000000000..ee1b40ea38 --- /dev/null +++ b/images/altcha-no-footer.svg @@ -0,0 +1 @@ +I'm not a robot diff --git a/images/altcha.svg b/images/altcha.svg new file mode 100644 index 0000000000..b84f0d5b13 --- /dev/null +++ b/images/altcha.svg @@ -0,0 +1 @@ +I'm not a robotProtected by ALTCHA diff --git a/js/altcha.js b/js/altcha.js new file mode 100644 index 0000000000..6f635c8591 --- /dev/null +++ b/js/altcha.js @@ -0,0 +1 @@ +(()=>{"use strict";var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,a=Object.keys,o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,u=Object.getPrototypeOf,f=Object.isExtensible;const d=()=>{};function h(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const p=512,v=1024,g=2048,m=4096,b=8192,y=16384,w=32768,x=1<<25,_=65536,k=1<<17,$=1<<19,S=65536,E=1<<21,C=1<<23,A=Symbol("$state"),T=Symbol("component"),P=Symbol("legacy props"),L=Symbol(""),R=Symbol("attributes"),O=Symbol("class"),I=Symbol("style"),M=Symbol("text"),H=Symbol("form reset"),N=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},U=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function D(e){return e===this.v}function V(e,t){return e!=e?t==t:e!==t||null!==e&&"object"==typeof e||"function"==typeof e}function j(e){return!V(e,this.v)}const z={},B=Symbol("uninitialized"),F="http://www.w3.org/1999/xhtml";let K=null;function q(e){K=e}function G(e,t=!1,n){K={p:K,i:!1,c:null,e:null,s:e,x:null,r:Nt,l:null}}function Y(e){var t=K,n=t.e;if(null!==n)for(var r of(t.e=null,n))dn(r);return void 0!==e&&(t.x=e),t.i=!0,K=t.p,W(e)}function W(e={}){return o(e,T,{value:!0}),e}let J=[];function X(){var e=J;J=[],function(e){for(var t=0;t{t===J&&X()})}J.push(e)}function Q(){for(;J.length>0;)X()}function ee(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let te,ne=!1;function re(e){ne=e}function ae(e){if(null===e)throw ee(),z;return te=e}function oe(){return ae(xe(te))}function ie(e){if(ne){if(null!==xe(te))throw ee(),z;te=e}}function le(e=1){if(ne){for(var t=e,n=te;t--;)n=xe(n);te=n}}function se(e=!0){for(var t=0,n=te;;){if(8===n.nodeType){var r=n.data;if("]"===r){if(0===t)return n;t-=1}else("["===r||"[!"===r||"["===r[0]&&!isNaN(Number(r.slice(1))))&&(t+=1)}var a=xe(n);e&&n.remove(),n=a}}function ce(e){if(!e||8!==e.nodeType)throw ee(),z;return e.data}function ue(t){if("object"!=typeof t||null===t||A in t||T in t)return t;const n=u(t);if(n!==s&&n!==c)return t;var r=new Map,a=e(t),o=St(0),l=qt,f=e=>{if(qt===l)return e();var t=It,n=qt;Ht(null),Gt(l);var r=e();return Ht(t),Gt(n),r};return a&&r.set("length",St(t.length)),new Proxy(t,{defineProperty(e,t,n){"value"in n&&!1!==n.configurable&&!1!==n.enumerable&&!1!==n.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var a=r.get(t);return void 0===a?f(()=>{var e=St(n.value);return r.set(t,e),e}):Ct(a,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(void 0===n){if(t in e){const e=f(()=>St(B));r.set(t,e),Tt(o)}}else Ct(n,B),Tt(o);return!0},get(e,n,a){if(n===A)return t;var o=r.get(n),l=n in e;if(void 0!==o||l&&!i(e,n)?.writable||(o=f(()=>St(ue(l?e[n]:B))),r.set(n,o)),void 0!==o){var s=rn(o);return s===B?void 0:s}return Reflect.get(e,n,a)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&"value"in n){var a=r.get(t);a&&(n.value=rn(a))}else if(void 0===n){var o=r.get(t),i=o?.v;if(void 0!==o&&i!==B)return{enumerable:!0,configurable:!0,value:i,writable:!0}}return n},has(e,t){if(t===A)return!0;var n=r.get(t),a=void 0!==n&&n.v!==B||Reflect.has(e,t);return!((void 0!==n||null!==Nt&&(!a||i(e,t)?.writable))&&(void 0===n&&(n=f(()=>St(a?ue(e[t]):B)),r.set(t,n)),rn(n)===B))&&a},set(e,t,n,l){var s=r.get(t),c=t in e;if(a&&"length"===t)for(var u=n;uSt(B)),r.set(u+"",d))}void 0===s?c&&!i(e,t)?.writable||(Ct(s=f(()=>St(void 0)),ue(n)),r.set(t,s)):(c=s.v!==B,Ct(s,f(()=>ue(n))));var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(l,n),!c){if(a&&"string"==typeof t){var p=r.get("length"),v=Number(t);Number.isInteger(v)&&v>=p.v&&Ct(p,v+1)}Tt(o)}return!0},ownKeys(e){rn(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return void 0===t||t.v!==B});for(var[n,a]of r)a.v===B||n in e||t.push(n);return t},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function fe(e){try{if(null!==e&&"object"==typeof e&&A in e)return e[A]}catch{}return e}function de(e,t){return Object.is(fe(e),fe(t))}var he,pe,ve,ge,me;function be(){if(void 0===he){he=window,pe=document,ve=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ge=i(t,"firstChild").get,me=i(t,"nextSibling").get,f(e)&&(e[O]=void 0,e[R]=null,e[I]=void 0,e.__e=void 0),f(n)&&(n[M]=void 0)}}function ye(e=""){return document.createTextNode(e)}function we(e){return ge.call(e)}function xe(e){return me.call(e)}function _e(e,t){if(!ne)return we(e);var n=we(te);if(null===n)n=te.appendChild(ye());else if(t&&3!==n.nodeType){var r=ye();return n?.before(r),ae(r),r}return t&&Ce(n),ae(n),n}function ke(e,t=!1){if(!ne){var n=we(e);return n instanceof Comment&&""===n.data?xe(n):n}if(t){if(3!==te?.nodeType){var r=ye();return te?.before(r),ae(r),r}Ce(te)}return te}function $e(e,t=!1){if(!ne)return we(e);var n=_e(e,t);return ie(e),n}function Se(e,t=1,n=!1){let r=ne?te:e;for(var a;t--;)a=r,r=xe(r);if(!ne)return r;if(n){if(3!==r?.nodeType){var o=ye();return null===r?a?.after(o):r.before(o),ae(o),o}Ce(r)}return ae(r),r}function Ee(e,t,n){return null==t||t===F?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function Ce(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;null!==t&&3===t.nodeType;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Ae(e,t){if(null===t||0===(t.f&y)){for(;null!==t;){if(128&t.f&&!(33570816&t.f)){if(0===(t.f&w))throw e;try{return void t.b.error(e)}catch(t){e=t}}t=t.parent}throw e}}const Te=-7169;function Pe(e,t){e.f=e.f&Te|t}function Le(e){0!==(e.f&p)||null===e.deps?Pe(e,v):Pe(e,m)}function Re(e){if(null!==e)for(const t of e)2&t.f&&0!==(t.f&S)&&(t.f^=S,Re(t.deps))}function Oe(e,t,n){0!==(e.f&g)?t.add(e):0!==(e.f&m)&&n.add(e),Re(e.deps),Pe(e,v)}function Ie(e,t,n){if(null==e)return t(void 0),d;const r=ln(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const Me=[];function He(e,t=d){let n=null;const r=new Set;function a(t){if(V(e,t)&&(e=t,n)){const t=!Me.length;for(const t of r)t[1](),Me.push(t,e);if(t){for(let e=0;e{r.delete(s),0===r.size&&n&&(n(),n=null)}}}}function Ne(e){let t;return Ie(e,e=>t=e)(),t}let Ue=Symbol("unmounted");function De(e,t,n){const r=n[t]??={store:null,source:Et(void 0),unsubscribe:d};if(r.store!==e&&!(Ue in n))if(r.unsubscribe(),r.store=e??null,null==e)r.source.v=void 0,r.unsubscribe=d;else{var a=!0;r.unsubscribe=Ie(e,e=>{a?r.source.v=e:Ct(r.source,e)}),a=!1}return e&&Ue in n?Ne(e):rn(r.source)}function Ve(e,t){if(t){const t=document.body;e.autofocus=!0,Z(()=>{document.activeElement===t&&e.focus()})}}let je=!1;function ze(){je||(je=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[H]?.()})},{capture:!0}))}function Be(e){var t=It,n=Nt;Ht(null),Ut(null);try{return e()}finally{Ht(t),Ut(n)}}function Fe(e,t,n,r){const a=Ge;var o=e.filter(e=>!e.settled),i=t.map(a);if(0!==n.length||0!==o.length){var l,s,c,u,f=Nt,d=(l=Nt,s=It,c=K,u=nt,function(e=!0){Ut(l),Ht(s),q(c),e&&0===(l.f&y)&&(u?.activate(),u?.apply())}),h=1===o.length?o[0].promise:o.length>1?Promise.all(o.map(e=>e.promise)):null,p=qe();0!==n.length?h?h.then(()=>{d(),g(),Ke()}):g():h.then(()=>v([])).finally(p)}else r(i);function v(e){if(0===(f.f&y)){d();try{r([...i,...e])}catch(e){Ae(e,f)}Ke()}}function g(){Promise.all(n.map(e=>We(e))).then(v).catch(e=>Ae(e,f)).finally(p)}}function Ke(e=!0){Ut(null),Ht(null),q(null),e&&nt?.deactivate()}function qe(){var e=Nt,t=e.b,n=nt,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Ge(e){return null!==Nt&&(Nt.f|=$),{ctx:K,deps:null,effects:null,equals:D,f:2050,fn:e,reactions:null,rv:0,v:B,wv:0,parent:Nt,ac:null}}const Ye=Symbol("obsolete");function We(e,t,n){let r=Nt;null===r&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var a=void 0,o=$t(B),i=!It,l=new Set;return function(e){sn(4718592,e)}(()=>{var t=Nt,n=h();a=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==N&&n.reject(e)}).finally(Ke)}catch(e){n.reject(e),Ke()}var s=nt;if(i){if(0!==(t.f&w))var c=qe();if(r.b?.is_rendered())s.async_deriveds.get(t)?.reject(Ye);else for(const e of l.values())e.reject(Ye);l.add(n),s.async_deriveds.set(t,n)}const u=(e,t=void 0)=>{c?.(),l.delete(n),t!==Ye&&(s.activate(),t?(o.f|=C,At(o,t)):(0!==(o.f&C)&&(o.f^=C),At(o,e)),s.deactivate())};n.promise.then(u,e=>u(null,e||"unknown"))}),un(()=>{for(const e of l)e.reject(Ye)}),new Promise(e=>{!function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}(a)})}function Je(e){const t=Ge(e);return Vt(t),t}function Xe(e){var t,n=Nt,r=e.parent;if(!Rt&&null!==r&&e.v!==B&&24576&r.f)return console.warn("https://svelte.dev/e/derived_inert"),e.v;Ut(r);try{e.f&=-65537,function(e){var t=e.effects;if(null!==t){e.effects=null;for(var n=0;nthis.schedule(e)){var n=this.#d.get(e);if(n){for(var r of(this.#d.delete(e),n.d))Pe(r,g),t(r);for(r of n.m)Pe(r,m),t(r)}this.#h.add(e)}#g(){this.#e=!0,ut++>1e3&&(this.#m(),function(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(e){Ae(e,ot)}}());for(const e of this.#u)this.#f.delete(e),Pe(e,g),this.schedule(e);for(const e of this.#f)Pe(e,m),this.schedule(e);const e=this.#s;this.#s=[],this.apply();var t=st=[],n=[],r=ct=[];for(const r of e)try{this.#b(r,t,n)}catch(e){throw wt(r),this.#v()||this.discard(),e}if(nt=null,r.length>0){var a=dt.ensure();for(const e of r)a.schedule(e)}if(st=null,ct=null,this.#v()){this.#y(n),this.#y(t);for(const[e,t]of this.#d)yt(e,t);return void(r.length>0&&nt.#g())}const o=this.#w();if(o)return this.#y(n),this.#y(t),void o.#x(this);this.#u.clear(),this.#f.clear();for(const e of this.#r)e(this);this.#r.clear(),rt=this,vt(n),vt(t),rt=null,this.#l?.resolve();var i=nt;if(0!==this.#o||0!==this.#s.length&&null===i||this.#m(),this.#s.length>0)if(null!==i){const e=i;e.#s.push(...this.#s.filter(t=>!e.#s.includes(t)))}else i=this;null!==i&&(_t.clear(),i.#g())}#b(e,t,n){e.f^=v;for(var r=e.first;null!==r;){var a=r.f,o=!!(96&a);if(!(o&&0!==(a&v)||0!==(a&b)||this.#d.has(r))&&null!==r.fn){o?r.f^=v:4&a?t.push(r):Wt(r)&&(!!(16&a)&&this.#f.add(r),tn(r));var i=r.first;if(null!==i){r=i;continue}}for(;null!==r;){var l=r.next;if(null!==l){r=l;break}r=r.parent}}}#w(){for(var e=this.#t;null!==e;){if(!e.is_fork)for(const[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e;e=e.#t}return null}#x(e){for(const[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(const[t,n]of e.async_deriveds){const e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#f);const t=e=>{var n=e.reactions;if(null!==n&&(!(2&e.f)||6144&e.f))for(const e of n){var r=e.f;if(2&r)t(e);else{var a=e;4194320&r&&!this.async_deriveds.has(a)&&(this.#f.delete(a),Pe(a,g),this.schedule(a))}}};for(const e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#m(),nt=this,this.#g()}#y(e){for(var t=0;t!u.current.get(e)[1]);if(u.#e&&0!==r.length){var a=r.filter(e=>!this.current.has(e));if(0===a.length)e&&u.discard();else if(t.length>0){if(e)for(const e of this.#h)u.unskip_effect(e,e=>{4194320&e.f?u.schedule(e):u.#y([e])});u.activate();var o=new Set,i=new Map;for(var l of t)gt(l,a,o,i);i=new Map;var s=[...u.current].filter(([e,t])=>{const n=this.current.get(e);return!n||n[0]!==t[0]||n[1]!==t[1]}).map(([e])=>e);if(s.length>0)for(const e of this.#c)155648&e.f||!mt(e,s,i)||(4194320&e.f?(Pe(e,g),u.schedule(e)):u.#u.add(e));if(u.#s.length>0&&!u.#p){for(var c of(u.apply(),u.#s))u.#b(c,[],[]);u.#s=[]}u.deactivate()}}}}increment(e,t){if(this.#o+=1,e){let e=this.#i.get(t)??0;this.#i.set(t,e+1)}}decrement(e,t){if(this.#o-=1,e){let e=this.#i.get(t)??0;1===e?this.#i.delete(t):this.#i.set(t,e-1)}this.#p||(this.#p=!0,Z(()=>{this.#p=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(const t of e)this.#u.add(t);for(const e of t)this.#f.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#a.add(e)}settled(){return(this.#l??=h()).promise}static ensure(){if(null===nt){const e=nt=new dt;lt||it||Z(()=>{e.#e||e.flush()})}return nt}apply(){at=null}schedule(e){if(ot=e,e.b?.is_pending&&16777228&e.f&&0===(e.f&w))e.b.defer_effect(e);else{for(var t=e;null!==t.parent;){var n=(t=t.parent).f;if(!(null===st||t!==Nt||null!==It&&2&It.f))return;if(96&n){if(0===(n&v))return;t.f^=v}}this.#s.push(t)}}#m(){if(this.linked){var e=this.#t,t=this.#n;null===e?et=t:e.#n=t,null===t?tt=e:t.#t=e,this.linked=!1}}}function ht(e){var t=it;it=!0;try{for(;;){if(Q(),null===nt)return;nt.flush()}}finally{it=t}}let pt=null;function vt(e){var t=e.length;if(0!==t){for(var n=0;n0)){_t.clear();for(const e of pt){if(24576&e.f)continue;const t=[e];let n=e.parent;for(;null!==n;)pt.has(n)&&(pt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){const n=t[e];24576&n.f||tn(n)}}pt.clear()}}pt=null}}function gt(e,t,n,r){if(!n.has(e)&&(n.add(e),null!==e.reactions))for(const a of e.reactions){const e=a.f;2&e?gt(a,t,n,r):4194320&e&&0===(e&g)&&mt(a,t,r)&&(Pe(a,g),bt(a))}}function mt(e,t,r){const a=r.get(e);if(void 0!==a)return a;if(null!==e.deps)for(const a of e.deps){if(n.call(t,a))return!0;if(2&a.f&&mt(a,t,r))return r.set(a,!0),!0}return r.set(e,!1),!1}function bt(e){nt.schedule(e)}function yt(e,t){if(!(32&e.f)||0===(e.f&v)){0!==(e.f&g)?t.d.push(e):0!==(e.f&m)&&t.m.push(e),Pe(e,v);for(var n=e.first;null!==n;)yt(n,t),n=n.next}}function wt(e){Pe(e,v);for(var t=e.first;null!==t;)wt(t),t=t.next}let xt=new Set;const _t=new Map;let kt=!1;function $t(e,t){return{f:0,v:e,reactions:null,equals:D,rv:0,wv:0}}function St(e,t){const n=$t(e);return Vt(n),n}function Et(e,t=!1,n=!0){const r=$t(e);return t||(r.equals=j),r}function Ct(e,t,n=!1){return null===It||Mt&&0===(It.f&k)||!(4325394&It.f)||null!==Dt&&Dt.has(e)||function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),At(e,n?ue(t):t,ct)}function At(e,t,n=null){if(!e.equals(t)){Rt?_t.set(e,t):_t.has(e)||_t.set(e,e.v);var r=dt.ensure();if(r.capture(e,t),2&e.f){const t=e;0!==(e.f&g)&&Xe(t),null===at&&Le(t)}e.wv=Yt(),Pt(e,g,n),null===Nt||0===(Nt.f&v)||96&Nt.f||(null===Bt?function(e){Bt=e}([e]):Bt.push(e)),!r.is_fork&&xt.size>0&&!kt&&function(){kt=!1;for(const e of xt){let t;0!==(e.f&v)&&Pe(e,m);try{t=Wt(e)}catch{t=!0}t&&tn(e)}xt.clear()}()}return t}function Tt(e){Ct(e,e.v+1)}function Pt(e,t,n){var r=e.reactions;if(null!==r)for(var a=r.length,o=0;oe.wv)return!0}0!==(t&p)&&null===at&&Pe(e,v)}return!1}function Jt(e,t,n=!0){var r=e.reactions;if(null!==r&&(null===Dt||!Dt.has(e)))for(var a=0;a{e.ac.abort(N)}),e.ac=null);try{e.f|=E;var u=(0,e.fn)();e.f|=w;var f=Zt(e);if(!(null===Bt||Mt||null===f||6146&e.f))for(var d=0;d0)for(t.length=zt+jt.length,r=0;r{l.ac.abort(N),l.ac=null,Pe(l,g)}),function(e){if(null!==e.effects)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),null!==t.ac&&Be(()=>{t.ac.abort(N),t.ac=null}),null!==t.fn&&(t.teardown=d),en(t,0),wn(t))}(l),en(l,0)}}function en(e,t){var n=e.deps;if(null!==n)for(var r=t;r{sn(8,()=>{e(...t.map(rn))})})}function gn(e,t=0){return sn(16|t,e)}function mn(e,t=0){return sn(16777216|t,e)}function bn(e){return sn(524320,e)}function yn(e){var t=e.teardown;if(null!==t){const n=Rt,r=It;Ot(!0),Ht(null);try{t.call(null)}catch(t){Ae(t,e.parent)}finally{Ot(n),Ht(r)}}}function wn(e,t=!1){var n=e.first;for(e.first=e.last=null;null!==n;){const e=n.ac;null!==e&&Be(()=>{e.abort(N)});var r=n.next;64&n.f?n.parent=null:xn(n,t),n=r}}function xn(e,t=!0){var n=!1;(t||262144&e.f)&&null!==e.nodes&&null!==e.nodes.end&&(_n(e.nodes.start,e.nodes.end),n=!0),e.f|=x,wn(e,t&&!n),en(e,0);var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)e.stop();yn(e),e.f^=x,e.f|=y;var a=e.parent;null!==a&&null!==a.first&&kn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function _n(e,t){for(;null!==e;){var n=e===t?null:xe(e);e.remove(),e=n}}function kn(e){var t=e.parent,n=e.prev,r=e.next;null!==n&&(n.next=r),null!==r&&(r.prev=n),null!==t&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function $n(e,t,n=!0){var r=[];e.f|=256,Sn(e,r,!0);var a=()=>{n&&xn(e),t&&t()},o=r.length;if(o>0){var i=()=>--o||a();for(var l of r)l.out(i)}else a()}function Sn(e,t,n){if(0===(e.f&b)){e.f^=b;var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)(e.is_global||n)&&t.push(e);for(var a=e.first;null!==a;){var o=a.next;64&a.f||Sn(a,t,!!(0!==(a.f&_)||32&a.f&&16&e.f)&&n),a=o}}}function En(e){e.f&=-257,Cn(e,!0)}function Cn(e,t){if(!(256&e.f)&&0!==(e.f&b)){e.f^=b,0===(e.f&v)&&(Pe(e,g),dt.ensure().schedule(e));for(var n=e.first;null!==n;){var r=n.next;Cn(n,!!(0!==(n.f&_)||32&n.f)&&t),n=r}var a=e.nodes&&e.nodes.t;if(null!==a)for(const e of a)(e.is_global||t)&&e.in()}}function An(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;null!==n;){var a=n===r?null:xe(n);t.append(n),n=a}}function Tn(e){const t={get:e=>Ne(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(Ne(t.store),{[e]:n}):Object.assign(Ne(t.store),e),t.store.set(Ne(t.store))},store:He(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:Tn({}),i18n:Tn({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("en",{ariaLinkLabel:"Altcha (official website)",cancel:"Cancel",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",enterCodeFromImage:"To proceed, please enter the code from the image below.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by ALTCHA',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."}),"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5");const Pn=Symbol("events"),Ln=new Set,Rn=new Set;function On(e,t,n,r={}){function a(e){if(r.capture||Dn.call(t,e),!e.cancelBubble)return Be(()=>n?.call(this,e))}return e.startsWith("pointer")||e.startsWith("touch")||"wheel"===e?Z(()=>{t.addEventListener(e,a,r)}):t.addEventListener(e,a,r),a}function In(e,t,n,r,a){var o={capture:r,passive:a},i=On(e,t,n,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&un(()=>{t.removeEventListener(e,i,o)})}function Mn(e,t,n){(t[Pn]??={})[e]=n}function Hn(e){for(var t=0;t{Un=!1,Nn=null}));var l=0,s=Nn===e&&e[Pn];if(s){var c=a.indexOf(s);if(-1!==c&&(t===document||t===window))return void(e[Pn]=t);var u=a.indexOf(t);if(-1===u)return;c<=u&&(l=c)}if((i=a[l]||e.target)!==t){o(e,"currentTarget",{configurable:!0,get:()=>i||n});var f=It,d=Nt;Ht(null),Ut(null);try{for(var h,p=[];null!==i&&i!==t;){try{var v=i[Pn]?.[r];null==v||i.disabled&&e.target!==i||v.call(i,e)}catch(e){h?p.push(e):h=e}if(e.cancelBubble)break;l++,i=l{throw e});throw h}}finally{e[Pn]=t,delete e.currentTarget,Ht(f),Ut(d)}}}const Vn=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function jn(e){var t=Ee("template");return t.innerHTML=function(e){return Vn?.createHTML(e)??e}(e.replaceAll("","\x3c!----\x3e")),t.content}function zn(e,t){var n=Nt;null===n.nodes&&(n.nodes={start:e,end:t,a:null,t:null})}function Bn(e,t){var n,r=!!(1&t),a=!!(2&t),o=!e.startsWith("");return()=>{if(ne)return zn(te,null),te;void 0===n&&(n=jn(o?e:""+e),r||(n=we(n)));var t=a||ve?document.importNode(n,!0):n.cloneNode(!0);return r?zn(we(t),t.lastChild):zn(t,t),t}}function Fn(e,t,n="svg"){var r,a=`<${n}>${e.startsWith("")?""+e:e}`;return()=>{if(ne)return zn(te,null),te;if(!r){var e=jn(a);r=we(we(e))}var t=r.cloneNode(!0);return zn(t,t),t}}function Kn(e,t){return Fn(e,0,"svg")}function qn(e=""){if(!ne){var t=ye(e+"");return zn(t,t),t}var n=te;return 3!==n.nodeType?(n.before(n=ye()),ae(n)):Ce(n),zn(n,n),n}function Gn(){if(ne)return zn(te,null),te;var e=document.createDocumentFragment(),t=document.createComment(""),n=ye();return e.append(t,n),zn(t,n),e}function Yn(e,t){if(ne){var n=Nt;return 0!==(n.f&w)&&null!==n.nodes.end||(n.nodes.end=te),void oe()}null!==e&&e.before(t)}function Wn(e){return e.endsWith("capture")&&"gotpointercapture"!==e&&"lostpointercapture"!==e}const Jn=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Xn(e){return Jn.includes(e)}const Zn={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Qn(e){return e=e.toLowerCase(),Zn[e]??e}const er=["touchstart","touchmove"];function tr(e){return er.includes(e)}class nr{parent;is_pending=!1;transform_error;#k;#$=ne?te:null;#S;#E;#C;#A=null;#T=null;#P=null;#L=null;#R=0;#O=0;#I=!1;#u=new Set;#f=new Set;#M=null;#H=function(e){let t,n=0,r=$t(0);return()=>{cn()&&(rn(r),pn(()=>(0===n&&(t=ln(()=>e())),n+=1,()=>{Z(()=>{n-=1,0===n&&(t?.(),t=void 0,Tt(r))})})))}}(()=>(this.#M=$t(this.#R),()=>{this.#M=null}));constructor(e,t,n,r){this.#k=e,this.#S=t,this.#E=e=>{var t=Nt;t.b=this,t.f|=128,n(e)},this.parent=Nt.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#C=gn(()=>{if(ne){const e=this.#$;oe();const t="[!"===e.data;if(e.data.startsWith("[?")){const t=JSON.parse(e.data.slice(2));this.#N(t)}else t?this.#U():this.#D()}else this.#V()},589824),ne&&(this.#k=te)}#D(){try{this.#A=bn(()=>this.#E(this.#k))}catch(e){this.error(e)}}#N(e){const t=this.#S.failed,{reset:n,invoke_onerror:r}=this.#j(e);Z(r),t&&(this.#P=bn(()=>{t(this.#k,()=>e,()=>n)}))}#j(e){var t=!1,n=!1;const r=()=>{t?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(t=!0,n&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),null!==this.#P&&$n(this.#P,()=>{this.#P=null}),this.#z(()=>{this.#V()}))};return{reset:r,invoke_onerror:()=>{try{n=!0,this.#S.onerror?.(e,r),n=!1}catch(e){Ae(e,this.#C&&this.#C.parent)}}}}#U(){const e=this.#S.pending;e&&(this.is_pending=!0,this.#T=bn(()=>e(this.#k)),Z(()=>{var e=this.#L=document.createDocumentFragment(),t=ye(),n=!1;if(e.append(t),this.#A=this.#z(()=>{try{return bn(()=>this.#E(t))}catch(e){try{this.error(e),n=!0}catch(e){Ae(e,this.#C.parent)}return null}}),null===this.#A)return this.#L=null,void(n&&this.#B(nt));0===this.#O&&(this.#k.before(e),this.#L=null,$n(this.#T,()=>{this.#T=null}),this.#B(nt))}))}#V(){try{if(this.is_pending=this.has_pending_snippet(),this.#O=0,this.#R=0,this.#A=bn(()=>{this.#E(this.#k)}),this.#O>0){var e=this.#L=document.createDocumentFragment();An(this.#A,e);const t=this.#S.pending;this.#T=bn(()=>t(this.#k))}else this.#B(nt)}catch(e){this.error(e)}}#B(e){this.is_pending=!1,e.transfer_effects(this.#u,this.#f)}defer_effect(e){Oe(e,this.#u,this.#f)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#S.pending}#z(e){var t=Nt,n=It,r=K;Ut(this.#C),Ht(this.#C),q(this.#C.ctx);try{return dt.ensure(),e()}finally{Ut(t),Ht(n),q(r)}}#F(e,t){this.has_pending_snippet()?(this.#O+=e,0===this.#O&&(this.#B(t),this.#T&&$n(this.#T,()=>{this.#T=null}),this.#L&&(this.#k.before(this.#L),this.#L=null))):this.parent&&this.parent.#F(e,t)}update_pending_count(e,t){this.#F(e,t),this.#R+=e,this.#M&&!this.#I&&(this.#I=!0,Z(()=>{this.#I=!1,this.#M&&At(this.#M,this.#R)}))}get_effect_pending(){return this.#H(),rn(this.#M)}error(e){if(!this.#S.onerror&&!this.#S.failed)throw e;nt?.is_fork?(this.#A&&nt.skip_effect(this.#A),this.#T&&nt.skip_effect(this.#T),this.#P&&nt.skip_effect(this.#P),nt.oncommit(()=>{this.#K(e)})):this.#K(e)}#K(e){this.#A&&(xn(this.#A),this.#A=null),this.#T&&(xn(this.#T),this.#T=null),this.#P&&(xn(this.#P),this.#P=null),ne&&(ae(this.#$),le(),ae(se()));let t=this.#S.failed;const n=e=>{const{reset:n,invoke_onerror:r}=this.#j(e);r(),t&&(this.#P=this.#z(()=>{try{return bn(()=>{var r=Nt;r.b=this,r.f|=128,t(this.#k,()=>e,()=>n)})}catch(e){return Ae(e,this.#C.parent),null}}))};Z(()=>{var t;try{t=this.transform_error(e)}catch(e){return void Ae(e,this.#C&&this.#C.parent)}null!==t&&"object"==typeof t&&"function"==typeof t.then?t.then(n,e=>Ae(e,this.#C&&this.#C.parent)):n(t)})}}function rr(e,t){var n=null==t?"":"object"==typeof t?`${t}`:t;n!==(e[M]??=e.nodeValue)&&(e[M]=n,e.nodeValue=`${n}`)}function ar(e,t){return lr(e,t)}function or(e,t){be(),t.intro=t.intro??!1;const n=t.target,r=ne,a=te;try{for(var o=we(n);o&&(8!==o.nodeType||"["!==o.data);)o=xe(o);if(!o)throw z;re(!0),ae(o);const r=lr(e,{...t,anchor:o});return re(!1),r}catch(r){if(r instanceof Error&&r.message.split("\n").some(e=>e.startsWith("https://svelte.dev/e/")))throw r;return r!==z&&console.warn("Failed to hydrate: ",r),!1===t.recover&&function(){throw new Error("https://svelte.dev/e/hydration_failed")}(),be(),n.textContent="",re(!1),ar(e,t)}finally{re(r),ae(a)}}const ir=new Map;function lr(e,{target:t,anchor:n,props:a={},events:o,context:i,intro:l=!0,transformError:s}){be();var c=void 0,u=function(){dt.ensure();const l=sn(524352,()=>{var l=n??t.appendChild(ye());u=l,f=t=>{if(G({}),i&&(K.c=i),o&&(a.$$events=o),ne&&zn(t,null),c=e(t,a)||W(),ne&&(Nt.nodes.end=te,null===te||8!==te.nodeType||"]"!==te.data))throw ee(),z;Y()},d=s,new nr(u,{pending:()=>{}},f,d);var u,f,d;var h=new Set,p=e=>{for(var n=0;n{for(var e of h)for(const n of[t,document]){var r=ir.get(n),a=r.get(e);0==--a?(n.removeEventListener(e,Dn),r.delete(e),0===r.size&&ir.delete(n)):r.set(e,a)}Rn.delete(p),l!==n&&l.parentNode?.removeChild(l)}});return(e={})=>new Promise(t=>{e.outro?$n(l,()=>{xn(l),t(void 0)}):(xn(l),t(void 0))})}();return sr.set(c,u),c}let sr=new WeakMap;class cr{anchor;#q=new Map;#G=new Map;#Y=new Map;#W=new Set;#J=!0;constructor(e,t=!0){this.anchor=e,this.#J=t}#_=e=>{if(this.#q.has(e)){var t=this.#q.get(e),n=this.#G.get(t);if(n)En(n),this.#W.delete(t);else{var r=this.#Y.get(t);r&&(En(r.effect),this.#G.set(t,r.effect),this.#Y.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(const[t,n]of this.#q){if(this.#q.delete(t),t===e)break;const r=this.#Y.get(n);r&&(xn(r.effect),this.#Y.delete(n))}for(const[e,r]of this.#G){if(e===t||this.#W.has(e))continue;const a=()=>{if(Array.from(this.#q.values()).includes(e)){var t=document.createDocumentFragment();An(r,t),t.append(ye()),this.#Y.set(e,{effect:r,fragment:t})}else xn(r);this.#W.delete(e),this.#G.delete(e)};this.#J||!n?(this.#W.add(e),$n(r,a,!1)):a()}}};#X=e=>{this.#q.delete(e);const t=Array.from(this.#q.values());for(const[e,n]of this.#Y)t.includes(e)||(xn(n.effect),this.#Y.delete(e))};ensure(e,t){var n=nt;!t||this.#G.has(e)||this.#Y.has(e)||this.#G.set(e,bn(()=>t(this.anchor))),this.#q.set(n,e),ne&&(this.anchor=te),this.#_(n)}}function ur(e){null===K&&function(){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}(),fn(()=>{const t=ln(e);if("function"==typeof t)return t})}function fr(e,t,n=!1){var r;ne&&(r=te,oe());var a=new cr(e);function o(e,t){if(ne){var n=ce(r);if(e!==parseInt(n.substring(1))){var o=se();return ae(o),a.anchor=o,re(!1),a.ensure(e,t),void re(!0)}}a.ensure(e,t)}gn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},n?_:0)}const dr=Symbol("NaN");function hr(e,t,n=!1,r=!1,a=!1,o=!1){var i=e,l="";if(n){var s=e;ne&&(i=ae(we(s)))}vn(()=>{var e=Nt;if(l!==(l=t()??"")){if(n&&!ne)return e.nodes=null,s.innerHTML=l,void(""!==l&&zn(we(s),s.lastChild));if(null!==e.nodes&&(_n(e.nodes.start,e.nodes.end),e.nodes=null),""!==l){if(ne){te.data;for(var o=oe(),c=o;null!==o&&(8!==o.nodeType||""!==o.data);)c=o,o=xe(o);if(null===o)throw ee(),z;return zn(te,c),void(i=ae(o))}var u=Ee(r?"svg":a?"math":"template",r?"http://www.w3.org/2000/svg":a?"http://www.w3.org/1998/Math/MathML":void 0);u.innerHTML=l;var f=r||a?u:u.content;if(zn(we(f),f.lastChild),r||a)for(;we(f);)i.before(we(f));else i.before(f)}}else ne&&oe()})}function pr(e,t){var n,r=void 0;mn(()=>{r!==(r=t())&&(n&&(xn(n),n=null),r&&(n=bn(()=>{hn(()=>r(e))})))})}function vr(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t=0;){var l=i+o;0!==i&&!gr.includes(r[i-1])||l!==r.length&&!gr.includes(r[l])?i=l:r=(0===i?"":r.substring(0,i))+r.substring(l+1)}return""===r?null:r}(n,0,o);ne&&l===e.getAttribute("class")||(null==l?e.removeAttribute("class"):t?e.className=l:e.setAttribute("class",l)),e[O]=n}else if(o&&a!==o)for(var s in o){var c=!!o[s];null!=a&&c===!!a[s]||e.classList.toggle(s,c)}return o}function wr(e,t={},n,r){for(var a in n){var o=n[a];t[a]!==o&&(null==n[a]?e.style.removeProperty(a):e.style.setProperty(a,o,r))}}function xr(e,t,n,r){var a=e[I];if(ne||a!==t){var o=function(e,t){if(t){var n,r,a="";if(Array.isArray(t)?(n=t[0],r=t[1]):n=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,"").trim();var o=!1,i=0,l=!1,s=[];n&&s.push(...Object.keys(n).map(br)),r&&s.push(...Object.keys(r).map(br));var c=0,u=-1;const t=e.length;for(var f=0;f0&&t.every(e=>"SELECTEDCONTENT"===e.nodeName)}return!1}const Ar=Symbol("class"),Tr=Symbol("style"),Pr=Symbol("is custom element"),Lr=Symbol("is html"),Rr=U?"link":"LINK",Or=U?"input":"INPUT",Ir=U?"option":"OPTION",Mr=U?"select":"SELECT",Hr=U?"progress":"PROGRESS";function Nr(e){if(ne){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;Ur(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var r=e.checked;Ur(e,"checked",null),e.checked=r}}};e[H]=n,Z(n),ze()}}function Ur(e,t,n,r){var a=Vr(e);ne&&(a[t]=e.getAttribute(t),"src"===t||"srcset"===t||"href"===t&&e.nodeName===Rr)||a[t]!==(a[t]=n)&&("loading"===t&&(e[L]=n),null==n?e.removeAttribute(t):"string"!=typeof n&&zr(e).has(t)?e[t]=n:e.setAttribute(t,n))}function Dr(e,t,n=[],r=[],a=[],o,i=!1,l=!1){Fe(a,n,r,n=>{var r=void 0,a={},o=e.nodeName===Mr,l=!1;if(mn(()=>{var s=t(...n.map(rn)),c=function(e,t,n,r,a=!1){ne&&a&&e.nodeName===Or&&("defaultValue"in n||"defaultChecked"in n||Nr(e));var o=Vr(e),i=o[Pr],l=!o[Lr];let s=ne&&i;s&&re(!1);var c,u=t||{},f=e.nodeName===Ir,d=e.nodeName===Mr;for(var h in t)h in n||h[0]+h[1]==="$$"||(n[h]=null);n.class?n.class="object"==typeof(c=n.class)?function(){for(var e,t,n=0,r="",a=arguments.length;npr(e,()=>f))),c[t]=f}r=c}),o){var s=e;hn(()=>{var e=r;"defaultValue"in e&&kr(s,e.defaultValue),Sr(s,e.value,!0),function(e){var t=new MutationObserver(t=>{t.every(Cr)||("__defaultValue"in e&&$r(e,!1),"__value"in e&&Sr(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),un(()=>{t.disconnect()})}(s)})}l=!0})}function Vr(e){return e[R]??={[Pr]:e.nodeName.includes("-"),[Lr]:e.namespaceURI===F}}var jr=new Map;function zr(e){var t,n=e.getAttribute("is")||e.nodeName,r=jr.get(n);if(r)return r;jr.set(n,r=new Set);for(var a=e,o=Element.prototype;o!==a;){for(var i in t=l(a))t[i].set&&"innerHTML"!==i&&"textContent"!==i&&"innerText"!==i&&r.add(i);a=u(a)}return r}function Br(e){var t=e.type;return"number"===t||"range"===t}function Fr(e){return""===e?null:+e}function Kr(e,t){return e===t||e?.[A]===t}function qr(e=W(),t,n,r){var a=K.r,o=Nt;return hn(()=>{var r,i;return pn(()=>{r=i,i=[],ln(()=>{Kr(n(...i),e)||(t(e,...i),r&&Kr(n(...r),e)&&t(null,...r))})}),()=>{let r=o;for(;r!==a&&null!==r.parent&&r.parent.f&x;)r=r.parent;const l=r.teardown;r.teardown=()=>{i&&Kr(n(...i),e)&&t(null,...i),l?.()}}}),e}const Gr={get(e,t){if(!e.exclude.has(t))return e.props[t]},set:(e,t)=>!1,getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t))return t in e.props?{enumerable:!0,configurable:!0,value:e.props[t]}:void 0},has:(e,t)=>!e.exclude.has(t)&&t in e.props,ownKeys:e=>Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))};function Yr(e,t,n){return new Proxy({props:e,exclude:t},Gr)}function Wr(e,t,n,r){var a,o=r,i=!0,l=()=>(i&&(i=!1,o=r),o);void 0===e[t]&&void 0!==r&&l(),a=()=>{var n=e[t];return void 0===n?l():(i=!0,n)};var s=!1,c=Ge(()=>(s=!1,a())),u=Nt;return function(e,t){if(arguments.length>0){const n=t?rn(c):e;return Ct(c,n),s=!0,void 0!==o&&(o=n),e}return Rt&&s||0!==(u.f&y)?c.v:rn(c)}}class Jr{#Z;#Q;constructor(e){var t=new Map,n=(e,n)=>{var r=Et(n,!1,!1);return t.set(e,r),r};const r=new Proxy({...e.props||{},$$events:{}},{get:(e,r)=>rn(t.get(r)??n(r,Reflect.get(e,r))),has:(e,r)=>r===P||(rn(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r)),set:(e,r,a)=>(Ct(t.get(r)??n(r,a),a),Reflect.set(e,r,a))});this.#Q=(e.hydrate?or:ar)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),e?.props?.$$host&&!1!==e.sync||ht(),this.#Z=r.$$events;for(const e of Object.keys(this.#Q))"$set"!==e&&"$destroy"!==e&&"$on"!==e&&o(this,e,{get(){return this.#Q[e]},set(t){this.#Q[e]=t},enumerable:!0});this.#Q.$set=e=>{Object.assign(r,e)},this.#Q.$destroy=()=>{!function(e){const t=sr.get(e);t?(sr.delete(e),t(void 0)):Promise.resolve()}(this.#Q)}}$set(e){this.#Q.$set(e)}$on(e,t){this.#Z[e]=this.#Z[e]||[];const n=(...e)=>t.call(this,...e);return this.#Z[e].push(n),()=>{this.#Z[e]=this.#Z[e].filter(e=>e!==n)}}$destroy(){this.#Q.$destroy()}}let Xr=class{};function Zr(e,t,n,r){const a=n[e]?.type;if(t="Boolean"===a&&"boolean"!=typeof t?null!=t:t,!r||!n[e])return t;if("toAttribute"===r)switch(a){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(a){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}function Qr(e,t,n,r,l,s){let c=class extends Xr{constructor(){super(e,n,l),this.$$p_d=t}static get observedAttributes(){return a(t).map(e=>(t[e].attribute||e).toLowerCase())}};return a(t).forEach(e=>{o(c.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=Zr(e,n,t),this.$$d[e]=n;var r=this.$$c;if(r){var a=i(r,e)?.get;a?r[e]=n:r.$set({[e]:n})}}})}),r.forEach(e=>{o(c.prototype,e,{get(){return this.$$c?.[e]}})}),e.element=c,c}"function"==typeof HTMLElement&&(Xr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}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 t=function(e){return t=>{const n=Ee("slot");"default"!==e&&(n.name=e),Yn(t,n)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=function(e){const t={};return e.childNodes.forEach(e=>{t[e.slot||"default"]=!0}),t}(this);for(const e of this.$$s)e in r&&("default"!==e||this.$$d.children?n[e]=t(e):(this.$$d.children=t(e),n.default=!0));for(const e of this.attributes){const t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=Zr(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=(e={component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}},new Jr(e)),this.$$me=function(e){dt.ensure();const t=sn(524352,e);return()=>{xn(t)}}(()=>{pn(()=>{this.$$r=!0;for(const e of a(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];const t=Zr(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})});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={}}var e}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Zr(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return a(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});var ea=new Set(["$$slots","$$events","$$legacy","$$host","loading"]),ta=Bn('
');function na(e,t){G(t,!0);let n,r=Wr(t,"loading"),a=Yr(t,ea);var o={get loading(){return r()},set loading(e){r(e),ht()}},i=ta(),l=_e(i);Dr(l,()=>({type:"checkbox",...a}),void 0,void 0,void 0,0,!0),qr(l,e=>n=e,()=>n);var s=Se(l,2);return le(2),ie(i),vn(()=>Ur(i,"data-loading",r())),Mn("click",s,function(){n?.click()}),Yn(e,i),Y(o)}Hn(["click"]),Qr(na,{loading:{}},[],[],{mode:"open"});var ra=new Set(["$$slots","$$events","$$legacy","$$host","loading"]),aa=Bn('
');function oa(e,t){G(t,!0);let n=Wr(t,"loading"),r=Yr(t,ra);var a={get loading(){return n()},set loading(e){n(e),ht()}},o=aa();return Dr(_e(o),()=>({type:"checkbox",...r}),void 0,void 0,void 0,0,!0),le(2),ie(o),vn(()=>Ur(o,"data-loading",n())),Yn(e,o),Y(a)}Qr(oa,{loading:{}},[],[],{mode:"open"});var ia=Bn('
');function la(e,t){G(t,!0);let n=Wr(t,"strings");var r={get strings(){return n()},set strings(e){n(e),ht()}},a=ia(),o=_e(a);return Ur(o,"href","https://altcha.org"),ie(a),vn(()=>Ur(o,"aria-label",n().ariaLinkLabel)),Yn(e,a),Y(r)}Qr(la,{strings:{}},[],[],{mode:"open"});var sa=Bn('');function ca(e,t){G(t,!0);let n=Wr(t,"logo"),r=Wr(t,"strings");var a={get logo(){return n()},set logo(e){n(e),ht()},get strings(){return r()},set strings(e){r(e),ht()}},o=sa(),i=_e(o);hr(i,()=>r().footer,!0),ie(i);var l=Se(i,2),s=e=>{la(e,{get strings(){return r()}})};return fr(l,e=>{n()&&e(s)}),ie(o),Yn(e,o),Y(a)}Qr(ca,{logo:{},strings:{}},[],[],{mode:"open"});var ua=new Set(["$$slots","$$events","$$legacy","$$host","loading"]),fa=Bn('
');function da(e,t){G(t,!0);let n,r=Wr(t,"loading"),a=Yr(t,ua);var o={get loading(){return r()},set loading(e){r(e),ht()}},i=fa(),l=_e(i);Dr(l,()=>({type:"checkbox",...a}),void 0,void 0,void 0,0,!0),qr(l,e=>n=e,()=>n);var s=Se(l,2);return ie(i),vn(()=>Ur(i,"data-loading",r())),Mn("click",s,function(){n?.click()}),Yn(e,i),Y(o)}Hn(["click"]),Qr(da,{loading:{}},[],[],{mode:"open"});var ha=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(ha||{}),pa=(e=>(e.SHA_256="SHA-256",e.SHA_384="SHA-384",e.SHA_512="SHA-512",e))(pa||{}),va=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(va||{}),ga=Bn('
'),ma=Bn('
'),ba=Kn(''),ya=Kn(''),wa=Kn(''),xa=Bn(''),_a=Bn(''),ka=Bn('
');function $a(e,t){G(t,!0);let n=Wr(t,"audioUrl"),r=Wr(t,"codeChallenge"),a=Wr(t,"config"),o=Wr(t,"imageUrl"),i=Wr(t,"onCancel"),l=Wr(t,"onReload"),s=Wr(t,"onSubmit"),c=Wr(t,"strings"),u=St(void 0),f=St(void 0),d=St(void 0),h=St(!1),p=St(""),v=St(!1);function g(){Ct(u,ha.PAUSED,!0)}function m(e){Ct(u,ha.ERROR,!0)}function b(){Ct(u,ha.READY,!0)}function y(){Ct(u,ha.LOADING,!0)}function w(){Ct(u,ha.PLAYING,!0)}function x(){Ct(u,ha.PAUSED,!0)}function _(e){e.play().catch(e=>{if(!(e instanceof DOMException&&"AbortError"===e.name))throw e})}function k(){rn(f)?rn(u)===ha.LOADING||(rn(f).paused?(n()&&rn(f).src!==n()&&(rn(f).src=n()),rn(f).currentTime=0,_(rn(f))):rn(f).pause()):(Ct(v,!0),requestAnimationFrame(()=>{rn(f)&&n()&&(rn(f).src=n(),_(rn(f)))}))}ur(()=>(a().disableAutoFocus||nn().then(()=>{rn(d)?.focus()}),()=>{rn(f)&&(rn(f).pause(),Ct(f,void 0))}));var $={get audioUrl(){return n()},set audioUrl(e){n(e),ht()},get codeChallenge(){return r()},set codeChallenge(e){r(e),ht()},get config(){return a()},set config(e){a(e),ht()},get imageUrl(){return o()},set imageUrl(e){o(e),ht()},get onCancel(){return i()},set onCancel(e){i(e),ht()},get onReload(){return l()},set onReload(e){l(e),ht()},get onSubmit(){return s()},set onSubmit(e){s(e),ht()},get strings(){return c()},set strings(e){c(e),ht()}},S=ka(),E=_e(S),C=_e(E),A=e=>{var t=ga(),n=$e(t,!0);vn(()=>rr(n,c().verificationRequired)),Yn(e,t)};fr(C,e=>{"standard"!==a().codeChallengeDisplay&&e(A)});var T=Se(C,2),P=$e(T,!0),L=Se(T,2),R=Se(L,2),O=_e(R);Nr(O),O.disabled=rn(h),qr(O,e=>Ct(d,e),()=>rn(d));var I=Se(O,2),M=e=>{var t=xa(),n=_e(t),r=e=>{Yn(e,ma())},a=e=>{Yn(e,ba())},o=e=>{Yn(e,ya())},i=e=>{Yn(e,wa())};fr(n,e=>{rn(u)===ha.LOADING?e(r):rn(u)===ha.ERROR?e(a,1):rn(u)===ha.PLAYING?e(o,2):e(i,-1)}),ie(t),vn(()=>{Ur(t,"title",c().getAudioChallenge),t.disabled=rn(u)===ha.LOADING||rn(u)===ha.ERROR,Ur(t,"aria-label",rn(u)===ha.LOADING?c().loading:c().getAudioChallenge)}),In("click",t,()=>k(),!0),Yn(e,t)};fr(I,e=>{r().audio&&e(M)});var N=Se(I,2);ie(R);var U=Se(R,2),D=_e(U),V=$e(D,!0),j=Se(D,2),z=$e(j,!0);ie(U),ie(E);var B=Se(E,2),F=e=>{var t=_a();qr(t,e=>Ct(f,e),()=>rn(f)),In("error",t,m),In("loadstart",t,y),In("canplay",t,b),In("pause",t,x),In("playing",t,w),In("ended",t,g),Yn(e,t)};return fr(B,e=>{rn(v)&&e(F)}),ie(S),vn(()=>{rr(P,c().enterCodeFromImage),Ur(L,"src",o()),Ur(O,"minlength",r().length||1),Ur(O,"maxlength",r().length),Ur(O,"placeholder",c().enterCode),Ur(O,"aria-label",rn(u)===ha.LOADING?c().loading:rn(u)===ha.PLAYING?"":c().enterCodeAria),Ur(O,"aria-live",rn(u)?"assertive":"polite"),Ur(O,"aria-busy",rn(u)===ha.LOADING),Ur(N,"title",c().reload),Ur(N,"aria-label",c().reload),Ur(D,"aria-label",c().verify),rr(V,c().verify),Ur(j,"aria-label",c().cancel),rr(z,c().cancel)}),In("submit",E,function(e){e.preventDefault(),e.stopPropagation(),s()?.(rn(p))},!0),Mn("keydown",O,function(e){"Space"===e.code?(e.preventDefault(),e.stopPropagation(),k()):"Escape"===e.code&&(e.preventDefault(),e.stopPropagation(),i()?.())}),function(e,t,n=t){var r=new WeakSet;!function(e,t,n,r=n){e.addEventListener(t,()=>Be(n));const a=e[H];e[H]=a?()=>{a(),r(!0)}:()=>r(!0),ze()}(e,"input",async a=>{var o=a?e.defaultValue:e.value;if(o=Br(e)?Fr(o):o,n(o),null!==nt&&r.add(nt),await nn(),o!==(o=t())){var i=e.selectionStart,l=e.selectionEnd,s=e.value.length;if(e.value=o??"",null!==l){var c=e.value.length;i===l&&l===s&&c>s?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=i,e.selectionEnd=Math.min(l,c))}}}),(ne&&e.defaultValue!==e.value||null==ln(t)&&e.value)&&(n(Br(e)?Fr(e.value):e.value),null!==nt&&r.add(nt)),pn(()=>{var n=t();if(e===document.activeElement){var a=nt;if(r.has(a))return}Br(e)&&n===Fr(e.value)||("date"!==e.type||n||e.value)&&n!==e.value&&(e.value=n??"")})}(O,()=>rn(p),e=>Ct(p,e)),In("click",N,()=>l()?.(),!0),In("click",j,()=>i()?.(),!0),Yn(e,S),Y($)}Hn(["keydown"]),Qr($a,{audioUrl:{},codeChallenge:{},config:{},imageUrl:{},onCancel:{},onReload:{},onSubmit:{},strings:{}},[],[],{mode:"open"});var Sa=new Set(["$$slots","$$events","$$legacy","$$host","anchor","children","display","backdrop","onClickOutside","onClickOutsideDelay","onClose","placement","updateUISignal","variant"]),Ea=Bn('
'),Ca=Bn('
'),Aa=Bn('
×
'),Ta=Bn('
',1);function Pa(e,t){G(t,!0);let n=Wr(t,"anchor"),r=Wr(t,"children"),a=Wr(t,"display",0,"standard"),o=Wr(t,"backdrop",0,!1),i=Wr(t,"onClickOutside"),l=Wr(t,"onClickOutsideDelay",0,600),s=Wr(t,"onClose"),c=Wr(t,"placement",0,"auto"),u=Wr(t,"updateUISignal"),f=Wr(t,"variant",0,"neutral"),h=Yr(t,Sa),p=St(void 0),v=St(void 0),g=St(!1),m=St(0);function b(){s()?.()}function y(){if(n()&&"auto"===c()&&rn(p)){const e=n().getBoundingClientRect(),t=document.documentElement.clientHeight-(e.top+e.height){"auto"!==c()&&Ct(g,"top"===c())}),fn(()=>{u()&&y()}),ur(()=>{const e="bottomsheet"===a()||"overlay"===a();return e&&(rn(v)&&document.body.append(rn(v)),rn(p)&&document.body.append(rn(p))),y(),nn().then(()=>{Ct(m,Date.now(),!0)}),()=>{e&&(rn(v)&&document.body.removeChild(rn(v)),rn(p)&&document.body.removeChild(rn(p)))}});var w={get anchor(){return n()},set anchor(e){n(e),ht()},get children(){return r()},set children(e){r(e),ht()},get display(){return a()},set display(e="standard"){a(e),ht()},get backdrop(){return o()},set backdrop(e=!1){o(e),ht()},get onClickOutside(){return i()},set onClickOutside(e){i(e),ht()},get onClickOutsideDelay(){return l()},set onClickOutsideDelay(e=600){l(e),ht()},get onClose(){return s()},set onClose(e){s(e),ht()},get placement(){return c()},set placement(e="auto"){c(e),ht()},get updateUISignal(){return u()},set updateUISignal(e){u(e),ht()},get variant(){return f()},set variant(e="neutral"){f(e),ht()}},x=Ta();In("click",he,function(e){const t=e.target;rn(p)?.contains(t)||l()&&!(rn(m)+l(){var t=Ea();qr(t,e=>Ct(v,e),()=>rn(v)),Yn(e,t)};fr(k,e=>{o()&&e($)});var S=Se(k,2);Dr(S,()=>({...h,class:`altcha-popover ${(t.class||"")??""}`,"data-popover":!0,"data-variant":f(),"data-top":rn(g),"data-display":a()}));var E=_e(S),C=e=>{Yn(e,Ca())};fr(E,e=>{"standard"===a()&&e(C)});var A=Se(E,2),T=e=>{var t=Aa();In("click",t,b,!0),Yn(e,t)};fr(A,e=>{"standard"!==a()&&e(T)});var P=Se(A,2);return function(e,t,...n){var r=new cr(e);gn(()=>{const e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},_)}(_e(P),()=>r()??d),ie(P),ie(S),qr(S,e=>Ct(p,e),()=>rn(p)),Yn(e,x),Y(w)}async function La(e){const{challenge:t,concurrency:n=navigator.hardwareConcurrency,controller:r=new AbortController,createWorker:a,onOutOfMemory:o=e=>e>1?Math.floor(e/2):0,counterMode:i,timeout:l}=e,s=Math.min(16,Math.max(1,n)),c=[],u=()=>{for(const e of c)e.terminate()};for(let e=0;e(r.signal.addEventListener("abort",()=>{e.postMessage({type:"abort"})}),new Promise((r,a)=>{e.addEventListener("error",e=>{a(e)}),e.addEventListener("message",t=>{if(t.data){for(const t of c)t!==e&&t.postMessage({type:"abort"});if(t.data.error)return a(new Error(t.data.error))}r(t.data)}),e.postMessage({challenge:t,counterMode:i,counterStart:n,counterStep:s,timeout:l,type:"work"})}))))}catch(n){if(n instanceof Error&&n?.message?.includes("Out of memory")&&o){u();const n=o(s);if(n)return La({...e,challenge:t,controller:r,concurrency:n,createWorker:a})}throw n}finally{u()}return r.signal.aborted?null:f||null}Qr(Pa,{anchor:{},children:{},display:{},backdrop:{},onClickOutside:{},onClickOutsideDelay:{},onClose:{},placement:{},updateUISignal:{},variant:{}},[],[],{mode:"open"}),Object.values(pa);class Ra{TAG_CODES={INPUT:1,TEXTAREA:2,SELECT:3,BUTTON:4,A:5,DETAILS:6,SUMMARY:7,IFRAME:8,VIDEO:9,AUDIO:10};maxSamples;sampleInterval;target;focusStartTime=0;focusInteraction=0;focusInteractionTimer=null;lastPointerSample=0;lastTouchSample=0;lastScrollSample=0;pendingPointer=null;pendingTouch=null;focus=[];pointer=[];scroll=[];touch=[];constructor(e={}){const{maxSamples:t=60,sampleInterval:n=50,target:r=window}=e;this.maxSamples=t,this.sampleInterval=n,this.target=r,this.attach()}destroy(){const e={capture:!0};this.target.removeEventListener("focusin",this.onFocus,e),this.target.removeEventListener("keydown",this.onInteraction,e),this.target.removeEventListener("pointerdown",this.onInteraction,e),this.target.removeEventListener("pointermove",this.onPointer,e),this.target.removeEventListener("scroll",this.onScroll,e),this.target.removeEventListener("touchmove",this.onTouchMove,e)}export(){return{focus:this.focus,maxTouchPoints:navigator.maxTouchPoints||0,pointer:this.pointer,scroll:this.scroll,time:Date.now(),touch:this.touch}}attach(){const e={passive:!0,capture:!0};this.target.addEventListener("focusin",this.onFocus,e),this.target.addEventListener("keydown",this.onInteraction,e),this.target.addEventListener("pointerdown",this.onInteraction,e),this.target.addEventListener("pointermove",this.onPointer,e),this.target.addEventListener("scroll",this.onScroll,e),this.target.addEventListener("touchmove",this.onTouchMove,e)}evict(e){e.length>this.maxSamples&&e.splice(0,e.length-this.maxSamples)}onFocus=e=>{if(2===this.focusInteraction)return;const t=e.target;if(!(t instanceof Element))return;const n=performance.now();0===this.focusStartTime&&(this.focusStartTime=n),this.focus.push([Math.round(n-this.focusStartTime),t.tabIndex,this.TAG_CODES[t.tagName]??0,this.focusInteraction?1:0]),this.evict(this.focus)};onInteraction=e=>{this.focusInteraction="keyCode"in e?1:2,this.focusInteractionTimer&&clearTimeout(this.focusInteractionTimer),this.focusInteractionTimer=setTimeout(()=>{this.focusInteraction=0},100)};onPointer=e=>{if("touch"===e.pointerType)return;const t=e.timeStamp||performance.now();this.pendingPointer=[Math.round(e.clientX),Math.round(e.clientY),Math.round(t)],t-this.lastPointerSample>=this.sampleInterval&&(this.pointer.push(this.pendingPointer),this.lastPointerSample=t,this.pendingPointer=null,this.evict(this.pointer))};onScroll=()=>{const e=performance.now();e-this.lastScrollSample{const t=e.timeStamp||performance.now(),n=e.touches[0];n&&(this.pendingTouch=[Math.round(n.clientX),Math.round(n.clientY),Math.round(t),Math.round(1e3*n.force)/1e3,Math.round(n.radiusX||0),Math.round(n.radiusY||0)],t-this.lastTouchSample>=this.sampleInterval&&(this.touch.push(this.pendingTouch),this.lastTouchSample=t,this.pendingTouch=null,this.evict(this.touch)))}}var Oa=Bn('
'),Ia=Bn('
'),Ma=Bn('
×
',1),Ha=Bn('
'),Na=Bn(''),Ua=Bn('
Secure context (HTTPS) required.
'),Da=Bn('
'),Va=Bn(" ",1),ja=Bn('
',1);"undefined"!=typeof window&&window.customElements&&!customElements.get("altcha-widget")&&customElements.define("altcha-widget",Qr(function(e,t){G(t,!0);const[n,r]=function(){const e={};return[e,function(){un(()=>{for(var t in e)e[t].unsubscribe();o(e,Ue,{enumerable:!1,value:!0})})}]}(),a=["ar","fa","he","ur"],{isSecureContext:i}=globalThis,{store:l}=globalThis.$altcha.defaults,s=navigator.hardwareConcurrency||2,c=navigator.deviceMemory||0,u=c&&c<=4?Math.min(4,s):s,f=globalThis.$altcha.i18n.store,d=t.$$host,h=(e,t)=>{nn().then(()=>{d?.dispatchEvent(new CustomEvent(e,{detail:t}))})};let p=null,v=St(ue(new URL(location.origin))),g=St(!1),m=St(null),b=St(null),y=St(null),w=St(ue(va.UNVERIFIED)),x=St(void 0),k=St(void 0),$=St(null),S=St(void 0),E=St(null),C=St(null),A=St(null),T=St(null),P=St(ue([])),L=St(0),R=St(ue({})),O=St(!0);const I=Je(()=>({fetch:(e,t)=>fetch(e,t),audioChallengeLanguage:"",auto:"off",barPlacement:"bottom",challenge:"",codeChallenge:null,codeChallengeDisplay:"standard",credentials:null,debug:!1,disableAutoFocus:!1,display:"standard",floatingAnchor:"",floatingOffset:8,floatingPersist:!1,floatingPlacement:"auto",hideFooter:!1,hideLogo:!1,humanInteractionSignature:!0,language:"",mockError:!1,minDuration:500,overlayContent:"",name:"altcha",popoverPlacement:"auto",retryOnOutOfMemoryError:!0,setCookie:null,serverVerificationFields:!1,serverVerificationTimeZone:!1,test:!1,timeout:9e4,type:"checkbox",validationMessage:"",verifyFunction:null,verifyUrl:"",workers:u,...De(l,"$altchaDefaults",n),...rn(R)})),M=Je(()=>`altcha-checkbox-${t.id||Math.floor(1e12*Math.random()).toString(16)}`),H=Je(()=>function(e){switch(e){case"checkbox":return na;case"switch":return da;default:return oa}}(rn(I).type)),N=Je(()=>rn(I).auto),U=Je(()=>rn(w)===va.VERIFYING),D=Je(()=>!rn(I).hideFooter),V=Je(()=>!rn(I).hideLogo&&"bar"!==rn(I).display),j=Je(()=>function(e,t){const n=Object.keys(e).map(e=>e.toLowerCase());let r=t.reduce((t,r)=>(r=r.toLowerCase(),t||(e[r]?r:null)||n.find(e=>r.split("-")[0]===e.split("-")[0])||null),null);return e[r||""]||(r="en"),{language:r,strings:e[r]}}(De(f,"$altchaI18nStore",n),[rn(I).language,document.documentElement.lang,...navigator.languages])),z=Je(()=>a.includes(rn(j).language)?"rtl":void 0),B=Je(()=>({...rn(j).strings})),F=Je(()=>rn(m)?.audio?.match(/^(https?:)?\//)?ee(rn(m).audio,rn(v),{language:rn(I).audioChallengeLanguage||rn(j).language}).toString():rn(m)?.audio),K=Je(()=>rn(m)?.image?.match(/^(https?:)?\//)?ee(rn(m).image,rn(v)):rn(m)?.image);async function q(e,...t){let n;for(const r of rn(P))n=await r[e].call(r,...t);return n}async function W(e){await new Promise(t=>setTimeout(t,e))}async function J(e=rn(I).challenge,t){const n=await q("onFetchChallenge",e);let r=null;if(void 0!==n)return n;if("string"==typeof e)if(e.startsWith("{")){Ae("parsing JSON challenge");try{r=JSON.parse(e)}catch{throw new Error("Unable to parse JSON challenge.")}}else{Ae("fetching challenge from",t?.method||"GET",e),Ct(v,new URL(e,location.origin),!0);const n=await rn(I).fetch(e,{credentials:rn(I).credentials||void 0,...t});await we(n);const a=n.headers.get("x-altcha-config");a&&function(e){try{const t=JSON.parse(e);t&&"object"==typeof t&&Ee({serverVerificationFields:t?.sentinel?.fields,serverVerificationTimeZone:t?.sentinel?.timeZone,verifyUrl:t.verifyurl,...t})}catch(e){Ae("unable to configure from x-altcha-config header",e)}}(a);const o=await n.json();if(o&&"his"in o&&o.his){if(Ae("requested HIS"),!p)throw new Error("Server requested HIS data but collector is disabled.");return J(ee(o.his.url,rn(v)),{body:JSON.stringify({his:p.export()}),headers:{"content-type":"application/json"},method:"POST"})}o&&"hisResult"in o&&o.hisResult&&Ae("HIS result",o.hisResult),r=o}else if(e&&"object"==typeof e)try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("Unable to parse JSON challenge.")}if(function(e){return null!==e&&"object"==typeof e&&"challenge"in e}(r)&&(r=function(e){const[t,n]=e.salt.split("?"),r={};if(n)try{Object.assign(r,Object.fromEntries(new URLSearchParams(n).entries()))}catch{}const a={codeChallenge:e.codeChallenge,parameters:{algorithm:e.algorithm,cost:1,data:r,expiresAt:r?.expires?parseInt(r.expires,10):void 0,keyLength:"SHA-512"===e.algorithm?64:"SHA-384"===e.algorithm?48:32,nonce:(o=(new TextEncoder).encode(e.salt),Array.from(new Uint8Array(o)).map(e=>e.toString(16).padStart(2,"0")).join("")),keyPrefix:e.challenge,salt:""},signature:e.signature};var o;return Object.defineProperties(a,{_originalSalt:{enumerable:!1,value:e.salt,writable:!1},_version:{enumerable:!1,value:1,writable:!1}}),a}(r)),!function(e){return!!e&&"object"==typeof e&&"parameters"in e&&!!e.parameters&&"object"==typeof e.parameters&&"algorithm"in e.parameters&&"nonce"in e.parameters&&"salt"in e.parameters&&"keyPrefix"in e.parameters}(r))throw new Error("Challenge validation failed.");return r}function X(){return document.getElementById(rn(M))}function Z(e){return rn($)?Array.from(rn($).elements).filter(t=>t.matches(e)):[]}function Q(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ee(e,t,n){const r=new URL(e,t);if(r.search||(r.search=t.search),n)for(const e in n)void 0!==n[e]&&null!==n[e]&&r.searchParams.set(e,n[e]);return r.toString()}function le(e){!rn(g)&&e.currentTarget.checked?(e.preventDefault(),e.currentTarget.checked=!1,rn(w)!==va.VERIFYING&&Oe()):e.currentTarget.checked||(e.preventDefault(),Te())}function fe(e){rn(w)===va.VERIFYING?e.currentTarget.setCustomValidity(rn(B).waitAlert):rn(I).validationMessage&&e.currentTarget.setCustomValidity(rn(I).validationMessage)}function de(){ye(rn(I).display),Te()}function ve(e){const t=e.target;"onfocus"===rn(N)&&rn(w)===va.UNVERIFIED&&rn($)&&t instanceof Element&&(rn($).contains(t)||t.form===rn($))&&Oe()}function ge(){ye(rn(I).display),Te()}function me(e){const t=e.target;"true"!==t?.getAttribute("data-code-challenge")&&"onsubmit"===rn(N)&&rn(w)===va.UNVERIFIED&&(e.preventDefault(),e.stopPropagation(),Ct(E,e.submitter,!0),Le(),Oe().then(e=>{e&&!rn(m)&&nn().then(()=>{be(rn(E))})}))}function be(e){rn($)&&"requestSubmit"in rn($)?rn($).requestSubmit(e):rn($)?.reportValidity()&&(e?e.click():rn($).submit())}function ye(e){switch(e){case"bar":case"floating":case"overlay":Ce(),rn(N)&&"off"!==rn(N)||(rn(R).auto="onsubmit");break;case"standard":Le()}rn(y)!==e&&Ct(y,e,!0)}async function we(e){if(e.status>=400){if(e.headers.get("content-type")?.includes("/json")){let t;try{t=await e.json()}catch{}if(t&&"error"in t)throw new Error(`Server responded with ${e.status} - ${t.error}`)}throw new Error(`Server responded with ${e.status}.`)}const t=e.headers.get("content-type");if(!t||!t.includes("/json"))throw new Error(`Server responded with invalid content-type. Expected application/json, received ${t}.`)}async function xe(e){if(!rn(T))return void Pe(va.ERROR,"Cannot verify code challenge without PoW payload.");Pe(va.VERIFYING);let t=null;if(rn(I).verifyUrl)t=await async function(e,t){const n=await q("onRequestServerVerification",e,t);if(void 0!==n)return n;if(Ae("requesting server verification from",rn(I).verifyUrl),!rn(I).verifyUrl)throw new Error("Parameter verifyUrl must be set for server verification.");const r=await rn(I).fetch(ee(rn(I).verifyUrl,rn(v)),{body:JSON.stringify({code:t,fields:rn(I).serverVerificationFields?Z('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("(?{be(rn(E))})):Pe(va.ERROR,t?.reason||"Verification failed."),rn(I).disableAutoFocus||X()?.focus()}function Ee(e){Object.assign(rn(R),{...Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t))})}function Ce(){Ct(O,!1)}function Ae(...e){(rn(I).debug||e.some(e=>e instanceof Error))&&console[e[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${rn(I).name}]`,...e)}function Te(e=va.UNVERIFIED,t=null){Ct(g,!1),Ct(C,t,!0),Ct(T,null),rn(b)&&rn(b).abort(),rn(A)&&(clearTimeout(rn(A)),Ct(A,null)),Pe(e)}function Pe(e,t=null){Ct(w,e,!0),Ct(C,t,!0),h("statechange",{payload:rn(T),state:rn(w)})}function Le(){Ct(O,!0),nn().then(()=>{Re()})}function Re(){if("floating"===rn(I).display)return function(e=20){if(!rn(S))return;const t=rn(I).floatingPlacement;if(!rn(k)&&(Ct(k,(rn(I).floatingAnchor instanceof HTMLElement?rn(I).floatingAnchor:rn(I).floatingAnchor?document.querySelector(rn(I).floatingAnchor):Z('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')[0])||rn($),!0),!rn(k)))return void Ae("unable to find floating anchor element");const n=parseInt(rn(I).floatingOffset,10)||12,r=rn(k).getBoundingClientRect(),a=rn(S).getBoundingClientRect(),o=document.documentElement.clientHeight,i=document.documentElement.clientWidth,l=t&&"auto"!==t?"top"===t:r.bottom+a.height+n+e>o,s=Math.max(e,Math.min(i-e-a.width,r.left+r.width/2-a.width/2));if(rn(S).style.setProperty("--altcha-floating-left",`${s}px`),rn(S).style.setProperty("--altcha-floating-top",l?r.top-(a.height+n)+"px":`${r.bottom+n}px`),rn(S).setAttribute("data-floating-position",l?"top":"bottom"),rn(x)){const e=rn(x).getBoundingClientRect();rn(x).style.left=r.left-s+r.width/2-e.width/2+"px"}}();Ct(L,rn(L)+1)}async function Oe(e={}){const{concurrency:t=Math.max(1,rn(I).workers),controller:n=new AbortController,minDuration:r=rn(I).minDuration}=e,a=performance.now();let o=null,l=null,s=!1;const c=await q("onVerify",e);if(void 0!==c)return c;Te(va.VERIFYING),Ct(b,n,!0);try{if(!i)throw new Error("Secure context (HTTPS) required.");if(rn(I).mockError)throw new Error("Mock error.");if(rn(I).test)return Ae("running test mode with null challenge"),await W(Math.max(0,r-(performance.now()-a))),rn(b)?.signal.aborted?(Te(),null):(Ct(T,btoa(JSON.stringify({challenge:null,solution:null,test:!0})),!0),Ae("verified"),Pe(va.VERIFIED),h("verified",{payload:rn(T)}),{payload:rn(T)});if(o=await J(),!o)throw new Error("Failed to fetch challenge.");Ae("challenge",o),"configuration"in o&&(Ae("re-configuring from challenge",o.configuration),Ee(o.configuration)),o.parameters.expiresAt&&function(e){rn(A)&&clearTimeout(rn(A));const t=()=>{rn(w)!==va.UNVERIFIED?(Ct(g,!1),Pe(va.EXPIRED)):Te(),h("expired")},n=1e3*e-Date.now();n>=1?Ct(A,setTimeout(t,n),!0):t()}(o.parameters.expiresAt),s="_version"in o&&1===o._version;const e=globalThis.$altcha.algorithms.get(o.parameters.algorithm);if(!e)throw new Error(`Unsupported algorithm ${o.parameters.algorithm}.`);if(l=await La({challenge:o,concurrency:t,controller:n,createWorker:e,counterMode:s?"string":"uint32",onOutOfMemory:e=>{if(Ae("out of memory error received"),h("outofmemory"),rn(I).retryOnOutOfMemoryError&&e>1){const t=Math.floor(e/2);return Ae(`retrying with ${t} workers...`),t}},timeout:rn(I).timeout}),rn(b)?.signal.aborted)return Te(),null;if(!l)throw new Error("Failed to find solution.");Ae("solution",l),await W(Math.max(0,r-(performance.now()-a))),Ct(m,o.codeChallenge||rn(I).codeChallenge||null,!0),Ct(T,s?btoa(JSON.stringify(function(e,t){return{algorithm:e.parameters.algorithm,challenge:e.parameters.keyPrefix,number:t.counter,salt:"_originalSalt"in e?e._originalSalt:e.parameters.nonce,signature:e.signature,took:t.time||0}}(o,l))):btoa(JSON.stringify({challenge:{parameters:o.parameters,signature:o.signature},solution:l})),!0),rn(m)?(Ae("requesting code verification"),Pe(va.CODE),h("codechallenge",{codeChallenge:rn(m)})):rn(I).verifyUrl?await xe():(Ae("verified"),Pe(va.VERIFIED),h("verified",{payload:rn(T)}))}catch(e){return Ae("verification failed",e),Pe(va.ERROR,String(e)),null}finally{Ct(b,null)}return{challenge:o,payload:rn(T),solution:l}}fn(()=>{Ee({auto:t.auto,challenge:t.challenge,display:t.display,language:t.language,name:t.name,type:t.type,workers:t.workers})}),fn(()=>{t.theme?d?.setAttribute("theme",t.theme):d?.removeAttribute("theme")}),fn(()=>{if(t.configuration)try{Ee(JSON.parse(t.configuration))}catch{Ae("unable to parse the `configuration` attribute (JSON expected)")}}),fn(()=>{rn(y)!==rn(I).display&&ye(rn(I).display)}),fn(()=>{rn(g)&&rn(w)===va.VERIFYING&&Ct(g,!1)}),fn(()=>{rn(g)||rn(w)!==va.VERIFIED||Ct(g,!0)}),fn(()=>{if(!rn(g)){const e=X();e&&e.checked&&(e.checked=!1)}}),fn(()=>{rn(w)===va.VERIFIED&&X()?.setCustomValidity("")}),fn(()=>{if("onload"===rn(N)){const e=setTimeout(()=>{Oe()},10);return()=>{e&&clearTimeout(e)}}}),fn(()=>{rn(C)&&Ae("error:",rn(C))}),fn(()=>{rn(T)&&rn(I).setCookie&&function(e,t={}){const{domain:n,name:r=rn(I).name,maxAge:a,path:o,sameSite:i,secure:l}=t;let s=`${encodeURIComponent(r)}=${encodeURIComponent(e)}`;n&&(s+=`; Domain=${n}`),null!=a&&(s+=`; Max-Age=${a}`),o&&(s+=`; Path=${o}`),i&&(s+=`; SameSite=${i}`),l&&(s+="; Secure"),document.cookie=s}(rn(T),rn(I).setCookie)}),ur(()=>(Ae("mounted","3.5.0"),d&&globalThis.$altcha.instances.add(d),Ct($,function(){if(t.form){const e=d?.getRootNode(),n=e?.getElementById?.(t.form);return n instanceof HTMLFormElement?n:null}return rn(S)?.closest("form")??null}(),!0),rn($)?.addEventListener("reset",ge),rn($)?.addEventListener("submit",me,{capture:!0}),document.addEventListener("focusin",ve),function(){Ct(P,[...globalThis.$altcha.plugins].map(e=>new e(d)),!0),Ae("activating plugins",rn(P).map(e=>e.constructor.name));for(const e of rn(P))e.activate()}(),rn(I).humanInteractionSignature&&(Ae("human interaction signature enabled"),p=new Ra),h("load"),i||Ae("secure context (HTTPS) required"),()=>{!function(){for(const e of rn(P))e.destroy()}(),d&&globalThis.$altcha.instances.delete(d),rn(A)&&clearTimeout(rn(A)),rn($)?.removeEventListener("reset",ge),rn($)?.removeEventListener("submit",me,{capture:!0}),document.removeEventListener("focusin",ve),p?.destroy()}));var Ie={configure:Ee,getConfiguration:function(){return{...rn(I)}},getState:function(){return rn(w)},hide:Ce,log:Ae,reset:Te,setState:Pe,show:Le,updateUI:Re,verify:Oe},Me=ja();In("scroll",pe,function(){Re()}),In("click",pe,function(e){const t=e.target;"floating"!==rn(I).display||!t||d?.contains(t)||t.hasAttribute("data-backdrop")||t.closest("[data-popover]")||rn(w)===va.VERIFIED||rn(I).floatingPersist||Ce()}),In("pageshow",he,function(e){e.persisted&&(ye(rn(I).display),Te())}),In("resize",he,function(){Re()});var He=ke(Me),Ne=e=>{Yn(e,Oa())};fr(He,e=>{"overlay"===rn(I).display&&rn(O)&&e(Ne)});var Ve=Se(He,2),je=_e(Ve),ze=e=>{var t=Ma(),n=ke(t),r=Se(n,2),a=e=>{var t=Ia();hr(t,()=>document.querySelector(rn(I).overlayContent)?.innerHTML,!0),ie(t),Yn(e,t)};fr(r,e=>{rn(I).overlayContent&&e(a)}),In("click",n,de,!0),Yn(e,t)};fr(je,e=>{"overlay"===rn(I).display&&rn(O)&&e(ze)});var Be=Se(je,2),Fe=_e(Be),Ke=_e(Fe),qe=_e(Ke);{let e=Je(()=>"standard"===rn(I).display&&"onsubmit"!==rn(N)||rn(w)===va.VERIFYING);!function(e,t,n){var r;ne&&(r=te,oe());var a=new cr(e);gn(()=>{var e=rn(H)??null;if(ne&&"["===ce(r)!=(null!==e)){var t=se();return ae(t),a.anchor=t,re(!1),a.ensure(e,e&&(t=>n(t,e))),void re(!0)}a.ensure(e,e&&(t=>n(t,e)))},_)}(qe,0,(n,r)=>{r(n,{get id(){return rn(M)},get form(){return t.form},name:"",get required(){return rn(e)},get loading(){return rn(U)},get checked(){return rn(g)},onchange:le,oninvalid:fe})})}var Ge=Se(qe,2),Ye=_e(Ge),We=e=>{var t=qn();vn(()=>rr(t,rn(B).verificationRequired)),Yn(e,t)},Xe=e=>{var t=qn();vn(()=>rr(t,rn(B).verifying)),Yn(e,t)},Ze=e=>{var t=qn();vn(()=>rr(t,rn(B).verified)),Yn(e,t)},Qe=e=>{var t=qn();vn(()=>rr(t,rn(B).label)),Yn(e,t)};fr(Ye,e=>{rn(w)===va.CODE&&rn(m)?e(We):rn(w)===va.VERIFYING?e(Xe,1):rn(w)===va.VERIFIED?e(Ze,2):e(Qe,-1)}),ie(Ge),ie(Ke);var et=Se(Ke,2),tt=e=>{la(e,{get strings(){return rn(B)}})};fr(et,e=>{rn(V)&&e(tt)}),ie(Fe);var nt=Se(Fe,2),rt=e=>{{let t=Je(()=>"bar"===rn(I).display&&rn(V));ca(e,{get logo(){return rn(t)},get strings(){return rn(B)}})}};fr(nt,e=>{rn(D)&&e(rt)});var at=Se(nt,2),ot=e=>{var t=Ha();qr(t,e=>Ct(x,e),()=>rn(x)),Yn(e,t)};fr(at,e=>{"floating"===rn(I).display&&e(ot)});var it=Se(at,2),lt=e=>{var n=Na();Nr(n),vn(()=>{var e,r,a;Ur(n,"form",t.form),Ur(n,"name",rn(I).name),e=n,r=rn(T),(a=Vr(e)).value!==(a.value=r??void 0)&&(e.value!==r||0===r&&e.nodeName===Hr)&&(e.value=r??"")}),Yn(e,n)};fr(it,e=>{rn(I).setCookie||e(lt)}),ie(Be);var st=Se(Be,2),ct=e=>{Pa(e,{get anchor(){return rn(S)},onClickOutside:()=>{i&&Te()},get placement(){return rn(I).popoverPlacement},role:"alert",variant:"error",get dir(){return rn(z)},get updateUISignal(){return rn(L)},children:(e,t)=>{var n=Gn(),r=ke(n),a=e=>{Yn(e,Ua())},o=e=>{var t=Da(),n=$e(t,!0);vn(()=>rr(n,rn(B).expired)),Yn(e,t)},l=e=>{var t=Da(),n=$e(t,!0);vn(()=>{Ur(t,"title",rn(C)),rr(n,rn(B).error)}),Yn(e,t)};fr(r,e=>{rn(C)||i?rn(C)||rn(w)!==va.EXPIRED?e(l,-1):e(o,1):e(a)}),Yn(e,n)},$$slots:{default:!0}})},ut=e=>{var t=Gn();!function(e,t,n){ne&&oe();var r=new cr(e);gn(()=>{var e=rn(m);e!=e&&(e=dr),r.ensure(e,n)})}(ke(t),0,e=>{{let t=Je(()=>"standard"!==rn(I).codeChallengeDisplay);Pa(e,{get anchor(){return rn(S)},get backdrop(){return rn(t)},get display(){return rn(I).codeChallengeDisplay},onClose:()=>{Te()},get placement(){return rn(I).popoverPlacement},role:"dialog",get"aria-label"(){return rn(B).verificationRequired},get dir(){return rn(z)},get updateUISignal(){return rn(L)},children:(e,t)=>{var n=Va(),r=ke(n);$a(r,{get audioUrl(){return rn(F)},get imageUrl(){return rn(K)},onCancel:()=>Te(),onReload:()=>Oe(),onSubmit:e=>xe(e),get codeChallenge(){return rn(m)},get config(){return rn(I)},get strings(){return rn(B)}});var a=Se(r,2),o=e=>{ca(e,{get logo(){return rn(V)},get strings(){return rn(B)}})};fr(a,e=>{rn(D)&&"standard"!==rn(I).codeChallengeDisplay&&e(o)}),Yn(e,n)},$$slots:{default:!0}})}}),Yn(e,t)};fr(st,e=>{rn(C)||rn(w)===va.EXPIRED||!i?e(ct):rn(m)&&rn(w)===va.CODE&&e(ut,1)}),ie(Ve),qr(Ve,e=>Ct(S,e),()=>rn(S)),vn(e=>{Ur(Ve,"data-state",rn(w)),Ur(Ve,"data-display",rn(I).display||void 0),Ur(Ve,"data-placement",e),Ur(Ve,"data-visible",rn(O)||void 0),Ur(Ve,"dir",rn(z)),Ur(Ge,"for",rn(M)),Ve.dir=Ve.dir},[()=>function(e){switch(e){case"bar":return rn(I).barPlacement||"bottom";case"floating":return rn(I).floatingPlacement||"auto";default:return}}(rn(I).display)]),Yn(e,Me);var ft=Y(Ie);return r(),ft},{auto:{type:"String"},challenge:{type:"String"},configuration:{type:"String"},display:{type:"String"},form:{type:"String"},language:{type:"String"},name:{type:"String"},theme:{type:"String"},type:{type:"String"},workers:{type:"Number"}},[],["configure","getConfiguration","getState","hide","log","reset","setState","show","updateUI","verify"]));const za='(function() {\n "use strict";\n function assertAlgorithm(algorithm, allowed) {\n if (!allowed.includes(algorithm)) {\n throw new Error(\n `Unsupported algorithm: ${String(algorithm)}. Expected one of: ${allowed.join(", ")}.`\n );\n }\n }\n function bufferStartsWith(buffer, prefix) {\n if (prefix.length > buffer.length) {\n return false;\n }\n for (let i = 0; i < prefix.length; i++) {\n if (buffer[i] !== prefix[i]) {\n return false;\n }\n }\n return true;\n }\n function bufferToHex(buffer) {\n return Array.from(new Uint8Array(buffer)).map((b) => b.toString(16).padStart(2, "0")).join("");\n }\n function concatBuffers(a, b) {\n const out = new Uint8Array(a.length + b.length);\n out.set(a, 0);\n out.set(b, a.length);\n return out;\n }\n function hexToBuffer(hex) {\n if (hex.length % 2 !== 0) {\n throw new Error(`Hex string must have an even length. Got: ${hex}`);\n }\n if (!/^[0-9a-fA-F]*$/.test(hex)) {\n throw new Error("Hex string contains non-hex characters.");\n }\n const buffer = new Uint8Array(hex.length / 2);\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = parseInt(hex.substring(i * 2, i * 2 + 2), 16);\n }\n return buffer;\n }\n async function delay(ms) {\n await new Promise((resolve) => setTimeout(resolve, ms));\n }\n function timeDuration(start) {\n return Math.floor((performance.now() - start) * 10) / 10;\n }\n var HmacAlgorithm = /* @__PURE__ */ ((HmacAlgorithm2) => {\n HmacAlgorithm2["SHA_256"] = "SHA-256";\n HmacAlgorithm2["SHA_384"] = "SHA-384";\n HmacAlgorithm2["SHA_512"] = "SHA-512";\n return HmacAlgorithm2;\n })(HmacAlgorithm || {});\n Object.values(HmacAlgorithm);\n const MAX_COUNTER = {\n string: Number.MAX_SAFE_INTEGER,\n uint32: 4294967295\n };\n function isValidCounter(n, mode) {\n return Number.isInteger(n) && n >= 0 && n <= MAX_COUNTER[mode];\n }\n class PasswordBuffer {\n constructor(nonce, mode = "uint32") {\n this.nonce = nonce;\n this.mode = mode;\n this.buffer = new Uint8Array(this.nonce.length + this.COUNTER_BYTES);\n this.buffer.set(this.nonce, 0);\n this.dataView = new DataView(this.buffer.buffer);\n }\n nonce;\n mode;\n COUNTER_BYTES = 4;\n buffer;\n dataView;\n encoder = new TextEncoder();\n /**\n * Appends the counter to the nonce buffer.\n * In \'string\' mode, encodes the counter as a UTF-8 string.\n * In \'uint32\' mode, writes the counter as a big-endian 32-bit integer.\n * Throws a RangeError unless the counter is an integer the mode encodes exactly.\n */\n setCounter(n) {\n if (!isValidCounter(n, this.mode)) {\n throw new RangeError(\n `counter must be an integer from 0 to ${MAX_COUNTER[this.mode]}. Got: ${n}`\n );\n }\n if (this.mode === "string") {\n return concatBuffers(this.nonce, this.encoder.encode(n.toString()));\n }\n this.dataView.setUint32(this.nonce.length, n, false);\n return this.buffer;\n }\n }\n function assertKeyPrefix(keyPrefix, keyLength) {\n if (typeof keyPrefix !== "string" || !/^[0-9a-fA-F]+$/.test(keyPrefix)) {\n throw new Error("keyPrefix must be a non-empty hex string.");\n }\n if (keyPrefix.length > keyLength * 2) {\n throw new Error(\n `keyPrefix (${keyPrefix.length} hex characters) must not be longer than the key (keyLength: ${keyLength} bytes).`\n );\n }\n }\n async function solveChallenge(options) {\n const {\n challenge,\n controller,\n counterMode = "uint32",\n counterStart = 0,\n counterStep = 1,\n deriveKey: deriveKey2,\n timeout = 9e4\n } = options;\n const { nonce, keyLength = 32, keyPrefix, salt } = challenge.parameters;\n assertKeyPrefix(keyPrefix, keyLength);\n const nonceBuf = hexToBuffer(nonce);\n const saltBuf = hexToBuffer(salt);\n const keyPrefixHex = keyPrefix.toLowerCase();\n const keyPrefixBuf = keyPrefix.length % 2 === 0 ? hexToBuffer(keyPrefix) : null;\n const password = new PasswordBuffer(nonceBuf, counterMode);\n const start = performance.now();\n let counter = counterStart;\n let iterations = 0;\n let derivedKeyHex = "";\n let lastYield = start;\n while (true) {\n if (controller?.signal.aborted || timeout && iterations % 10 === 0 && performance.now() - start > timeout) {\n return null;\n }\n const { derivedKey } = await deriveKey2(\n challenge.parameters,\n saltBuf,\n password.setCounter(counter)\n );\n if (iterations % 10 === 0 && performance.now() - lastYield > 200) {\n await delay(0);\n lastYield = performance.now();\n }\n if (keyPrefixBuf ? bufferStartsWith(derivedKey, keyPrefixBuf) : bufferToHex(derivedKey).startsWith(keyPrefixHex)) {\n derivedKeyHex = bufferToHex(derivedKey);\n break;\n }\n counter = counter + counterStep;\n iterations = iterations + 1;\n }\n return {\n counter,\n derivedKey: derivedKeyHex,\n time: timeDuration(start)\n };\n }\n function handler(options) {\n const { deriveKey: deriveKey2 } = options;\n let controller = void 0;\n self.onmessage = async (message) => {\n const { challenge, counterMode, counterStart, counterStep, timeout, type } = message.data;\n if (type === "abort") {\n controller?.abort();\n } else if (type === "work") {\n controller = new AbortController();\n let solution;\n try {\n solution = await solveChallenge({\n challenge,\n controller,\n counterStart,\n counterStep,\n deriveKey: deriveKey2,\n counterMode,\n timeout\n });\n } catch (err) {\n return self.postMessage({ error: err });\n }\n self.postMessage(solution);\n }\n };\n }\n async function deriveKey(parameters, salt, password) {\n const { algorithm, cost, keyLength = 32 } = parameters;\n assertAlgorithm(algorithm, ["PBKDF2/SHA-256", "PBKDF2/SHA-384", "PBKDF2/SHA-512"]);\n const passwordKey = await crypto.subtle.importKey(\n "raw",\n password,\n { name: "PBKDF2" },\n false,\n ["deriveBits"]\n );\n const derivedBits = await crypto.subtle.deriveBits(\n {\n name: "PBKDF2",\n salt,\n iterations: cost,\n hash: algorithm.slice("PBKDF2/".length)\n },\n passwordKey,\n keyLength * 8\n );\n return {\n parameters: {},\n derivedKey: new Uint8Array(derivedBits)\n };\n }\n handler({\n deriveKey\n });\n})();\n',Ba="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",za],{type:"text/javascript;charset=utf-8"});function Fa(e){let t;try{if(t=Ba&&(self.URL||self.webkitURL).createObjectURL(Ba),!t)throw"";const n=new Worker(t,{name:e?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(za),{name:e?.name})}}const Ka='(function() {\n "use strict";\n function assertAlgorithm(algorithm, allowed) {\n if (!allowed.includes(algorithm)) {\n throw new Error(\n `Unsupported algorithm: ${String(algorithm)}. Expected one of: ${allowed.join(", ")}.`\n );\n }\n }\n function bufferStartsWith(buffer, prefix) {\n if (prefix.length > buffer.length) {\n return false;\n }\n for (let i = 0; i < prefix.length; i++) {\n if (buffer[i] !== prefix[i]) {\n return false;\n }\n }\n return true;\n }\n function bufferToHex(buffer) {\n return Array.from(new Uint8Array(buffer)).map((b) => b.toString(16).padStart(2, "0")).join("");\n }\n function concatBuffers(a, b) {\n const out = new Uint8Array(a.length + b.length);\n out.set(a, 0);\n out.set(b, a.length);\n return out;\n }\n function hexToBuffer(hex) {\n if (hex.length % 2 !== 0) {\n throw new Error(`Hex string must have an even length. Got: ${hex}`);\n }\n if (!/^[0-9a-fA-F]*$/.test(hex)) {\n throw new Error("Hex string contains non-hex characters.");\n }\n const buffer = new Uint8Array(hex.length / 2);\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = parseInt(hex.substring(i * 2, i * 2 + 2), 16);\n }\n return buffer;\n }\n async function delay(ms) {\n await new Promise((resolve) => setTimeout(resolve, ms));\n }\n function timeDuration(start) {\n return Math.floor((performance.now() - start) * 10) / 10;\n }\n var HmacAlgorithm = /* @__PURE__ */ ((HmacAlgorithm2) => {\n HmacAlgorithm2["SHA_256"] = "SHA-256";\n HmacAlgorithm2["SHA_384"] = "SHA-384";\n HmacAlgorithm2["SHA_512"] = "SHA-512";\n return HmacAlgorithm2;\n })(HmacAlgorithm || {});\n Object.values(HmacAlgorithm);\n const MAX_COUNTER = {\n string: Number.MAX_SAFE_INTEGER,\n uint32: 4294967295\n };\n function isValidCounter(n, mode) {\n return Number.isInteger(n) && n >= 0 && n <= MAX_COUNTER[mode];\n }\n class PasswordBuffer {\n constructor(nonce, mode = "uint32") {\n this.nonce = nonce;\n this.mode = mode;\n this.buffer = new Uint8Array(this.nonce.length + this.COUNTER_BYTES);\n this.buffer.set(this.nonce, 0);\n this.dataView = new DataView(this.buffer.buffer);\n }\n nonce;\n mode;\n COUNTER_BYTES = 4;\n buffer;\n dataView;\n encoder = new TextEncoder();\n /**\n * Appends the counter to the nonce buffer.\n * In \'string\' mode, encodes the counter as a UTF-8 string.\n * In \'uint32\' mode, writes the counter as a big-endian 32-bit integer.\n * Throws a RangeError unless the counter is an integer the mode encodes exactly.\n */\n setCounter(n) {\n if (!isValidCounter(n, this.mode)) {\n throw new RangeError(\n `counter must be an integer from 0 to ${MAX_COUNTER[this.mode]}. Got: ${n}`\n );\n }\n if (this.mode === "string") {\n return concatBuffers(this.nonce, this.encoder.encode(n.toString()));\n }\n this.dataView.setUint32(this.nonce.length, n, false);\n return this.buffer;\n }\n }\n function assertKeyPrefix(keyPrefix, keyLength) {\n if (typeof keyPrefix !== "string" || !/^[0-9a-fA-F]+$/.test(keyPrefix)) {\n throw new Error("keyPrefix must be a non-empty hex string.");\n }\n if (keyPrefix.length > keyLength * 2) {\n throw new Error(\n `keyPrefix (${keyPrefix.length} hex characters) must not be longer than the key (keyLength: ${keyLength} bytes).`\n );\n }\n }\n async function solveChallenge(options) {\n const {\n challenge,\n controller,\n counterMode = "uint32",\n counterStart = 0,\n counterStep = 1,\n deriveKey: deriveKey2,\n timeout = 9e4\n } = options;\n const { nonce, keyLength = 32, keyPrefix, salt } = challenge.parameters;\n assertKeyPrefix(keyPrefix, keyLength);\n const nonceBuf = hexToBuffer(nonce);\n const saltBuf = hexToBuffer(salt);\n const keyPrefixHex = keyPrefix.toLowerCase();\n const keyPrefixBuf = keyPrefix.length % 2 === 0 ? hexToBuffer(keyPrefix) : null;\n const password = new PasswordBuffer(nonceBuf, counterMode);\n const start = performance.now();\n let counter = counterStart;\n let iterations = 0;\n let derivedKeyHex = "";\n let lastYield = start;\n while (true) {\n if (controller?.signal.aborted || timeout && iterations % 10 === 0 && performance.now() - start > timeout) {\n return null;\n }\n const { derivedKey } = await deriveKey2(\n challenge.parameters,\n saltBuf,\n password.setCounter(counter)\n );\n if (iterations % 10 === 0 && performance.now() - lastYield > 200) {\n await delay(0);\n lastYield = performance.now();\n }\n if (keyPrefixBuf ? bufferStartsWith(derivedKey, keyPrefixBuf) : bufferToHex(derivedKey).startsWith(keyPrefixHex)) {\n derivedKeyHex = bufferToHex(derivedKey);\n break;\n }\n counter = counter + counterStep;\n iterations = iterations + 1;\n }\n return {\n counter,\n derivedKey: derivedKeyHex,\n time: timeDuration(start)\n };\n }\n function handler(options) {\n const { deriveKey: deriveKey2 } = options;\n let controller = void 0;\n self.onmessage = async (message) => {\n const { challenge, counterMode, counterStart, counterStep, timeout, type } = message.data;\n if (type === "abort") {\n controller?.abort();\n } else if (type === "work") {\n controller = new AbortController();\n let solution;\n try {\n solution = await solveChallenge({\n challenge,\n controller,\n counterStart,\n counterStep,\n deriveKey: deriveKey2,\n counterMode,\n timeout\n });\n } catch (err) {\n return self.postMessage({ error: err });\n }\n self.postMessage(solution);\n }\n };\n }\n async function deriveKey(parameters, salt, password) {\n const { algorithm, keyLength = 32 } = parameters;\n assertAlgorithm(algorithm, ["SHA-256", "SHA-384", "SHA-512"]);\n const iterations = Math.max(1, parameters.cost);\n let derivedKey = concatBuffers(salt, password);\n for (let i = 0; i < iterations; i++) {\n derivedKey = new Uint8Array(await crypto.subtle.digest(algorithm, derivedKey));\n }\n return {\n parameters: {},\n derivedKey: derivedKey.slice(0, keyLength)\n };\n }\n handler({\n deriveKey\n });\n})();\n',qa="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Ka],{type:"text/javascript;charset=utf-8"});function Ga(e){let t;try{if(t=qa&&(self.URL||self.webkitURL).createObjectURL(qa),!t)throw"";const n=new Worker(t,{name:e?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ka),{name:e?.name})}}!function(e,t="altcha-css"){if("undefined"!=typeof document&&document&&!document.getElementById(t)){const n=document.createElement("style");n.id=t,n.textContent=e;const r=document.currentScript?.nonce??document.querySelector('meta[name="csp-nonce"]')?.content;r&&(n.nonce=r),document.head.appendChild(n)}}(':root {\n --altcha-border-color: var(--altcha-color-neutral);\n --altcha-border-width: 1px;\n --altcha-border-radius: 6px;\n --altcha-color-base: light-dark(oklch(100% 0.00011 271.152), oklch(20.904% 0.00002 271.152));\n --altcha-color-base-content: light-dark(\n \toklch(20.904% 0.00002 271.152),\n \toklch(100% 0.00011 271.152)\n );\n --altcha-color-error: oklch(51.284% 0.20527 28.678);\n --altcha-color-error-content: oklch(100% 0.00011 271.152);\n --altcha-color-neutral: light-dark(oklch(83.591% 0.0001 271.152), oklch(46.04% 0.00005 271.152));\n --altcha-color-neutral-content: light-dark(\n \toklch(46.76% 0.00005 271.152),\n \toklch(100% 0.00011 271.152)\n );\n --altcha-color-primary: oklch(40.279% 0.2449 268.131);\n --altcha-color-primary-content: oklch(100% 0.00011 271.152);\n --altcha-color-success: oklch(55.748% 0.18968 142.511);\n --altcha-color-success-content: oklch(100% 0.00011 271.152);\n --altcha-checkbox-border-color: light-dark(\n \toklch(66.494% 0.00233 15.434),\n \toklch(51.028% 0.00006 271.152)\n );\n --altcha-checkbox-border-radius: 5px;\n --altcha-checkbox-border-width: var(--altcha-border-width);\n --altcha-checkbox-outline: 2px solid var(--altcha-checkbox-outline-color);\n --altcha-checkbox-outline-color: -webkit-focus-ring-color;\n --altcha-checkbox-outline-offset: 2px;\n --altcha-checkbox-size: 22px;\n --altcha-checkbox-transition-duration: var(--altcha-transition-duration);\n --altcha-input-background-color: var(--altcha-color-base);\n --altcha-input-border-radius: 3px;\n --altcha-input-border-width: 1px;\n --altcha-input-color: var(--altcha-color-base-content);\n --altcha-max-width: 320px;\n --altcha-padding: 0.75rem;\n --altcha-popover-arrow-size: 6px;\n --altcha-popover-color: var(--altcha-border-color);\n --altcha-shadow: drop-shadow(3px 3px 6px oklch(0% 0 0 / 0.2));\n --altcha-spinner-color: var(--altcha-color-base-content);\n --altcha-switch-background-color: var(--altcha-color-neutral);\n --altcha-switch-border-radius: calc(infinity * 1px);\n --altcha-switch-height: var(--altcha-checkbox-size);\n --altcha-switch-padding: 0.25rem;\n --altcha-switch-width: calc(var(--altcha-checkbox-size) * 1.75);\n --altcha-switch-toggle-border-radius: 100%;\n --altcha-switch-toggle-color: var(--altcha-color-neutral-content);\n --altcha-switch-toggle-size: calc(\n \tvar(--altcha-switch-height) - calc(var(--altcha-switch-padding) * 2)\n );\n --altcha-transition-duration: 0.6s;\n --altcha-z-index: 99999999;\n --altcha-z-index-popover: 999999999;\n}\n\n@supports (-moz-appearance: none) {\n :root {\n --altcha-checkbox-outline-color: var(--altcha-color-primary);\n }\n}\n.altcha {\n all: revert-layer;\n display: none;\n font-family: inherit;\n font-size: inherit;\n position: relative;\n}\n.altcha[data-visible] {\n display: block;\n}\n.altcha-popover, .altcha-popover * {\n all: revert-layer;\n box-sizing: border-box;\n font-family: inherit;\n font-size: inherit;\n line-height: 1.25;\n}\n.altcha * {\n all: revert-layer;\n box-sizing: border-box;\n font-family: inherit;\n font-size: inherit;\n line-height: 1.25;\n}\n.altcha a, .altcha-popover a {\n color: currentColor;\n text-decoration: none;\n}\n.altcha a:hover, .altcha-popover a:hover {\n color: currentColor;\n}\n.altcha-main {\n align-items: start;\n background-color: var(--altcha-color-base);\n border: var(--altcha-border-width, 1px) solid var(--altcha-border-color);\n border-radius: var(--altcha-border-radius, 0);\n color: var(--altcha-color-base-content);\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n justify-content: space-between;\n padding: var(--altcha-padding);\n max-width: var(--altcha-max-width, 100%);\n}\n.altcha-main > * {\n display: flex;\n width: 100%;\n}\n.altcha-main > *:first-child {\n flex-grow: 1;\n}\n.altcha-checkbox-wrap {\n align-items: center;\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n gap: 0.5rem;\n}\n.altcha-checkbox-wrap > * {\n display: flex;\n}\n.altcha-logo {\n opacity: 0.7;\n}\n.altcha-footer {\n align-items: center;\n display: flex;\n flex-grow: 1;\n gap: 0.5rem;\n justify-content: flex-end;\n font-size: 0.7rem;\n opacity: 0.7;\n}\n.altcha-footer p {\n margin: 0;\n padding: 0;\n}\n.altcha-error {\n font-size: 0.85rem;\n}\n.altcha-button {\n align-items: center;\n background: var(--altcha-color-primary);\n border: var(--altcha-input-border-width) solid var(--altcha-color-primary);\n border-radius: var(--altcha-input-border-radius);\n color: var(--altcha-color-primary-content);\n cursor: pointer;\n display: flex;\n font-size: 0.9rem;\n gap: 0.5rem;\n padding: 0.35rem;\n}\n.altcha-button:focus {\n border-color: var(--altcha-color-primary);\n outline: var(--altcha-checkbox-outline);\n outline-offset: var(--altcha-checkbox-outline-offset);\n}\n.altcha-button > .altcha-spinner, .altcha-button > svg {\n height: 20px;\n width: 20px;\n}\n.altcha-button-secondary {\n background: transparent;\n border-color: var(--altcha-color-neutral);\n color: var(--altcha-color-neutral-content);\n}\n.altcha-input {\n background: var(--altcha-input-background-color);\n border: var(--altcha-input-border-width) solid var(--altcha-color-neutral);\n border-radius: var(--altcha-input-border-radius);\n color: var(--altcha-input-color);\n flex-grow: 1;\n font-size: 1rem;\n min-width: 0;\n padding: 0.25rem;\n width: auto;\n}\n.altcha-input:focus {\n border-color: var(--altcha-color-primary);\n outline: var(--altcha-checkbox-outline);\n outline-offset: var(--altcha-checkbox-outline-offset);\n}\n.altcha-spinner {\n animation: altcha-rotate 0.6s linear infinite;\n border-radius: 100%;\n border: var(--altcha-checkbox-border-width) solid var(--altcha-spinner-color);\n border-bottom-color: transparent;\n border-right-color: transparent;\n opacity: 0.7;\n}\n.altcha-popover {\n background-color: var(--altcha-color-base);\n border: var(--altcha-border-width) solid var(--altcha-border-color);\n border-radius: var(--altcha-border-radius);\n color: var(--altcha-color-base-content);\n filter: var(--altcha-shadow);\n position: absolute;\n left: calc(var(--altcha-padding) / 2);\n max-width: calc(var(--altcha-max-width) - var(--altcha-padding));\n top: calc(var(--altcha-padding) + var(--altcha-checkbox-size) + var(--altcha-popover-arrow-size));\n z-index: var(--altcha-z-index-popover);\n}\n.altcha-popover-arrow {\n border: var(--altcha-popover-arrow-size) solid transparent;\n border-bottom-color: var(--altcha-popover-color);\n content: "";\n height: 0;\n left: calc(var(--altcha-checkbox-size) / 2);\n position: absolute;\n top: calc(var(--altcha-popover-arrow-size) * -2);\n width: 0;\n}\n.altcha-popover-content {\n max-height: 100dvh;\n overflow: auto;\n padding: var(--altcha-padding);\n}\n.altcha-popover[data-top=true][data-display=standard] {\n bottom: calc(100% - (var(--altcha-padding) - var(--altcha-popover-arrow-size)));\n top: auto;\n}\n.altcha-popover[data-top=true][data-display=standard] .altcha-popover-arrow {\n border-bottom-color: transparent;\n border-top-color: var(--altcha-popover-color);\n bottom: calc(var(--altcha-popover-arrow-size) * -2);\n top: auto;\n}\n.altcha-popover[data-variant=error] {\n --altcha-popover-color: var(--altcha-color-error);\n background-color: var(--altcha-color-error);\n border-color: var(--altcha-color-error);\n color: var(--altcha-color-error-content);\n}\n.altcha-popover[data-variant=error] .altcha-popover-content {\n padding: calc(var(--altcha-padding) / 1.5) var(--altcha-padding);\n}\n.altcha-popover[data-display=overlay] {\n animation: altcha-overlay-slidein 0.5s forwards;\n left: 50%;\n position: fixed;\n top: 45%;\n transform: translate(-50%, -50%);\n width: var(--altcha-max-width);\n z-index: var(--altcha-z-index);\n}\n.altcha-popover[data-display=bottomsheet] {\n animation: altcha-bottomsheet-slideup 0.5s forwards;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: 0;\n bottom: -100%;\n left: 50%;\n position: fixed;\n top: auto;\n transform: translate(-50%, 0);\n width: var(--altcha-max-width);\n z-index: var(--altcha-z-index);\n}\n.altcha-popover[data-display=bottomsheet] .altcha-popover-content {\n padding-bottom: calc(var(--altcha-padding) * 2);\n}\n.altcha-popover-backdrop {\n background: var(--altcha-color-base-content);\n bottom: 0;\n left: 0;\n opacity: 0.1;\n position: fixed;\n right: 0;\n top: 0;\n transition: opacity 0.5s;\n z-index: var(--altcha-z-index);\n}\n.altcha-popover-close {\n color: var(--altcha-color-base-content);\n cursor: pointer;\n display: inline-block;\n font-size: 1rem;\n height: 1.25rem;\n line-height: 0.95;\n position: absolute;\n right: 0;\n text-align: center;\n text-shadow: 0 0 1px var(--altcha-color-base);\n top: -1.5rem;\n width: 1.25rem;\n z-index: var(--altcha-z-index);\n}\n[dir=rtl] .altcha-popover {\n left: auto;\n right: calc(var(--altcha-padding) / 2);\n}\n[dir=rtl] .altcha-popover-arrow {\n left: auto;\n right: calc(var(--altcha-checkbox-size) / 2);\n}\n[dir=rtl] .altcha-popover-close {\n left: 0;\n right: auto;\n}\n.altcha-popover[data-display=bottomsheet] .altcha-footer, .altcha-popover[data-display=overlay] .altcha-footer {\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n gap: 0.5rem;\n}\n.altcha-popover[data-display=bottomsheet] .altcha-footer svg, .altcha-popover[data-display=overlay] .altcha-footer svg {\n height: 18px;\n width: 18px;\n vertical-align: middle;\n}\n.altcha-code-challenge > form {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n.altcha-code-challenge-title {\n font-weight: 600;\n}\n.altcha-code-challenge-text {\n font-size: 0.85rem;\n}\n.altcha-code-challenge-image {\n background: white;\n border: var(--altcha-input-border-width) solid var(--altcha-color-neutral);\n border-radius: var(--altcha-input-border-radius);\n object-fit: contain;\n height: 50px;\n}\n.altcha-code-challenge-row {\n display: flex;\n gap: 0.5rem;\n}\n.altcha-code-challenge-buttons {\n align-items: center;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin-top: var(--altcha-padding);\n justify-content: space-between;\n}\n.altcha-code-challenge-buttons button {\n justify-content: center;\n width: 100%;\n}\n.altcha-checkbox {\n cursor: pointer;\n height: var(--altcha-checkbox-size);\n position: relative;\n width: var(--altcha-checkbox-size);\n}\n.altcha-checkbox input {\n appearance: none;\n background: var(--altcha-input-background-color);\n border: var(--altcha-checkbox-border-width, 2px) solid var(--altcha-checkbox-border-color);\n border-radius: var(--altcha-checkbox-border-radius);\n cursor: pointer;\n height: var(--altcha-checkbox-size);\n left: 0;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 0;\n width: var(--altcha-checkbox-size);\n}\n@supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none) {\n .altcha-checkbox input {\n /* Safari-only: fixes focus outline */\n }\n .altcha-checkbox input:focus {\n outline-width: 2px;\n outline-style: solid;\n }\n}\n.altcha-checkbox input:before {\n border-radius: var(--altcha-checkbox-border-radius);\n content: "";\n width: 100%;\n height: 100%;\n background: var(--altcha-color-neutral);\n display: block;\n transform: scale(0);\n}\n.altcha-checkbox input:checked {\n background-color: var(--altcha-color-success);\n border-color: var(--altcha-color-success);\n}\n.altcha-checkbox input:checked::before {\n background-color: var(--altcha-color-success);\n opacity: 0;\n transform: scale(2.2);\n transition: all var(--altcha-checkbox-transition-duration) ease;\n transition-delay: 0.1s;\n}\n.altcha-checkbox svg {\n --altcha-radio-svg-size: calc(var(--altcha-checkbox-size) * 0.5);\n --altcha-radio-svg-offset: calc(var(--altcha-checkbox-size) * 0.25);\n fill: none;\n left: var(--altcha-radio-svg-offset);\n height: var(--altcha-radio-svg-size);\n opacity: 0;\n position: absolute;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-dasharray: 16px;\n stroke-dashoffset: 16px;\n top: var(--altcha-radio-svg-offset);\n transform: translate3d(0, 0, 0);\n width: var(--altcha-radio-svg-size);\n}\n.altcha-checkbox input:checked + svg {\n color: var(--altcha-color-success-content);\n opacity: 1;\n stroke-dashoffset: 0;\n transition: all var(--altcha-checkbox-transition-duration) ease;\n transition-delay: 0.1s;\n}\n.altcha-checkbox-spinner {\n display: none;\n left: 0;\n height: var(--altcha-checkbox-size);\n position: absolute;\n top: 0;\n width: var(--altcha-checkbox-size);\n}\n.altcha-checkbox[data-loading=true] input {\n appearance: none;\n opacity: 0;\n pointer-events: none;\n}\n.altcha-checkbox[data-loading=true] .altcha-checkbox-spinner {\n display: block;\n}\n.altcha-checkbox-native {\n height: var(--altcha-checkbox-size);\n position: relative;\n width: var(--altcha-checkbox-size);\n}\n.altcha-checkbox-native input {\n height: var(--altcha-checkbox-size);\n margin: 0;\n width: var(--altcha-checkbox-size);\n}\n.altcha-checkbox-native-spinner {\n display: none;\n left: 0;\n height: var(--altcha-checkbox-size);\n position: absolute;\n top: 0;\n width: var(--altcha-checkbox-size);\n}\n.altcha-checkbox-native[data-loading=true] input {\n appearance: none;\n opacity: 0;\n pointer-events: none;\n}\n.altcha-checkbox-native[data-loading=true] .altcha-checkbox-native-spinner {\n display: block;\n}\n.altcha-switch {\n align-items: center;\n border-radius: var(--altcha-switch-border-radius);\n background-color: var(--altcha-switch-background-color);\n display: flex;\n height: var(--altcha-switch-height);\n padding: var(--altcha-switch-padding);\n position: relative;\n width: var(--altcha-switch-width);\n}\n.altcha-switch:focus-within {\n outline: var(--altcha-checkbox-outline);\n outline-offset: var(--altcha-checkbox-outline-offset);\n}\n.altcha-switch input {\n appearance: none;\n cursor: pointer;\n height: 100%;\n left: 0;\n opacity: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.altcha-switch-toggle {\n align-items: center;\n background-color: var(--altcha-switch-toggle-color);\n border-radius: var(--altcha-switch-toggle-border-radius);\n cursor: pointer;\n display: flex;\n height: var(--altcha-switch-toggle-size);\n justify-content: center;\n left: var(--altcha-switch-padding);\n position: absolute;\n transition: width 150ms ease-out, left 150ms ease-out;\n width: var(--altcha-switch-toggle-size);\n}\n.altcha-switch-spinner {\n display: none;\n height: var(--altcha-switch-toggle-size);\n width: var(--altcha-switch-toggle-size);\n}\n.altcha-switch[data-loading=true] {\n pointer-events: none;\n}\n.altcha-switch[data-loading=true] .altcha-switch-spinner {\n display: block;\n}\n.altcha-switch[data-loading=true] .altcha-switch-toggle {\n background-color: transparent;\n left: calc(50% - var(--altcha-switch-toggle-size) / 2);\n}\n[data-state=verified] .altcha-switch {\n --altcha-switch-background-color: var(--altcha-color-success);\n}\n[data-state=verified] .altcha-switch-toggle {\n background-color: var(--altcha-color-success-content);\n left: calc(100% - var(--altcha-switch-height) + var(--altcha-switch-padding));\n}\n[dir=rtl] .altcha-switch-toggle {\n left: calc(100% - var(--altcha-switch-height) + var(--altcha-switch-padding));\n}\n[dir=rtl][data-state=verified] .altcha-switch-toggle {\n left: var(--altcha-switch-padding);\n}\n.altcha-floating-arrow {\n border: 6px solid transparent;\n border-bottom-color: var(--altcha-border-color);\n content: "";\n height: 0;\n left: 12px;\n position: absolute;\n top: -12px;\n width: 0;\n}\n.altcha-overlay-backdrop {\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n transition: opacity var(--altcha-transition-duration);\n z-index: var(--altcha-z-index);\n}\n.altcha-overlay-close {\n display: inline-block;\n color: currentColor;\n cursor: pointer;\n font-size: 1rem;\n height: 1rem;\n line-height: 0.85;\n position: absolute;\n right: 0;\n text-align: center;\n text-shadow: 0 0 1px var(--altcha-color-base);\n top: -1.5rem;\n width: 1rem;\n z-index: var(--altcha-z-index);\n}\n.altcha[data-display=overlay] {\n animation: altcha-overlay-slidein var(--altcha-transition-duration) forwards;\n filter: var(--altcha-shadow);\n left: 50%;\n opacity: 0;\n position: fixed;\n top: 45%;\n transform: translate(-50%, -50%);\n z-index: var(--altcha-z-index);\n}\n.altcha[data-display=overlay] .altcha-main {\n width: var(--altcha-max-width);\n}\n.altcha[data-display=floating] {\n display: none;\n filter: var(--altcha-shadow);\n left: var(--altcha-floating-left, -100%);\n position: fixed;\n top: var(--altcha-floating-top, -100%);\n z-index: var(--altcha-z-index);\n}\n.altcha[data-display=floating] .altcha-main {\n width: var(--altcha-max-width);\n}\n.altcha[data-display=floating][data-floating-position=top] .altcha-floating-arrow {\n border-bottom-color: transparent;\n border-top-color: var(--altcha-border-color);\n bottom: -12px;\n top: auto;\n}\n.altcha[data-display=floating][data-visible] {\n display: flex;\n}\n.altcha[data-display=bar] {\n bottom: -100%;\n filter: var(--altcha-shadow);\n left: 0;\n position: fixed;\n right: 0;\n transition: bottom var(--altcha-transition-duration), top var(--altcha-transition-duration);\n z-index: var(--altcha-z-index);\n}\n.altcha[data-display=bar] .altcha-main {\n align-items: center;\n border-radius: 0;\n border-width: var(--altcha-border-width) 0 0 0;\n flex-direction: row;\n max-width: 100% !important;\n}\n.altcha[data-display=bar] .altcha-main > * {\n width: auto;\n}\n.altcha[data-display=bar][data-placement=top] {\n bottom: auto;\n top: -100%;\n}\n.altcha[data-display=bar][data-placement=top] .altcha-main {\n border-width: 0 0 var(--altcha-border-width) 0;\n}\n.altcha[data-display=bar][data-placement=bottom]:not([data-state=unverified]) {\n bottom: 0;\n}\n.altcha[data-display=bar][data-placement=top]:not([data-state=unverified]) {\n top: 0;\n}\n.altcha[data-display=invisible] {\n display: none;\n}\n\n@keyframes altcha-rotate {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes altcha-bottomsheet-slideup {\n 100% {\n bottom: 0;\n }\n}\n@keyframes altcha-overlay-slidein {\n 100% {\n opacity: 1;\n top: 50%;\n }\n}'),$altcha.algorithms.set("SHA-256",()=>new Ga),$altcha.algorithms.set("SHA-384",()=>new Ga),$altcha.algorithms.set("SHA-512",()=>new Ga),$altcha.algorithms.set("PBKDF2/SHA-256",()=>new Fa),$altcha.algorithms.set("PBKDF2/SHA-384",()=>new Fa),$altcha.algorithms.set("PBKDF2/SHA-512",()=>new Fa);var Ya="altcha-widget.frm-altcha-widget",Wa=".frm-altcha",Ja=["name","challenge","auto","language","configuration"],Xa=new WeakSet,Za=function(e){return"function"!=typeof e.getState||"verified"===e.getState()},Qa=function(e){return new Promise(function(t){var n=function(){var r=e.getState();"verifying"!==r&&(e.removeEventListener("statechange",n),t("verified"===r))};e.addEventListener("statechange",n),"verifying"!==e.getState()&&e.verify().then(n)})},eo=function(e,t,n){Xa.has(e)||(Xa.add(e),Promise.all(t.map(Qa)).then(function(t){Xa.delete(e),t.every(Boolean)&&e.requestSubmit(n)}))},to=function(e){var t=e.target;if(t instanceof HTMLFormElement){var n=Array.from(t.querySelectorAll(Ya)).filter(function(e){return!Za(e)});n.length&&(e.preventDefault(),e.stopImmediatePropagation(),eo(t,n,e.submitter&&t.contains(e.submitter)?e.submitter:void 0))}},no=function(e){var t=e.target instanceof Element?e.target.closest(Ya):null,n=null==t?void 0:t.closest("form");t&&n&&!Za(t)&&(e.preventDefault(),eo(n,[t]))},ro=function(e){var t=e.currentTarget;"function"==typeof t.getConfiguration&&"standard"!==t.getConfiguration().display&&(["verified","unverified"].includes(e.detail.state)?t.hide():t.show())},ao=function(e){(e instanceof Element&&e.matches(Wa)?[e]:Array.from(e.querySelectorAll(Wa))).forEach(function(e){if(!e.querySelector(Ya)){var t=document.createElement("altcha-widget");t.className="frm-altcha-widget",t.addEventListener("statechange",ro),Ja.forEach(function(n){var r=e.dataset[n];r&&t.setAttribute(n,r)}),e.append(t)}})},oo=function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){var t;if(e instanceof HTMLElement)if(e.classList.contains("frm_error")){var n=null===(t=e.closest(".frm_form_field"))||void 0===t?void 0:t.querySelector(Ya);n&&"function"==typeof n.reset&&(n.reset(),function(e){var t=e.querySelector('input[type="checkbox"]');if(t){t.setAttribute("aria-invalid","true");var n=function(){"verified"===e.getState()&&(t.removeAttribute("aria-invalid"),e.removeEventListener("statechange",n))};e.addEventListener("statechange",n)}}(n))}else ao(e)})})},io=function(){document.documentElement.dataset.frmAltcha||(document.documentElement.dataset.frmAltcha="1",ao(document),document.addEventListener("submit",to,!0),document.addEventListener("invalid",no,!0),new MutationObserver(oo).observe(document.documentElement,{childList:!0,subtree:!0}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",io):io()})(); \ No newline at end of file diff --git a/js/altcha/THIRD-PARTY-NOTICES.txt b/js/altcha/THIRD-PARTY-NOTICES.txt new file mode 100644 index 0000000000..1c6b9ad8d6 --- /dev/null +++ b/js/altcha/THIRD-PARTY-NOTICES.txt @@ -0,0 +1,28 @@ +Formidable Forms bundles the following third-party software in js/altcha.js, +the individual translations in js/altcha/i18n/, +and the ALTCHA logo in classes/views/frm-settings/captcha/altcha-option.php. + +altcha 3.5.0 +https://github.com/altcha-org/altcha + +MIT License + +Copyright (c) 2023-2026 Daniel Regeci, BAU Software s.r.o. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/js/altcha/i18n/af.js b/js/altcha/i18n/af.js new file mode 100644 index 0000000000..a6c8a474d8 --- /dev/null +++ b/js/altcha/i18n/af.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function r(r,t,i){if(null==r)return t(void 0),e;const n=function(){var e=a;try{return a=!0,r.subscribe(t,i)}finally{a=e}}();return n.unsubscribe?()=>n.unsubscribe():n}const t=[];function i(r,i=e){let n=null;const a=new Set;function o(e){if(o=e,((i=r)!=i?o==o:i!==o||null!==i&&"object"==typeof i||"function"==typeof i)&&(r=e,n)){const e=!t.length;for(const e of a)e[1](),t.push(e,r);if(e){for(let e=0;e{a.delete(f),0===a.size&&n&&(n(),n=null)}}}}function n(e){let t;return r(e,e=>t=e)(),t}let a=!1;function o(e){const r={get:e=>n(r.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(n(r.store),{[e]:t}):Object.assign(n(r.store),e),r.store.set(n(r.store))},store:i(e)};return r}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("af",{ariaLinkLabel:"Altcha (amptelike webwerf)",enterCode:"Voer kode in",enterCodeAria:"Voer die kode in wat jy hoor. Druk Spasie om die klank af te speel.",error:"Verifikasie het misluk. Probeer later weer.",expired:"Verifikasie het verval. Probeer weer.",footer:'Beskerm deur ALTCHA',getAudioChallenge:"Kry 'n klankuitdaging",label:"Ek is nie 'n robot nie",loading:"Laai...",reload:"Laai weer",verify:"Verifieer",verificationRequired:"Verifikasie is vereis!",verified:"Geverifieer",verifying:"Verifieer...",waitAlert:"Verifieer... wag asseblief.",cancel:"Kanselleer",enterCodeFromImage:"Om voort te gaan, voer asseblief die kode vanaf die onderstaande prentjie in."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/am.js b/js/altcha/i18n/am.js new file mode 100644 index 0000000000..814bafa86c --- /dev/null +++ b/js/altcha/i18n/am.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("am",{ariaLinkLabel:"Altcha (ዋናው ድህረ ገጽ)",enterCode:"ኮድ አስገባ",enterCodeAria:"የሚሰማዎትን ኮድ ያስገቡ። ድምጽ ለመጫወት Space ን ይጫኑ።",error:"ማረጋገጫ አልተሳካም። በኋላ ላይ እንደገና ይሞክሩ።",expired:"ማረጋገጫው ጊዜው አልፏል። እንደገና ይሞክሩ።",footer:'በ ALTCHA የተጠበቀ',getAudioChallenge:"የድምጽ ፈተና ያግኙ",label:"እኔ ሮቦት አይደለሁም",loading:"በመጫን ላይ...",reload:"እንደገና ጫን",verify:"አረጋግጥ",verificationRequired:"ማረጋገጫ ያስፈልጋል!",verified:"ተረጋግጧል",verifying:"በማረጋገጥ ላይ...",waitAlert:"በማረጋገጥ ላይ... እባክዎ ይጠብቁ።",cancel:"ይቅር",enterCodeFromImage:"ለመቀጠል፣ እባክዎን ከታች ካለው ምስል ኮዱን ያስገቡ።"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ar.js b/js/altcha/i18n/ar.js new file mode 100644 index 0000000000..8600d9bc63 --- /dev/null +++ b/js/altcha/i18n/ar.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ar",{ariaLinkLabel:"Altcha (الموقع الرسمي)",enterCode:"أدخل الرمز",enterCodeAria:"أدخل الرمز الذي تسمعه. اضغط على المسافة لتشغيل الصوت.",error:"فشل التحقق. حاول مرة أخرى لاحقاً.",expired:"انتهت صلاحية التحقق. حاول مرة أخرى.",footer:'محمي بواسطة ALTCHA',getAudioChallenge:"احصل على تحدي صوتي",label:"أنا لست روبوتاً",loading:"جارٍ التحميل...",reload:"إعادة تحميل",verify:"تحقق",verificationRequired:"مطلوب التحقق!",verified:"تم التحقق",verifying:"جارٍ التحقق...",waitAlert:"جارٍ التحقق... يرجى الانتظار.",cancel:"إلغاء",enterCodeFromImage:"للمتابعة، يرجى إدخال الرمز من الصورة أدناه."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/az.js b/js/altcha/i18n/az.js new file mode 100644 index 0000000000..b4b18c1444 --- /dev/null +++ b/js/altcha/i18n/az.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function n(n,t,i){if(null==n)return t(void 0),e;const l=function(){var e=r;try{return r=!0,n.subscribe(t,i)}finally{r=e}}();return l.unsubscribe?()=>l.unsubscribe():l}const t=[];function i(n,i=e){let l=null;const r=new Set;function a(e){if(a=e,((i=n)!=i?a==a:i!==a||null!==i&&"object"==typeof i||"function"==typeof i)&&(n=e,l)){const e=!t.length;for(const e of r)e[1](),t.push(e,n);if(e){for(let e=0;e{r.delete(d),0===r.size&&l&&(l(),l=null)}}}}function l(e){let t;return n(e,e=>t=e)(),t}let r=!1;function a(e){const n={get:e=>l(n.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(l(n.store),{[e]:t}):Object.assign(l(n.store),e),n.store.set(l(n.store))},store:i(e)};return n}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:a({}),i18n:a({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("az",{ariaLinkLabel:"Altcha (rəsmi vebsayt)",enterCode:"Kodu daxil edin",enterCodeAria:"Eşitdiyiniz kodu daxil edin. Səsi dinləmək üçün Boşluq düyməsinə basın.",error:"Təsdiqləmə uğursuz oldu. Daha sonra yenidən cəhd edin.",expired:"Təsdiqləmə vaxtı bitdi. Yenidən cəhd edin.",footer:'Qorunur ALTCHA tərəfindən',getAudioChallenge:"Audio tapşırıq alın",label:"Mən robot deyiləm",loading:"Yüklənir...",reload:"Yenilə",verify:"Təsdiqlə",verificationRequired:"Təsdiqləmə tələb olunur!",verified:"Təsdiqləndi",verifying:"Təsdiqlənir...",waitAlert:"Təsdiqlənir... zəhmət olmasa gözləyin.",cancel:"İmtina et",enterCodeFromImage:"Davam etmək üçün, zəhmət olmasa aşağıdakı şəkildəki kodu daxil edin."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/be.js b/js/altcha/i18n/be.js new file mode 100644 index 0000000000..1dac2482c7 --- /dev/null +++ b/js/altcha/i18n/be.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("be",{ariaLinkLabel:"Altcha (афіцыйны сайт)",enterCode:"Увядзіце код",enterCodeAria:"Увядзіце код, які вы чуеце. Націсніце прабел, каб прайграць аўдыё.",error:"Праверка не прайшла. Паспрабуйце пазней.",expired:"Тэрмін праверкі скончыўся. Паспрабуйце зноў.",footer:'Абаронена ALTCHA',getAudioChallenge:"Атрымаць аўдыё выклік",label:"Я не робат",loading:"Загрузка...",reload:"Перазагрузіць",verify:"Праверыць",verificationRequired:"Патрабуецца праверка!",verified:"Праверана",verifying:"Правяраем...",waitAlert:"Праверка... калі ласка, пачакайце.",cancel:"Скасаваць",enterCodeFromImage:"Каб працягнуць, увядзіце код з малюнка ніжэй."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/bg.js b/js/altcha/i18n/bg.js new file mode 100644 index 0000000000..0393b91e00 --- /dev/null +++ b/js/altcha/i18n/bg.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("bg",{ariaLinkLabel:"Altcha (официален уебсайт)",enterCode:"Въведете код",enterCodeAria:"Въведете кода, който чувате. Натиснете Space за възпроизвеждане на аудио.",error:"Проверката неуспешна. Моля, опитайте по-късно.",expired:"Времето за проверка изтече. Моля, опитайте отново.",footer:'Защитено от ALTCHA',getAudioChallenge:"Аудио проверка",label:"Аз не съм робот",loading:"Зареждане...",reload:"Презареди",verify:"Провери",verificationRequired:"Изисква се проверка!",verified:"Проверено",verifying:"Проверява се...",waitAlert:"Проверката е в процес... моля изчакайте.",cancel:"Отказ",enterCodeFromImage:"За да продължите, моля, въведете кода от изображението по-долу."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/bn.js b/js/altcha/i18n/bn.js new file mode 100644 index 0000000000..87f069aa70 --- /dev/null +++ b/js/altcha/i18n/bn.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("bn",{ariaLinkLabel:"Altcha (অফিসিয়াল ওয়েবসাইট)",enterCode:"কোড লিখুন",enterCodeAria:"আপনি যে কোড শুনতে পান তা লিখুন। অডিও প্লে করতে স্পেস বাটন টিপুন।",error:"যাচাইকরণ ব্যর্থ হয়েছে। পরে আবার চেষ্টা করুন।",expired:"যাচাইকরণ সময়সীমা শেষ হয়েছে। আবার চেষ্টা করুন।",footer:'দ্বারা সুরক্ষিত ALTCHA',getAudioChallenge:"অডিও চ্যালেঞ্জ নিন",label:"আমি রোবট নই",loading:"লোড হচ্ছে...",reload:"পুনরায় লোড করুন",verify:"যাচাই করুন",verificationRequired:"যাচাই প্রয়োজন!",verified:"যাচাই করা হয়েছে",verifying:"যাচাই করা হচ্ছে...",waitAlert:"যাচাই করা হচ্ছে... দয়া করে অপেক্ষা করুন।",cancel:"বাতিল করুন",enterCodeFromImage:"এগিয়ে যেতে, অনুগ্রহ করে নীচের চিত্র থেকে কোডটি প্রবেশ করান।"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/bs.js b/js/altcha/i18n/bs.js new file mode 100644 index 0000000000..aaf1be2703 --- /dev/null +++ b/js/altcha/i18n/bs.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,i,a){if(null==t)return i(void 0),e;const n=function(){var e=o;try{return o=!0,t.subscribe(i,a)}finally{o=e}}();return n.unsubscribe?()=>n.unsubscribe():n}const i=[];function a(t,a=e){let n=null;const o=new Set;function r(e){if(r=e,((a=t)!=a?r==r:a!==r||null!==a&&"object"==typeof a||"function"==typeof a)&&(t=e,n)){const e=!i.length;for(const e of o)e[1](),i.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&n&&(n(),n=null)}}}}function n(e){let i;return t(e,e=>i=e)(),i}let o=!1;function r(e){const t={get:e=>n(t.store)[e],set:(e,i)=>{"string"==typeof e?Object.assign(n(t.store),{[e]:i}):Object.assign(n(t.store),e),t.store.set(n(t.store))},store:a(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:r({}),i18n:r({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("bs",{ariaLinkLabel:"Altcha (službena web stranica)",enterCode:"Unesite kod",enterCodeAria:"Unesite kod koji čujete. Pritisnite Space da biste pustili zvuk.",error:"Verifikacija nije uspjela. Pokušajte ponovo kasnije.",expired:"Verifikacija je istekla. Pokušajte ponovo.",footer:'Zaštićeno od strane ALTCHA',getAudioChallenge:"Dohvatite audio izazov",label:"Nisam robot",loading:"Učitavanje...",reload:"Ponovno učitaj",verify:"Verifikuj",verificationRequired:"Verifikacija je obavezna!",verified:"Verifikovano",verifying:"Verifikacija u toku...",waitAlert:"Verifikacija u toku... molimo vas da sačekate.",cancel:"Odustani",enterCodeFromImage:"Za nastavak, molimo unesite kod sa slike ispod."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ca.js b/js/altcha/i18n/ca.js new file mode 100644 index 0000000000..cf2c1962f9 --- /dev/null +++ b/js/altcha/i18n/ca.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function r(r,t,i){if(null==r)return t(void 0),e;const n=function(){var e=a;try{return a=!0,r.subscribe(t,i)}finally{a=e}}();return n.unsubscribe?()=>n.unsubscribe():n}const t=[];function i(r,i=e){let n=null;const a=new Set;function o(e){if(o=e,((i=r)!=i?o==o:i!==o||null!==i&&"object"==typeof i||"function"==typeof i)&&(r=e,n)){const e=!t.length;for(const e of a)e[1](),t.push(e,r);if(e){for(let e=0;e{a.delete(c),0===a.size&&n&&(n(),n=null)}}}}function n(e){let t;return r(e,e=>t=e)(),t}let a=!1;function o(e){const r={get:e=>n(r.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(n(r.store),{[e]:t}):Object.assign(n(r.store),e),r.store.set(n(r.store))},store:i(e)};return r}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ca",{ariaLinkLabel:"Altcha (lloc web oficial)",enterCode:"Introdueix el codi",enterCodeAria:"Introdueix el codi que escoltes. Prem Espai per reproduir l’àudio.",error:"Verificació fallida. Torna-ho a provar més tard.",expired:"Verificació expirada. Torna-ho a provar.",footer:'Protegit per ALTCHA',getAudioChallenge:"Obtenir un desafiament d’àudio",label:"No sóc un robot",loading:"Carregant...",reload:"Torna a carregar",verify:"Verificar",verificationRequired:"Es requereix verificació!",verified:"Verificat",verifying:"Verificant...",waitAlert:"Verificant... si us plau, espera.",cancel:"Cancel·la",enterCodeFromImage:"Per continuar, si us plau, introdueix el codi de la imatge següent."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/cs.js b/js/altcha/i18n/cs.js new file mode 100644 index 0000000000..d61c21565c --- /dev/null +++ b/js/altcha/i18n/cs.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,o){if(null==t)return n(void 0),e;const r=function(){var e=s;try{return s=!0,t.subscribe(n,o)}finally{s=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const n=[];function o(t,o=e){let r=null;const s=new Set;function i(e){if(i=e,((o=t)!=o?i==i:o!==i||null!==o&&"object"==typeof o||"function"==typeof o)&&(t=e,r)){const e=!n.length;for(const e of s)e[1](),n.push(e,t);if(e){for(let e=0;e{s.delete(u),0===s.size&&r&&(r(),r=null)}}}}function r(e){let n;return t(e,e=>n=e)(),n}let s=!1;function i(e){const t={get:e=>r(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(r(t.store),{[e]:n}):Object.assign(r(t.store),e),t.store.set(r(t.store))},store:o(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:i({}),i18n:i({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("cs",{ariaLinkLabel:"Altcha (oficiální web)",enterCode:"Zadejte kód",enterCodeAria:"Zadejte kód, který slyšíte. Stisknutím mezerníku přehrajete zvuk.",error:"Ověření selhalo. Zkuste to prosím později.",expired:"Ověření vypršelo. Zkuste to prosím znovu.",footer:'Chráněno pomocí ALTCHA',getAudioChallenge:"Získat audio výzvu",label:"Nejsem robot",loading:"Načítání...",reload:"Znovu načíst",verify:"Ověřit",verificationRequired:"Vyžaduje se ověření!",verified:"Ověřeno",verifying:"Ověřování...",waitAlert:"Probíhá ověření... prosím počkejte.",cancel:"Zrušit",enterCodeFromImage:"Pro pokračování zadejte kód z obrázku níže."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/da.js b/js/altcha/i18n/da.js new file mode 100644 index 0000000000..829dd59b30 --- /dev/null +++ b/js/altcha/i18n/da.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=l;try{return l=!0,t.subscribe(n,r)}finally{l=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const l=new Set;function s(e){if(s=e,((r=t)!=r?s==s:r!==s||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of l)e[1](),n.push(e,t);if(e){for(let e=0;e{l.delete(c),0===l.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let l=!1;function s(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:s({}),i18n:s({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("da",{ariaLinkLabel:"Altcha (officiel hjemmeside)",enterCode:"Indtast kode",enterCodeAria:"Indtast den kode, du hører. Tryk på mellemrumstasten for at afspille lyd.",error:"Verificering mislykkedes. Prøv venligst igen senere.",expired:"Verificering udløbet. Prøv venligst igen.",footer:'Beskyttet af ALTCHA',getAudioChallenge:"Hent lydudfordring",label:"Jeg er ikke en robot",loading:"Indlæser...",reload:"Genindlæs",verify:"Verificer",verificationRequired:"Verificering kræves!",verified:"Verificeret",verifying:"Verificerer...",waitAlert:"Verificerer... vent venligst.",cancel:"Annuller",enterCodeFromImage:"For at fortsætte, bedes du indtaste koden fra billedet herunder."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/de.js b/js/altcha/i18n/de.js new file mode 100644 index 0000000000..bacbecc70f --- /dev/null +++ b/js/altcha/i18n/de.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function n(n,t,r){if(null==n)return t(void 0),e;const i=function(){var e=o;try{return o=!0,n.subscribe(t,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const t=[];function r(n,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=n)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(n=e,i)){const e=!t.length;for(const e of o)e[1](),t.push(e,n);if(e){for(let e=0;e{o.delete(u),0===o.size&&i&&(i(),i=null)}}}}function i(e){let t;return n(e,e=>t=e)(),t}let o=!1;function l(e){const n={get:e=>i(n.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(i(n.store),{[e]:t}):Object.assign(i(n.store),e),n.store.set(i(n.store))},store:r(e)};return n}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("de",{ariaLinkLabel:"Altcha (offizielle Website)",enterCode:"Code eingeben",enterCodeAria:"Geben Sie den Code ein, den Sie hören. Drücken Sie die Leertaste, um die Audio abzuspielen.",error:"Überprüfung fehlgeschlagen. Bitte versuchen Sie es später erneut.",expired:"Überprüfung abgelaufen. Bitte versuchen Sie es erneut.",footer:'Geschützt durch ALTCHA',getAudioChallenge:"Audio-Herausforderung anfordern",label:"Ich bin kein Roboter",loading:"Lade...",reload:"Neu laden",verify:"Überprüfen",verificationRequired:"Überprüfung erforderlich!",verified:"Überprüft",verifying:"Wird überprüft...",waitAlert:"Überprüfung läuft... bitte warten.",cancel:"Abbrechen",enterCodeFromImage:"Um fortzufahren, geben Sie bitte den Code aus dem Bild unten ein."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/el.js b/js/altcha/i18n/el.js new file mode 100644 index 0000000000..f42c6eeb4f --- /dev/null +++ b/js/altcha/i18n/el.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("el",{ariaLinkLabel:"Altcha (επίσημος ιστότοπος)",enterCode:"Εισαγάγετε κωδικό",enterCodeAria:"Εισαγάγετε τον κωδικό που ακούτε. Πατήστε Space για να παίξετε τον ήχο.",error:"Η επαλήθευση απέτυχε. Δοκιμάστε ξανά αργότερα.",expired:"Η επαλήθευση έληξε. Δοκιμάστε ξανά.",footer:'Προστατεύεται από το ALTCHA',getAudioChallenge:"Λήψη ηχητικής δοκιμασίας",label:"Δεν είμαι ρομπότ",loading:"Φόρτωση...",reload:"Επαναφόρτωση",verify:"Επαλήθευση",verificationRequired:"Απαιτείται έλεγχος!",verified:"Επαληθεύτηκε",verifying:"Γίνεται επαλήθευση...",waitAlert:"Γίνεται επαλήθευση... παρακαλώ περιμένετε.",cancel:"Ακύρωση",enterCodeFromImage:"Για να συνεχίσετε, εισάγετε τον κωδικό από την παρακάτω εικόνα."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/es-419.js b/js/altcha/i18n/es-419.js new file mode 100644 index 0000000000..4fa7736087 --- /dev/null +++ b/js/altcha/i18n/es-419.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function r(r,n,a){if(null==r)return n(void 0),e;const i=function(){var e=t;try{return t=!0,r.subscribe(n,a)}finally{t=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function a(r,a=e){let i=null;const t=new Set;function o(e){if(o=e,((a=r)!=a?o==o:a!==o||null!==a&&"object"==typeof a||"function"==typeof a)&&(r=e,i)){const e=!n.length;for(const e of t)e[1](),n.push(e,r);if(e){for(let e=0;e{t.delete(c),0===t.size&&i&&(i(),i=null)}}}}function i(e){let n;return r(e,e=>n=e)(),n}let t=!1;function o(e){const r={get:e=>i(r.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(r.store),{[e]:n}):Object.assign(i(r.store),e),r.store.set(i(r.store))},store:a(e)};return r}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("es-419",{ariaLinkLabel:"Altcha (sitio web oficial)",enterCode:"Ingresa el código",enterCodeAria:"Ingresa el código que escuchas. Presiona Espacio para reproducir el audio.",error:"Falló la verificación. Por favor vuelve a intentarlo más tarde.",expired:"La verificación expiró. Por favor inténtalo de nuevo.",footer:'Protegido por ALTCHA',getAudioChallenge:"Obtener un reto de audio",label:"No soy un robot",loading:"Cargando...",reload:"Volver a cargar",verify:"Verificar",verificationRequired:"¡Verificación requerida!",verified:"Verificado",verifying:"Verificando...",waitAlert:"Verificando... por favor espera.",cancel:"Cancelar",enterCodeFromImage:"Para continuar, ingresa el código de la imagen a continuación."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/es-es.js b/js/altcha/i18n/es-es.js new file mode 100644 index 0000000000..6065b3e046 --- /dev/null +++ b/js/altcha/i18n/es-es.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const a=function(){var e=i;try{return i=!0,t.subscribe(n,r)}finally{i=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const n=[];function r(t,r=e){let a=null;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,a)){const e=!n.length;for(const e of i)e[1](),n.push(e,t);if(e){for(let e=0;e{i.delete(l),0===i.size&&a&&(a(),a=null)}}}}function a(e){let n;return t(e,e=>n=e)(),n}let i=!1;function o(e){const t={get:e=>a(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(a(t.store),{[e]:n}):Object.assign(a(t.store),e),t.store.set(a(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("es-es",{ariaLinkLabel:"Altcha (sitio web oficial)",enterCode:"Introduce el código",enterCodeAria:"Introduce el código que escuchas. Pulsa Espacio para reproducir el audio.",error:"Falló la verificación. Por favor intente nuevamente más tarde.",expired:"Verificación expirada. Por favor intente nuevamente.",footer:'Protegido por ALTCHA',getAudioChallenge:"Obtener un desafío de audio",label:"No soy un robot",loading:"Cargando...",reload:"Recargar",verify:"Verificar",verificationRequired:"¡Verificación requerida!",verified:"Verificado",verifying:"Verificando...",waitAlert:"Verificando... por favor espere.",cancel:"Cancelar",enterCodeFromImage:"Para continuar, introduzca el código de la imagen de abajo."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/et.js b/js/altcha/i18n/et.js new file mode 100644 index 0000000000..edec06d154 --- /dev/null +++ b/js/altcha/i18n/et.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,i,n){if(null==t)return i(void 0),e;const a=function(){var e=o;try{return o=!0,t.subscribe(i,n)}finally{o=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const i=[];function n(t,n=e){let a=null;const o=new Set;function l(e){if(l=e,((n=t)!=n?l==l:n!==l||null!==n&&"object"==typeof n||"function"==typeof n)&&(t=e,a)){const e=!i.length;for(const e of o)e[1](),i.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&a&&(a(),a=null)}}}}function a(e){let i;return t(e,e=>i=e)(),i}let o=!1;function l(e){const t={get:e=>a(t.store)[e],set:(e,i)=>{"string"==typeof e?Object.assign(a(t.store),{[e]:i}):Object.assign(a(t.store),e),t.store.set(a(t.store))},store:n(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("et",{ariaLinkLabel:"Altcha (ametlik veebisait)",enterCode:"Sisesta kood",enterCodeAria:"Sisestage kuuldu kood. Vajutage tühikut, et esitada heli.",error:"Kinnitamine ebaõnnestus. Proovi hiljem uuesti.",expired:"Kinnitamine aegus. Proovi uuesti.",footer:'Kaitstud ALTCHA poolt',getAudioChallenge:"Hangi heliülesanne",label:"Ma ei ole robot",loading:"Laadimine...",reload:"Laadi uuesti",verify:"Kinnita",verificationRequired:"Kontroll on vajalik!",verified:"Kinnitatud",verifying:"Kinnitamine...",waitAlert:"Kinnitamine... palun oota.",cancel:"Tühista",enterCodeFromImage:"Jätkamiseks sisestage alloleval pildil olev kood."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/eu.js b/js/altcha/i18n/eu.js new file mode 100644 index 0000000000..13c9ccdfd5 --- /dev/null +++ b/js/altcha/i18n/eu.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,a,i){if(null==t)return a(void 0),e;const r=function(){var e=n;try{return n=!0,t.subscribe(a,i)}finally{n=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const a=[];function i(t,i=e){let r=null;const n=new Set;function o(e){if(o=e,((i=t)!=i?o==o:i!==o||null!==i&&"object"==typeof i||"function"==typeof i)&&(t=e,r)){const e=!a.length;for(const e of n)e[1](),a.push(e,t);if(e){for(let e=0;e{n.delete(l),0===n.size&&r&&(r(),r=null)}}}}function r(e){let a;return t(e,e=>a=e)(),a}let n=!1;function o(e){const t={get:e=>r(t.store)[e],set:(e,a)=>{"string"==typeof e?Object.assign(r(t.store),{[e]:a}):Object.assign(r(t.store),e),t.store.set(r(t.store))},store:i(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("eu",{ariaLinkLabel:"Altcha (webgune ofiziala)",enterCode:"Sartu kodea",enterCodeAria:"Sartu entzun duzun kodea. Sakatu Espazioa audioa erreproduzitzeko.",error:"Egiaztatzeak huts egin du. Saiatu berriro geroago.",expired:"Egiaztatzea iraungi da. Saiatu berriro.",footer:'ALTCHAk babestuta',getAudioChallenge:"Jaso audio-erronka bat",label:"Ez naiz robot bat",loading:"Kargatzen...",reload:"Birkargatu",verify:"Egiaztatu",verificationRequired:"Egiaztatzea beharrezkoa da!",verified:"Egiaztatuta",verifying:"Egiaztatzen...",waitAlert:"Egiaztatzen... itxaron mesedez.",cancel:"Utzi",enterCodeFromImage:"Jarraitzeko, idatzi beheko irudiko kodea."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/fa.js b/js/altcha/i18n/fa.js new file mode 100644 index 0000000000..9b28285f69 --- /dev/null +++ b/js/altcha/i18n/fa.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("fa",{ariaLinkLabel:"Altcha (وب‌سایت رسمی)",enterCode:"کد را وارد کنید",enterCodeAria:"کدی که می‌شنوید را وارد کنید. برای پخش صدا Space را فشار دهید.",error:"احراز هویت ناموفق بود. بعداً دوباره تلاش کنید.",expired:"احراز هویت منقضی شد. دوباره تلاش کنید.",footer:'محافظت شده توسط ALTCHA',getAudioChallenge:"دریافت چالش صوتی",label:"من ربات نیستم",loading:"در حال بارگذاری...",reload:"بارگذاری مجدد",verify:"تایید",verificationRequired:"احراز هویت لازم است!",verified:"تایید شد",verifying:"در حال تایید...",waitAlert:"در حال تایید... لطفا منتظر بمانید.",cancel:"لغو کردن",enterCodeFromImage:"برای ادامه، لطفاً کد تصویر زیر را وارد کنید."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/fi.js b/js/altcha/i18n/fi.js new file mode 100644 index 0000000000..b50a49d5f1 --- /dev/null +++ b/js/altcha/i18n/fi.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,a){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,a)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function a(t,a=e){let i=null;const o=new Set;function l(e){if(l=e,((a=t)!=a?l==l:a!==l||null!==a&&"object"==typeof a||"function"==typeof a)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:a(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("fi",{ariaLinkLabel:"Altcha (virallinen verkkosivusto)",enterCode:"Syötä koodi",enterCodeAria:"Kirjoita kuulemasi koodi. Paina välilyöntiä toistaaksesi äänen.",error:"Varmennus epäonnistui. Yritä myöhemmin uudelleen.",expired:"Varmennus vanhentui. Yritä uudelleen.",footer:'Suojattu ALTCHA:lla',getAudioChallenge:"Hae äänitehtävä",label:"En ole robotti",loading:"Ladataan...",reload:"Lataa uudelleen",verify:"Vahvista",verificationRequired:"Vahvistus vaaditaan!",verified:"Vahvistettu",verifying:"Vahvistetaan...",waitAlert:"Vahvistetaan... odota hetki.",cancel:"Peruuta",enterCodeFromImage:"Jatkaaksesi, syötä alla olevan kuvan koodi."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/fr-ca.js b/js/altcha/i18n/fr-ca.js new file mode 100644 index 0000000000..f879a4cbce --- /dev/null +++ b/js/altcha/i18n/fr-ca.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function a(e){if(a=e,((r=t)!=r?a==a:r!==a||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function a(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:a({}),i18n:a({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("fr-ca",{ariaLinkLabel:"Altcha (site officiel)",enterCode:"Entrez le code",enterCodeAria:"Entrez le code que vous entendez. Appuyez sur la barre d'espace pour écouter l'audio.",error:"Échec de la vérification. Réessayez plus tard.",expired:"La vérification a expiré. Réessayez.",footer:'Protégé par ALTCHA',getAudioChallenge:"Obtenir un défi audio",label:"Je ne suis pas un robot",loading:"Chargement...",reload:"Recharger",verify:"Vérifier",verificationRequired:"Vérification requise !",verified:"Vérifié",verifying:"Vérification en cours...",waitAlert:"Vérification en cours... veuillez patienter.",cancel:"Annuler",enterCodeFromImage:"Pour continuer, veuillez entrer le code de l'image ci-dessous."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/fr-fr.js b/js/altcha/i18n/fr-fr.js new file mode 100644 index 0000000000..aef92eadee --- /dev/null +++ b/js/altcha/i18n/fr-fr.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function a(e){if(a=e,((r=t)!=r?a==a:r!==a||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function a(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:a({}),i18n:a({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("fr-fr",{ariaLinkLabel:"Altcha (site officiel)",enterCode:"Entrez le code",enterCodeAria:"Entrez le code que vous entendez. Appuyez sur Espace pour écouter l'audio.",error:"Échec de la vérification. Essayez à nouveau plus tard.",expired:"La vérification a expiré. Essayez à nouveau.",footer:'Protégé par ALTCHA',getAudioChallenge:"Obtenir un défi audio",label:"Je ne suis pas un robot",loading:"Chargement...",reload:"Recharger",verify:"Vérifier",verificationRequired:"Vérification requise !",verified:"Vérifié",verifying:"Vérification en cours...",waitAlert:"Vérification en cours... veuillez patienter.",cancel:"Annuler",enterCodeFromImage:"Pour continuer, veuillez entrer le code de l'image ci-dessous."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ga.js b/js/altcha/i18n/ga.js new file mode 100644 index 0000000000..785beeae87 --- /dev/null +++ b/js/altcha/i18n/ga.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,i,n){if(null==t)return i(void 0),e;const a=function(){var e=r;try{return r=!0,t.subscribe(i,n)}finally{r=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const i=[];function n(t,n=e){let a=null;const r=new Set;function l(e){if(l=e,((n=t)!=n?l==l:n!==l||null!==n&&"object"==typeof n||"function"==typeof n)&&(t=e,a)){const e=!i.length;for(const e of r)e[1](),i.push(e,t);if(e){for(let e=0;e{r.delete(c),0===r.size&&a&&(a(),a=null)}}}}function a(e){let i;return t(e,e=>i=e)(),i}let r=!1;function l(e){const t={get:e=>a(t.store)[e],set:(e,i)=>{"string"==typeof e?Object.assign(a(t.store),{[e]:i}):Object.assign(a(t.store),e),t.store.set(a(t.store))},store:n(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ga",{ariaLinkLabel:"Altcha (láithreán gréasáin oifigiúil)",enterCode:"Iontráil cód",enterCodeAria:"Cuir isteach an cód a chloiseann tú. Brúigh Spás chun an fuaime a sheinm.",error:"Theip ar an bhfíorú. Bain triail eile as níos déanaí.",expired:"Tá an fíorú as feidhm. Bain triail eile as.",footer:'Cosanta ag ALTCHA',getAudioChallenge:"Faigh dúshlán fuaime",label:"Níl mé i mo róbat",loading:"Á luchtú...",reload:"Athluchtaigh",verify:"Fíoraigh",verificationRequired:"Fíorú riachtanach!",verified:"Fíoraithe",verifying:"Fíorú ar siúl...",waitAlert:"Fíorú ar siúl... fan go fóill.",cancel:"Cealaigh",enterCodeFromImage:"Chun dul ar aghaidh, le do thoil cuir isteach an cód ón íomhá thíos."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/he.js b/js/altcha/i18n/he.js new file mode 100644 index 0000000000..666feb9cd7 --- /dev/null +++ b/js/altcha/i18n/he.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("he",{ariaLinkLabel:"Altcha (אתר רשמי)",enterCode:"הזן קוד",enterCodeAria:"הזן את הקוד שאתה שומע. לחץ על רווח להפעלת השמע.",error:"האימות נכשל. נסה שוב מאוחר יותר.",expired:"תוקף האימות פג. נסה שוב.",footer:'מוגן על ידי ALTCHA',getAudioChallenge:"קבל אתגר שמע",label:"אני לא רובוט",loading:"טוען...",reload:"טען מחדש",verify:"אמת",verificationRequired:"נדרש אימות!",verified:"אומת",verifying:"מאמת...",waitAlert:"מבצע אימות... אנא המתן.",cancel:"ביטול",enterCodeFromImage:"כדי להמשיך, אנא הזן את הקוד מהתמונה למטה."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/hi.js b/js/altcha/i18n/hi.js new file mode 100644 index 0000000000..3be1d41887 --- /dev/null +++ b/js/altcha/i18n/hi.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("hi",{ariaLinkLabel:"Altcha (आधिकारिक वेबसाइट)",enterCode:"कोड दर्ज करेंं",enterCodeAria:"आप जो कोड सुनते हैं उसे दर्ज करें। ऑडियो चलाने के लिए स्पेस दबाएं।",error:"सत्यापन विफल। कृपया बाद में फिर से प्रयास करें।",expired:"सत्यापन समाप्त हो गया है। कृपया पुनः प्रयास करें।",footer:'द्वारा संरक्षित ALTCHA',getAudioChallenge:"ऑडियो चुनौती प्राप्त करें",label:"मैं रोबोट नहीं हूँ",loading:"लोड हो रहा है...",reload:"पुनः लोड करें",verify:"सत्यापित करें",verificationRequired:"सत्यापन आवश्यक है!",verified:"सत्यापित",verifying:"सत्यापित कर रहे हैं...",waitAlert:"सत्यापित किया जा रहा है... कृपया प्रतीक्षा करें।",cancel:"रद्द करें",enterCodeFromImage:"आगे बढ़ने के लिए, कृपया नीचे दी गई छवि से कोड दर्ज करें।"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/hr.js b/js/altcha/i18n/hr.js new file mode 100644 index 0000000000..5d03b0ea2e --- /dev/null +++ b/js/altcha/i18n/hr.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,o){if(null==t)return n(void 0),e;const r=function(){var e=a;try{return a=!0,t.subscribe(n,o)}finally{a=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const n=[];function o(t,o=e){let r=null;const a=new Set;function i(e){if(i=e,((o=t)!=o?i==i:o!==i||null!==o&&"object"==typeof o||"function"==typeof o)&&(t=e,r)){const e=!n.length;for(const e of a)e[1](),n.push(e,t);if(e){for(let e=0;e{a.delete(u),0===a.size&&r&&(r(),r=null)}}}}function r(e){let n;return t(e,e=>n=e)(),n}let a=!1;function i(e){const t={get:e=>r(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(r(t.store),{[e]:n}):Object.assign(r(t.store),e),t.store.set(r(t.store))},store:o(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:i({}),i18n:i({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("hr",{ariaLinkLabel:"Altcha (službena web stranica)",enterCode:"Unesite kod",enterCodeAria:"Unesite kod koji čujete. Pritisnite razmaknicu za reprodukciju zvuka.",error:"Provjera nije uspjela. Molimo pokušajte kasnije.",expired:"Provjera je istekla. Molimo pokušajte ponovo.",footer:'Zaštićeno od strane ALTCHA',getAudioChallenge:"Audio provjera",label:"Ja nisam robot",loading:"Učitavanje...",reload:"Ponovno učitaj",verify:"Provjeri",verificationRequired:"Potrebna je provjera!",verified:"Provjereno",verifying:"Provjeravanje...",waitAlert:"Provjera je u tijeku... molimo pričekajte.",cancel:"Odustani",enterCodeFromImage:"Za nastavak molimo unesite kod sa slike ispod."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/hu.js b/js/altcha/i18n/hu.js new file mode 100644 index 0000000000..2cb2aa405c --- /dev/null +++ b/js/altcha/i18n/hu.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,l,n){if(null==t)return l(void 0),e;const a=function(){var e=r;try{return r=!0,t.subscribe(l,n)}finally{r=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const l=[];function n(t,n=e){let a=null;const r=new Set;function s(e){if(s=e,((n=t)!=n?s==s:n!==s||null!==n&&"object"==typeof n||"function"==typeof n)&&(t=e,a)){const e=!l.length;for(const e of r)e[1](),l.push(e,t);if(e){for(let e=0;e{r.delete(c),0===r.size&&a&&(a(),a=null)}}}}function a(e){let l;return t(e,e=>l=e)(),l}let r=!1;function s(e){const t={get:e=>a(t.store)[e],set:(e,l)=>{"string"==typeof e?Object.assign(a(t.store),{[e]:l}):Object.assign(a(t.store),e),t.store.set(a(t.store))},store:n(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:s({}),i18n:s({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("hu",{ariaLinkLabel:"Altcha (hivatalos weboldal)",enterCode:"Írja be a kódot",enterCodeAria:"Írja be a hallott kódot. Nyomja meg a Szóköz billentyűt a hang lejátszásához.",error:"A hitelesítés nem sikerült. Próbáld meg később újra.",expired:"A hitelesítés lejárt. Próbáld újra.",footer:'Védve a következő által: ALTCHA',getAudioChallenge:"Hangalapú kihívás kérése",label:"Nem vagyok robot",loading:"Betöltés...",reload:"Újratöltés",verify:"Ellenőrzés",verificationRequired:"Ellenőrzés szükséges!",verified:"Ellenőrizve",verifying:"Ellenőrzés folyamatban...",waitAlert:"Ellenőrzés folyamatban... kérlek várj.",cancel:"Mégse",enterCodeFromImage:"A folytatáshoz, kérjük, adja meg az alábbi kép kódját."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/hy.js b/js/altcha/i18n/hy.js new file mode 100644 index 0000000000..90afa65367 --- /dev/null +++ b/js/altcha/i18n/hy.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("hy",{ariaLinkLabel:"Altcha (պաշտոնական կայք)",enterCode:"Մուտքագրեք կոդը",enterCodeAria:"Մուտքագրեք այն կոդը, որը լսում եք։ Ձայնը նվագելու համար սեղմեք բացատ (Space):",error:"Հաստատումը ձախողվեց։ Փորձեք ավելի ուշ։",expired:"Հաստատման ժամկետը լրացել է։ Փորձեք կրկին։",footer:'Պաշտպանված է ALTCHA-ի կողմից',getAudioChallenge:"Ստանալ ձայնային առաջադրանք",label:"Ես ռոբոտ չեմ",loading:"Բեռնվում է...",reload:"Թարմացնել",verify:"Հաստատել",verificationRequired:"Պահանջվում է հաստատում։",verified:"Հաստատված է",verifying:"Հաստատվում է...",waitAlert:"Հաստատվում է... խնդրում ենք սպասել։",cancel:"Չեղարկել",enterCodeFromImage:"Շարունակելու համար, խնդրում ենք մուտագրել ստորև պատկերից վերցված կոդը:"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/id.js b/js/altcha/i18n/id.js new file mode 100644 index 0000000000..5c852be870 --- /dev/null +++ b/js/altcha/i18n/id.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function a(a,t,n){if(null==a)return t(void 0),e;const i=function(){var e=r;try{return r=!0,a.subscribe(t,n)}finally{r=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const t=[];function n(a,n=e){let i=null;const r=new Set;function s(e){if(s=e,((n=a)!=n?s==s:n!==s||null!==n&&"object"==typeof n||"function"==typeof n)&&(a=e,i)){const e=!t.length;for(const e of r)e[1](),t.push(e,a);if(e){for(let e=0;e{r.delete(u),0===r.size&&i&&(i(),i=null)}}}}function i(e){let t;return a(e,e=>t=e)(),t}let r=!1;function s(e){const a={get:e=>i(a.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(i(a.store),{[e]:t}):Object.assign(i(a.store),e),a.store.set(i(a.store))},store:n(e)};return a}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:s({}),i18n:s({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("id",{ariaLinkLabel:"Altcha (situs web resmi)",enterCode:"Masukkan kode",enterCodeAria:"Masukkan kode yang Anda dengar. Tekan Spasi untuk memutar audio.",error:"Verifikasi gagal. Coba lagi nanti.",expired:"Verifikasi telah kedaluwarsa. Coba lagi.",footer:'Dilindungi oleh ALTCHA',getAudioChallenge:"Dapatkan tantangan audio",label:"Saya bukan robot",loading:"Memuat...",reload:"Muat ulang",verify:"Verifikasi",verificationRequired:"Verifikasi diperlukan!",verified:"Terverifikasi",verifying:"Memverifikasi...",waitAlert:"Memverifikasi... harap tunggu.",cancel:"Batal",enterCodeFromImage:"Untuk melanjutkan, silakan masukkan kode dari gambar di bawah ini."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/is.js b/js/altcha/i18n/is.js new file mode 100644 index 0000000000..91bd729d89 --- /dev/null +++ b/js/altcha/i18n/is.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,a){if(null==t)return n(void 0),e;const r=function(){var e=i;try{return i=!0,t.subscribe(n,a)}finally{i=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const n=[];function a(t,a=e){let r=null;const i=new Set;function s(e){if(s=e,((a=t)!=a?s==s:a!==s||null!==a&&"object"==typeof a||"function"==typeof a)&&(t=e,r)){const e=!n.length;for(const e of i)e[1](),n.push(e,t);if(e){for(let e=0;e{i.delete(u),0===i.size&&r&&(r(),r=null)}}}}function r(e){let n;return t(e,e=>n=e)(),n}let i=!1;function s(e){const t={get:e=>r(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(r(t.store),{[e]:n}):Object.assign(r(t.store),e),t.store.set(r(t.store))},store:a(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:s({}),i18n:s({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("is",{ariaLinkLabel:"Altcha (opinber vefsíða)",enterCode:"Sláðu inn kóða",enterCodeAria:"Sláðu inn kóðann sem þú heyrir. Ýttu á Space til að spila hljóðið.",error:"Staðfesting mistókst. Reyndu aftur síðar.",expired:"Staðfesting er útrunnin. Reyndu aftur.",footer:'Verndað af ALTCHA',getAudioChallenge:"Fá hljóðáskorun",label:"Ég er ekki robot",loading:"Hleður...",reload:"Hleð aftur",verify:"Staðfesta",verificationRequired:"Staðfesting er nauðsynleg!",verified:"Staðfest",verifying:"Að staðfesta...",waitAlert:"Að staðfesta... vinsamlegast bíða.",cancel:"Hætta við",enterCodeFromImage:"Til að halda áfram, vinsamlegast sláðu inn kóðann af myndinni hér að neðan."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/it.js b/js/altcha/i18n/it.js new file mode 100644 index 0000000000..e3dd59bd9e --- /dev/null +++ b/js/altcha/i18n/it.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function i(i,t,n){if(null==i)return t(void 0),e;const r=function(){var e=a;try{return a=!0,i.subscribe(t,n)}finally{a=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const t=[];function n(i,n=e){let r=null;const a=new Set;function o(e){if(o=e,((n=i)!=n?o==o:n!==o||null!==n&&"object"==typeof n||"function"==typeof n)&&(i=e,r)){const e=!t.length;for(const e of a)e[1](),t.push(e,i);if(e){for(let e=0;e{a.delete(l),0===a.size&&r&&(r(),r=null)}}}}function r(e){let t;return i(e,e=>t=e)(),t}let a=!1;function o(e){const i={get:e=>r(i.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(r(i.store),{[e]:t}):Object.assign(r(i.store),e),i.store.set(r(i.store))},store:n(e)};return i}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("it",{ariaLinkLabel:"Altcha (sito ufficiale)",enterCode:"Inserisci il codice",enterCodeAria:"Inserisci il codice che senti. Premi Spazio per riprodurre l'audio.",error:"Verifica fallita. Riprova più tardi.",expired:"Verifica scaduta. Riprova.",footer:'Protetto da ALTCHA',getAudioChallenge:"Ottieni una sfida audio",label:"Non sono un robot",loading:"Caricamento...",reload:"Ricarica",verify:"Verifica",verificationRequired:"Verifica richiesta!",verified:"Verificato",verifying:"Verifica in corso...",waitAlert:"Verifica in corso... attendere.",cancel:"Annulla",enterCodeFromImage:"Per procedere, inserisci il codice dall'immagine sottostante."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ja.js b/js/altcha/i18n/ja.js new file mode 100644 index 0000000000..6b93e119f9 --- /dev/null +++ b/js/altcha/i18n/ja.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ja",{ariaLinkLabel:"Altcha (公式ウェブサイト)",enterCode:"コードを入力",enterCodeAria:"聞こえるコードを入力してください。スペースキーを押して音声を再生します。",error:"認証に失敗しました。後でもう一度試してください。",expired:"認証が期限切れです。再試行してください。",footer:'保護されています ALTCHA',getAudioChallenge:"音声チャレンジを取得",label:"私はロボットではありません",loading:"読み込み中...",reload:"再読み込み",verify:"確認",verificationRequired:"認証が必要です!",verified:"確認済み",verifying:"確認中...",waitAlert:"確認中...少々お待ちください。",cancel:"キャンセル",enterCodeFromImage:"続行するには、以下の画像からコードを入力してください。"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ka.js b/js/altcha/i18n/ka.js new file mode 100644 index 0000000000..2e16adf68c --- /dev/null +++ b/js/altcha/i18n/ka.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ka",{ariaLinkLabel:"Altcha (ოფიციალური ვებსაიტი)",enterCode:"შეიყვანეთ კოდი",enterCodeAria:"შეიყვანეთ კოდი, რომელსაც გაიგონებთ. აუდიოს მოსასმენად დააჭირეთ Space-ს.",error:"ვერიფიკაცია ჩაიშალა. სცადეთ მოგვიანებით.",expired:"ვერიფიკაციის ვადა გავიდა. სცადეთ ხელახლა.",footer:'დაცულია ALTCHA-ით',getAudioChallenge:"მიიღეთ აუდიო გამოწვევა",label:"მე არ ვარ რობოტი",loading:"იტვირთება...",reload:"განახლება",verify:"დადასტურება",verificationRequired:"საჭიროა ვერიფიკაცია!",verified:"დადასტურებულია",verifying:"დადასტურება მიმდინარეობს...",waitAlert:"დადასტურება მიმდინარეობს... გთხოვთ, დაიცადეთ.",cancel:"გაუქმება",enterCodeFromImage:"გაგრძელების მიზნით, გთხოვთ შეიყვანოთ კოდი ქვემოთ მოცემული სურათიდან."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/kk.js b/js/altcha/i18n/kk.js new file mode 100644 index 0000000000..0bfe011318 --- /dev/null +++ b/js/altcha/i18n/kk.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("kk",{ariaLinkLabel:"Altcha (ресми веб-сайт)",enterCode:"Кодты енгізіңіз",enterCodeAria:"Естіген кодыңызды енгізіңіз. Аудионы ойнату үшін Бос орынды басыңыз.",error:"Тексеру сәтсіз аяқталды. Кейінірек қайталаңыз.",expired:"Тексеру мерзімі аяқталды. Қайталаңыз.",footer:'ALTCHA қорғайды',getAudioChallenge:"Аудио сынақ алу",label:"Мен робот емеспін",loading:"Жүктелуде...",reload:"Қайта жүктеу",verify:"Тексеру",verificationRequired:"Тексеру талап етіледі!",verified:"Тексерілді",verifying:"Тексеруде...",waitAlert:"Тексерілуде... күте тұрыңыз.",cancel:"Болдыру",enterCodeFromImage:"Жалғастыру үшін төмендегі суреттегі кодты енгізіңіз."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ko.js b/js/altcha/i18n/ko.js new file mode 100644 index 0000000000..053886a5d1 --- /dev/null +++ b/js/altcha/i18n/ko.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const o=function(){var e=i;try{return i=!0,t.subscribe(n,r)}finally{i=e}}();return o.unsubscribe?()=>o.unsubscribe():o}const n=[];function r(t,r=e){let o=null;const i=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,o)){const e=!n.length;for(const e of i)e[1](),n.push(e,t);if(e){for(let e=0;e{i.delete(c),0===i.size&&o&&(o(),o=null)}}}}function o(e){let n;return t(e,e=>n=e)(),n}let i=!1;function l(e){const t={get:e=>o(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(o(t.store),{[e]:n}):Object.assign(o(t.store),e),t.store.set(o(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ko",{ariaLinkLabel:"Altcha (공식 웹사이트)",enterCode:"코드 입력",enterCodeAria:"들리는 코드를 입력하세요. 스페이스 바를 눌러 오디오를 재생합니다.",error:"인증 실패. 나중에 다시 시도해주세요.",expired:"인증이 만료되었습니다. 다시 시도해주세요.",footer:'ALTCHA에서 보호됨 ALTCHA',getAudioChallenge:"오디오 챌린지 받기",label:"저는 로봇이 아닙니다",loading:"로딩 중...",reload:"새로 고침",verify:"확인",verificationRequired:"인증이 필요합니다!",verified:"확인됨",verifying:"확인 중...",waitAlert:"확인 중... 잠시만 기다려주세요.",cancel:"취소",enterCodeFromImage:"계속 진행하려면 아래 이미지에서 코드를 입력하세요."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/lb.js b/js/altcha/i18n/lb.js new file mode 100644 index 0000000000..79d66704d2 --- /dev/null +++ b/js/altcha/i18n/lb.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,i){if(null==t)return n(void 0),e;const r=function(){var e=o;try{return o=!0,t.subscribe(n,i)}finally{o=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const n=[];function i(t,i=e){let r=null;const o=new Set;function a(e){if(a=e,((i=t)!=i?a==a:i!==a||null!==i&&"object"==typeof i||"function"==typeof i)&&(t=e,r)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&r&&(r(),r=null)}}}}function r(e){let n;return t(e,e=>n=e)(),n}let o=!1;function a(e){const t={get:e=>r(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(r(t.store),{[e]:n}):Object.assign(r(t.store),e),t.store.set(r(t.store))},store:i(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:a({}),i18n:a({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("lb",{ariaLinkLabel:"Altcha (offiziell Websäit)",enterCode:"Code aginn",enterCodeAria:"Gitt de Code an deen dir héiert. Dréckt op d'Weltraumtast fir Audio ofzespillen.",error:"Verifikatioun ass feelgeschloen. Probéiert méi spéit nach emol.",expired:"Verifikatioun ofgelaf. Probéiert nach emol.",footer:'Geschützt vun ALTCHA',getAudioChallenge:"Kritt eng Audio-Herausfuerderung",label:"Ech sinn keen Robot",loading:"Lueden...",reload:"Nei lueden",verify:"Verifizéieren",verificationRequired:"Verifikatioun néideg!",verified:"Verifizéiert",verifying:"Verifizéieren...",waitAlert:"Verifizéieren... waart wgl.",cancel:"Ofbriechen",enterCodeFromImage:"Fir virun ze fueren, gitt wgl. de Code aus dem Bild hei drënner an."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/lt.js b/js/altcha/i18n/lt.js new file mode 100644 index 0000000000..3c310f27d8 --- /dev/null +++ b/js/altcha/i18n/lt.js @@ -0,0 +1 @@ +(()=>{"use strict";const t=()=>{};function e(e,i,a){if(null==e)return i(void 0),t;const n=function(){var t=r;try{return r=!0,e.subscribe(i,a)}finally{r=t}}();return n.unsubscribe?()=>n.unsubscribe():n}const i=[];function a(e,a=t){let n=null;const r=new Set;function o(t){if(o=t,((a=e)!=a?o==o:a!==o||null!==a&&"object"==typeof a||"function"==typeof a)&&(e=t,n)){const t=!i.length;for(const t of r)t[1](),i.push(t,e);if(t){for(let t=0;t{r.delete(u),0===r.size&&n&&(n(),n=null)}}}}function n(t){let i;return e(t,t=>i=t)(),i}let r=!1;function o(t){const e={get:t=>n(e.store)[t],set:(t,i)=>{"string"==typeof t?Object.assign(n(e.store),{[t]:i}):Object.assign(n(e.store),t),e.store.set(n(e.store))},store:a(t)};return e}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("lt",{ariaLinkLabel:"Altcha (oficiali svetainė)",enterCode:"Įveskite kodą",enterCodeAria:"Įveskite girdimą kodą. Paspauskite tarpo klavišą, kad grotumėte garso įrašą.",error:"Patvirtinimas nepavyko. Bandykite vėliau.",expired:"Patvirtinimo laikas baigėsi. Bandykite dar kartą.",footer:'Apsaugota ALTCHA',getAudioChallenge:"Gauti garso užduotį",label:"Aš nesu robotas",loading:"Įkeliama...",reload:"Įkelti iš naujo",verify:"Patvirtinti",verificationRequired:"Reikalingas patvirtinimas!",verified:"Patvirtinta",verifying:"Tikrinama...",waitAlert:"Tikrinama... prašome palaukti.",cancel:"Atšaukti",enterCodeFromImage:"Norėdami tęsti, įveskite kodą iš paveikslėlio žemiau."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/lv.js b/js/altcha/i18n/lv.js new file mode 100644 index 0000000000..eb637492f9 --- /dev/null +++ b/js/altcha/i18n/lv.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function i(i,t,n){if(null==i)return t(void 0),e;const a=function(){var e=r;try{return r=!0,i.subscribe(t,n)}finally{r=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const t=[];function n(i,n=e){let a=null;const r=new Set;function o(e){if(o=e,((n=i)!=n?o==o:n!==o||null!==n&&"object"==typeof n||"function"==typeof n)&&(i=e,a)){const e=!t.length;for(const e of r)e[1](),t.push(e,i);if(e){for(let e=0;e{r.delete(u),0===r.size&&a&&(a(),a=null)}}}}function a(e){let t;return i(e,e=>t=e)(),t}let r=!1;function o(e){const i={get:e=>a(i.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(a(i.store),{[e]:t}):Object.assign(a(i.store),e),i.store.set(a(i.store))},store:n(e)};return i}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("lv",{ariaLinkLabel:"Altcha (oficiālā tīmekļa vietne)",enterCode:"Ievadiet kodu",enterCodeAria:"Ievadiet dzirdamo kodu. Nospiediet atstarpes taustiņu, lai atskaņotu audio.",error:"Verifikācija neizdevās. Mēģiniet vēlāk vēlreiz.",expired:"Verifikācijas laiks ir beidzies. Mēģiniet vēlreiz.",footer:'Aizsargāts ar ALTCHA',getAudioChallenge:"Saņemt audio izaicinājumu",label:"Es neesmu robots",loading:"Notiek ielāde...",reload:"Pārlādēt",verify:"Verificēt",verificationRequired:"Nepieciešama verifikācija!",verified:"Verificēts",verifying:"Notiek verifikācija...",waitAlert:"Notiek verifikācija... lūdzu, uzgaidiet.",cancel:"Atcelt",enterCodeFromImage:"Lai turpinātu, lūdzu, ievadiet zemāk redzamo attēlu kodu."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/me.js b/js/altcha/i18n/me.js new file mode 100644 index 0000000000..a7fe22bfce --- /dev/null +++ b/js/altcha/i18n/me.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,i,n){if(null==t)return i(void 0),e;const a=function(){var e=o;try{return o=!0,t.subscribe(i,n)}finally{o=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const i=[];function n(t,n=e){let a=null;const o=new Set;function r(e){if(r=e,((n=t)!=n?r==r:n!==r||null!==n&&"object"==typeof n||"function"==typeof n)&&(t=e,a)){const e=!i.length;for(const e of o)e[1](),i.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&a&&(a(),a=null)}}}}function a(e){let i;return t(e,e=>i=e)(),i}let o=!1;function r(e){const t={get:e=>a(t.store)[e],set:(e,i)=>{"string"==typeof e?Object.assign(a(t.store),{[e]:i}):Object.assign(a(t.store),e),t.store.set(a(t.store))},store:n(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:r({}),i18n:r({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("me",{ariaLinkLabel:"Altcha (zvanična web stranica)",enterCode:"Unesite kod",enterCodeAria:"Unesite kod koji čujete. Pritisnite Space za puštanje zvuka.",error:"Verifikacija nije uspjela. Pokušajte ponovo kasnije.",expired:"Verifikacija je istekla. Pokušajte ponovo.",footer:'Zaštićeno putem ALTCHA',getAudioChallenge:"Preuzmi audio izazov",label:"Nijesam robot",loading:"Učitavanje...",reload:"Ponovo učitaj",verify:"Verifikuj",verificationRequired:"Potrebna je verifikacija!",verified:"Verifikovano",verifying:"Verifikacija u toku...",waitAlert:"Verifikujem... molimo sačekajte.",cancel:"Odustani",enterCodeFromImage:"Za nastavak, molimo unesite kod sa slike ispod."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/mk.js b/js/altcha/i18n/mk.js new file mode 100644 index 0000000000..2f1f0d3765 --- /dev/null +++ b/js/altcha/i18n/mk.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("mk",{ariaLinkLabel:"Altcha (официјален веб-сајт)",enterCode:"Внесете код",enterCodeAria:"Внесете го кодот што го слушате. Притиснете Space за да ја пуштите аудио снимката.",error:"Проверката не успеа. Обидете се подоцна.",expired:"Проверката истече. Обидете се повторно.",footer:'Заштитено со ALTCHA',getAudioChallenge:"Земете аудио предизвик",label:"Јас не сум робот",loading:"Се вчитува...",reload:"Превчитај",verify:"Провери",verificationRequired:"Потребна е проверка!",verified:"Потврдено",verifying:"Се проверува...",waitAlert:"Се проверува... ве молиме почекајте.",cancel:"Откажи",enterCodeFromImage:"За да продолжите, ве молиме внесете го кодот од сликата подолу."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/mr.js b/js/altcha/i18n/mr.js new file mode 100644 index 0000000000..c8ee186bdc --- /dev/null +++ b/js/altcha/i18n/mr.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("mr",{ariaLinkLabel:"Altcha (अधिकृत संकेतस्थळ)",enterCode:"कोड टाकाा",enterCodeAria:"तुम्ही ऐकत असलेला कोड टाका. ऑडिओ प्ले करण्यासाठी स्पेस दाबा.",error:"पुष्टीकरण अयशस्वी झाले. कृपया नंतर पुन्हा प्रयत्न करा.",expired:"पुष्टीकरण कालबाह्य झाले आहे. कृपया पुन्हा प्रयत्न करा.",footer:'द्वारे संरक्षित ALTCHA',getAudioChallenge:"ऑडिओ चॅलेंज मिळवा",label:"मी रोबोट नाही",loading:"लोड होत आहे...",reload:"पुन्हा लोड करा",verify:"पुष्टीकरण करा",verificationRequired:"पडताळणी आवश्यक आहे!",verified:"पुष्टीकरण झाले",verifying:"पुष्टीकरण करत आहे...",waitAlert:"पुष्टीकरण करत आहे... कृपया थोडा वेळ थांबा.",cancel:"रद्द करा",enterCodeFromImage:"पुढे जाण्यासाठी, कृपया खालील प्रतिमेतील कोड प्रविष्ट करा."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/mt.js b/js/altcha/i18n/mt.js new file mode 100644 index 0000000000..d727477ff5 --- /dev/null +++ b/js/altcha/i18n/mt.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,i,a){if(null==t)return i(void 0),e;const n=function(){var e=r;try{return r=!0,t.subscribe(i,a)}finally{r=e}}();return n.unsubscribe?()=>n.unsubscribe():n}const i=[];function a(t,a=e){let n=null;const r=new Set;function l(e){if(l=e,((a=t)!=a?l==l:a!==l||null!==a&&"object"==typeof a||"function"==typeof a)&&(t=e,n)){const e=!i.length;for(const e of r)e[1](),i.push(e,t);if(e){for(let e=0;e{r.delete(f),0===r.size&&n&&(n(),n=null)}}}}function n(e){let i;return t(e,e=>i=e)(),i}let r=!1;function l(e){const t={get:e=>n(t.store)[e],set:(e,i)=>{"string"==typeof e?Object.assign(n(t.store),{[e]:i}):Object.assign(n(t.store),e),t.store.set(n(t.store))},store:a(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("mt",{ariaLinkLabel:"Altcha (sit uffiċjali)",enterCode:"Idħol il-kodiċi",enterCodeAria:"Idħol il-kodiċi li tisma'. Agħfas Spazju biex tindaqq l-awdjo.",error:"Il-verifika falliet. Erġa’ pprova aktar tard.",expired:"Il-verifika skadiet. Erġa’ pprova.",footer:'Protett minn ALTCHA',getAudioChallenge:"Ikseb sfida bl-awdjo",label:"M’inix robot",loading:"Qed jitgħabba...",reload:"Ittella’ mill-ġdid",verify:"Ivverifika",verificationRequired:"Verifika meħtieġa!",verified:"Ivverifikat",verifying:"Verifika għaddejja...",waitAlert:"Verifika għaddejja... stenna ftit.",cancel:"Ikkanċella",enterCodeFromImage:"Biex tipproċedi, jekk jogħġbok daħħal il-kodiċi mill-immaġni hawn taħt."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/nb.js b/js/altcha/i18n/nb.js new file mode 100644 index 0000000000..ec71d4cd30 --- /dev/null +++ b/js/altcha/i18n/nb.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=s;try{return s=!0,t.subscribe(n,r)}finally{s=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const s=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of s)e[1](),n.push(e,t);if(e){for(let e=0;e{s.delete(f),0===s.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let s=!1;function o(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("nb",{ariaLinkLabel:"Altcha (offisiell nettside)",enterCode:"Skriv inn kode",enterCodeAria:"Skriv inn koden du hører. Trykk på Space for å spille av lyden.",error:"Verifisering mislyktes. Prøv igjen senere.",expired:"Verifiseringen utløp. Prøv igjen.",footer:'Beskyttet av ALTCHA',getAudioChallenge:"Få en lydutfordring",label:"Jeg er ikke en robot",loading:"Laster...",reload:"Last på nytt",verify:"Verifiser",verificationRequired:"Verifisering kreves!",verified:"Verifisert",verifying:"Verifiserer...",waitAlert:"Verifiserer... vennligst vent.",cancel:"Avbryt",enterCodeFromImage:"For å fortsette, vennligst skriv inn koden fra bildet nedenfor."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/nl.js b/js/altcha/i18n/nl.js new file mode 100644 index 0000000000..7877c65492 --- /dev/null +++ b/js/altcha/i18n/nl.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,i){if(null==t)return n(void 0),e;const r=function(){var e=o;try{return o=!0,t.subscribe(n,i)}finally{o=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const n=[];function i(t,i=e){let r=null;const o=new Set;function a(e){if(a=e,((i=t)!=i?a==a:i!==a||null!==i&&"object"==typeof i||"function"==typeof i)&&(t=e,r)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&r&&(r(),r=null)}}}}function r(e){let n;return t(e,e=>n=e)(),n}let o=!1;function a(e){const t={get:e=>r(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(r(t.store),{[e]:n}):Object.assign(r(t.store),e),t.store.set(r(t.store))},store:i(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:a({}),i18n:a({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("nl",{ariaLinkLabel:"Altcha (officiële website)",enterCode:"Voer code in",enterCodeAria:"Voer de code in die je hoort. Druk op Spatie om de audio af te spelen.",error:"Verificatie mislukt. Probeer het later opnieuw.",expired:"Verificatie verlopen. Probeer het opnieuw.",footer:'Beschermd door ALTCHA',getAudioChallenge:"Audio-uitdaging ontvangen",label:"Ik ben geen robot",loading:"Laden...",reload:"Herladen",verify:"Verifiëren",verificationRequired:"Verificatie vereist!",verified:"Geverifieerd",verifying:"Bezig met verifiëren...",waitAlert:"Bezig met verifiëren... even geduld a.u.b.",cancel:"Annuleren",enterCodeFromImage:"Om door te gaan, voert u de code uit de onderstaande afbeelding in."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/pl.js b/js/altcha/i18n/pl.js new file mode 100644 index 0000000000..9cf062d36b --- /dev/null +++ b/js/altcha/i18n/pl.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function n(n,t,o){if(null==n)return t(void 0),e;const a=function(){var e=r;try{return r=!0,n.subscribe(t,o)}finally{r=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const t=[];function o(n,o=e){let a=null;const r=new Set;function i(e){if(i=e,((o=n)!=o?i==i:o!==i||null!==o&&"object"==typeof o||"function"==typeof o)&&(n=e,a)){const e=!t.length;for(const e of r)e[1](),t.push(e,n);if(e){for(let e=0;e{r.delete(c),0===r.size&&a&&(a(),a=null)}}}}function a(e){let t;return n(e,e=>t=e)(),t}let r=!1;function i(e){const n={get:e=>a(n.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(a(n.store),{[e]:t}):Object.assign(a(n.store),e),n.store.set(a(n.store))},store:o(e)};return n}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:i({}),i18n:i({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("pl",{ariaLinkLabel:"Altcha (oficjalna strona internetowa)",enterCode:"Wprowadź kod",enterCodeAria:"Wpisz kod, który słyszysz. Naciśnij Spację, aby odtworzyć dźwięk.",error:"Weryfikacja nie powiodła się. Spróbuj ponownie później.",expired:"Weryfikacja wygasła. Spróbuj ponownie.",footer:'Chronione przez ALTCHA',getAudioChallenge:"Pobierz zadanie dźwiękowe",label:"Nie jestem robotem",loading:"Ładowanie...",reload:"Odśwież",verify:"Zweryfikuj",verificationRequired:"Wymagana weryfikacja!",verified:"Zweryfikowano",verifying:"Weryfikacja...",waitAlert:"Trwa weryfikacja... proszę czekać.",cancel:"Anuluj",enterCodeFromImage:"Aby kontynuować, wprowadź kod z poniższego obrazka."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/pt-br.js b/js/altcha/i18n/pt-br.js new file mode 100644 index 0000000000..4778888c62 --- /dev/null +++ b/js/altcha/i18n/pt-br.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function r(r,t,i){if(null==r)return t(void 0),e;const o=function(){var e=a;try{return a=!0,r.subscribe(t,i)}finally{a=e}}();return o.unsubscribe?()=>o.unsubscribe():o}const t=[];function i(r,i=e){let o=null;const a=new Set;function n(e){if(n=e,((i=r)!=i?n==n:i!==n||null!==i&&"object"==typeof i||"function"==typeof i)&&(r=e,o)){const e=!t.length;for(const e of a)e[1](),t.push(e,r);if(e){for(let e=0;e{a.delete(l),0===a.size&&o&&(o(),o=null)}}}}function o(e){let t;return r(e,e=>t=e)(),t}let a=!1;function n(e){const r={get:e=>o(r.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(o(r.store),{[e]:t}):Object.assign(o(r.store),e),r.store.set(o(r.store))},store:i(e)};return r}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:n({}),i18n:n({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("pt-br",{ariaLinkLabel:"Altcha (site oficial)",enterCode:"Digite o código",enterCodeAria:"Digite o código que você ouve. Pressione Espaço para reproduzir o áudio.",error:"Falha na verificação. Por favor, tente novamente mais tarde.",expired:"Verificação expirada. Por favor, tente novamente.",footer:'Protegido por ALTCHA',getAudioChallenge:"Obter desafio de áudio",label:"Eu não sou um robô",loading:"Carregando...",reload:"Recarregar",verify:"Verificar",verificationRequired:"Verificação necessária!",verified:"Verificado",verifying:"Verificando...",waitAlert:"Verificando... por favor aguarde.",cancel:"Cancelar",enterCodeFromImage:"Para prosseguir, digite o código da imagem abaixo."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/pt-pt.js b/js/altcha/i18n/pt-pt.js new file mode 100644 index 0000000000..08749bc90a --- /dev/null +++ b/js/altcha/i18n/pt-pt.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function r(r,t,o){if(null==r)return t(void 0),e;const a=function(){var e=i;try{return i=!0,r.subscribe(t,o)}finally{i=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const t=[];function o(r,o=e){let a=null;const i=new Set;function n(e){if(n=e,((o=r)!=o?n==n:o!==n||null!==o&&"object"==typeof o||"function"==typeof o)&&(r=e,a)){const e=!t.length;for(const e of i)e[1](),t.push(e,r);if(e){for(let e=0;e{i.delete(l),0===i.size&&a&&(a(),a=null)}}}}function a(e){let t;return r(e,e=>t=e)(),t}let i=!1;function n(e){const r={get:e=>a(r.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(a(r.store),{[e]:t}):Object.assign(a(r.store),e),r.store.set(a(r.store))},store:o(e)};return r}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:n({}),i18n:n({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("pt-pt",{ariaLinkLabel:"Altcha (site oficial)",enterCode:"Introduza o código",enterCodeAria:"Introduza o código que ouve. Prima Espaço para reproduzir o áudio.",error:"A verificação falhou. Por favor, tente novamente mais tarde.",expired:"Verificação expirada. Por favor, tente novamente.",footer:'Protegido por ALTCHA',getAudioChallenge:"Obter desafio de áudio",label:"Não sou um robô",loading:"A carregar...",reload:"Recarregar",verify:"Verificar",verificationRequired:"Verificação necessária!",verified:"Verificado",verifying:"A verificar...",waitAlert:"A verificar... por favor aguarde.",cancel:"Cancelar",enterCodeFromImage:"Para prosseguir, introduza o código da imagem abaixo."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ro.js b/js/altcha/i18n/ro.js new file mode 100644 index 0000000000..95d60daaa2 --- /dev/null +++ b/js/altcha/i18n/ro.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,i,n){if(null==t)return i(void 0),e;const r=function(){var e=a;try{return a=!0,t.subscribe(i,n)}finally{a=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const i=[];function n(t,n=e){let r=null;const a=new Set;function o(e){if(o=e,((n=t)!=n?o==o:n!==o||null!==n&&"object"==typeof n||"function"==typeof n)&&(t=e,r)){const e=!i.length;for(const e of a)e[1](),i.push(e,t);if(e){for(let e=0;e{a.delete(s),0===a.size&&r&&(r(),r=null)}}}}function r(e){let i;return t(e,e=>i=e)(),i}let a=!1;function o(e){const t={get:e=>r(t.store)[e],set:(e,i)=>{"string"==typeof e?Object.assign(r(t.store),{[e]:i}):Object.assign(r(t.store),e),t.store.set(r(t.store))},store:n(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ro",{ariaLinkLabel:"Altcha (site oficial)",enterCode:"Introduceți codul",enterCodeAria:"Introduceți codul pe care îl auziți. Apăsați Spațiu pentru a reda audio.",error:"Verificarea a eșuat. Încearcă din nou mai târziu.",expired:"Verificarea a expirat. Încearcă din nou.",footer:'Protejat de ALTCHA',getAudioChallenge:"Obține o provocare audio",label:"Nu sunt un robot",loading:"Se încarcă...",reload:"Reîncarcă",verify:"Verifică",verificationRequired:"Verificare necesară!",verified:"Verificat",verifying:"Se verifică...",waitAlert:"Se verifică... te rugăm să aștepți.",cancel:"Anulare",enterCodeFromImage:"Pentru a continua, vă rugăm să introduceți codul din imaginea de mai jos."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ru.js b/js/altcha/i18n/ru.js new file mode 100644 index 0000000000..58bf06239d --- /dev/null +++ b/js/altcha/i18n/ru.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ru",{ariaLinkLabel:"Altcha (официальный сайт)",enterCode:"Введите код",enterCodeAria:"Введите код, который слышите. Нажмите пробел для воспроизведения аудио.",error:"Ошибка верификации. Попробуйте позже.",expired:"Срок действия верификации истек. Попробуйте снова.",footer:'Защищено ALTCHA',getAudioChallenge:"Получить аудио задачу",label:"Я не робот",loading:"Загрузка...",reload:"Перезагрузить",verify:"Проверить",verificationRequired:"Требуется проверка!",verified:"Проверено",verifying:"Идет проверка...",waitAlert:"Идет проверка... Пожалуйста, подождите.",cancel:"Отмена",enterCodeFromImage:"Чтобы продолжить, пожалуйста, введите код с изображения ниже."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/sk.js b/js/altcha/i18n/sk.js new file mode 100644 index 0000000000..f896f1a09e --- /dev/null +++ b/js/altcha/i18n/sk.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,a,n){if(null==t)return a(void 0),e;const r=function(){var e=i;try{return i=!0,t.subscribe(a,n)}finally{i=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const a=[];function n(t,n=e){let r=null;const i=new Set;function o(e){if(o=e,((n=t)!=n?o==o:n!==o||null!==n&&"object"==typeof n||"function"==typeof n)&&(t=e,r)){const e=!a.length;for(const e of i)e[1](),a.push(e,t);if(e){for(let e=0;e{i.delete(c),0===i.size&&r&&(r(),r=null)}}}}function r(e){let a;return t(e,e=>a=e)(),a}let i=!1;function o(e){const t={get:e=>r(t.store)[e],set:(e,a)=>{"string"==typeof e?Object.assign(r(t.store),{[e]:a}):Object.assign(r(t.store),e),t.store.set(r(t.store))},store:n(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("sk",{ariaLinkLabel:"Altcha (oficiálna webová stránka)",enterCode:"Zadajte kód",enterCodeAria:"Zadajte kód, ktorý počujete. Stlačením medzerníka prehráte zvuk.",error:"Verifikácia zlyhala. Skúste to znova neskôr.",expired:"Verifikácia vypršala. Skúste to znova.",footer:'Chránené ALTCHA',getAudioChallenge:"Získať audio výzvu",label:"Nie som robot",loading:"Načítava sa...",reload:"Obnoviť",verify:"Verifikovať",verificationRequired:"Vyžaduje sa overenie!",verified:"Verifikované",verifying:"Prebieha verifikácia...",waitAlert:"Prebieha verifikácia... prosím čakajte.",cancel:"Zrušiť",enterCodeFromImage:"Na pokračovanie, prosím, zadajte kód z obrázka nižšie."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/sl.js b/js/altcha/i18n/sl.js new file mode 100644 index 0000000000..df53bc4203 --- /dev/null +++ b/js/altcha/i18n/sl.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function n(n,t,r){if(null==n)return t(void 0),e;const o=function(){var e=i;try{return i=!0,n.subscribe(t,r)}finally{i=e}}();return o.unsubscribe?()=>o.unsubscribe():o}const t=[];function r(n,r=e){let o=null;const i=new Set;function a(e){if(a=e,((r=n)!=r?a==a:r!==a||null!==r&&"object"==typeof r||"function"==typeof r)&&(n=e,o)){const e=!t.length;for(const e of i)e[1](),t.push(e,n);if(e){for(let e=0;e{i.delete(u),0===i.size&&o&&(o(),o=null)}}}}function o(e){let t;return n(e,e=>t=e)(),t}let i=!1;function a(e){const n={get:e=>o(n.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(o(n.store),{[e]:t}):Object.assign(o(n.store),e),n.store.set(o(n.store))},store:r(e)};return n}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:a({}),i18n:a({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("sl",{ariaLinkLabel:"Altcha (uradna spletna stran)",enterCode:"Vnesite kodo",enterCodeAria:"Vnesite kodo, ki jo slišite. Pritisnite preslednico za predvajanje zvoka.",error:"Preverjanje ni uspelo. Poskusite znova kasneje.",expired:"Preverjanje je poteklo. Poskusite znova.",footer:'Zaščiteno z ALTCHA',getAudioChallenge:"Pridobite zvočni izziv",label:"Nisem robot",loading:"Nalagam...",reload:"Ponovno naloži",verify:"Preveri",verificationRequired:"Potrebna je preveritev!",verified:"Preverjeno",verifying:"Preverjanje...",waitAlert:"Preverjanje... prosim počakajte.",cancel:"Preklic",enterCodeFromImage:"Za nadaljevanje, prosimo, vnesite kodo s slike spodaj."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/sq.js b/js/altcha/i18n/sq.js new file mode 100644 index 0000000000..7ee12521b8 --- /dev/null +++ b/js/altcha/i18n/sq.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,r,i){if(null==t)return r(void 0),e;const n=function(){var e=a;try{return a=!0,t.subscribe(r,i)}finally{a=e}}();return n.unsubscribe?()=>n.unsubscribe():n}const r=[];function i(t,i=e){let n=null;const a=new Set;function o(e){if(o=e,((i=t)!=i?o==o:i!==o||null!==i&&"object"==typeof i||"function"==typeof i)&&(t=e,n)){const e=!r.length;for(const e of a)e[1](),r.push(e,t);if(e){for(let e=0;e{a.delete(l),0===a.size&&n&&(n(),n=null)}}}}function n(e){let r;return t(e,e=>r=e)(),r}let a=!1;function o(e){const t={get:e=>n(t.store)[e],set:(e,r)=>{"string"==typeof e?Object.assign(n(t.store),{[e]:r}):Object.assign(n(t.store),e),t.store.set(n(t.store))},store:i(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("sq",{ariaLinkLabel:"Altcha (faqja zyrtare)",enterCode:"Fut kodin",enterCodeAria:"Fut kodin që dëgjon. Shtypni Hapësirë për të luajtur audio.",error:"Verifikimi dështoi. Provoni përsëri më vonë.",expired:"Verifikimi ka skaduar. Provoni përsëri.",footer:'I mbrojtur nga ALTCHA',getAudioChallenge:"Merr një sfidë audio",label:"Unë nuk jam një robot",loading:"Duke u ngarkuar...",reload:"Ringarko",verify:"Verifiko",verificationRequired:"Kërkohet verifikimi!",verified:"I verifikuar",verifying:"Duke verifikuar...",waitAlert:"Duke verifikuar... ju lutem prisni.",cancel:"Anuloje",enterCodeFromImage:"Për të vazhduar, ju lutemi fusni kodin nga imazhi më poshtë."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/sr.js b/js/altcha/i18n/sr.js new file mode 100644 index 0000000000..c302bdd16e --- /dev/null +++ b/js/altcha/i18n/sr.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,i,a){if(null==t)return i(void 0),e;const n=function(){var e=o;try{return o=!0,t.subscribe(i,a)}finally{o=e}}();return n.unsubscribe?()=>n.unsubscribe():n}const i=[];function a(t,a=e){let n=null;const o=new Set;function r(e){if(r=e,((a=t)!=a?r==r:a!==r||null!==a&&"object"==typeof a||"function"==typeof a)&&(t=e,n)){const e=!i.length;for(const e of o)e[1](),i.push(e,t);if(e){for(let e=0;e{o.delete(u),0===o.size&&n&&(n(),n=null)}}}}function n(e){let i;return t(e,e=>i=e)(),i}let o=!1;function r(e){const t={get:e=>n(t.store)[e],set:(e,i)=>{"string"==typeof e?Object.assign(n(t.store),{[e]:i}):Object.assign(n(t.store),e),t.store.set(n(t.store))},store:a(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:r({}),i18n:r({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("sr",{ariaLinkLabel:"Altcha (zvanična web stranica)",enterCode:"Unesite kod",enterCodeAria:"Unesite kod koji čujete. Pritisnite Space da biste pustili zvuk.",error:"Verifikacija nije uspela. Pokušajte ponovo kasnije.",expired:"Verifikacija je istekla. Pokušajte ponovo.",footer:'Zaštićeno od strane ALTCHA',getAudioChallenge:"Dohvatite audio izazov",label:"Nisam robot",loading:"Učitavanje...",reload:"Ponovo učitaj",verify:"Verifikuj",verificationRequired:"Verifikacija je obavezna!",verified:"Verifikovano",verifying:"Verifikacija u toku...",waitAlert:"Verifikacija u toku... molimo vas da sačekate.",cancel:"Откажи",enterCodeFromImage:"Да бисте наставили, унесите код са слике испод."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/sv.js b/js/altcha/i18n/sv.js new file mode 100644 index 0000000000..da24a5b13b --- /dev/null +++ b/js/altcha/i18n/sv.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=a;try{return a=!0,t.subscribe(n,r)}finally{a=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const a=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of a)e[1](),n.push(e,t);if(e){for(let e=0;e{a.delete(f),0===a.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let a=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("sv",{ariaLinkLabel:"Altcha (officiell webbplats)",enterCode:"Ange kod",enterCodeAria:"Ange koden du hör. Tryck på mellanslag för att spela upp ljudet.",error:"Verifiering misslyckades. Försök igen senare.",expired:"Verifieringen har gått ut. Försök igen.",footer:'Skyddad av ALTCHA',getAudioChallenge:"Få ljudutmaning",label:"Jag är inte en robot",loading:"Laddar...",reload:"Ladda om",verify:"Verifiera",verificationRequired:"Verifiering krävs!",verified:"Verifierad",verifying:"Verifierar...",waitAlert:"Verifierar... vänligen vänta.",cancel:"Avbryt",enterCodeFromImage:"För att fortsätta, ange koden från bilden nedan."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/sw.js b/js/altcha/i18n/sw.js new file mode 100644 index 0000000000..56be70c12f --- /dev/null +++ b/js/altcha/i18n/sw.js @@ -0,0 +1 @@ +(()=>{"use strict";const a=()=>{};function i(i,t,e){if(null==i)return t(void 0),a;const n=function(){var a=r;try{return r=!0,i.subscribe(t,e)}finally{r=a}}();return n.unsubscribe?()=>n.unsubscribe():n}const t=[];function e(i,e=a){let n=null;const r=new Set;function s(a){if(s=a,((e=i)!=e?s==s:e!==s||null!==e&&"object"==typeof e||"function"==typeof e)&&(i=a,n)){const a=!t.length;for(const a of r)a[1](),t.push(a,i);if(a){for(let a=0;a{r.delete(u),0===r.size&&n&&(n(),n=null)}}}}function n(a){let t;return i(a,a=>t=a)(),t}let r=!1;function s(a){const i={get:a=>n(i.store)[a],set:(a,t)=>{"string"==typeof a?Object.assign(n(i.store),{[a]:t}):Object.assign(n(i.store),a),i.store.set(n(i.store))},store:e(a)};return i}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:s({}),i18n:s({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("sw",{ariaLinkLabel:"Altcha (tovuti rasmi)",enterCode:"Weka nambari",enterCodeAria:"Weka nambari unayosikia. Bonyeza Space kucheza sauti.",error:"Uthibitishaji umeshindwa. Jaribu tena baadaye.",expired:"Uthibitishaji umeisha. Jaribu tena.",footer:'Imealindwa na ALTCHA',getAudioChallenge:"Pata changamoto ya sauti",label:"Mimi sio roboti",loading:"Inapakia...",reload:"Pakia tena",verify:"Thibitisha",verificationRequired:"Uthibitishaji unahitajika!",verified:"Imethibitishwa",verifying:"Inathibitisha...",waitAlert:"Inathibitisha... tafadhali subiri.",cancel:"Ghairi",enterCodeFromImage:"Ili kuendelea, tafadhali weka nambari kutoka kwa picha hapa chini."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ta.js b/js/altcha/i18n/ta.js new file mode 100644 index 0000000000..a9fbc34ed1 --- /dev/null +++ b/js/altcha/i18n/ta.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ta",{ariaLinkLabel:"Altcha (அதிகாரப்பூர்வ வலைத்தளம்)",enterCode:"குறியீட்டை உள்ளிடவும்",enterCodeAria:"நீங்கள் கேட்கும் குறியீட்டை உள்ளிடவும். ஆடியோவை இயக்க Space ஐ அழுத்தவும்.",error:"சரிபார்ப்பு தோல்வி. பிறகு மீண்டும் முயற்சிக்கவும்.",expired:"சரிபார்ப்பு காலாவதியானது. மீண்டும் முயற்சிக்கவும்.",footer:'மூலமாக பாதுகாக்கப்பட்டவை ALTCHA',getAudioChallenge:"ஒலி சவாலை பெறவும்",label:"நான் ரோபோடான அல்ல",loading:"செயலாக்கம்...",reload:"மீண்டும் புதுப்பிக்கவும்",verify:"சரிபார்க்கவும்",verificationRequired:"சரிபார்ப்பு தேவை!",verified:"சரிபார்க்கப்பட்டது",verifying:"சரிபார்க்கப்படுகிறது...",waitAlert:"சரிபார்க்கப்படுகிறது... தயவுசெய்து காத்திருக்கவும்.",cancel:"ரத்துசெய்",enterCodeFromImage:"தொடர, கீழே உள்ள படத்திலிருந்து குறியீட்டை உள்ளிடவும்."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/te.js b/js/altcha/i18n/te.js new file mode 100644 index 0000000000..13f29562b0 --- /dev/null +++ b/js/altcha/i18n/te.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("te",{ariaLinkLabel:"Altcha (అధికారిక వెబ్‌సైట్)",enterCode:"కోడ్‌ని నమోదు చేయండి",enterCodeAria:"మీరు విన్న కోడ్‌ని నమోదు చేయండి. ఆడియో ప్లే చేయడానికి స్పేస్‌ను నొక్కండి.",error:"చెకింగ్ విఫలమైంది. దయచేసి మరల ప్రయత్నించండి.",expired:"చెకింగ్ కాలం ముగిసింది. దయచేసి మరల ప్రయత్నించండి.",footer:'ఈ సైట్ రక్షించబడింది ALTCHA',getAudioChallenge:"ఆడియో ఛాలెంజ్ పొందండి",label:"నేను రోబోట్ కాదు",loading:"లోడ్ అవుతోంది...",reload:"మళ్ళీ లోడ్ చేయండి",verify:"ధ్రువీకరించు",verificationRequired:"ధృవీకరణ అవసరం!",verified:"ధ్రువీకరించబడింది",verifying:"ధ్రువీకరణ జరుగుతుంది...",waitAlert:"ధ్రువీకరణ జరుగుతుంది... దయచేసి వేచి ఉండండి.",cancel:"రద్దు చేయండి",enterCodeFromImage:"కొనసాగడానికి, దయచేసి క్రింది చిత్రంలో ఉన్న కోడ్‌ను నమోదు చేయండి."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/th.js b/js/altcha/i18n/th.js new file mode 100644 index 0000000000..705a711b44 --- /dev/null +++ b/js/altcha/i18n/th.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("th",{ariaLinkLabel:"Altcha (เว็บไซต์ทางการ)",enterCode:"ป้อนรหัส",enterCodeAria:"ป้อนรหัสที่คุณได้ยิน กด Space เพื่อเล่นเสียง",error:"การตรวจสอบล้มเหลว กรุณาลองอีกครั้งภายหลัง",expired:"การตรวจสอบหมดอายุ กรุณาลองใหม่",footer:'ป้องกันโดย ALTCHA',getAudioChallenge:"รับการท้าทายเสียง",label:"ฉันไม่ใช่บอท",loading:"กำลังโหลด...",reload:"โหลดใหม่",verify:"ตรวจสอบ",verificationRequired:"จำเป็นต้องตรวจสอบ!",verified:"ตรวจสอบแล้ว",verifying:"กำลังตรวจสอบ...",waitAlert:"กำลังตรวจสอบ... กรุณารอ",cancel:"ยกเลิก",enterCodeFromImage:"เพื่อดำเนินการต่อ โปรดป้อนรหัสจากรูปภาพด้านล่าง"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/tk.js b/js/altcha/i18n/tk.js new file mode 100644 index 0000000000..41c9aa7b53 --- /dev/null +++ b/js/altcha/i18n/tk.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function a(a,t,n){if(null==a)return t(void 0),e;const r=function(){var e=i;try{return i=!0,a.subscribe(t,n)}finally{i=e}}();return r.unsubscribe?()=>r.unsubscribe():r}const t=[];function n(a,n=e){let r=null;const i=new Set;function l(e){if(l=e,((n=a)!=n?l==l:n!==l||null!==n&&"object"==typeof n||"function"==typeof n)&&(a=e,r)){const e=!t.length;for(const e of i)e[1](),t.push(e,a);if(e){for(let e=0;e{i.delete(u),0===i.size&&r&&(r(),r=null)}}}}function r(e){let t;return a(e,e=>t=e)(),t}let i=!1;function l(e){const a={get:e=>r(a.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(r(a.store),{[e]:t}):Object.assign(r(a.store),e),a.store.set(r(a.store))},store:n(e)};return a}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("tk",{ariaLinkLabel:"Altcha (resmi web sahypa)",enterCode:"Kody giriziň",enterCodeAria:"Eşiden kodyňyzy giriziň. Sesli görkezmäni diňlemek üçin Space basyň.",error:"Barlamak şowsuz boldy. Has soňrak synanyşyň.",expired:"Barlamanyň möhleti gutardy. Gaýtadan synanyşyň.",footer:'Goralan ALTCHA tarapyndan',getAudioChallenge:"Sesli tabşyryk alyň",label:"Men robot däl",loading:"Ýüklenýär...",reload:"Täzeden ýükle",verify:"Barla",verificationRequired:"Barlamak zerurdyr!",verified:"Barlandy",verifying:"Barlanýar...",waitAlert:"Barlanýar... garaşyň.",cancel:"Ýapmak",enterCodeFromImage:"Dowam etmek üçin, aşakdaky suratyň koduny giriziň."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/tr.js b/js/altcha/i18n/tr.js new file mode 100644 index 0000000000..aeae65e32a --- /dev/null +++ b/js/altcha/i18n/tr.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function n(n,t,r){if(null==n)return t(void 0),e;const a=function(){var e=i;try{return i=!0,n.subscribe(t,r)}finally{i=e}}();return a.unsubscribe?()=>a.unsubscribe():a}const t=[];function r(n,r=e){let a=null;const i=new Set;function o(e){if(o=e,((r=n)!=r?o==o:r!==o||null!==r&&"object"==typeof r||"function"==typeof r)&&(n=e,a)){const e=!t.length;for(const e of i)e[1](),t.push(e,n);if(e){for(let e=0;e{i.delete(u),0===i.size&&a&&(a(),a=null)}}}}function a(e){let t;return n(e,e=>t=e)(),t}let i=!1;function o(e){const n={get:e=>a(n.store)[e],set:(e,t)=>{"string"==typeof e?Object.assign(a(n.store),{[e]:t}):Object.assign(a(n.store),e),n.store.set(a(n.store))},store:r(e)};return n}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("tr",{ariaLinkLabel:"Altcha (resmi web sitesi)",enterCode:"Kodu girin",enterCodeAria:"Duyduğunuz kodu girin. Ses dosyasını oynatmak için Boşluk tuşuna basın.",error:"Doğrulama başarısız oldu. Lütfen daha sonra tekrar deneyin.",expired:"Doğrulama süresi doldu. Lütfen tekrar deneyin.",footer:'ALTCHA tarafından korunuyor ALTCHA',getAudioChallenge:"Sesli doğrulama al",label:"Ben robot değilim",loading:"Yükleniyor...",reload:"Yeniden yükle",verify:"Doğrula",verificationRequired:"Doğrulama gerekli!",verified:"Doğrulandı",verifying:"Doğrulama yapılıyor...",waitAlert:"Doğrulama yapılıyor... lütfen bekleyin.",cancel:"İptal",enterCodeFromImage:"Devam etmek için lütfen aşağıdaki resimdeki kodu girin."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/uk.js b/js/altcha/i18n/uk.js new file mode 100644 index 0000000000..73d0a34b47 --- /dev/null +++ b/js/altcha/i18n/uk.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("uk",{ariaLinkLabel:"Altcha (офіційний сайт)",enterCode:"Введіть код",enterCodeAria:"Введіть код, який ви чуєте. Натисніть пробіл, щоб відтворити аудіо.",error:"Перевірка не вдалася. Спробуйте пізніше.",expired:"Перевірка прострочена. Спробуйте знову.",footer:'Захищено ALTCHA',getAudioChallenge:"Отримати аудіо-челлендж",label:"Я не робот",loading:"Завантаження...",reload:"Перезавантажити",verify:"Перевірити",verificationRequired:"Потрібна перевірка!",verified:"Перевірено",verifying:"Перевіряється...",waitAlert:"Перевірка... будь ласка, зачекайте.",cancel:"Скасувати",enterCodeFromImage:"Щоб продовжити, введіть код із зображення нижче."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/ur.js b/js/altcha/i18n/ur.js new file mode 100644 index 0000000000..2e88c0cdbc --- /dev/null +++ b/js/altcha/i18n/ur.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("ur",{ariaLinkLabel:"Altcha (سرکاری ویب سائٹ)",enterCode:"کوڈ درج کریں",enterCodeAria:"جو کوڈ آپ سنتے ہیں وہ درج کریں۔ آڈیو چلانے کے لیے اسپیس دبائیں۔",error:"توثیق ناکام ہو گئی۔ براہ کرم بعد میں دوبارہ کوشش کریں۔",expired:"توثیق کی مدت ختم ہو گئی ہے۔ براہ کرم دوبارہ کوشش کریں۔",footer:'کے ذریعے محفوظ ALTCHA',getAudioChallenge:"آڈیو چیلنج حاصل کریں",label:"میں روبوٹ نہیں ہوں",loading:"لوڈ ہو رہا ہے...",reload:"دوبارہ لوڈ کریں",verify:"توثیق کریں",verificationRequired:"تصدیق ضروری ہے!",verified:"توثیق شدہ",verifying:"توثیق ہو رہی ہے...",waitAlert:"توثیق ہو رہی ہے... براہ کرم انتظار کریں۔",cancel:"منسوخ کریں",enterCodeFromImage:"اگلے مرحلے پر جانے کے لیے، براہ کرم نیچے دی گئی تصویر سے کوڈ درج کریں۔"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/uz.js b/js/altcha/i18n/uz.js new file mode 100644 index 0000000000..f83e02bd61 --- /dev/null +++ b/js/altcha/i18n/uz.js @@ -0,0 +1 @@ +(()=>{"use strict";const i=()=>{};function e(e,t,n){if(null==e)return t(void 0),i;const a=function(){var i=r;try{return r=!0,e.subscribe(t,n)}finally{r=i}}();return a.unsubscribe?()=>a.unsubscribe():a}const t=[];function n(e,n=i){let a=null;const r=new Set;function o(i){if(o=i,((n=e)!=n?o==o:n!==o||null!==n&&"object"==typeof n||"function"==typeof n)&&(e=i,a)){const i=!t.length;for(const i of r)i[1](),t.push(i,e);if(i){for(let i=0;i{r.delete(u),0===r.size&&a&&(a(),a=null)}}}}function a(i){let t;return e(i,i=>t=i)(),t}let r=!1;function o(i){const e={get:i=>a(e.store)[i],set:(i,t)=>{"string"==typeof i?Object.assign(a(e.store),{[i]:t}):Object.assign(a(e.store),i),e.store.set(a(e.store))},store:n(i)};return e}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:o({}),i18n:o({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("uz",{ariaLinkLabel:"Altcha (rasmiy veb-sayt)",enterCode:"Kodni kiriting",enterCodeAria:"Eshitgan kodingizni kiriting. Audioni ijro etish uchun Bo'sh joy tugmasini bosing.",error:"Tekshiruv muvaffaqiyatsiz tugadi. Keyinroq qayta urinib ko'ring.",expired:"Tekshiruv muddati tugadi. Qayta urinib ko'ring.",footer:'ALTCHA tomonidan himoyalangan',getAudioChallenge:"Audio sinovni olish",label:"Men robot emasman",loading:"Yuklanmoqda...",reload:"Qayta yuklash",verify:"Tekshirish",verificationRequired:"Tekshiruv talab qilinadi!",verified:"Tekshirildi",verifying:"Tekshirilmoqda...",waitAlert:"Tekshirilmoqda... iltimos kuting.",cancel:"Bekor qilish",enterCodeFromImage:"Davom etish uchun, iltimos, quyidagi rasmda ko'rsatilgan kodni kiriting."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/vi.js b/js/altcha/i18n/vi.js new file mode 100644 index 0000000000..968b99658c --- /dev/null +++ b/js/altcha/i18n/vi.js @@ -0,0 +1 @@ +(()=>{"use strict";const t=()=>{};function n(n,e,i){if(null==n)return e(void 0),t;const r=function(){var t=h;try{return h=!0,n.subscribe(e,i)}finally{h=t}}();return r.unsubscribe?()=>r.unsubscribe():r}const e=[];function i(n,i=t){let r=null;const h=new Set;function c(t){if(c=t,((i=n)!=i?c==c:i!==c||null!==i&&"object"==typeof i||"function"==typeof i)&&(n=t,r)){const t=!e.length;for(const t of h)t[1](),e.push(t,n);if(t){for(let t=0;t{h.delete(a),0===h.size&&r&&(r(),r=null)}}}}function r(t){let e;return n(t,t=>e=t)(),e}let h=!1;function c(t){const n={get:t=>r(n.store)[t],set:(t,e)=>{"string"==typeof t?Object.assign(r(n.store),{[t]:e}):Object.assign(r(n.store),t),n.store.set(r(n.store))},store:i(t)};return n}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:c({}),i18n:c({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("vi",{ariaLinkLabel:"Altcha (trang web chính thức)",enterCode:"Nhập mã",enterCodeAria:"Nhập mã bạn nghe được. Nhấn Phím cách để phát âm thanh.",error:"Xác minh thất bại. Vui lòng thử lại sau.",expired:"Xác minh đã hết hạn. Vui lòng thử lại.",footer:'Được bảo vệ bởi ALTCHA',getAudioChallenge:"Nhận thử thách âm thanh",label:"Tôi không phải là robot",loading:"Đang tải...",reload:"Tải lại",verify:"Xác minh",verificationRequired:"Yêu cầu xác minh!",verified:"Đã xác minh",verifying:"Đang xác minh...",waitAlert:"Đang xác minh... vui lòng chờ.",cancel:"Hủy bỏ",enterCodeFromImage:"Để tiếp tục, vui lòng nhập mã từ hình ảnh bên dưới."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/yo.js b/js/altcha/i18n/yo.js new file mode 100644 index 0000000000..bf757e3deb --- /dev/null +++ b/js/altcha/i18n/yo.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,i){if(null==t)return n(void 0),e;const o=function(){var e=a;try{return a=!0,t.subscribe(n,i)}finally{a=e}}();return o.unsubscribe?()=>o.unsubscribe():o}const n=[];function i(t,i=e){let o=null;const a=new Set;function r(e){if(r=e,((i=t)!=i?r==r:i!==r||null!==i&&"object"==typeof i||"function"==typeof i)&&(t=e,o)){const e=!n.length;for(const e of a)e[1](),n.push(e,t);if(e){for(let e=0;e{a.delete(u),0===a.size&&o&&(o(),o=null)}}}}function o(e){let n;return t(e,e=>n=e)(),n}let a=!1;function r(e){const t={get:e=>o(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(o(t.store),{[e]:n}):Object.assign(o(t.store),e),t.store.set(o(t.store))},store:i(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:r({}),i18n:r({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("yo",{ariaLinkLabel:"Altcha (oju opo wẹẹbu osise)",enterCode:"Tẹ koodu sii",enterCodeAria:"Tẹ koodu ti o ngbọ sii. Tẹ Space lati ṣe ohun orin.",error:"Ìdájọ́kòwò kò ṣẹ́ṣe. Gbiyanju lẹẹkansi ni ọjọ́ iwájú.",expired:"Ìdájọ́kòwò ti pari. Gbiyanju lẹẹkansi.",footer:'Ti wa ni ààbò nipasẹ ALTCHA',getAudioChallenge:"Gba ìjàdú ohùn",label:"Emi kii ṣe ẹrọ",loading:"Ó ń gbé sílẹ̀...",reload:"Tún gbé wọlé",verify:"Ṣàdájọ́",verificationRequired:"Ìdájọ́kòwò ni a nílò!",verified:"A ti dájọ́",verifying:"Ó ń ṣàdájọ́...",waitAlert:"Ó ń ṣàdájọ́... ẹ jọ̀ọ́ ẹ duro.",cancel:"Fagbọsẹ",enterCodeFromImage:"Lati tẹsiwaju, jọwọ tẹ koodu ti o wa lati aworan isalẹ sii."})})(); \ No newline at end of file diff --git a/js/altcha/i18n/zh-cn.js b/js/altcha/i18n/zh-cn.js new file mode 100644 index 0000000000..95f76e579e --- /dev/null +++ b/js/altcha/i18n/zh-cn.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("zh-cn",{ariaLinkLabel:"Altcha (官方网站)",enterCode:"输入代码",enterCodeAria:"输入您听到的代码。按空格键播放音频。",error:"验证失败。稍后再试。",expired:"验证已过期。请重试。",footer:'由 ALTCHA 保护',getAudioChallenge:"获取音频挑战",label:"我不是机器人",loading:"加载中...",reload:"重新加载",verify:"验证",verificationRequired:"需要验证!",verified:"已验证",verifying:"正在验证...",waitAlert:"正在验证... 请稍等。",cancel:"取消",enterCodeFromImage:"为继续操作,请输入下图中显示的验证码。"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/zh-hk.js b/js/altcha/i18n/zh-hk.js new file mode 100644 index 0000000000..1fd50e8fd1 --- /dev/null +++ b/js/altcha/i18n/zh-hk.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("zh-hk",{ariaLinkLabel:"Altcha (官方網站)",cancel:"取消",enterCode:"輸入代碼",enterCodeAria:"輸入你聽到嘅代碼。按空格鍵播放音訊。",enterCodeFromImage:"要繼續,請輸入下面圖片入面嘅代碼。",error:"驗證失敗。請稍後再試。",expired:"驗證已過期。請再試一次。",footer:'由 ALTCHA 提供保護',getAudioChallenge:"取得音訊驗證",label:"我唔係機械人",loading:"載入中...",reload:"重新載入",verify:"驗證",verificationRequired:"需要驗證!",verified:"已驗證",verifying:"驗證中...",waitAlert:"驗證中... 請稍候。"})})(); \ No newline at end of file diff --git a/js/altcha/i18n/zh-tw.js b/js/altcha/i18n/zh-tw.js new file mode 100644 index 0000000000..459e5ffa9d --- /dev/null +++ b/js/altcha/i18n/zh-tw.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=()=>{};function t(t,n,r){if(null==t)return n(void 0),e;const i=function(){var e=o;try{return o=!0,t.subscribe(n,r)}finally{o=e}}();return i.unsubscribe?()=>i.unsubscribe():i}const n=[];function r(t,r=e){let i=null;const o=new Set;function l(e){if(l=e,((r=t)!=r?l==l:r!==l||null!==r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!n.length;for(const e of o)e[1](),n.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function i(e){let n;return t(e,e=>n=e)(),n}let o=!1;function l(e){const t={get:e=>i(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(i(t.store),{[e]:n}):Object.assign(i(t.store),e),t.store.set(i(t.store))},store:r(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:l({}),i18n:l({}),instances:new Set,plugins:new Set},globalThis.$altcha.i18n.set("zh-tw",{ariaLinkLabel:"Altcha (官方網站)",enterCode:"輸入代碼",enterCodeAria:"輸入您聽到的代碼。按空格鍵播放音頻。",error:"驗證失敗。稍後再試。",expired:"驗證已過期。請重試。",footer:'由 ALTCHA 保護',getAudioChallenge:"獲取音頻挑戰",label:"我不是機器人",loading:"載入中...",reload:"重新載入",verify:"驗證",verificationRequired:"需要驗證!",verified:"已驗證",verifying:"正在驗證...",waitAlert:"正在驗證... 請稍等。",cancel:"取消",enterCodeFromImage:"若要繼續,請輸入下方的圖片驗證碼。"})})(); \ No newline at end of file diff --git a/js/src/altcha-field.js b/js/src/altcha-field.js new file mode 100644 index 0000000000..b87ce2b15f --- /dev/null +++ b/js/src/altcha-field.js @@ -0,0 +1,270 @@ +/** + * Loads the ALTCHA widget and connects it to Formidable forms. + * + * Lite's Captcha field prints an empty .frm-altcha element with the widget settings in data + * attributes, as it does for the other captcha types. This script puts the widget inside it, + * including for form pages that load later over AJAX. + */ +import 'altcha'; + +const WIDGET_SELECTOR = 'altcha-widget.frm-altcha-widget'; +const CAPTCHA_SELECTOR = '.frm-altcha'; + +/** + * Widget attributes read from the captcha element's data attributes. + * + * @type {string[]} + */ +const WIDGET_ATTRIBUTES = [ 'name', 'challenge', 'auto', 'language', 'configuration' ]; + +/** + * Forms waiting for verification to finish, so repeated submit clicks only submit once. + * + * @type {WeakSet} + */ +const waitingForms = new WeakSet(); + +/** + * Whether a widget has finished its proof of work. + * + * @param {HTMLElement} widget The altcha-widget element. + * @return {boolean} True when verified, or when the widget has not loaded its methods yet. + */ +const isVerified = widget => typeof widget.getState !== 'function' || widget.getState() === 'verified'; + +/** + * Resolve once a widget has finished verifying, starting verification if nothing is running. + * + * A second verify() call aborts one already in progress and the first call resolves to null, + * for example when focusing the submit button starts the widget's onfocus verification. So the + * result is read from the widget's state, not from the verify() return value. + * + * @param {HTMLElement} widget The altcha-widget element. + * @return {Promise} Whether the widget ended up verified. + */ +const finishVerification = widget => new Promise( resolve => { + const settle = () => { + const state = widget.getState(); + + if ( state === 'verifying' ) { + return; + } + + widget.removeEventListener( 'statechange', settle ); + resolve( state === 'verified' ); + }; + + widget.addEventListener( 'statechange', settle ); + + if ( widget.getState() !== 'verifying' ) { + widget.verify().then( settle ); + } +} ); + +/** + * Verify the widgets, then submit the form again once, if every widget verified. + * + * @param {HTMLFormElement} form The form. + * @param {HTMLElement[]} widgets Widgets that still need to verify. + * @param {HTMLElement|undefined} submitter The button that submitted the form, if known. + * @return {void} + */ +const verifyThenSubmit = ( form, widgets, submitter ) => { + if ( waitingForms.has( form ) ) { + return; + } + + waitingForms.add( form ); + + Promise.all( widgets.map( finishVerification ) ).then( results => { + waitingForms.delete( form ); + + if ( results.every( Boolean ) ) { + form.requestSubmit( submitter ); + } + } ); +}; + +/** + * Finish verification before the form is sent, whatever the widget's automatic mode. + * + * Runs in the capture phase on the document, so it stops the submit before Formidable's own + * handler sees it. Once every widget is verified the form is submitted again, and that + * submit goes through to Formidable, including its AJAX submit. + * + * @param {SubmitEvent} event Submit event. + * @return {void} + */ +const verifyBeforeSubmit = event => { + const form = event.target; + + if ( ! ( form instanceof HTMLFormElement ) ) { + return; + } + + const pending = Array.from( form.querySelectorAll( WIDGET_SELECTOR ) ).filter( widget => ! isVerified( widget ) ); + + if ( ! pending.length ) { + return; + } + + event.preventDefault(); + event.stopImmediatePropagation(); + + verifyThenSubmit( form, pending, event.submitter && form.contains( event.submitter ) ? event.submitter : undefined ); +}; + +/** + * Handle the widget's required checkbox blocking a submit in forms without novalidate. + * + * The browser fires invalid instead of submit, so verifyBeforeSubmit never runs. Verify in + * the background instead of showing the browser's "check this box" message, then submit. + * + * @param {Event} event Invalid event. + * @return {void} + */ +const verifyInvalidWidget = event => { + const widget = event.target instanceof Element ? event.target.closest( WIDGET_SELECTOR ) : null; + const form = widget?.closest( 'form' ); + + if ( ! widget || ! form || isVerified( widget ) ) { + return; + } + + event.preventDefault(); + verifyThenSubmit( form, [ widget ] ); +}; + +/** + * Show verification feedback for layouts that start hidden, including automatic verification. + * + * @since x.x + * + * @param {CustomEvent} event Widget state change. + * @return {void} + */ +const syncWidgetDisplay = event => { + const widget = event.currentTarget; + + if ( typeof widget.getConfiguration !== 'function' || widget.getConfiguration().display === 'standard' ) { + return; + } + + if ( [ 'verified', 'unverified' ].includes( event.detail.state ) ) { + widget.hide(); + return; + } + + widget.show(); +}; + +/** + * Put a widget inside each captcha element that does not have one yet. + * + * @param {Document|Element} root Element or document to search. + * @return {void} + */ +const addWidgets = root => { + const captchas = root instanceof Element && root.matches( CAPTCHA_SELECTOR ) ? [ root ] : Array.from( root.querySelectorAll( CAPTCHA_SELECTOR ) ); + + captchas.forEach( captcha => { + if ( captcha.querySelector( WIDGET_SELECTOR ) ) { + return; + } + + const widget = document.createElement( 'altcha-widget' ); + widget.className = 'frm-altcha-widget'; + widget.addEventListener( 'statechange', syncWidgetDisplay ); + + WIDGET_ATTRIBUTES.forEach( attribute => { + const value = captcha.dataset[ attribute ]; + + if ( value ) { + widget.setAttribute( attribute, value ); + } + } ); + + // Each widget goes into a different captcha element, so there is nothing to batch. + captcha.append( widget ); // eslint-disable-line formidable/prefer-document-fragment + } ); +}; + +/** + * Mark the widget's checkbox invalid after the server rejects it, as Formidable does for + * other inputs, until the visitor verifies again. + * + * @param {HTMLElement} widget The altcha-widget element. + * @return {void} + */ +const markInvalid = widget => { + const checkbox = widget.querySelector( 'input[type="checkbox"]' ); + + if ( ! checkbox ) { + return; + } + + checkbox.setAttribute( 'aria-invalid', 'true' ); + + const clear = () => { + if ( widget.getState() === 'verified' ) { + checkbox.removeAttribute( 'aria-invalid' ); + widget.removeEventListener( 'statechange', clear ); + } + }; + + widget.addEventListener( 'statechange', clear ); +}; + +/** + * Add widgets to new form pages, and reset a widget when the server rejects its solution, + * so the visitor gets a fresh challenge. + * + * Formidable adds a .frm_error element to the field container for each server-side error. + * + * @param {MutationRecord[]} records DOM changes. + * @return {void} + */ +const watchChanges = records => { + records.forEach( record => { + record.addedNodes.forEach( node => { + if ( ! ( node instanceof HTMLElement ) ) { + return; + } + + if ( ! node.classList.contains( 'frm_error' ) ) { + addWidgets( node ); + return; + } + + const widget = node.closest( '.frm_form_field' )?.querySelector( WIDGET_SELECTOR ); + + if ( widget && typeof widget.reset === 'function' ) { + widget.reset(); + markInvalid( widget ); + } + } ); + } ); +}; + +/** + * Start once, even if a theme or plugin prints the script twice. + * + * @return {void} + */ +const init = () => { + if ( document.documentElement.dataset.frmAltcha ) { + return; + } + + document.documentElement.dataset.frmAltcha = '1'; + addWidgets( document ); + document.addEventListener( 'submit', verifyBeforeSubmit, true ); + document.addEventListener( 'invalid', verifyInvalidWidget, true ); + new MutationObserver( watchChanges ).observe( document.documentElement, { childList: true, subtree: true } ); +}; + +if ( document.readyState === 'loading' ) { + document.addEventListener( 'DOMContentLoaded', init ); +} else { + init(); +} diff --git a/package-lock.json b/package-lock.json index a157f47daa..f4e7a3bef8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@wordpress/element": "^2.16.0", "@wordpress/i18n": "^3.14.0", "@wordpress/url": "^2.17.0", + "altcha": "3.5.0", "classnames": "^2.2.6", "glob": "^11.0.3", "google-closure-compiler": "^20240317.0.0", @@ -8961,6 +8962,15 @@ "ajv": "^6.9.1" } }, + "node_modules/altcha": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/altcha/-/altcha-3.5.0.tgz", + "integrity": "sha512-wBXNK1bBeWs/XTOZiyE3JQvRNECgFKYEJqcPxFW7tFd7ErG62yQmMlRasygZrza3zyNTTuon3BfMF/PcBcepcw==", + "license": "MIT", + "dependencies": { + "hash-wasm": "^4.12.0" + } + }, "node_modules/anser": { "version": "1.4.10", "resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz", @@ -14785,6 +14795,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hash-wasm": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/hash-wasm/-/hash-wasm-4.13.0.tgz", + "integrity": "sha512-GrWl7wsV46fKIXQZB5ebskLZLAmKL6d9RS0fspCxDeQyjoNu1AfTJTMLPOJyfzaQm0ldFiwFN21/w+sE/kgEFQ==", + "license": "MIT" + }, "node_modules/hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", diff --git a/package.json b/package.json index 08e62b2810..6865ce7262 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "@wordpress/element": "^2.16.0", "@wordpress/i18n": "^3.14.0", "@wordpress/url": "^2.17.0", + "altcha": "3.5.0", "classnames": "^2.2.6", "glob": "^11.0.3", "google-closure-compiler": "^20240317.0.0", diff --git a/resources/scss/altcha.scss b/resources/scss/altcha.scss new file mode 100644 index 0000000000..5cd05cf065 --- /dev/null +++ b/resources/scss/altcha.scss @@ -0,0 +1,36 @@ +/* + * Match the ALTCHA widget to the active Formidable form style. + * Each value falls back to the widget's own default when the form has no style. + */ +.with_frm_style .frm-altcha-widget { + --altcha-border-color: var(--border-color, #d0d0d0); + --altcha-border-radius: var(--border-radius, 6px); + --altcha-color-base: var(--bg-color, #fff); + --altcha-color-base-content: var(--text-color, #1e1e1e); + --altcha-color-primary: var(--submit-bg-color, #2c4ccf); + --altcha-color-primary-content: var(--submit-text-color, #fff); + --altcha-color-error: var(--border-color-error, #b94a48); + --altcha-checkbox-border-color: var(--border-color, #98a2b3); + --altcha-max-width: 100%; + display: block; +} + +/* + * The widget's checkbox is required until verified, so Formidable's invalid input styles + * would paint it red before the visitor has done anything. + */ +.with_frm_style .frm_form_field .frm-altcha-widget .altcha-checkbox input[type="checkbox"]:not(:checked) { + border-color: var(--altcha-checkbox-border-color); + box-shadow: none; +} + +/* + * Formidable's focus style paints a focused input with the field background, so a verified + * checkbox lost its fill while focused and its white checkmark disappeared on white. Keep the + * widget's checked colors on focus. The focus ring from the form style still shows. + * The style rule weighs (0,7,1), so this selector needs (0,9,1) to win without !important. + */ +.with_frm_style .frm_form_field .frm-altcha-widget .altcha[data-state] .altcha-checkbox input[type="checkbox"]:checked:focus { + background-color: var(--altcha-color-success); + border-color: var(--altcha-color-success); +} diff --git a/tests/phpunit/altcha/FrmAltchaTestHelper.php b/tests/phpunit/altcha/FrmAltchaTestHelper.php new file mode 100644 index 0000000000..a01200adfe --- /dev/null +++ b/tests/phpunit/altcha/FrmAltchaTestHelper.php @@ -0,0 +1,85 @@ + 10, + 'counter' => self::COUNTER, + 'cost' => 1, + ), + $args + ) + ); + } + + /** + * Solve a challenge the way the widget does and encode the payload. + * + * @param array $challenge Challenge from FrmAltchaChallengeHelper::create(). + * @param int $counter Counter to submit. + * + * @return string + */ + public static function solve( $challenge, $counter = self::COUNTER ) { + $parameters = $challenge['parameters']; + $key = FrmAltchaChallengeHelper::derive_key( hex2bin( $parameters['nonce'] ), hex2bin( $parameters['salt'] ), $counter, $parameters['cost'] ); + + return self::encode( + array( + 'challenge' => $challenge, + 'solution' => array( + 'counter' => $counter, + 'derivedKey' => bin2hex( $key ), + 'time' => 12.3, + ), + ) + ); + } + + /** + * Decode a payload into an array. + * + * @param string $payload Base64 JSON. + * + * @return array + */ + public static function decode( $payload ) { + return json_decode( base64_decode( $payload ), true ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + } + + /** + * Encode data as a payload, the same way the widget does. + * + * @param mixed $data Payload data. + * + * @return string + */ + public static function encode( $data ) { + return base64_encode( (string) wp_json_encode( $data ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + } +} diff --git a/tests/phpunit/altcha/test_FrmAltchaAssets.php b/tests/phpunit/altcha/test_FrmAltchaAssets.php new file mode 100644 index 0000000000..9700a37775 --- /dev/null +++ b/tests/phpunit/altcha/test_FrmAltchaAssets.php @@ -0,0 +1,92 @@ +language; + } + + /** + * The widget loads only the selected translation, before the main bundle. + * + * @dataProvider translation_cases + * + * @param string $language Selected widget language. + * @param string $translation Expected translation filename, or empty for English. + */ + public function test_translation_dependency( $language, $translation ) { + global $wp_scripts; + + $previous_scripts = $wp_scripts; + $wp_scripts = null; + $this->language = $language; + add_filter( 'frm_altcha_language', array( $this, 'filter_language' ) ); + + try { + wp_register_script( 'formidable', false ); + $url = FrmAltchaController::api_url(); + + // Lite registers the same handle after the URL filter has run. + wp_register_script( 'captcha-api', $url, array( 'formidable' ), '3', true ); + wp_enqueue_script( 'captcha-api' ); + + $scripts = wp_scripts(); + $dependencies = array( 'formidable' ); + + if ( '' !== $translation ) { + $handle = 'frm-altcha-language-' . $translation; + $dependencies[] = $handle; + $this->assertStringContainsString( '/js/altcha/i18n/' . $translation . '.js', $scripts->registered[ $handle ]->src ); + } + + $this->assertSame( $dependencies, $scripts->registered['captcha-api']->deps ); + $this->assertStringContainsString( '/js/altcha.js', $url ); + $this->assertTrue( $scripts->all_deps( array( 'captcha-api' ) ) ); + + if ( '' !== $translation ) { + $this->assertLessThan( array_search( 'captcha-api', $scripts->to_do, true ), array_search( $handle, $scripts->to_do, true ) ); + } + } finally { + remove_filter( 'frm_altcha_language', array( $this, 'filter_language' ) ); + $wp_scripts = $previous_scripts; + } + } + + /** + * @return array + */ + public static function translation_cases() { + return array( + 'English' => array( 'en-US', '' ), + 'German region' => array( 'de-CH', 'de' ), + 'French region' => array( 'fr_FR', 'fr-fr' ), + 'French base' => array( 'fr', 'fr-ca' ), + 'Portuguese base' => array( 'pt', 'pt-pt' ), + 'Portuguese region' => array( 'pt-BR', 'pt-br' ), + 'Spanish base' => array( 'es', 'es-es' ), + 'Chinese region' => array( 'zh-SG', 'zh-cn' ), + 'Unknown language' => array( 'xx-YY', '' ), + 'Invalid language' => array( '../../de', '' ), + ); + } +} diff --git a/tests/phpunit/altcha/test_FrmAltchaChallengeHelper.php b/tests/phpunit/altcha/test_FrmAltchaChallengeHelper.php new file mode 100644 index 0000000000..30a99a9f1f --- /dev/null +++ b/tests/phpunit/altcha/test_FrmAltchaChallengeHelper.php @@ -0,0 +1,194 @@ +assertSame( array( 'parameters', 'signature' ), array_keys( $challenge ) ); + $this->assertSame( array( 'algorithm', 'cost', 'expiresAt', 'keyLength', 'keyPrefix', 'keySignature', 'nonce', 'salt' ), array_keys( $params ) ); + $this->assertSame( 'PBKDF2/SHA-256', $params['algorithm'] ); + $this->assertSame( 32, $params['keyLength'] ); + $this->assertSame( 32, strlen( $params['keyPrefix'] ) ); + $this->assertMatchesRegularExpression( '/^[0-9a-f]{64}$/', $challenge['signature'] ); + $this->assertEqualsWithDelta( time() + 20 * MINUTE_IN_SECONDS, $params['expiresAt'], 5 ); + } + + /** + * Two challenges never share a nonce, salt or signature. + * + * @covers FrmAltchaChallengeHelper::create + */ + public function test_challenges_are_unique() { + $first = FrmAltchaChallengeHelper::create(); + $second = FrmAltchaChallengeHelper::create(); + + $this->assertNotSame( $first['parameters']['nonce'], $second['parameters']['nonce'] ); + $this->assertNotSame( $first['parameters']['salt'], $second['parameters']['salt'] ); + $this->assertNotSame( $first['signature'], $second['signature'] ); + } + + /** + * @covers FrmAltchaChallengeHelper::verify + */ + public function test_solved_challenge_verifies() { + $challenge = FrmAltchaTestHelper::challenge(); + $result = FrmAltchaChallengeHelper::verify( FrmAltchaTestHelper::solve( $challenge ) ); + + $this->assertTrue( $result['verified'] ); + $this->assertSame( '', $result['reason'] ); + $this->assertSame( hash( 'sha256', $challenge['signature'] ), $result['id'] ); + $this->assertSame( $challenge['parameters']['expiresAt'], $result['expires'] ); + } + + /** + * The key prefix is the first half of the derived key, so a search finds the counter. + * + * @covers FrmAltchaChallengeHelper::create + * @covers FrmAltchaChallengeHelper::derive_key + */ + public function test_key_prefix_matches_secret_counter() { + $challenge = FrmAltchaTestHelper::challenge(); + $params = $challenge['parameters']; + $found = null; + + for ( $counter = 0; $counter <= 10; $counter++ ) { + $key = bin2hex( FrmAltchaChallengeHelper::derive_key( hex2bin( $params['nonce'] ), hex2bin( $params['salt'] ), $counter, $params['cost'] ) ); + + if ( str_starts_with( $key, $params['keyPrefix'] ) ) { + $found = $counter; + break; + } + } + + $this->assertSame( FrmAltchaTestHelper::COUNTER, $found ); + } + + /** + * Lowering the cost, moving the expiry or swapping the prefix breaks the signature. + * + * @covers FrmAltchaChallengeHelper::verify + */ + public function test_tampered_parameters_are_rejected() { + $payload = FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge() ); + $changes = array( + 'cost' => 2, + 'expiresAt' => time() + DAY_IN_SECONDS, + 'keyPrefix' => str_repeat( '0', 32 ), + ); + + foreach ( $changes as $key => $value ) { + $data = FrmAltchaTestHelper::decode( $payload ); + $data['challenge']['parameters'][ $key ] = $value; + $result = FrmAltchaChallengeHelper::verify( FrmAltchaTestHelper::encode( $data ) ); + + $this->assertFalse( $result['verified'], $key ); + $this->assertSame( 'invalid-signature', $result['reason'], $key ); + } + } + + /** + * @covers FrmAltchaChallengeHelper::verify + */ + public function test_wrong_solution_is_rejected() { + $challenge = FrmAltchaTestHelper::challenge(); + $wrong_counter = FrmAltchaChallengeHelper::verify( FrmAltchaTestHelper::solve( $challenge, FrmAltchaTestHelper::COUNTER + 1 ) ); + $this->assertFalse( $wrong_counter['verified'] ); + $this->assertSame( 'invalid-solution', $wrong_counter['reason'] ); + + $data = FrmAltchaTestHelper::decode( FrmAltchaTestHelper::solve( $challenge ) ); + $data['solution']['derivedKey'] = str_repeat( 'a', 64 ); + $guessed = FrmAltchaChallengeHelper::verify( FrmAltchaTestHelper::encode( $data ) ); + $this->assertFalse( $guessed['verified'] ); + $this->assertSame( 'invalid-solution', $guessed['reason'] ); + } + + /** + * A challenge signed by another site is rejected. + * + * @covers FrmAltchaChallengeHelper::verify + */ + public function test_other_site_secret_is_rejected() { + $payload = FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge() ); + + update_option( FrmAltchaChallengeHelper::SECRET_OPTION, str_repeat( 'b', 64 ), false ); + $result = FrmAltchaChallengeHelper::verify( $payload ); + + $this->assertFalse( $result['verified'] ); + $this->assertSame( 'invalid-signature', $result['reason'] ); + } + + /** + * @covers FrmAltchaChallengeHelper::verify + */ + public function test_expired_challenge_is_rejected() { + $payload = FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge( array( 'expires' => 1 ) ) ); + sleep( 2 ); + + $result = FrmAltchaChallengeHelper::verify( $payload ); + + $this->assertFalse( $result['verified'] ); + $this->assertSame( 'expired', $result['reason'] ); + } + + /** + * @covers FrmAltchaChallengeHelper::verify + */ + public function test_malformed_payloads_are_rejected() { + $valid = FrmAltchaTestHelper::decode( FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge() ) ); + $string_counter = $valid; + $extra_parameter = $valid; + $upper_key = $valid; + + $string_counter['solution']['counter'] = '7'; + $extra_parameter['challenge']['parameters']['x'] = 1; + $upper_key['solution']['derivedKey'] = strtoupper( $valid['solution']['derivedKey'] ); + + $payloads = array( + 'missing' => '', + 'array' => array( 'a' ), + 'not base64' => '%%%', + 'not json' => base64_encode( 'nope' ), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + 'widget test' => FrmAltchaTestHelper::encode( + array( + 'challenge' => null, + 'solution' => null, + 'test' => true, + ) + ), + 'v1 payload' => FrmAltchaTestHelper::encode( + array( + 'algorithm' => 'SHA-256', + 'challenge' => 'a', + 'number' => 1, + 'salt' => 's', + 'signature' => 'x', + ) + ), + 'string counter' => FrmAltchaTestHelper::encode( $string_counter ), + 'extra param' => FrmAltchaTestHelper::encode( $extra_parameter ), + 'upper key' => FrmAltchaTestHelper::encode( $upper_key ), + 'too long' => str_repeat( 'A', FrmAltchaChallengeHelper::MAX_PAYLOAD_LENGTH + 4 ), + ); + + foreach ( $payloads as $label => $payload ) { + $result = FrmAltchaChallengeHelper::verify( $payload ); + $this->assertFalse( $result['verified'], $label ); + $this->assertContains( $result['reason'], array( 'missing', 'malformed' ), $label ); + } + } +} diff --git a/tests/phpunit/altcha/test_FrmAltchaDefaults.php b/tests/phpunit/altcha/test_FrmAltchaDefaults.php new file mode 100644 index 0000000000..afdb002633 --- /dev/null +++ b/tests/phpunit/altcha/test_FrmAltchaDefaults.php @@ -0,0 +1,101 @@ +]*value="([a-z]+)"/', $html, $matches ); + + $this->assertSame( array( 'altcha', 'recaptcha', 'hcaptcha', 'turnstile' ), $matches[1], 'ALTCHA should be the first of four CAPTCHA options.' ); + $this->assertStringContainsString( 'id="altcha_settings"', $html, 'The ALTCHA settings panel should be included.' ); + } + + /** + * Defaults apply only to legacy providers with no keys, before a type is saved. + */ + public function test_legacy_provider_without_keys_defaults_to_altcha() { + foreach ( array( 'recaptcha', 'hcaptcha', 'turnstile' ) as $provider ) { + update_option( + 'frm_options', + (object) array( + 'active_captcha' => $provider, + 'pubkey' => '', + 'privkey' => '', + ) + ); + $settings = new FrmSettings(); + $this->assertSame( 'altcha', $settings->active_captcha, 'Legacy providers without keys should default to ALTCHA.' ); + } + } + + /** + * Existing keys, including partially configured providers, preserve the selection. + */ + public function test_existing_provider_keys_preserve_selection() { + foreach ( array( + 'recaptcha' => '', + 'hcaptcha' => 'hcaptcha_', + 'turnstile' => 'turnstile_', + ) as $provider => $prefix ) { + foreach ( array( 'pubkey', 'privkey' ) as $key ) { + update_option( + 'frm_options', + (object) array( + 'active_captcha' => $provider, + 'pubkey' => '', + 'privkey' => '', + $prefix . $key => 'test-key', + ) + ); + $settings = new FrmSettings(); + $this->assertSame( $provider, $settings->active_captcha, 'Existing keys should preserve the selected provider.' ); + } + } + } + + /** + * Saving a selection opts out of the compatibility fallback on later requests. + */ + public function test_saved_selection_without_keys_does_not_fallback() { + foreach ( array( 'recaptcha', 'hcaptcha', 'turnstile', 'altcha' ) as $provider ) { + $settings = new FrmSettings(); + $params = array(); + + foreach ( get_object_vars( $settings ) as $key => $value ) { + $params[ 'frm_' . $key ] = $value; + } + + $params['frm_active_captcha'] = $provider; + + foreach ( array( '', 'hcaptcha_', 'turnstile_' ) as $prefix ) { + $params[ 'frm_' . $prefix . 'pubkey' ] = ''; + $params[ 'frm_' . $prefix . 'privkey' ] = ''; + } + + $this->run_private_method( array( $settings, 'update_settings' ), array( $params ) ); + $settings->store(); + $reloaded = new FrmSettings(); + + $this->assertTrue( $reloaded->captcha_type_selected, 'Saving a provider should record an explicit selection.' ); + $this->assertSame( $provider, $reloaded->active_captcha, 'Explicit selections should survive reloads without keys.' ); + } + } + + /** + * A new installation needs no API keys to use the CAPTCHA field. + */ + public function test_new_settings_default_to_altcha() { + delete_option( 'frm_options' ); + delete_option( 'recaptcha' ); + $settings = new FrmSettings(); + $this->assertSame( 'altcha', $settings->active_captcha, 'New installations should default to ALTCHA.' ); + } +} diff --git a/tests/phpunit/altcha/test_FrmAltchaReplayHelper.php b/tests/phpunit/altcha/test_FrmAltchaReplayHelper.php new file mode 100644 index 0000000000..8f09a9f24f --- /dev/null +++ b/tests/phpunit/altcha/test_FrmAltchaReplayHelper.php @@ -0,0 +1,196 @@ +start_transaction(); + } + + public function tearDown(): void { + FrmAltchaReplayHelper::uninstall(); + parent::tearDown(); + } + + /** + * Settings, challenge requests, provider selection and cleanup do not create replay storage. + */ + public function test_unused_sites_do_not_create_storage() { + global $wpdb; + $migrate = new FrmMigrate(); + $migrate->upgrade(); + FrmAltchaChallengeHelper::create( + array( + 'counter' => 7, + 'cost' => 1, + ) + ); + + foreach ( array( 'recaptcha', 'hcaptcha', 'turnstile' ) as $provider ) { + FrmCaptchaFactory::get_settings_object( $provider ); + } + + $this->assertFalse( FrmAltchaReplayHelper::is_used( hash( 'sha256', 'unused' ) ), 'An unused challenge should not be claimed.' ); + FrmAltchaReplayHelper::purge(); + FrmCronController::schedule_events(); + + $previous = $wpdb->suppress_errors(); + + try { + $result = $wpdb->query( $wpdb->prepare( 'SELECT 1 FROM %i', FrmAltchaReplayHelper::table_name() ) ); + } finally { + $wpdb->suppress_errors( $previous ); + } + + $this->assertFalse( $result, 'Unused ALTCHA should not create a replay table.' ); + $this->assertFalse( wp_next_scheduled( FrmAltchaReplayHelper::PURGE_HOOK ), 'Unused ALTCHA should not schedule cleanup.' ); + } + + /** + * Simulate a database user that cannot create replay storage. + * + * @param string $query The query about to execute. + * + * @return string + */ + public function reject_replay_table_creation( $query ) { + if ( str_contains( $query, 'CREATE' ) && str_contains( $query, FrmAltchaReplayHelper::table_name() ) ) { + return 'SELECT 1 FROM frm_missing_replay_table'; + } + + return $query; + } + + /** + * Missing CREATE privileges must block a claim rather than disable replay protection. + */ + public function test_failed_table_creation_blocks_claims() { + global $wpdb; + $previous = $wpdb->suppress_errors(); + add_filter( 'query', array( $this, 'reject_replay_table_creation' ) ); + + try { + $result = FrmAltchaReplayHelper::claim( hash( 'sha256', 'failed-create' ), time() + 60 ); + } finally { + remove_filter( 'query', array( $this, 'reject_replay_table_creation' ) ); + $wpdb->suppress_errors( $previous ); + } + + $this->assertFalse( $result, 'A claim should fail when storage cannot be created.' ); + $this->assertFalse( wp_next_scheduled( FrmAltchaReplayHelper::PURGE_HOOK ), 'Failed creation should not schedule cleanup.' ); + } + + /** + * Claims use compact binary hashes without adding WordPress options. + */ + public function test_claim_uses_binary_hash_and_rejects_duplicates() { + global $wpdb; + $id = hash( 'sha256', 'binary-replay' ); + $expires = time() + HOUR_IN_SECONDS; + + $this->assertTrue( FrmAltchaReplayHelper::claim( $id, $expires ), 'The first claim should succeed.' ); + $this->assertFalse( FrmAltchaReplayHelper::claim( $id, $expires + 60 ), 'A second claim should fail.' ); + $this->assertTrue( FrmAltchaReplayHelper::is_used( $id ), 'A claimed challenge should be used.' ); + + $row = $wpdb->get_row( + $wpdb->prepare( + 'SELECT HEX(challenge_hash) AS hash, LENGTH(challenge_hash) AS bytes, expires_at FROM %i WHERE challenge_hash = UNHEX(%s)', + $wpdb->prefix . 'frm_altcha_replays', + $id + ) + ); + $this->assertSame( strtoupper( $id ), $row->hash, 'The complete challenge hash should be stored.' ); + $this->assertSame( 32, (int) $row->bytes, 'The hash should occupy 32 bytes.' ); + $this->assertSame( $expires, (int) $row->expires_at, 'A duplicate claim should leave the original expiration intact.' ); + } + + /** + * Invalid hashes must not be truncated or padded into valid binary keys. + */ + public function test_invalid_hashes_cannot_be_claimed() { + foreach ( array( '', 'not-hex', str_repeat( 'a', 63 ), str_repeat( 'a', 65 ), str_repeat( 'g', 64 ) ) as $id ) { + $this->assertFalse( FrmAltchaReplayHelper::claim( $id, time() + 60 ), 'Malformed hashes should not be claimed.' ); + $this->assertFalse( FrmAltchaReplayHelper::is_used( $id ), 'Malformed hashes should not match a claim.' ); + } + } + + /** + * Cleanup drains more than one batch and preserves unexpired claims. + */ + public function test_cleanup_removes_multiple_batches() { + $expires = time() - 60; + + for ( $i = 0; $i <= FrmAltchaReplayHelper::PURGE_BATCH_SIZE; $i++ ) { + FrmAltchaReplayHelper::claim( hash( 'sha256', 'expired-replay-' . $i ), $expires ); + } + + $live = hash( 'sha256', 'unexpired-replay' ); + FrmAltchaReplayHelper::claim( $live, time() + HOUR_IN_SECONDS ); + FrmAltchaReplayHelper::purge(); + + $this->assertFalse( FrmAltchaReplayHelper::is_used( hash( 'sha256', 'expired-replay-0' ) ), 'The first cleanup batch should be deleted.' ); + $last = hash( 'sha256', 'expired-replay-' . FrmAltchaReplayHelper::PURGE_BATCH_SIZE ); + $this->assertFalse( FrmAltchaReplayHelper::is_used( $last ), 'Rows beyond the first batch should also be deleted.' ); + $this->assertTrue( FrmAltchaReplayHelper::is_used( $live ), 'Unexpired claims should survive cleanup.' ); + } + + /** + * The first accepted solution creates the compact indexed schema. + */ + public function test_first_claim_creates_storage_and_indexes() { + global $wpdb; + $id = hash( 'sha256', 'first-replay' ); + $this->assertTrue( FrmAltchaReplayHelper::claim( $id, time() + HOUR_IN_SECONDS ), 'The first replay claim should succeed.' ); + $table = FrmAltchaReplayHelper::table_name(); + $columns = $wpdb->get_results( $wpdb->prepare( 'SHOW COLUMNS FROM %i', $table ), OBJECT_K ); + + $this->assertSame( 'binary(32)', $columns['challenge_hash']->Type, 'Replay hashes should use a binary column.' ); + $this->assertCount( 2, $columns, 'Replay storage should contain only the hash and expiration.' ); + $this->assertNotFalse( wp_next_scheduled( FrmAltchaReplayHelper::PURGE_HOOK ), 'The first replay should schedule cleanup.' ); + $index_rows = $wpdb->get_results( $wpdb->prepare( 'SHOW INDEX FROM %i', $table ), ARRAY_A ); + $indexed = array(); + + foreach ( $index_rows as $index ) { + $indexed[ $index['Key_name'] ] = $index['Column_name']; + } + + $this->assertSame( 'challenge_hash', $indexed['PRIMARY'], 'The challenge hash should prevent duplicate claims.' ); + $this->assertSame( 'expires_at', $indexed['expires_at'], 'Expiration cleanup should have its own index.' ); + } + + /** + * Uninstall removes optional replay storage and its scheduled cleanup. + */ + public function test_uninstall_removes_replay_table() { + global $wpdb; + FrmAltchaReplayHelper::claim( hash( 'sha256', 'uninstall-replay' ), time() + HOUR_IN_SECONDS ); + $table = FrmAltchaReplayHelper::table_name(); + $this->set_user_by_role( 'administrator' ); + do_action( 'frm_after_uninstall' ); + $suppressed = $wpdb->suppress_errors(); + + try { + $result = $wpdb->query( $wpdb->prepare( 'SELECT 1 FROM %i', $table ) ); + } finally { + $wpdb->suppress_errors( $suppressed ); + } + + $this->assertFalse( $result, 'The replay table should no longer be queryable after uninstall.' ); + $this->assertFalse( wp_next_scheduled( FrmAltchaReplayHelper::PURGE_HOOK ), 'Uninstall should remove cleanup scheduling.' ); + } +} diff --git a/tests/phpunit/altcha/test_FrmAltchaSubmit.php b/tests/phpunit/altcha/test_FrmAltchaSubmit.php new file mode 100644 index 0000000000..3ad0b6db1c --- /dev/null +++ b/tests/phpunit/altcha/test_FrmAltchaSubmit.php @@ -0,0 +1,279 @@ +previous_captcha = $frm_settings->active_captcha; + $frm_settings->active_captcha = FrmAltchaSettings::TYPE; + + $this->form_id = (int) $this->factory->form->create(); + $this->text_id = (int) $this->factory->field->create( + array( + 'type' => 'text', + 'form_id' => $this->form_id, + 'required' => '1', + ) + ); + $this->altcha_id = (int) $this->factory->field->create( + array( + 'type' => 'captcha', + 'form_id' => $this->form_id, + ) + ); + } + + public function tearDown(): void { + $_POST = array(); + FrmAppHelper::get_settings()->active_captcha = $this->previous_captcha; + parent::tearDown(); + } + + /** + * Validate a submission the way Formidable does on submit. + * + * @param mixed $payload Value of the widget's hidden input, or null to leave it out. + * @param string $text Value of the required text field. + * + * @return array Validation errors. + */ + private function submit( $payload, $text = 'Hello' ) { + $_POST = array( + 'form_id' => $this->form_id, + 'frm_action' => 'create', + 'item_meta' => array( + $this->text_id => $text, + ), + ); + + if ( null !== $payload ) { + $_POST['frm-altcha-response'] = $payload; + } + + self::reset_pro_captcha_state(); + + return FrmEntryValidate::validate( wp_unslash( $_POST ) ); + } + + /** + * Pro remembers a passed captcha for the rest of the request, so later captcha fields on a + * multi-page form are skipped. Each submit in these tests stands for a separate request. + * + * @return void + */ + private static function reset_pro_captcha_state() { + if ( ! class_exists( 'FrmProFieldCaptcha' ) ) { + return; + } + + $initial = array( + 'is_valid' => false, + 'checked' => null, + ); + + foreach ( $initial as $name => $value ) { + $property = new ReflectionProperty( 'FrmProFieldCaptcha', $name ); + $property->setAccessible( true ); + $property->setValue( null, $value ); + } + } + + /** + * ALTCHA is a registered captcha type and Lite's Captcha field uses it. + * + * @covers FrmCaptchaFactory::get_settings_object + * @covers FrmAltchaSettings::add_front_end_element_attributes + */ + public function test_captcha_field_renders_altcha() { + $settings = FrmCaptchaFactory::get_settings_object(); + + $this->assertInstanceOf( 'FrmAltchaSettings', $settings ); + $this->assertSame( 'frm-altcha-response', $settings->token_field ); + $this->assertTrue( FrmFieldCaptcha::should_show_captcha() ); + + $field = FrmFieldFactory::get_field_object( FrmField::getOne( $this->altcha_id ) ); + $html = $field->front_field_input( + array( + 'html_id' => 'field_altcha_test', + 'field_name' => 'item_meta[' . $this->altcha_id . ']', + ), + array() + ); + + $this->assertStringContainsString( 'class="frm-altcha"', $html ); + $this->assertStringContainsString( 'data-name="frm-altcha-response"', $html ); + $this->assertStringContainsString( 'action=frm_altcha_challenge', $html ); + $this->assertStringNotContainsString( 'data-sitekey', $html ); + } + + /** + * Other captcha types are unchanged, and an unknown type still falls back to reCAPTCHA. + * + * @covers FrmCaptchaFactory::get_settings_object + */ + public function test_other_captcha_types_are_unchanged() { + $this->assertInstanceOf( 'FrmTurnstileSettings', FrmCaptchaFactory::get_settings_object( 'turnstile' ) ); + $this->assertInstanceOf( 'FrmRecaptchaSettings', FrmCaptchaFactory::get_settings_object( 'not-registered' ) ); + } + + /** + * @covers FrmAltchaController::verify_response + * @covers FrmAltchaController::claim_solution + */ + public function test_solved_payload_passes_once() { + $payload = FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge() ); + + $this->assertSame( array(), $this->submit( $payload ) ); + + $replayed = $this->submit( $payload ); + $this->assertArrayHasKey( 'field' . $this->altcha_id, $replayed ); + $this->assertSame( FrmAppHelper::get_settings()->re_msg, $replayed[ 'field' . $this->altcha_id ] ); + } + + /** + * A visitor who fixes another field and submits again keeps their solution. + * + * @covers FrmAltchaController::claim_solution + */ + public function test_other_errors_do_not_spend_the_solution() { + $payload = FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge() ); + $errors = $this->submit( $payload, '' ); + $this->assertArrayHasKey( 'field' . $this->text_id, $errors ); + $this->assertArrayNotHasKey( 'field' . $this->altcha_id, $errors ); + + $this->assertSame( array(), $this->submit( $payload ) ); + } + + /** + * @covers FrmAltchaController::verify_response + */ + public function test_missing_and_invalid_payloads_fail() { + $data = FrmAltchaTestHelper::decode( FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge() ) ); + $data['solution']['derivedKey'] = str_repeat( 'c', 64 ); + + $this->assertArrayHasKey( 'field' . $this->altcha_id, $this->submit( null ) ); + $this->assertArrayHasKey( 'field' . $this->altcha_id, $this->submit( FrmAltchaTestHelper::encode( $data ) ) ); + } + + /** + * The field's own invalid message is used when the check fails. + * + * @covers FrmAltchaController::verify_response + */ + public function test_custom_invalid_message() { + FrmField::update( $this->altcha_id, array( 'field_options' => array( 'invalid' => 'Bots go home' ) ) ); + + $data = FrmAltchaTestHelper::decode( FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge() ) ); + $data['solution']['derivedKey'] = str_repeat( 'd', 64 ); + $errors = $this->submit( FrmAltchaTestHelper::encode( $data ) ); + + $this->assertSame( 'Bots go home', $errors[ 'field' . $this->altcha_id ] ); + + // Lite uses its own message when no response is posted at all, as for the other captcha types. + $this->assertSame( 'The captcha is missing from this form', $this->submit( null )[ 'field' . $this->altcha_id ] ); + } + + /** + * With CAPTCHA spam handling set to save, a failed ALTCHA check saves a spam entry like the other captcha types. + * + * @covers FrmAltchaController::verify_response + */ + public function test_failed_check_follows_spam_handling() { + if ( ! FrmSpamEntriesHelper::can_store_spam() ) { + $this->markTestSkipped( 'Spam entries cannot be stored on this install.' ); + } + + add_filter( 'frm_save_spam_entry', '__return_true' ); + + $data = FrmAltchaTestHelper::decode( FrmAltchaTestHelper::solve( FrmAltchaTestHelper::challenge() ) ); + $data['solution']['derivedKey'] = str_repeat( 'e', 64 ); + $errors = $this->submit( FrmAltchaTestHelper::encode( $data ) ); + + remove_filter( 'frm_save_spam_entry', '__return_true' ); + + $this->assertArrayNotHasKey( 'field' . $this->altcha_id, $errors ); + $this->assertSame( 'captcha', FrmSpamEntriesHelper::get_flagged_source( array( 'form_id' => $this->form_id ) ) ); + } + + /** + * @covers FrmAltchaReplayHelper::claim + * @covers FrmAltchaReplayHelper::is_used + * @covers FrmAltchaReplayHelper::purge + */ + public function test_replay_guard_claims_once_and_purges_expired() { + $live = hash( 'sha256', 'live' ); + $expired = hash( 'sha256', 'expired' ); + + $this->assertFalse( FrmAltchaReplayHelper::is_used( $live ) ); + $this->assertTrue( FrmAltchaReplayHelper::claim( $live, time() + HOUR_IN_SECONDS ) ); + $this->assertFalse( FrmAltchaReplayHelper::claim( $live, time() + HOUR_IN_SECONDS ) ); + $this->assertTrue( FrmAltchaReplayHelper::is_used( $live ) ); + + $this->assertTrue( FrmAltchaReplayHelper::claim( $expired, time() - 10 ) ); + FrmAltchaReplayHelper::purge(); + + $this->assertTrue( FrmAltchaReplayHelper::is_used( $live ) ); + $this->assertFalse( FrmAltchaReplayHelper::is_used( $expired ) ); + } + + /** + * @covers FrmAltchaHelper::sanitize_settings + */ + public function test_settings_are_clamped() { + $settings = FrmAltchaHelper::sanitize_settings( + array( + 'difficulty' => 'extreme', + 'expires' => '99999', + 'auto' => '