Version Description
Oct 20 2022 =
New integrations added , CleanTalk status on the sites list implemented , parameters without cookies improved and some minor issues fixed
- New. Integration. Site Reviews Integration.
- New. Integration. Sendinblue Integration
- Mod: Cleantalk Status in list of sites
- Fix. JS. CF async loading scripts fixed.
- Fix. JS. Listening events on document object instead of window object.
- Fix. Fixed spam protection if JS disabled.
- Fix. Mautic integration. Force third-side validation pre-intreception.
- Fix. WooCommerce. CartBounty plugin requests skipped.
- Fix. Code. Deprecated hooks wpmu_new_blog, delete_blog fixed.
- Fix. WPMS. Getting setting fixed for apply this on the new added blog.
- Fix. Code. JS events listening on the document object.
- Fix. Code. JS parameter without cookies fixed.
- Fix. EmailEncoder. Exclude placeholders from encoding to prevent field breach.
- Fix. No cookie. Collecting data moved to the more early stage.
- Fix. Common. Custom ajax forms block message fixed.
- Fix. EmailDecoder. Email decoding block message fixed
Download this release
Release Info
Developer | glomberg |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.187 |
Comparing to | |
See all releases |
Code changes from version 5.186 to 5.187
- cleantalk.php +28 -10
- inc/cleantalk-admin.php +46 -0
- inc/cleantalk-ajax.php +18 -4
- inc/cleantalk-common.php +4 -6
- inc/cleantalk-public-integrations.php +2 -0
- inc/cleantalk-public-validate.php +41 -12
- inc/cleantalk-public.php +16 -4
- js/apbct-public--3--cleantalk-modal.min.js +1 -1
- js/apbct-public--3--cleantalk-modal.min.js.map +1 -1
- js/apbct-public-bundle.min.js +1 -1
- js/apbct-public-bundle.min.js.map +1 -1
- lib/Cleantalk/Antispam/EmailEncoder.php +9 -13
- lib/Cleantalk/ApbctWP/Activator.php +1 -1
- lib/Cleantalk/ApbctWP/Antispam/EmailEncoder.php +6 -7
- lib/Cleantalk/ApbctWP/CleantalkUpgraderSkin.php +2 -1
- lib/Cleantalk/ApbctWP/CleantalkUpgraderSkinDeprecated.php +1 -0
- readme.txt +22 -3
cleantalk.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
7 |
-
Version: 5.
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
@@ -175,7 +175,7 @@ add_action('wp_ajax_cleantalk_force_ajax_check', 'ct_ajax_hook');
|
|
175 |
add_action('wp_ajax_nopriv_apbct_email_check_before_post', 'apbct_email_check_before_post');
|
176 |
|
177 |
// Database prefix
|
178 |
-
global $wpdb;
|
179 |
$apbct->db_prefix = ! APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $wpdb->prefix : $wpdb->base_prefix;
|
180 |
$apbct->db_prefix = ! $apbct->white_label && defined('CLEANTALK_ACCESS_KEY') ? $wpdb->base_prefix : $wpdb->prefix;
|
181 |
|
@@ -485,11 +485,30 @@ function apbct_deactivation($network_wide)
|
|
485 |
}
|
486 |
|
487 |
// Hook for newly added blog
|
488 |
-
|
489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
{
|
491 |
Activator::activation(false, $blog_id);
|
492 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
|
494 |
// Async loading for JavaScript
|
495 |
add_filter('script_loader_tag', 'apbct_add_async_attribute', 10, 3);
|
@@ -499,11 +518,6 @@ if ( ! defined('WP_ALLOW_MULTISITE') || (defined('WP_ALLOW_MULTISITE') && WP_ALL
|
|
499 |
add_action('admin_init', 'apbct_plugin_redirect');
|
500 |
}
|
501 |
|
502 |
-
// Deleting SFW tables when deleting websites
|
503 |
-
if ( defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE === true ) {
|
504 |
-
add_action('delete_blog', 'apbct_sfw__delete_tables', 10, 2);
|
505 |
-
}
|
506 |
-
|
507 |
// After plugin loaded - to load locale as described in manual
|
508 |
add_action('plugins_loaded', 'apbct_plugin_loaded');
|
509 |
|
@@ -644,6 +658,10 @@ if ( is_admin() || is_network_admin() ) {
|
|
644 |
// Init action.
|
645 |
add_action('plugins_loaded', 'apbct_init', 1);
|
646 |
|
|
|
|
|
|
|
|
|
647 |
// Comments
|
648 |
add_filter('preprocess_comment', 'ct_preprocess_comment', 1, 1); // param - comment data array
|
649 |
add_filter('comment_text', 'ct_comment_text');
|
@@ -2586,7 +2604,7 @@ function apbct_log($message = 'empty', $func = null, $params = array())
|
|
2586 |
* @return void
|
2587 |
* @psalm-suppress UnusedParam
|
2588 |
*/
|
2589 |
-
function apbct_sfw__delete_tables($blog_id
|
2590 |
{
|
2591 |
global $wpdb;
|
2592 |
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
7 |
+
Version: 5.187
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
175 |
add_action('wp_ajax_nopriv_apbct_email_check_before_post', 'apbct_email_check_before_post');
|
176 |
|
177 |
// Database prefix
|
178 |
+
global $wpdb, $wp_version;
|
179 |
$apbct->db_prefix = ! APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $wpdb->prefix : $wpdb->base_prefix;
|
180 |
$apbct->db_prefix = ! $apbct->white_label && defined('CLEANTALK_ACCESS_KEY') ? $wpdb->base_prefix : $wpdb->prefix;
|
181 |
|
485 |
}
|
486 |
|
487 |
// Hook for newly added blog
|
488 |
+
if ( version_compare($wp_version, '5.1') >= 0 ) {
|
489 |
+
add_action('wp_initialize_site', 'apbct_activation__new_blog', 10, 2);
|
490 |
+
add_action('wp_uninitialize_site', 'apbct_wpms__delete_blog', 10, 1);
|
491 |
+
} else {
|
492 |
+
add_action('wpmu_new_blog', 'apbct_activation__new_blog__deprecated', 10, 6);
|
493 |
+
add_action('delete_blog', 'apbct_wpms__delete_blog__deprecated', 10, 2);
|
494 |
+
}
|
495 |
+
|
496 |
+
function apbct_activation__new_blog__deprecated($blog_id, $_user_id, $_domain, $_path, $_site_id, $_meta)
|
497 |
{
|
498 |
Activator::activation(false, $blog_id);
|
499 |
}
|
500 |
+
function apbct_activation__new_blog(WP_Site $new_site, $_args)
|
501 |
+
{
|
502 |
+
Activator::activation(false, $new_site->blog_id);
|
503 |
+
}
|
504 |
+
function apbct_wpms__delete_blog__deprecated($blog_id, $_drop)
|
505 |
+
{
|
506 |
+
apbct_sfw__delete_tables($blog_id);
|
507 |
+
}
|
508 |
+
function apbct_wpms__delete_blog(WP_Site $old_site)
|
509 |
+
{
|
510 |
+
apbct_sfw__delete_tables($old_site->blog_id);
|
511 |
+
}
|
512 |
|
513 |
// Async loading for JavaScript
|
514 |
add_filter('script_loader_tag', 'apbct_add_async_attribute', 10, 3);
|
518 |
add_action('admin_init', 'apbct_plugin_redirect');
|
519 |
}
|
520 |
|
|
|
|
|
|
|
|
|
|
|
521 |
// After plugin loaded - to load locale as described in manual
|
522 |
add_action('plugins_loaded', 'apbct_plugin_loaded');
|
523 |
|
658 |
// Init action.
|
659 |
add_action('plugins_loaded', 'apbct_init', 1);
|
660 |
|
661 |
+
if ( Post::get('ct_no_cookie_hidden_field') ) {
|
662 |
+
apbct_form__get_no_cookie_data();
|
663 |
+
}
|
664 |
+
|
665 |
// Comments
|
666 |
add_filter('preprocess_comment', 'ct_preprocess_comment', 1, 1); // param - comment data array
|
667 |
add_filter('comment_text', 'ct_comment_text');
|
2604 |
* @return void
|
2605 |
* @psalm-suppress UnusedParam
|
2606 |
*/
|
2607 |
+
function apbct_sfw__delete_tables($blog_id)
|
2608 |
{
|
2609 |
global $wpdb;
|
2610 |
|
inc/cleantalk-admin.php
CHANGED
@@ -1216,3 +1216,49 @@ function apbct__add_debug_tab($links)
|
|
1216 |
|
1217 |
return $links;
|
1218 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1216 |
|
1217 |
return $links;
|
1218 |
}
|
1219 |
+
|
1220 |
+
/**
|
1221 |
+
* Function for `wpmu_blogs_columns` filter-hook.
|
1222 |
+
*
|
1223 |
+
* @param string[] $sites_columns An array of displayed site columns.
|
1224 |
+
*
|
1225 |
+
* @return string[]
|
1226 |
+
*/
|
1227 |
+
function apbct__wpmu_blogs_columns_filter($sites_columns)
|
1228 |
+
{
|
1229 |
+
$sites_columns[] = esc_html__('CleanTalk Status', 'cleantalk-spam-protect');
|
1230 |
+
|
1231 |
+
return $sites_columns;
|
1232 |
+
}
|
1233 |
+
|
1234 |
+
add_filter('wpmu_blogs_columns', 'apbct__wpmu_blogs_columns_filter');
|
1235 |
+
|
1236 |
+
/**
|
1237 |
+
* Function for `manage_posts_custom_column` action-hook.
|
1238 |
+
*
|
1239 |
+
* @param string $_column_name The name of the column to display.
|
1240 |
+
* @param int $site_id The current post ID.
|
1241 |
+
*
|
1242 |
+
* @return void
|
1243 |
+
*/
|
1244 |
+
function apbct__manage_sites_custom_column_action($_column_name, $site_id)
|
1245 |
+
{
|
1246 |
+
$cleantalk_data = get_blog_option($site_id, 'cleantalk_data');
|
1247 |
+
$key_is_ok_text = esc_html__('The Access key is set and correct', 'cleantalk-spam-protect');
|
1248 |
+
$key_is_bad_text = esc_html__('The Access key is not set or is incorrect', 'cleantalk-spam-protect');
|
1249 |
+
$key_status_caption = '<span style="color: red"">' . $key_is_bad_text . '</span>';
|
1250 |
+
|
1251 |
+
if (!$cleantalk_data) {
|
1252 |
+
return;
|
1253 |
+
}
|
1254 |
+
|
1255 |
+
$key_is_ok = isset($cleantalk_data['key_is_ok']) ? $cleantalk_data['key_is_ok'] : false;
|
1256 |
+
|
1257 |
+
if ($key_is_ok) {
|
1258 |
+
$key_status_caption = '<span style="color: green"">' . $key_is_ok_text . '</span>';
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
echo $key_status_caption;
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
add_action('manage_sites_custom_column', 'apbct__manage_sites_custom_column_action', 10, 2);
|
inc/cleantalk-ajax.php
CHANGED
@@ -406,7 +406,9 @@ function ct_ajax_hook($message_obj = null)
|
|
406 |
// WPUserMeta registration plugin exclusion
|
407 |
'pf_ajax_request',
|
408 |
//profilegrid addon
|
409 |
-
'pm_check_user_exist'
|
|
|
|
|
410 |
);
|
411 |
|
412 |
global $apbct;
|
@@ -532,7 +534,7 @@ function ct_ajax_hook($message_obj = null)
|
|
532 |
if ( Post::get('action') === 'ufbl_front_form_action' ) {
|
533 |
$ct_post_temp = $_POST;
|
534 |
foreach ( $ct_post_temp as $key => $_value ) {
|
535 |
-
if ( preg_match('/form_data_\d_name/', $key) ) {
|
536 |
unset($ct_post_temp[$key]);
|
537 |
}
|
538 |
}
|
@@ -643,10 +645,10 @@ function ct_ajax_hook($message_obj = null)
|
|
643 |
// Detect contact form an set it's name to $contact_form to use later
|
644 |
$contact_form = null;
|
645 |
foreach ( $_POST as $param => $_value ) {
|
646 |
-
if ( strpos($param, 'et_pb_contactform_submit') === 0 ) {
|
647 |
$contact_form = 'contact_form_divi_theme';
|
648 |
}
|
649 |
-
if ( strpos($param, 'avia_generated_form') === 0 ) {
|
650 |
$contact_form = 'contact_form_enfold_theme';
|
651 |
}
|
652 |
if ( ! empty($contact_form) ) {
|
@@ -997,6 +999,18 @@ function ct_ajax_hook($message_obj = null)
|
|
997 |
);
|
998 |
}
|
999 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1000 |
if ( Post::hasString('action', 'fusion_form_submit_form_to_') ) {
|
1001 |
die(
|
1002 |
json_encode(
|
406 |
// WPUserMeta registration plugin exclusion
|
407 |
'pf_ajax_request',
|
408 |
//profilegrid addon
|
409 |
+
'pm_check_user_exist',
|
410 |
+
//Cartbounty plugin (saves every action on the page to keep abandoned carts)
|
411 |
+
'cartbounty_pro_save', 'cartbounty_save'
|
412 |
);
|
413 |
|
414 |
global $apbct;
|
534 |
if ( Post::get('action') === 'ufbl_front_form_action' ) {
|
535 |
$ct_post_temp = $_POST;
|
536 |
foreach ( $ct_post_temp as $key => $_value ) {
|
537 |
+
if ( preg_match('/form_data_\d_name/', (string)$key) ) {
|
538 |
unset($ct_post_temp[$key]);
|
539 |
}
|
540 |
}
|
645 |
// Detect contact form an set it's name to $contact_form to use later
|
646 |
$contact_form = null;
|
647 |
foreach ( $_POST as $param => $_value ) {
|
648 |
+
if ( strpos((string)$param, 'et_pb_contactform_submit') === 0 ) {
|
649 |
$contact_form = 'contact_form_divi_theme';
|
650 |
}
|
651 |
+
if ( strpos((string)$param, 'avia_generated_form') === 0 ) {
|
652 |
$contact_form = 'contact_form_enfold_theme';
|
653 |
}
|
654 |
if ( ! empty($contact_form) ) {
|
999 |
);
|
1000 |
}
|
1001 |
|
1002 |
+
// Site Reviews Integration
|
1003 |
+
if ( Post::hasString('action', 'glsr_action') ) {
|
1004 |
+
wp_send_json_error(
|
1005 |
+
array(
|
1006 |
+
'code' => 'CODE',
|
1007 |
+
'error' => 'ERROR',
|
1008 |
+
'message' => $ct_result->comment,
|
1009 |
+
'notices' => 'NOTICES',
|
1010 |
+
)
|
1011 |
+
);
|
1012 |
+
}
|
1013 |
+
|
1014 |
if ( Post::hasString('action', 'fusion_form_submit_form_to_') ) {
|
1015 |
die(
|
1016 |
json_encode(
|
inc/cleantalk-common.php
CHANGED
@@ -106,8 +106,6 @@ function apbct_base_call($params = array(), $reg_flag = false)
|
|
106 |
return array('ct_result' => new CleantalkResponse());
|
107 |
}
|
108 |
|
109 |
-
apbct_form__get_no_cookie_data();
|
110 |
-
|
111 |
// URL, IP, Role exclusions
|
112 |
if ( apbct_exclusions_check() ) {
|
113 |
do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
|
@@ -510,7 +508,7 @@ function apbct_get_sender_info()
|
|
510 |
|
511 |
if ( count($_POST) > 0 ) {
|
512 |
foreach ( $_POST as $k => $v ) {
|
513 |
-
if ( preg_match("/^(ct_check|checkjs).+/", $k) ) {
|
514 |
$checkjs_data_post = $v;
|
515 |
}
|
516 |
}
|
@@ -1177,7 +1175,7 @@ function apbct_add_async_attribute($tag, $handle)
|
|
1177 |
}
|
1178 |
|
1179 |
// Prevent script deferred loading by various CDN
|
1180 |
-
$tag = str_replace(' src', ' data-
|
1181 |
|
1182 |
if ( class_exists('Cookiebot_WP') ) {
|
1183 |
$tag = str_replace(' src', ' data-cookieconsent="ignore" src', $tag);
|
@@ -1368,8 +1366,8 @@ function apbct_get_honeypot_filled_fields()
|
|
1368 |
//get field suffix for GET search forms
|
1369 |
$apbct_event_id = false;
|
1370 |
foreach ( $_GET as $key => $value ) {
|
1371 |
-
if ( strpos($key, 'apbct_submit_id__search_form_') !== false ) {
|
1372 |
-
$apbct_event_id = str_replace('apbct_submit_id__search_form_', '', $key);
|
1373 |
}
|
1374 |
}
|
1375 |
|
106 |
return array('ct_result' => new CleantalkResponse());
|
107 |
}
|
108 |
|
|
|
|
|
109 |
// URL, IP, Role exclusions
|
110 |
if ( apbct_exclusions_check() ) {
|
111 |
do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
|
508 |
|
509 |
if ( count($_POST) > 0 ) {
|
510 |
foreach ( $_POST as $k => $v ) {
|
511 |
+
if ( preg_match("/^(ct_check|checkjs).+/", (string)$k) ) {
|
512 |
$checkjs_data_post = $v;
|
513 |
}
|
514 |
}
|
1175 |
}
|
1176 |
|
1177 |
// Prevent script deferred loading by various CDN
|
1178 |
+
$tag = str_replace(' src', ' data-pagespeed-no-defer src', $tag);
|
1179 |
|
1180 |
if ( class_exists('Cookiebot_WP') ) {
|
1181 |
$tag = str_replace(' src', ' data-cookieconsent="ignore" src', $tag);
|
1366 |
//get field suffix for GET search forms
|
1367 |
$apbct_event_id = false;
|
1368 |
foreach ( $_GET as $key => $value ) {
|
1369 |
+
if ( strpos((string)$key, 'apbct_submit_id__search_form_') !== false ) {
|
1370 |
+
$apbct_event_id = str_replace('apbct_submit_id__search_form_', '', (string)$key);
|
1371 |
}
|
1372 |
}
|
1373 |
|
inc/cleantalk-public-integrations.php
CHANGED
@@ -1567,7 +1567,9 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1567 |
if ( $buddypress === true ) {
|
1568 |
$bp->signup->errors['signup_username'] = $ct_result->comment;
|
1569 |
} elseif ( $facebook ) {
|
|
|
1570 |
$_POST['FB_userdata']['email'] = '';
|
|
|
1571 |
$_POST['FB_userdata']['name'] = '';
|
1572 |
|
1573 |
return;
|
1567 |
if ( $buddypress === true ) {
|
1568 |
$bp->signup->errors['signup_username'] = $ct_result->comment;
|
1569 |
} elseif ( $facebook ) {
|
1570 |
+
/** @psalm-suppress InvalidArrayOffset */
|
1571 |
$_POST['FB_userdata']['email'] = '';
|
1572 |
+
/** @psalm-suppress InvalidArrayOffset */
|
1573 |
$_POST['FB_userdata']['name'] = '';
|
1574 |
|
1575 |
return;
|
inc/cleantalk-public-validate.php
CHANGED
@@ -76,7 +76,7 @@ function ct_contact_form_validate()
|
|
76 |
//Skip system fields for divi
|
77 |
if ( strpos(Post::get('action'), 'et_pb_contactform_submit') === 0 ) {
|
78 |
foreach ( array_keys($_POST) as $key ) {
|
79 |
-
if ( strpos($key, 'et_pb_contact_email_fields') === 0 ) {
|
80 |
unset($_POST[$key]);
|
81 |
}
|
82 |
}
|
@@ -98,7 +98,7 @@ function ct_contact_form_validate()
|
|
98 |
apbct_is_plugin_active('calculated-fields-form/cp_calculatedfieldsf_free.php')
|
99 |
) {
|
100 |
foreach ( array_keys($_POST) as $key ) {
|
101 |
-
if ( strpos($key, 'calculatedfields') !== false ) {
|
102 |
do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
|
103 |
|
104 |
return null;
|
@@ -157,7 +157,7 @@ function ct_contact_form_validate()
|
|
157 |
|
158 |
// Remove visible fields from POST
|
159 |
foreach ($_POST as $key => $_value) {
|
160 |
-
if (stripos($key, 'apbct_visible_fields') === 0) {
|
161 |
unset($_POST[$key]);
|
162 |
}
|
163 |
}
|
@@ -166,13 +166,13 @@ function ct_contact_form_validate()
|
|
166 |
// Recognize contact form an set it's name to $contact_form to use later
|
167 |
$contact_form = null;
|
168 |
foreach ( array_keys($_POST) as $param ) {
|
169 |
-
if ( strpos($param, 'et_pb_contactform_submit') === 0 ) {
|
170 |
$contact_form = 'contact_form_divi_theme';
|
171 |
-
$contact_form_additional = str_replace('et_pb_contactform_submit', '', $param);
|
172 |
}
|
173 |
-
if ( strpos($param, 'avia_generated_form') === 0 ) {
|
174 |
$contact_form = 'contact_form_enfold_theme';
|
175 |
-
$contact_form_additional = str_replace('avia_generated_form', '', $param);
|
176 |
}
|
177 |
if ( ! empty($contact_form) ) {
|
178 |
break;
|
@@ -261,21 +261,50 @@ function ct_contact_form_validate()
|
|
261 |
echo wp_kses(
|
262 |
$echo_string,
|
263 |
array(
|
264 |
-
'a'
|
265 |
'href' => true,
|
266 |
'title' => true,
|
267 |
),
|
268 |
-
'br'
|
269 |
-
'p'
|
270 |
'div' => array(
|
271 |
-
'id'
|
272 |
'class' => true,
|
273 |
'style' => true
|
274 |
),
|
275 |
-
'h3'
|
276 |
)
|
277 |
);
|
278 |
die();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
} else {
|
280 |
ct_die(null, null);
|
281 |
}
|
76 |
//Skip system fields for divi
|
77 |
if ( strpos(Post::get('action'), 'et_pb_contactform_submit') === 0 ) {
|
78 |
foreach ( array_keys($_POST) as $key ) {
|
79 |
+
if ( strpos((string)$key, 'et_pb_contact_email_fields') === 0 ) {
|
80 |
unset($_POST[$key]);
|
81 |
}
|
82 |
}
|
98 |
apbct_is_plugin_active('calculated-fields-form/cp_calculatedfieldsf_free.php')
|
99 |
) {
|
100 |
foreach ( array_keys($_POST) as $key ) {
|
101 |
+
if ( strpos((string)$key, 'calculatedfields') !== false ) {
|
102 |
do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
|
103 |
|
104 |
return null;
|
157 |
|
158 |
// Remove visible fields from POST
|
159 |
foreach ($_POST as $key => $_value) {
|
160 |
+
if (stripos((string)$key, 'apbct_visible_fields') === 0) {
|
161 |
unset($_POST[$key]);
|
162 |
}
|
163 |
}
|
166 |
// Recognize contact form an set it's name to $contact_form to use later
|
167 |
$contact_form = null;
|
168 |
foreach ( array_keys($_POST) as $param ) {
|
169 |
+
if ( strpos((string)$param, 'et_pb_contactform_submit') === 0 ) {
|
170 |
$contact_form = 'contact_form_divi_theme';
|
171 |
+
$contact_form_additional = str_replace('et_pb_contactform_submit', '', (string)$param);
|
172 |
}
|
173 |
+
if ( strpos((string)$param, 'avia_generated_form') === 0 ) {
|
174 |
$contact_form = 'contact_form_enfold_theme';
|
175 |
+
$contact_form_additional = str_replace('avia_generated_form', '', (string)$param);
|
176 |
}
|
177 |
if ( ! empty($contact_form) ) {
|
178 |
break;
|
261 |
echo wp_kses(
|
262 |
$echo_string,
|
263 |
array(
|
264 |
+
'a' => array(
|
265 |
'href' => true,
|
266 |
'title' => true,
|
267 |
),
|
268 |
+
'br' => array(),
|
269 |
+
'p' => array(),
|
270 |
'div' => array(
|
271 |
+
'id' => true,
|
272 |
'class' => true,
|
273 |
'style' => true
|
274 |
),
|
275 |
+
'h3' => array(),
|
276 |
)
|
277 |
);
|
278 |
die();
|
279 |
+
} elseif (
|
280 |
+
(int)$apbct->settings['forms__check_internal'] === 1
|
281 |
+
&& !empty($_POST)
|
282 |
+
&& apbct_is_ajax()
|
283 |
+
&& Post::equal('sib_form_action', 'subscribe_form_submit')
|
284 |
+
&& apbct_is_plugin_active('mailin/sendinblue.php')
|
285 |
+
) {
|
286 |
+
wp_send_json(
|
287 |
+
array(
|
288 |
+
'status' => 'failure',
|
289 |
+
'msg' => array(
|
290 |
+
"errorMsg" => wp_kses(
|
291 |
+
$ct_result->comment,
|
292 |
+
array(
|
293 |
+
'a' => array(
|
294 |
+
'href' => true,
|
295 |
+
'title' => true,
|
296 |
+
),
|
297 |
+
'br' => array(),
|
298 |
+
'p' => array(),
|
299 |
+
'div' => array(
|
300 |
+
'id' => true,
|
301 |
+
),
|
302 |
+
'h1' => array(),
|
303 |
+
)
|
304 |
+
)
|
305 |
+
),
|
306 |
+
)
|
307 |
+
);
|
308 |
} else {
|
309 |
ct_die(null, null);
|
310 |
}
|
inc/cleantalk-public.php
CHANGED
@@ -253,7 +253,7 @@ function apbct_init()
|
|
253 |
$post_keys = array_keys($_POST);
|
254 |
foreach ( $post_keys as $post_key ) {
|
255 |
// Detect POST keys like /s2member_pro.*registration/
|
256 |
-
if ( strpos($post_key, 's2member') !== false && strpos($post_key, 'registration') !== false ) {
|
257 |
ct_s2member_registration_test($post_key);
|
258 |
break;
|
259 |
}
|
@@ -354,6 +354,18 @@ function apbct_init()
|
|
354 |
if ( ! empty($_POST) && apbct_custom_forms_trappings() ) {
|
355 |
add_action('init', 'ct_contact_form_validate', 999);
|
356 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
}
|
358 |
|
359 |
function apbct_buffer__start()
|
@@ -529,7 +541,7 @@ function apbct_hook__wp_footer()
|
|
529 |
$script =
|
530 |
'<script ' . $cookie_bot_asset
|
531 |
. ">
|
532 |
-
|
533 |
setTimeout(function(){
|
534 |
if( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {
|
535 |
" . $send_way_asset . "
|
@@ -582,7 +594,7 @@ function ct_add_hidden_fields(
|
|
582 |
$field_id_hash = md5((string)rand(0, 1000));
|
583 |
|
584 |
// Using only cookies
|
585 |
-
if ( $cookie_check
|
586 |
$html =
|
587 |
"<script "
|
588 |
. (class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '')
|
@@ -591,7 +603,7 @@ function ct_add_hidden_fields(
|
|
591 |
if(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);
|
592 |
else elem.attachEvent(event, callback);
|
593 |
}
|
594 |
-
apbct_attach_event_handler__backend(
|
595 |
if (typeof apbctLocalStorage === \"object\") {
|
596 |
apbctLocalStorage.set('{$field_name}', '{$ct_checkjs_key}', true );
|
597 |
} else {
|
253 |
$post_keys = array_keys($_POST);
|
254 |
foreach ( $post_keys as $post_key ) {
|
255 |
// Detect POST keys like /s2member_pro.*registration/
|
256 |
+
if ( strpos((string)$post_key, 's2member') !== false && strpos((string)$post_key, 'registration') !== false ) {
|
257 |
ct_s2member_registration_test($post_key);
|
258 |
break;
|
259 |
}
|
354 |
if ( ! empty($_POST) && apbct_custom_forms_trappings() ) {
|
355 |
add_action('init', 'ct_contact_form_validate', 999);
|
356 |
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* Internal Forms - Sendinblue Integration https://wordpress.org/plugins/mailin/
|
360 |
+
*/
|
361 |
+
if (
|
362 |
+
(int)$apbct->settings['forms__check_internal'] === 1
|
363 |
+
&& !empty($_POST)
|
364 |
+
&& Post::equal('sib_form_action', 'subscribe_form_submit')
|
365 |
+
&& apbct_is_plugin_active('mailin/sendinblue.php')
|
366 |
+
) {
|
367 |
+
ct_contact_form_validate();
|
368 |
+
}
|
369 |
}
|
370 |
|
371 |
function apbct_buffer__start()
|
541 |
$script =
|
542 |
'<script ' . $cookie_bot_asset
|
543 |
. ">
|
544 |
+
document.addEventListener('DOMContentLoaded', function () {
|
545 |
setTimeout(function(){
|
546 |
if( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {
|
547 |
" . $send_way_asset . "
|
594 |
$field_id_hash = md5((string)rand(0, 1000));
|
595 |
|
596 |
// Using only cookies
|
597 |
+
if ( $cookie_check ) {
|
598 |
$html =
|
599 |
"<script "
|
600 |
. (class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '')
|
603 |
if(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);
|
604 |
else elem.attachEvent(event, callback);
|
605 |
}
|
606 |
+
apbct_attach_event_handler__backend(document, 'DOMContentLoaded', function(){
|
607 |
if (typeof apbctLocalStorage === \"object\") {
|
608 |
apbctLocalStorage.set('{$field_name}', '{$ct_checkjs_key}', true );
|
609 |
} else {
|
js/apbct-public--3--cleantalk-modal.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,n,a){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(
|
2 |
//# sourceMappingURL=apbct-public--3--cleantalk-modal.min.js.map
|
1 |
+
let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,n,a){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},n={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},a={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},o={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},l={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},d={styles:{overflow:"hidden"},toString:e},i=document.createElement("style"),d=(i.setAttribute("id","cleantalk-modal-styles"),i.innerHTML="body.cleantalk-modal-opened{"+d+"}",i.innerHTML+="#cleantalk-modal-overlay{"+t+"}",i.innerHTML+="#cleantalk-modal-close{"+a+"}",i.innerHTML+="#cleantalk-modal-close:before{"+o+"}",i.innerHTML+="#cleantalk-modal-close:after{"+l+"}",document.body.append(i),document.createElement("div")),t=(d.setAttribute("id","cleantalk-modal-overlay"),document.body.append(d),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),a=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",n),d.append(t),document.createElement("div")),o=(a.setAttribute("id","cleantalk-modal-close"),t.append(a),document.createElement("div"));this.loaded?o.innerHTML=this.loaded:(o.innerHTML="Loading...",this.load("get_options_template")),o.setAttribute("id","cleantalk-modal-content"),t.append(o),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)});
|
2 |
//# sourceMappingURL=apbct-public--3--cleantalk-modal.min.js.map
|
js/apbct-public--3--cleantalk-modal.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-public--3--cleantalk-modal.min.js","sources":["apbct-public--3--cleantalk-modal.js"],"sourcesContent":["/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});"],"names":["let","cleantalkModal","loaded","loading","opened","opening","load","action","this","callback","result","data","params","obj","document","dispatchEvent","CustomEvent","bubbles","apbct_admin_sendAJAX","apbct_public_sendAJAX","notJson","open","renderCss","cssStr","key","styles","overlayCss","z-index","position","top","left","width","height","background","display","justify-content","align-items","toString","innerCss","padding","border","border-radius","box-shadow","closeCss","cursor","right","box-sizing","closeCssBefore","content","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","createElement","overlay","setAttribute","innerHTML","body","append","inner","classList","add","close","remove","getElementById","addEventListener","e","target","id"],"mappings":"AACAA,IAAIC,eAAiB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AS4C,KAAKG,UAAUG,OAAQ,wBAAyB,EACzDlD,SAASmD,eAAgB,yBAA0B,EAAED,OAAO,EAC5DlD,SAASmD,eAAgB,wBAAyB,EAAED,OAAO,EAC3DlD,SAASC,cACL,IAAIC,YAAa,uBAAwB,CACrCC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,CAEJ,EAGAH,SAASoD,iBAAiB,QAAQ,SAAUC,IACpCA,EAAEC,QAA0B,4BAAhBD,EAAEC,OAAOC,IAAoD,0BAAhBF,EAAEC,OAAOC,KAClEpE,eAAe8D,MAAM,CAE7B,CAAC,EACDjD,SAASoD,iBAAiB,8BAA+B,SAAUC,GAC3DlE,eAAeG,QAAUH,eAAeC,SACxCY,SAASmD,eAAgB,yBAA0B,EAAER,UAAYxD,eAAeC,OAExF,CAAC"}
|
1 |
+
{"version":3,"file":"apbct-public--3--cleantalk-modal.min.js","sources":["apbct-public--3--cleantalk-modal.js"],"sourcesContent":["/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( let key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});"],"names":["let","cleantalkModal","loaded","loading","opened","opening","load","action","this","callback","result","data","params","obj","document","dispatchEvent","CustomEvent","bubbles","apbct_admin_sendAJAX","apbct_public_sendAJAX","notJson","open","renderCss","key","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","display","justify-content","align-items","toString","innerCss","padding","border","border-radius","box-shadow","closeCss","cursor","right","box-sizing","closeCssBefore","content","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","createElement","overlay","setAttribute","innerHTML","body","append","inner","classList","add","close","remove","getElementById","addEventListener","e","target","id"],"mappings":"AACAA,IAAIC,eAAiB,CAGjBC,OAAQ,CAAA,EACRC,QAAS,CAAA,EACTC,OAAQ,CAAA,EACRC,QAAS,CAAA,EAGTC,KAAM,SAAUC,GACNC,KAAKN,SACPM,KAAKL,QAAU,CAAA,EACfM,SAAW,SAAUC,EAAQC,EAAMC,EAAQC,GACvCZ,eAAeE,QAAU,CAAA,EACzBF,eAAeC,OAASQ,EACxBI,SAASC,cACL,IAAIC,YAAa,8BAA+B,CAC5CC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,GACoC,YAAhC,OAAOC,qBACPA,qBAEAC,uBAFsB,CAAEZ,OAAWA,CAAO,EAAG,CAAEE,SAAYA,SAAUW,QAAW,CAAA,CAAK,CAAE,EAMnG,EAEAC,KAAM,WAEc,SAAZC,IACA,IACUC,EADNC,EAAS,GACb,IAAUD,KAAOf,KAAKiB,OAClBD,GAAUD,EAAM,IAAMf,KAAKiB,OAAOF,GAAO,IAE7C,OAAOC,CACX,CANA,IAOIE,EAAa,CACbD,OAAQ,CACJE,UAAW,OACXC,SAAY,QACZC,IAAO,IACPC,KAAQ,IACRC,MAAS,OACTC,OAAU,OACVC,WAAc,kBACdC,QAAW,OACXC,kBAAoB,SACpBC,cAAgB,QACpB,EACAC,SAAUf,CACd,EACIgB,EAAW,CACXb,OAAQ,CACJG,SAAa,WACbW,QAAY,OACZN,WAAe,OACfO,OAAW,6BACXC,gBAAkB,MAClBC,aAAe,qCACnB,EACAL,SAAUf,CACd,EACIqB,EAAW,CACXlB,OAAQ,CACJG,SAAa,WACbK,WAAe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AM,uBAAwB,EAClDI,EAAMD,OAAQI,CAAM,EAENjD,SAASwC,cAAe,KAAM,GACvC9C,KAAKN,OACN8C,EAAQS,UAAYjD,KAAKN,QAEzB8C,EAAQS,UAAY,aAEpBjD,KAAKF,KAAM,sBAAuB,GAEtC0C,EAAQQ,aAAc,KAAM,yBAA0B,EACtDI,EAAMD,OAAQX,CAAQ,EAEtBxC,KAAKJ,OAAS,CAAA,CAClB,EAEA2D,MAAO,WACHjD,SAAS4C,KAAKG,UAAUG,OAAQ,wBAAyB,EACzDlD,SAASmD,eAAgB,yBAA0B,EAAED,OAAO,EAC5DlD,SAASmD,eAAgB,wBAAyB,EAAED,OAAO,EAC3DlD,SAASC,cACL,IAAIC,YAAa,uBAAwB,CACrCC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,CAEJ,EAGAH,SAASoD,iBAAiB,QAAQ,SAAUC,IACpCA,EAAEC,QAA0B,4BAAhBD,EAAEC,OAAOC,IAAoD,0BAAhBF,EAAEC,OAAOC,KAClEpE,eAAe8D,MAAM,CAE7B,CAAC,EACDjD,SAASoD,iBAAiB,8BAA+B,SAAUC,GAC3DlE,eAAeG,QAAUH,eAAeC,SACxCY,SAASmD,eAAgB,yBAA0B,EAAER,UAAYxD,eAAeC,OAExF,CAAC"}
|
js/apbct-public-bundle.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,a=[],r=!0,c=!1;try{for(o=o.call(e);!(r=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);r=!0);}catch(e){c=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(c)throw i}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var o,n,i,a,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return n=!(o=!0),{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){n=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t),t.add(e)}function _classPrivateFieldInitSpec(e,t,o){_checkPrivateRedeclaration(e,t),t.set(e,o)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function _classPrivateMethodGet(e,t,o){if(t.has(e))return o;throw new TypeError("attempted to get private field on non-instance")}function _classPrivateFieldSet(e,t,o){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),o),o}function _classExtractFieldDescriptor(e,t,o){if(t.has(e))return t.get(e);throw new TypeError("attempted to "+o+" private field on non-instance")}function _classApplyDescriptorSet(e,t,o){if(t.set)t.set.call(e,o);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=o}}var _selector=new WeakMap,_eventCallback=new WeakMap,_eventSelector=new WeakMap,_event=new WeakMap,_addElement=new WeakSet,_push=new WeakSet,_reduce=new WeakSet,_deselect=new WeakSet,_onChecker=new WeakSet,_isElem=new WeakSet,_isWithoutSelector=new WeakSet,ApbctCore=function(){function t(e){_classCallCheck(this,t),_classPrivateMethodInitSpec(this,_isWithoutSelector),_classPrivateMethodInitSpec(this,_isElem),_classPrivateMethodInitSpec(this,_onChecker),_classPrivateMethodInitSpec(this,_deselect),_classPrivateMethodInitSpec(this,_reduce),_classPrivateMethodInitSpec(this,_push),_classPrivateMethodInitSpec(this,_addElement),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"rest_parameters",{}),_classPrivateFieldInitSpec(this,_selector,{writable:!0,value:null}),_defineProperty(this,"elements",[]),_classPrivateFieldInitSpec(this,_eventCallback,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_eventSelector,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_event,{writable:!0,value:void 0}),this.select(e)}return _createClass(t,[{key:"select",value:function(e){return e instanceof HTMLCollection?(_classPrivateFieldSet(this,_selector,null),this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(_classPrivateFieldSet(this,_selector,null),this.elements=[],this.elements[0]=e):"string"==typeof e?(_classPrivateFieldSet(this,_selector,e),this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):_classPrivateMethodGet(this,_deselect,_deselect2).call(this),this}},{key:"css",value:function(e,t){if(t|=!1,"object"===_typeof(e)){for(var o in e)for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),i=0;i<this.elements.length;i++)this.elements[i].style[n]=e[o];return this}var a;if("string"==typeof e)return void 0!==(a=getComputedStyle(this.elements[0])[e])&&!t&&(a=a.replace(/(\d)(em|pt|%|px){1,2}$/,"$1"),Number(a)==a)?Number(a):a}},{key:"hide",value:function(){this.prop("prev-display",this.css("display")),this.css({display:"none"})}},{key:"show",value:function(){this.css({display:this.prop("prev-display")})}},{key:"addClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.add(className)}},{key:"removeClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.remove(className)}},{key:"toggleClass",value:function(e){for(var t=0;t<this.elements.length;t++)this.elements[t].classList.toggle(e)}},{key:"ajax",value:function(e){return this.ajax_parameters=e,new ApbctAjax(e)}},{key:"rest",value:function(e){return this.rest_parameters=e,new ApbctRest(e)}},{key:"on",value:function(){_classPrivateFieldSet(this,_event,arguments.length<=0?void 0:arguments[0]),_classPrivateFieldSet(this,_eventCallback,(arguments.length<=2?void 0:arguments[2])||(arguments.length<=1?void 0:arguments[1])),_classPrivateFieldSet(this,_eventSelector,"string"==typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null);for(var e=0;e<this.elements.length;e++)this.elements[e].addEventListener(_classPrivateFieldGet(this,_event),null!==_classPrivateFieldGet(this,_eventSelector)?_classPrivateMethodGet(this,_onChecker,_onChecker2).bind(this):_classPrivateFieldGet(this,_eventCallback))}},{key:"ready",value:function(e){document.addEventListener("DOMContentLoaded",e)}},{key:"change",value:function(e){this.on("change",e)}},{key:"attr",value:function(e){for(var t=[],o=0;o<this.elements.length;o++)void 0!==_typeof(this.elements[o][e])?t.push(this.elements[o][e]):t.push(this.elements[o].getAttribute(e));return 1===t.length?t[0]:t}},{key:"prop",value:function(e,t){if(void 0!==t){for(var o=0;o<this.elements.length;o++)this.elements[o][e]=t;return this}for(var n=[],i=0;i<this.elements.length;i++)n.push(this.elements[i][e]);return 1===n.length?n[0]:n}},{key:"html",value:function(e){return void 0!==e?this.prop("innerHTML",e):this.prop("innerHTML")}},{key:"val",value:function(e){return void 0!==e?this.prop("value",e):this.prop("value")}},{key:"data",value:function(e,t){return void 0!==t?this.prop("apbct-data",e,t):this.prop("apbct-data")}},{key:"is",value:function(e){var t,o=!1,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)var i=t.value,o=o||_classPrivateMethodGet(this,_isElem,_isElem2).call(this,i,e)}catch(e){n.e(e)}finally{n.f()}return o}},{key:"filter",value:function(e){_classPrivateFieldSet(this,_selector,null);for(var t=this.elements.length-1;0<=t;t--)_classPrivateMethodGet(this,_isElem,_isElem2).call(this,this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||_classPrivateMethodGet(this,_deselect,_deselect2).call(this),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)_classPrivateMethodGet(this,_push,_push2).call(this,this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=0,t.style.display="block",+new Date);(function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))})()}()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=1,+new Date);(function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"})()}()}catch(e){t.e(e)}finally{t.f()}}}]),t}();function _addElement2(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(_classPrivateFieldSet(this,_selector,e),this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):_classPrivateMethodGet(this,_deselect,_deselect2).call(this)}function _push2(e){this.elements.push(e)}function _reduce2(){this.elements=this.elements.slice(0,-1)}function _deselect2(){this.elements=[]}function _onChecker2(e){if(e.target===document.querySelector(_classPrivateFieldGet(this,_eventSelector)))return e.stopPropagation(),_classPrivateFieldGet(this,_eventCallback).call(this,e)}function _isElem2(e,t){var o=!1;return"function"==typeof t&&(o=o||t.call(this,e)),o="string"==typeof t?t.match(/^[a-z]/)&&function(e){e=document.createElement(e).constructor;return!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))}(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==_classPrivateFieldGet(this,_selector)?null!==document.querySelector(_classPrivateFieldGet(this,_selector)+t):_classPrivateMethodGet(this,_isWithoutSelector,_isWithoutSelector2).call(this,e,t)):o}function _isWithoutSelector2(e,t){var o,n=!1,i=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(i.s();!(o=i.n()).done;)var a=o.value,n=n||e===a}catch(e){i.e(e)}finally{i.f()}return n}function apbct(e){return(new ApbctCore).select(e)}var _xhr=new WeakMap,_methods_to_convert_data_to_URL=new WeakMap,_body=new WeakMap,_http_code=new WeakMap,_status_text=new WeakMap,_prepare=new WeakSet,_complete=new WeakSet,_error=new WeakSet,ApbctXhr=function(){function o(e){for(var t in _classCallCheck(this,o),_classPrivateMethodInitSpec(this,_error),_classPrivateMethodInitSpec(this,_complete),_classPrivateMethodInitSpec(this,_prepare),_classPrivateFieldInitSpec(this,_xhr,{writable:!0,value:new XMLHttpRequest}),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_classPrivateFieldInitSpec(this,_methods_to_convert_data_to_URL,{writable:!0,value:["GET","HEAD"]}),_classPrivateFieldInitSpec(this,_body,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,_http_code,{writable:!0,value:0}),_classPrivateFieldInitSpec(this,_status_text,{writable:!0,value:""}),console.log("%cXHR%c started","color: red; font-weight: bold;","color: grey; font-weight: normal;"),e)void 0!==this[t]&&(this[t]=e[t]);if(_classPrivateMethodGet(this,_prepare,_prepare2).call(this),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;_classPrivateFieldGet(this,_xhr).open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),_classPrivateFieldGet(this,_xhr).responseType=this.responseType,_classPrivateFieldGet(this,_xhr).timeout=this.timeout,_classPrivateFieldGet(this,_xhr).onreadystatechange=function(){this.onReadyStateChange()}.bind(this),_classPrivateFieldGet(this,_xhr).onload=function(){this.onLoad()}.bind(this),_classPrivateFieldGet(this,_xhr).onprogress=function(e){this.onProgress(e)}.bind(this),_classPrivateFieldGet(this,_xhr).onerror=function(){this.onError()}.bind(this),_classPrivateFieldGet(this,_xhr).ontimeout=function(){this.onTimeout()}.bind(this),_classPrivateFieldGet(this,_xhr).send(_classPrivateFieldGet(this,_body))}return _createClass(o,[{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),_classPrivateMethodGet(this,_complete,_complete2).call(this),_classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text)),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(_classPrivateFieldGet(this,_status_text))}},{key:"onTimeout",value:function(){_classPrivateMethodGet(this,_complete,_complete2).call(this),_classPrivateMethodGet(this,_error,_error2).call(this,0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(_classPrivateMethodGet(this,_complete,_complete2).call(this),"json"===this.responseType){if(null===_classPrivateFieldGet(this,_xhr).response)return _classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text),"No response"),!1;if(void 0!==_classPrivateFieldGet(this,_xhr).response.error)return _classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text),_classPrivateFieldGet(this,_xhr).response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,_classPrivateFieldGet(this,_xhr).response,this.data)}},{key:"errorOutput",value:function(e){console.log("%c ctXHR error: %c"+e,"color: red;","color: grey;")}},{key:"setHeaders",value:function(){for(var e in this.headers)void 0!==this.headers[e]&&_classPrivateFieldGet(this,_xhr).setRequestHeader(e,this.headers[e])}},{key:"convertData",value:function(){return~_classPrivateFieldGet(this,_methods_to_convert_data_to_URL).indexOf(this.method)?this.convertDataToURL():this.convertDataToBody()}},{key:"convertDataToURL",value:function(){var e=new URLSearchParams(this.data).toString(),t=this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/)?"&":"?";return this.url+=t+e,this.url}},{key:"convertDataToBody",value:function(){for(var e in _classPrivateFieldSet(this,_body,new FormData),this.data)_classPrivateFieldGet(this,_body).append(e,"object"===_typeof(this.data[e])?JSON.stringify(this.data[e]):this.data[e]);return _classPrivateFieldGet(this,_body)}},{key:"deleteDoubleJSONEncoding",value:function(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=this.deleteDoubleJSONEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}}]),o}();function _prepare2(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}function _complete2(){_classPrivateFieldSet(this,_http_code,_classPrivateFieldGet(this,_xhr).status),_classPrivateFieldSet(this,_status_text,_classPrivateFieldGet(this,_xhr).statusText),this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}function _error2(e,t,o){var n="";"timeout"===t?n+="Server response timeout":200===e?"parsererror"===t?n+="Unexpected response from server. See console for details.":(n+="Unexpected error. Status: "+t+".",void 0!==o&&(n+=" Additional error info: "+o)):n+=500===e?"Internal server error.":"Unexpected response code:"+e,this.errorOutput(n)}var ApbctAjax=function(){_inherits(t,ApbctXhr);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.call(this,arguments.length<=0?void 0:arguments[0])}return _createClass(t)}(),ApbctRest=function(){_inherits(a,ApbctXhr);var i=_createSuper(a);function a(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return _classCallCheck(this,a),(o=o[0]).url=a.default_route+o.route,o.headers={"X-WP-Nonce":ctPublicFunctions._rest_nonce},_defineProperty(_assertThisInitialized(e=i.call(this,o)),"route",""),e}return _createClass(a)}();function ctSetCookie(e,t,o){var n;if(("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){apbctLocalStorage.set(e[0],encodeURIComponent(e[1]))}),ctNoCookieAttachHiddenFieldsToForms();else if("native"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+i});else if("alternative"===ctPublicFunctions.data__cookies_type&&!n){"function"==typeof getJavascriptClientData?e=getJavascriptClientData(e):console.log("APBCT ERROR: getJavascriptClientData() is not loaded");try{JSON.parse(e)}catch(e){return void console.log("APBCT ERROR: JSON parse error:"+e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})}}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(e,t,o){var n=[];n.callback=t.callback||null,n.onErrorCallback=t.onErrorCallback||null,n.callback_context=t.callback_context||null,n.callback_params=t.callback_params||null,n.async=t.async||!0,n.notJson=t.notJson||null,n.timeout=t.timeout||15e3,n.obj=o||null,n.button=t.button||null,n.progressbar=t.progressbar||null,n.silent=t.silent||null,n.no_nonce=t.no_nonce||null,n.data=e,n.url=ctPublicFunctions._ajax_url,"string"==typeof e?(n.no_nonce||(n.data=n.data+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce),n.data=n.data+"&no_cache="+Math.random()):(n.no_nonce||(n.data._ajax_nonce=ctPublicFunctions._ajax_nonce),n.data.no_cache=Math.random()),(new ApbctCore).ajax(n)}function apbct_public_sendREST(e,t){var o=[];o.route=e,o.callback=t.callback||null,o.onErrorCallback=t.onErrorCallback||null,o.data=t.data||[],o.method=t.method||"POST",(new ApbctCore).rest(o)}_defineProperty(ApbctRest,"default_route",ctPublicFunctions._rest_url+"cleantalk-antispam/v1/");var apbctLocalStorage={get:function(t,e){void 0===e&&(e="value");t=localStorage.getItem(t);if(null!==t)try{var o=JSON.parse(t);return o.hasOwnProperty(e)?JSON.parse(o[e]):o}catch(e){return t}return!1},set:function(e,t){var o;!(2<arguments.length&&void 0!==arguments[2])||arguments[2]?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t<localStorage.length;t++){var o=localStorage.key(t);-1===o.indexOf("ct_")&&-1===o.indexOf("apbct_")||(e[o.toString()]=apbctLocalStorage.get(o))}return e}},ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(window,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(window,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){var t;ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&((t=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),t.setAttribute("id","apbct_pixel"),t.setAttribute("style","display: none; left: 99999px;"),t.setAttribute("src",e),apbct("body").append(t))}function ctGetPixelUrl(){var e=apbctLocalStorage.get("apbct_pixel_url");if(!1!==e){if(!apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImg(e);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function ctPreloadLocalStorage(){ctPublic.data__to_local_storage&&Object.entries(ctPublic.data__to_local_storage).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];apbctLocalStorage.set(t,e)})}function apbct_ready(){ctPreloadLocalStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ct_date.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),apbct("input[type = 'email'], #email").on("blur",checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){ctNoCookieAttachHiddenFieldsToForms();for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=JSON.stringify(o),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);var i=document.querySelectorAll("[data-original-string]");if(i.length)for(var a=0;a<i.length;++a)i[a].parentElement.href||i[a].parentElement.parentElement.href||i[a].addEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler),apbctAjaxEmailDecode(e,this)}function apbctAjaxEmailDecode(n,i){var a=n.target,e={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer},t=(void 0!==i.href&&0===i.href.indexOf("mailto:")&&n.preventDefault(),a.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),a.style.cursor="progress",document.createElement("div")),o=(t.setAttribute("class","apbct-tooltip"),document.createElement("div")),r=(o.setAttribute("class","apbct-tooltip--text"),document.createElement("div")),o=(r.setAttribute("class","apbct-tooltip--arrow"),apbct(a).append(t),apbct(t).append(o),apbct(t).append(r),ctShowDecodeComment(a,ctPublicFunctions.text__wait_for_decoding),n.target.dataset.originalString);void 0!==i.href&&0===i.href.indexOf("mailto:")&&(o=i.dataset.originalString),e.encodedEmail=o,"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:e,method:"POST",callback:function(e){var t,o;e.success&&(void 0!==i.href&&0===i.href.indexOf("mailto:")?(a.style.cursor="default",a.getElementsByClassName("apbct-tooltip")[0].style.display="none",t=i.href.replace("mailto:",""),o=i.innerHTML,i.innerHTML=o.replace(t,e.data.decoded_email),i.href="mailto:"+e.data.decoded_email,i.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,n.target)},3e3)),setTimeout(function(){apbct(a.getElementsByClassName("apbct-tooltip")).fadeOut(700)},4e3)},onErrorCallback:function(e){a.addEventListener("click",ctFillDecodedEmailHandler),a.removeAttribute("style"),ctShowDecodeComment(a,"Error occurred: "+e)}}):(e.action="apbct_decode_email",apbct_public_sendAJAX(e,{notJson:!0,callback:function(e){var t,o;e.success&&(void 0!==i.href&&0===i.href.indexOf("mailto:")?(t=i.href.replace("mailto:",""),o=i.innerHTML,i.innerHTML=o.replace(t,e.data.decoded_email),i.href="mailto:"+e.data.decoded_email,i.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,n.target)},3e3)),setTimeout(function(){apbct(a.getElementsByClassName("apbct-tooltip")).fadeOut(700)},4e3)},onErrorCallback:function(e){a.addEventListener("click",ctFillDecodedEmailHandler),a.removeAttribute("style"),ctShowDecodeComment(a,"Error occurred: "+e)}}))}function getJavascriptClientData(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t={},o=(t.apbct_headless=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),t.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),t.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),t.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),t.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),t.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),t.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),t.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),t.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone"),apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved")),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),r=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");if(t.ct_mouse_moved=void 0!==o?o:a,t.ct_has_scrolled=void 0!==n?n:r,t.ct_cookies_type=void 0!==i?i:c,"object"===_typeof(e)&&e!==[])for(var l=0;l<e.length;++l)"object"===_typeof(e[l][1])?t[e[l][1][0]]=e[l][1][1]:t[e[l][0]]=e[l][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return t=removeDoubleJsonEncoding(t),JSON.stringify(t)}function removeDoubleJsonEncoding(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){apbct(e).html(apbct(e).html().replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1"))}function ctShowDecodeComment(e,t){t&&(apbct(e.getElementsByClassName("apbct-tooltip")).fadeIn(300),apbct(e.getElementsByClassName("apbct-tooltip--text")).html(t),setTimeout(function(){apbct(e.getElementsByClassName("apbct-tooltip")).fadeOut(700)},5e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",i=0,a="",r=0,c=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===c.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(c.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),i++):(a+=" "+e.getAttribute("name"),r++))}),a=a.trim(),{visible_fields:n=n.trim(),visible_fields_count:i,invisible_fields:a,invisible_fields_count:r}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else"none"===ctPublic.data__cookies_type?ctSetCookie("apbct_visible_fields",JSON.stringify(o[0])):ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),a=0;a<i.length;a++)i[a].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctParseBlockMessage(e){void 0!==e.apbct&&(e=e.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:e.comment}})),cleantalkModal.loaded=e.comment,cleantalkModal.open(),1==+e.stop_script&&window.stop())}function ctSetPixelUrlLocalstorage(e){ctSetCookie("apbct_pixel_url",e)}function ctNoCookieConstructHiddenField(){var e="",t=apbctLocalStorage.getCleanTalkData(),t=JSON.stringify(t);return t=btoa(t),(e=document.createElement("input")).setAttribute("id","ct_no_cookie_hidden_field"),e.setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",t),e.setAttribute("type","hidden"),e}function ctNoCookieGetForms(){var e=document.forms;return e||!1}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var e=ctNoCookieGetForms();if(e)for(var t=0;t<e.length;t++)if(null===document.forms[t].getAttribute("method")||"post"===document.forms[t].getAttribute("method").toLowerCase()){var o=document.getElementsByName("ct_no_cookie_hidden_field");if(o)for(var n=0;n<o.length;n++)o[n].parentNode.removeChild(o[n]);document.forms[t].append(ctNoCookieConstructHiddenField())}}}apbct_attach_event_handler(window,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(window,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(window,"scroll",ctSetHasScrolled),apbct_attach_event_handler(window,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){return void console.log(e.toString())}ctParseBlockMessage(n)}});var cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},r={styles:{overflow:"hidden"},toString:e},c=document.createElement("style"),r=(c.setAttribute("id","cleantalk-modal-styles"),c.innerHTML="body.cleantalk-modal-opened{"+r+"}",c.innerHTML+="#cleantalk-modal-overlay{"+t+"}",c.innerHTML+="#cleantalk-modal-close{"+n+"}",c.innerHTML+="#cleantalk-modal-close:before{"+i+"}",c.innerHTML+="#cleantalk-modal-close:after{"+a+"}",document.body.append(c),document.createElement("div")),t=(r.setAttribute("id","cleantalk-modal-overlay"),document.body.append(r),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),r.append(t),document.createElement("div")),i=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?i.innerHTML=this.loaded:(i.innerHTML="Loading...",this.load("get_options_template")),i.setAttribute("id","cleantalk-modal-content"),t.append(i),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},buttons_to_handle=(document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),[]),gdpr_notice_for_button="Please, apply the GDPR agreement.";function apbct_gdpr_handle_buttons(){try{buttons_to_handle!==[]&&buttons_to_handle.forEach(function(e){var t='[id="apbct_gdpr_'+e.index+'"]',t=jQuery(t);jQuery(t).prop("checked")?(e.button.disabled=!1,jQuery(e.button).prop("title",e.old_notice)):(e.button.disabled=!0,jQuery(e.button).prop("title",gdpr_notice_for_button))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not handle form buttons "+e)}}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;"string"==typeof o.action&&(isIntegratedForm(o)?apbctProcessExternalForm(o,e,document):-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((t=document.createElement("input")).name="cleantalk_hidden_action",t.value=o.action,t.type="hidden",o.appendChild(t),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location))}var n=document.getElementsByTagName("iframe");if(0<n.length)for(var i=0;i<n.length;i++)if(null!=n[i].contentDocument){var a=n[i].contentDocument.forms;if(0===a.length)return;for(var r=0;r<a.length;r++)apbctProcessExternalForm(a[r],r,n[i].contentDocument)}}function apbctProcessExternalForm(e,t,o){var n=document.createElement("i"),n=(n.className="cleantalk_placeholder",n.style="display: none",e.parentElement.insertBefore(n,e),e.previousSibling),i=e.outerHTML,a=e,e=(e.parentElement.removeChild(e),document.createElement("div")),i=(e.innerHTML=i,n.after(e.firstElementChild),document.createElement("input")),r=(i.name="action",i.value="cleantalk_force_ajax_check",i.type="hidden",o.forms[t]),c=(r.appendChild(i),r.apbctPrev=n,r.apbctFormOriginal=a,!1);void 0!==r.classList&&["newsletterform","ml-block-form"].forEach(function(e){r.classList.contains(e)&&(c=e)}),c?void 0!==(e=jQuery("form."+c).find('button[type="submit"]'))&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(e.currentTarget)}):o.forms[t].onsubmit=function(e){e.preventDefault();jQuery(e.currentTarget).prev(),jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var i=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(i.val())})})}function isIntegratedForm(e){var t=e.action,o=e.id;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_"))}function sendAjaxCheckingFormData(c,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(c),apbct_visible_fields_set_cookie(o),{}),o=c.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){var i=jQuery(c).detach(),a=c.apbctPrev,r=c.apbctFormOriginal,i=(apbct_replace_inputs_values_from_other_form(i,r),a.after(r),jQuery(r).find('input[name="apbct_visible_fields"]').remove(),jQuery(r).find('input[value="cleantalk_force_ajax_check"]').remove(),jQuery(r).find("button[type=submit]"));if(0!==i.length)return void i[0].click();if(0!==(i=jQuery(r).find("input[type=submit]")).length)return void i[0].click();if(0!==(i=jQuery(r).find('button[data-element="submit"]')).length)return void i[0].click();0!==(i=jQuery(r).find('input[type="image"][name="submit"]')).length&&i[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",apbct_public_sendAJAX(o,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.submit()}})}function ct_check_internal__is_exclude_form(t){return["wp-login.php","wp-comments-post.php"].some(function(e){return null!==t.match(new RegExp(ctPublic.blog_home+".*"+e))})}document.addEventListener("DOMContentLoaded",function(){if(buttons_to_handle=[],"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms.length&&"undefined"!=typeof jQuery)try{ctPublicGDPR.gdpr_forms.forEach(function(e,t){var o=jQuery("#"+e+", ."+e),e=(o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?o=jQuery(".wpcf7[role=form]").children("form"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(o=jQuery(".wpforms-form"))),!1),n=o.find('input[type|="submit"]');n.length&&(!1!==(e=n[0])&&(e.disabled=!0,n=jQuery(e).prop("title")?jQuery(e).prop("title"):"",buttons_to_handle.push({index:t,button:e,old_notice:n}),jQuery(e).prop("title",gdpr_notice_for_button)),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>"))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not add GDPR notice"+e)}}),window.onload=function(){+ctPublic.settings__forms__check_external&&"undefined"!=typeof jQuery&&setTimeout(function(){ct_protect_external()},1500)},document.addEventListener("DOMContentLoaded",function(){var e,t="";if(+ctPublic.settings__forms__check_internal)for(var o=0;o<document.forms.length;o++)"string"!=typeof document.forms[o].action||null===(t=(e=document.forms[o]).action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(e.click,"undefined"!=typeof jQuery&&(jQuery(e).off("**"),jQuery(e).off(),jQuery(e).on("submit",function(e){return ct_check_internal(e.target),!1})))});
|
1 |
+
"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,a=[],r=!0,c=!1;try{for(o=o.call(e);!(r=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);r=!0);}catch(e){c=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(c)throw i}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var o,n,i,a,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return n=!(o=!0),{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){n=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t),t.add(e)}function _classPrivateFieldInitSpec(e,t,o){_checkPrivateRedeclaration(e,t),t.set(e,o)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function _classPrivateMethodGet(e,t,o){if(t.has(e))return o;throw new TypeError("attempted to get private field on non-instance")}function _classPrivateFieldSet(e,t,o){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),o),o}function _classExtractFieldDescriptor(e,t,o){if(t.has(e))return t.get(e);throw new TypeError("attempted to "+o+" private field on non-instance")}function _classApplyDescriptorSet(e,t,o){if(t.set)t.set.call(e,o);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=o}}var _selector=new WeakMap,_eventCallback=new WeakMap,_eventSelector=new WeakMap,_event=new WeakMap,_addElement=new WeakSet,_push=new WeakSet,_reduce=new WeakSet,_deselect=new WeakSet,_onChecker=new WeakSet,_isElem=new WeakSet,_isWithoutSelector=new WeakSet,ApbctCore=function(){function t(e){_classCallCheck(this,t),_classPrivateMethodInitSpec(this,_isWithoutSelector),_classPrivateMethodInitSpec(this,_isElem),_classPrivateMethodInitSpec(this,_onChecker),_classPrivateMethodInitSpec(this,_deselect),_classPrivateMethodInitSpec(this,_reduce),_classPrivateMethodInitSpec(this,_push),_classPrivateMethodInitSpec(this,_addElement),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"rest_parameters",{}),_classPrivateFieldInitSpec(this,_selector,{writable:!0,value:null}),_defineProperty(this,"elements",[]),_classPrivateFieldInitSpec(this,_eventCallback,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_eventSelector,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_event,{writable:!0,value:void 0}),this.select(e)}return _createClass(t,[{key:"select",value:function(e){return e instanceof HTMLCollection?(_classPrivateFieldSet(this,_selector,null),this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(_classPrivateFieldSet(this,_selector,null),this.elements=[],this.elements[0]=e):"string"==typeof e?(_classPrivateFieldSet(this,_selector,e),this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):_classPrivateMethodGet(this,_deselect,_deselect2).call(this),this}},{key:"css",value:function(e,t){if(t|=!1,"object"===_typeof(e)){for(var o in e)for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),i=0;i<this.elements.length;i++)this.elements[i].style[n]=e[o];return this}var a;if("string"==typeof e)return void 0!==(a=getComputedStyle(this.elements[0])[e])&&!t&&(a=a.replace(/(\d)(em|pt|%|px){1,2}$/,"$1"),Number(a)==a)?Number(a):a}},{key:"hide",value:function(){this.prop("prev-display",this.css("display")),this.css({display:"none"})}},{key:"show",value:function(){this.css({display:this.prop("prev-display")})}},{key:"addClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.add(className)}},{key:"removeClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.remove(className)}},{key:"toggleClass",value:function(e){for(var t=0;t<this.elements.length;t++)this.elements[t].classList.toggle(e)}},{key:"ajax",value:function(e){return this.ajax_parameters=e,new ApbctAjax(e)}},{key:"rest",value:function(e){return this.rest_parameters=e,new ApbctRest(e)}},{key:"on",value:function(){_classPrivateFieldSet(this,_event,arguments.length<=0?void 0:arguments[0]),_classPrivateFieldSet(this,_eventCallback,(arguments.length<=2?void 0:arguments[2])||(arguments.length<=1?void 0:arguments[1])),_classPrivateFieldSet(this,_eventSelector,"string"==typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null);for(var e=0;e<this.elements.length;e++)this.elements[e].addEventListener(_classPrivateFieldGet(this,_event),null!==_classPrivateFieldGet(this,_eventSelector)?_classPrivateMethodGet(this,_onChecker,_onChecker2).bind(this):_classPrivateFieldGet(this,_eventCallback))}},{key:"ready",value:function(e){document.addEventListener("DOMContentLoaded",e)}},{key:"change",value:function(e){this.on("change",e)}},{key:"attr",value:function(e){for(var t=[],o=0;o<this.elements.length;o++)void 0!==_typeof(this.elements[o][e])?t.push(this.elements[o][e]):t.push(this.elements[o].getAttribute(e));return 1===t.length?t[0]:t}},{key:"prop",value:function(e,t){if(void 0!==t){for(var o=0;o<this.elements.length;o++)this.elements[o][e]=t;return this}for(var n=[],i=0;i<this.elements.length;i++)n.push(this.elements[i][e]);return 1===n.length?n[0]:n}},{key:"html",value:function(e){return void 0!==e?this.prop("innerHTML",e):this.prop("innerHTML")}},{key:"val",value:function(e){return void 0!==e?this.prop("value",e):this.prop("value")}},{key:"data",value:function(e,t){return void 0!==t?this.prop("apbct-data",e,t):this.prop("apbct-data")}},{key:"is",value:function(e){var t,o=!1,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)var i=t.value,o=o||_classPrivateMethodGet(this,_isElem,_isElem2).call(this,i,e)}catch(e){n.e(e)}finally{n.f()}return o}},{key:"filter",value:function(e){_classPrivateFieldSet(this,_selector,null);for(var t=this.elements.length-1;0<=t;t--)_classPrivateMethodGet(this,_isElem,_isElem2).call(this,this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||_classPrivateMethodGet(this,_deselect,_deselect2).call(this),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)_classPrivateMethodGet(this,_push,_push2).call(this,this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=0,t.style.display="block",+new Date);(function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))})()}()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=1,+new Date);(function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"})()}()}catch(e){t.e(e)}finally{t.f()}}}]),t}();function _addElement2(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(_classPrivateFieldSet(this,_selector,e),this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):_classPrivateMethodGet(this,_deselect,_deselect2).call(this)}function _push2(e){this.elements.push(e)}function _reduce2(){this.elements=this.elements.slice(0,-1)}function _deselect2(){this.elements=[]}function _onChecker2(e){if(e.target===document.querySelector(_classPrivateFieldGet(this,_eventSelector)))return e.stopPropagation(),_classPrivateFieldGet(this,_eventCallback).call(this,e)}function _isElem2(e,t){var o=!1;return"function"==typeof t&&(o=o||t.call(this,e)),o="string"==typeof t?t.match(/^[a-z]/)&&function(e){e=document.createElement(e).constructor;return!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))}(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==_classPrivateFieldGet(this,_selector)?null!==document.querySelector(_classPrivateFieldGet(this,_selector)+t):_classPrivateMethodGet(this,_isWithoutSelector,_isWithoutSelector2).call(this,e,t)):o}function _isWithoutSelector2(e,t){var o,n=!1,i=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(i.s();!(o=i.n()).done;)var a=o.value,n=n||e===a}catch(e){i.e(e)}finally{i.f()}return n}function apbct(e){return(new ApbctCore).select(e)}var _xhr=new WeakMap,_methods_to_convert_data_to_URL=new WeakMap,_body=new WeakMap,_http_code=new WeakMap,_status_text=new WeakMap,_prepare=new WeakSet,_complete=new WeakSet,_error=new WeakSet,ApbctXhr=function(){function o(e){for(var t in _classCallCheck(this,o),_classPrivateMethodInitSpec(this,_error),_classPrivateMethodInitSpec(this,_complete),_classPrivateMethodInitSpec(this,_prepare),_classPrivateFieldInitSpec(this,_xhr,{writable:!0,value:new XMLHttpRequest}),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_classPrivateFieldInitSpec(this,_methods_to_convert_data_to_URL,{writable:!0,value:["GET","HEAD"]}),_classPrivateFieldInitSpec(this,_body,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,_http_code,{writable:!0,value:0}),_classPrivateFieldInitSpec(this,_status_text,{writable:!0,value:""}),console.log("%cXHR%c started","color: red; font-weight: bold;","color: grey; font-weight: normal;"),e)void 0!==this[t]&&(this[t]=e[t]);if(_classPrivateMethodGet(this,_prepare,_prepare2).call(this),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;_classPrivateFieldGet(this,_xhr).open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),_classPrivateFieldGet(this,_xhr).responseType=this.responseType,_classPrivateFieldGet(this,_xhr).timeout=this.timeout,_classPrivateFieldGet(this,_xhr).onreadystatechange=function(){this.onReadyStateChange()}.bind(this),_classPrivateFieldGet(this,_xhr).onload=function(){this.onLoad()}.bind(this),_classPrivateFieldGet(this,_xhr).onprogress=function(e){this.onProgress(e)}.bind(this),_classPrivateFieldGet(this,_xhr).onerror=function(){this.onError()}.bind(this),_classPrivateFieldGet(this,_xhr).ontimeout=function(){this.onTimeout()}.bind(this),_classPrivateFieldGet(this,_xhr).send(_classPrivateFieldGet(this,_body))}return _createClass(o,[{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),_classPrivateMethodGet(this,_complete,_complete2).call(this),_classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text)),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(_classPrivateFieldGet(this,_status_text))}},{key:"onTimeout",value:function(){_classPrivateMethodGet(this,_complete,_complete2).call(this),_classPrivateMethodGet(this,_error,_error2).call(this,0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(_classPrivateMethodGet(this,_complete,_complete2).call(this),"json"===this.responseType){if(null===_classPrivateFieldGet(this,_xhr).response)return _classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text),"No response"),!1;if(void 0!==_classPrivateFieldGet(this,_xhr).response.error)return _classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text),_classPrivateFieldGet(this,_xhr).response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,_classPrivateFieldGet(this,_xhr).response,this.data)}},{key:"errorOutput",value:function(e){console.log("%c ctXHR error: %c"+e,"color: red;","color: grey;")}},{key:"setHeaders",value:function(){for(var e in this.headers)void 0!==this.headers[e]&&_classPrivateFieldGet(this,_xhr).setRequestHeader(e,this.headers[e])}},{key:"convertData",value:function(){return~_classPrivateFieldGet(this,_methods_to_convert_data_to_URL).indexOf(this.method)?this.convertDataToURL():this.convertDataToBody()}},{key:"convertDataToURL",value:function(){var e=new URLSearchParams(this.data).toString(),t=this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/)?"&":"?";return this.url+=t+e,this.url}},{key:"convertDataToBody",value:function(){for(var e in _classPrivateFieldSet(this,_body,new FormData),this.data)_classPrivateFieldGet(this,_body).append(e,"object"===_typeof(this.data[e])?JSON.stringify(this.data[e]):this.data[e]);return _classPrivateFieldGet(this,_body)}},{key:"deleteDoubleJSONEncoding",value:function(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=this.deleteDoubleJSONEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}}]),o}();function _prepare2(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}function _complete2(){_classPrivateFieldSet(this,_http_code,_classPrivateFieldGet(this,_xhr).status),_classPrivateFieldSet(this,_status_text,_classPrivateFieldGet(this,_xhr).statusText),this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}function _error2(e,t,o){var n="";"timeout"===t?n+="Server response timeout":200===e?"parsererror"===t?n+="Unexpected response from server. See console for details.":(n+="Unexpected error. Status: "+t+".",void 0!==o&&(n+=" Additional error info: "+o)):n+=500===e?"Internal server error.":"Unexpected response code:"+e,this.errorOutput(n)}var ApbctAjax=function(){_inherits(t,ApbctXhr);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.call(this,arguments.length<=0?void 0:arguments[0])}return _createClass(t)}(),ApbctRest=function(){_inherits(a,ApbctXhr);var i=_createSuper(a);function a(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return _classCallCheck(this,a),(o=o[0]).url=a.default_route+o.route,o.headers={"X-WP-Nonce":ctPublicFunctions._rest_nonce},_defineProperty(_assertThisInitialized(e=i.call(this,o)),"route",""),e}return _createClass(a)}();function ctSetCookie(e,t,o){var n;if(("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){apbctLocalStorage.set(e[0],encodeURIComponent(e[1]))}),ctNoCookieAttachHiddenFieldsToForms();else if("native"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+i});else if("alternative"===ctPublicFunctions.data__cookies_type&&!n){"function"==typeof getJavascriptClientData?e=getJavascriptClientData(e):console.log("APBCT ERROR: getJavascriptClientData() is not loaded");try{JSON.parse(e)}catch(e){return void console.log("APBCT ERROR: JSON parse error:"+e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})}}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(e,t,o){var n=[];n.callback=t.callback||null,n.onErrorCallback=t.onErrorCallback||null,n.callback_context=t.callback_context||null,n.callback_params=t.callback_params||null,n.async=t.async||!0,n.notJson=t.notJson||null,n.timeout=t.timeout||15e3,n.obj=o||null,n.button=t.button||null,n.progressbar=t.progressbar||null,n.silent=t.silent||null,n.no_nonce=t.no_nonce||null,n.data=e,n.url=ctPublicFunctions._ajax_url,"string"==typeof e?(n.no_nonce||(n.data=n.data+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce),n.data=n.data+"&no_cache="+Math.random()):(n.no_nonce||(n.data._ajax_nonce=ctPublicFunctions._ajax_nonce),n.data.no_cache=Math.random()),(new ApbctCore).ajax(n)}function apbct_public_sendREST(e,t){var o=[];o.route=e,o.callback=t.callback||null,o.onErrorCallback=t.onErrorCallback||null,o.data=t.data||[],o.method=t.method||"POST",(new ApbctCore).rest(o)}_defineProperty(ApbctRest,"default_route",ctPublicFunctions._rest_url+"cleantalk-antispam/v1/");var apbctLocalStorage={get:function(t,e){void 0===e&&(e="value");t=localStorage.getItem(t);if(null!==t)try{var o=JSON.parse(t);return o.hasOwnProperty(e)?JSON.parse(o[e]):o}catch(e){return t}return!1},set:function(e,t){var o;!(2<arguments.length&&void 0!==arguments[2])||arguments[2]?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t<localStorage.length;t++){var o=localStorage.key(t);-1===o.indexOf("ct_")&&-1===o.indexOf("apbct_")||(e[o.toString()]=apbctLocalStorage.get(o))}return e}},ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(document,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(document,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){var t;ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&((t=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),t.setAttribute("id","apbct_pixel"),t.setAttribute("style","display: none; left: 99999px;"),t.setAttribute("src",e),apbct("body").append(t))}function ctGetPixelUrl(){var e=apbctLocalStorage.get("apbct_pixel_url");if(!1!==e){if(!apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImg(e);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function ctPreloadLocalStorage(){ctPublic.data__to_local_storage&&Object.entries(ctPublic.data__to_local_storage).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];apbctLocalStorage.set(t,e)})}function apbct_ready(){ctPreloadLocalStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ct_date.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),apbct("input[type = 'email'], #email").on("blur",checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){ctNoCookieAttachHiddenFieldsToForms();for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=JSON.stringify(o),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);var i=document.querySelectorAll("[data-original-string]");if(i.length)for(var a=0;a<i.length;++a)i[a].parentElement.href||i[a].parentElement.parentElement.href||i[a].addEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler),apbctAjaxEmailDecode(e,this)}function apbctAjaxEmailDecode(e,t){var o=e.target,n={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer},i=(void 0!==t.href&&0===t.href.indexOf("mailto:")&&e.preventDefault(),o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress",document.createElement("div")),a=(i.setAttribute("class","apbct-tooltip"),document.createElement("div")),r=(a.setAttribute("class","apbct-tooltip--text"),document.createElement("div")),a=(r.setAttribute("class","apbct-tooltip--arrow"),apbct(o).append(i),apbct(i).append(a),apbct(i).append(r),ctShowDecodeComment(o,ctPublicFunctions.text__wait_for_decoding),e.target.dataset.originalString);void 0!==t.href&&0===t.href.indexOf("mailto:")&&(a=t.dataset.originalString),n.encodedEmail=a,"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:n,method:"POST",callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}):(n.action="apbct_decode_email",apbct_public_sendAJAX(n,{notJson:!0,callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}))}function apbctEmailEncoderCallback(e,t,o){var n,i;e.success?void 0!==t.href&&0===t.href.indexOf("mailto:")?(n=t.href.replace("mailto:",""),i=t.innerHTML,t.innerHTML=i.replace(n,e.data.decoded_email),t.href="mailto:"+e.data.decoded_email,t.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,o)},3e3):(o.removeAttribute("style"),ctShowDecodeComment(o,e.data.comment))}function getJavascriptClientData(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t={},o=(t.apbct_headless=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),t.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),t.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),t.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),t.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),t.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),t.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),t.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),t.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone"),apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved")),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),r=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");if(t.ct_mouse_moved=void 0!==o?o:a,t.ct_has_scrolled=void 0!==n?n:r,t.ct_cookies_type=void 0!==i?i:c,"object"===_typeof(e)&&e!==[])for(var l=0;l<e.length;++l)"object"===_typeof(e[l][1])?t[e[l][1][0]]=e[l][1][1]:t[e[l][0]]=e[l][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return t=removeDoubleJsonEncoding(t),JSON.stringify(t)}function removeDoubleJsonEncoding(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){apbct(e).html(apbct(e).html().replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1"))}function ctShowDecodeComment(e,t){t&&(apbct(e.getElementsByClassName("apbct-tooltip")).fadeIn(300),apbct(e.getElementsByClassName("apbct-tooltip--text")).html(t),setTimeout(function(){apbct(e.getElementsByClassName("apbct-tooltip")).fadeOut(700)},5e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",i=0,a="",r=0,c=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===c.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(c.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),i++):(a+=" "+e.getAttribute("name"),r++))}),a=a.trim(),{visible_fields:n=n.trim(),visible_fields_count:i,invisible_fields:a,invisible_fields_count:r}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else"none"===ctPublic.data__cookies_type?ctSetCookie("apbct_visible_fields",JSON.stringify(o[0])):ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),a=0;a<i.length;a++)i[a].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctParseBlockMessage(e){void 0!==e.apbct&&(e=e.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:e.comment}})),cleantalkModal.loaded=e.comment,cleantalkModal.open(),1==+e.stop_script&&window.stop())}function ctSetPixelUrlLocalstorage(e){ctSetCookie("apbct_pixel_url",e)}function ctNoCookieConstructHiddenField(){var e="",t=apbctLocalStorage.getCleanTalkData(),t=JSON.stringify(t);return t=btoa(t),(e=document.createElement("input")).setAttribute("id","ct_no_cookie_hidden_field"),e.setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",t),e.setAttribute("type","hidden"),e}function ctNoCookieGetForms(){var e=document.forms;return e||!1}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var e=ctNoCookieGetForms();if(e)for(var t=0;t<e.length;t++)if(null===document.forms[t].getAttribute("method")||"post"===document.forms[t].getAttribute("method").toLowerCase()){var o=document.getElementsByName("ct_no_cookie_hidden_field");if(o)for(var n=0;n<o.length;n++)o[n].parentNode.removeChild(o[n]);document.forms[t].append(ctNoCookieConstructHiddenField())}}}apbct_attach_event_handler(document,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(document,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(document,"scroll",ctSetHasScrolled),"loading"!==document.readyState?apbct_ready():apbct_attach_event_handler(document,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){return void console.log(e.toString())}ctParseBlockMessage(n)}});var cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},r={styles:{overflow:"hidden"},toString:e},c=document.createElement("style"),r=(c.setAttribute("id","cleantalk-modal-styles"),c.innerHTML="body.cleantalk-modal-opened{"+r+"}",c.innerHTML+="#cleantalk-modal-overlay{"+t+"}",c.innerHTML+="#cleantalk-modal-close{"+n+"}",c.innerHTML+="#cleantalk-modal-close:before{"+i+"}",c.innerHTML+="#cleantalk-modal-close:after{"+a+"}",document.body.append(c),document.createElement("div")),t=(r.setAttribute("id","cleantalk-modal-overlay"),document.body.append(r),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),r.append(t),document.createElement("div")),i=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?i.innerHTML=this.loaded:(i.innerHTML="Loading...",this.load("get_options_template")),i.setAttribute("id","cleantalk-modal-content"),t.append(i),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},buttons_to_handle=(document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),[]),gdpr_notice_for_button="Please, apply the GDPR agreement.";function apbct_gdpr_handle_buttons(){try{buttons_to_handle!==[]&&buttons_to_handle.forEach(function(e){var t='[id="apbct_gdpr_'+e.index+'"]',t=jQuery(t);jQuery(t).prop("checked")?(e.button.disabled=!1,jQuery(e.button).prop("title",e.old_notice)):(e.button.disabled=!0,jQuery(e.button).prop("title",gdpr_notice_for_button))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not handle form buttons "+e)}}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;"string"==typeof o.action&&(isIntegratedForm(o)?apbctProcessExternalForm(o,e,document):-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((t=document.createElement("input")).name="cleantalk_hidden_action",t.value=o.action,t.type="hidden",o.appendChild(t),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location))}var n=document.getElementsByTagName("iframe");if(0<n.length)for(var i=0;i<n.length;i++)if(null!=n[i].contentDocument){var a=n[i].contentDocument.forms;if(0===a.length)return;for(var r=0;r<a.length;r++)apbctProcessExternalForm(a[r],r,n[i].contentDocument)}}function apbctProcessExternalForm(e,n,i){var t=document.createElement("i"),t=(t.className="cleantalk_placeholder",t.style="display: none",e.parentElement.insertBefore(t,e),e.previousSibling),o=e.outerHTML,a=e,e=(e.parentElement.removeChild(e),document.createElement("div")),o=(e.innerHTML=o,t.after(e.firstElementChild),document.createElement("input")),r=(o.name="action",o.value="cleantalk_force_ajax_check",o.type="hidden",i.forms[n]),c=(r.appendChild(o),r.apbctPrev=t,r.apbctFormOriginal=a,!1);void 0!==r.classList&&["newsletterform","ml-block-form"].forEach(function(e){r.classList.contains(e)&&(c=e)}),c?void 0!==(e=jQuery("form."+c).find('button[type="submit"]'))&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(e.currentTarget)}):i.forms[n].onsubmit=function(e){var t,o;e.preventDefault(),-1!==i.forms[n].id.indexOf("mauticform")&&0<(t=jQuery(i.forms[n]).find('input[id*="checkbox_rgpd"]')).length&&!0===t.prop("checked")&&0<(o=jQuery(".cleantalk_placeholder")).length&&o[0].setAttribute("mautic_hidden_gdpr_id",t.prop("id")),jQuery(e.currentTarget).prev(),jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var i=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(i.val())})})}function isIntegratedForm(e){var t=e.action,o=e.id;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_"))}function sendAjaxCheckingFormData(d,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(d),apbct_visible_fields_set_cookie(o),{}),o=d.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){var i=jQuery(d).detach(),a=d.apbctPrev,r=d.apbctFormOriginal,c=!1,l=(apbct_replace_inputs_values_from_other_form(i,r),-1!==r.id.indexOf("mautic")&&(c=!0),document.getElementsByClassName("cleantalk_placeholder"));if(l)for(var s=0;s<l.length;s++){var u=l[s].getAttribute("mautic_hidden_gdpr_id");void 0===u||void 0!==(u=jQuery(r).find("#"+u))&&u.prop("checked",!0)}a.after(r),jQuery(r).find('input[name="apbct_visible_fields"]').remove(),jQuery(r).find('input[value="cleantalk_force_ajax_check"]').remove();i=jQuery(r).find("button[type=submit]");if(0!==i.length)return i[0].click(),void(c&&setTimeout(function(){ct_protect_external()},1500));if(0!==(i=jQuery(r).find("input[type=submit]")).length)return void i[0].click();if(0!==(i=jQuery(r).find('button[data-element="submit"]')).length)return void i[0].click();0!==(i=jQuery(r).find('input[type="image"][name="submit"]')).length&&i[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",apbct_public_sendAJAX(o,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.submit()}})}function ct_check_internal__is_exclude_form(t){return["wp-login.php","wp-comments-post.php"].some(function(e){return null!==t.match(new RegExp(ctPublic.blog_home+".*"+e))})}document.addEventListener("DOMContentLoaded",function(){if(buttons_to_handle=[],"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms.length&&"undefined"!=typeof jQuery)try{ctPublicGDPR.gdpr_forms.forEach(function(e,t){var o=jQuery("#"+e+", ."+e),e=(o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?o=jQuery(".wpcf7[role=form]").children("form"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(o=jQuery(".wpforms-form"))),!1),n=o.find('input[type|="submit"]');n.length&&(!1!==(e=n[0])&&(e.disabled=!0,n=jQuery(e).prop("title")?jQuery(e).prop("title"):"",buttons_to_handle.push({index:t,button:e,old_notice:n}),jQuery(e).prop("title",gdpr_notice_for_button)),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>"))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not add GDPR notice"+e)}}),window.onload=function(){+ctPublic.settings__forms__check_external&&"undefined"!=typeof jQuery&&setTimeout(function(){ct_protect_external()},1500)},document.addEventListener("DOMContentLoaded",function(){var e,t="";if(+ctPublic.settings__forms__check_internal)for(var o=0;o<document.forms.length;o++)"string"!=typeof document.forms[o].action||null===(t=(e=document.forms[o]).action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(e.click,"undefined"!=typeof jQuery&&(jQuery(e).off("**"),jQuery(e).off(),jQuery(e).on("submit",function(e){return ct_check_internal(e.target),!1})))});
|
js/apbct-public-bundle.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["class ApbctCore{\n\n ajax_parameters = {};\n rest_parameters = {};\n\n #selector = null;\n elements = [];\n\n // Event properties\n #eventCallback;\n #eventSelector;\n #event;\n\n /**\n * Default constructor\n */\n constructor(selector){\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param selector\n * @returns {*}\n */\n select(selector) {\n\n if(selector instanceof HTMLCollection){\n this.#selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n }else if( typeof selector === 'object' ){\n this.#selector = null;\n this.elements = [];\n this.elements[0] = selector;\n }else if( typeof selector === 'string' ){\n this.#selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n }else{\n this.#deselect();\n }\n\n return this;\n }\n\n #addElement(elemToAdd){\n if( typeof elemToAdd === 'object' ){\n this.elements.push(elemToAdd);\n }else if( typeof elemToAdd === 'string' ){\n this.#selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n }else{\n this.#deselect();\n }\n }\n\n #push(elem){\n this.elements.push(elem);\n }\n\n #reduce(){\n this.elements = this.elements.slice(0,-1);\n }\n\n #deselect(){\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param style\n * @param getRaw\n *\n * @returns {boolean|*}\n */\n css(style, getRaw){\n\n getRaw = getRaw | false;\n\n // Set style\n if(typeof style === \"object\"){\n\n const stringToCamelCase = str =>\n str.replace(/([-_][a-z])/g, group =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', '')\n );\n\n // Apply multiple styles\n for(let style_name in style){\n let DOM_style_name = stringToCamelCase(style_name);\n\n // Apply to multiple elements (currently selected)\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].style[DOM_style_name] = style[style_name];\n }\n }\n\n return this;\n }\n\n // Get style of first currently selected element\n if(typeof style === 'string'){\n\n let computedStyle = getComputedStyle(this.elements[0])[style];\n\n // Process\n if( typeof computedStyle !== 'undefined' && ! getRaw){\n computedStyle = computedStyle.replace(/(\\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units\n computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT\n return computedStyle;\n }\n\n // Return unprocessed\n return computedStyle;\n }\n }\n\n hide(){\n this.prop('prev-display', this.css('display'));\n this.css({'display': 'none'});\n }\n\n show(){\n this.css({'display': this.prop('prev-display')});\n }\n\n addClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.add(className);\n }\n }\n\n removeClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.remove(className);\n }\n }\n\n toggleClass(className){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.toggle(className);\n }\n }\n\n /**\n * Wrapper for apbctAJAX class\n *\n * @param ajax_parameters\n * @returns {ApbctAjax}\n */\n ajax(ajax_parameters){\n this.ajax_parameters = ajax_parameters;\n return new ApbctAjax(ajax_parameters);\n }\n\n /**\n * Wrapper for apbctREST class\n *\n * @param rest_parameters\n * @returns {ApbctRest}\n */\n rest(rest_parameters){\n this.rest_parameters = rest_parameters;\n return new ApbctRest(rest_parameters);\n }\n\n /************** EVENTS **************/\n\n /**\n *\n * Why the mess with arguments?\n *\n * Because we need to support the following function signatures:\n * on('click', function(){ alert('some'); });\n * on('click', 'inner_selector', function(){ alert('some'); });\n *\n * @param args\n */\n on(...args){\n\n this.#event = args[0];\n this.#eventCallback = args[2] || args[1];\n this.#eventSelector = typeof args[1] === \"string\" ? args[1] : null;\n\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].addEventListener(\n this.#event,\n this.#eventSelector !== null\n ? this.#onChecker.bind(this)\n : this.#eventCallback\n );\n }\n }\n\n /**\n * Check if a selector of an event matches current target\n *\n * @param event\n * @returns {*}\n */\n #onChecker(event){\n if(event.target === document.querySelector(this.#eventSelector)){\n event.stopPropagation();\n return this.#eventCallback(event);\n }\n }\n\n ready(callback){\n document.addEventListener('DOMContentLoaded', callback);\n }\n\n change(callback){\n this.on('change', callback);\n }\n\n /************** ATTRIBUTES **************/\n\n /**\n * Get an attribute or property of an element\n *\n * @param attrName\n * @returns {*|*[]}\n */\n attr(attrName){\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n\n // Use property instead of attribute if possible\n if(typeof this.elements[i][attrName] !== undefined){\n outputValue.push(this.elements[i][attrName]);\n }else{\n outputValue.push(this.elements[i].getAttribute(attrName));\n }\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n\n prop(propName, value){\n\n // Setting values\n if(typeof value !== \"undefined\"){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i][propName] = value;\n }\n\n return this;\n\n // Getting values\n }else{\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n outputValue.push(this.elements[i][propName]);\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n }\n\n /**\n * Set or get inner HTML\n *\n * @param value\n * @returns {*|*[]}\n */\n html(value){\n return typeof value !== 'undefined'\n ? this.prop('innerHTML', value)\n : this.prop('innerHTML');\n }\n\n /**\n * Set or get value of input tags\n *\n * @param value\n * @returns {*|*[]|undefined}\n */\n val(value){\n return typeof value !== 'undefined'\n ? this.prop('value', value)\n : this.prop('value');\n }\n\n data(name, value){\n return typeof value !== 'undefined'\n ? this.prop('apbct-data', name, value)\n : this.prop('apbct-data');\n }\n\n /************** END OF ATTRIBUTES **************/\n\n /************** FILTERS **************/\n\n /**\n * Check if the current elements are corresponding to filter\n *\n * @param filter\n * @returns {boolean}\n */\n is(filter){\n\n let outputValue = false;\n\n for(let elem of this.elements){\n outputValue ||= this.#isElem(elem, filter);\n }\n\n return outputValue;\n }\n\n #isElem(elemToCheck, filter){\n\n let is = false;\n let isRegisteredTagName = function(name){\n let newlyCreatedElement = document.createElement(name).constructor;\n return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );\n };\n\n // Check for filter function\n if(typeof filter === 'function') {\n is ||= filter.call(this, elemToCheck);\n }\n\n // Check for filter function\n if(typeof filter === 'string') {\n\n // Filter is tag name\n if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){\n is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();\n\n // Filter is property\n }else if( filter.match(/^[a-z]/) ){\n is ||= Boolean(elemToCheck[filter]);\n\n // Filter is CSS selector\n }else {\n is ||= this.#selector !== null\n ? document.querySelector(this.#selector + filter) !== null // If possible\n : this.#isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector\n }\n }\n\n return is;\n }\n\n #isWithoutSelector(elemToCheck, filter){\n\n let elems = document.querySelectorAll(filter);\n let outputValue = false;\n\n for(let elem of elems){\n outputValue ||= elemToCheck === elem;\n }\n\n return outputValue;\n }\n\n filter(filter){\n\n this.#selector = null;\n\n for( let i = this.elements.length - 1; i >= 0; i-- ){\n if( ! this.#isElem(this.elements[i], filter) ){\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /************** NODES **************/\n\n parent(filter){\n\n this.select(this.elements[0].parentElement);\n\n if( typeof filter !== 'undefined' && ! this.is(filter) ){\n this.#deselect();\n }\n\n return this;\n }\n\n parents(filter){\n\n this.select(this.elements[0]);\n\n for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {\n this.#push(this.elements[ this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0,1); // Deleting initial element from the set\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n children(filter){\n\n this.select(this.elements[0].children);\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n siblings(filter){\n\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /************** DOM MANIPULATIONS **************/\n remove(){\n for(let elem of this.elements){\n elem.remove();\n }\n }\n\n after(content){\n for(let elem of this.elements){\n elem.after(content);\n }\n }\n\n append(content){\n for(let elem of this.elements){\n elem.append(content);\n }\n }\n\n /** ANIMATION **/\n fadeIn(time) {\n for(let elem of this.elements){\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n fadeOut(time) {\n for(let elem of this.elements){\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * Enter point to ApbctCore class\n *\n * @param params\n * @returns {*}\n */\nfunction apbct(params){\n return new ApbctCore()\n .select(params);\n}\nclass ApbctXhr{\n\n #xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n #methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n #body = null;\n #http_code = 0;\n #status_text = '';\n\n constructor(parameters){\n\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for( let key in parameters ){\n if( typeof this[key] !== 'undefined' ){\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.#prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if( ! this.url ){\n console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')\n return false;\n }\n\n // Configure the request\n this.#xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.#xhr.responseType = this.responseType;\n this.#xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.#xhr.onreadystatechange = function(){\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.#xhr.onload = function(){\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.#xhr.onprogress = function(event){\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.#xhr.onerror = function(){\n this.onError();\n }.bind(this);\n\n this.#xhr.ontimeout = function(){\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.#xhr.send(this.#body);\n }\n\n #prepare(){\n\n // Disable button\n if(this.button){\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n #complete(){\n\n this.#http_code = this.#xhr.status;\n this.#status_text = this.#xhr.statusText;\n\n // Disable button\n if(this.button){\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n onReadyStateChange(){\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){\n this.on_ready_state_change();\n }\n }\n\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function'){\n this.on_progress();\n }\n }\n\n onError(){\n\n console.log('error');\n\n this.#complete();\n this.#error(\n this.#http_code,\n this.#status_text\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback(this.#status_text);\n }\n }\n\n onTimeout(){\n this.#complete();\n this.#error(\n 0,\n 'timeout'\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback('Timeout');\n }\n }\n\n onLoad(){\n\n this.#complete();\n\n if (this.responseType === 'json' ){\n if(this.#xhr.response === null){\n this.#error(this.#http_code, this.#status_text, 'No response');\n return false;\n }else if( typeof this.#xhr.response.error !== 'undefined') {\n this.#error(this.#http_code, this.#status_text, this.#xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.#xhr.response, this.data);\n }\n }\n\n #error(http_code, status_text, additional_msg){\n\n let error_string = '';\n\n if( status_text === 'timeout' ){\n error_string += 'Server response timeout'\n\n }else if( http_code === 200 ){\n\n if( status_text === 'parsererror' ){\n error_string += 'Unexpected response from server. See console for details.';\n }else {\n error_string += 'Unexpected error. Status: ' + status_text + '.';\n if( typeof additional_msg !== 'undefined' )\n error_string += ' Additional error info: ' + additional_msg;\n }\n\n }else if(http_code === 500){\n error_string += 'Internal server error.';\n\n }else {\n error_string += 'Unexpected response code:' + http_code;\n }\n\n this.errorOutput( error_string );\n }\n\n errorOutput(error_msg){\n console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );\n }\n\n setHeaders(){\n // Set headers if passed\n for( let header_name in this.headers ){\n if( typeof this.headers[header_name] !== 'undefined' ){\n this.#xhr.setRequestHeader(header_name, this.headers[header_name]);\n }\n }\n }\n\n convertData()\n {\n // GET, HEAD request-type\n if( ~this.#methods_to_convert_data_to_URL.indexOf( this.method ) ){\n return this.convertDataToURL();\n\n // POST request-type\n }else{\n return this.convertDataToBody()\n }\n }\n\n convertDataToURL(){\n let params_appendix = new URLSearchParams(this.data).toString();\n let params_prefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += params_prefix + params_appendix;\n\n return this.url;\n }\n\n /**\n *\n * @returns {null}\n */\n convertDataToBody()\n {\n this.#body = new FormData();\n\n for (let dataKey in this.data) {\n this.#body.append(\n dataKey,\n typeof this.data[dataKey] === 'object'\n ? JSON.stringify(this.data[dataKey])\n : this.data[dataKey]\n );\n }\n\n return this.#body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\n deleteDoubleJSONEncoding(object){\n\n if( typeof object === 'object'){\n\n for (let objectKey in object) {\n\n // Recursion\n if( typeof object[objectKey] === 'object'){\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if(\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ){\n let parsedValue = JSON.parse(object[objectKey]);\n if( typeof parsedValue === 'object' ){\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n }\n}\nclass ApbctAjax extends ApbctXhr{\n\n constructor(...args) {\n super(args[0]);\n }\n}\nclass ApbctRest extends ApbctXhr{\n\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n \"X-WP-Nonce\": ctPublicFunctions._rest_nonce\n };\n super(args);\n }\n}\n\nfunction ctSetCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n cookies.forEach( function (item, i, arr\t) {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))\n });\n ctNoCookieAttachHiddenFieldsToForms()\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){\n\n if (typeof (getJavascriptClientData) === \"function\"){\n //reprocess already gained cookies data\n cookies = getJavascriptClientData(cookies);\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded')\n }\n\n try {\n JSON.parse(cookies)\n } catch (e){\n console.log('APBCT ERROR: JSON parse error:' + e)\n return\n }\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n let _params = [];\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"callback_context\"] = params.callback_context || null;\n _params[\"callback_params\"] = params.callback_params || null;\n _params[\"async\"] = params.async || true;\n _params[\"notJson\"] = params.notJson || null;\n _params[\"timeout\"] = params.timeout || 15000;\n _params[\"obj\"] = obj || null;\n _params[\"button\"] = params.button || null;\n _params[\"progressbar\"] = params.progressbar || null;\n _params[\"silent\"] = params.silent || null;\n _params[\"no_nonce\"] = params.no_nonce || null;\n _params[\"data\"] = data;\n _params[\"url\"] = ctPublicFunctions._ajax_url;\n\n if(typeof (data) === 'string') {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"] = _params[\"data\"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"] = _params[\"data\"] + '&no_cache=' + Math.random()\n } else {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"]._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n let _params = [];\n _params[\"route\"] = route;\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"data\"] = params.data || [];\n _params[\"method\"] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\nlet apbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData : function () {\n let data = {}\n for(let i=0; i<localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){\n data[key.toString()] = apbctLocalStorage.get(key)\n }\n }\n return data\n },\n\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\n//Reading interval\nvar ctMouseReadInterval = setInterval(function(){\n\tctMouseEventTimerFlag = true;\n}, 150);\n\n//Writting interval\nvar ctMouseWriteDataInterval = setInterval(function(){\n\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n}, 1200);\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tlet insertedImg = document.createElement('img');\n\t\t\tinsertedImg.setAttribute('alt', 'CleanTalk Pixel');\n\t\t\tinsertedImg.setAttribute('id', 'apbct_pixel');\n\t\t\tinsertedImg.setAttribute('style', 'display: none; left: 99999px;');\n\t\t\tinsertedImg.setAttribute('src', pixelUrl);\n\t\t\tapbct('body').append(insertedImg);\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n\t\t\tapbctLocalStorage.delete('apbct_pixel_url')\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\nfunction ctPreloadLocalStorage(){\n\tif (ctPublic.data__to_local_storage){\n\t\tlet data = Object.entries(ctPublic.data__to_local_storage)\n\t\tdata.forEach(([key, value]) => {\n\t\t\tapbctLocalStorage.set(key,value)\n\t\t});\n\t}\n}\n\napbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\napbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"scroll\", ctSetHasScrolled);\n\n// Ready function\nfunction apbct_ready(){\n\n\tctPreloadLocalStorage()\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tapbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n\tapbctLocalStorage.set('ct_fkp_timestamp', \"0\");\n\tapbctLocalStorage.set('ct_pointer_data', \"0\");\n\tapbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );\n\tapbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n\tapbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tapbct(\"input[type = 'email'], #email\").on('blur', checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tctNoCookieAttachHiddenFieldsToForms()\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = JSON.stringify(visibleFieldsToInput);\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n\t\t}\n\t}\n}\napbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\nfunction ctFillDecodedEmailHandler(event) {\n\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\tapbctAjaxEmailDecode(event, this);\n}\n\nfunction apbctAjaxEmailDecode(event, baseElement){\n\tconst element = event.target;\n\tconst javascriptClientData = getJavascriptClientData();\n\tlet data = {\n\t\tevent_javascript_data: javascriptClientData,\n\t\tpost_url: document.location.href,\n\t\treferrer: document.referrer,\n\t};\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tevent.preventDefault();\n\t}\n\n\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\telement.style.cursor = 'progress';\n\n\t// Adding a tooltip\n\tlet apbctTooltip = document.createElement('div');\n\tapbctTooltip.setAttribute('class', 'apbct-tooltip');\n\tlet apbctTooltipText = document.createElement('div');\n\tapbctTooltipText.setAttribute('class', 'apbct-tooltip--text');\n\tlet apbctTooltipArrow = document.createElement('div');\n\tapbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');\n\tapbct(element).append(apbctTooltip);\n\tapbct(apbctTooltip).append(apbctTooltipText);\n\tapbct(apbctTooltip).append(apbctTooltipArrow);\n\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\n\tlet encodedEmail = event.target.dataset.originalString;\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tencodedEmail = baseElement.dataset.originalString;\n\t}\n\n\tdata.encodedEmail = encodedEmail;\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\telement.style.cursor = 'default';\n\t\t\t\t\t\t\telement.getElementsByClassName('apbct-tooltip')[0].style.display='none';\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t// Using AJAX request and handler\n\t}else{\n\t\tdata.action = 'apbct_decode_email';\n\t\tapbct_public_sendAJAX(\n\t\t\tdata,\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction getJavascriptClientData(common_cookies = []) {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\tif (\n\t\ttypeof (common_cookies) === \"object\"\n\t\t&& common_cookies !== []\n\t){\n\t\tfor (let i = 0; i < common_cookies.length; ++i){\n\t\t\tif ( typeof (common_cookies[i][1]) === \"object\" ){\n\t\t\t\t//this is for handle SFW cookies\n\t\t\t\tresultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]\n\t\t\t} else {\n\t\t\t\tresultDataJson[common_cookies[i][0]] = common_cookies[i][1]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.log('APBCT JS ERROR: Collecting data type mismatch')\n\t}\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tapbct(target).html(\n\t\tapbct(target)\n\t\t\t.html()\n\t\t\t.replace(/.+?(<div class=[\"']apbct-tooltip[\"'].+?<\\/div>)/, email + \"$1\")\n\t);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\n\tif( ! comment ){\n\t\treturn;\n\t}\n\n\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);\n\tapbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);\n\tsetTimeout(function(){\n\t\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t}, 5000);\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( ctPublic.data__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tif (ctPublic.data__cookies_type === 'none'){\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection[0] ) );\n\t\t} else {\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t\t}\n\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\n\t});\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\ttry {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctParseBlockMessage(response);\n\t\t}\n\t});\n}\n\nfunction ctParseBlockMessage(response) {\n\n\tif (typeof response.apbct !== 'undefined') {\n\t\tresponse = response.apbct;\n\t\tif (response.blocked) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\t// Show the result by modal\n\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\tcleantalkModal.open();\n\n\t\t\tif(+response.stop_script == 1)\n\t\t\t\twindow.stop();\n\t\t}\n\t}\n}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tctSetCookie('apbct_pixel_url', ajax_pixel_url)\n}\n\nfunction ctNoCookieConstructHiddenField(){\n\tlet field = ''\n\tlet no_cookie_data = apbctLocalStorage.getCleanTalkData()\n\tno_cookie_data = JSON.stringify(no_cookie_data)\n\tno_cookie_data = btoa(no_cookie_data)\n\tfield = document.createElement('input')\n\tfield.setAttribute('id','ct_no_cookie_hidden_field')\n\tfield.setAttribute('name','ct_no_cookie_hidden_field')\n\tfield.setAttribute('value', no_cookie_data)\n\tfield.setAttribute('type', 'hidden')\n\treturn field\n}\n\nfunction ctNoCookieGetForms(){\n\tlet forms = document.forms\n\tif (forms) {\n\t\treturn forms\n\t}\n\treturn false\n}\n\nfunction ctNoCookieAttachHiddenFieldsToForms(){\n\n\tif (ctPublic.data__cookies_type !== 'none'){\n\t\treturn\n\t}\n\n\tlet forms = ctNoCookieGetForms()\n\n\tif (forms){\n\t\tfor ( let i = 0; i < forms.length; i++ ){\n\t\t\t//ignore forms with get method @todo We need to think about this\n\t\t\tif (document.forms[i].getAttribute('method') === null ||\n\t\t\t\tdocument.forms[i].getAttribute('method').toLowerCase() === 'post'){\n\n\t\t\t\tlet elements = document.getElementsByName('ct_no_cookie_hidden_field')\n\t\t\t\t//clear previous hidden set\n\t\t\t\tif (elements){\n\t\t\t\t\tfor (let j = 0; j < elements.length; j++) {\n\t\t\t\t\t\telements[j].parentNode.removeChild(elements[j])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// add new set\n\t\t\t\tdocument.forms[i].append(ctNoCookieConstructHiddenField())\n\t\t\t}\n\t\t}\n\t}\n\n}\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\nlet buttons_to_handle = []\nlet gdpr_notice_for_button = 'Please, apply the GDPR agreement.'\n\ndocument.addEventListener('DOMContentLoaded', function(){\n\tbuttons_to_handle = []\n\tif(\n\t\ttypeof ctPublicGDPR === 'undefined' ||\n\t\t! ctPublicGDPR.gdpr_forms.length\n\t) {\n\t\treturn;\n\t}\n\n\tif ( typeof jQuery === 'undefined' ) {\n\t\treturn;\n\t}\n\ttry {\n\t\tctPublicGDPR.gdpr_forms.forEach(function(item, i){\n\n\t\t\tlet elem = jQuery('#'+item+', .'+item);\n\n\t\t\t// Filter forms\n\t\t\tif (!elem.is('form')){\n\t\t\t\t// Caldera\n\t\t\t\tif (elem.find('form')[0])\n\t\t\t\t\telem = elem.children('form').first();\n\t\t\t\t// Contact Form 7\n\t\t\t\telse if(\n\t\t\t\t\tjQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')\n\t\t\t\t\t\t.attr('id')\n\t\t\t\t\t\t.indexOf('wpcf7-f'+item) !== -1\n\t\t\t\t) {\n\t\t\t\t\telem = jQuery('.wpcf7[role=form]').children('form');\n\t\t\t\t}\n\n\t\t\t\t// Formidable\n\t\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t\t// WPForms\n\t\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\t\telem = jQuery('.wpforms-form');\n\t\t\t}\n\n\t\t\t//disable forms buttons\n\t\t\tlet button = false\n\t\t\tlet buttons_collection= elem.find('input[type|=\"submit\"]')\n\n\t\t\tif (!buttons_collection.length) {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbutton = buttons_collection[0]\n\t\t\t}\n\n\t\t\tif (button !== false){\n\t\t\t\tbutton.disabled = true\n\t\t\t\tlet old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''\n\t\t\t\tbuttons_to_handle.push({index:i,button:button,old_notice:old_notice})\n\t\t\t\tjQuery(button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\n\t\t\t// Adding notice and checkbox\n\t\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required\" style=\" margin-right: 10px;\" onchange=\"apbct_gdpr_handle_buttons()\">')\n\t\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)\n\t}\n});\n\nfunction apbct_gdpr_handle_buttons(){\n\n\ttry {\n\n\t\tif (buttons_to_handle === []){\n\t\t\treturn\n\t\t}\n\n\t\tbuttons_to_handle.forEach((button) => {\n\t\t\tlet selector = '[id=\"apbct_gdpr_' + button.index + '\"]'\n\t\t\tlet apbct_gdpr_item = jQuery(selector)\n\t\t\t//chek if apbct_gdpr checkbox is set\n\t\t\tif (jQuery(apbct_gdpr_item).prop(\"checked\")){\n\t\t\t\tbutton.button.disabled = false\n\t\t\t\tjQuery(button.button).prop('title', button.old_notice)\n\t\t\t} else {\n\t\t\t\tbutton.button.disabled = true\n\t\t\t\tjQuery(button.button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)\n\t}\n}\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){\n return\n }\n\n if(typeof(currentForm.action) == 'string') {\n\n // Ajax checking for the integrated forms\n if(isIntegratedForm(currentForm)) {\n\n apbctProcessExternalForm(currentForm, i, document);\n\n // Common flow - modify form's action\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n\n // Trying to process external form into an iframe\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) { continue; }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) { return; }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n let currentForm = iframeForms[y];\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n\n const cleantalk_placeholder = document.createElement(\"i\");\n cleantalk_placeholder.className = 'cleantalk_placeholder';\n cleantalk_placeholder.style = 'display: none';\n currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);\n\n // Deleting form to prevent submit event\n let prev = currentForm.previousSibling,\n form_html = currentForm.outerHTML,\n form_original = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement(\"div\");\n placeholder.innerHTML = form_html;\n prev.after(placeholder.firstElementChild);\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n let reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(force_action);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = form_original;\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n });\n }\n } else {\n documentObject.forms[iterator].onsubmit = function ( event ){\n event.preventDefault();\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n}\n\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n if ( typeof jQuery === 'undefined' ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n let formId = formObj.id;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n let form_new = jQuery(form).detach();\n let prev = form.apbctPrev;\n let formOriginal = form.apbctFormOriginal;\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n jQuery(formOriginal).find('input[name=\"apbct_visible_fields\"]').remove();\n jQuery(formOriginal).find('input[value=\"cleantalk_force_ajax_check\"]').remove();\n\n // Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n }\n }\n );\n}\n\nfunction ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n //AJAX Request\n apbct_public_sendAJAX(\n ct_data,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function (data) {\n if(data.success === true){\n currForm.submit();\n }else{\n alert(data.data);\n return false;\n }\n }\n }\n );\n}\n\ndocument.addEventListener('DOMContentLoaded',function(){\n let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n let ctPrevHandler;\n\tfor( let i=0; i<document.forms.length; i++ ){\n\t\tif ( typeof(document.forms[i].action) == 'string' ){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n if ( typeof jQuery !== 'undefined' ) {\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}"],"names":["ApbctCore","ajax_parameters","rest_parameters","#selector","elements","#eventCallback","#eventSelector","#event","constructor","selector","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","#deselect","#addElement","elemToAdd","push","#push","elem","#reduce","css","style","getRaw","let","style_name","DOM_style_name","replace","group","toUpperCase","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ApbctAjax","rest","ApbctRest","on","args","addEventListener","#onChecker","bind","event","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","#isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","#isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","apbct","params","ApbctXhr","#xhr","XMLHttpRequest","method","url","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","#methods_to_convert_data_to_URL","#body","#http_code","#status_text","parameters","key","console","log","#prepare","Object","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onerror","onError","ontimeout","onTimeout","send","setAttribute","cursor","#complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","#error","response","error","http_code","status_text","additional_msg","error_string","errorOutput","error_msg","header_name","setRequestHeader","convertDataToURL","convertDataToBody","params_appendix","URLSearchParams","toString","params_prefix","dataKey","FormData","JSON","stringify","object","objectKey","parsedValue","parse","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","skip_alt","data__cookies_type","forEach","item","arr","apbctLocalStorage","set","encodeURIComponent","ctNoCookieAttachHiddenFieldsToForms","ctSecure","location","protocol","cookie","cookiePrefix","getJavascriptClientData","e","data__ajax_type","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","decodeURIComponent","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","Math","random","no_cache","get","property","storageValue","localStorage","getItem","json","hasOwnProperty","is_json","objToSave","timestamp","floor","getTime","setItem","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","email","result","now","ctSetPixelImg","pixelUrl","insertedImg","ctPublic","pixel__enabled","getElementById","ctGetPixelUrl","local_storage_pixel_url","ctSetHasScrolled","ctPreloadLocalStorage","data__to_local_storage","entries","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","contains","id","apbct_collect_visible_fields","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","decodedEmailNodes","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","baseElement","element","event_javascript_data","post_url","referrer","apbctTooltip","preventDefault","text__wait_for_decoding","apbctTooltipText","apbctTooltipArrow","ctShowDecodeComment","encodedEmail","dataset","originalString","baseElementContent","success","getElementsByClassName","innerHTML","decoded_email","click","ctProcessDecodedDataResult","res","common_cookies","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","targetElement","is_allowed","ctFillDecodedEmail","show_comment","comment","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","isNaN","getAttribute","visibility","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","body","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ctParseBlockMessage","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajax_pixel_url","ctNoCookieConstructHiddenField","field","no_cookie_data","btoa","ctNoCookieGetForms","getElementsByName","j","parentNode","removeChild","jQuery","ajaxComplete","xhr","settings","responseText","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","buttons_to_handle","gdpr_notice_for_button","apbct_gdpr_handle_buttons","index","apbct_gdpr_item","disabled","old_notice","info","ct_protect_external","cleantalk_hidden_action","cleantalk_hidden_method","ct_method","currentForm","isIntegratedForm","apbctProcessExternalForm","hostname","ct_action","type","appendChild","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalk_placeholder","prev","insertBefore","previousSibling","form_html","outerHTML","form_original","placeholder","force_action","firstElementChild","reUseCurrentForm","mailerlite_detected_class","apbctPrev","apbctFormOriginal","mailerlite_class","mailerliteSubmitButton","find","sendAjaxCheckingFormData","currentTarget","clone","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","formObj","formAction","formId","firstChild","formOriginal","elems","form_new","detach","subm_button","ct_check_internal","currForm","ct_data","alert","submit","ct_check_internal__is_exclude_form","some","blog_home","ctPublicGDPR","gdpr_forms","first","buttons_collection","gdpr_text","settings__forms__check_external","ct_currForm","ct_currAction","settings__forms__check_internal","off"],"mappings":"MAAMA,UAEFC,gBAAkB,GAClBC,gBAAkB,GAElBC,UAAY,KACZC,SAAW,GAGXC,eACAC,eACAC,OAKAC,YAAYC,GACRC,KAAKC,OAAOF,CAAQ,CACxB,CAQAE,OAAOF,GAkBH,OAhBGA,a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T,WAAW,WACP6W,oBAAoB,CACxB,EAAG,IAAI,CACX,EA4IAzc,SAASyC,iBAAiB,mBAAmB,WACzC7B,IACIogB,EADAC,EAAgB,GAGpB,GAAM,CAACnQ,SAASoQ,gCAKnB,IAAKtgB,IAAIM,EAAE,EAAGA,EAAElB,SAASoS,MAAMjR,OAAQD,CAAC,GACE,UAApC,OAAOlB,SAASoS,MAAMlR,GAAS,QAIiB,QAFpD+f,GADSD,EAAchhB,SAASoS,MAAMlR,IACVsL,QAEDlI,QAAQ,WAAW,GACwB,OAAzD2c,EAAcjd,MAAM8M,SAAS2P,UAAY,SAAU,GACjDF,mCAAmCU,CAAa,IAElCD,EAAYvM,MACL,aAAlB,OAAOgF,SACRA,OAAOuH,CAAW,EAAEG,IAAI,IAAI,EAC5B1H,OAAOuH,CAAW,EAAEG,IAAI,EACxB1H,OAAOuH,CAAW,EAAEze,GAAG,SAAU,SAASK,GAEtC,OADAsd,kBAAkBtd,EAAMC,MAAM,EACvB,CAAA,CACX,CAAC,GAKrB,CAAC"}
|
1 |
+
{"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["class ApbctCore{\n\n ajax_parameters = {};\n rest_parameters = {};\n\n #selector = null;\n elements = [];\n\n // Event properties\n #eventCallback;\n #eventSelector;\n #event;\n\n /**\n * Default constructor\n */\n constructor(selector){\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param selector\n * @returns {*}\n */\n select(selector) {\n\n if(selector instanceof HTMLCollection){\n this.#selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n }else if( typeof selector === 'object' ){\n this.#selector = null;\n this.elements = [];\n this.elements[0] = selector;\n }else if( typeof selector === 'string' ){\n this.#selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n }else{\n this.#deselect();\n }\n\n return this;\n }\n\n #addElement(elemToAdd){\n if( typeof elemToAdd === 'object' ){\n this.elements.push(elemToAdd);\n }else if( typeof elemToAdd === 'string' ){\n this.#selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n }else{\n this.#deselect();\n }\n }\n\n #push(elem){\n this.elements.push(elem);\n }\n\n #reduce(){\n this.elements = this.elements.slice(0,-1);\n }\n\n #deselect(){\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param style\n * @param getRaw\n *\n * @returns {boolean|*}\n */\n css(style, getRaw){\n\n getRaw = getRaw | false;\n\n // Set style\n if(typeof style === \"object\"){\n\n const stringToCamelCase = str =>\n str.replace(/([-_][a-z])/g, group =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', '')\n );\n\n // Apply multiple styles\n for(let style_name in style){\n let DOM_style_name = stringToCamelCase(style_name);\n\n // Apply to multiple elements (currently selected)\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].style[DOM_style_name] = style[style_name];\n }\n }\n\n return this;\n }\n\n // Get style of first currently selected element\n if(typeof style === 'string'){\n\n let computedStyle = getComputedStyle(this.elements[0])[style];\n\n // Process\n if( typeof computedStyle !== 'undefined' && ! getRaw){\n computedStyle = computedStyle.replace(/(\\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units\n computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT\n return computedStyle;\n }\n\n // Return unprocessed\n return computedStyle;\n }\n }\n\n hide(){\n this.prop('prev-display', this.css('display'));\n this.css({'display': 'none'});\n }\n\n show(){\n this.css({'display': this.prop('prev-display')});\n }\n\n addClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.add(className);\n }\n }\n\n removeClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.remove(className);\n }\n }\n\n toggleClass(className){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.toggle(className);\n }\n }\n\n /**\n * Wrapper for apbctAJAX class\n *\n * @param ajax_parameters\n * @returns {ApbctAjax}\n */\n ajax(ajax_parameters){\n this.ajax_parameters = ajax_parameters;\n return new ApbctAjax(ajax_parameters);\n }\n\n /**\n * Wrapper for apbctREST class\n *\n * @param rest_parameters\n * @returns {ApbctRest}\n */\n rest(rest_parameters){\n this.rest_parameters = rest_parameters;\n return new ApbctRest(rest_parameters);\n }\n\n /************** EVENTS **************/\n\n /**\n *\n * Why the mess with arguments?\n *\n * Because we need to support the following function signatures:\n * on('click', function(){ alert('some'); });\n * on('click', 'inner_selector', function(){ alert('some'); });\n *\n * @param args\n */\n on(...args){\n\n this.#event = args[0];\n this.#eventCallback = args[2] || args[1];\n this.#eventSelector = typeof args[1] === \"string\" ? args[1] : null;\n\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].addEventListener(\n this.#event,\n this.#eventSelector !== null\n ? this.#onChecker.bind(this)\n : this.#eventCallback\n );\n }\n }\n\n /**\n * Check if a selector of an event matches current target\n *\n * @param event\n * @returns {*}\n */\n #onChecker(event){\n if(event.target === document.querySelector(this.#eventSelector)){\n event.stopPropagation();\n return this.#eventCallback(event);\n }\n }\n\n ready(callback){\n document.addEventListener('DOMContentLoaded', callback);\n }\n\n change(callback){\n this.on('change', callback);\n }\n\n /************** ATTRIBUTES **************/\n\n /**\n * Get an attribute or property of an element\n *\n * @param attrName\n * @returns {*|*[]}\n */\n attr(attrName){\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n\n // Use property instead of attribute if possible\n if(typeof this.elements[i][attrName] !== undefined){\n outputValue.push(this.elements[i][attrName]);\n }else{\n outputValue.push(this.elements[i].getAttribute(attrName));\n }\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n\n prop(propName, value){\n\n // Setting values\n if(typeof value !== \"undefined\"){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i][propName] = value;\n }\n\n return this;\n\n // Getting values\n }else{\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n outputValue.push(this.elements[i][propName]);\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n }\n\n /**\n * Set or get inner HTML\n *\n * @param value\n * @returns {*|*[]}\n */\n html(value){\n return typeof value !== 'undefined'\n ? this.prop('innerHTML', value)\n : this.prop('innerHTML');\n }\n\n /**\n * Set or get value of input tags\n *\n * @param value\n * @returns {*|*[]|undefined}\n */\n val(value){\n return typeof value !== 'undefined'\n ? this.prop('value', value)\n : this.prop('value');\n }\n\n data(name, value){\n return typeof value !== 'undefined'\n ? this.prop('apbct-data', name, value)\n : this.prop('apbct-data');\n }\n\n /************** END OF ATTRIBUTES **************/\n\n /************** FILTERS **************/\n\n /**\n * Check if the current elements are corresponding to filter\n *\n * @param filter\n * @returns {boolean}\n */\n is(filter){\n\n let outputValue = false;\n\n for(let elem of this.elements){\n outputValue ||= this.#isElem(elem, filter);\n }\n\n return outputValue;\n }\n\n #isElem(elemToCheck, filter){\n\n let is = false;\n let isRegisteredTagName = function(name){\n let newlyCreatedElement = document.createElement(name).constructor;\n return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );\n };\n\n // Check for filter function\n if(typeof filter === 'function') {\n is ||= filter.call(this, elemToCheck);\n }\n\n // Check for filter function\n if(typeof filter === 'string') {\n\n // Filter is tag name\n if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){\n is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();\n\n // Filter is property\n }else if( filter.match(/^[a-z]/) ){\n is ||= Boolean(elemToCheck[filter]);\n\n // Filter is CSS selector\n }else {\n is ||= this.#selector !== null\n ? document.querySelector(this.#selector + filter) !== null // If possible\n : this.#isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector\n }\n }\n\n return is;\n }\n\n #isWithoutSelector(elemToCheck, filter){\n\n let elems = document.querySelectorAll(filter);\n let outputValue = false;\n\n for(let elem of elems){\n outputValue ||= elemToCheck === elem;\n }\n\n return outputValue;\n }\n\n filter(filter){\n\n this.#selector = null;\n\n for( let i = this.elements.length - 1; i >= 0; i-- ){\n if( ! this.#isElem(this.elements[i], filter) ){\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /************** NODES **************/\n\n parent(filter){\n\n this.select(this.elements[0].parentElement);\n\n if( typeof filter !== 'undefined' && ! this.is(filter) ){\n this.#deselect();\n }\n\n return this;\n }\n\n parents(filter){\n\n this.select(this.elements[0]);\n\n for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {\n this.#push(this.elements[ this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0,1); // Deleting initial element from the set\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n children(filter){\n\n this.select(this.elements[0].children);\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n siblings(filter){\n\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /************** DOM MANIPULATIONS **************/\n remove(){\n for(let elem of this.elements){\n elem.remove();\n }\n }\n\n after(content){\n for(let elem of this.elements){\n elem.after(content);\n }\n }\n\n append(content){\n for(let elem of this.elements){\n elem.append(content);\n }\n }\n\n /** ANIMATION **/\n fadeIn(time) {\n for(let elem of this.elements){\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n fadeOut(time) {\n for(let elem of this.elements){\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * Enter point to ApbctCore class\n *\n * @param params\n * @returns {*}\n */\nfunction apbct(params){\n return new ApbctCore()\n .select(params);\n}\nclass ApbctXhr{\n\n #xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n #methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n #body = null;\n #http_code = 0;\n #status_text = '';\n\n constructor(parameters){\n\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for( let key in parameters ){\n if( typeof this[key] !== 'undefined' ){\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.#prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if( ! this.url ){\n console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')\n return false;\n }\n\n // Configure the request\n this.#xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.#xhr.responseType = this.responseType;\n this.#xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.#xhr.onreadystatechange = function(){\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.#xhr.onload = function(){\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.#xhr.onprogress = function(event){\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.#xhr.onerror = function(){\n this.onError();\n }.bind(this);\n\n this.#xhr.ontimeout = function(){\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.#xhr.send(this.#body);\n }\n\n #prepare(){\n\n // Disable button\n if(this.button){\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n #complete(){\n\n this.#http_code = this.#xhr.status;\n this.#status_text = this.#xhr.statusText;\n\n // Disable button\n if(this.button){\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n onReadyStateChange(){\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){\n this.on_ready_state_change();\n }\n }\n\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function'){\n this.on_progress();\n }\n }\n\n onError(){\n\n console.log('error');\n\n this.#complete();\n this.#error(\n this.#http_code,\n this.#status_text\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback(this.#status_text);\n }\n }\n\n onTimeout(){\n this.#complete();\n this.#error(\n 0,\n 'timeout'\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback('Timeout');\n }\n }\n\n onLoad(){\n\n this.#complete();\n\n if (this.responseType === 'json' ){\n if(this.#xhr.response === null){\n this.#error(this.#http_code, this.#status_text, 'No response');\n return false;\n }else if( typeof this.#xhr.response.error !== 'undefined') {\n this.#error(this.#http_code, this.#status_text, this.#xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.#xhr.response, this.data);\n }\n }\n\n #error(http_code, status_text, additional_msg){\n\n let error_string = '';\n\n if( status_text === 'timeout' ){\n error_string += 'Server response timeout'\n\n }else if( http_code === 200 ){\n\n if( status_text === 'parsererror' ){\n error_string += 'Unexpected response from server. See console for details.';\n }else {\n error_string += 'Unexpected error. Status: ' + status_text + '.';\n if( typeof additional_msg !== 'undefined' )\n error_string += ' Additional error info: ' + additional_msg;\n }\n\n }else if(http_code === 500){\n error_string += 'Internal server error.';\n\n }else {\n error_string += 'Unexpected response code:' + http_code;\n }\n\n this.errorOutput( error_string );\n }\n\n errorOutput(error_msg){\n console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );\n }\n\n setHeaders(){\n // Set headers if passed\n for( let header_name in this.headers ){\n if( typeof this.headers[header_name] !== 'undefined' ){\n this.#xhr.setRequestHeader(header_name, this.headers[header_name]);\n }\n }\n }\n\n convertData()\n {\n // GET, HEAD request-type\n if( ~this.#methods_to_convert_data_to_URL.indexOf( this.method ) ){\n return this.convertDataToURL();\n\n // POST request-type\n }else{\n return this.convertDataToBody()\n }\n }\n\n convertDataToURL(){\n let params_appendix = new URLSearchParams(this.data).toString();\n let params_prefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += params_prefix + params_appendix;\n\n return this.url;\n }\n\n /**\n *\n * @returns {null}\n */\n convertDataToBody()\n {\n this.#body = new FormData();\n\n for (let dataKey in this.data) {\n this.#body.append(\n dataKey,\n typeof this.data[dataKey] === 'object'\n ? JSON.stringify(this.data[dataKey])\n : this.data[dataKey]\n );\n }\n\n return this.#body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\n deleteDoubleJSONEncoding(object){\n\n if( typeof object === 'object'){\n\n for (let objectKey in object) {\n\n // Recursion\n if( typeof object[objectKey] === 'object'){\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if(\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ){\n let parsedValue = JSON.parse(object[objectKey]);\n if( typeof parsedValue === 'object' ){\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n }\n}\nclass ApbctAjax extends ApbctXhr{\n\n constructor(...args) {\n super(args[0]);\n }\n}\nclass ApbctRest extends ApbctXhr{\n\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n \"X-WP-Nonce\": ctPublicFunctions._rest_nonce\n };\n super(args);\n }\n}\n\nfunction ctSetCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n cookies.forEach( function (item, i, arr\t) {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))\n });\n ctNoCookieAttachHiddenFieldsToForms()\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){\n\n if (typeof (getJavascriptClientData) === \"function\"){\n //reprocess already gained cookies data\n cookies = getJavascriptClientData(cookies);\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded')\n }\n\n try {\n JSON.parse(cookies)\n } catch (e){\n console.log('APBCT ERROR: JSON parse error:' + e)\n return\n }\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n let _params = [];\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"callback_context\"] = params.callback_context || null;\n _params[\"callback_params\"] = params.callback_params || null;\n _params[\"async\"] = params.async || true;\n _params[\"notJson\"] = params.notJson || null;\n _params[\"timeout\"] = params.timeout || 15000;\n _params[\"obj\"] = obj || null;\n _params[\"button\"] = params.button || null;\n _params[\"progressbar\"] = params.progressbar || null;\n _params[\"silent\"] = params.silent || null;\n _params[\"no_nonce\"] = params.no_nonce || null;\n _params[\"data\"] = data;\n _params[\"url\"] = ctPublicFunctions._ajax_url;\n\n if(typeof (data) === 'string') {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"] = _params[\"data\"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"] = _params[\"data\"] + '&no_cache=' + Math.random()\n } else {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"]._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n let _params = [];\n _params[\"route\"] = route;\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"data\"] = params.data || [];\n _params[\"method\"] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\nlet apbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData : function () {\n let data = {}\n for(let i=0; i<localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){\n data[key.toString()] = apbctLocalStorage.get(key)\n }\n }\n return data\n },\n\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\n//Reading interval\nvar ctMouseReadInterval = setInterval(function(){\n\tctMouseEventTimerFlag = true;\n}, 150);\n\n//Writting interval\nvar ctMouseWriteDataInterval = setInterval(function(){\n\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n}, 1200);\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tlet insertedImg = document.createElement('img');\n\t\t\tinsertedImg.setAttribute('alt', 'CleanTalk Pixel');\n\t\t\tinsertedImg.setAttribute('id', 'apbct_pixel');\n\t\t\tinsertedImg.setAttribute('style', 'display: none; left: 99999px;');\n\t\t\tinsertedImg.setAttribute('src', pixelUrl);\n\t\t\tapbct('body').append(insertedImg);\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n\t\t\tapbctLocalStorage.delete('apbct_pixel_url')\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\nfunction ctPreloadLocalStorage(){\n\tif (ctPublic.data__to_local_storage){\n\t\tlet data = Object.entries(ctPublic.data__to_local_storage)\n\t\tdata.forEach(([key, value]) => {\n\t\t\tapbctLocalStorage.set(key,value)\n\t\t});\n\t}\n}\n\napbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\napbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"scroll\", ctSetHasScrolled);\n\n// Ready function\nfunction apbct_ready(){\n\n\tctPreloadLocalStorage()\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tapbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n\tapbctLocalStorage.set('ct_fkp_timestamp', \"0\");\n\tapbctLocalStorage.set('ct_pointer_data', \"0\");\n\tapbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );\n\tapbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n\tapbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tapbct(\"input[type = 'email'], #email\").on('blur', checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tctNoCookieAttachHiddenFieldsToForms()\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = JSON.stringify(visibleFieldsToInput);\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n\t\t}\n\t}\n}\napbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\nfunction ctFillDecodedEmailHandler(event) {\n\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\tapbctAjaxEmailDecode(event, this);\n}\n\nfunction apbctAjaxEmailDecode(event, baseElement){\n\tconst element = event.target;\n\tconst javascriptClientData = getJavascriptClientData();\n\tlet data = {\n\t\tevent_javascript_data: javascriptClientData,\n\t\tpost_url: document.location.href,\n\t\treferrer: document.referrer,\n\t};\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tevent.preventDefault();\n\t}\n\n\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\telement.style.cursor = 'progress';\n\n\t// Adding a tooltip\n\tlet apbctTooltip = document.createElement('div');\n\tapbctTooltip.setAttribute('class', 'apbct-tooltip');\n\tlet apbctTooltipText = document.createElement('div');\n\tapbctTooltipText.setAttribute('class', 'apbct-tooltip--text');\n\tlet apbctTooltipArrow = document.createElement('div');\n\tapbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');\n\tapbct(element).append(apbctTooltip);\n\tapbct(apbctTooltip).append(apbctTooltipText);\n\tapbct(apbctTooltip).append(apbctTooltipArrow);\n\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\n\tlet encodedEmail = event.target.dataset.originalString;\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tencodedEmail = baseElement.dataset.originalString;\n\t}\n\n\tdata.encodedEmail = encodedEmail;\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\telement.style.cursor = 'default';\n\t\t\t\t\t\t\telement.getElementsByClassName('apbct-tooltip')[0].style.display='none';\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t// Using AJAX request and handler\n\t}else{\n\t\tdata.action = 'apbct_decode_email';\n\t\tapbct_public_sendAJAX(\n\t\t\tdata,\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction getJavascriptClientData(common_cookies = []) {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\tif (\n\t\ttypeof (common_cookies) === \"object\"\n\t\t&& common_cookies !== []\n\t){\n\t\tfor (let i = 0; i < common_cookies.length; ++i){\n\t\t\tif ( typeof (common_cookies[i][1]) === \"object\" ){\n\t\t\t\t//this is for handle SFW cookies\n\t\t\t\tresultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]\n\t\t\t} else {\n\t\t\t\tresultDataJson[common_cookies[i][0]] = common_cookies[i][1]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.log('APBCT JS ERROR: Collecting data type mismatch')\n\t}\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tapbct(target).html(\n\t\tapbct(target)\n\t\t\t.html()\n\t\t\t.replace(/.+?(<div class=[\"']apbct-tooltip[\"'].+?<\\/div>)/, email + \"$1\")\n\t);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\n\tif( ! comment ){\n\t\treturn;\n\t}\n\n\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);\n\tapbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);\n\tsetTimeout(function(){\n\t\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t}, 5000);\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( ctPublic.data__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tif (ctPublic.data__cookies_type === 'none'){\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection[0] ) );\n\t\t} else {\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t\t}\n\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\n\t});\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\ttry {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctParseBlockMessage(response);\n\t\t}\n\t});\n}\n\nfunction ctParseBlockMessage(response) {\n\n\tif (typeof response.apbct !== 'undefined') {\n\t\tresponse = response.apbct;\n\t\tif (response.blocked) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\t// Show the result by modal\n\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\tcleantalkModal.open();\n\n\t\t\tif(+response.stop_script == 1)\n\t\t\t\twindow.stop();\n\t\t}\n\t}\n}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tctSetCookie('apbct_pixel_url', ajax_pixel_url)\n}\n\nfunction ctNoCookieConstructHiddenField(){\n\tlet field = ''\n\tlet no_cookie_data = apbctLocalStorage.getCleanTalkData()\n\tno_cookie_data = JSON.stringify(no_cookie_data)\n\tno_cookie_data = btoa(no_cookie_data)\n\tfield = document.createElement('input')\n\tfield.setAttribute('id','ct_no_cookie_hidden_field')\n\tfield.setAttribute('name','ct_no_cookie_hidden_field')\n\tfield.setAttribute('value', no_cookie_data)\n\tfield.setAttribute('type', 'hidden')\n\treturn field\n}\n\nfunction ctNoCookieGetForms(){\n\tlet forms = document.forms\n\tif (forms) {\n\t\treturn forms\n\t}\n\treturn false\n}\n\nfunction ctNoCookieAttachHiddenFieldsToForms(){\n\n\tif (ctPublic.data__cookies_type !== 'none'){\n\t\treturn\n\t}\n\n\tlet forms = ctNoCookieGetForms()\n\n\tif (forms){\n\t\tfor ( let i = 0; i < forms.length; i++ ){\n\t\t\t//ignore forms with get method @todo We need to think about this\n\t\t\tif (document.forms[i].getAttribute('method') === null ||\n\t\t\t\tdocument.forms[i].getAttribute('method').toLowerCase() === 'post'){\n\n\t\t\t\tlet elements = document.getElementsByName('ct_no_cookie_hidden_field')\n\t\t\t\t//clear previous hidden set\n\t\t\t\tif (elements){\n\t\t\t\t\tfor (let j = 0; j < elements.length; j++) {\n\t\t\t\t\t\telements[j].parentNode.removeChild(elements[j])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// add new set\n\t\t\t\tdocument.forms[i].append(ctNoCookieConstructHiddenField())\n\t\t\t}\n\t\t}\n\t}\n\n}\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( let key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\nlet buttons_to_handle = []\nlet gdpr_notice_for_button = 'Please, apply the GDPR agreement.'\n\ndocument.addEventListener('DOMContentLoaded', function(){\n\tbuttons_to_handle = []\n\tif(\n\t\ttypeof ctPublicGDPR === 'undefined' ||\n\t\t! ctPublicGDPR.gdpr_forms.length\n\t) {\n\t\treturn;\n\t}\n\n\tif ( typeof jQuery === 'undefined' ) {\n\t\treturn;\n\t}\n\ttry {\n\t\tctPublicGDPR.gdpr_forms.forEach(function(item, i){\n\n\t\t\tlet elem = jQuery('#'+item+', .'+item);\n\n\t\t\t// Filter forms\n\t\t\tif (!elem.is('form')){\n\t\t\t\t// Caldera\n\t\t\t\tif (elem.find('form')[0])\n\t\t\t\t\telem = elem.children('form').first();\n\t\t\t\t// Contact Form 7\n\t\t\t\telse if(\n\t\t\t\t\tjQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')\n\t\t\t\t\t\t.attr('id')\n\t\t\t\t\t\t.indexOf('wpcf7-f'+item) !== -1\n\t\t\t\t) {\n\t\t\t\t\telem = jQuery('.wpcf7[role=form]').children('form');\n\t\t\t\t}\n\n\t\t\t\t// Formidable\n\t\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t\t// WPForms\n\t\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\t\telem = jQuery('.wpforms-form');\n\t\t\t}\n\n\t\t\t//disable forms buttons\n\t\t\tlet button = false\n\t\t\tlet buttons_collection= elem.find('input[type|=\"submit\"]')\n\n\t\t\tif (!buttons_collection.length) {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbutton = buttons_collection[0]\n\t\t\t}\n\n\t\t\tif (button !== false){\n\t\t\t\tbutton.disabled = true\n\t\t\t\tlet old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''\n\t\t\t\tbuttons_to_handle.push({index:i,button:button,old_notice:old_notice})\n\t\t\t\tjQuery(button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\n\t\t\t// Adding notice and checkbox\n\t\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required\" style=\" margin-right: 10px;\" onchange=\"apbct_gdpr_handle_buttons()\">')\n\t\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)\n\t}\n});\n\nfunction apbct_gdpr_handle_buttons(){\n\n\ttry {\n\n\t\tif (buttons_to_handle === []){\n\t\t\treturn\n\t\t}\n\n\t\tbuttons_to_handle.forEach((button) => {\n\t\t\tlet selector = '[id=\"apbct_gdpr_' + button.index + '\"]'\n\t\t\tlet apbct_gdpr_item = jQuery(selector)\n\t\t\t//chek if apbct_gdpr checkbox is set\n\t\t\tif (jQuery(apbct_gdpr_item).prop(\"checked\")){\n\t\t\t\tbutton.button.disabled = false\n\t\t\t\tjQuery(button.button).prop('title', button.old_notice)\n\t\t\t} else {\n\t\t\t\tbutton.button.disabled = true\n\t\t\t\tjQuery(button.button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)\n\t}\n}\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){\n return\n }\n\n if(typeof(currentForm.action) == 'string') {\n\n // Ajax checking for the integrated forms\n if(isIntegratedForm(currentForm)) {\n\n apbctProcessExternalForm(currentForm, i, document);\n\n // Common flow - modify form's action\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n\n // Trying to process external form into an iframe\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) { continue; }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) { return; }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n let currentForm = iframeForms[y];\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n\n const cleantalk_placeholder = document.createElement(\"i\");\n cleantalk_placeholder.className = 'cleantalk_placeholder';\n cleantalk_placeholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);\n\n // Deleting form to prevent submit event\n let prev = currentForm.previousSibling,\n form_html = currentForm.outerHTML,\n form_original = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement(\"div\");\n placeholder.innerHTML = form_html;\n prev.after(placeholder.firstElementChild);\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n let reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(force_action);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = form_original;\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n });\n }\n } else {\n documentObject.forms[iterator].onsubmit = function ( event ){\n event.preventDefault();\n\n //mautic integration\n if (documentObject.forms[iterator].id.indexOf('mauticform') !== -1) {\n let checkbox = jQuery(documentObject.forms[iterator]).find('input[id*=\"checkbox_rgpd\"]')\n if (checkbox.length > 0){\n if (checkbox.prop(\"checked\") === true){\n let placeholder = jQuery('.cleantalk_placeholder')\n if (placeholder.length > 0) {\n placeholder[0].setAttribute('mautic_hidden_gdpr_id', checkbox.prop(\"id\"))\n }\n }\n }\n }\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n}\n\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n if ( typeof jQuery === 'undefined' ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n let formId = formObj.id;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n let form_new = jQuery(form).detach();\n let prev = form.apbctPrev;\n let formOriginal = form.apbctFormOriginal;\n let mautic_integration = false;\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n //mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mautic_integration = true\n }\n let placeholders = document.getElementsByClassName('cleantalk_placeholder')\n if (placeholders) {\n for (let i = 0; i < placeholders.length; i++) {\n let mautic_hidden_gdpr_id = placeholders[i].getAttribute(\"mautic_hidden_gdpr_id\")\n if (typeof(mautic_hidden_gdpr_id) !== 'undefined') {\n let mautic_gdpr_radio = jQuery(formOriginal).find('#' + mautic_hidden_gdpr_id)\n if (typeof(mautic_gdpr_radio) !== 'undefined') {\n mautic_gdpr_radio.prop(\"checked\", true);\n }\n }\n }\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n jQuery(formOriginal).find('input[name=\"apbct_visible_fields\"]').remove();\n jQuery(formOriginal).find('input[value=\"cleantalk_force_ajax_check\"]').remove();\n\n\n //Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n if (mautic_integration) {\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n }\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n }\n }\n );\n}\n\nfunction ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n //AJAX Request\n apbct_public_sendAJAX(\n ct_data,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function (data) {\n if(data.success === true){\n currForm.submit();\n }else{\n alert(data.data);\n return false;\n }\n }\n }\n );\n}\n\ndocument.addEventListener('DOMContentLoaded',function(){\n let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n let ctPrevHandler;\n\tfor( let i=0; i<document.forms.length; i++ ){\n\t\tif ( typeof(document.forms[i].action) == 'string' ){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n if ( typeof jQuery !== 'undefined' ) {\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}"],"names":["ApbctCore","ajax_parameters","rest_parameters","#selector","elements","#eventCallback","#eventSelector","#event","constructor","selector","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","#deselect","#addElement","elemToAdd","push","#push","elem","#reduce","css","style","getRaw","let","style_name","DOM_style_name","replace","group","toUpperCase","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ApbctAjax","rest","ApbctRest","on","args","addEventListener","#onChecker","bind","event","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","#isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","#isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","apbct","params","ApbctXhr","#xhr","XMLHttpRequest","method","url","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","#methods_to_convert_data_to_URL","#body","#http_code","#status_text","parameters","key","console","log","#prepare","Object","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onerror","onError","ontimeout","onTimeout","send","setAttribute","cursor","#complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","#error","response","error","http_code","status_text","additional_msg","error_string","errorOutput","error_msg","header_name","setRequestHeader","convertDataToURL","convertDataToBody","params_appendix","URLSearchParams","toString","params_prefix","dataKey","FormData","JSON","stringify","object","objectKey","parsedValue","parse","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","skip_alt","data__cookies_type","forEach","item","arr","apbctLocalStorage","set","encodeURIComponent","ctNoCookieAttachHiddenFieldsToForms","ctSecure","location","protocol","cookie","cookiePrefix","getJavascriptClientData","e","data__ajax_type","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","decodeURIComponent","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","Math","random","no_cache","get","property","storageValue","localStorage","getItem","json","hasOwnProperty","is_json","objToSave","timestamp","floor","getTime","setItem","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","email","result","now","ctSetPixelImg","pixelUrl","insertedImg","ctPublic","pixel__enabled","getElementById","ctGetPixelUrl","local_storage_pixel_url","ctSetHasScrolled","ctPreloadLocalStorage","data__to_local_storage","entries","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","contains","id","apbct_collect_visible_fields","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","decodedEmailNodes","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","baseElement","element","event_javascript_data","post_url","referrer","apbctTooltip","preventDefault","text__wait_for_decoding","apbctTooltipText","apbctTooltipArrow","ctShowDecodeComment","encodedEmail","dataset","originalString","baseElementContent","success","getElementsByClassName","innerHTML","decoded_email","click","ctProcessDecodedDataResult","res","common_cookies","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","targetElement","is_allowed","ctFillDecodedEmail","show_comment","comment","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","isNaN","getAttribute","visibility","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","body","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ctParseBlockMessage","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajax_pixel_url","ctNoCookieConstructHiddenField","field","no_cookie_data","btoa","ctNoCookieGetForms","getElementsByName","j","parentNode","removeChild","jQuery","ajaxComplete","xhr","settings","responseText","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","buttons_to_handle","gdpr_notice_for_button","apbct_gdpr_handle_buttons","index","apbct_gdpr_item","disabled","old_notice","info","ct_protect_external","cleantalk_hidden_action","cleantalk_hidden_method","ct_method","currentForm","isIntegratedForm","apbctProcessExternalForm","hostname","ct_action","type","appendChild","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalk_placeholder","prev","insertBefore","previousSibling","form_html","outerHTML","form_original","placeholder","force_action","firstElementChild","reUseCurrentForm","mailerlite_detected_class","apbctPrev","apbctFormOriginal","mailerlite_class","mailerliteSubmitButton","find","sendAjaxCheckingFormData","currentTarget","checkbox","clone","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","formObj","formAction","formId","firstChild","formOriginal","elems","form_new","detach","mautic_integration","placeholders","mautic_hidden_gdpr_id","mautic_gdpr_radio","subm_button","ct_check_internal","currForm","ct_data","alert","submit","ct_check_internal__is_exclude_form","some","blog_home","ctPublicGDPR","gdpr_forms","first","buttons_collection","gdpr_text","settings__forms__check_external","ct_currForm","ct_currAction","settings__forms__check_internal","off"],"mappings":"MAAMA,UAEFC,gBAAkB,GAClBC,gBAAkB,GAElBC,UAAY,KACZC,SAAW,GAGXC,eACAC,eACAC,OAKAC,YAAYC,GACRC,KAAKC,OAAOF,CAAQ,CACxB,CAQAE,OAAOF,GAkBH,OAhBGA,aAAoBG,gBACnBF,KAAKP,UAAe,KACpBO,KAAKN,SAAc,GACnBM,KAAKN,SAAWS,MAAMC,UAAUC,MAAMC,KAAKP,CAAQ,GACzB,UAApB,OAAOA,GACbC,KAAKP,UAAe,KACpBO,KAAKN,SAAc,GACnBM,KAAKN,S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GAAG,SAAU,SAASK,GAEtC,OADA2d,kBAAkB3d,EAAMC,MAAM,EACvB,CAAA,CACX,CAAC,GAKrB,CAAC"}
|
lib/Cleantalk/Antispam/EmailEncoder.php
CHANGED
@@ -60,7 +60,8 @@ class EmailEncoder
|
|
60 |
//list of encoding exclusions signs
|
61 |
$this->encoding_exclusions_signs = array(
|
62 |
//divi contact forms additional emails
|
63 |
-
array('_unique_id', 'et_pb_contact_form')
|
|
|
64 |
);
|
65 |
|
66 |
$this->secret_key = md5($apbct->api_key);
|
@@ -133,18 +134,13 @@ class EmailEncoder
|
|
133 |
check_ajax_referer('ct_secret_stuff');
|
134 |
}
|
135 |
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
$this->decoded_email = $this->decodeEmailFromPost();
|
144 |
-
$allow_request = $this->checkRequest();
|
145 |
-
$this->response = $this->compileResponse($this->decoded_email, $allow_request);
|
146 |
-
|
147 |
-
return $this->response;
|
148 |
}
|
149 |
|
150 |
/**
|
60 |
//list of encoding exclusions signs
|
61 |
$this->encoding_exclusions_signs = array(
|
62 |
//divi contact forms additional emails
|
63 |
+
array('_unique_id', 'et_pb_contact_form'),
|
64 |
+
array('placeholder') //keep safe placeholders to prevent field breach
|
65 |
);
|
66 |
|
67 |
$this->secret_key = md5($apbct->api_key);
|
134 |
check_ajax_referer('ct_secret_stuff');
|
135 |
}
|
136 |
|
137 |
+
if ( $this->checkRequest() ) {
|
138 |
+
$this->decoded_email = $this->decodeEmailFromPost();
|
139 |
+
$this->response = $this->compileResponse($this->decoded_email, true);
|
140 |
+
wp_send_json_success($this->response);
|
141 |
+
}
|
142 |
+
$this->response = $this->compileResponse('', false);
|
143 |
+
wp_send_json_error($this->response);
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
|
146 |
/**
|
lib/Cleantalk/ApbctWP/Activator.php
CHANGED
@@ -47,7 +47,7 @@ class Activator
|
|
47 |
} else {
|
48 |
// Do actions for the new blog created
|
49 |
if ( apbct_is_plugin_active_for_network('cleantalk-spam-protect/cleantalk.php') ) {
|
50 |
-
$settings =
|
51 |
if ( !empty($apbct->allow_custom_key) ) {
|
52 |
unset($settings['apikey']);
|
53 |
}
|
47 |
} else {
|
48 |
// Do actions for the new blog created
|
49 |
if ( apbct_is_plugin_active_for_network('cleantalk-spam-protect/cleantalk.php') ) {
|
50 |
+
$settings = get_blog_option(get_main_site_id(), 'cleantalk_settings');
|
51 |
if ( !empty($apbct->allow_custom_key) ) {
|
52 |
unset($settings['apikey']);
|
53 |
}
|
lib/Cleantalk/ApbctWP/Antispam/EmailEncoder.php
CHANGED
@@ -68,14 +68,13 @@ class EmailEncoder extends \Cleantalk\Antispam\EmailEncoder
|
|
68 |
return true;
|
69 |
}
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
76 |
-
}
|
77 |
|
78 |
-
return
|
79 |
}
|
80 |
|
81 |
/**
|
@@ -90,7 +89,7 @@ class EmailEncoder extends \Cleantalk\Antispam\EmailEncoder
|
|
90 |
{
|
91 |
return [
|
92 |
'is_allowed' => $is_allowed,
|
93 |
-
'show_comment' => $is_allowed,
|
94 |
'comment' => $this->comment,
|
95 |
'decoded_email' => strip_tags($decoded_email, '<a>'),
|
96 |
];
|
68 |
return true;
|
69 |
}
|
70 |
|
71 |
+
$stub_comment = $api_response->allow
|
72 |
+
? esc_html__('Allowed', 'cleantalk-spam-protect')
|
73 |
+
: esc_html__('Blocked', 'cleantalk-spam-protect');
|
74 |
|
75 |
+
$this->comment = ! empty($api_response->comment) ? $api_response->comment : $stub_comment;
|
|
|
76 |
|
77 |
+
return $api_response->allow === 1;
|
78 |
}
|
79 |
|
80 |
/**
|
89 |
{
|
90 |
return [
|
91 |
'is_allowed' => $is_allowed,
|
92 |
+
'show_comment' => ! $is_allowed,
|
93 |
'comment' => $this->comment,
|
94 |
'decoded_email' => strip_tags($decoded_email, '<a>'),
|
95 |
];
|
lib/Cleantalk/ApbctWP/CleantalkUpgraderSkin.php
CHANGED
@@ -26,8 +26,9 @@ class CleantalkUpgraderSkin extends \WP_Upgrader_Skin
|
|
26 |
}
|
27 |
|
28 |
/**
|
29 |
-
*
|
30 |
* @param string $feedback
|
|
|
|
|
31 |
*/
|
32 |
public function feedback($feedback, ...$args)
|
33 |
{
|
26 |
}
|
27 |
|
28 |
/**
|
|
|
29 |
* @param string $feedback
|
30 |
+
* @param mixed ...$args Optional text replacements.
|
31 |
+
* @psalm-suppress ParamNameMismatch
|
32 |
*/
|
33 |
public function feedback($feedback, ...$args)
|
34 |
{
|
lib/Cleantalk/ApbctWP/CleantalkUpgraderSkinDeprecated.php
CHANGED
@@ -31,6 +31,7 @@ class CleantalkUpgraderSkinDeprecated extends \WP_Upgrader_Skin
|
|
31 |
* @param string $feedback
|
32 |
*
|
33 |
* @psalm-suppress MethodSignatureMismatch
|
|
|
34 |
*/
|
35 |
public function feedback($feedback)
|
36 |
{
|
31 |
* @param string $feedback
|
32 |
*
|
33 |
* @psalm-suppress MethodSignatureMismatch
|
34 |
+
* @psalm-suppress ParamNameMismatch
|
35 |
*/
|
36 |
public function feedback($feedback)
|
37 |
{
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Spam protection, AntiSpam, FireWall by CleanTalk ===
|
2 |
Contributors: glomberg, artemacleantalk, alexandergull
|
3 |
Tags: spam, antispam, anti-spam, comments, firewall
|
4 |
-
Requires at least:
|
5 |
-
Tested up to: 6.
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 5.
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
@@ -451,6 +451,25 @@ Yes, it is. Please read this article,
|
|
451 |
|
452 |
== Changelog ==
|
453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
= 5.186 Oct 06 2022 =
|
455 |
#### Several integrations added 🔥, custom logo for SFW blocking pages added 🎯, external forms into iframe protected 🎉 and some minor issues fixed 💪🏼
|
456 |
* New. MemberPress direct integration.
|
1 |
=== Spam protection, AntiSpam, FireWall by CleanTalk ===
|
2 |
Contributors: glomberg, artemacleantalk, alexandergull
|
3 |
Tags: spam, antispam, anti-spam, comments, firewall
|
4 |
+
Requires at least: 4.7
|
5 |
+
Tested up to: 6.1
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 5.187
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
451 |
|
452 |
== Changelog ==
|
453 |
|
454 |
+
= 5.187 Oct 20 2022 =
|
455 |
+
#### New integrations added 🔥, CleanTalk status on the sites list implemented 💣, parameters without cookies improved 🎈 and some minor issues fixed 💪🏼
|
456 |
+
* New. Integration. Site Reviews Integration.
|
457 |
+
* New. Integration. Sendinblue Integration
|
458 |
+
* Mod: Cleantalk Status in list of sites
|
459 |
+
* Fix. JS. CF async loading scripts fixed.
|
460 |
+
* Fix. JS. Listening events on document object instead of window object.
|
461 |
+
* Fix. Fixed spam protection if JS disabled.
|
462 |
+
* Fix. Mautic integration. Force third-side validation pre-intreception.
|
463 |
+
* Fix. WooCommerce. CartBounty plugin requests skipped.
|
464 |
+
* Fix. Code. Deprecated hooks wpmu_new_blog, delete_blog fixed.
|
465 |
+
* Fix. WPMS. Getting setting fixed for apply this on the new added blog.
|
466 |
+
* Fix. Code. JS events listening on the document object.
|
467 |
+
* Fix. Code. JS parameter without cookies fixed.
|
468 |
+
* Fix. EmailEncoder. Exclude placeholders from encoding to prevent field breach.
|
469 |
+
* Fix. No cookie. Collecting data moved to the more early stage.
|
470 |
+
* Fix. Common. Custom ajax forms block message fixed.
|
471 |
+
* Fix. EmailDecoder. Email decoding block message fixed
|
472 |
+
|
473 |
= 5.186 Oct 06 2022 =
|
474 |
#### Several integrations added 🔥, custom logo for SFW blocking pages added 🎯, external forms into iframe protected 🎉 and some minor issues fixed 💪🏼
|
475 |
* New. MemberPress direct integration.
|