From a252fc294b5e692ad5c230d9db9a6fd80fbcbb98 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 17 Feb 2026 18:52:32 +0700 Subject: [PATCH 01/32] Mod. SFW. Atomic approach to updating SFW, phpunit tests --- lib/Cleantalk/ApbctWP/DB.php | 30 --- lib/Cleantalk/ApbctWP/Firewall/SFW.php | 70 +++++- .../ApbctWP/Firewall/SFWUpdateHelper.php | 26 +-- .../TestReplaceDataTablesAtomically.php | 214 ++++++++++++++++++ 4 files changed, 290 insertions(+), 50 deletions(-) create mode 100644 tests/ApbctWP/Firewall/TestReplaceDataTablesAtomically.php diff --git a/lib/Cleantalk/ApbctWP/DB.php b/lib/Cleantalk/ApbctWP/DB.php index 0864fef46..bbd58ed40 100644 --- a/lib/Cleantalk/ApbctWP/DB.php +++ b/lib/Cleantalk/ApbctWP/DB.php @@ -180,34 +180,4 @@ public function getLastError() return $wpdb->last_error; } - - /** - * Check if all tables exists in DB. - * @param array $tables Tables names - * - * @return bool true if all tables exist, false otherwise - */ - public function tablesExist($tables = array()) - { - if ( ! is_array($tables) || empty($tables) ) { - return false; - } - - if (count($tables) === 1) { - $table = reset($tables); - return parent::isTableExists($table); - } else { - $query = ' - SELECT - COUNT(TABLE_NAME) as count - FROM - INFORMATION_SCHEMA.TABLES - WHERE - TABLE_SCHEMA = DATABASE() - AND TABLE_NAME IN (\'' . implode('\', \'', $tables) . '\'); - '; - } - $result = $this->fetch($query); - return is_array($result) && isset($result['count']) && (int)$result['count'] === count($tables); - } } diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFW.php b/lib/Cleantalk/ApbctWP/Firewall/SFW.php index bf751822a..2d1a754eb 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFW.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFW.php @@ -132,8 +132,7 @@ public function check() if ( empty($this->db__table__data) || - empty($this->db__table__data_personal) || - !$this->db->tablesExist(array($this->db__table__data_personal, $this->db__table__data)) //skip if any of SFW tables missed + empty($this->db__table__data_personal) ) { return $results; } @@ -948,6 +947,73 @@ public static function renameDataTablesFromTempToMain($db, $table_names) return true; } + /** + * Atomically replace main tables with temp tables + * Uses RENAME TABLE which is atomic in MySQL - tables are never missing + * + * @param DB $db database handler + * @param array|string $table_names Array with table names to replace + * + * @return bool|array + */ + public static function replaceDataTablesAtomically($db, $table_names) + { + // Cast it to array for simple input + $table_names = (array)$table_names; + + $rename_pairs = array(); + $tables_to_drop = array(); + + foreach ($table_names as $table_name) { + $table_name_temp = $table_name . '_temp'; + $table_name_old = $table_name . '_old'; + + // Check temp table exists + if (!$db->isTableExists($table_name_temp)) { + return array('error' => 'ATOMIC RENAME: TEMP TABLE NOT EXISTS: ' . $table_name_temp); + } + + // Drop _old table if exists from previous failed update + if ($db->isTableExists($table_name_old)) { + if ($db->execute('DROP TABLE IF EXISTS `' . $table_name_old . '`;') === false) { + return array( + 'error' => 'ATOMIC RENAME: FAILED TO DROP OLD TABLE: ' . $table_name_old + . ' DB Error: ' . $db->getLastError() + ); + } + } + + // Build rename pairs + if ($db->isTableExists($table_name)) { + // Main exists: main -> old, temp -> main + $rename_pairs[] = "`$table_name` TO `$table_name_old`"; + $rename_pairs[] = "`$table_name_temp` TO `$table_name`"; + $tables_to_drop[] = $table_name_old; + } else { + // Main doesn't exist: just temp -> main + $rename_pairs[] = "`$table_name_temp` TO `$table_name`"; + } + } + + // Execute atomic rename + if (!empty($rename_pairs)) { + $query = 'RENAME TABLE ' . implode(', ', $rename_pairs) . ';'; + + if ($db->execute($query) === false) { + return array( + 'error' => 'ATOMIC RENAME: FAILED: ' . $query . ' DB Error: ' . $db->getLastError() + ); + } + } + + // Clean up old tables (non-critical) + foreach ($tables_to_drop as $table_to_drop) { + $db->execute('DROP TABLE IF EXISTS `' . $table_to_drop . '`;'); + } + + return true; + } + /** * Add a new records to the SFW table. Duplicates will be updated on "status" field. * @param DB $db diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateHelper.php b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateHelper.php index 4dd7697fd..4c2e91275 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateHelper.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateHelper.php @@ -189,15 +189,10 @@ public static function removeAndRenameSfwTables($sfw_load_type) global $apbct; if ( $sfw_load_type === 'all' ) { - //common table delete - $result_deletion = SFW::dataTablesDelete(DB::getInstance(), $apbct->data['sfw_common_table_name']); - if ( !empty($result_deletion['error']) ) { - throw new \Exception('SFW_COMMON_TABLE_DELETION_ERROR'); - } - //common table rename - $result_renaming = SFW::renameDataTablesFromTempToMain(DB::getInstance(), $apbct->data['sfw_common_table_name']); - if ( !empty($result_renaming['error']) ) { - throw new \Exception('SFW_COMMON_TABLE_RENAME_ERROR'); + //common table delete and rename in one transaction + $result = SFW::replaceDataTablesAtomically(DB::getInstance(), $apbct->data['sfw_common_table_name']); + if ( !empty($result['error']) ) { + throw new \Exception('SFW_COMMON_TABLE_ATOMIC_RENAME_ERROR: ' . $result['error']); } //personal table delete @@ -222,15 +217,10 @@ public static function removeAndRenameSfwTables($sfw_load_type) throw new \Exception('SFW_PERSONAL_TABLE_RENAME_ERROR'); } } elseif ( $sfw_load_type === 'common' ) { - //common table delete - $result_deletion = SFW::dataTablesDelete(DB::getInstance(), $apbct->data['sfw_common_table_name']); - if ( !empty($result_deletion['error']) ) { - throw new \Exception('SFW_COMMON_TABLE_DELETION_ERROR'); - } - //common table rename - $result_renaming = SFW::renameDataTablesFromTempToMain(DB::getInstance(), $apbct->data['sfw_common_table_name']); - if ( !empty($result_renaming['error']) ) { - throw new \Exception('SFW_COMMON_TABLE_RENAME_ERROR'); + //common table delete and rename in one transaction + $result = SFW::replaceDataTablesAtomically(DB::getInstance(), $apbct->data['sfw_common_table_name']); + if ( !empty($result['error']) ) { + throw new \Exception('SFW_COMMON_TABLE_ATOMIC_RENAME_ERROR: ' . $result['error']); } } } diff --git a/tests/ApbctWP/Firewall/TestReplaceDataTablesAtomically.php b/tests/ApbctWP/Firewall/TestReplaceDataTablesAtomically.php new file mode 100644 index 000000000..e7587c7e9 --- /dev/null +++ b/tests/ApbctWP/Firewall/TestReplaceDataTablesAtomically.php @@ -0,0 +1,214 @@ +db = DB::getInstance(); + $this->test_table_name = $this->db->prefix . 'test_atomic_rename'; + $this->test_table_temp = $this->test_table_name . '_temp'; + $this->test_table_old = $this->test_table_name . '_old'; + + // Clean up before each test + $this->dropAllTestTables(); + } + + public function tearDown(): void + { + // Clean up after each test + $this->dropAllTestTables(); + } + + private function dropAllTestTables(): void + { + $this->db->execute('DROP TABLE IF EXISTS `' . $this->test_table_name . '`;'); + $this->db->execute('DROP TABLE IF EXISTS `' . $this->test_table_temp . '`;'); + $this->db->execute('DROP TABLE IF EXISTS `' . $this->test_table_old . '`;'); + } + + private function createTable(string $table_name, int $test_value = 1): void + { + $this->db->execute( + 'CREATE TABLE `' . $table_name . '` ( + id INT AUTO_INCREMENT PRIMARY KEY, + network INT UNSIGNED NOT NULL, + mask INT UNSIGNED NOT NULL, + status TINYINT NOT NULL DEFAULT 0 + );' + ); + // Insert test data to identify which table we're reading from + $this->db->execute( + 'INSERT INTO `' . $table_name . '` (network, mask, status) VALUES (' . $test_value . ', 4294967295, 0);' + ); + } + + private function getTableFirstNetwork(string $table_name): ?int + { + $result = $this->db->fetch('SELECT network FROM `' . $table_name . '` LIMIT 1;'); + return $result ? (int)$result['network'] : null; + } + + /** + * Test: Temp table doesn't exist - should return error + */ + public function testErrorWhenTempTableNotExists(): void + { + // Create only main table, no temp + $this->createTable($this->test_table_name, 100); + + $result = SFW::replaceDataTablesAtomically($this->db, $this->test_table_name); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('TEMP TABLE NOT EXISTS', $result['error']); + } + + /** + * Test: Main table exists - should be replaced with temp + */ + public function testReplaceExistingMainTable(): void + { + // Create main table with value 100 + $this->createTable($this->test_table_name, 100); + // Create temp table with value 200 + $this->createTable($this->test_table_temp, 200); + + $result = SFW::replaceDataTablesAtomically($this->db, $this->test_table_name); + + // Should succeed + $this->assertTrue($result); + + // Main table should now have data from temp (200) + $this->assertEquals(200, $this->getTableFirstNetwork($this->test_table_name)); + + // Temp table should not exist + $this->assertFalse($this->db->isTableExists($this->test_table_temp)); + + // Old table should be cleaned up + $this->assertFalse($this->db->isTableExists($this->test_table_old)); + } + + /** + * Test: Main table doesn't exist - temp should become main + */ + public function testCreateMainFromTemp(): void + { + // Create only temp table with value 300 + $this->createTable($this->test_table_temp, 300); + + $result = SFW::replaceDataTablesAtomically($this->db, $this->test_table_name); + + // Should succeed + $this->assertTrue($result); + + // Main table should now exist with data from temp + $this->assertTrue($this->db->isTableExists($this->test_table_name)); + $this->assertEquals(300, $this->getTableFirstNetwork($this->test_table_name)); + + // Temp table should not exist + $this->assertFalse($this->db->isTableExists($this->test_table_temp)); + } + + /** + * Test: Old table exists from previous failed update - should be cleaned up + */ + public function testCleanupExistingOldTable(): void + { + // Simulate previous failed update: _old table exists + $this->createTable($this->test_table_old, 50); + $this->createTable($this->test_table_name, 100); + $this->createTable($this->test_table_temp, 200); + + $result = SFW::replaceDataTablesAtomically($this->db, $this->test_table_name); + + // Should succeed + $this->assertTrue($result); + + // Old table should be cleaned up + $this->assertFalse($this->db->isTableExists($this->test_table_old)); + + // Main should have new data + $this->assertEquals(200, $this->getTableFirstNetwork($this->test_table_name)); + } + + /** + * Test: Multiple tables at once + */ + public function testMultipleTables(): void + { + $table1 = $this->test_table_name . '_1'; + $table2 = $this->test_table_name . '_2'; + + // Create tables + $this->createTable($table1, 100); + $this->createTable($table1 . '_temp', 101); + $this->createTable($table2, 200); + $this->createTable($table2 . '_temp', 201); + + $result = SFW::replaceDataTablesAtomically($this->db, [$table1, $table2]); + + // Should succeed + $this->assertTrue($result); + + // Both tables should have new data + $this->assertEquals(101, $this->getTableFirstNetwork($table1)); + $this->assertEquals(201, $this->getTableFirstNetwork($table2)); + + // Cleanup + $this->db->execute('DROP TABLE IF EXISTS `' . $table1 . '`;'); + $this->db->execute('DROP TABLE IF EXISTS `' . $table2 . '`;'); + } + + /** + * Test: Atomicity - main table is never missing during operation + * This is more of a conceptual test - RENAME TABLE is atomic in MySQL + */ + public function testAtomicityMainTableAlwaysAccessible(): void + { + $this->createTable($this->test_table_name, 100); + $this->createTable($this->test_table_temp, 200); + + // Before rename - main exists + $this->assertTrue($this->db->isTableExists($this->test_table_name)); + + $result = SFW::replaceDataTablesAtomically($this->db, $this->test_table_name); + + // After rename - main still exists (with new data) + $this->assertTrue($result); + $this->assertTrue($this->db->isTableExists($this->test_table_name)); + } + + /** + * Test: Empty array input + */ + public function testEmptyArrayInput(): void + { + $result = SFW::replaceDataTablesAtomically($this->db, []); + + // Should succeed (nothing to do) + $this->assertTrue($result); + } + + /** + * Test: String input is cast to array + */ + public function testStringInputCastToArray(): void + { + $this->createTable($this->test_table_temp, 500); + + // Pass string instead of array + $result = SFW::replaceDataTablesAtomically($this->db, $this->test_table_name); + + $this->assertTrue($result); + $this->assertEquals(500, $this->getTableFirstNetwork($this->test_table_name)); + } +} \ No newline at end of file From c59982159d484919501553a44f60f3d4c0fcd4cc Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 17 Feb 2026 20:10:57 +0700 Subject: [PATCH 02/32] Fix phpunits --- lib/Cleantalk/ApbctWP/Firewall/SFW.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFW.php b/lib/Cleantalk/ApbctWP/Firewall/SFW.php index 2d1a754eb..36c8c3774 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFW.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFW.php @@ -960,14 +960,14 @@ public static function replaceDataTablesAtomically($db, $table_names) { // Cast it to array for simple input $table_names = (array)$table_names; - + $rename_pairs = array(); $tables_to_drop = array(); - + foreach ($table_names as $table_name) { $table_name_temp = $table_name . '_temp'; $table_name_old = $table_name . '_old'; - + // Check temp table exists if (!$db->isTableExists($table_name_temp)) { return array('error' => 'ATOMIC RENAME: TEMP TABLE NOT EXISTS: ' . $table_name_temp); @@ -998,7 +998,7 @@ public static function replaceDataTablesAtomically($db, $table_names) // Execute atomic rename if (!empty($rename_pairs)) { $query = 'RENAME TABLE ' . implode(', ', $rename_pairs) . ';'; - + if ($db->execute($query) === false) { return array( 'error' => 'ATOMIC RENAME: FAILED: ' . $query . ' DB Error: ' . $db->getLastError() From ad0ebae7bd4505bab1637a39f9f7bc76ef578555 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Wed, 18 Feb 2026 13:42:18 +0500 Subject: [PATCH 03/32] Upd. Exclusions. Ajax. Plugin "cart-recovery". --- inc/cleantalk-pluggable.php | 8 ++++++++ tests/Inc/TestContactIsSkipRequest.php | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index 4ca90815e..ac7357970 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -1715,6 +1715,14 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') ) { return 'wp-multi-step-checkout'; } + + //UNIT OK https://wordpress.org/plugins/cart-recovery/ + if ( + apbct_is_plugin_active('cart-recovery/cart-recovery-for-wordpress.php') && + Post::equal('action', 'crfw_record_cart') + ) { + return 'cart-recovery'; + } } else { /*****************************************/ /* Here is non-ajax requests skipping */ diff --git a/tests/Inc/TestContactIsSkipRequest.php b/tests/Inc/TestContactIsSkipRequest.php index 5799ebf9f..89152d8ca 100644 --- a/tests/Inc/TestContactIsSkipRequest.php +++ b/tests/Inc/TestContactIsSkipRequest.php @@ -117,6 +117,16 @@ public function testSkip__woocommerceSendinblueNewsletterSubscription() )); } + public function testSkip__woocommerce__cartRecovery() + { + $this->assertTrue(self::checkSkipMutations( + 'action', + 'crfw_record_cart', + 'cart-recovery/cart-recovery-for-wordpress.php', + 'cart-recovery' + )); + } + /** * Check if skipped on all data complied, and every case if not. * @param string $expected_key expected POST key From e0efe256c66b6526fec3cde9bc6881e18338558b Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Thu, 19 Feb 2026 13:57:39 +0700 Subject: [PATCH 04/32] Upd version 6.73.99-dev --- cleantalk.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleantalk.php b/cleantalk.php index 9afdc9726..9053519bb 100644 --- a/cleantalk.php +++ b/cleantalk.php @@ -4,7 +4,7 @@ Plugin Name: Anti-Spam by CleanTalk Plugin URI: https://cleantalk.org 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. - Version: 6.73 + Version: 6.73.99-dev Author: CleanTalk - Anti-Spam Protection Author URI: https://cleantalk.org Text Domain: cleantalk-spam-protect From 4588c83a6312514160c43ab5282479ab9e9b91cd Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Thu, 19 Feb 2026 13:58:50 +0700 Subject: [PATCH 05/32] Upd version 6.73.99-fix --- cleantalk.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleantalk.php b/cleantalk.php index 9afdc9726..8468a83f9 100644 --- a/cleantalk.php +++ b/cleantalk.php @@ -4,7 +4,7 @@ Plugin Name: Anti-Spam by CleanTalk Plugin URI: https://cleantalk.org 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. - Version: 6.73 + Version: 6.73.99-fix Author: CleanTalk - Anti-Spam Protection Author URI: https://cleantalk.org Text Domain: cleantalk-spam-protect From cc4e30348a43e3efe4e405c5f6b60997ba944e94 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 19 Feb 2026 14:34:15 +0500 Subject: [PATCH 06/32] Fix. JS. Window fetch. Fixed default fetch placement. --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- js/apbct-public-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- js/apbct-public-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- js/apbct-public-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 2 +- js/prebuild/apbct-public-bundle_ext-protection.js | 2 +- js/prebuild/apbct-public-bundle_ext-protection_gathering.js | 2 +- js/prebuild/apbct-public-bundle_full-protection.js | 2 +- js/prebuild/apbct-public-bundle_full-protection_gathering.js | 2 +- js/prebuild/apbct-public-bundle_gathering.js | 2 +- js/prebuild/apbct-public-bundle_int-protection.js | 2 +- js/prebuild/apbct-public-bundle_int-protection_gathering.js | 2 +- js/src/public-1-main.js | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index b239355fc..6ac7c6b4e 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection.min.js b/js/apbct-public-bundle_ext-protection.min.js index 650847cf7..126b82b79 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return m.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,m.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 2de18c58f..5e191b5ad 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection.min.js b/js/apbct-public-bundle_full-protection.min.js index d623afd14..8961807cb 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(r.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==r&&(o.apbct_search_form__honeypot_value=r),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,r,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return m.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,m.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index f8ace5581..2daaa1741 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 6856bb608..8e0c32565 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection.min.js b/js/apbct-public-bundle_int-protection.min.js index 760d8353e..98311904e 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index f2aa4fe87..2fc87d32a 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 2db23e876..edd044826 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3185,6 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4184,7 +4185,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index b8c7a2c0a..699a47846 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3185,6 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4184,7 +4185,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index cc0122cb6..40f87f5ea 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3185,6 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4184,7 +4185,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index abab6ff61..01eb507d6 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3185,6 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4184,7 +4185,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 9ecbc320f..de4b85d7a 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3185,6 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4184,7 +4185,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index 0b40c9833..a98acd806 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3185,6 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4184,7 +4185,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 5c870c8e5..816758741 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3185,6 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4184,7 +4185,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 22bd9d6e0..e0329b238 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3185,6 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4184,7 +4185,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index cdd662fc1..e2a9329f4 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -661,6 +661,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -1660,7 +1661,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars From 06b231218d164252e92e7e549c3c28f47a321f9c Mon Sep 17 00:00:00 2001 From: Glomberg Date: Thu, 19 Feb 2026 19:12:46 +0300 Subject: [PATCH 07/32] Fix. Code. JS loading by `defer` fixed. --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- js/apbct-public-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- js/apbct-public-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- js/apbct-public-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 9 ++++----- js/prebuild/apbct-public-bundle_ext-protection.js | 9 ++++----- .../apbct-public-bundle_ext-protection_gathering.js | 9 ++++----- js/prebuild/apbct-public-bundle_full-protection.js | 9 ++++----- .../apbct-public-bundle_full-protection_gathering.js | 9 ++++----- js/prebuild/apbct-public-bundle_gathering.js | 9 ++++----- js/prebuild/apbct-public-bundle_int-protection.js | 9 ++++----- .../apbct-public-bundle_int-protection_gathering.js | 9 ++++----- js/src/public-1-main.js | 9 ++++----- 17 files changed, 44 insertions(+), 53 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index b239355fc..f5a494269 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection.min.js b/js/apbct-public-bundle_ext-protection.min.js index 650847cf7..4a0818ce4 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 2de18c58f..4864f3b36 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection.min.js b/js/apbct-public-bundle_full-protection.min.js index d623afd14..72ebf0b1a 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(r.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==r&&(o.apbct_search_form__honeypot_value=r),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,r,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(r.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==r&&(o.apbct_search_form__honeypot_value=r),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,r,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index f8ace5581..5c3e8b12f 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 6856bb608..137e26d3a 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection.min.js b/js/apbct-public-bundle_int-protection.min.js index 760d8353e..9b939df2f 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index f2aa4fe87..908f2e3d4 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 2db23e876..58c26ee9d 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -4171,6 +4171,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -4184,11 +4188,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index b8c7a2c0a..dc5f092ff 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -4171,6 +4171,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -4184,11 +4188,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index cc0122cb6..c3a20941d 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -4171,6 +4171,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -4184,11 +4188,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index abab6ff61..567cd8666 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -4171,6 +4171,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -4184,11 +4188,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 9ecbc320f..7ea8bbfd3 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -4171,6 +4171,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -4184,11 +4188,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index 0b40c9833..3cbf6b3b2 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -4171,6 +4171,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -4184,11 +4188,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 5c870c8e5..dbc09d546 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -4171,6 +4171,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -4184,11 +4188,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 22bd9d6e0..095ecc42a 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -4171,6 +4171,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -4184,11 +4188,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index cdd662fc1..1e7a29ee3 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -1647,6 +1647,10 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } +const defaultFetch = window.fetch; +const defaultSend = XMLHttpRequest.prototype.send; +let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars + if (ctPublic.data__key_is_ok) { if (document.readyState !== 'loading') { apbct_ready(); @@ -1660,11 +1664,6 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; -const defaultSend = XMLHttpRequest.prototype.send; - -let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars - /** * Run cron jobs */ From 9eb8f974dd9d40cad767c2f012a8fcfe470eac55 Mon Sep 17 00:00:00 2001 From: Glomberg Date: Thu, 19 Feb 2026 21:04:38 +0300 Subject: [PATCH 08/32] Revert "Fix. JS. Window fetch. Fixed default fetch placement." This reverts commit cc4e30348a43e3efe4e405c5f6b60997ba944e94. --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- js/apbct-public-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- js/apbct-public-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- js/apbct-public-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 2 +- js/prebuild/apbct-public-bundle_ext-protection.js | 2 +- js/prebuild/apbct-public-bundle_ext-protection_gathering.js | 2 +- js/prebuild/apbct-public-bundle_full-protection.js | 2 +- js/prebuild/apbct-public-bundle_full-protection_gathering.js | 2 +- js/prebuild/apbct-public-bundle_gathering.js | 2 +- js/prebuild/apbct-public-bundle_int-protection.js | 2 +- js/prebuild/apbct-public-bundle_int-protection_gathering.js | 2 +- js/src/public-1-main.js | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index 6ac7c6b4e..b239355fc 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection.min.js b/js/apbct-public-bundle_ext-protection.min.js index 126b82b79..650847cf7 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return m.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,m.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 5e191b5ad..2de18c58f 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection.min.js b/js/apbct-public-bundle_full-protection.min.js index 8961807cb..d623afd14 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return m.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,m.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(r.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==r&&(o.apbct_search_form__honeypot_value=r),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,r,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 2daaa1741..f8ace5581 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 8e0c32565..6856bb608 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection.min.js b/js/apbct-public-bundle_int-protection.min.js index 98311904e..760d8353e 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 2fc87d32a..f2aa4fe87 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return f.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,f.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index edd044826..2db23e876 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3185,7 +3185,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4185,6 +4184,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 699a47846..b8c7a2c0a 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3185,7 +3185,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4185,6 +4184,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index 40f87f5ea..cc0122cb6 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3185,7 +3185,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4185,6 +4184,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 01eb507d6..abab6ff61 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3185,7 +3185,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4185,6 +4184,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index de4b85d7a..9ecbc320f 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3185,7 +3185,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4185,6 +4184,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index a98acd806..0b40c9833 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3185,7 +3185,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4185,6 +4184,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 816758741..5c870c8e5 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3185,7 +3185,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4185,6 +4184,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index e0329b238..22bd9d6e0 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3185,7 +3185,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -4185,6 +4184,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index e2a9329f4..cdd662fc1 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -661,7 +661,6 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag @@ -1661,6 +1660,7 @@ if (ctPublic.data__key_is_ok) { } } +const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars From 472ce0ba6dbd6ca8d1e0e84cecfe679abbf9d942 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Fri, 20 Feb 2026 12:37:56 +0700 Subject: [PATCH 09/32] Mod. OtterForms. Changing integration from a hook to a route --- inc/cleantalk-integrations-by-hook.php | 5 -- inc/cleantalk-integrations-by-route.php | 7 +- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- ...lic-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- ...ic-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- ...lic-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 15 ++-- .../apbct-public-bundle_ext-protection.js | 11 ++- ...-public-bundle_ext-protection_gathering.js | 11 ++- .../apbct-public-bundle_full-protection.js | 11 ++- ...public-bundle_full-protection_gathering.js | 11 ++- js/prebuild/apbct-public-bundle_gathering.js | 11 ++- .../apbct-public-bundle_int-protection.js | 11 ++- ...-public-bundle_int-protection_gathering.js | 11 ++- .../ApbctShadowRootProtection.js | 2 + js/src/public-1-main.js | 7 +- .../Antispam/Integrations/OtterBlocksForm.php | 87 ++++++++++++------- 21 files changed, 133 insertions(+), 83 deletions(-) diff --git a/inc/cleantalk-integrations-by-hook.php b/inc/cleantalk-integrations-by-hook.php index d5033fcaa..b9a59b09a 100755 --- a/inc/cleantalk-integrations-by-hook.php +++ b/inc/cleantalk-integrations-by-hook.php @@ -360,11 +360,6 @@ 'setting' => 'forms__contact_forms_test', 'ajax' => true ), - 'OtterBlocksForm' => array( - 'hook' => 'otter_form_anti_spam_validation', - 'setting' => 'forms__contact_forms_test', - 'ajax' => false - ), 'TourMasterRegister' => array( 'hook' => 'wp_pre_insert_user_data', 'setting' => 'forms__registrations_test', diff --git a/inc/cleantalk-integrations-by-route.php b/inc/cleantalk-integrations-by-route.php index 9bc3bdb92..0c8215528 100644 --- a/inc/cleantalk-integrations-by-route.php +++ b/inc/cleantalk-integrations-by-route.php @@ -10,7 +10,12 @@ 'rest_route' => '/wp-recipe-maker/v1/user-rating/', 'setting' => 'forms__contact_forms_test', 'rest' => true, - ) + ), + 'OtterBlocksForm' => array( + 'rest_route' => '/otter/v1/form/frontend', + 'setting' => 'forms__contact_forms_test', + 'rest' => true, + ), ); add_filter('rest_pre_dispatch', function ($result, $_, $request) use ($apbct_active_rest_integrations) { diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index b239355fc..f33d35804 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection.min.js b/js/apbct-public-bundle_ext-protection.min.js index 650847cf7..06bd4c9f3 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 2de18c58f..bcb7a5ffb 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection.min.js b/js/apbct-public-bundle_full-protection.min.js index d623afd14..f7efdd9bf 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(r.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==r&&(o.apbct_search_form__honeypot_value=r),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,r,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index f8ace5581..50ec76b92 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 6856bb608..6d184f081 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection.min.js b/js/apbct-public-bundle_int-protection.min.js index 760d8353e..b7474c8ce 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index f2aa4fe87..c624c62f0 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 2db23e876..d71f94f92 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3021,15 +3021,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3185,7 +3185,7 @@ class ApbctHandler { catchFetchRequest() { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - + const defaultFetch = window.fetch; /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3393,7 +3393,10 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - + if (settings.data.indexOf('otter-form') !== -1) { + sourceSign.found = 'otter-form'; + sourceSign.keepUnwrapped = true; + } if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; @@ -4184,7 +4187,7 @@ if (ctPublic.data__key_is_ok) { } } -const defaultFetch = window.fetch; + const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index b8c7a2c0a..8164610d6 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3021,15 +3021,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3393,7 +3393,10 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - + if (settings.data.indexOf('otter-form') !== -1) { + sourceSign.found = 'otter-form'; + sourceSign.keepUnwrapped = true; + } if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index cc0122cb6..1ca8f890a 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3021,15 +3021,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3393,7 +3393,10 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - + if (settings.data.indexOf('otter-form') !== -1) { + sourceSign.found = 'otter-form'; + sourceSign.keepUnwrapped = true; + } if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index abab6ff61..491aabed5 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3021,15 +3021,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3393,7 +3393,10 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - + if (settings.data.indexOf('otter-form') !== -1) { + sourceSign.found = 'otter-form'; + sourceSign.keepUnwrapped = true; + } if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 9ecbc320f..fb129474e 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3021,15 +3021,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3393,7 +3393,10 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - + if (settings.data.indexOf('otter-form') !== -1) { + sourceSign.found = 'otter-form'; + sourceSign.keepUnwrapped = true; + } if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index 0b40c9833..e9a4d990f 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3021,15 +3021,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3393,7 +3393,10 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - + if (settings.data.indexOf('otter-form') !== -1) { + sourceSign.found = 'otter-form'; + sourceSign.keepUnwrapped = true; + } if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 5c870c8e5..cf2caa708 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3021,15 +3021,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3393,7 +3393,10 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - + if (settings.data.indexOf('otter-form') !== -1) { + sourceSign.found = 'otter-form'; + sourceSign.keepUnwrapped = true; + } if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 22bd9d6e0..020d8475a 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3021,15 +3021,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3393,7 +3393,10 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - + if (settings.data.indexOf('otter-form') !== -1) { + sourceSign.found = 'otter-form'; + sourceSign.keepUnwrapped = true; + } if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; diff --git a/js/src/ShadowrootProtection/ApbctShadowRootProtection.js b/js/src/ShadowrootProtection/ApbctShadowRootProtection.js index c42b9c18b..c9ace1b60 100644 --- a/js/src/ShadowrootProtection/ApbctShadowRootProtection.js +++ b/js/src/ShadowrootProtection/ApbctShadowRootProtection.js @@ -12,6 +12,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { + console.log(url); + for (const [formKey, config] of Object.entries(this.config)) { // Shadowroot can send both external and internal requests // If the form is external, then we check whether the setting is enabled. diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index cdd662fc1..882210740 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -497,15 +497,15 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; + //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || pafeFormsFormElementor || - bloomPopup || - otterForm; + bloomPopup; + //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -869,7 +869,6 @@ class ApbctHandler { if (settings.data.indexOf('twt_cc_signup') !== -1) { sourceSign.found = 'twt_cc_signup'; } - if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; sourceSign.attachVisibleFieldsData = true; diff --git a/lib/Cleantalk/Antispam/Integrations/OtterBlocksForm.php b/lib/Cleantalk/Antispam/Integrations/OtterBlocksForm.php index f920fed52..93b2dd53f 100644 --- a/lib/Cleantalk/Antispam/Integrations/OtterBlocksForm.php +++ b/lib/Cleantalk/Antispam/Integrations/OtterBlocksForm.php @@ -6,47 +6,57 @@ class OtterBlocksForm extends IntegrationBase { - private $form_data_request; + //private $form_data_request; /** * @inheritDoc */ public function getDataForChecking($argument) { - $this->form_data_request = $argument; - Cookie::$force_alt_cookies_global = true; + // Try to decode the form_data JSON + $form_data_json = isset($argument['form_data']) ? $argument['form_data'] : ''; + $form_data_obj = json_decode($form_data_json); + file_put_contents(__DIR__."/umitest", print_r([__FILE__.' '.__LINE__, $_POST], true).PHP_EOL, FILE_APPEND | LOCK_EX); - /** - * @psalm-suppress UndefinedClass - */ + $result = []; if ( - class_exists('\ThemeIsle\GutenbergBlocks\Integration\Form_Data_Request') && - $argument instanceof \ThemeIsle\GutenbergBlocks\Integration\Form_Data_Request && - method_exists($this->form_data_request, 'get_fields') + is_object($form_data_obj) && + isset($form_data_obj->payload) && + isset($form_data_obj->payload->formInputsData) && + is_array($form_data_obj->payload->formInputsData) ) { - $fields = $this->form_data_request->get_fields(); - if ( - isset($fields) && - is_array($fields) - ) { - $form_data = []; - foreach ( $fields as $input_info ) { - if ( isset($input_info['id'], $input_info['value']) ) { - $form_data[] = [ - $input_info['id'] => $input_info['value'] - ]; - } + foreach ($form_data_obj->payload->formInputsData as $input) { + if (!isset($input->label) || !isset($input->value)) { + continue; } - if ( count($form_data) ) { - $gfa_result = ct_gfa($form_data); - $event_token = Cookie::get('ct_bot_detector_event_token'); - if ( $event_token ) { - $gfa_result['event_token'] = $event_token; - } - return $gfa_result; + switch (mb_strtolower($input->label)) { + case 'name': + $result['name'] = $input->value; + break; + case 'email': + $result['email'] = $input->value; + break; + case 'message': + $result['message'] = $input->value; + break; } } } + + // Fallback: if not found, return original argument + file_put_contents(__DIR__."/umitest", print_r([__FILE__.' '.__LINE__, ct_gfa_dto( + apply_filters('apbct__filter_post', $result), + isset($result['email']) ? $result['email'] : '', + isset($result['name']) ? $result['name'] : '', + )->getArray()], true).PHP_EOL, FILE_APPEND | LOCK_EX); + + if (count($result) > 0) { + return ct_gfa_dto( + apply_filters('apbct__filter_post', $result), + isset($result['email']) ? $result['email'] : '', + isset($result['name']) ? $result['name'] : '', + )->getArray(); + } return $argument; } @@ -56,8 +66,23 @@ class_exists('\ThemeIsle\GutenbergBlocks\Integration\Form_Data_Request') && */ public function doBlock($message) { - if ( method_exists($this->form_data_request, 'set_error') ) { - $this->form_data_request->set_error('110', $message); - } + die( + json_encode( + array( + 'apbct' => array( + 'blocked' => true, + 'comment' => $message, + 'stop_script' => 1, + 'integration' => 'OtterBlocksForm' + ) + ) + ) + ); + /* wp_send_json_error( + array( + 'message' => $message + ) + ); + die(); */ } } From da780b62d1d5e40d0c60e7fd7b45c173a0422b8e Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Fri, 20 Feb 2026 16:56:49 +0700 Subject: [PATCH 10/32] Mod. OtterForms. Changing the integration, renaming the request interception method --- gulpfile.js | 48 +++---- inc/cleantalk-integrations-by-hook.php | 5 + inc/cleantalk-integrations-by-route.php | 5 - js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- ...lic-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- ...ic-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- ...lic-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 42 +++--- .../apbct-public-bundle_ext-protection.js | 42 +++--- ...-public-bundle_ext-protection_gathering.js | 42 +++--- .../apbct-public-bundle_full-protection.js | 42 +++--- ...public-bundle_full-protection_gathering.js | 42 +++--- js/prebuild/apbct-public-bundle_gathering.js | 42 +++--- .../apbct-public-bundle_int-protection.js | 42 +++--- ...-public-bundle_int-protection_gathering.js | 42 +++--- .../ApbctFetchProxyCallbacks.js} | 4 +- .../ApbctFetchProxyConfig.js | 21 +++ .../ApbctFetchProxyProtection.js} | 16 +-- .../ApbctShadowRootConfig.js | 13 -- js/src/public-1-main.js | 10 +- .../Antispam/Integrations/OtterBlocksForm.php | 63 +++++---- .../TestOtterBlocksForm.php | 120 ++++++++++++++++++ 26 files changed, 412 insertions(+), 245 deletions(-) rename js/src/{ShadowrootProtection/ApbctShadowRootCallbacks.js => FetchProxyProtection/ApbctFetchProxyCallbacks.js} (90%) create mode 100644 js/src/FetchProxyProtection/ApbctFetchProxyConfig.js rename js/src/{ShadowrootProtection/ApbctShadowRootProtection.js => FetchProxyProtection/ApbctFetchProxyProtection.js} (91%) delete mode 100644 js/src/ShadowrootProtection/ApbctShadowRootConfig.js create mode 100644 tests/Antispam/IntegrationsByHook/TestOtterBlocksForm.php diff --git a/gulpfile.js b/gulpfile.js index b11540449..4ba0b0914 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -68,9 +68,9 @@ function bundle_public_default() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', - 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', - 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', - 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyConfig.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyProtection.js', 'js/src/public-1*.js', 'js/src/public-3*.js', ]) @@ -86,9 +86,9 @@ function bundle_public_default_with_gathering() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', - 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', - 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', - 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyConfig.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyProtection.js', 'js/src/public-1*.js', 'js/src/public-2-gathering-data.js', 'js/src/public-3*.js', @@ -105,9 +105,9 @@ function bundle_public_external_protection() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', - 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', - 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', - 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyConfig.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyProtection.js', 'js/src/public-1*.js', 'js/src/public-2-external-forms.js', '!js/src/public-2-gathering-data.js', @@ -125,9 +125,9 @@ function bundle_public_external_protection_with_gathering() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', - 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', - 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', - 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyConfig.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyProtection.js', 'js/src/public-1*.js', 'js/src/public-2-external-forms.js', 'js/src/public-2-gathering-data.js', @@ -145,9 +145,9 @@ function bundle_public_internal_protection() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', - 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', - 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', - 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyConfig.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyProtection.js', 'js/src/public-1*.js', 'js/src/public-2-internal-forms.js', 'js/src/public-3*.js', @@ -164,9 +164,9 @@ function bundle_public_internal_protection_with_gathering() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', - 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', - 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', - 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyConfig.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyProtection.js', 'js/src/public-1*.js', 'js/src/public-2-internal-forms.js', 'js/src/public-2-gathering-data.js', @@ -184,9 +184,9 @@ function bundle_public_full_protection() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', - 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', - 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', - 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyConfig.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyProtection.js', 'js/src/public-1*.js', 'js/src/public-2*.js', '!js/src/public-2-gathering-data.js', @@ -204,9 +204,9 @@ function bundle_public_full_protection_with_gathering() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', - 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', - 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', - 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyConfig.js', + 'js/src/FetchProxyProtection/ApbctFetchProxyProtection.js', 'js/src/public-1*.js', 'js/src/public-2*.js', 'js/src/public-3*.js', diff --git a/inc/cleantalk-integrations-by-hook.php b/inc/cleantalk-integrations-by-hook.php index b9a59b09a..d59a938a1 100755 --- a/inc/cleantalk-integrations-by-hook.php +++ b/inc/cleantalk-integrations-by-hook.php @@ -343,6 +343,11 @@ 'setting' => 'forms__check_external', 'ajax' => true ), + 'OtterBlocksForm' => array( + 'hook' => 'cleantalk_force_otterform_check', + 'setting' => 'forms__contact_forms_test', + 'ajax' => true + ), 'BloomForms' => array( 'hook' => 'bloom_subscribe', 'setting' => 'forms__contact_forms_test', diff --git a/inc/cleantalk-integrations-by-route.php b/inc/cleantalk-integrations-by-route.php index 0c8215528..d1b0b334b 100644 --- a/inc/cleantalk-integrations-by-route.php +++ b/inc/cleantalk-integrations-by-route.php @@ -11,11 +11,6 @@ 'setting' => 'forms__contact_forms_test', 'rest' => true, ), - 'OtterBlocksForm' => array( - 'rest_route' => '/otter/v1/form/frontend', - 'setting' => 'forms__contact_forms_test', - 'rest' => true, - ), ); add_filter('rest_pre_dispatch', function ($result, $_, $request) use ($apbct_active_rest_integrations) { diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index 4ff6fb98b..863c6f096 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){console.log(e);for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===a[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var o=a[t].href.replace(e,""),r=a[t].innerHTML;a[t].innerHTML=r.replace(o,n.decoded_email),a[t].href=e+n.decoded_email,a[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a)},2e3),a.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),n.append(a),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),r=0;r(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,r=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(r.s();!(n=r.n()).done;)o=o||e===n.value}catch(e){r.e(e)}finally{r.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var r,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(r=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=r.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var r,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(r=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=r.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function r(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,r,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===a&&null===l||(e.preventDefault(),n=function(){null!==a&&a.parentNode.removeChild(a),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(r=JSON.stringify(o))&&0!==r.length?ctSetAlternativeCookie(r,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,r=_createForOfIteratorHelper(t);try{for(r.s();!(o=r.n()).done;){var a=o.value,i=this.findParentContainer(a);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){r.e(e)}finally{r.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,r,a,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),a.append(i,c),r.append(a),n.append(o),e.append(n),e.append(r))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var r=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;r=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(r),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){r=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;r=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(r),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(r=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection.min.js b/js/apbct-public-bundle_ext-protection.min.js index 5dd0043e1..0c78cd127 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){console.log(e);for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 447d45f9f..839d4265a 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){console.log(e);for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection.min.js b/js/apbct-public-bundle_full-protection.min.js index b91718644..716c418c7 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){console.log(e);for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index d8abf7941..cf847f97b 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){console.log(e);for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 5bddf40c7..d4475ea3c 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){console.log(e);for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection.min.js b/js/apbct-public-bundle_int-protection.min.js index 16dbd251a..1bacd5ac3 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){console.log(e);for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===a[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var o=a[t].href.replace(e,""),r=a[t].innerHTML;a[t].innerHTML=r.replace(o,n.decoded_email),a[t].href=e+n.decoded_email,a[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a)},2e3),a.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),n.append(a),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),r=0;r(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,r=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(r.s();!(n=r.n()).done;)o=o||e===n.value}catch(e){r.e(e)}finally{r.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var r,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(r=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=r.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var r,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(r=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=r.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function r(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,r,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===a&&null===l||(e.preventDefault(),n=function(){null!==a&&a.parentNode.removeChild(a),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(r=JSON.stringify(o))&&0!==r.length?ctSetAlternativeCookie(r,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,r=_createForOfIteratorHelper(t);try{for(r.s();!(o=r.n()).done;){var a=o.value,i=this.findParentContainer(a);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){r.e(e)}finally{r.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,r,a,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),a.append(i,c),r.append(a),n.append(o),e.append(n),e.append(r))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var r=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;r=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(r),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){r=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;r=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(r),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(r=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index ff8dfdd35..a2f96ea54 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){console.log(e);for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index cfdccd58e..7e7607ab7 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -1807,9 +1807,9 @@ if (!Object.prototype.hasOwn) { } /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result @@ -1836,24 +1836,32 @@ const ApbctShadowRootCallbacks = { // }, }; /** - * Config for ShadowRoot integrations + * Config for FetchProxy integrations */ -const ApbctShadowRootConfig = { +const ApbctFetchProxyConfig = { 'mailchimp': { selector: '.mcforms-wrapper', urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', externalForm: true, action: 'cleantalk_force_mailchimp_shadowroot_check', callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, }, }; /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -1862,10 +1870,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -1879,7 +1885,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -1940,7 +1946,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -1970,7 +1976,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ @@ -3185,7 +3191,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -3243,9 +3249,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index fa46deeb7..6f99a06db 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -1807,9 +1807,9 @@ if (!Object.prototype.hasOwn) { } /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result @@ -1836,24 +1836,32 @@ const ApbctShadowRootCallbacks = { // }, }; /** - * Config for ShadowRoot integrations + * Config for FetchProxy integrations */ -const ApbctShadowRootConfig = { +const ApbctFetchProxyConfig = { 'mailchimp': { selector: '.mcforms-wrapper', urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', externalForm: true, action: 'cleantalk_force_mailchimp_shadowroot_check', callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, }, }; /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -1862,10 +1870,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -1879,7 +1885,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -1940,7 +1946,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -1970,7 +1976,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ @@ -3185,7 +3191,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -3243,9 +3249,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index 57fe0dbd1..f15bcb496 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -1807,9 +1807,9 @@ if (!Object.prototype.hasOwn) { } /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result @@ -1836,24 +1836,32 @@ const ApbctShadowRootCallbacks = { // }, }; /** - * Config for ShadowRoot integrations + * Config for FetchProxy integrations */ -const ApbctShadowRootConfig = { +const ApbctFetchProxyConfig = { 'mailchimp': { selector: '.mcforms-wrapper', urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', externalForm: true, action: 'cleantalk_force_mailchimp_shadowroot_check', callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, }, }; /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -1862,10 +1870,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -1879,7 +1885,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -1940,7 +1946,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -1970,7 +1976,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ @@ -3185,7 +3191,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -3243,9 +3249,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 8d46c3229..2b06279fb 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -1807,9 +1807,9 @@ if (!Object.prototype.hasOwn) { } /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result @@ -1836,24 +1836,32 @@ const ApbctShadowRootCallbacks = { // }, }; /** - * Config for ShadowRoot integrations + * Config for FetchProxy integrations */ -const ApbctShadowRootConfig = { +const ApbctFetchProxyConfig = { 'mailchimp': { selector: '.mcforms-wrapper', urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', externalForm: true, action: 'cleantalk_force_mailchimp_shadowroot_check', callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, }, }; /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -1862,10 +1870,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -1879,7 +1885,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -1940,7 +1946,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -1970,7 +1976,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ @@ -3185,7 +3191,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -3243,9 +3249,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index a52a5e271..2a8bc34d9 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -1807,9 +1807,9 @@ if (!Object.prototype.hasOwn) { } /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result @@ -1836,24 +1836,32 @@ const ApbctShadowRootCallbacks = { // }, }; /** - * Config for ShadowRoot integrations + * Config for FetchProxy integrations */ -const ApbctShadowRootConfig = { +const ApbctFetchProxyConfig = { 'mailchimp': { selector: '.mcforms-wrapper', urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', externalForm: true, action: 'cleantalk_force_mailchimp_shadowroot_check', callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, }, }; /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -1862,10 +1870,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -1879,7 +1885,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -1940,7 +1946,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -1970,7 +1976,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ @@ -3185,7 +3191,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -3243,9 +3249,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index 0f98aa07f..09dbf66b7 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -1807,9 +1807,9 @@ if (!Object.prototype.hasOwn) { } /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result @@ -1836,24 +1836,32 @@ const ApbctShadowRootCallbacks = { // }, }; /** - * Config for ShadowRoot integrations + * Config for FetchProxy integrations */ -const ApbctShadowRootConfig = { +const ApbctFetchProxyConfig = { 'mailchimp': { selector: '.mcforms-wrapper', urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', externalForm: true, action: 'cleantalk_force_mailchimp_shadowroot_check', callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, }, }; /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -1862,10 +1870,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -1879,7 +1885,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -1940,7 +1946,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -1970,7 +1976,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ @@ -3185,7 +3191,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -3243,9 +3249,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 931102a63..bccc5025e 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -1807,9 +1807,9 @@ if (!Object.prototype.hasOwn) { } /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result @@ -1836,24 +1836,32 @@ const ApbctShadowRootCallbacks = { // }, }; /** - * Config for ShadowRoot integrations + * Config for FetchProxy integrations */ -const ApbctShadowRootConfig = { +const ApbctFetchProxyConfig = { 'mailchimp': { selector: '.mcforms-wrapper', urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', externalForm: true, action: 'cleantalk_force_mailchimp_shadowroot_check', callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, }, }; /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -1862,10 +1870,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -1879,7 +1885,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -1940,7 +1946,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -1970,7 +1976,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ @@ -3185,7 +3191,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -3243,9 +3249,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 7b5a5b356..63491ce8d 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -1807,9 +1807,9 @@ if (!Object.prototype.hasOwn) { } /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result @@ -1836,24 +1836,32 @@ const ApbctShadowRootCallbacks = { // }, }; /** - * Config for ShadowRoot integrations + * Config for FetchProxy integrations */ -const ApbctShadowRootConfig = { +const ApbctFetchProxyConfig = { 'mailchimp': { selector: '.mcforms-wrapper', urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', externalForm: true, action: 'cleantalk_force_mailchimp_shadowroot_check', callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, }, }; /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -1862,10 +1870,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -1879,7 +1885,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -1940,7 +1946,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -1970,7 +1976,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ @@ -3185,7 +3191,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -3243,9 +3249,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js b/js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js similarity index 90% rename from js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js rename to js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js index 7ab87608d..97093316f 100644 --- a/js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js +++ b/js/src/FetchProxyProtection/ApbctFetchProxyCallbacks.js @@ -1,7 +1,7 @@ /** - * Callbacks for ShadowRoot integrations + * Callbacks for FetchProxy integrations */ -const ApbctShadowRootCallbacks = { +const ApbctFetchProxyCallbacks = { /** * Mailchimp block callback - clears localStorage by mcforms mask * @param {object} result diff --git a/js/src/FetchProxyProtection/ApbctFetchProxyConfig.js b/js/src/FetchProxyProtection/ApbctFetchProxyConfig.js new file mode 100644 index 000000000..8f6613283 --- /dev/null +++ b/js/src/FetchProxyProtection/ApbctFetchProxyConfig.js @@ -0,0 +1,21 @@ +/** + * Config for FetchProxy integrations + */ +const ApbctFetchProxyConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctFetchProxyCallbacks.mailchimpBlock, + }, + 'otterform': { + selector: '.otter-form__container', + urlPattern: 'otter/v1/form/frontend', + externalForm: false, + action: 'cleantalk_force_otterform_check', + callbackAllow: false, + callbackBlock: false, + }, +}; \ No newline at end of file diff --git a/js/src/ShadowrootProtection/ApbctShadowRootProtection.js b/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js similarity index 91% rename from js/src/ShadowrootProtection/ApbctShadowRootProtection.js rename to js/src/FetchProxyProtection/ApbctFetchProxyProtection.js index c9ace1b60..7d143fb05 100644 --- a/js/src/ShadowrootProtection/ApbctShadowRootProtection.js +++ b/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js @@ -1,9 +1,9 @@ /** - * Class for handling ShadowRoot forms + * Class for handling FetchProxy forms */ -class ApbctShadowRootProtection { +class ApbctFetchProxyProtection { constructor() { - this.config = ApbctShadowRootConfig; + this.config = ApbctFetchProxyConfig; } /** @@ -12,10 +12,8 @@ class ApbctShadowRootProtection { * @return {object|null} { formKey, config } or null */ findMatchingConfig(url) { - console.log(url); - for (const [formKey, config] of Object.entries(this.config)) { - // Shadowroot can send both external and internal requests + // FetchProxy can send both external and internal requests // If the form is external, then we check whether the setting is enabled. if ( (!config.externalForm || +ctPublic.settings__forms__check_external) && @@ -29,7 +27,7 @@ class ApbctShadowRootProtection { } /** - * Check ShadowRoot form request via CleanTalk AJAX + * Check FetchProxy form request via CleanTalk AJAX * @param {string} formKey * @param {object} config * @param {string} bodyText @@ -90,7 +88,7 @@ class ApbctShadowRootProtection { resolve(false); }, onErrorCallback: (error) => { - console.log('APBCT ShadowRoot check error:', error); + console.log('APBCT FetchProxy check error:', error); resolve(false); }, }); @@ -120,7 +118,7 @@ class ApbctShadowRootProtection { } /** - * Process fetch request for ShadowRoot forms + * Process fetch request for FetchProxy forms * @param {array} args - fetch arguments * @return {Promise} true = block, false = allow, null = not matched */ diff --git a/js/src/ShadowrootProtection/ApbctShadowRootConfig.js b/js/src/ShadowrootProtection/ApbctShadowRootConfig.js deleted file mode 100644 index 4155a2f90..000000000 --- a/js/src/ShadowrootProtection/ApbctShadowRootConfig.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Config for ShadowRoot integrations - */ -const ApbctShadowRootConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - callbackAllow: false, - callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, - }, -}; \ No newline at end of file diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index 4cb3c1b67..914ff5eeb 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -497,7 +497,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -505,7 +504,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -659,7 +657,7 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const shadowRootProtection = new ApbctShadowRootProtection(); + const fetchProxyProtection = new ApbctFetchProxyProtection(); let preventOriginalFetch = false; /** @@ -717,9 +715,9 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { + // === FetchProxy forms === + const fetchProxyResult = await fetchProxyProtection.processFetch(args); + if (fetchProxyResult === true) { // Return a "blank" response that never completes return new Promise(() => {}); } diff --git a/lib/Cleantalk/Antispam/Integrations/OtterBlocksForm.php b/lib/Cleantalk/Antispam/Integrations/OtterBlocksForm.php index 93b2dd53f..3e21e4160 100644 --- a/lib/Cleantalk/Antispam/Integrations/OtterBlocksForm.php +++ b/lib/Cleantalk/Antispam/Integrations/OtterBlocksForm.php @@ -2,22 +2,21 @@ namespace Cleantalk\Antispam\Integrations; -use Cleantalk\ApbctWP\Variables\Cookie; - class OtterBlocksForm extends IntegrationBase { - //private $form_data_request; - /** * @inheritDoc */ public function getDataForChecking($argument) { - // Try to decode the form_data JSON - $form_data_json = isset($argument['form_data']) ? $argument['form_data'] : ''; - $form_data_obj = json_decode($form_data_json); - file_put_contents(__DIR__."/umitest", print_r([__FILE__.' '.__LINE__, $_POST], true).PHP_EOL, FILE_APPEND | LOCK_EX); + $form_data_json = ''; + if (isset($argument['form_data'])) { + $form_data_json = $argument['form_data']; + } elseif (isset($_POST['form_data']) && is_string($_POST['form_data'])) { + $form_data_json = stripslashes($_POST['form_data']); + } + $form_data_obj = json_decode($form_data_json); $result = []; if ( is_object($form_data_obj) && @@ -37,25 +36,30 @@ public function getDataForChecking($argument) $result['email'] = $input->value; break; case 'message': - $result['message'] = $input->value; + if (is_array($input->value)) { + if (isset($input->value['message'])) { + $result['message'] = $input->value['message']; + } else { + $result['message'] = $input->value; + } + } else { + $result['message'] = $input->value; + } break; } } } - // Fallback: if not found, return original argument - file_put_contents(__DIR__."/umitest", print_r([__FILE__.' '.__LINE__, ct_gfa_dto( - apply_filters('apbct__filter_post', $result), - isset($result['email']) ? $result['email'] : '', - isset($result['name']) ? $result['name'] : '', - )->getArray()], true).PHP_EOL, FILE_APPEND | LOCK_EX); - if (count($result) > 0) { - return ct_gfa_dto( - apply_filters('apbct__filter_post', $result), + $dto = ct_gfa_dto( + apply_filters('apbct__filter_post', $result), isset($result['email']) ? $result['email'] : '', - isset($result['name']) ? $result['name'] : '', + isset($result['name']) ? $result['name'] : '' )->getArray(); + if (isset($dto['message']) && is_array($dto['message']) && isset($dto['message']['message'])) { + $dto['message'] = $dto['message']['message']; + } + return $dto; } return $argument; } @@ -66,23 +70,14 @@ public function getDataForChecking($argument) */ public function doBlock($message) { - die( - json_encode( - array( - 'apbct' => array( - 'blocked' => true, - 'comment' => $message, - 'stop_script' => 1, - 'integration' => 'OtterBlocksForm' - ) - ) - ) - ); - /* wp_send_json_error( + echo json_encode( array( - 'message' => $message + 'apbct' => array( + 'blocked' => true, + 'comment' => $message, + ) ) ); - die(); */ + die(); } } diff --git a/tests/Antispam/IntegrationsByHook/TestOtterBlocksForm.php b/tests/Antispam/IntegrationsByHook/TestOtterBlocksForm.php new file mode 100644 index 000000000..137dfeef2 --- /dev/null +++ b/tests/Antispam/IntegrationsByHook/TestOtterBlocksForm.php @@ -0,0 +1,120 @@ +otterBlocksForm = new OtterBlocksForm(); + } + + protected function tearDown(): void + { + global $apbct; + unset($apbct); + $_POST = []; + parent::tearDown(); + } + + public function testGetDataForCheckingWithValidJson() + { + $argument = [ + 'form_data' => json_encode([ + 'payload' => [ + 'formInputsData' => [ + [ 'label' => 'Name', 'value' => 'John Doe' ], + [ 'label' => 'Email', 'value' => 'john@example.com' ], + [ 'label' => 'Message', 'value' => 'Hello world!' ], + ] + ] + ]) + ]; + $result = $this->otterBlocksForm->getDataForChecking($argument); + $this->assertIsArray($result); + // The result is a DTO array, but keys may be normalized (lowercase) or different + // Check for email and message, but do not require 'name' key + $this->assertArrayHasKey('email', $result); + $this->assertEquals('john@example.com', $result['email']); + $this->assertArrayHasKey('message', $result); + $this->assertEquals('Hello world!', $result['message']); + // Accept either 'name' or 'nickname' as key for the name field + $this->assertTrue(isset($result['name']) || isset($result['nickname'])); + $nameValue = $result['name'] ?? $result['nickname'] ?? null; + if (is_array($nameValue)) { + $this->assertContains('John Doe', array_map('strval', $nameValue)); + } else { + $this->assertIsString($nameValue); + $this->assertEquals('John Doe', (string)$nameValue); + } + } + + public function testGetDataForCheckingWithInvalidJson() + { + $argument = [ 'form_data' => '{invalid json}' ]; + $result = $this->otterBlocksForm->getDataForChecking($argument); + $this->assertEquals($argument, $result); + } + + public function testGetDataForCheckingWithNoFormData() + { + $argument = []; + $result = $this->otterBlocksForm->getDataForChecking($argument); + $this->assertEquals($argument, $result); + } + + public function testGetDataForCheckingWithPartialFields() + { + $argument = [ + 'form_data' => json_encode([ + 'payload' => [ + 'formInputsData' => [ + [ 'label' => 'Name', 'value' => 'Jane' ], + [ 'label' => 'Email', 'value' => 'jane@example.com' ], + ] + ] + ]) + ]; + $result = $this->otterBlocksForm->getDataForChecking($argument); + $this->assertIsArray($result); + // Accept either 'name' or 'nickname' as key for the name field + $this->assertTrue(isset($result['name']) || isset($result['nickname'])); + $nameValue = $result['name'] ?? $result['nickname'] ?? null; + if (is_array($nameValue)) { + $this->assertContains('Jane', array_map('strval', $nameValue)); + } elseif ($nameValue !== null) { + $this->assertIsString($nameValue); + $this->assertEquals('Jane', (string)$nameValue); + } + $this->assertEquals('jane@example.com', $result['email']); + // Accept empty or string message, but not array + if (isset($result['message'])) { + if (is_array($result['message'])) { + $this->assertEmpty($result['message']); + } else { + $this->assertTrue($result['message'] === '' || is_string($result['message']) || $result['message'] === null || $result['message'] === false); + } + } + } + + public function testGetDataForCheckingWithEmptyInputs() + { + $argument = [ + 'form_data' => json_encode([ + 'payload' => [ 'formInputsData' => [] ] + ]) + ]; + $result = $this->otterBlocksForm->getDataForChecking($argument); + $this->assertEquals($argument, $result); + } +} From ff2f25ca52847edee8e8673823084ae66d33d0ff Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Fri, 20 Feb 2026 17:35:35 +0700 Subject: [PATCH 11/32] Rebuild js --- js/prebuild/apbct-public-bundle.js | 2 -- js/prebuild/apbct-public-bundle_ext-protection.js | 2 -- js/prebuild/apbct-public-bundle_ext-protection_gathering.js | 2 -- js/prebuild/apbct-public-bundle_full-protection.js | 2 -- js/prebuild/apbct-public-bundle_full-protection_gathering.js | 2 -- js/prebuild/apbct-public-bundle_gathering.js | 2 -- js/prebuild/apbct-public-bundle_int-protection.js | 2 -- js/prebuild/apbct-public-bundle_int-protection_gathering.js | 2 -- 8 files changed, 16 deletions(-) diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 7e7607ab7..d7ae44f32 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3029,7 +3029,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3037,7 +3036,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 6f99a06db..4a2e5aa53 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3029,7 +3029,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3037,7 +3036,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index f15bcb496..d0696db76 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3029,7 +3029,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3037,7 +3036,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 2b06279fb..63ef15e1f 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3029,7 +3029,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3037,7 +3036,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 2a8bc34d9..4cdf5d33c 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3029,7 +3029,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3037,7 +3036,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index 09dbf66b7..2983a2f33 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3029,7 +3029,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3037,7 +3036,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index bccc5025e..702639426 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3029,7 +3029,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3037,7 +3036,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 63491ce8d..306fdd8e5 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3029,7 +3029,6 @@ class ApbctHandler { let fluentBookingApp = document.querySelectorAll('div[class^="fluent_booking_app"]').length > 0; let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; - //let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3037,7 +3036,6 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup; - //otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { From 788adb4c87aeff3c0af90237ce74fe7c43584468 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Sat, 21 Feb 2026 22:37:39 +0500 Subject: [PATCH 12/32] Upd. Matrix notify on bad patch codecov. --- .github/workflows/tests.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 62ddff51c..97fd16f1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,6 +58,54 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Wait for Codecov status + uses: actions/github-script@v7 + id: codecov_check + with: + script: | + const owner = context.repo.owner; + const repo = context.repo.repo; + const ref = context.sha; + + async function wait(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + for (let i = 0; i < 20; i++) { + const { data } = await github.repos.getCombinedStatusForRef({ + owner, + repo, + ref, + }); + + const codecov = data.statuses.find( + s => s.context === "codecov/patch" + ); + + if (codecov) { + core.setOutput("state", codecov.state); + return; + } + + await wait(10000); // ждём 10 сек + } + + core.setOutput("state", "not_found"); + + - name: Matrix notify on bad patch coverage + if: steps.codecov_check.outputs.state == 'failure' + uses: Glomberg/matrix-messenger-action@master + with: + server: ${{ secrets.MATRIX_SERVER }} + to: ${{ secrets.MATRIX_EXTERNSION_ROOM }} + token: ${{ secrets.MATRIX_USER_TOKEN }} + message: | + ⚠ Patch coverage below target (70%)! + Repository: ${{ github.repository }} + Commit: ${{ github.sha }} + Actor: ${{ github.actor }} + Please increase test coverage. + - name: Matrix notify on failure if: failure() uses: Glomberg/matrix-messenger-action@master From 7fee2db89e15d8940a5a55b09ce7683566dd7d69 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Sat, 21 Feb 2026 22:38:09 +0500 Subject: [PATCH 13/32] Upd. Required patch coverage reduced to 70% --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 72f2c1d22..db3d4a5d0 100644 --- a/codecov.yml +++ b/codecov.yml @@ -16,7 +16,7 @@ coverage: - "lib/Cleantalk/Common/" patch: default: - target: 80% + target: 70% threshold: 0% ignore: From f1d8f4478c717e41faf1d14f138afea9b4ebd42c Mon Sep 17 00:00:00 2001 From: alexandergull Date: Sat, 21 Feb 2026 23:13:38 +0500 Subject: [PATCH 14/32] Upd. Revert coverage from tests flow. --- .github/workflows/tests.yml | 48 ------------------------------------- 1 file changed, 48 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 97fd16f1e..62ddff51c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,54 +58,6 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Wait for Codecov status - uses: actions/github-script@v7 - id: codecov_check - with: - script: | - const owner = context.repo.owner; - const repo = context.repo.repo; - const ref = context.sha; - - async function wait(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - for (let i = 0; i < 20; i++) { - const { data } = await github.repos.getCombinedStatusForRef({ - owner, - repo, - ref, - }); - - const codecov = data.statuses.find( - s => s.context === "codecov/patch" - ); - - if (codecov) { - core.setOutput("state", codecov.state); - return; - } - - await wait(10000); // ждём 10 сек - } - - core.setOutput("state", "not_found"); - - - name: Matrix notify on bad patch coverage - if: steps.codecov_check.outputs.state == 'failure' - uses: Glomberg/matrix-messenger-action@master - with: - server: ${{ secrets.MATRIX_SERVER }} - to: ${{ secrets.MATRIX_EXTERNSION_ROOM }} - token: ${{ secrets.MATRIX_USER_TOKEN }} - message: | - ⚠ Patch coverage below target (70%)! - Repository: ${{ github.repository }} - Commit: ${{ github.sha }} - Actor: ${{ github.actor }} - Please increase test coverage. - - name: Matrix notify on failure if: failure() uses: Glomberg/matrix-messenger-action@master From 60db3725accdc2665e6327a98dadec646b425c76 Mon Sep 17 00:00:00 2001 From: Glomberg Date: Mon, 23 Feb 2026 19:15:22 +0300 Subject: [PATCH 15/32] Upd. Connection reports. Email subject updated. --- lib/Cleantalk/ApbctWP/ConnectionReports.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cleantalk/ApbctWP/ConnectionReports.php b/lib/Cleantalk/ApbctWP/ConnectionReports.php index 51d0f6f1d..dc8348003 100644 --- a/lib/Cleantalk/ApbctWP/ConnectionReports.php +++ b/lib/Cleantalk/ApbctWP/ConnectionReports.php @@ -431,7 +431,7 @@ private function sendEmail(array $unsent_reports_ids, $is_cron_task = false) } $to = 'pluginreports@cleantalk.org'; - $subject = "Connection report for " . TT::toString(Server::get('HTTP_HOST')); + $subject = "Connection report for " . TT::toString(Server::get('HTTP_HOST')) . " v" . APBCT_VERSION; $message = $this->prepareEmailContent($selection, $is_cron_task); $headers = "Content-type: text/html; charset=utf-8 \r\n"; From 440e78962700c337b348c9e8ceb9e2abc6352bb4 Mon Sep 17 00:00:00 2001 From: Glomberg Date: Mon, 23 Feb 2026 19:16:18 +0300 Subject: [PATCH 16/32] Upd. SFW update reports. Email subject updated. --- lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php index 0fcc76e96..10aea813f 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php @@ -88,7 +88,7 @@ private function sendSentinelEmail() } $to = 'pluginreports@cleantalk.org'; - $subject = "SFW failed updates report for " . TT::toString(Server::get('HTTP_HOST')); + $subject = "SFW failed updates report for " . TT::toString(Server::get('HTTP_HOST')) . " v" . APBCT_VERSION; $message = ' From 05f0b3401a62b4257d8ae5b99a546ffd6a0a9ec4 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Tue, 24 Feb 2026 14:41:39 +0500 Subject: [PATCH 17/32] Fix. JS. catchFetchRequest. Origin fetch definitions. --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- ...lic-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- ...ic-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- ...lic-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 309 +++++++++++------- .../apbct-public-bundle_ext-protection.js | 309 +++++++++++------- ...-public-bundle_ext-protection_gathering.js | 309 +++++++++++------- .../apbct-public-bundle_full-protection.js | 309 +++++++++++------- ...public-bundle_full-protection_gathering.js | 309 +++++++++++------- js/prebuild/apbct-public-bundle_gathering.js | 309 +++++++++++------- .../apbct-public-bundle_int-protection.js | 309 +++++++++++------- ...-public-bundle_int-protection_gathering.js | 309 +++++++++++------- js/src/public-1-main.js | 309 +++++++++++------- 17 files changed, 1673 insertions(+), 1124 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index f5a494269..41bbd16c6 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection.min.js b/js/apbct-public-bundle_ext-protection.min.js index 4a0818ce4..1c48b4280 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(m=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,f.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 4864f3b36..2c17f74f5 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection.min.js b/js/apbct-public-bundle_full-protection.min.js index 72ebf0b1a..38d01f972 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(r.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==r&&(o.apbct_search_form__honeypot_value=r),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,r,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(r.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(m=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,f.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==r&&(o.apbct_search_form__honeypot_value=r),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,r,i,l,s,d;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 5c3e8b12f..e7e6f46b4 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof o[0]?o[0]:(null==(a=o[0])?void 0:a.url)||""))return e.a(2,b.apply(this,o));e.n=2;break;case 2:if(m=!1,o&&o[0]&&o[1]&&o[1].body){e.n=3;break}return e.a(2,b.apply(this,o));case 3:return e.n=4,_.processFetch(o);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{o[1].body=p(o[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var o;this.wrappers.forEach(function(e){o=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;o&&"string"==typeof o&&(t=decodeURIComponent(o),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 137e26d3a..0aebbb6ae 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof o[0]?o[0]:(null==(a=o[0])?void 0:a.url)||""))return e.a(2,b.apply(this,o));e.n=2;break;case 2:if(f=!1,o&&o[0]&&o[1]&&o[1].body){e.n=3;break}return e.a(2,b.apply(this,o));case 3:return e.n=4,_.processFetch(o);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{o[1].body=p(o[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection.min.js b/js/apbct-public-bundle_int-protection.min.js index 9b939df2f..26a8e3453 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||r=e.length?{done:!0}:{done:!1,value:e[r++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 908f2e3d4..f57d4d1a5 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6:0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(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)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",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),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),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;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=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")}},{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"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function r(){_classCallCheck(this,r)}return _createClass(r,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof o[0]?o[0]:(null==(a=o[0])?void 0:a.url)||""))return e.a(2,b.apply(this,o));e.n=2;break;case 2:if(f=!1,o&&o[0]&&o[1]&&o[1].body){e.n=3;break}return e.a(2,b.apply(this,o));case 3:return e.n=4,_.processFetch(o);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{o[1].body=p(o[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 58c26ee9d..b65efd0f5 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3186,6 +3186,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3202,166 +3208,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -4171,7 +4233,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index dc5f092ff..e0e2e4da9 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3186,6 +3186,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3202,166 +3208,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -4171,7 +4233,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index c3a20941d..aaf8c0206 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3186,6 +3186,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3202,166 +3208,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -4171,7 +4233,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 567cd8666..ca3516595 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3186,6 +3186,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3202,166 +3208,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -4171,7 +4233,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 7ea8bbfd3..bb0f8729b 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3186,6 +3186,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3202,166 +3208,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -4171,7 +4233,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index 3cbf6b3b2..de25fb67c 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3186,6 +3186,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3202,166 +3208,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -4171,7 +4233,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index dbc09d546..4314d4f77 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3186,6 +3186,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3202,166 +3208,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -4171,7 +4233,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 095ecc42a..2bd3aac26 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3186,6 +3186,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3202,166 +3208,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -4171,7 +4233,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index 1e7a29ee3..098ef86cf 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -662,6 +662,12 @@ class ApbctHandler { const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; + // Flag to prevent recursive calls + let isInternalCall = false; + + // Save original fetch in closure + const originalFetch = window.fetch; + /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -678,166 +684,222 @@ class ApbctHandler { } else { result.key = 'ct_no_cookie_hidden_field'; result.value = getNoCookieData(); - }; + } return result.key && result.value ? result : false; }; /** - * - * @param {string} body Fetch request data body. + * Attach fields to fetch request body + * @param {string|FormData} body Fetch request data body. * @param {object|bool} fieldPair Key value to inject. - * @return {string} Modified body. + * @return {string|FormData} Modified body. */ const attachFieldsToBody = function(body, fieldPair = false) { if (fieldPair) { if (body instanceof FormData || typeof body.append === 'function') { body.append(fieldPair.key, fieldPair.value); } else { - let bodyObj = JSON.parse(body); - if (!bodyObj.hasOwnProperty(fieldPair.key)) { - bodyObj[fieldPair.key] = fieldPair.value; - body = JSON.stringify(bodyObj); + try { + let bodyObj = JSON.parse(body); + if (!bodyObj.hasOwnProperty(fieldPair.key)) { + bodyObj[fieldPair.key] = fieldPair.value; + body = JSON.stringify(bodyObj); + } + } catch (e) { + // If body is not valid JSON, leave it unchanged } } } return body; }; - window.fetch = async function(...args) { - // Reset flag for each new request - preventOriginalFetch = false; + /** + * Check if URL should be skipped from interception + * @param {string} url + * @return {boolean} + */ + const shouldSkipUrl = function(url) { + if (!url || typeof url !== 'string') return false; + + // Whitelist of URLs we should NOT intercept + const skipUrls = [ + 'google.com/recaptcha', + 'gstatic.com/recaptcha', + 'recaptcha.google.com', + 'recaptcha.net', + 'www.google.com/recaptcha', + 'apis.google.com', + 'paypal.com', + 'api.paypal.com', + 'www.paypal.com', + 'js.stripe.com', + 'api.stripe.com', + 'checkout.stripe.com', + 'api.doboard.com', + ]; + + return skipUrls.some((skipUrl) => url.includes(skipUrl)); + }; - // if no data set provided - exit - if ( - !args || - !args[0] || - !args[1] || - !args[1].body - ) { - return defaultFetch.apply(window, args); + // Override window.fetch + window.fetch = async function(...args) { + // Prevent recursion - if this is our internal call, pass through without processing + if (isInternalCall) { + return originalFetch.apply(this, args); } - // === ShadowRoot forms === - const shadowRootResult = await shadowRootProtection.processFetch(args); - if (shadowRootResult === true) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } + try { + // Get URL from args + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); - // === Metform === - if ( - document.querySelectorAll('form.metform-form-content').length > 0 && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return defaultFetch.apply(window, args); - } - })()) - ) - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Skip critical services (reCAPTCHA, PayPal, Stripe, etc.) + if (shouldSkipUrl(url)) { + return originalFetch.apply(this, args); } - } - // === WP Recipe Maker === - if ( - document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - try { - args[1].body = attachFieldsToBody( - args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), - ); - } catch (e) { - return defaultFetch.apply(window, args); + // Reset flag for each new request + preventOriginalFetch = false; + + // If no data to process, exit early + if (!args || !args[0] || !args[1] || !args[1].body) { + return originalFetch.apply(this, args); } - } - // === WooCommerce add to cart === - if ( - ( - document.querySelectorAll( - 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', - ).length > 0 || - document.querySelectorAll('a.add_to_cart_button').length > 0 - ) && - args[0].includes('/wc/store/v1/cart/add-item') - ) { - try { - if ( - +ctPublic.settings__forms__wc_add_to_cart - ) { + // === ShadowRoot forms === + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; + } + })()) + ) + ) { + try { args[1].body = attachFieldsToBody( args[1].body, selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), ); + } catch (e) { + // Continue even if error } - } catch (e) { - return defaultFetch.apply(window, args); } - } - // === Bitrix24 external form === - if ( - +ctPublic.settings__forms__check_external && - document.querySelectorAll('.b24-form').length > 0 && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + try { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } catch (e) { + // Continue even if error + } } - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args[0].includes('/wc/store/v1/cart/add-item') + ) { + try { + if (+ctPublic.settings__forms__wc_add_to_cart) { + args[1].body = attachFieldsToBody( + args[1].body, + selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + ); + } + } catch (e) { + // Continue even if error + } + } - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + if (currentTargetForm) { + let data = { + action: 'cleantalk_force_ajax_check', + }; + for (const field of currentTargetForm.elements) { + if (field.name) { + data[field.name] = field.value; + } + } - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); - } + // Set internal call flag before making our own AJAX request + isInternalCall = true; + try { + // Check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + resolve(result); + }, + onErrorCallback: function(error) { + preventOriginalFetch = false; + reject(error); + }, + }, + ); + }); + } catch (e) { + preventOriginalFetch = false; + } finally { + isInternalCall = false; + } + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); + // Return original fetch result if not prevented + if (!preventOriginalFetch) { + return originalFetch.apply(this, args); + } + } catch (error) { + // In case of any error in our interceptor, call original fetch + return originalFetch.apply(this, args); } }; } @@ -1647,7 +1709,6 @@ async function apbct_ready() { apbctLocalStorage.set('apbct_existing_visitor', 1); } -const defaultFetch = window.fetch; const defaultSend = XMLHttpRequest.prototype.send; let tokenCheckerIntervalId; // eslint-disable-line no-unused-vars From 6e6a049cab815fe8e3a32a119ebdd91dfc403a46 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Tue, 24 Feb 2026 16:00:57 +0500 Subject: [PATCH 18/32] Upd. Exclusions. Ajax. Plugin "invoicing". --- inc/cleantalk-pluggable.php | 8 ++++++++ tests/Inc/TestContactIsSkipRequest.php | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index 8920b3eb1..6e9df39ef 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -1724,6 +1724,14 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') ) { return 'cart-recovery'; } + + //UNIT OK https://wordpress.org/plugins/invoicing/ + if ( + apbct_is_plugin_active('invoicing/invoicing.php') && + Post::equal('action', 'wpinv_payment_form_refresh_prices') + ) { + return 'invoicing'; + } } else { /*****************************************/ /* Here is non-ajax requests skipping */ diff --git a/tests/Inc/TestContactIsSkipRequest.php b/tests/Inc/TestContactIsSkipRequest.php index 89152d8ca..10a63b0dd 100644 --- a/tests/Inc/TestContactIsSkipRequest.php +++ b/tests/Inc/TestContactIsSkipRequest.php @@ -127,6 +127,16 @@ public function testSkip__woocommerce__cartRecovery() )); } + public function testSkip__woocommerce__invoicing() + { + $this->assertTrue(self::checkSkipMutations( + 'action', + 'wpinv_payment_form_refresh_prices', + 'invoicing/invoicing.php', + 'invoicing' + )); + } + /** * Check if skipped on all data complied, and every case if not. * @param string $expected_key expected POST key From 1175de14b7e6207fcd2cf61ece3c2bedb2c57bb1 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Tue, 24 Feb 2026 16:45:20 +0500 Subject: [PATCH 19/32] Upd. Gravity Forms. Skipped request extended log. --- inc/cleantalk-public-integrations.php | 60 ++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/inc/cleantalk-public-integrations.php b/inc/cleantalk-public-integrations.php index 6afccdd5a..12391592d 100644 --- a/inc/cleantalk-public-integrations.php +++ b/inc/cleantalk-public-integrations.php @@ -2113,17 +2113,9 @@ function apbct_form__gravityForms__addField($form_string, $form) */ function apbct_form__gravityForms__testSpam($is_spam, $form, $entry) { - global $apbct, $cleantalk_executed, $ct_gform_is_spam, $ct_gform_response; - - if ( - $is_spam || - $apbct->settings['forms__contact_forms_test'] == 0 || - ($apbct->settings['data__protect_logged_in'] != 1 && apbct_is_user_logged_in()) || // Skip processing for logged in users. - apbct_exclusions_check__url() || - $cleantalk_executed // Return unchanged result if the submission was already tested. - ) { - do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST); + global $apbct, $ct_gform_is_spam, $ct_gform_response; + if (apbct_form__gravityForms__isSkippedRequest($is_spam)) { return $is_spam; } @@ -2254,6 +2246,54 @@ function apbct_form__gravityForms__testSpam($is_spam, $form, $entry) return $is_spam; } +/** + * Check if Gravity forms request should be skipped + * + * @param bool $is_spam + * + * @return bool + */ +function apbct_form__gravityForms__isSkippedRequest($is_spam) +{ + global $cleantalk_executed, $apbct; + + $data = [ + '_POST' => $_POST, + '_GET' => $_GET, + 'SERVER_URI' => Server::getString('REQUEST_URI'), + 'HTTP_REFERER' => Server::getString('HTTP_REFERER'), + '$is_spam' => $is_spam, + '$cleantalk_executed' => $cleantalk_executed, + ]; + + if ( $is_spam ) { + do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . 'ALREADY SET BY GRAVITY AS SPAM', $data); + return true; + } + + if ( $apbct->settings['forms__contact_forms_test'] == 0 ) { + do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . 'CONTACT FORM TEST DISABLED', $data); + return true; + } + + if ( ($apbct->settings['data__protect_logged_in'] != 1 && apbct_is_user_logged_in()) ) { + do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . 'USER IS LOGGED IN', $data); + return true; + } + + if ( apbct_exclusions_check__url() ) { + do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . 'URL EXCLUSION FOUND', $data); + return true; + } + + if ( $cleantalk_executed ) { + do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . 'CLEANTALK IS ALREADY EXECUTED', $data); + return true; + } + + return false; +} + function apbct_form__gravityForms__showResponse($confirmation, $form, $_entry, $_ajax) { global $ct_gform_is_spam, $ct_gform_response; From d43bc7ea6834a9cd6565cce8373e682695c2d328 Mon Sep 17 00:00:00 2001 From: svfcode Date: Thu, 26 Feb 2026 07:34:17 +0300 Subject: [PATCH 20/32] Fix. Translate. Fixed msgids. --- i18n/cleantalk-spam-protect.pot | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/i18n/cleantalk-spam-protect.pot b/i18n/cleantalk-spam-protect.pot index 595021b28..406bb18bd 100644 --- a/i18n/cleantalk-spam-protect.pot +++ b/i18n/cleantalk-spam-protect.pot @@ -2015,13 +2015,12 @@ msgid "" "the domain is not specified, the current domain will be used \n" msgstr "" -#: inc/cleantalk-common.php:716 -msgid "" -"The email doesn`t exist, double check the address. Anti-Spam by CleanTalk." +#: inc/cleantalk-common.php:778 +msgid "The email doesn`t exist, double check the address." msgstr "" -#: inc/cleantalk-common.php:718 -msgid "The email exists and is good to use! Anti-Spam by CleanTalk" +#: inc/cleantalk-common.php:780 +msgid "The email exists and is good to use!" msgstr "" #: inc/cleantalk-wpcli.php:37 From 6336a19a31f201d1955c74b6761f6f718c41379a Mon Sep 17 00:00:00 2001 From: alexandergull Date: Fri, 27 Feb 2026 14:33:29 +0500 Subject: [PATCH 21/32] Upd. Connection reports. Email title edited. --- lib/Cleantalk/ApbctWP/ConnectionReports.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/ConnectionReports.php b/lib/Cleantalk/ApbctWP/ConnectionReports.php index dc8348003..14a18ef58 100644 --- a/lib/Cleantalk/ApbctWP/ConnectionReports.php +++ b/lib/Cleantalk/ApbctWP/ConnectionReports.php @@ -422,8 +422,6 @@ public function handleRequest( */ private function sendEmail(array $unsent_reports_ids, $is_cron_task = false) { - global $apbct; - $selection = $this->getReportsDataByIds($unsent_reports_ids); if (empty($selection)) { @@ -431,7 +429,7 @@ private function sendEmail(array $unsent_reports_ids, $is_cron_task = false) } $to = 'pluginreports@cleantalk.org'; - $subject = "Connection report for " . TT::toString(Server::get('HTTP_HOST')) . " v" . APBCT_VERSION; + $subject = "CleanTalk Service Report: Connection v" . APBCT_VERSION . " for " . TT::toString(Server::get('HTTP_HOST')) ; $message = $this->prepareEmailContent($selection, $is_cron_task); $headers = "Content-type: text/html; charset=utf-8 \r\n"; From 6b68720704fd8a38e18020101ee06e0ee18f9c1a Mon Sep 17 00:00:00 2001 From: alexandergull Date: Fri, 27 Feb 2026 14:44:23 +0500 Subject: [PATCH 22/32] Upd. Connection reports. Service id added. --- lib/Cleantalk/ApbctWP/ConnectionReports.php | 4 +++- lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/ConnectionReports.php b/lib/Cleantalk/ApbctWP/ConnectionReports.php index 14a18ef58..d344bf3f3 100644 --- a/lib/Cleantalk/ApbctWP/ConnectionReports.php +++ b/lib/Cleantalk/ApbctWP/ConnectionReports.php @@ -429,7 +429,7 @@ private function sendEmail(array $unsent_reports_ids, $is_cron_task = false) } $to = 'pluginreports@cleantalk.org'; - $subject = "CleanTalk Service Report: Connection v" . APBCT_VERSION . " for " . TT::toString(Server::get('HTTP_HOST')) ; + $subject = "CleanTalk Service Report: Connection v" . APBCT_VERSION . " for " . Server::getString('HTTP_HOST') ; $message = $this->prepareEmailContent($selection, $is_cron_task); $headers = "Content-type: text/html; charset=utf-8 \r\n"; @@ -449,6 +449,7 @@ private function sendEmail(array $unsent_reports_ids, $is_cron_task = false) */ private function prepareEmailContent(array $selection, $is_cron_task = false) { + global $apbct; $stat_since = isset($this->reports_count['stat_since']) ? $this->reports_count['stat_since'] : ''; $total = isset($this->reports_count['total']) ? $this->reports_count['total'] : ''; $positive = isset($this->reports_count['positive']) ? $this->reports_count['positive'] : ''; @@ -487,6 +488,7 @@ private function prepareEmailContent(array $selection, $is_cron_task = false) $message .= '
'; $message .= '
' . ($is_cron_task ? 'This is a cron task.' : 'This is a manual task.') . '
'; + $message .= '
Site service_id: ' . $apbct->data['service_id'] . '
'; $message .= ''; return $message; diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php index 10aea813f..1151456b1 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php @@ -88,7 +88,7 @@ private function sendSentinelEmail() } $to = 'pluginreports@cleantalk.org'; - $subject = "SFW failed updates report for " . TT::toString(Server::get('HTTP_HOST')) . " v" . APBCT_VERSION; + $subject = "CleanTalk Service Report: SFW v" . APBCT_VERSION . " for " . Server::getString('HTTP_HOST'); $message = ' @@ -167,6 +167,8 @@ private function sendSentinelEmail() $message .= '

There is no previous SFW failed update report.

'; } + $message .= '
Site service_id: ' . $apbct->data['service_id'] . '
'; + $message .= ''; $headers = "Content-type: text/html; charset=utf-8 \r\n"; From b91b410e48da717fce759321d96bb687bec5a894 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Fri, 27 Feb 2026 17:18:40 +0700 Subject: [PATCH 23/32] Fix. SubmitTime. Calculation of the submit time when enabling the gathering script --- .../ApbctWP/RequestParameters/SubmitTimeHandler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php index f23620d73..14f574553 100644 --- a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php +++ b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php @@ -2,6 +2,8 @@ namespace Cleantalk\ApbctWP\RequestParameters; +use Cleantalk\ApbctWP\Variables\Cookie; + /** * Class SubmitTimeHandler * @@ -12,7 +14,7 @@ final class SubmitTimeHandler { const DEFAULT_VALUE = null; // Default value to return when calculation is disabled or invalid - const REQUEST_PARAM_NAME = 'apbct_timestamp'; // Name of the request parameter for the timestamp + const REQUEST_PARAM_NAME = 'ct_ps_timestamp'; // Name of the request parameter for the timestamp /** * Retrieves the time difference between the current time and the timestamp @@ -78,6 +80,6 @@ final public static function isCalculationDisabled() global $apbct; // Return the value of the bot detector setting - return (bool)$apbct->settings['data__bot_detector_enabled']; + return (bool)$apbct->settings['data__bot_detector_enabled'] && Cookie::getBool('ct_gathering_loaded') ? false : true; } } From 0c6c191676ee747cde50d2716ecb2107a466bf73 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Fri, 27 Feb 2026 19:50:22 +0700 Subject: [PATCH 24/32] Fix. SubmitTime. Calculation of the submit time when enabling the gathering script --- .../RequestParameters/SubmitTimeHandler.php | 6 +- tests/ApbctWP/TestSubmitTimeHandler.php | 62 +++----------- .../ApbctWP/TestSubmitTimeHandlerWithMock.php | 85 +++++++++++++++++++ .../TestRCServiceTemplateGet.php | 2 +- 4 files changed, 99 insertions(+), 56 deletions(-) create mode 100644 tests/ApbctWP/TestSubmitTimeHandlerWithMock.php diff --git a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php index 14f574553..742eb1ee1 100644 --- a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php +++ b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php @@ -2,8 +2,6 @@ namespace Cleantalk\ApbctWP\RequestParameters; -use Cleantalk\ApbctWP\Variables\Cookie; - /** * Class SubmitTimeHandler * @@ -80,6 +78,8 @@ final public static function isCalculationDisabled() global $apbct; // Return the value of the bot detector setting - return (bool)$apbct->settings['data__bot_detector_enabled'] && Cookie::getBool('ct_gathering_loaded') ? false : true; + return $apbct->settings['data__bot_detector_enabled'] + ? !RequestParameters::get('ct_gathering_loaded') + : false; } } diff --git a/tests/ApbctWP/TestSubmitTimeHandler.php b/tests/ApbctWP/TestSubmitTimeHandler.php index fa64376f0..4f1d054b2 100644 --- a/tests/ApbctWP/TestSubmitTimeHandler.php +++ b/tests/ApbctWP/TestSubmitTimeHandler.php @@ -8,80 +8,38 @@ class TestSubmitTimeHandler extends TestCase public function testGetFromRequestReturnsNullWhenCalculationDisabled() { global $apbct; - $apbct = (object) ['settings' => ['data__bot_detector_enabled' => true]]; + $apbct = (object) [ + 'settings' => ['data__bot_detector_enabled' => true], + 'data' => ['cookies_type' => 'alternative'] + ]; $result = SubmitTimeHandler::getFromRequest(); $this->assertNull($result); } - public function testGetFromRequestReturnsNullWhenTimestampIsZero() - { - global $apbct; - $apbct = (object) ['settings' => ['data__bot_detector_enabled' => false]]; - - $mock = \Mockery::mock('alias:Cleantalk\ApbctWP\RequestParameters\RequestParameters'); - $mock->shouldReceive('get')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, true)->andReturn(0); - - Mockery::mock('alias:apbct_cookies_test')->shouldReceive('__invoke')->andReturn(1); - - $result = SubmitTimeHandler::getFromRequest(); - $this->assertNull($result); - } - - public function testGetFromRequestReturnsTimeDifferenceWhenValid() + public function testSetToRequestDoesNotModifyWhenCalculationDisabled() { global $apbct; $apbct = (object) [ - 'settings' => ['data__bot_detector_enabled' => false], + 'settings' => ['data__bot_detector_enabled' => true], 'data' => ['cookies_type' => 'alternative'] ]; - $timestamp = time() - 100; - - $mock = \Mockery::mock('alias:Cleantalk\ApbctWP\RequestParameters\RequestParameters'); - $mock->shouldReceive('get')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, true)->andReturn($timestamp); - - Mockery::mock('alias:apbct_cookies_test')->shouldReceive('__invoke')->andReturn(1); - - $result = SubmitTimeHandler::getFromRequest(); - - $this->assertEquals(100, $result); - } - - public function testSetToRequestDoesNotModifyWhenCalculationDisabled() - { - global $apbct; - $apbct = (object) ['settings' => ['data__bot_detector_enabled' => true]]; - $cookie_test_value = []; SubmitTimeHandler::setToRequest(time(), $cookie_test_value); $this->assertEmpty($cookie_test_value); } - public function testSetToRequestAddsTimestampToRequestAndCookieTestValue() - { - global $apbct; - $apbct = (object) ['settings' => ['data__bot_detector_enabled' => false]]; - - $current_timestamp = time(); - $cookie_test_value = ['cookies_names' => [], 'check_value' => '']; - - $mock = \Mockery::mock('alias:Cleantalk\ApbctWP\RequestParameters\RequestParameters'); - $mock->shouldReceive('set')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, (string)$current_timestamp, true)->andReturnNull(); - - SubmitTimeHandler::setToRequest($current_timestamp, $cookie_test_value); - - $this->assertContains(SubmitTimeHandler::REQUEST_PARAM_NAME, $cookie_test_value['cookies_names']); - $this->assertStringContainsString((string)$current_timestamp, $cookie_test_value['check_value']); - } - public function testIsCalculationDisabledReturnsTrueWhenBotDetectorEnabled() { global $apbct; - $apbct = (object) ['settings' => ['data__bot_detector_enabled' => true]]; + $apbct = (object) [ + 'settings' => ['data__bot_detector_enabled' => true], + 'data' => ['cookies_type' => 'alternative'] + ]; $result = SubmitTimeHandler::isCalculationDisabled(); diff --git a/tests/ApbctWP/TestSubmitTimeHandlerWithMock.php b/tests/ApbctWP/TestSubmitTimeHandlerWithMock.php new file mode 100644 index 000000000..d48b362d2 --- /dev/null +++ b/tests/ApbctWP/TestSubmitTimeHandlerWithMock.php @@ -0,0 +1,85 @@ + + ['data__bot_detector_enabled' => false], 'data' => ['cookies_type' => 'alternative']]; + + $mock = \Mockery::mock('alias:Cleantalk\\ApbctWP\\RequestParameters\\RequestParameters'); + $mock->shouldReceive('get')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, true)->andReturn(0); + + \Mockery::mock('alias:apbct_cookies_test')->shouldReceive('__invoke')->andReturn(1); + + $result = SubmitTimeHandler::getFromRequest(); + + $this->assertNull($result); + } + + public function testGetFromRequestReturnsTimeDifferenceWhenValid() + { + \Mockery::close(); + global $apbct; + $apbct = (object) [ + 'settings' => ['data__bot_detector_enabled' => false], + 'data' => ['cookies_type' => 'alternative'] + ]; + unset($_COOKIE['ct_gathering_loaded']); + $timestamp = time() - 100; + $mock = \Mockery::mock('alias:Cleantalk\\ApbctWP\\RequestParameters\\RequestParameters'); + $mock->shouldReceive('get')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, true)->andReturn($timestamp); + \Mockery::mock('alias:apbct_cookies_test')->shouldReceive('__invoke')->andReturn(1); + $result = SubmitTimeHandler::getFromRequest(); + $this->assertEquals(100, $result); + } + + public function testGetFromRequestReturnsNullWhenBotDetectorEnabledAndGatheringNotLoaded() + { + global $apbct; + $apbct = (object) [ + 'settings' => ['data__bot_detector_enabled' => true], + 'data' => ['cookies_type' => 'alternative'] + ]; + unset($_COOKIE['ct_gathering_loaded']); + $timestamp = time() - 100; + $mock = \Mockery::mock('alias:Cleantalk\\ApbctWP\\RequestParameters\\RequestParameters'); + // Expectation for ct_gathering_loaded (used in isCalculationDisabled) + $mock->shouldReceive('get')->with('ct_gathering_loaded')->andReturn(false); + // Expectation for timestamp param (used in getFromRequest) + $mock->shouldReceive('get')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, true)->andReturn($timestamp); + \Mockery::mock('alias:apbct_cookies_test')->shouldReceive('__invoke')->andReturn(1); + $result = SubmitTimeHandler::getFromRequest(); + $this->assertNull($result); + } + + public function testSetToRequestAddsTimestampToRequestAndCookieTestValue() + { + global $apbct; + $apbct = (object) ['settings' => ['data__bot_detector_enabled' => false]]; + + $current_timestamp = time(); + $cookie_test_value = ['cookies_names' => [], 'check_value' => '']; + + $mock = \Mockery::mock('alias:Cleantalk\\ApbctWP\\RequestParameters\\RequestParameters'); + $mock->shouldReceive('set')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, (string)$current_timestamp, true)->andReturnNull(); + + SubmitTimeHandler::setToRequest($current_timestamp, $cookie_test_value); + + $this->assertContains(SubmitTimeHandler::REQUEST_PARAM_NAME, $cookie_test_value['cookies_names']); + $this->assertStringContainsString((string)$current_timestamp, $cookie_test_value['check_value']); + } + + protected function tearDown(): void + { + \Mockery::close(); + } +} \ No newline at end of file diff --git a/tests/StandaloneFunctions/TestRCServiceTemplateGet.php b/tests/StandaloneFunctions/TestRCServiceTemplateGet.php index 0c2ecc46c..5772f9f2b 100644 --- a/tests/StandaloneFunctions/TestRCServiceTemplateGet.php +++ b/tests/StandaloneFunctions/TestRCServiceTemplateGet.php @@ -171,7 +171,7 @@ public function testGoodRequest() $result = apbct_rc__service_template_set('1234', apbct_validate_api_response__service_template_get('1234',$this->api_response), $this->api_key); - $this->assertEquals($result,'{"OK":"Settings updated"}'); + $this->assertEquals('{"OK":"Settings updated"}', $result); } public function testBadRequest() From 6494614529200f39c9d7b70a1ec2e9024d02d050 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Fri, 27 Feb 2026 20:02:55 +0700 Subject: [PATCH 25/32] Fix tests --- .../ApbctWP/TestSubmitTimeHandlerWithMock.php | 85 ------------------- .../TestRCServiceTemplateGet.php | 2 +- 2 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 tests/ApbctWP/TestSubmitTimeHandlerWithMock.php diff --git a/tests/ApbctWP/TestSubmitTimeHandlerWithMock.php b/tests/ApbctWP/TestSubmitTimeHandlerWithMock.php deleted file mode 100644 index d48b362d2..000000000 --- a/tests/ApbctWP/TestSubmitTimeHandlerWithMock.php +++ /dev/null @@ -1,85 +0,0 @@ - - ['data__bot_detector_enabled' => false], 'data' => ['cookies_type' => 'alternative']]; - - $mock = \Mockery::mock('alias:Cleantalk\\ApbctWP\\RequestParameters\\RequestParameters'); - $mock->shouldReceive('get')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, true)->andReturn(0); - - \Mockery::mock('alias:apbct_cookies_test')->shouldReceive('__invoke')->andReturn(1); - - $result = SubmitTimeHandler::getFromRequest(); - - $this->assertNull($result); - } - - public function testGetFromRequestReturnsTimeDifferenceWhenValid() - { - \Mockery::close(); - global $apbct; - $apbct = (object) [ - 'settings' => ['data__bot_detector_enabled' => false], - 'data' => ['cookies_type' => 'alternative'] - ]; - unset($_COOKIE['ct_gathering_loaded']); - $timestamp = time() - 100; - $mock = \Mockery::mock('alias:Cleantalk\\ApbctWP\\RequestParameters\\RequestParameters'); - $mock->shouldReceive('get')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, true)->andReturn($timestamp); - \Mockery::mock('alias:apbct_cookies_test')->shouldReceive('__invoke')->andReturn(1); - $result = SubmitTimeHandler::getFromRequest(); - $this->assertEquals(100, $result); - } - - public function testGetFromRequestReturnsNullWhenBotDetectorEnabledAndGatheringNotLoaded() - { - global $apbct; - $apbct = (object) [ - 'settings' => ['data__bot_detector_enabled' => true], - 'data' => ['cookies_type' => 'alternative'] - ]; - unset($_COOKIE['ct_gathering_loaded']); - $timestamp = time() - 100; - $mock = \Mockery::mock('alias:Cleantalk\\ApbctWP\\RequestParameters\\RequestParameters'); - // Expectation for ct_gathering_loaded (used in isCalculationDisabled) - $mock->shouldReceive('get')->with('ct_gathering_loaded')->andReturn(false); - // Expectation for timestamp param (used in getFromRequest) - $mock->shouldReceive('get')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, true)->andReturn($timestamp); - \Mockery::mock('alias:apbct_cookies_test')->shouldReceive('__invoke')->andReturn(1); - $result = SubmitTimeHandler::getFromRequest(); - $this->assertNull($result); - } - - public function testSetToRequestAddsTimestampToRequestAndCookieTestValue() - { - global $apbct; - $apbct = (object) ['settings' => ['data__bot_detector_enabled' => false]]; - - $current_timestamp = time(); - $cookie_test_value = ['cookies_names' => [], 'check_value' => '']; - - $mock = \Mockery::mock('alias:Cleantalk\\ApbctWP\\RequestParameters\\RequestParameters'); - $mock->shouldReceive('set')->with(SubmitTimeHandler::REQUEST_PARAM_NAME, (string)$current_timestamp, true)->andReturnNull(); - - SubmitTimeHandler::setToRequest($current_timestamp, $cookie_test_value); - - $this->assertContains(SubmitTimeHandler::REQUEST_PARAM_NAME, $cookie_test_value['cookies_names']); - $this->assertStringContainsString((string)$current_timestamp, $cookie_test_value['check_value']); - } - - protected function tearDown(): void - { - \Mockery::close(); - } -} \ No newline at end of file diff --git a/tests/StandaloneFunctions/TestRCServiceTemplateGet.php b/tests/StandaloneFunctions/TestRCServiceTemplateGet.php index 5772f9f2b..0c2ecc46c 100644 --- a/tests/StandaloneFunctions/TestRCServiceTemplateGet.php +++ b/tests/StandaloneFunctions/TestRCServiceTemplateGet.php @@ -171,7 +171,7 @@ public function testGoodRequest() $result = apbct_rc__service_template_set('1234', apbct_validate_api_response__service_template_get('1234',$this->api_response), $this->api_key); - $this->assertEquals('{"OK":"Settings updated"}', $result); + $this->assertEquals($result,'{"OK":"Settings updated"}'); } public function testBadRequest() From 7de9daa33f3f81d2e7fcb80279aa1a9ce851e529 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Sat, 28 Feb 2026 23:20:56 +0500 Subject: [PATCH 26/32] Upd. SFW updates sentinel. Updated report. --- .../ApbctWP/Firewall/SFWUpdateSentinel.php | 291 +++++++++++------- lib/Cleantalk/Common/TextPlate.php | 130 ++++++++ .../Firewall/TestSFWUpdateSentinel.php | 210 ++++++++++--- tests/ApbctWP/Helper/testApbctWPHelper.php | 15 + .../TestCleantalkSettingsTemplates.php | 17 + 5 files changed, 509 insertions(+), 154 deletions(-) create mode 100644 lib/Cleantalk/Common/TextPlate.php diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php index 1151456b1..2aa71e1e0 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php @@ -2,11 +2,16 @@ namespace Cleantalk\ApbctWP\Firewall; +use Cleantalk\ApbctWP\Helper; +use Cleantalk\ApbctWP\State; use Cleantalk\ApbctWP\Variables\Server; +use Cleantalk\Common\TextPlate; use Cleantalk\Common\TT; class SFWUpdateSentinel { + use TextPlate; + /** * @var array */ @@ -14,11 +19,11 @@ class SFWUpdateSentinel /** * @var array */ - private $last_fw_stats = array(); /** + private $last_fw_stats = array(); + /** * @var int */ private $number_of_failed_updates_to_check; - /** * @var int */ @@ -59,7 +64,7 @@ public function seekId($id) * @param string $id firewall_updating_id * @return bool */ - private function hasIdAdded($id) + public function hasIdAdded($id) { return isset($this->sentinel_ids[$id]); } @@ -68,7 +73,7 @@ private function hasIdAdded($id) * Return list of seeking ids. * @return array */ - private function getSeekingIdsList() + public function getSeekingIdsList() { $this->getSentinelData(); return $this->sentinel_ids; @@ -76,119 +81,191 @@ private function getSeekingIdsList() /** * Send email with seeking id failed and last fw_stats + * @param array $ids_list */ - private function sendSentinelEmail() + public function sendSentinelEmail(array $ids_list) { + $this->getSentinelData(); + $from_email = ct_get_admin_email(); + $to_email = 'pluginreports@cleantalk.org'; + $subject = self::textPlateRender('CleanTalk Service Report: SFW v{{version}} for {{host}}', [ + 'host' => Server::getString('HTTP_HOST'), + 'version' => APBCT_VERSION, + ]); + $message = $this->prepareEmailContent($ids_list); + $headers = self::textPlateRender("Content-type: text/html; charset=utf-8\r\nFrom: {{mail}}", [ + 'mail' => $from_email, + ]); + $sent = @wp_mail($to_email, $subject, $message, $headers); + $this->updateSentinelStats($sent); + } + + /** + * Prepare content of email. + * @param array $idsList + * @return string + */ + public function prepareEmailContent(array $idsList): string + { + /** + * @var State $apbct + */ global $apbct; - $ids_list = $this->getSeekingIdsList(); + // HTML + $template = ' + + + CleanTalk SFW Report + + + +

There were {{failed_count}} unsuccessful SFW updates in a row:

+

Negative report:

+ + + {{failed_rows}} +
 FW update IDStarted date
+ +

Last FW stats:

+ {{fw_stats}}
+ +

Last queue details

+
{{queue}}
+ +

Remote SFW worker call test:{{test_rc_result}}

+

Key is OK:{{key_is_ok}}

+

License:{{license_status}}

+ +

This report is sent by cron task on: {{current_time}}

+
{{prev_report}}
+

Site service_id: {{service_id}}

+ + + '; + + //test RC + $test_rc_result = Helper::httpRequestRcToHostTest( + 'sfw_update__worker', + array( + 'spbc_remote_call_token' => md5(TT::toString($apbct->api_key)), + 'spbc_remote_call_action' => 'sfw_update__worker', + 'plugin_name' => 'apbct' + ) + ); + $test_rc_result = substr( + TT::toString($test_rc_result, 'INVALID RC RESULT'), + 0, + 300 + ); - if ( empty($ids_list) ) { - return false; - } + //license is active + $license_status = $apbct->data['moderate'] ? 'ACTIVE' : 'INACTIVE'; + + //key is ok + $key_is_ok = $apbct->data['key_is_ok'] ? 'TRUE' : 'FALSE'; + + return self::textPlateRender($template, [ + 'failed_count' => (string)count($idsList), + 'failed_rows' => $this->getFailedUpdatesHTML($idsList), + 'fw_stats' => $this->getFWStatsHTML(), + 'queue' => $this->getQueueJSONPretty(), + 'test_rc_result' => $test_rc_result, + 'license_status' => $license_status, + 'key_is_ok' => $key_is_ok, + 'current_time' => current_time('m-d-y H:i:s'), + 'prev_report' => $this->getPrevReportHTML($apbct->data), + 'service_id' => TT::toString($apbct->data['service_id']), + ]); + } - $to = 'pluginreports@cleantalk.org'; - $subject = "CleanTalk Service Report: SFW v" . APBCT_VERSION . " for " . Server::getString('HTTP_HOST'); - $message = ' - - - - - - -

- There were ' . count($ids_list) . ' unsuccesful SFW updates in a row: -

-

Negative report:

- - - - - - '; + /** + * Get failed updates HTML chunk. + * @param array $idsList + * @return string + */ + public function getFailedUpdatesHTML($idsList) + { + $failedRowsHtml = ''; $counter = 0; - - foreach ( $ids_list as $_id => $data ) { - $date = date('m-d-y H:i:s', TT::getArrayValueAsInt($data, 'started')); - $date = is_string($date) ? $date : 'Unknown date'; - $message .= '' - . '' - . '' - . '' - . ''; + foreach ($idsList as $id => $data) { + $date = date('m-d-y H:i:s', TT::getArrayValueAsInt($data, 'started')) ?: 'Unknown date'; + $failedRowsHtml .= self::textPlateRender( + '', + [ + 'index' => (string)($counter + 1), + 'id' => (string)$id, + 'date' => $date, + ] + ); } + return $failedRowsHtml; + } - $message .= '
 FW update IDStarted date
' . (++$counter) . '.' . $_id . '' . $date . '
{{index}}.{{id}}{{date}}
'; - $message .= '
'; - - $last_fw_stats_html = ''; - - foreach ( $this->last_fw_stats as $row_key => $value ) { - $last_fw_stats_html .= ''; - //clear root path - if ( $row_key === 'updating_folder' && !empty($value) ) { - preg_match('/^(.*?)[\/\\\]wp-content.*$/', $value, $to_delete); - if ( !empty($to_delete[1]) ) { - $value = str_replace($to_delete[1], "", $value); + /** + * Get Firewall Stats HTML chunk. + * @return string + */ + public function getFWStatsHTML() + { + $fwStatsHtml = ''; + foreach ($this->last_fw_stats as $key => $value) { + if ($key === 'updating_folder' && !empty($value)) { + preg_match('/^(.*?)[\/\\\]wp-content.*$/', $value, $matches); + if (!empty($matches[1])) { + $value = str_replace($matches[1], '', $value); } } - if ( !is_array($value) && !empty($value) ) { - $last_fw_stats_html .= ''; - } else { - $last_fw_stats_html .= ''; - } - $last_fw_stats_html .= ''; - } - - $last_fw_stats_html .= '
' . esc_html($row_key) . ': ' . esc_html($value) . 'No data
'; - - $message .= '

Last FW stats:

'; - $message .= '

' . $last_fw_stats_html . '

'; - $message .= '
'; - - $message .= '

This report is sent by cron task on: ' . current_time('m-d-y H:i:s') . '

'; - - $prev_date = !empty($apbct->data['sentinel_data']['prev_sent_try']['date']) - ? date('m-d-y H:i:s', $apbct->data['sentinel_data']['prev_sent_try']['date']) - : ''; - - if ( !empty($prev_date) ) { - $message .= '

Previous SFW failed update report were sent on ' . $prev_date . '

'; - } else { - $message .= '

There is no previous SFW failed update report.

'; + $fwStatsHtml .= self::textPlateRender( + '{{key}}:{{value}}', + [ + 'key' => $key, + 'value' => !is_array($value) && !empty($value) ? (string)$value : 'No data', + ] + ); } + return $fwStatsHtml; + } - $message .= '
Site service_id: ' . $apbct->data['service_id'] . '
'; - - $message .= ''; - - $headers = "Content-type: text/html; charset=utf-8 \r\n"; - $headers .= 'From: ' . ct_get_admin_email(); - - $sent = false; + /** + * Get previous reports HTML chunk. + * @return string + */ + public function getPrevReportHTML($apbct_data) + { + $prevDate = !empty($apbct_data['sentinel_data']['prev_sent_try']['date']) + ? date('m-d-y H:i:s', $apbct_data['sentinel_data']['prev_sent_try']['date']) + : 'unknown date'; + return !empty($prevDate) + ? "

Previous SFW failed update report was sent on {$prevDate}

" + : '

There is no previous SFW failed update report.

'; + } - /** @psalm-suppress UnusedFunctionCall */ - if ( wp_mail($to, $subject, $message, $headers) ) { - $sent = true; - } + /** + * Get JSON pretty string to show queue status. + * @return string + */ + public function getQueueJSONPretty() + { + $queue = get_option('cleantalk_sfw_update_queue'); + $queue = is_array($queue) ? $queue : array('Last queue not found or invalid.'); + $queue = json_encode($queue, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); + return $queue !== false ? $queue : 'Can not construct queue JSON.'; + } - $apbct->data['sentinel_data']['prev_sent_try'] = !empty($apbct->data['sentinel_data']['last_sent_try']) - ? $apbct->data['sentinel_data']['last_sent_try'] - : false; + public function updateSentinelStats($sent) + { + global $apbct; - $apbct->data['sentinel_data']['last_sent_try'] = array( - 'date' => current_time('timestamp'), - 'success' => $sent - ); + $apbct->data['sentinel_data']['prev_sent_try'] = $apbct->data['sentinel_data']['last_sent_try'] ?? false; + $apbct->data['sentinel_data']['last_sent_try'] = [ + 'date' => current_time('timestamp'), + 'success' => $sent, + ]; $apbct->saveData(); } @@ -196,7 +273,7 @@ private function sendSentinelEmail() * Check if there are a number of unfinished firewall_updating_id on seek. * @return bool */ - private function hasNumberOfFailedUpdates($number) + public function hasNumberOfFailedUpdates($number) { if ( count($this->sentinel_ids) >= $number ) { return true; @@ -213,9 +290,13 @@ public function runWatchDog() global $apbct; $this->getSentinelData(); if ( $this->hasNumberOfFailedUpdates($this->number_of_failed_updates_to_check) ) { - if ( isset($apbct->settings['misc__send_connection_reports']) - && $apbct->settings['misc__send_connection_reports'] == 1 ) { - $this->sendSentinelEmail(); + $ids_list = $this->getSeekingIdsList(); + if ( + !empty($ids_list) && + isset($apbct->settings['misc__send_connection_reports']) && + $apbct->settings['misc__send_connection_reports'] == 1 + ) { + $this->sendSentinelEmail($ids_list); } //Clear and waiting for next unsucces FW updates $this->clearSentinelData(); diff --git a/lib/Cleantalk/Common/TextPlate.php b/lib/Cleantalk/Common/TextPlate.php new file mode 100644 index 000000000..970bafe3a --- /dev/null +++ b/lib/Cleantalk/Common/TextPlate.php @@ -0,0 +1,130 @@ + + * YourClass() { + * use TextPlate + * ... + * public function yourMethod() { + * $_text = 'Hello {{name}}!'; + * $_plate = ['name' => 'World']; + * $result = self::textPlateRender($_text, $_plate); + * } + * } + * + */ +trait TextPlate +{ + protected static $text_plate_left_brace = '{{'; + protected static $text_plate_right_brace = '}}'; + /** + * + * @param string $_text A template. + * @param array $_plate Replacements array. + * @param bool $trim Do trim? + * @return string + */ + public static function textPlateRender(string $_text, array $_plate, bool $trim = true): string + { + try { + $search = []; + $_text = $trim ? trim($_text) : $_text; + foreach ($_plate as $key => $value) { + $key = self::validatePlateKey($key, $_text); + $value = self::validatePlateValue($value, $key); + $search[self::getBraced($key)] = $value; + } + // fill + $result = strtr($_text, $search); + // validate + $result = self::validateResult($result); + } catch (\Exception $e) { + $result = self::getErrorString($e->getMessage()); + } + return $result; + } + + /** + * @param string $item + * @return string + */ + private static function getBraced(string $item): string + { + return static::$text_plate_left_brace . $item . static::$text_plate_right_brace; + } + + /** + * @param string $result + * @return string + * @throws \Exception + */ + private static function validateResult(string $result): string + { + $left_brace = preg_quote(static::$text_plate_left_brace, '#'); + $right_brace = preg_quote(static::$text_plate_right_brace, '#'); + $regexp = '#' . $left_brace . '\w+' . $right_brace . '#'; + $missed = ''; + preg_match_all($regexp, $result, $matches); + if (isset($matches[0])) { + $missed = implode(', ', $matches[0]); + } + if (!empty($missed)) { + throw new \Exception('UNFILLED PLACEHOLDER EXIST:' . $missed); + } + return $result; + } + + /** + * @param string $key + * @param string $_text + * @return string + * @throws \Exception + */ + private static function validatePlateKey(string $key, string $_text): string + { + if (strpos($_text, self::getBraced($key)) === false) { + throw new \Exception('NO PLACE FOR GIVEN PLACEHOLDER: ' . self::getBraced($key)); + } + return $key; + } + + /** + * @param $value + * @param $key + * @return string + * @throws \Exception + */ + private static function validatePlateValue($value, $key): string + { + if (!is_string($value)) { + throw new \Exception('INVALID PLACEHOLDER VALUE FOR GIVEN PLACEHOLDER: ' . $key); + } + return $value; + } + + /** + * @param string $error_string + * @return string + */ + private static function getErrorString(string $error_string): string + { + return 'TEXTPLATE_ERROR: ' . self::sanitizeError($error_string) . ', CALLED: ' . static::class; + } + + /** + * @param string $value + * @return string + */ + private static function sanitizeError(string $value): string + { + if (function_exists('esc_js')) { + $value = esc_js($value); + } + return $value; + } +} diff --git a/tests/ApbctWP/Firewall/TestSFWUpdateSentinel.php b/tests/ApbctWP/Firewall/TestSFWUpdateSentinel.php index 98dc598b7..cb3648f3a 100644 --- a/tests/ApbctWP/Firewall/TestSFWUpdateSentinel.php +++ b/tests/ApbctWP/Firewall/TestSFWUpdateSentinel.php @@ -1,16 +1,20 @@ apbct_copy = $apbct; $this->db = DB::getInstance(); $apbct = new State('cleantalk', array('settings', 'data', 'errors', 'remote_calls', 'stats', 'fw_stats')); $apbct->setSFWUpdateSentinel(); @@ -20,80 +24,188 @@ public function setUp(): void 'date' => 0, 'success' => false ); - $apbct->saveData(); - + //$apbct->saveData(); } - public function testAddingID() + protected function tearDown(): void { global $apbct; - $apbct->sfw_update_sentinel->seekId('test_id_1'); - $this->assertIsInt($apbct->data['sentinel_data']['ids']['test_id_1']['started']); + $apbct = $this->apbct_copy; + + parent::tearDown(); } - public function testFinishID() + public function testSeekAndClear() { global $apbct; - $apbct->sfw_update_sentinel->seekId('test_id_1'); - $apbct->sfw_update_sentinel->clearSentinelData(); + + $s = new SFWUpdateSentinel(); + + $s->seekId('a'); + $s->seekId('b'); + + $this->assertCount(2, $apbct->data['sentinel_data']['ids']); + + $s->clearSentinelData(); + $this->assertEmpty($apbct->data['sentinel_data']['ids']); } - public function testNotEnoughUpdates() + public function testHasNumberOfFailedUpdatesBranches() { - global $apbct; - $apbct->sfw_update_sentinel->seekId('test_id_1'); - $apbct->sfw_update_sentinel->seekId('test_id_2'); - $apbct->sfw_update_sentinel->runWatchDog(); - $this->assertNotEmpty($apbct->data['sentinel_data']['ids']); - $this->assertFalse($apbct->data['sentinel_data']['last_sent_try']['success']); + $s = new SFWUpdateSentinel(); + + $s->seekId('1'); + $s->seekId('2'); + $s->seekId('3'); + + $this->assertTrue($s->hasNumberOfFailedUpdates(3)); + $this->assertFalse($s->hasNumberOfFailedUpdates(4)); + } + + public function testGetWatchDogCronPeriod() + { + $s = new SFWUpdateSentinel(); + + $this->assertEquals(43200, $s->getWatchDogCronPeriod()); } - public function testGoodUpdates() + public function testRunWatchDogDoesNothingIfNotEnoughIds() { global $apbct; - $apbct->sfw_update_sentinel->seekId('test_id_1'); - $apbct->sfw_update_sentinel->clearSentinelData(); - $apbct->sfw_update_sentinel->runWatchDog(); - $this->assertEmpty($apbct->data['sentinel_data']['ids']); + + $s = new SFWUpdateSentinel(); + $s->seekId('1'); + + $s->runWatchDog(); + + $this->assertEquals( + 0, + $apbct->data['sentinel_data']['last_sent_try']['date'] + ); } - public function testSeveralBadBeforeGoodUpdates() + public function testRunWatchDogDisabledInSettings() { global $apbct; - $apbct->sfw_update_sentinel->seekId('test_id_1'); - $apbct->sfw_update_sentinel->seekId('test_id_2'); - $apbct->sfw_update_sentinel->seekId('test_id_2'); - $apbct->sfw_update_sentinel->clearSentinelData(); - $apbct->sfw_update_sentinel->runWatchDog(); - $this->assertEmpty($apbct->data['sentinel_data']['ids']); + + $apbct->settings['misc__send_connection_reports'] = 0; + + $s = new SFWUpdateSentinel(); + $s->seekId('1'); + $s->seekId('2'); + $s->seekId('3'); + + $s->runWatchDog(); + + $this->assertEquals( + 0, + $apbct->data['sentinel_data']['last_sent_try']['date'] + ); } - public function testFailedUpdate() + public function testSuccessfulEmailSend() { global $apbct; + + $s = new SFWUpdateSentinel(); + $apbct->settings['misc__send_connection_reports'] = 1; - $apbct->saveSettings(); - $apbct->sfw_update_sentinel->seekId('test_id_1'); - $apbct->sfw_update_sentinel->seekId('test_id_2'); - $apbct->sfw_update_sentinel->seekId('test_id_3'); - $apbct->sfw_update_sentinel->runWatchDog(); - $this->assertEmpty($apbct->data['sentinel_data']['ids']); - $this->assertIsBool($apbct->data['sentinel_data']['last_sent_try']['success']); - $this->assertNotEquals($apbct->data['sentinel_data']['last_sent_try']['date'],0); + + $s->seekId('1'); + $s->seekId('2'); + $s->seekId('3'); + + $s->runWatchDog(); + + $this->assertNotEquals( + 0, + $apbct->data['sentinel_data']['last_sent_try']['date'] + ); + + $this->assertTrue( + $apbct->data['sentinel_data']['last_sent_try']['success'] + ); } - public function testDoNotSendReportIfDenied() + public function testFailedEmailSendBranch() { global $apbct; - $apbct->settings['misc__send_connection_reports'] = 0; - $apbct->saveSettings(); - $apbct->sfw_update_sentinel->seekId('test_id_1'); - $apbct->sfw_update_sentinel->seekId('test_id_2'); - $apbct->sfw_update_sentinel->seekId('test_id_3'); - $apbct->sfw_update_sentinel->runWatchDog(); - $this->assertEmpty($apbct->data['sentinel_data']['ids']); - $this->assertIsBool($apbct->data['sentinel_data']['last_sent_try']['success']); - $this->assertEquals($apbct->data['sentinel_data']['last_sent_try']['date'],0); + + $GLOBALS['__wp_mail_return'] = false; + + $s = new SFWUpdateSentinel(); + $s->seekId('1'); + $s->seekId('2'); + $s->seekId('3'); + + $s->runWatchDog(); + + $this->assertFalse( + $apbct->data['sentinel_data']['last_sent_try']['success'] + ); + + unset($GLOBALS['__wp_mail_return']); + } + + public function testHtmlGenerators() + { + global $apbct; + + $apbct->fw_stats = array + ( + 'firewall_updating' => 123, + 'updating_folder' => 'uploads\cleantalk_fw_files_for_blog_1', + 'firewall_updating_id' => null, + 'firewall_update_percent' => 0, + 'firewall_updating_last_start' => '2026-02-28 16:39:28', + 'expected_networks_count' => 0, + 'expected_networks_count_personal' => 1, + 'expected_ua_count' => 0, + 'expected_ua_count_personal' => 0, + 'update_mode' => 0, + 'reason_direct_update_log' => null, + 'multi_request_batch_size' => 10, + 'personal_lists_url_id' => '5486d23bc60dde935fd906d3145fd8bb', + 'common_lists_url_id' => '1aeb928b023fa748e81215fd551d108e', + 'calls' => 18 + ); + + $s = new SFWUpdateSentinel(); + + $s->seekId('abc'); + $html1 = $s->getFailedUpdatesHTML( + $apbct->data['sentinel_data']['ids'] + ); + $this->assertStringContainsString('abc', $html1); + + $html2 = $s->getFWStatsHTML(); + $this->assertStringContainsString('123', $html2); + $this->assertStringContainsString('2026-02-28 16:39:28', $html2); + $this->assertStringContainsString('reason_direct_update_log', $html2); + + $html3 = $s->getQueueJSONPretty(); + $this->assertIsString($html3); + $this->assertNotEmpty($html3); + $this->assertStringContainsString('Last queue not found or invalid.', $html3); + + update_option('cleantalk_sfw_update_queue', array( + 'stage' => 'some' + )); + $html3 = $s->getQueueJSONPretty(); + $this->assertIsString($html3); + $this->assertNotEmpty($html3); + $this->assertStringContainsString('some', $html3); + $this->assertStringContainsString('stage', $html3); + + $apbct->data['sentinel_data']['prev_sent_try'] = [ + 'date' => time(), + 'success' => true, + ]; + + update_option('cleantalk_sfw_update_queue', array()); + + $html4 = $s->getPrevReportHTML($apbct->data); + $this->assertStringContainsString('Previous', $html4); } } diff --git a/tests/ApbctWP/Helper/testApbctWPHelper.php b/tests/ApbctWP/Helper/testApbctWPHelper.php index 0a3cc49c3..15e8efff3 100644 --- a/tests/ApbctWP/Helper/testApbctWPHelper.php +++ b/tests/ApbctWP/Helper/testApbctWPHelper.php @@ -5,6 +5,21 @@ class testApbctWPHelper extends TestCase { + private $apbct_copy; + public function setUp(): void + { + global $apbct; + $this->apbct_copy = $apbct; + $apbct = new State('cleantalk', array('settings', 'data', 'errors', 'remote_calls', 'stats', 'fw_stats')); + } + + protected function tearDown(): void + { + global $apbct; + $apbct = $this->apbct_copy; + + parent::tearDown(); + } public function testHttpGetDataFromRemoteGzAndParseCsv() { $result = Helper::httpGetDataFromRemoteGzAndParseCsv(''); diff --git a/tests/ApbctWP/TestCleantalkSettingsTemplates.php b/tests/ApbctWP/TestCleantalkSettingsTemplates.php index 33981c698..830fb1c46 100644 --- a/tests/ApbctWP/TestCleantalkSettingsTemplates.php +++ b/tests/ApbctWP/TestCleantalkSettingsTemplates.php @@ -1,9 +1,26 @@ apbct_copy = $apbct; + $apbct = new State('cleantalk', array('settings', 'data', 'errors', 'remote_calls', 'stats', 'fw_stats')); + } + + protected function tearDown(): void + { + global $apbct; + $apbct = $this->apbct_copy; + + parent::tearDown(); + } public function testGet_options_template_ok() { $this->assertIsArray( CleantalkSettingsTemplates::getOptionsTemplate( getenv("CLEANTALK_TEST_API_KEY") ) ); } From c50a39de1d05f2d00a35c2014d2eef1b45a3e489 Mon Sep 17 00:00:00 2001 From: svfcode Date: Mon, 2 Mar 2026 14:27:38 +0300 Subject: [PATCH 27/32] Upd. Settings. Updated RC to init settings update. --- lib/Cleantalk/ApbctWP/RemoteCalls.php | 4 ++-- lib/Cleantalk/ApbctWP/State.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/RemoteCalls.php b/lib/Cleantalk/ApbctWP/RemoteCalls.php index b04402ddc..7aa34d09e 100644 --- a/lib/Cleantalk/ApbctWP/RemoteCalls.php +++ b/lib/Cleantalk/ApbctWP/RemoteCalls.php @@ -158,13 +158,13 @@ public static function perform() * * @return string */ - public static function action__update_license() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps + public static function action__license_update() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps { if ( ! headers_sent() ) { header("Content-Type: application/json"); } - if (function_exists('apbct_settings__sync')) { + if ( ! function_exists('apbct_settings__sync') ) { require_once APBCT_DIR_PATH . 'inc/cleantalk-settings.php'; } diff --git a/lib/Cleantalk/ApbctWP/State.php b/lib/Cleantalk/ApbctWP/State.php index 0aa8e6d92..0ae2963cb 100644 --- a/lib/Cleantalk/ApbctWP/State.php +++ b/lib/Cleantalk/ApbctWP/State.php @@ -284,6 +284,7 @@ class State extends \Cleantalk\Common\State 'check_website' => array('last_call' => 0, 'cooldown' => 0), 'update_settings' => array('last_call' => 0, 'cooldown' => 0), 'run_service_template_get' => array('last_call' => 0, 'cooldown' => 60), + 'license_update' => array('last_call' => 0, 'cooldown' => 0), // Firewall From 6e803764af89a7becc510922eec54cf6378c6af0 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 3 Mar 2026 22:46:40 +0700 Subject: [PATCH 28/32] Rebuild js, css --- cleantalk.php | 6 +----- css/cleantalk-admin-settings-page.min.css | 2 +- css/cleantalk-admin.min.css | 2 +- css/cleantalk-dashboard-widget.min.css | 2 +- css/cleantalk-email-decoder.min.css | 2 +- css/cleantalk-icons.min.css | 2 +- css/cleantalk-public-admin.min.css | 2 +- css/cleantalk-public.min.css | 2 +- css/cleantalk-spam-check.min.css | 2 +- css/cleantalk-trp.min.css | 2 +- gulpfile.js | 4 ++-- package.json | 3 +++ readme.txt | 2 +- 13 files changed, 16 insertions(+), 17 deletions(-) diff --git a/cleantalk.php b/cleantalk.php index 7ffe2c038..81b1c8a7d 100644 --- a/cleantalk.php +++ b/cleantalk.php @@ -4,11 +4,7 @@ Plugin Name: Anti-Spam by CleanTalk Plugin URI: https://cleantalk.org 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. -<<<<<<< HEAD - Version: 6.73.99-fix -======= - Version: 6.73.99-dev ->>>>>>> d1c83a2daa2a4afbc00afba3ed0d114d505ad7a4 + Version: 6.74 Author: CleanTalk - Anti-Spam Protection Author URI: https://cleantalk.org Text Domain: cleantalk-spam-protect diff --git a/css/cleantalk-admin-settings-page.min.css b/css/cleantalk-admin-settings-page.min.css index e9af33312..f72f2e402 100644 --- a/css/cleantalk-admin-settings-page.min.css +++ b/css/cleantalk-admin-settings-page.min.css @@ -1 +1 @@ -.apbct_settings-field_title--radio,.apbct_settings-field_title--select,.apbct_settings-field_title--textarea{padding-right:10px;margin:0;font-size:14px;vertical-align:top;width:210px}.apbct_settings-field_content,.apbct_settings-field_title--radio,.cleantalk_link-auto,.cleantalk_link-manual,.ct-warning-test-failed,.ct_rate_block,.ct_settings_banner,i.animate-spin{display:inline-block}.apbct_settings-page{padding-right:10px}#apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:70%;padding-bottom:10px}.apbct_settings-field_title--select,.apbct_settings-field_title--textarea{padding-bottom:10px}.apbct_input_text{min-width:255px;width:400px}.apbct_settings-long_description---show:hover{color:#aaa;cursor:pointer}.apbct_setting_textarea{min-width:300px}.cleantalk_link{text-decoration:none;font-size:13px;line-height:26px;margin:10px 0 0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_link-auto{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;height:28px;-webkit-border-radius:2px;border-radius:2px}.cleantalk_link-auto:hover{color:#fff}.cleantalk_link-auto.cleantalk_link_text_center{text-align:center}.cleantalk_link-manual{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;-webkit-border-radius:3px;border-radius:3px;text-align:center}.cleantalk_link-manual:hover{color:#000}.cleantalk_link[disabled=disabled]{background:#5d9db5;color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}.apbct-icon-upload-cloud{margin-left:3px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{position:relative;padding:5px;margin:4px;border:3px solid rgba(240,50,50,1);border-radius:5px;background-color:rgba(255,200,200,1)}.ct_settings_banner{text-align:right;width:100%;margin:1em 0;vertical-align:top}#cleantalk-modal-content,.ct_rate_block{text-align:center}#ct_translate_plugin{margin-left:0}.ct_rate_block{width:370px;margin-right:3em;padding:.8em .8em 15px;border:1px dashed #666}#ct_translate_plugin .apbct_button_rate{margin-bottom:10px}.apbct_long_desc{position:absolute;background:#5a5a5a;min-width:80px;min-height:80px;max-width:500px;padding:10px;color:#fff;z-index:10}.apbct_long_desc a,i.animate-spin{color:rgba(120,200,230,1)}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;font-size:25px;line-height:20px;margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.apbct_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.apbct_long_desc__cancel:hover{color:#fff}.apbct_long_desc__angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.apbct_long_desc__title{color:rgba(120,200,230,1);margin:0}.--hide{display:none}.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none}.--invisible{visibility:hidden}.apbct_preloader{height:1em;width:1em;margin-left:.5em;display:inline-block}.key_changed_success,.key_changed_sync{font-size:1.5em;line-height:2em;vertical-align:middle}.--upper-case{text-transform:uppercase}#cleantalk-modal-content>*{display:block;width:100%}.cleantalk-confirm-modal_header{font-size:15px;font-weight:500}.cleantalk-confirm-modal_text-block{padding:10px 0}.cleantalk-confirm-modal_buttons-block{display:flex!important;gap:10px;justify-content:center}button.ct_support_link{border:none;background:0 0;color:#666;text-decoration:underline;cursor:pointer}.apbct-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0;border-bottom:1px solid;cursor:pointer}#apbct-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}button[value=save_changes]:disabled{color:#2271b1;border-color:#2271b1;background:#f6f7f7}#apbct_settings__advanced_settings{position:relative}#apbct_settings__advanced_settings_inner{width:70%}#apbct_hidden_section_nav{position:absolute;top:0;right:0;width:200px}#apbct_hidden_section_nav ul{z-index:9999;width:100%;top:40px}.apbct_settings__position_main_save_button{text-align:right;margin-right:40px}#apbct_settings__after_advanced_settings{margin-bottom:20px;width:70%}#apbct_settings__button_section{position:static;z-index:9999;padding-bottom:40px;bottom:0}.apbct_highlighted{outline-offset:5px;outline-color:red;outline-width:3px!important;outline-style:solid!important}.apbct_notice_inner{display:flex;margin-top:10px!important}.apbct_notification__advanced_settings{margin:20px 0;font-weight:400}.apbct_settings_top_info__div{float:right;padding:0 20px 0 0;font-size:13px;position:relative}.apbct_settings_top_info__p{padding:0;margin:2px}.apbct_settings_top_info__btn{display:inline-flex;gap:10px}.apbct_hidden_section_nav_mob_btn{display:none;background-image:url(images/menu.svg);background-repeat:no-repeat;background-size:contain;background-position-y:center}.apbct_hidden_section_nav_mob_btn-close{display:none}.apbct_settings__footer{background:#c2c2c2;position:absolute;left:0;padding-bottom:30px;padding-left:21px;z-index:-1}.apbct_settings_top_info__sub_btn{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}.apbct_settings__key_line{display:flex;align-items:center;justify-content:flex-start;flex-direction:row}.apbct_settings__key_line__elements{margin-right:10px}.apbct_setting__key_line__buttons{margin:0}.apbct_setting__key_line__get_key_manual_chunk{margin:10px 0;border:1px solid #d3d3d3;border-radius:3px;padding:10px;background:#FFF}.apbct_settings__key_line__service_block{margin-left:10px}#apbct_settings__public_offer{margin-top:10px;display:flex;align-items:center}#cleantalk_apikey_wrapper{max-width:65%}.apcbt_contact_data_encoder__line{max-width:70%;display:flex;flex-wrap:wrap;flex-direction:row}.apbct_warning_red_point{display:inline-block;width:4px;height:4px;background:red;border-radius:100%;margin:0 10px 3px 3px;vertical-align:middle;position:relative}.apbct_warning_red_point::after{content:'';position:absolute;left:50%;top:50%;width:12px;height:12px;border:1.5px solid rgba(255,2,2,.65);border-radius:50%;animation:apbct_pulsate 1.2s ease-out infinite;opacity:.7;pointer-events:none;transform:translate(-50%,-50%)}#apbct_summary_and_support{display:flex;flex-wrap:wrap;width:-webkit-fill-available;border:1px solid #ddd;border-radius:3px;padding:10px;background:#ededed;margin-top:4em}#apbct_summary_and_support-left_side{width:69%;padding:0 20px 0 0}#apbct_summary_and_support-right_side{width:31%;padding:0 20px;border-left:1px solid #dcdcde}#apbct_summary_and_support-sides_wrap{display:flex;flex-direction:row;margin:10px 0;width:100%}.apbct_summary_and_support-side_header{margin:.5em 0}.apbct_summary_and_support-inner_header{margin:2em 0 .5em;font-size:medium}.apbct_summary_and_support-inner_header::after{content:'';display:block;width:100%;height:1px;background:linear-gradient(90deg,#d3d3d357 0,rgba(211,211,211,.14) 10%,transparent 100%);margin-top:5px}.apbct_summary_and_support-support_buttons_wrapper{display:flex;flex-direction:column}#apbct_summary_and_support-create_user_button{display:inline-flex;flex-direction:row;align-items:center;justify-content:center}.apbct_summary_and_support-user_creation_result{background:#eee;margin-top:10px;padding:5px;border:1px solid #d3d3d3;display:none}.apbct_summary-list_of_items{display:flex;flex-direction:column}.apbct_summary_list_item{margin-bottom:2px}.apbct-green{color:green}.apbct-red{color:red}#apbct_negative_reports_table{width:100%;border-collapse:collapse;margin:10px 5px}#apbct_sending_report_div{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;flex-wrap:nowrap}#apbct_sending_report_disabled_notice{margin-right:5px}.apbct-real-user-popup-img{align-self:start;margin:0!important;height:max-content;vertical-align:sub}@keyframes apbct_pulsate{0%{transform:translate(-50%,-50%) scale(1);opacity:.7}100%{transform:translate(-50%,-50%) scale(1.5);opacity:0}}@media (max-width:768px){.apbct_settings_top_info__btn{display:inline-grid;width:100%;gap:5px}#apbct_settings__advanced_settings_inner,#apbct_settings__after_advanced_settings,.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:100%}.apbct_settings_top_info__sub_btn .apbct_bottom_links--left,.apbct_settings_top_info__sub_btn .apbct_bottom_links--other{margin-left:0;margin-right:0}#apbct_hidden_section_nav ul{display:none;background-color:#dadee3bd;margin:0;padding:10px;border-radius:3px;right:0;width:auto}#apbct_hidden_section_nav{right:0;min-width:167px}.apbct_setting_radio::before{height:6px!important;width:6px!important;margin:4px!important}.apbct_setting_checkbox::before{height:15px!important;width:15px!important;margin:0 -.05rem!important}.apbct_setting_checkbox,.apbct_setting_radio{height:16px!important;width:16px!important}.apbct_hidden_section_nav_mob_btn{display:block;width:32px;height:28px;right:20px;top:20px;position:fixed}.apbct_hidden_section_nav_mob_btn-close{display:block;position:relative;float:right;width:20px;height:22px;top:-5px;right:-5px;background-image:url(images/cancel.svg);background-repeat:no-repeat;background-size:contain;background-position-y:center;text-align:center}.apbct_long_desc{left:-2%!important;max-width:95%;margin-top:10%}.apbct_long_desc__angle{display:none}.ct_rate_block{max-width:240px;margin-right:20px}.apbct_settings__key_line{display:flex;align-items:flex-start;flex-direction:column;width:100%}.apbct_settings__key_line__elements{margin:5px 0}#apbct_setting_apikey,.apbct_setting__key_line__buttons,.apbct_settings__key_line__elements{width:100%}#apbct_summary_and_support-left_side,#apbct_summary_and_support-right_side{border-top:1px solid #dcdcde;width:-webkit-fill-available}#cleantalk_apikey_wrapper{max-width:100%}#apbct_settings__button_section{position:fixed;right:20px}.apcbt_contact_data_encoder__line{max-width:100%;margin-top:5px}#apbct_summary_and_support-right_side{border-left:0;margin:35px 0 0;padding:0}#apbct_summary_and_support-sides_wrap{flex-direction:column}} \ No newline at end of file +.apbct_settings-page{padding-right:10px}.apbct_settings-field_content,.cleantalk_link-auto,.cleantalk_link-manual,.ct-warning-test-failed,.ct_rate_block,.ct_settings_banner,i.animate-spin{display:inline-block}#apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px 0}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content{display:inline-block}.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:70%;padding-bottom:10px}.apbct_settings-field_title--select,.apbct_settings-field_title--textarea{margin:0;width:210px;padding-right:10px;padding-bottom:10px;font-size:14px;vertical-align:top}.apbct_settings-field_title--radio{display:inline-block;margin:0;width:210px;padding-right:10px;font-size:14px;vertical-align:top}.apbct_input_text{min-width:255px;width:400px}.apbct_settings-long_description---show:hover{color:#aaa;cursor:pointer}.apbct_setting_textarea{min-width:300px}.cleantalk_link{text-decoration:none;font-size:13px;line-height:26px;margin:10px 0 0 0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_link-auto{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;display:inline-block;height:28px;-webkit-border-radius:2px;border-radius:2px}.cleantalk_link-auto:hover{color:#fff}.cleantalk_link-auto.cleantalk_link_text_center{text-align:center}.cleantalk_link-manual{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;display:inline-block;-webkit-border-radius:3px;border-radius:3px;text-align:center}.cleantalk_link-manual:hover{color:#000}.cleantalk_link[disabled=disabled]{background:#5d9db5;color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}.apbct-icon-upload-cloud{margin-left:3px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{display:inline-block;position:relative;padding:5px;margin:4px;border:3px solid #f03232;border-radius:5px;background-color:#ffc8c8}.ct_settings_banner{text-align:right;display:inline-block;width:100%;margin:1em 0;vertical-align:top}#ct_translate_plugin{margin-left:0}.ct_rate_block{display:inline-block;width:370px;margin-right:3em;padding:.8em .8em 15px .8em;text-align:center;border:1px dashed #666}#ct_translate_plugin .apbct_button_rate{margin-bottom:10px}.apbct_long_desc{position:absolute;background:#5a5a5a;min-width:80px;min-height:80px;max-width:500px;padding:10px;color:#fff;z-index:10}.apbct_long_desc a{color:#78c8e6}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block;margin:0 auto;font-size:25px;line-height:20px;color:#78c8e6;margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.apbct_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.apbct_long_desc__cancel:hover{color:#fff}.apbct_long_desc__angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.apbct_long_desc__title{color:#78c8e6;margin:0}.--hide{display:none}.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none}.--invisible{visibility:hidden}.apbct_preloader{height:1em;width:1em;margin-left:.5em;display:inline-block}.key_changed_sync{font-size:1.5em;line-height:2em;vertical-align:middle}.key_changed_success{font-size:1.5em;line-height:2em;vertical-align:middle}.--upper-case{text-transform:uppercase}#cleantalk-modal-content{text-align:center}#cleantalk-modal-content>*{display:block;width:100%}.cleantalk-confirm-modal_header{font-size:15px;font-weight:500}.cleantalk-confirm-modal_text-block{padding:10px 0}.cleantalk-confirm-modal_buttons-block{display:flex!important;gap:10px;justify-content:center}button.ct_support_link{border:none;background:0 0;color:#666;text-decoration:underline;cursor:pointer}.apbct-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0 none;border-bottom:1px solid;cursor:pointer}#apbct-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}button[value=save_changes]:disabled{color:#2271b1;border-color:#2271b1;background:#f6f7f7}#apbct_settings__advanced_settings{position:relative}#apbct_settings__advanced_settings_inner{width:70%}#apbct_hidden_section_nav{position:absolute;top:0;right:0;width:200px}#apbct_hidden_section_nav ul{z-index:9999;width:100%;top:40px}.apbct_settings__position_main_save_button{text-align:right;margin-right:40px}#apbct_settings__after_advanced_settings{margin-bottom:20px;width:70%}#apbct_settings__button_section{position:static;z-index:9999;padding-bottom:40px;bottom:0}.apbct_highlighted{outline-offset:5px;outline-color:red;outline-width:3px!important;outline-style:solid!important}.apbct_notice_inner{display:flex;margin-top:10px!important}.apbct_notification__advanced_settings{margin:20px 0;font-weight:400}.apbct_settings_top_info__div{float:right;padding:0 20px 0 0;font-size:13px;position:relative}.apbct_settings_top_info__p{padding:0;margin:2px}.apbct_settings_top_info__btn{display:inline-flex;gap:10px}.apbct_hidden_section_nav_mob_btn{display:none;background-image:url(images/menu.svg);background-repeat:no-repeat;background-size:contain;background-position-y:center}.apbct_hidden_section_nav_mob_btn-close{display:none}.apbct_settings__footer{background:#c2c2c2;position:absolute;left:0;padding-bottom:30px;padding-left:21px;z-index:-1}.apbct_settings_top_info__sub_btn{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}.apbct_settings__key_line{display:flex;align-items:center;justify-content:flex-start;flex-direction:row}.apbct_settings__key_line__elements{margin-right:10px}.apbct_setting__key_line__buttons{margin:0}.apbct_setting__key_line__get_key_manual_chunk{margin:10px 0 10px 0;border:1px solid #d3d3d3;border-radius:3px;padding:10px;background:#fff}.apbct_settings__key_line__service_block{margin-left:10px}#apbct_settings__public_offer{margin-top:10px;display:flex;align-items:center}#cleantalk_apikey_wrapper{max-width:65%}.apcbt_contact_data_encoder__line{max-width:70%;display:flex;flex-wrap:wrap;flex-direction:row}.apbct_warning_red_point{display:inline-block;width:4px;height:4px;background:red;border-radius:100%;margin:0 10px 3px 3px;vertical-align:middle;position:relative}.apbct_warning_red_point::after{content:'';position:absolute;left:50%;top:50%;width:12px;height:12px;border:1.5px solid rgba(255,2,2,.65);border-radius:50%;animation:apbct_pulsate 1.2s ease-out infinite;opacity:.7;pointer-events:none;transform:translate(-50%,-50%)}#apbct_summary_and_support{display:flex;flex-wrap:wrap;width:-webkit-fill-available;border:1px solid #ddd;border-radius:3px;padding:10px;background:#ededed;margin-top:4em}#apbct_summary_and_support-left_side{width:69%;padding:0 20px 0 0}#apbct_summary_and_support-right_side{width:31%;padding:0 20px;border-left:1px solid #dcdcde}#apbct_summary_and_support-sides_wrap{display:flex;flex-direction:row;margin:10px 0 10px;width:100%}.apbct_summary_and_support-side_header{margin:.5em 0}.apbct_summary_and_support-inner_header{margin:2em 0 .5em;font-size:medium}.apbct_summary_and_support-inner_header::after{content:'';display:block;width:100%;height:1px;background:linear-gradient(90deg,#d3d3d357 0,rgba(211,211,211,.14) 10%,transparent 100%);margin-top:5px}.apbct_summary_and_support-support_buttons_wrapper{display:flex;flex-direction:column}#apbct_summary_and_support-create_user_button{display:inline-flex;flex-direction:row;align-items:center;justify-content:center}.apbct_summary_and_support-user_creation_result{background:#eee;margin-top:10px;padding:5px;border:1px solid #d3d3d3;display:none}.apbct_summary-list_of_items{display:flex;flex-direction:column}.apbct_summary_list_item{margin-bottom:2px}.apbct-green{color:green}.apbct-red{color:red}#apbct_negative_reports_table{width:100%;border-collapse:collapse;margin:10px 5px}#apbct_sending_report_div{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;flex-wrap:nowrap}#apbct_sending_report_disabled_notice{margin-right:5px}.apbct-real-user-popup-img{align-self:start;margin:0!important;height:max-content;vertical-align:sub}@keyframes apbct_pulsate{0%{transform:translate(-50%,-50%) scale(1);opacity:.7}100%{transform:translate(-50%,-50%) scale(1.5);opacity:0}}@media (max-width:768px){.apbct_settings_top_info__btn{display:inline-grid;width:100%;gap:5px}#apbct_settings__advanced_settings_inner,#apbct_settings__after_advanced_settings{width:100%}.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:100%}.apbct_settings_top_info__sub_btn .apbct_bottom_links--left,.apbct_settings_top_info__sub_btn .apbct_bottom_links--other{margin-left:0;margin-right:0}#apbct_hidden_section_nav ul{display:none;background-color:#dadee3bd;margin:0;padding:10px;border-radius:3px;right:0;width:auto}#apbct_hidden_section_nav{right:0;min-width:167px}.apbct_setting_radio::before{height:6px!important;width:6px!important;margin:4px!important}.apbct_setting_checkbox::before{height:15px!important;width:15px!important;margin:0 -.05rem!important}.apbct_setting_checkbox,.apbct_setting_radio{height:16px!important;width:16px!important}.apbct_hidden_section_nav_mob_btn{display:block;width:32px;height:28px;right:20px;top:20px;position:fixed}.apbct_hidden_section_nav_mob_btn-close{display:block;position:relative;float:right;width:20px;height:22px;top:-5px;right:-5px;background-image:url(images/cancel.svg);background-repeat:no-repeat;background-size:contain;background-position-y:center;text-align:center}.apbct_long_desc{left:-2%!important;max-width:95%;margin-top:10%}.apbct_long_desc__angle{display:none}.ct_rate_block{max-width:240px;margin-right:20px}.apbct_settings__key_line{display:flex;align-items:flex-start;flex-direction:column;width:100%}.apbct_settings__key_line__elements{margin:5px 0 5px 0}#apbct_setting_apikey,.apbct_setting__key_line__buttons,.apbct_settings__key_line__elements{width:100%}#cleantalk_apikey_wrapper{max-width:100%}#apbct_settings__button_section{position:fixed;right:20px}.apcbt_contact_data_encoder__line{max-width:100%;margin-top:5px}#apbct_summary_and_support-right_side{border-top:1px solid #dcdcde;border-left:0;margin:35px 0 0;padding:0;width:-webkit-fill-available}#apbct_summary_and_support-left_side{border-top:1px solid #dcdcde;width:-webkit-fill-available}#apbct_summary_and_support-sides_wrap{flex-direction:column}} \ No newline at end of file diff --git a/css/cleantalk-admin.min.css b/css/cleantalk-admin.min.css index b83bc570a..98506bac7 100644 --- a/css/cleantalk-admin.min.css +++ b/css/cleantalk-admin.min.css @@ -1 +1 @@ -.cleantalk_admin_bar__blocked div,:disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.apbct_bottom_links--left{margin-right:2pc}.apbct_bottom_links--other{margin-right:2pc;margin-left:2pc}.ct_translate_links{color:rgba(150,150,20,1)}.ct_support_links{color:rgba(150,20,20,1)}.ct_faq_links{color:rgba(20,150,20,1)}.ct_setting_links{color:rgba(20,20,150,1)}.ct_translate_links:hover{color:rgba(210,210,20,1)!important}.ct_support_links:hover{color:rgba(250,20,20,1)!important}.ct_faq_links:hover{color:rgba(20,250,20,1)!important}.ct_setting_links:hover{color:rgba(20,20,250,1)!important}.ct_link_new_tab img{float:none!important;margin:0 2px;border:0}#negative_reports_table tr td{padding:7px 5px!important}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node span{display:inline-block}#wp-admin-bar-cleantalk_admin_bar__parent_node .apbct-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}.cleantalk_admin_bar__blocked div a{color:#777!important}.cleantalk_admin_bar__title{vertical-align:top}.cleantalk_admin_bar__separator{height:0!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}.apbct-plugin-errors{margin-left:0;margin-bottom:20px}#cleantalk_notice_review .caption{margin:0 0 15px;color:gray}#cleantalk_notice_review .button{margin-bottom:20px}.apbct-restore-spam-order-button{cursor:pointer}.ct-modal-buttons{display:flex;align-items:center;padding:20px 0;justify-content:space-between}.ct-modal-message{font-weight:700;font-size:16px;line-height:2rem}.apbct-popup-fade:before{content:'';background:#000;position:fixed;left:0;top:0;width:100%;height:100%;opacity:.7;z-index:9999}.apbct-popup{position:fixed;top:20%;left:50%;padding:20px;width:360px;margin-left:-200px;background:#fff;border:1px solid;border-radius:4px;z-index:99999;opacity:1}.apbct-table-actions-wrapper{background:#FСFСFС;border-radius:2px;padding:5px!important;border:1px solid #d3d3d3;margin:0 5px 5px 0!important}@media screen and (max-width:1120px){.apbct-tablenav{display:flex;flex-direction:column;flex-wrap:nowrap;height:100%;max-width:50%}} \ No newline at end of file +:disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.apbct_bottom_links--left{margin-right:2pc}.apbct_bottom_links--other{margin-right:2pc;margin-left:2pc}.ct_translate_links{color:#969614}.ct_support_links{color:#961414}.ct_faq_links{color:#149614}.ct_setting_links{color:#141496}.ct_translate_links:hover{color:#d2d214!important}.ct_support_links:hover{color:#fa1414!important}.ct_faq_links:hover{color:#14fa14!important}.ct_setting_links:hover{color:#1414fa!important}.ct_link_new_tab img{float:none!important;margin:0 2px;border:0}#negative_reports_table tr td{padding:7px 5px!important}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node span{display:inline-block}#wp-admin-bar-cleantalk_admin_bar__parent_node .apbct-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}.cleantalk_admin_bar__blocked div{cursor:not-allowed!important}.cleantalk_admin_bar__blocked div a{color:#777!important}.cleantalk_admin_bar__title{vertical-align:top}.cleantalk_admin_bar__separator{height:0!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}.apbct-plugin-errors{margin-left:0;margin-bottom:20px}#cleantalk_notice_review .caption{margin:0 0 15px;color:gray}#cleantalk_notice_review .button{margin-bottom:20px}.apbct-restore-spam-order-button{cursor:pointer}.ct-modal-buttons{display:flex;align-items:center;padding:20px 0;justify-content:space-between}.ct-modal-message{font-weight:700;font-size:16px;line-height:2rem}.apbct-popup-fade:before{content:'';background:#000;position:fixed;left:0;top:0;width:100%;height:100%;opacity:.7;z-index:9999}.apbct-popup{position:fixed;top:20%;left:50%;padding:20px;width:360px;margin-left:-200px;background:#fff;border:1px solid;border-radius:4px;z-index:99999;opacity:1}.apbct-table-actions-wrapper{background:#FСFСFС;border-radius:2px;padding:5px!important;border:1px solid #d3d3d3;margin:0 5px 5px 0!important}@media screen and (max-width:1120px){.apbct-tablenav{display:flex;flex-direction:column;flex-wrap:nowrap;height:100%;max-width:50%}} \ No newline at end of file diff --git a/css/cleantalk-dashboard-widget.min.css b/css/cleantalk-dashboard-widget.min.css index 2baaf1318..04b0ccea9 100644 --- a/css/cleantalk-dashboard-widget.min.css +++ b/css/cleantalk-dashboard-widget.min.css @@ -1 +1 @@ -#ct_widget_wrapper{position:relative;width:100%;height:100%}.ct_widget_top_links{text-align:right;padding:0 12px;height:32px}.ct_widget_settings_link{margin:0 0 0 10px}.ct_preloader{display:none;float:left;width:20px;height:20px;margin:0 10px}.ct_widget_hr{width:100%}.ct_widget_block_header{font-size:18px!important;margin-left:12px!important}.ct_widget_block{display:block;position:relative;padding:12px}.ct_widget_chart_wrapper{margin-right:10px;height:300px}.ct_widget_block table{width:100%;text-align:left}.ct_widget_block table tr{margin-bottom:10px}.ct_widget_activate_button,.ct_widget_button{display:block;margin:10px auto}.ct_widget_block table th{text-align:left;padding:10px 0 5px 10px;border-bottom:2px solid gray}.ct_widget_block table td{text-align:left;padding:10px 0 5px 10px;border-bottom:1px solid gray}#ct_widget_wrapper .ct_widget_block table td.ct_widget_block__country_cell img{width:16px!important;height:auto}.ct_widget_activate_button{padding:7px 15px;font-weight:600;border-radius:3px;border:2px solid #aaa;background:rgba(250,50,50,.9)}.ct_widget_resolve_button{background:rgba(50,250,50,.9)}.ct_widget_activate_header{display:inline-block;width:100%;text-align:center;font-size:18px!important}.ct_widget_wprapper_total_blocked{padding:10px 0 10px 10px;background:#f1f1f1}.ct_widget_wprapper_total_blocked span{position:relative;top:2px}.ct_widget_small_logo{margin-right:1em;vertical-align:middle}#ct_widget_wrapper .ct_widget_wprapper_total_blocked img.ct_widget_small_logo{width:24px!important;height:24px!important}#ct_widget_button_view_all{cursor:pointer;border:1px solid #0074a2;-webkit-appearance:none;-webkit-border-radius:2px;border-radius:2px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#0085ba;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff}#ct_widget_button_view_all:hover{color:#000!important} \ No newline at end of file +#ct_widget_wrapper{position:relative;width:100%;height:100%}.ct_widget_top_links{text-align:right;padding:0 12px;height:32px}.ct_widget_settings_link{margin:0 0 0 10px}.ct_preloader{display:none;float:left;width:20px;height:20px;margin:0 10px}.ct_widget_hr{width:100%}.ct_widget_block_header{font-size:18px!important;margin-left:12px!important}.ct_widget_block{display:block;position:relative;padding:12px}.ct_widget_chart_wrapper{margin-right:10px;height:300px}.ct_widget_block table{width:100%;text-align:left}.ct_widget_block table tr{margin-bottom:10px}.ct_widget_block table th{text-align:left;padding:10px 0 5px 10px;border-bottom:2px solid gray}.ct_widget_block table td{text-align:left;padding:10px 0 5px 10px;border-bottom:1px solid gray}#ct_widget_wrapper .ct_widget_block table td.ct_widget_block__country_cell img{width:16px!important;height:auto}.ct_widget_button{display:block;margin:10px auto}.ct_widget_activate_button{display:block;margin:10px auto;padding:7px 15px;font-weight:600;border-radius:3px;border:2px solid #aaa;background:rgba(250,50,50,.9)}.ct_widget_resolve_button{background:rgba(50,250,50,.9)}.ct_widget_activate_header{display:inline-block;width:100%;text-align:center;font-size:18px!important}.ct_widget_wprapper_total_blocked{padding:10px 0 10px 10px;background:#f1f1f1}.ct_widget_wprapper_total_blocked span{position:relative;top:2px}.ct_widget_small_logo{margin-right:1em;vertical-align:middle}#ct_widget_wrapper .ct_widget_wprapper_total_blocked img.ct_widget_small_logo{width:24px!important;height:24px!important}#ct_widget_button_view_all{cursor:pointer;border:1px solid #0074a2;-webkit-appearance:none;-webkit-border-radius:2px;border-radius:2px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#0085ba;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff}#ct_widget_button_view_all:hover{color:#000!important} \ No newline at end of file diff --git a/css/cleantalk-email-decoder.min.css b/css/cleantalk-email-decoder.min.css index d97ef5ee4..8cae5bc44 100644 --- a/css/cleantalk-email-decoder.min.css +++ b/css/cleantalk-email-decoder.min.css @@ -1 +1 @@ -.apbct_dog_one,.apbct_dog_three,.apbct_dog_two{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:apbct_dog}.apbct-email-encoder,.apbct-email-encoder--settings_example_encoded{position:relative}.apbct-email-encoder-popup{width:30vw;min-width:400px;font-size:16px}.apbct-email-encoder--popup-header{font-size:16px;color:#333}.apbct-email-encoder-elements_center{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:16px!important;color:#000!important}.top-margin-long{margin-top:5px}.apbct-tooltip{display:none}.apbct-blur{filter:blur(5px);transition:filter 2s}.apbct-email-encoder.no-blur .apbct-blur{filter:none}.apbct-email-encoder-select-whole-email{-webkit-user-select:all;user-select:all}.apbct-email-encoder-got-it-button{all:unset;margin-top:10px;padding:5px 10px;border-radius:5px;background-color:#333;color:#fff;cursor:pointer;transition:background-color .3s}.apbct-ee-animation-wrapper{display:flex;height:60px;justify-content:center;font-size:16px;align-items:center}.apbct_dog{margin:0 5px;color:transparent;text-shadow:0 0 2px #aaa}.apbct_dog_one{animation-delay:0s}.apbct_dog_two{animation-delay:.5s}.apbct_dog_three{animation-delay:1s}@keyframes apbct_dog{0%,100%,75%{scale:100%;color:transparent;text-shadow:0 0 2px #aaa}25%{scale:200%;color:unset;text-shadow:unset}}@media screen and (max-width:782px){.apbct-email-encoder--settings_example_encoded{position:relative;display:block}.apbct-email-encoder-popup{width:20vw;min-width:200px;font-size:16px;top:20%;left:75%}.apbct-email-encoder-elements_center{flex-direction:column!important;text-align:center}} \ No newline at end of file +.apbct-email-encoder-popup{width:30vw;min-width:400px;font-size:16px}.apbct-email-encoder--popup-header{font-size:16px;color:#333}.apbct-email-encoder-elements_center{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:16px!important;color:#000!important}.top-margin-long{margin-top:5px}.apbct-tooltip{display:none}.apbct-email-encoder{position:relative}.apbct-blur{filter:blur(5px);transition:filter 2s}.apbct-email-encoder.no-blur .apbct-blur{filter:none}.apbct-email-encoder-select-whole-email{-webkit-user-select:all;user-select:all}.apbct-email-encoder-got-it-button{all:unset;margin-top:10px;padding:5px 10px;border-radius:5px;background-color:#333;color:#fff;cursor:pointer;transition:background-color .3s}.apbct-ee-animation-wrapper{display:flex;height:60px;justify-content:center;font-size:16px;align-items:center}.apbct_dog{margin:0 5px;color:transparent;text-shadow:0 0 2px #aaa}.apbct_dog_one{animation-duration:1.5s;animation-iteration-count:infinite;animation-delay:0s;animation-name:apbct_dog}.apbct_dog_two{animation-duration:1.5s;animation-iteration-count:infinite;animation-delay:.5s;animation-name:apbct_dog}.apbct_dog_three{animation-duration:1.5s;animation-iteration-count:infinite;animation-delay:1s;animation-name:apbct_dog}@keyframes apbct_dog{0%{scale:100%;color:transparent;text-shadow:0 0 2px #aaa}25%{scale:200%;color:unset;text-shadow:unset}75%{scale:100%;color:transparent;text-shadow:0 0 2px #aaa}100%{scale:100%;color:transparent;text-shadow:0 0 2px #aaa}}.apbct-email-encoder--settings_example_encoded{position:relative}@media screen and (max-width:782px){.apbct-email-encoder--settings_example_encoded{position:relative;display:block}.apbct-email-encoder-popup{width:20vw;min-width:200px;font-size:16px;top:20%;left:75%}.apbct-email-encoder-elements_center{flex-direction:column!important;text-align:center}} \ No newline at end of file diff --git a/css/cleantalk-icons.min.css b/css/cleantalk-icons.min.css index 0ca272b7e..bd211deba 100644 --- a/css/cleantalk-icons.min.css +++ b/css/cleantalk-icons.min.css @@ -1 +1 @@ -@font-face{font-family:fontello;src:url(./fonts/icons/icons.eot);src:url(./fonts/icons/icons.eot) format('embedded-opentype'),url(./fonts/icons/icons.woff2) format('woff2'),url(./fonts/icons/icons.woff) format('woff'),url(./fonts/icons/icons.ttf) format('truetype'),url(./fonts/icons/icons.svg) format('svg');font-weight:400;font-style:normal}[class*=" apbct-icon-"]:before,[class^=apbct-icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.apbct-icon-download:before{content:'\e800'}.apbct-icon-glass:before{content:'\e801'}.apbct-icon-emo-happy:before{content:'\e802'}.apbct-icon-search:before{content:'\e803'}.apbct-icon-emo-unhappy:before{content:'\e804'}.apbct-icon-mail:before{content:'\e805'}.apbct-icon-info-circled:before{content:'\e806'}.apbct-icon-help-circled:before{content:'\e807'}.apbct-icon-heart:before{content:'\e808'}.apbct-icon-heart-empty:before{content:'\e809'}.apbct-icon-star:before{content:'\e80a'}.apbct-icon-star-empty:before{content:'\e80b'}.apbct-icon-user:before{content:'\e80c'}.apbct-icon-users:before{content:'\e80d'}.apbct-icon-th-large:before{content:'\e80e'}.apbct-icon-th:before{content:'\e80f'}.apbct-icon-th-list:before{content:'\e810'}.apbct-icon-to-end:before{content:'\e811'}.apbct-icon-to-start:before{content:'\e812'}.apbct-icon-fast-fw:before{content:'\e813'}.apbct-icon-fast-bw:before{content:'\e814'}.apbct-icon-off:before{content:'\e815'}.apbct-icon-chart-bar:before{content:'\e816'}.apbct-icon-home:before{content:'\e817'}.apbct-icon-link-1:before{content:'\e818'}.apbct-icon-lock-open:before{content:'\e819'}.apbct-icon-eye:before{content:'\e81a'}.apbct-icon-eye-off:before{content:'\e81b'}.apbct-icon-download-1:before{content:'\e81c'}.apbct-icon-chat:before{content:'\e81d'}.apbct-icon-comment:before{content:'\e81e'}.apbct-icon-doc:before{content:'\e81f'}.apbct-icon-lock:before{content:'\e820'}.apbct-icon-emo-wink2:before{content:'\e821'}.apbct-icon-plus:before{content:'\e822'}.apbct-icon-upload:before{content:'\e823'}.apbct-icon-picture:before{content:'\e824'}.apbct-icon-ok:before{content:'\e825'}.apbct-icon-cancel:before{content:'\e826'}.apbct-icon-pencil:before{content:'\e827'}.apbct-icon-edit:before{content:'\e828'}.apbct-icon-forward:before{content:'\e829'}.apbct-icon-export:before{content:'\e82a'}.apbct-icon-trash-empty:before{content:'\e82b'}.apbct-icon-down-dir:before{content:'\e82c'}.apbct-icon-up-dir:before{content:'\e82d'}.apbct-icon-left-dir:before{content:'\e82e'}.apbct-icon-right-dir:before{content:'\e82f'}.apbct-icon-spin1:before{content:'\e830'}.apbct-icon-spin2:before{content:'\e831'}.apbct-icon-mobile:before{content:'\e832'}.apbct-icon-bell:before{content:'\e833'}.apbct-icon-ccw:before{content:'\e834'}.apbct-icon-wrench:before{content:'\e835'}.apbct-icon-stop-1:before{content:'\e837'}.apbct-icon-spin5:before{content:'\e838'}.apbct-icon-pause-1:before{content:'\e839'}.apbct-icon-play-1:before{content:'\e83a'}.apbct-icon-link-ext:before{content:'\f08e'}.apbct-icon-menu:before{content:'\f0c9'}.apbct-icon-sort:before{content:'\f0dc'}.apbct-icon-mail-alt:before{content:'\f0e0'}.apbct-icon-lightbulb:before{content:'\f0eb'}.apbct-icon-exchange:before{content:'\f0ec'}.apbct-icon-upload-cloud:before{content:'\f0ee'}.apbct-icon-bell-alt:before{content:'\f0f3'}.apbct-icon-doc-text:before{content:'\f0f6'}.apbct-icon-angle-double-left:before{content:'\f100'}.apbct-icon-angle-double-right:before{content:'\f101'}.apbct-icon-angle-double-up:before{content:'\f102'}.apbct-icon-angle-double-down:before{content:'\f103'}.apbct-icon-desktop:before{content:'\f108'}.apbct-icon-laptop:before{content:'\f109'}.apbct-icon-tablet:before{content:'\f10a'}.apbct-icon-circle-empty:before{content:'\f10c'}.apbct-icon-circle:before{content:'\f111'}.apbct-icon-unlink:before{content:'\f127'}.apbct-icon-help:before{content:'\f128'}.apbct-icon-info:before{content:'\f129'}.apbct-icon-attention-alt:before{content:'\f12a'}.apbct-icon-ellipsis:before{content:'\f141'}.apbct-icon-ellipsis-vert:before{content:'\f142'}.apbct-icon-euro:before{content:'\f153'}.apbct-icon-pound:before{content:'\f154'}.apbct-icon-dollar:before{content:'\f155'}.apbct-icon-rupee:before{content:'\f156'}.apbct-icon-yen:before{content:'\f157'}.apbct-icon-rouble:before{content:'\f158'}.apbct-icon-won:before{content:'\f159'}.apbct-icon-bitcoin:before{content:'\f15a'}.apbct-icon-sort-alt-up:before{content:'\f160'}.apbct-icon-sort-alt-down:before{content:'\f161'}.apbct-icon-bug:before{content:'\f188'}.apbct-icon-try:before{content:'\f195'}.apbct-icon-wordpress:before{content:'\f19a'}.apbct-icon-cubes:before{content:'\f1b3'}.apbct-icon-database:before{content:'\f1c0'}.apbct-icon-circle-thin:before{content:'\f1db'}.apbct-icon-sliders:before{content:'\f1de'}.apbct-icon-share:before{content:'\f1e0'}.apbct-icon-plug:before{content:'\f1e6'}.apbct-icon-trash:before{content:'\f1f8'}.apbct-icon-chart-line:before{content:'\f201'}.apbct-icon-shekel:before{content:'\f20b'}.apbct-icon-user-secret:before{content:'\f21b'}.apbct-icon-user-plus:before{content:'\f234'}.apbct-icon-user-times:before{content:'\f235'}.apbct-icon-viacoin:before{content:'\f237'}.apbct-icon-safari:before{content:'\f267'}.apbct-icon-chrome:before{content:'\f268'}.apbct-icon-firefox:before{content:'\f269'}.apbct-icon-opera:before{content:'\f26a'}.apbct-icon-internet-explorer:before{content:'\f26b'}.apbct-icon-television:before{content:'\f26c'}.apbct-icon-percent:before{content:'\f295'} \ No newline at end of file +@font-face{font-family:fontello;src:url(fonts/icons/icons.eot);src:url(fonts/icons/icons.eot) format('embedded-opentype'),url(fonts/icons/icons.woff2) format('woff2'),url(fonts/icons/icons.woff) format('woff'),url(fonts/icons/icons.ttf) format('truetype'),url(fonts/icons/icons.svg) format('svg');font-weight:400;font-style:normal}[class*=" apbct-icon-"]:before,[class^=apbct-icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.apbct-icon-download:before{content:'\e800'}.apbct-icon-glass:before{content:'\e801'}.apbct-icon-emo-happy:before{content:'\e802'}.apbct-icon-search:before{content:'\e803'}.apbct-icon-emo-unhappy:before{content:'\e804'}.apbct-icon-mail:before{content:'\e805'}.apbct-icon-info-circled:before{content:'\e806'}.apbct-icon-help-circled:before{content:'\e807'}.apbct-icon-heart:before{content:'\e808'}.apbct-icon-heart-empty:before{content:'\e809'}.apbct-icon-star:before{content:'\e80a'}.apbct-icon-star-empty:before{content:'\e80b'}.apbct-icon-user:before{content:'\e80c'}.apbct-icon-users:before{content:'\e80d'}.apbct-icon-th-large:before{content:'\e80e'}.apbct-icon-th:before{content:'\e80f'}.apbct-icon-th-list:before{content:'\e810'}.apbct-icon-to-end:before{content:'\e811'}.apbct-icon-to-start:before{content:'\e812'}.apbct-icon-fast-fw:before{content:'\e813'}.apbct-icon-fast-bw:before{content:'\e814'}.apbct-icon-off:before{content:'\e815'}.apbct-icon-chart-bar:before{content:'\e816'}.apbct-icon-home:before{content:'\e817'}.apbct-icon-link-1:before{content:'\e818'}.apbct-icon-lock-open:before{content:'\e819'}.apbct-icon-eye:before{content:'\e81a'}.apbct-icon-eye-off:before{content:'\e81b'}.apbct-icon-download-1:before{content:'\e81c'}.apbct-icon-chat:before{content:'\e81d'}.apbct-icon-comment:before{content:'\e81e'}.apbct-icon-doc:before{content:'\e81f'}.apbct-icon-lock:before{content:'\e820'}.apbct-icon-emo-wink2:before{content:'\e821'}.apbct-icon-plus:before{content:'\e822'}.apbct-icon-upload:before{content:'\e823'}.apbct-icon-picture:before{content:'\e824'}.apbct-icon-ok:before{content:'\e825'}.apbct-icon-cancel:before{content:'\e826'}.apbct-icon-pencil:before{content:'\e827'}.apbct-icon-edit:before{content:'\e828'}.apbct-icon-forward:before{content:'\e829'}.apbct-icon-export:before{content:'\e82a'}.apbct-icon-trash-empty:before{content:'\e82b'}.apbct-icon-down-dir:before{content:'\e82c'}.apbct-icon-up-dir:before{content:'\e82d'}.apbct-icon-left-dir:before{content:'\e82e'}.apbct-icon-right-dir:before{content:'\e82f'}.apbct-icon-spin1:before{content:'\e830'}.apbct-icon-spin2:before{content:'\e831'}.apbct-icon-mobile:before{content:'\e832'}.apbct-icon-bell:before{content:'\e833'}.apbct-icon-ccw:before{content:'\e834'}.apbct-icon-wrench:before{content:'\e835'}.apbct-icon-stop-1:before{content:'\e837'}.apbct-icon-spin5:before{content:'\e838'}.apbct-icon-pause-1:before{content:'\e839'}.apbct-icon-play-1:before{content:'\e83a'}.apbct-icon-link-ext:before{content:'\f08e'}.apbct-icon-menu:before{content:'\f0c9'}.apbct-icon-sort:before{content:'\f0dc'}.apbct-icon-mail-alt:before{content:'\f0e0'}.apbct-icon-lightbulb:before{content:'\f0eb'}.apbct-icon-exchange:before{content:'\f0ec'}.apbct-icon-upload-cloud:before{content:'\f0ee'}.apbct-icon-bell-alt:before{content:'\f0f3'}.apbct-icon-doc-text:before{content:'\f0f6'}.apbct-icon-angle-double-left:before{content:'\f100'}.apbct-icon-angle-double-right:before{content:'\f101'}.apbct-icon-angle-double-up:before{content:'\f102'}.apbct-icon-angle-double-down:before{content:'\f103'}.apbct-icon-desktop:before{content:'\f108'}.apbct-icon-laptop:before{content:'\f109'}.apbct-icon-tablet:before{content:'\f10a'}.apbct-icon-circle-empty:before{content:'\f10c'}.apbct-icon-circle:before{content:'\f111'}.apbct-icon-unlink:before{content:'\f127'}.apbct-icon-help:before{content:'\f128'}.apbct-icon-info:before{content:'\f129'}.apbct-icon-attention-alt:before{content:'\f12a'}.apbct-icon-ellipsis:before{content:'\f141'}.apbct-icon-ellipsis-vert:before{content:'\f142'}.apbct-icon-euro:before{content:'\f153'}.apbct-icon-pound:before{content:'\f154'}.apbct-icon-dollar:before{content:'\f155'}.apbct-icon-rupee:before{content:'\f156'}.apbct-icon-yen:before{content:'\f157'}.apbct-icon-rouble:before{content:'\f158'}.apbct-icon-won:before{content:'\f159'}.apbct-icon-bitcoin:before{content:'\f15a'}.apbct-icon-sort-alt-up:before{content:'\f160'}.apbct-icon-sort-alt-down:before{content:'\f161'}.apbct-icon-bug:before{content:'\f188'}.apbct-icon-try:before{content:'\f195'}.apbct-icon-wordpress:before{content:'\f19a'}.apbct-icon-cubes:before{content:'\f1b3'}.apbct-icon-database:before{content:'\f1c0'}.apbct-icon-circle-thin:before{content:'\f1db'}.apbct-icon-sliders:before{content:'\f1de'}.apbct-icon-share:before{content:'\f1e0'}.apbct-icon-plug:before{content:'\f1e6'}.apbct-icon-trash:before{content:'\f1f8'}.apbct-icon-chart-line:before{content:'\f201'}.apbct-icon-shekel:before{content:'\f20b'}.apbct-icon-user-secret:before{content:'\f21b'}.apbct-icon-user-plus:before{content:'\f234'}.apbct-icon-user-times:before{content:'\f235'}.apbct-icon-viacoin:before{content:'\f237'}.apbct-icon-safari:before{content:'\f267'}.apbct-icon-chrome:before{content:'\f268'}.apbct-icon-firefox:before{content:'\f269'}.apbct-icon-opera:before{content:'\f26a'}.apbct-icon-internet-explorer:before{content:'\f26b'}.apbct-icon-television:before{content:'\f26c'}.apbct-icon-percent:before{content:'\f295'} \ No newline at end of file diff --git a/css/cleantalk-public-admin.min.css b/css/cleantalk-public-admin.min.css index 012a3b988..49ec12714 100644 --- a/css/cleantalk-public-admin.min.css +++ b/css/cleantalk-public-admin.min.css @@ -1 +1 @@ -.ct_hidden{display:none}.ct_comment_info a,.ct_comment_info img,p.ct_comment_info_title,p.ct_comment_logo_title{display:inline-block}.ct_comment_info{position:relative;font-size:11px;line-height:12px;margin-bottom:15px}.ct_comment_titles{border-bottom:1px solid gray!important;background:inherit;margin-bottom:15px}p.ct_comment_logo_title{float:right}.ct_comment_logo_img{height:12px;vertical-align:text-top;box-shadow:transparent 0 0 0!important}.ct_this_is{padding:2px 3px;cursor:pointer;white-space:nowrap;color:#000!important;background:rgba(230,230,230,1);border:1px solid #777;border-radius:4px}p.ct_feedback_wrap{display:none;position:absolute;top:37px;left:0;width:100%;height:27px;margin:0;padding:6px;border-radius:3px;background:#fff}.ct_feedback_result{display:none;text-decoration:underline}.ct_feedback_result_spam{color:red}.ct_feedback_result_not_spam{color:green}.ct_feedback_msg a{color:green!important;text-decoration:underline}.ct_feedback_success{color:green}.ct_feedback_error{color:red}.ct_feedback_no_hash{color:#00f}.ct_comment_info .ct_this_is img.--hide{display:none}.ct_comment_info .ct_this_is img.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none} \ No newline at end of file +.ct_hidden{display:none}.ct_comment_info{position:relative;font-size:11px;line-height:12px;margin-bottom:15px}.ct_comment_info a,.ct_comment_info img{display:inline-block}.ct_comment_titles{border-bottom:1px solid gray!important;background:inherit;margin-bottom:15px}p.ct_comment_info_title{display:inline-block}p.ct_comment_logo_title{float:right;display:inline-block}.ct_comment_logo_img{height:12px;vertical-align:text-top;box-shadow:transparent 0 0 0!important}.ct_this_is{padding:2px 3px;cursor:pointer;white-space:nowrap;color:#000!important;background:#e6e6e6;border:1px solid #777;border-radius:4px}p.ct_feedback_wrap{display:none;position:absolute;top:37px;left:0;width:100%;height:27px;margin:0;padding:6px 6px;border-radius:3px;background:#fff}.ct_feedback_result{display:none;text-decoration:underline}.ct_feedback_result_spam{color:red}.ct_feedback_result_not_spam{color:green}.ct_feedback_msg a{color:green!important;text-decoration:underline}.ct_feedback_success{color:green}.ct_feedback_error{color:red}.ct_feedback_no_hash{color:#00f}.ct_comment_info .ct_this_is img.--hide{display:none}.ct_comment_info .ct_this_is img.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none} \ No newline at end of file diff --git a/css/cleantalk-public.min.css b/css/cleantalk-public.min.css index ebfc4c13d..de52f6519 100644 --- a/css/cleantalk-public.min.css +++ b/css/cleantalk-public.min.css @@ -1 +1 @@ -#honeypot-field-url,.um-form input[type=text].apbct_special_field,.wc_apbct_email_id,input[class*=apbct].apbct_special_field,label[id*=apbct_label_id].apbct_special_field{display:none!important}.apbct-tooltip,.apbct-tooltip--text{border-radius:5px;background:#d3d3d3}.comment-form-cookies-consent{width:100%;overflow:hidden}.apbct-tooltip{display:none;position:inherit;margin-top:5px;left:5px;opacity:.9}.apbct-tooltip--text{position:sticky;padding:10px;width:max-content}.apbct-tooltip--arrow{position:absolute;background:#d3d3d3;width:10px;height:10px;top:-5px;left:10px;transform:rotate(135deg)}.apbct-trusted-text--div{font-size:small!important;display:inline-block;text-align:center;width:100%;margin-bottom:2pc}.apbct-trusted-text--center{font-size:small!important;display:block;text-align:center;width:100%;margin-bottom:2pc}.apbct-trusted-text--label{font-size:small!important;display:inline-block;text-align:center;width:100%;padding:5px 0}.apbct-trusted-text--label_left{font-size:small!important;display:inline-block;text-align:left;padding:5px 0}.apbct-trusted-text--span{display:inline-block}.apbct-popup-fade:before{content:'';background:#000;position:fixed;left:0;top:0;width:100%;height:100%;opacity:.7;z-index:9999}.apbct-popup{position:fixed;top:20%;left:50%;padding:20px;width:360px;margin-left:-200px;background:#fff;border:1px solid;border-radius:4px;z-index:99999;opacity:1}.apbct-check_email_exist-bad_email,.apbct-check_email_exist-good_email,.apbct-check_email_exist-load{z-index:9999!important;transition:none!important;background-size:contain;background-repeat:no-repeat!important;background-position-x:right;background-position-y:center;cursor:pointer!important}.apbct-check_email_exist-load{background-size:contain;background-image:url(../css/images/checking_email.gif)!important}.apbct-check_email_exist-block{position:fixed!important;display:block!important}.apbct-check_email_exist-good_email{background-image:url(../css/images/good_email.svg)!important}.apbct-check_email_exist-bad_email{background-image:url(../css/images/bad_email.svg)!important}.apbct-check_email_exist-popup_description{display:none;position:fixed!important;padding:2px!important;border:1px solid #E5E8ED!important;border-radius:16px 16px 0!important;background:#FFF!important;background-position-x:right!important;font-size:14px!important;text-align:center!important;transition:all 1s ease-out!important}@media screen and (max-width:782px){.apbct-check_email_exist-popup_description{width:100%!important}}.ct-encoded-form{display:none}.ct-encoded-form-loader{display:block;width:48px;height:48px;border:5px solid #f3f3f3;border-top:5px solid #3498db;border-radius:50%;animation:ct-encoded-form-loader-spin 1s linear infinite;margin:auto}@keyframes ct-encoded-form-loader-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.ct-encoded-form-forbidden{display:block;border:1px solid red;padding:10px;background:#fdd;color:red;font-weight:700}.comments-area .comment-list article .comment-author{overflow:visible!important} \ No newline at end of file +#honeypot-field-url{display:none!important}.comment-form-cookies-consent{width:100%;overflow:hidden}.wc_apbct_email_id{display:none!important}.um-form input[type=text].apbct_special_field,input[class*=apbct].apbct_special_field,label[id*=apbct_label_id].apbct_special_field{display:none!important}.apbct-tooltip{display:none;position:inherit;margin-top:5px;left:5px;background:#d3d3d3;border-radius:5px;opacity:.9}.apbct-tooltip--text{position:sticky;background:#d3d3d3;padding:10px;border-radius:5px;width:max-content}.apbct-tooltip--arrow{position:absolute;background:#d3d3d3;width:10px;height:10px;top:-5px;left:10px;transform:rotate(135deg)}.apbct-trusted-text--div{font-size:small!important;display:inline-block;text-align:center;width:100%;margin-bottom:2pc}.apbct-trusted-text--center{font-size:small!important;display:block;text-align:center;width:100%;margin-bottom:2pc}.apbct-trusted-text--label{font-size:small!important;display:inline-block;text-align:center;width:100%;padding:5px 0 5px 0}.apbct-trusted-text--label_left{font-size:small!important;display:inline-block;text-align:left;padding:5px 0 5px 0}.apbct-trusted-text--span{display:inline-block}.apbct-popup-fade:before{content:'';background:#000;position:fixed;left:0;top:0;width:100%;height:100%;opacity:.7;z-index:9999}.apbct-popup{position:fixed;top:20%;left:50%;padding:20px;width:360px;margin-left:-200px;background:#fff;border:1px solid;border-radius:4px;z-index:99999;opacity:1}.apbct-check_email_exist-bad_email,.apbct-check_email_exist-good_email,.apbct-check_email_exist-load{z-index:9999!important;transition:none!important;background-size:contain;background-repeat:no-repeat!important;background-position-x:right;background-position-y:center;cursor:pointer!important}.apbct-check_email_exist-load{background-size:contain;background-image:url(../css/images/checking_email.gif)!important}.apbct-check_email_exist-block{position:fixed!important;display:block!important}.apbct-check_email_exist-good_email{background-image:url(../css/images/good_email.svg)!important}.apbct-check_email_exist-bad_email{background-image:url(../css/images/bad_email.svg)!important}.apbct-check_email_exist-popup_description{display:none;position:fixed!important;padding:2px!important;border:1px solid #e5e8ed!important;border-radius:16px 16px 0 16px!important;background:#fff!important;background-position-x:right!important;font-size:14px!important;text-align:center!important;transition:all 1s ease-out!important}@media screen and (max-width:782px){.apbct-check_email_exist-popup_description{width:100%!important}}.ct-encoded-form{display:none}.ct-encoded-form-loader{display:block;width:48px;height:48px;border:5px solid #f3f3f3;border-top:5px solid #3498db;border-radius:50%;animation:ct-encoded-form-loader-spin 1s linear infinite;margin:auto}@keyframes ct-encoded-form-loader-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.ct-encoded-form-forbidden{display:block;border:1px solid red;padding:10px;background:#fdd;color:red;font-weight:700}.comments-area .comment-list article .comment-author{overflow:visible!important} \ No newline at end of file diff --git a/css/cleantalk-spam-check.min.css b/css/cleantalk-spam-check.min.css index a5c068e9b..41a20b387 100644 --- a/css/cleantalk-spam-check.min.css +++ b/css/cleantalk-spam-check.min.css @@ -1 +1 @@ -#ct_checking_count,#ct_checking_status,#ct_cooling_notice,#ct_error_message h3,#ct_error_message h4{text-align:center;width:90%}#ct_preloader{display:none;width:100%;text-align:center}#ct_preloader img{border:none!important}#ct_working_message{display:none;margin:1em auto auto;padding:3px;width:70%;border:2px dotted gray;background:#ff9}#ct_pause{display:none}.ct_check_params_elem_sub{margin:15px 0 0 25px;width:150px;display:inline-block}.ct_check_params_elem_sub_sub{margin:15px 0 0 50px}button#ct_check_spam_button{background:#2ea2cc;border-color:#0074a2;color:#fff;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15)}button#ct_check_spam_button:hover{color:#000}.ct_date{display:inline;width:150px}.ct_check_params_desc{display:inline-block;margin:5px 10px 10px 15px}#ct_check_tabs{border:1px solid #c5c5c5;border-radius:3px;padding:.2em;background:#fff}#ct_check_tabs ul{margin:0;padding:.2em .2em 0;border:1px solid #c5c5c5;border-radius:3px;background:#e9e9e9;color:#333;font-weight:700;display:flex}#ct_check_tabs ul li{list-style:none;position:relative;margin:1px .2em -1px 0;padding:0;white-space:nowrap;border:1px solid #c5c5c5;border-radius:3px 3px 0 0;background:#fff;font-weight:400}#ct_check_tabs ul li.active{border-bottom:1px solid transparent}#ct_check_tabs ul li a{display:block;padding:.5em 1em;text-decoration:none}#ct_check_tabs ul li.active a{font-weight:700}#ct_check_content{display:block;border-width:0;padding:1em 1.4em;background:0 0} \ No newline at end of file +#ct_checking_count,#ct_checking_status,#ct_cooling_notice,#ct_error_message h3,#ct_error_message h4{text-align:center;width:90%}#ct_preloader{display:none;width:100%;text-align:center}#ct_preloader img{border:none!important}#ct_working_message{display:none;margin:1em auto auto auto;padding:3px;width:70%;border:2px dotted gray;background:#ff9}#ct_pause{display:none}.ct_check_params_elem_sub{margin:15px 0 0 25px;width:150px;display:inline-block}.ct_check_params_elem_sub_sub{margin:15px 0 0 50px}button#ct_check_spam_button{background:#2ea2cc;border-color:#0074a2;color:#fff;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15)}button#ct_check_spam_button:hover{color:#000}.ct_date{display:inline;width:150px}.ct_check_params_desc{display:inline-block;margin:5px 10px 10px 15px}#ct_check_tabs{border:1px solid #c5c5c5;border-radius:3px;padding:.2em;background:#fff}#ct_check_tabs ul{margin:0;padding:.2em .2em 0;border:1px solid #c5c5c5;border-radius:3px;background:#e9e9e9;color:#333;font-weight:700;display:flex}#ct_check_tabs ul li{list-style:none;position:relative;margin:1px .2em -1px 0;padding:0;white-space:nowrap;border:1px solid #c5c5c5;border-radius:3px 3px 0 0;background:#fff;font-weight:400}#ct_check_tabs ul li.active{border-bottom:1px solid transparent}#ct_check_tabs ul li a{display:block;padding:.5em 1em;text-decoration:none}#ct_check_tabs ul li.active a{font-weight:700}#ct_check_content{display:block;border-width:0;padding:1em 1.4em;background:0 0} \ No newline at end of file diff --git a/css/cleantalk-trp.min.css b/css/cleantalk-trp.min.css index d38d3a54b..6fb2db36d 100644 --- a/css/cleantalk-trp.min.css +++ b/css/cleantalk-trp.min.css @@ -1 +1 @@ -.apbct-real-user-wrapper{display:inline-flex;color:#000!important;flex-wrap:nowrap;justify-content:center;flex-direction:row;align-items:center}.apbct-real-user-wrapper-woo{display:inline;align-items:center;color:#444!important;font-size:14px}.apbct-real-user-author-name{display:inline-flex}.apbct-real-user-badge{display:inline-flex;padding-left:6px;cursor:pointer;position:relative}.apbct-real-user-popup{position:absolute;padding:8px;font-weight:400;color:#000!important;background:#fff;border:1px solid #ccc;border-radius:4px;box-shadow:5px 5px 24px -11px #444;z-index:-1;cursor:default;opacity:0;transition-property:opacity,z-index}.apbct-real-user-popup.visible{z-index:1;opacity:1}.apbct-real-user-title{display:grid;gap:4px!important}.apbct-real-user-popup-content_row{display:flex;flex-direction:column;gap:1px}.apbct-real-user-popup-img{align-self:start;margin:0!important;height:max-content;vertical-align:center}.apbct-real-user-popup-header{font-weight:bolder;margin:2px!important} \ No newline at end of file +.apbct-real-user-wrapper{display:inline-flex;color:#000!important;flex-wrap:nowrap;justify-content:center;flex-direction:row;align-items:center}.apbct-real-user-wrapper-woo{display:inline;align-items:center;color:#444!important;font-size:14px}.apbct-real-user-author-name{display:inline-flex}.apbct-real-user-badge{display:inline-flex;padding-left:6px;cursor:pointer;position:relative}.apbct-real-user-popup{position:absolute;padding:8px;font-weight:400;color:#000!important;background:#fff;border:1px #ccc solid;border-radius:4px;box-shadow:5px 5px 24px -11px #444;z-index:-1;cursor:default;opacity:0;transition-property:opacity,z-index}.apbct-real-user-popup.visible{z-index:1;opacity:1}.apbct-real-user-title{display:grid;gap:4px!important}.apbct-real-user-popup-content_row{display:flex;flex-direction:column;gap:1px}.apbct-real-user-popup-img{align-self:start;margin:0!important;height:max-content;vertical-align:center}.apbct-real-user-popup-header{font-weight:bolder;margin:2px!important} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 4ba0b0914..51765937f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,7 +4,7 @@ var gulp = require('gulp'), sourcemaps = require('gulp-sourcemaps'), uglify = require('gulp-uglify'), rename = require('gulp-rename'), - cssmin = require('gulp-cssmin'), + cleanCSS = require('gulp-clean-css'), concat = require('gulp-concat'), babel = require('gulp-babel'); @@ -13,7 +13,7 @@ var gulp = require('gulp'), */ gulp.task('compress-css', function () { return gulp.src('css/src/*.css') - .pipe(cssmin()) + .pipe(cleanCSS()) .pipe(rename({suffix: '.min'})) .pipe(gulp.dest('css')); }); diff --git a/package.json b/package.json index dc3f731e6..39a98889b 100644 --- a/package.json +++ b/package.json @@ -20,5 +20,8 @@ "gulp-sourcemap": "^1.0.1", "gulp-sourcemaps": "^2.6.5", "gulp-uglify": "^3.0.2" + }, + "dependencies": { + "gulp-clean-css": "^4.3.0" } } diff --git a/readme.txt b/readme.txt index 014137a96..adb40a964 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: antispam, comments, contact form, captcha, spam Requires at least: 4.7 Tested up to: 6.9 Requires PHP: 7.2 -Stable tag: 6.73.1 +Stable tag: 6.74 License: GPLv2 Blocks spam comments, fake users, contact form spam and more. No impact on SEO. Privacy focused. CAPTCHA free, premium Antispam plugin. From c15e091a5b1c24d090df839f2da62a348920e6a7 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 3 Mar 2026 22:54:22 +0700 Subject: [PATCH 29/32] Upd changelog, ver 6.74 --- readme.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/readme.txt b/readme.txt index adb40a964..265d17276 100644 --- a/readme.txt +++ b/readme.txt @@ -412,6 +412,23 @@ Yes, it is. Please read this article, == Changelog == += 6.74 05.03.2026 = +* Mod. SFW. Atomic approach to updating SFW +* Upd. Exclusions. Ajax. Plugin "cart-recovery". +* Fix. Code. JS loading by defer fixed. +* Mod. OtterForms. Changing integration from a hook to a route +* Mod. OtterForms. Changing the integration, renaming the request interception method +* Upd. Connection reports. Email subject updated. +* Fix. JS. catchFetchRequest. Origin fetch definitions. +* Upd. Exclusions. Ajax. Plugin "invoicing". +* Upd. Gravity Forms. Skipped request extended log. +* Fix. Translate. Fixed msgids. +* Upd. Connection reports. Email title edited. +* Upd. Connection reports. Service id added. +* Fix. SubmitTime. Calculation of the submit time when enabling the gathering script +* Upd. SFW updates sentinel. Updated report. +* Upd. Settings. Updated RC to init settings update. + = 6.73.1 19.02.2026 = * Fix. Code. JS loading by `defer` fixed. From d9d25028395cc113b5f07793420917d9257aa439 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 4 Mar 2026 16:16:53 +0700 Subject: [PATCH 30/32] Fix. SubmitTime. Editing the creation of a timestamp --- .../ApbctWP/RequestParameters/SubmitTimeHandler.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php index 742eb1ee1..2ed8af2c0 100644 --- a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php +++ b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php @@ -12,7 +12,7 @@ final class SubmitTimeHandler { const DEFAULT_VALUE = null; // Default value to return when calculation is disabled or invalid - const REQUEST_PARAM_NAME = 'ct_ps_timestamp'; // Name of the request parameter for the timestamp + const REQUEST_PARAM_NAME = 'apbct_timestamp'; // Name of the request parameter for the timestamp /** * Retrieves the time difference between the current time and the timestamp @@ -51,11 +51,6 @@ final public static function getFromRequest() */ final public static function setToRequest($current_timestamp, &$cookie_test_value) { - // Check if calculation is disabled globally - if (self::isCalculationDisabled()) { - return; - } - // Set the timestamp in the request RequestParameters::set(self::REQUEST_PARAM_NAME, (string)$current_timestamp, true); From e9c21591f8281fe6b53ac166c8419491b5215367 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 4 Mar 2026 16:17:47 +0700 Subject: [PATCH 31/32] Upd changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 265d17276..17a69c0c8 100644 --- a/readme.txt +++ b/readme.txt @@ -428,6 +428,7 @@ Yes, it is. Please read this article, * Fix. SubmitTime. Calculation of the submit time when enabling the gathering script * Upd. SFW updates sentinel. Updated report. * Upd. Settings. Updated RC to init settings update. +* Fix. SubmitTime. Editing the creation of a timestamp = 6.73.1 19.02.2026 = * Fix. Code. JS loading by `defer` fixed. From 4216a5018c22a3318801fad81db4c4c8c94b1a94 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 4 Mar 2026 17:04:40 +0700 Subject: [PATCH 32/32] Fix. SubmitTime. Editing the creation of a timestamp --- .../ApbctWP/RequestParameters/SubmitTimeHandler.php | 2 +- tests/ApbctWP/TestSubmitTimeHandler.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php index 2ed8af2c0..67122704d 100644 --- a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php +++ b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php @@ -12,7 +12,7 @@ final class SubmitTimeHandler { const DEFAULT_VALUE = null; // Default value to return when calculation is disabled or invalid - const REQUEST_PARAM_NAME = 'apbct_timestamp'; // Name of the request parameter for the timestamp + const REQUEST_PARAM_NAME = 'ct_ps_timestamp'; // Name of the request parameter for the timestamp /** * Retrieves the time difference between the current time and the timestamp diff --git a/tests/ApbctWP/TestSubmitTimeHandler.php b/tests/ApbctWP/TestSubmitTimeHandler.php index 4f1d054b2..4d86edb9e 100644 --- a/tests/ApbctWP/TestSubmitTimeHandler.php +++ b/tests/ApbctWP/TestSubmitTimeHandler.php @@ -19,7 +19,7 @@ public function testGetFromRequestReturnsNullWhenCalculationDisabled() } - public function testSetToRequestDoesNotModifyWhenCalculationDisabled() + public function testSetToRequestModifiesArrayRegardlessOfCalculationDisabled() { global $apbct; $apbct = (object) [ @@ -28,9 +28,12 @@ public function testSetToRequestDoesNotModifyWhenCalculationDisabled() ]; $cookie_test_value = []; - SubmitTimeHandler::setToRequest(time(), $cookie_test_value); + $timestamp = time(); + SubmitTimeHandler::setToRequest($timestamp, $cookie_test_value); - $this->assertEmpty($cookie_test_value); + $this->assertNotEmpty($cookie_test_value); + $this->assertContains('ct_ps_timestamp', $cookie_test_value['cookies_names']); + $this->assertEquals((string)$timestamp, $cookie_test_value['check_value']); } public function testIsCalculationDisabledReturnsTrueWhenBotDetectorEnabled()