{"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["/**\n * Base class\n */\nclass ApbctCore {\n ajax_parameters = {};\n restParameters = {};\n\n selector = null;\n elements = [];\n\n // Event properties\n eventCallback;\n eventSelector;\n event;\n\n /**\n * Default constructor\n * @param {string} selector\n */\n constructor(selector) {\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param {string} selector\n * @return {*}\n */\n select(selector) {\n if (selector instanceof HTMLCollection) {\n this.selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n } else if ( typeof selector === 'object' ) {\n this.selector = null;\n this.elements = [];\n this.elements[0] = selector;\n } else if ( typeof selector === 'string' ) {\n this.selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n } else {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {object|string} elemToAdd\n */\n addElement(elemToAdd) {\n if ( typeof elemToAdd === 'object' ) {\n this.elements.push(elemToAdd);\n } else if ( typeof elemToAdd === 'string' ) {\n this.selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n } else {\n this.deselect();\n }\n }\n\n /**\n * @param {object} elem\n */\n push(elem) {\n this.elements.push(elem);\n }\n\n /**\n * reduce\n */\n reduce() {\n this.elements = this.elements.slice(0, -1);\n }\n\n /**\n * deselect\n */\n deselect() {\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param {object|string} style\n * @param {boolean} getRaw\n *\n * @return {boolean|*}\n */\n css(style, getRaw) {\n getRaw = getRaw || false;\n\n // Set style\n if (typeof style === 'object') {\n const stringToCamelCase = (str) =>\n str.replace(/([-_][a-z])/g, (group) =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', ''),\n );\n\n // Apply multiple styles\n for (const styleName in style) {\n if (Object.hasOwn(style, styleName)) {\n const DomStyleName = stringToCamelCase(styleName);\n\n // Apply to multiple elements (currently selected)\n for (let i=0; i= 0; i-- ) {\n if ( ! this.isElem(this.elements[i], filter) ) {\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /**\n * NODES\n */\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parent(filter) {\n this.select(this.elements[0].parentElement);\n\n if ( typeof filter !== 'undefined' && ! this.is(filter) ) {\n this.deselect();\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n parents(filter) {\n this.select(this.elements[0]);\n\n for ( ; this.elements[this.elements.length - 1].parentElement !== null; ) {\n this.push(this.elements[this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0, 1); // Deleting initial element from the set\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n children(filter) {\n this.select(this.elements[0].children);\n\n if ( typeof filter !== 'undefined' ) {\n this.filter(filter);\n }\n\n return this;\n }\n\n /**\n * @param {mixed} filter\n * @return {ApbctCore}\n */\n siblings(filter) {\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /** ************ DOM MANIPULATIONS **************/\n remove() {\n for (let elem of this.elements) {\n elem.remove();\n }\n }\n\n /**\n * @param {string} content\n */\n after(content) {\n for (let elem of this.elements) {\n elem.after(content);\n }\n }\n\n /**\n * @param {string} content\n */\n append(content) {\n for (let elem of this.elements) {\n elem.append(content);\n }\n }\n\n /** ************ ANIMATION **************/\n /**\n * @param {number} time\n */\n fadeIn(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n /**\n * @param {number} time\n */\n fadeOut(time) {\n for (let elem of this.elements) {\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function() {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * @param {mixed} msg\n * @param {string} url\n */\nfunction ctProcessError(msg, url) {\n let log = {};\n if (msg && msg.message) {\n log.err = {\n 'msg': msg.message,\n 'file': !!msg.fileName ? msg.fileName : false,\n 'ln': !!msg.lineNumber ? msg.lineNumber : !!lineNo ? lineNo : false,\n 'col': !!msg.columnNumber ? msg.columnNumber : !!columnNo ? columnNo : false,\n 'stacktrace': !!msg.stack ? msg.stack : false,\n 'cause': !!url ? JSON.stringify(url) : false,\n 'errorObj': !!error ? error : false,\n };\n } else {\n log.err = {\n 'msg': msg,\n };\n\n if (!!url) {\n log.err.file = url;\n }\n }\n\n log.url = window.location.href;\n log.userAgent = window.navigator.userAgent;\n\n let ctJsErrors = 'ct_js_errors';\n let errArray = localStorage.getItem(ctJsErrors);\n if (errArray === null) errArray = '[]';\n errArray = JSON.parse(errArray);\n for (let i = 0; i < errArray.length; i++) {\n if (errArray[i].err.msg === log.err.msg) {\n return;\n }\n }\n\n errArray.push(log);\n localStorage.setItem(ct_js_errors, JSON.stringify(errArray));\n}\n\nif (Math.floor(Math.random() * 100) === 1) {\n window.onerror = function(exception, url) {\n let filterWords = ['apbct', 'ctPublic'];\n let length = filterWords.length;\n while (length--) {\n if (exception.indexOf(filterWords[length]) !== -1) {\n ctProcessError(exception, url);\n }\n }\n\n return false;\n };\n}\n\n/**\n * Enter point to ApbctCore class\n *\n * @param {array|object} params\n * @return {*}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction apbct(params) {\n return new ApbctCore()\n .select(params);\n}\n\n/**\n * ApbctXhr\n */\nclass ApbctXhr {\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(parameters) {\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for ( let key in parameters ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if ( ! this.url ) {\n console.log('%cXHR%c not URL provided',\n 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function() {\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function() {\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event) {\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function() {\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function() {\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n /**\n * prepare\n */\n prepare() {\n // Disable button\n if (this.button) {\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n /**\n * complete\n */\n complete() {\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if (this.button) {\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if (this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n /**\n * onReadyStateChange\n */\n onReadyStateChange() {\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function') {\n this.on_ready_state_change();\n }\n }\n\n /**\n * @param {object} event\n */\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function') {\n this.on_progress();\n }\n }\n\n /**\n * onError\n */\n onError() {\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text,\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback(this.status_text);\n }\n }\n\n /**\n * onTimeout\n */\n onTimeout() {\n this.complete();\n this.error(\n 0,\n 'timeout',\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function') {\n this.onErrorCallback('Timeout');\n }\n }\n\n /**\n * @return {boolean}\n */\n onLoad() {\n this.complete();\n\n if (this.responseType === 'json' ) {\n if (this.xhr.response === null) {\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n } else if ( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n /**\n * @param {number} httpCode\n * @param {string} statusText\n * @param {string} additionalMsg\n */\n error(httpCode, statusText, additionalMsg) {\n let errorString = '';\n\n if ( statusText === 'timeout' ) {\n errorString += 'Server response timeout';\n } else if ( httpCode === 200 ) {\n if ( statusText === 'parsererror' ) {\n errorString += 'Unexpected response from server. See console for details.';\n } else {\n errorString += 'Unexpected error. Status: ' + statusText + '.';\n if ( typeof additionalMsg !== 'undefined' ) {\n errorString += ' Additional error info: ' + additionalMsg;\n }\n }\n } else if (httpCode === 500) {\n errorString += 'Internal server error.';\n } else {\n errorString += 'Unexpected response code:' + httpCode;\n }\n\n this.errorOutput( errorString );\n }\n\n /**\n * @param {string} errorMsg\n */\n errorOutput(errorMsg) {\n console.log( '%c ctXHR error: %c' + errorMsg, 'color: red;', 'color: grey;' );\n }\n\n /**\n * setHeaders\n */\n setHeaders() {\n // Set headers if passed\n for ( let headerName in this.headers ) {\n if ( typeof this.headers[headerName] !== 'undefined' ) {\n this.xhr.setRequestHeader(headerName, this.headers[headerName]);\n }\n }\n }\n\n /**\n * @return {string|*}\n */\n convertData() {\n // GET, HEAD request-type\n if ( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ) {\n return this.convertDataToURL();\n\n // POST request-type\n } else {\n return this.convertDataToBody();\n }\n }\n\n /**\n * @return {string}\n */\n convertDataToURL() {\n let paramsAppendix = new URLSearchParams(this.data).toString();\n let paramsPrefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += paramsPrefix + paramsAppendix;\n\n return this.url;\n }\n\n /**\n * @return {null}\n */\n convertDataToBody() {\n this.body = new FormData();\n for (let dataKey in this.data) {\n if (Object.hasOwn(this.data, dataKey)) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object' ?\n JSON.stringify(this.data[dataKey]) :\n this.data[dataKey],\n );\n }\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {object} object\n * @return {*}\n */\n deleteDoubleJSONEncoding(object) {\n if ( typeof object === 'object') {\n for (let objectKey in object) {\n if (Object.hasOwn(object, objectKey)) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n let parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n }\n\n return object;\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctAjax extends ApbctXhr {\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n super(args[0]);\n }\n}\n// eslint-disable-next-line require-jsdoc\nclass ApbctRest extends ApbctXhr {\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n // eslint-disable-next-line require-jsdoc\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n 'X-WP-Nonce': ctPublicFunctions._rest_nonce,\n };\n super(args);\n }\n}\n\n/**\n * @param {object|array|string} cookies\n * @param {object|array|string} value\n * @param {string|number} expires\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetCookie( cookies, value, expires ) {\n let listOfCookieNamesToForceAlt = [\n 'ct_sfw_pass_key',\n 'ct_sfw_passed',\n 'wordpress_apbct_antibot',\n 'apbct_anticrawler_passed',\n 'apbct_antiflood_passed',\n 'apbct_email_encoder_passed',\n ];\n\n let skipAlt = false;\n\n if ( typeof cookies === 'string') {\n skipAlt = cookies === 'ct_pointer_data';\n if ( typeof value === 'string' || typeof value === 'number' ) {\n cookies = [[cookies, value, expires]];\n }\n }\n\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n let forcedAltCookiesSet = [];\n cookies.forEach( function(item) {\n if (listOfCookieNamesToForceAlt.indexOf(item[0]) !== -1) {\n forcedAltCookiesSet.push(item);\n } else {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]));\n }\n });\n // if cookies from list found use alt cookies for this selection set\n if ( forcedAltCookiesSet.length > 0 ) {\n ctSetAlternativeCookie(forcedAltCookiesSet);\n }\n\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n } else {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n // If problem integration forms detected use alt cookies for whole cookies set\n if ( ctPublic.force_alt_cookies && !skipAlt) {\n // do it just once\n ctSetAlternativeCookie(cookies, {forceAltCookies: true});\n }\n cookies.forEach( function(item) {\n const _expires = typeof item[2] !== 'undefined' ? 'expires=' + expires + '; ' : '';\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix +\n item[0] +\n '=' +\n encodeURIComponent(item[1]) +\n '; ' +\n _expires +\n 'path=/; samesite=lax' +\n ctSecure;\n });\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' && !skipAlt ) {\n ctSetAlternativeCookie(cookies);\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctDetectForcedAltCookiesForms() {\n let ninjaFormsSign = document.querySelectorAll('#tmpl-nf-layout').length > 0;\n let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0;\n let smartFormsSign = document.querySelectorAll('script[id*=\"smart-forms\"]').length > 0;\n let jetpackCommentsForm = document.querySelectorAll('iframe[name=\"jetpack_remote_comment\"]').length > 0;\n let cwginstockForm = document.querySelectorAll('.cwginstock-subscribe-form').length > 0;\n let userRegistrationProForm = document.querySelectorAll('div[id^=\"user-registration-form\"]').length > 0;\n let etPbDiviSubscriptionForm = document.querySelectorAll('div[class^=\"et_pb_newsletter_form\"]').length > 0;\n let fluentBookingApp = document.querySelectorAll('div[class^=\"fluent_booking_app\"]').length > 0;\n ctPublic.force_alt_cookies = smartFormsSign ||\n ninjaFormsSign ||\n jetpackCommentsForm ||\n elementorUltimateAddonsRegister ||\n cwginstockForm ||\n userRegistrationProForm ||\n etPbDiviSubscriptionForm ||\n fluentBookingApp;\n\n setTimeout(function() {\n if (!ctPublic.force_alt_cookies) {\n let bookingPress = document.querySelectorAll('main[id^=\"bookingpress_booking_form\"]').length > 0;\n ctPublic.force_alt_cookies = bookingPress;\n }\n }, 1000);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctSetAlternativeCookie(cookies, params) {\n if (typeof (getJavascriptClientData) === 'function' ) {\n // reprocess already gained cookies data\n if (Array.isArray(cookies)) {\n cookies = getJavascriptClientData(cookies);\n }\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded');\n }\n\n try {\n cookies = JSON.parse(cookies);\n } catch (e) {\n console.log('APBCT ERROR: JSON parse error:' + e);\n return;\n }\n\n const callback = params && params.callback || null;\n const onErrorCallback = params && params.onErrorCallback || null;\n\n if ( params && params.forceAltCookies ) {\n cookies.apbct_force_alt_cookies = true;\n }\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n // fix for url encoded cookie apbct_pixel_url on REST route\n if (typeof cookies.apbct_pixel_url === 'string' &&\n cookies.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookies.apbct_pixel_url = decodeURIComponent(cookies.apbct_pixel_url);\n }\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: {cookies: cookies},\n callback: callback,\n onErrorCallback: onErrorCallback,\n },\n );\n\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n callback: callback,\n onErrorCallback: onErrorCallback,\n },\n );\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @return {string|undefined}\n */\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctGetCookie(name) {\n let matches = document.cookie.match(new RegExp(\n '(?:^|; )' + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + '=([^;]*)',\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// eslint-disable-next-line require-jsdoc,no-unused-vars\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if ( ctPublicFunctions.data__cookies_type === 'none' ) {\n return;\n\n // Using traditional cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'native' ) {\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + '=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax' + ctSecure;\n\n // Using alternative cookies\n } else if ( ctPublicFunctions.data__cookies_type === 'alternative' ) {\n // @ToDo implement this logic\n }\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendAJAX(data, params, obj) {\n // Default params\n let _params = [];\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['callback_context'] = params.callback_context || null;\n _params['callback_params'] = params.callback_params || null;\n _params['async'] = params.async || true;\n _params['notJson'] = params.notJson || null;\n _params['responseType']= params.notJson ? 'text' : 'json';\n _params['timeout'] = params.timeout || 15000;\n _params['obj'] = obj || null;\n _params['button'] = params.button || null;\n _params['spinner'] = params.spinner || null;\n _params['progressbar'] = params.progressbar || null;\n _params['silent'] = params.silent || null;\n _params['no_nonce'] = params.no_nonce || null;\n _params['data'] = data;\n _params['url'] = ctPublicFunctions._ajax_url;\n\n if (typeof (data) === 'string') {\n if ( ! _params['no_nonce'] ) {\n _params['data'] = _params['data'] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params['data'] = _params['data'] + '&no_cache=' + Math.random();\n } else {\n if ( ! _params['no_nonce'] ) {\n _params['data']._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params['data'].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_public_sendREST( route, params ) {\n let _params = [];\n _params['route'] = route;\n _params['callback'] = params.callback || null;\n _params['onErrorCallback'] = params.onErrorCallback || null;\n _params['data'] = params.data || [];\n _params['method'] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\n/**\n * Generate unique ID\n * @return {string}\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctGenerateUniqueID() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n}\n\nlet apbctLocalStorage = {\n get: function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n if ( json.hasOwnProperty(property) ) {\n try {\n // if property can be parsed as JSON - do it\n return JSON.parse( json[property] );\n } catch (e) {\n // if not - return string of value\n return json[property].toString();\n }\n } else {\n return json;\n }\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set: function(key, value, isJson = true) {\n if (isJson) {\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive: function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet: function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete: function(key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData: function() {\n let data = {};\n for (let i=0; i {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctDate = new Date();\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctCheckedEmails = {};\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\n\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_attach_event_handler(elem, event, callback) {\n if (typeof window.addEventListener === 'function') elem.addEventListener(event, callback);\n else elem.attachEvent(event, callback);\n}\n// eslint-disable-next-line require-jsdoc,camelcase\nfunction apbct_remove_event_handler(elem, event, callback) {\n if (typeof window.removeEventListener === 'function') elem.removeEventListener(event, callback);\n else elem.detachEvent(event, callback);\n}\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n// run cron jobs\ncronFormsHandler(2000);\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Do handle periodical actions.\n * @param {int} cronStartTimeout Time to go before cron start.\n */\nfunction cronFormsHandler(cronStartTimeout = 2000) {\n setTimeout(function() {\n setInterval(function() {\n restartFieldsListening();\n restartBotDetectorEventTokenAttach();\n }, 2000);\n }, cronStartTimeout);\n}\n\n/**\n * Restart event_token attachment if some forms load after document ready.\n */\nfunction restartBotDetectorEventTokenAttach() {\n // List there any new conditions, right now it works only for LatePoint forms.\n // Probably, we can remove this condition at all, because setEventTokenField()\n // checks all the forms without the field\n const doAttach = (\n document.getElementsByClassName('latepoint-form').length > 0 ||\n document.getElementsByClassName('mec-booking-form-container').length > 0\n );\n\n try {\n if ( doAttach ) {\n // get token from LS\n const token = apbctLocalStorage.get('bot_detector_event_token');\n if (typeof setEventTokenField === 'function' && token !== undefined && token.length === 64) {\n setEventTokenField(token);\n }\n // probably there we could use a new botDetectorInit if token is not found\n }\n } catch (e) {\n console.log(e.toString());\n }\n}\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * @param {mixed} e\n */\nfunction checkEmail(e) {\n let currentEmail = e.target.value;\n if (currentEmail && !(currentEmail in ctCheckedEmails)) {\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'check_email_before_post',\n {\n method: 'POST',\n data: {'email': currentEmail},\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n // Using AJAX request and handler\n } else if ( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_email_check_before_post',\n email: currentEmail,\n },\n {\n callback: function(result) {\n if (result.result) {\n ctCheckedEmails[currentEmail] = {\n 'result': result.result,\n 'timestamp': Date.now() / 1000 |0,\n };\n ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n }\n },\n },\n );\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImg(pixelUrl) {\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( +ctPublic.pixel__enabled ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if ( +ctPublic.pixel__enabled ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n */\nfunction ctGetPixelUrl() {\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n }\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n */\nfunction restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n ctStartFieldsListening();\n }\n}\n\n/**\n * init listeners for keyup and focus events\n */\nfunction ctStartFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\n/**\n * ctPreloadLocalStorage\n */\nfunction ctPreloadLocalStorage() {\n if (ctPublic.data__to_local_storage) {\n let data = Object.entries(ctPublic.data__to_local_storage);\n data.forEach(([key, value]) => {\n apbctLocalStorage.set(key, value);\n });\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * Prepare block to intercept AJAX response\n */\nfunction apbctPrepareBlockForAjaxForms() {\n // eslint-disable-next-line require-jsdoc\n function ctPrepareBlockMessage(xhr) {\n if (xhr.responseText &&\n xhr.responseText.indexOf('\"apbct') !== -1 &&\n xhr.responseText.indexOf('DOCTYPE') === -1\n ) {\n try {\n ctParseBlockMessage(JSON.parse(xhr.responseText));\n } catch (e) {\n console.log(e.toString());\n }\n }\n }\n\n if (typeof jQuery !== 'undefined') {\n // Capturing responses and output block message for unknown AJAX forms\n if (typeof jQuery(document).ajaxComplete() !== 'function') {\n jQuery(document).on('ajaxComplete', function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n } else {\n jQuery(document).ajaxComplete( function(event, xhr, settings) {\n ctPrepareBlockMessage(xhr);\n });\n }\n }\n}\n\n/**\n * Ready function\n */\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_ready() {\n // this way calls a lot of apbct_ready(), needs to find another way\n // if (typeof jQuery !== 'undefined') {\n // jQuery(document).on('gform_page_loaded', function() {\n // apbct_ready();\n // });\n // }\n\n apbctPrepareBlockForAjaxForms();\n\n ctPreloadLocalStorage();\n\n // set session ID\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = apbctGenerateUniqueID();\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n\n apbctWriteReferrersToSessionStorage();\n\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n\n ctStartFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(ctStartFieldsListening, 1000);\n\n window.addEventListener('animationstart', apbctOnAnimationStart, true);\n window.addEventListener('input', apbctOnInput, true);\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n\n // Collect scrolling info\n const initCookies = [\n ['ct_ps_timestamp', Math.floor(new Date().getTime() / 1000)],\n ['ct_fkp_timestamp', '0'],\n ['ct_pointer_data', '0'],\n // eslint-disable-next-line camelcase\n ['ct_timezone', ctDate.getTimezoneOffset()/60*(-1)],\n ['ct_screen_info', apbctGetScreenInfo()],\n ['apbct_headless', navigator.webdriver],\n ];\n\n apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n apbctLocalStorage.set('ct_fkp_timestamp', '0');\n apbctLocalStorage.set('ct_pointer_data', '0');\n // eslint-disable-next-line camelcase\n apbctLocalStorage.set('ct_timezone', ctDate.getTimezoneOffset()/60*(-1) );\n apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n apbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n if ( ctPublic.data__cookies_type !== 'native' ) {\n initCookies.push(['apbct_visible_fields', '0']);\n } else {\n // Delete all visible fields cookies on load the page\n let cookiesArray = document.cookie.split(';');\n if ( cookiesArray.length !== 0 ) {\n for ( let i = 0; i < cookiesArray.length; i++ ) {\n let currentCookie = cookiesArray[i].trim();\n let cookieName = currentCookie.split('=')[0];\n if ( cookieName.indexOf('apbct_visible_fields_') === 0 ) {\n ctDeleteCookie(cookieName);\n }\n }\n }\n }\n\n if ( +ctPublic.pixel__setting ) {\n if ( +ctPublic.pixel__enabled ) {\n ctGetPixelUrl();\n } else {\n initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n }\n }\n\n if ( +ctPublic.data__email_check_before_post) {\n initCookies.push(['ct_checked_emails', '0']);\n apbct('input[type = \\'email\\'], #email').on('blur', checkEmail);\n }\n\n if (apbctLocalStorage.isSet('ct_checkjs')) {\n initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n } else {\n initCookies.push(['ct_checkjs', 0]);\n }\n\n // detect integrated forms that need to be handled via alternative cookies\n ctDetectForcedAltCookiesForms();\n\n // send bot detector event token to alt cookies on problem forms\n if (typeof ctPublic.force_alt_cookies !== 'undefined' &&\n ctPublic.force_alt_cookies &&\n apbctLocalStorage.get('bot_detector_event_token') &&\n // do bot set if (ct_bot_detector_event_token) already set,\n // and it is equal to newly added from moderate (bot_detector_event_token)\n apbctLocalStorage.get('ct_bot_detector_event_token') !== apbctLocalStorage.get('bot_detector_event_token')\n ) {\n initCookies.push(['ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token')]);\n }\n\n if (!ctPublic.force_alt_cookies && ctPublic.data__cookies_type == 'alternative') {\n ctPublic.force_alt_cookies = apbctLocalStorage.get('bot_detector_event_token');\n }\n\n ctSetCookie(initCookies);\n\n setTimeout(function() {\n if (\n typeof ctPublic.force_alt_cookies == 'undefined' ||\n (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)\n ) {\n ctNoCookieAttachHiddenFieldsToForms();\n }\n\n if (\n typeof ctPublic.data__cookies_type !== 'undefined' &&\n ctPublic.data__cookies_type === 'none'\n ) {\n ctAjaxSetupAddCleanTalkDataBeforeSendAjax();\n }\n\n for (let i = 0; i < document.forms.length; i++) {\n let form = document.forms[i];\n\n // Exclusion for forms\n if (ctCheckHiddenFieldsExclusions(document.forms[i], 'visible_fields')) {\n continue;\n }\n\n // The Form has hidden field like apbct_visible_fields\n if (\n document.forms[i].elements.apbct_visible_fields !== undefined &&\n document.forms[i].elements.apbct_visible_fields.length > 0\n ) {\n continue;\n }\n\n if (form.querySelector('input[name=\"apbct_visible_fields\"]')) {\n let visibleFields = form.querySelector('input[name=\"apbct_visible_fields\"]');\n form.removeChild(visibleFields);\n }\n\n let hiddenInput = document.createElement( 'input' );\n hiddenInput.setAttribute( 'type', 'hidden' );\n hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n hiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n let visibleFieldsToInput = {};\n visibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n hiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n form.append( hiddenInput );\n\n form.onsubmit_prev = form.onsubmit;\n\n form.ctFormIndex = i;\n form.onsubmit = function(event) {\n if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(this);\n apbct_visible_fields_set_cookie( visibleFields, event.target.ctFormIndex );\n }\n\n if (ctPublic.data__cookies_type === 'none' && isFormThatNeedCatchXhr(event.target)) {\n window.XMLHttpRequest.prototype.send = function(data) {\n let noCookieData = getNoCookieData();\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n defaultSend.call(this, noCookieData + data);\n setTimeout(() => {\n window.XMLHttpRequest.prototype.send = defaultSend;\n }, 0);\n };\n }\n\n // Call previous submit action\n if (event.target.onsubmit_prev instanceof Function && !ctOnsubmitPrevCallExclude(event.target)) {\n setTimeout(function() {\n event.target.onsubmit_prev.call(event.target, event);\n }, 500);\n }\n };\n }\n }, 1000);\n\n // Listen clicks on encoded emails\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n if (\n encodedEmailNodes[i].parentElement.href ||\n encodedEmailNodes[i].parentElement.parentElement.href\n ) {\n // Skip listening click on hyperlinks\n continue;\n }\n encodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n // WordPress Search form processing\n for (const _form of document.forms) {\n if (\n typeof ctPublic !== 'undefined' &&\n ctPublic.settings__forms__search_test === '1' &&\n (\n _form.getAttribute('id') === 'searchform' ||\n (_form.getAttribute('class') !== null && _form.getAttribute('class').indexOf('search-form') !== -1) ||\n (_form.getAttribute('role') !== null && _form.getAttribute('role').indexOf('search') !== -1)\n )\n ) {\n _form.apbctSearchPrevOnsubmit = _form.onsubmit;\n // this handles search forms onsubmit process\n _form.onsubmit = (e) => ctSearchFormOnSubmitHandler(e, _form);\n }\n }\n}\n\n/**\n * Prepare jQuery.ajaxSetup to add nocookie data to the jQuery ajax request.\n * Notes:\n * - Do it just once, the ajaxSetup.beforeSend will be overwritten for any calls.\n * - Signs of forms need to be caught will be checked during ajaxSetup.settings.data process on send.\n * - Any sign of the form HTML of the caller is insignificant in this process.\n * @return {void}\n */\nfunction ctAjaxSetupAddCleanTalkDataBeforeSendAjax() {\n // jquery ajax call intercept\n if ( typeof jQuery !== 'undefined' ) {\n jQuery.ajaxSetup({\n beforeSend: function(xhr, settings) {\n let sourceSign = false;\n // settings data is string (important!)\n if ( typeof settings.data === 'string' ) {\n if (settings.data.indexOf('twt_cc_signup') !== -1) {\n sourceSign = 'twt_cc_signup';\n }\n\n if (settings.data.indexOf('action=mailpoet') !== -1) {\n sourceSign = 'action=mailpoet';\n }\n\n if (\n settings.data.indexOf('action=user_registration') !== -1 &&\n settings.data.indexOf('ur_frontend_form_nonce') !== -1\n ) {\n sourceSign = 'action=user_registration';\n }\n\n if (settings.data.indexOf('action=happyforms_message') !== -1) {\n sourceSign = 'action=happyforms_message';\n }\n }\n if ( typeof settings.url === 'string' ) {\n if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) {\n sourceSign = 'wc-ajax=add_to_cart';\n }\n }\n\n if (sourceSign) {\n let noCookieData = getNoCookieData();\n noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData + '&';\n settings.data = noCookieData + settings.data;\n }\n },\n });\n }\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctOnsubmitPrevCallExclude(form) {\n if (form.classList.contains('hb-booking-search-form')) {\n return true;\n }\n\n return false;\n}\n\nif (ctPublic.data__key_is_ok) {\n if (document.readyState !== 'loading') {\n apbct_ready();\n } else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', apbct_ready);\n }\n\n apbctLocalStorage.set('ct_checkjs', ctPublic.ct_checkjs_key, true );\n}\n\n/**\n * @param {SubmitEvent} e\n * @param {*} _form\n */\nfunction ctSearchFormOnSubmitHandler(e, _form) {\n try {\n // set NoCookie data if is provided\n const noCookieField = _form.querySelector('[name=\"ct_no_cookie_hidden_field\"]');\n // set honeypot data if is provided\n const honeyPotField = _form.querySelector('[id*=\"apbct__email_id__\"]');\n const botDetectorField = _form.querySelector('[name*=\"ct_bot_detector_event_token\"]');\n let hpValue = null;\n let hpEventId = null;\n\n // get honeypot field and it's value\n if (\n honeyPotField !== null &&\n honeyPotField.value !== null &&\n honeyPotField.getAttribute('apbct_event_id') !== null\n ) {\n hpValue = honeyPotField.value;\n hpEventId = honeyPotField.getAttribute('apbct_event_id');\n }\n\n if (ctPublic.data__cookies_type === 'alternative' || ctPublic.data__cookies_type === 'native') {\n if (botDetectorField !== null) {\n botDetectorField.parentNode.removeChild(botDetectorField);\n }\n }\n\n // if noCookie data or honeypot data is set, proceed handling\n if ( noCookieField !== null || honeyPotField !== null) {\n e.preventDefault();\n const callBack = () => {\n if (honeyPotField !== null) {\n honeyPotField.parentNode.removeChild(honeyPotField);\n }\n // ct_bot_detector_event_token\n if (botDetectorField !== null) {\n botDetectorField.parentNode.removeChild(botDetectorField);\n }\n if (_form.apbctSearchPrevOnsubmit instanceof Function) {\n _form.apbctSearchPrevOnsubmit();\n } else {\n const _noCookieField = _form.querySelector('[name=\"ct_no_cookie_hidden_field\"]');\n if ( _noCookieField !== null ) {\n _noCookieField.parentNode.removeChild(_noCookieField);\n }\n HTMLFormElement.prototype.submit.call(_form);\n }\n };\n\n let parsedCookies = '{}';\n\n // if noCookie data provided trim prefix and add data from base64 decoded value then\n if (noCookieField !== null) {\n parsedCookies = atob(noCookieField.value.replace('_ct_no_cookie_data_', ''));\n }\n\n const cookiesArray = JSON.parse(parsedCookies);\n\n // if honeypot data provided add the fields to the parsed data\n if ( hpValue !== null && hpEventId !== null ) {\n cookiesArray.apbct_search_form__honeypot_value = hpValue;\n cookiesArray.apbct_search_form__honeypot_id = hpEventId;\n }\n\n // if the pixel needs to be decoded\n if (\n typeof cookiesArray.apbct_pixel_url === 'string' &&\n cookiesArray.apbct_pixel_url.indexOf('%3A') !== -1\n ) {\n cookiesArray.apbct_pixel_url = decodeURIComponent(cookiesArray.apbct_pixel_url);\n }\n\n parsedCookies = JSON.stringify(cookiesArray);\n\n // if any data provided, proceed data to xhr\n if ( parsedCookies.length !== 0 ) {\n ctSetAlternativeCookie(\n parsedCookies,\n {callback: callBack, onErrorCallback: callBack, forceAltCookies: true},\n );\n } else {\n callBack();\n }\n }\n } catch (error) {\n console.warn('APBCT search form onsubmit handler error. ' + error);\n }\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event) {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n let clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n let popupText = document.createElement('p');\n popupText.setAttribute('id', 'apbct_popup_text');\n popupText.style.color = 'black';\n popupText.innerText = 'Please wait while ' + ctPublic.wl_brandname + ' is decoding the email addresses.';\n waitingPopup.append(popupText);\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctPublic.wl_brandname + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(event, ctPublic.encodedEmailNodes, clickSource);\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n // collect data\n const javascriptClientData = getJavascriptClientData();\n let data = {\n event_javascript_data: javascriptClientData,\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (typeof encodedEmailNodes[i].href !== 'undefined' && encodedEmailNodes[i].href.indexOf('mailto:') === 0) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey);\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // chek what is what\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === encodedEmailNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n break;\n }\n // handler for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0) {\n let encodedEmail = encodedEmailNodes[i].href.replace('mailto:', '');\n let baseElementContent = encodedEmailNodes[i].innerHTML;\n encodedEmailNodes[i].innerHTML =\n baseElementContent.replace(encodedEmail, currentResultData.decoded_email);\n encodedEmailNodes[i].href = 'mailto:' + currentResultData.decoded_email;\n } else {\n // fill the nodes\n ctProcessDecodedDataResult(currentResultData, encodedEmailNodes[i]);\n }\n // remove listeners\n encodedEmailNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n // click on mailto if so\n if (ctPublic.encodedEmailNodesIsMixed) {\n clickSource.click();\n }\n }\n }, 3000);\n } else {\n if (result.success) {\n resetEncodedNodes();\n ctShowDecodeComment('Blocked: ' + result.data[0].comment);\n } else {\n resetEncodedNodes();\n ctShowDecodeComment('Cannot connect with CleanTalk server: ' + result.data[0].comment);\n }\n }\n}\n\n/**\n * resetEncodedNodes\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) {\n let resultDataJson = {};\n\n resultDataJson.apbct_headless = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if (\n typeof (commonCookies) === 'object' &&\n commonCookies !== []\n ) {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param {mixed} object\n * @return {*}\n */\nfunction removeDoubleJsonEncoding(object) {\n if ( typeof object === 'object') {\n // eslint-disable-next-line guard-for-in\n for (let objectKey in object) {\n // Recursion\n if ( typeof object[objectKey] === 'object') {\n object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if (\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ) {\n const parsedValue = JSON.parse(object[objectKey]);\n if ( typeof parsedValue === 'object' ) {\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n apbct(target).html(\n apbct(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n/**\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n comment = 'Can not decode email. Unknown reason';\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n popupText.innerText = 'CleanTalk email decoder: ' + comment;\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_collect_visible_fields( form ) {\n // Get only fields\n let inputs = [];\n let inputsVisible = '';\n let inputsVisibleCount = 0;\n let inputsInvisible = '';\n let inputsInvisibleCount = 0;\n let inputsWithDuplicateNames = [];\n\n for (let key in form.elements) {\n if (!isNaN(+key)) {\n inputs[key] = form.elements[key];\n }\n }\n\n // Filter fields\n inputs = inputs.filter(function(elem) {\n // Filter already added fields\n if ( inputsWithDuplicateNames.indexOf( elem.getAttribute('name') ) !== -1 ) {\n return false;\n }\n // Filter inputs with same names for type == radio\n if ( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute('type') )) {\n inputsWithDuplicateNames.push( elem.getAttribute('name') );\n return false;\n }\n return true;\n });\n\n // Visible fields\n inputs.forEach(function(elem, i, elements) {\n // Unnecessary fields\n if (\n elem.getAttribute('type') === 'submit' || // type == submit\n elem.getAttribute('name') === null ||\n elem.getAttribute('name') === 'ct_checkjs'\n ) {\n return;\n }\n // Invisible fields\n if (\n getComputedStyle(elem).display === 'none' || // hidden\n getComputedStyle(elem).visibility === 'hidden' || // hidden\n getComputedStyle(elem).opacity === '0' || // hidden\n elem.getAttribute('type') === 'hidden' // type == hidden\n ) {\n if ( elem.classList.contains('wp-editor-area') ) {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n } else {\n inputsInvisible += ' ' + elem.getAttribute('name');\n inputsInvisibleCount++;\n }\n // eslint-disable-next-line brace-style\n }\n // Visible fields\n else {\n inputsVisible += ' ' + elem.getAttribute('name');\n inputsVisibleCount++;\n }\n });\n\n inputsInvisible = inputsInvisible.trim();\n inputsVisible = inputsVisible.trim();\n\n return {\n visible_fields: inputsVisible,\n visible_fields_count: inputsVisibleCount,\n invisible_fields: inputsInvisible,\n invisible_fields_count: inputsInvisibleCount,\n };\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc\nfunction apbct_visible_fields_set_cookie( visibleFieldsCollection, formId ) {\n let collection = typeof visibleFieldsCollection === 'object' && visibleFieldsCollection !== null ?\n visibleFieldsCollection : {};\n\n if ( ctPublic.data__cookies_type === 'native' ) {\n // eslint-disable-next-line guard-for-in\n for ( let i in collection ) {\n if ( i > 10 ) {\n // Do not generate more than 10 cookies\n return;\n }\n let collectionIndex = formId !== undefined ? formId : i;\n ctSetCookie('apbct_visible_fields_' + collectionIndex, JSON.stringify( collection[i] ) );\n }\n } else {\n if (ctPublic.data__cookies_type === 'none') {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection[0] ) );\n } else {\n ctSetCookie('apbct_visible_fields', JSON.stringify( collection ) );\n }\n }\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_js_keys__set_input_value(result, data, params, obj) {\n if ( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n let elements = document.querySelectorAll('[name^=ct_checkjs]');\n for ( let i = 0; i < elements.length; i++ ) {\n elements[i].value = result.js_key;\n }\n }\n}\n\n/**\n * @return {string}\n */\nfunction apbctGetScreenInfo() {\n return JSON.stringify({\n fullWidth: document.documentElement.scrollWidth,\n fullHeight: Math.max(\n document.body.scrollHeight, document.documentElement.scrollHeight,\n document.body.offsetHeight, document.documentElement.offsetHeight,\n document.body.clientHeight, document.documentElement.clientHeight,\n ),\n visibleWidth: document.documentElement.clientWidth,\n visibleHeight: document.documentElement.clientHeight,\n });\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctParseBlockMessage(response) {\n if (typeof response.apbct !== 'undefined') {\n response = response.apbct;\n if (response.blocked) {\n document.dispatchEvent(\n new CustomEvent( 'apbctAjaxBockAlert', {\n bubbles: true,\n detail: {message: response.comment},\n } ),\n );\n\n // Show the result by modal\n cleantalkModal.loaded = response.comment;\n cleantalkModal.open();\n\n if (+response.stop_script === 1) {\n window.stop();\n }\n }\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n// eslint-disable-next-line require-jsdoc\nfunction ctNoCookieConstructHiddenField(type) {\n let inputType = 'hidden';\n if (type === 'submit') {\n inputType = 'submit';\n }\n let field = '';\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n\n let noCookieDataTypo = {typo: []};\n if (document.ctTypoData && document.ctTypoData.data) {\n noCookieDataTypo = {typo: document.ctTypoData.data};\n }\n\n let noCookieData = {...noCookieDataLocal, ...noCookieDataSession, ...noCookieDataTypo};\n noCookieData = JSON.stringify(noCookieData);\n noCookieData = '_ct_no_cookie_data_' + btoa(noCookieData);\n field = document.createElement('input');\n field.setAttribute('name', 'ct_no_cookie_hidden_field');\n field.setAttribute('value', noCookieData);\n field.setAttribute('type', inputType);\n field.classList.add('apbct_special_field');\n field.classList.add('ct_no_cookie_hidden_field');\n return field;\n}\n\n/**\n * @return {boolean|*}\n */\nfunction ctGetPageForms() {\n let forms = document.forms;\n if (forms) {\n return forms;\n }\n return false;\n}\n\n/**\n * Get type of the field should be excluded. Return exclusion signs via object.\n * @param {object} form Form dom object.\n * @return {object} {'no_cookie': 1|0, 'visible_fields': 1|0}\n */\nfunction ctGetHiddenFieldExclusionsType(form) {\n // visible fields\n let result = {'no_cookie': 0, 'visible_fields': 0};\n if (\n +ctPublic.data__visible_fields_required === 0 ||\n (form.method.toString().toLowerCase() === 'get' &&\n form.querySelectorAll('.nf-form-content').length === 0 &&\n form.id !== 'twt_cc_signup') ||\n form.classList.contains('slp_search_form') || // StoreLocatorPlus form\n form.parentElement.classList.contains('mec-booking') ||\n form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n (form.id && form.id === 'caspioform') || // Caspio Form\n (form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n (form.classList && form.classList.contains('give-form')) || // GiveWP\n (form.id && form.id === 'ult-forgot-password-form') || // ult forgot password\n (form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n (form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n (form.id &&\n form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n (form.name &&\n form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n (form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) || // The Events Calendar\n (form.id && form.id === 'ihf-login-form') || // Optima Express login\n (form.id &&\n form.id === 'subscriberForm' &&\n form.action.toString().indexOf('actionType=update') !== -1) || // Optima Express update\n (form.id && form.id === 'ihf-main-search-form') || // Optima Express search\n (form.id && form.id === 'frmCalc') || // nobletitle-calc\n form.action.toString().indexOf('property-organizer-delete-saved-search-submit') !== -1 ||\n form.querySelector('a[name=\"login\"]') !== null // digimember login form\n ) {\n result.visible_fields = 1;\n }\n\n // ajax search pro exclusion\n let ncFieldExclusionsSign = form.parentNode;\n if (\n ncFieldExclusionsSign && ncFieldExclusionsSign.classList.contains('proinput') ||\n (form.name === 'options' && form.classList.contains('asp-fss-flex'))\n ) {\n result.no_cookie = 1;\n }\n\n // woocommerce login form\n if (\n form && form.classList.contains('woocommerce-form-login')\n ) {\n result.visible_fields = 1;\n result.no_cookie = 1;\n }\n\n return result;\n}\n\n/**\n * Check if the form should be skipped from hidden field attach.\n * Return exclusion description if it is found, false otherwise.\n * @param {object} form Form dom object.\n * @param {string} hiddenFieldType Type of hidden field that needs to be checked.\n * Possible values: 'no_cookie'|'visible_fields'.\n * @return {boolean}\n */\nfunction ctCheckHiddenFieldsExclusions(form, hiddenFieldType) {\n // Ajax Search Lite\n if (Boolean(form.querySelector('fieldset.asl_sett_scroll'))) {\n return true;\n }\n if (typeof (hiddenFieldType) === 'string' &&\n ['visible_fields', 'no_cookie'].indexOf(hiddenFieldType) !== -1) {\n const exclusions = ctGetHiddenFieldExclusionsType(form);\n return exclusions[hiddenFieldType] === 1;\n }\n\n return false;\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n\n if ( ctCheckHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // add new set\n document.forms[i].append(ctNoCookieConstructHiddenField());\n } else if (typeof ctPublic !== 'undefined' &&\n ctPublic.settings__forms__search_test === '1' &&\n (\n document.forms[i].getAttribute('id') === 'searchform' ||\n (\n document.forms[i].getAttribute('class') !== null &&\n document.forms[i].getAttribute('class').indexOf('search-form') !== -1) ||\n (\n document.forms[i].getAttribute('role') !== null &&\n document.forms[i].getAttribute('role').indexOf('search') !== -1\n )\n )\n ) {\n document.forms[i].append(ctNoCookieConstructHiddenField('submit'));\n }\n }\n }\n}\n\nconst defaultFetch = window.fetch;\nconst defaultSend = XMLHttpRequest.prototype.send;\n\nif (document.readyState !== 'loading') {\n checkFormsExistForCatching();\n} else {\n apbct_attach_event_handler(document, 'DOMContentLoaded', checkFormsExistForCatching);\n}\n\n/**\n * checkFormsExistForCatching\n */\nfunction checkFormsExistForCatching() {\n setTimeout(function() {\n if (isFormThatNeedCatch()) {\n window.fetch = function(...args) {\n if (args &&\n args[0] &&\n typeof args[0].includes === 'function' &&\n args[0].includes('/wp-json/metform/')\n ) {\n let noCookieData = getNoCookieData();\n\n if (args && args[1] && args[1].body) {\n args[1].body.append('ct_no_cookie_hidden_field', noCookieData);\n }\n }\n\n return defaultFetch.apply(window, args);\n };\n }\n }, 1000);\n}\n\n/**\n * @return {boolean}\n */\nfunction isFormThatNeedCatch() {\n const formClasses = [\n 'metform-form-content',\n ];\n let classExists = false;\n\n const forms = document.forms;\n for (let form of forms) {\n formClasses.forEach(function(classForm) {\n if (form.classList.contains(classForm)) {\n classExists = true;\n }\n });\n }\n\n return classExists;\n}\n\n/**\n * @param {HTMLElement} form\n * @return {boolean}\n */\nfunction isFormThatNeedCatchXhr(form) {\n if (document.querySelector('div.elementor-widget[title=\\'Login/Signup\\']') != null) {\n return false;\n }\n if (form && form.action && form.action.toString().indexOf('mailpoet_subscription_form') !== -1) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @return {string}\n */\nfunction getNoCookieData() {\n let noCookieDataLocal = apbctLocalStorage.getCleanTalkData();\n let noCookieDataSession = apbctSessionStorage.getCleanTalkData();\n let noCookieData = {...noCookieDataLocal, ...noCookieDataSession};\n noCookieData = JSON.stringify(noCookieData);\n\n return '_ct_no_cookie_data_' + btoa(noCookieData);\n}\n\n/**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\nfunction apbctWriteReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n}\n\n\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if ( ! this.loaded ) {\n this.loading = true;\n let callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalContentLoaded', {\n bubbles: true,\n } ),\n );\n };\n // eslint-disable-next-line camelcase\n if ( typeof apbct_admin_sendAJAX === 'function' ) {\n apbct_admin_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n } else {\n apbct_public_sendAJAX( {'action': action}, {'callback': callback, 'notJson': true} );\n }\n }\n },\n\n open: function() {\n /* Cleantalk Modal CSS start */\n let renderCss = function() {\n let cssStr = '';\n // eslint-disable-next-line guard-for-in\n for ( const key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n let overlayCss = {\n styles: {\n 'z-index': '9999999999',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'width': '100%',\n 'height': '100%',\n 'background': 'rgba(0,0,0,0.5)',\n 'display': 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n },\n toString: renderCss,\n };\n let innerCss = {\n styles: {\n 'position': 'relative',\n 'padding': '30px',\n 'background': '#FFF',\n 'border': '1px solid rgba(0,0,0,0.75)',\n 'border-radius': '4px',\n 'box-shadow': '7px 7px 5px 0px rgba(50,50,50,0.75)',\n },\n toString: renderCss,\n };\n let closeCss = {\n styles: {\n 'position': 'absolute',\n 'background': '#FFF',\n 'width': '20px',\n 'height': '20px',\n 'border': '2px solid rgba(0,0,0,0.75)',\n 'border-radius': '15px',\n 'cursor': 'pointer',\n 'top': '-8px',\n 'right': '-8px',\n 'box-sizing': 'content-box',\n },\n toString: renderCss,\n };\n let closeCssBefore = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(45deg)',\n },\n toString: renderCss,\n };\n let closeCssAfter = {\n styles: {\n 'content': '\"\"',\n 'display': 'block',\n 'position': 'absolute',\n 'background': '#000',\n 'border-radius': '1px',\n 'width': '2px',\n 'height': '16px',\n 'top': '2px',\n 'left': '9px',\n 'transform': 'rotate(-45deg)',\n },\n toString: renderCss,\n };\n let bodyCss = {\n styles: {\n 'overflow': 'hidden',\n },\n toString: renderCss,\n };\n let cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n let overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n let inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n let close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n let content = document.createElement( 'div' );\n if ( this.loaded ) {\n const urlRegex = /(https?:\\/\\/[^\\s]+)/g;\n const serviceContentRegex = /.*\\/inc/g;\n if (serviceContentRegex.test(this.loaded)) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = this.loaded.replace(urlRegex, '$1');\n }\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function() {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( 'cleantalkModalClosed', {\n bubbles: true,\n } ),\n );\n },\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click', function( e ) {\n if ( e.target && (e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close') ) {\n cleantalkModal.close();\n }\n});\ndocument.addEventListener('cleantalkModalContentLoaded', function( e ) {\n if ( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\n\n/**\n * Handle external forms\n */\nfunction ctProtectExternal() {\n for (let i = 0; i < document.forms.length; i++) {\n if (document.forms[i].cleantalk_hidden_action === undefined &&\n document.forms[i].cleantalk_hidden_method === undefined) {\n // current form\n const currentForm = document.forms[i];\n\n // skip excluded forms\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n\n // Ajax checking for the integrated forms - will be changed the whole form object to make protection\n if ( isIntegratedForm(currentForm) ) {\n apbctProcessExternalForm(currentForm, i, document);\n\n // Ajax checking for the integrated forms - will be changed only submit button to make protection\n } else if ( currentForm.dataset.mailingListId !== undefined ) { // MooForm 3rd party service\n apbctProcessExternalFormByFakeButton(currentForm, i, document);\n\n // Common flow - modify form's action\n } else if (\n typeof(currentForm.action) == 'string' &&\n ( currentForm.action.indexOf('http://') !== -1 ||\n currentForm.action.indexOf('https://') !== -1 )\n ) {\n let tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n const host = tmp[0].toLowerCase();\n\n if (host !== location.hostname.toLowerCase()) {\n const ctAction = document.createElement('input');\n ctAction.name = 'cleantalk_hidden_action';\n ctAction.value = currentForm.action;\n ctAction.type = 'hidden';\n currentForm.appendChild(ctAction);\n\n const ctMethod = document.createElement('input');\n ctMethod.name = 'cleantalk_hidden_method';\n ctMethod.value = currentForm.method;\n ctMethod.type = 'hidden';\n\n currentForm.method = 'POST';\n\n currentForm.appendChild(ctMethod);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n // Trying to process external form into an iframe\n apbctProcessIframes();\n // if form is still not processed by fields listening, do it here\n ctStartFieldsListening();\n}\n\n/**\n * Exclusion forms\n * @param {HTMLElement} currentForm\n * @return {boolean}\n */\nfunction formIsExclusion(currentForm) {\n const exclusionsById = [\n 'give-form', // give form exclusion because of direct integration\n 'frmCalc', // nobletitle-calc\n 'ihf-contact-request-form',\n 'wpforms', // integration with wpforms\n ];\n\n const exclusionsByRole = [\n 'search', // search forms\n ];\n\n const exclusionsByClass = [\n 'search-form', // search forms\n 'hs-form', // integrated hubspot plugin through dynamicRenderedForms logic\n 'ihc-form-create-edit', // integrated Ultimate Membership Pro plugin through dynamicRenderedForms logic\n 'nf-form-content', // integration with Ninja Forms for js events\n 'elementor-form', // integration with elementor-form\n 'wpforms', // integration with wpforms\n ];\n\n let result = false;\n\n try {\n // mewto forms exclusion\n if (currentForm.parentElement &&\n currentForm.parentElement.classList.length > 0 &&\n currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1) {\n result = true;\n }\n\n exclusionsById.forEach(function(exclusionId) {\n const formId = currentForm.getAttribute('id');\n if ( formId !== null && typeof (formId) !== 'undefined' && formId.indexOf(exclusionId) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByClass.forEach(function(exclusionClass) {\n let foundClass = '';\n if (currentForm.getAttribute('class')) {\n foundClass = currentForm.getAttribute('class');\n } else {\n foundClass = apbctGetFormClass(currentForm, exclusionClass);\n }\n const formClass = foundClass;\n if ( formClass !== null && typeof formClass !== 'undefined' && formClass.indexOf(exclusionClass) !== -1 ) {\n result = true;\n }\n });\n\n exclusionsByRole.forEach(function(exclusionRole) {\n const formRole = currentForm.getAttribute('id');\n if ( formRole !== null && typeof formRole !== 'undefined'&& formRole.indexOf(exclusionRole) !== -1 ) {\n result = true;\n }\n });\n } catch (e) {\n console.table('APBCT ERROR: formIsExclusion() - ', e);\n }\n\n return result;\n}\n\n/**\n * Gets the form class if it is not in
\n * @param {HTMLElement} currentForm\n * @param {string} exclusionClass\n * @return {string}\n */\nfunction apbctGetFormClass(currentForm, exclusionClass) {\n if (typeof(currentForm) == 'object' && currentForm.querySelector('.' + exclusionClass)) {\n return exclusionClass;\n }\n}\n\n/**\n * Handle external forms in iframes\n */\nfunction apbctProcessIframes() {\n const frames = document.getElementsByTagName('iframe');\n\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) {\n continue;\n }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n const currentForm = iframeForms[y];\n if ( formIsExclusion(currentForm)) {\n continue;\n }\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n // skip excluded forms\n if ( formIsExclusion(currentForm)) {\n return;\n }\n\n const cleantalkPlaceholder = document.createElement('i');\n cleantalkPlaceholder.className = 'cleantalk_placeholder';\n cleantalkPlaceholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalkPlaceholder, currentForm);\n\n // Deleting form to prevent submit event\n const prev = currentForm.previousSibling;\n const formHtml = currentForm.outerHTML;\n const formOriginal = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement('div');\n placeholder.innerHTML = formHtml;\n prev.after(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = formOriginal;\n\n // mailerlite integration - disable click on submit button\n let mailerliteDetectedClass = false;\n if (reUseCurrentForm.classList !== undefined) {\n // list there all the mailerlite classes\n const mailerliteClasses = ['newsletterform', 'ml-block-form'];\n mailerliteClasses.forEach(function(mailerliteClass) {\n if (reUseCurrentForm.classList.contains(mailerliteClass)) {\n mailerliteDetectedClass = mailerliteClass;\n }\n });\n }\n if ( mailerliteDetectedClass ) {\n const mailerliteSubmitButton = documentObject.querySelector('form.' + mailerliteDetectedClass)\n .querySelector('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.addEventListener('click', function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(reUseCurrentForm);\n });\n }\n } else {\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n}\n\n/**\n * Process external forms via fake button replacing\n * @param {HTMLElement} currentForm\n * @param {int} iterator\n * @param {HTMLElement} documentObject\n */\nfunction apbctProcessExternalFormByFakeButton(currentForm, iterator, documentObject) {\n // skip excluded forms\n if ( formIsExclusion(currentForm)) {\n return;\n }\n\n const submitButtonOriginal = currentForm.querySelector('[type=\"submit\"]');\n\n if ( ! submitButtonOriginal ) {\n return;\n }\n\n const parent = submitButtonOriginal.parentElement;\n const submitButtonHtml = submitButtonOriginal.outerHTML;\n\n // Remove the original submit button\n submitButtonOriginal.remove();\n\n // Insert a clone of the submit button\n const placeholder = document.createElement('div');\n placeholder.innerHTML = submitButtonHtml;\n parent.appendChild(placeholder.firstElementChild);\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n\n const reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(forceAction);\n reUseCurrentForm.apbctParent = parent;\n reUseCurrentForm.submitButtonOriginal = submitButtonOriginal;\n\n documentObject.forms[iterator].onsubmit = function(event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n };\n}\n\n/**\n * Process external forms\n * @param {HTMLElement} formSource\n * @param {HTMLElement} formTarget\n */\nfunction apbctReplaceInputsValuesFromOtherForm(formSource, formTarget) {\n const inputsSource = formSource.querySelectorAll('button, input, textarea, select');\n const inputsTarget = formTarget.querySelectorAll('button, input, textarea, select');\n\n inputsSource.forEach((elemSource) => {\n inputsTarget.forEach((elemTarget) => {\n if (elemSource.outerHTML === elemTarget.outerHTML) {\n if (elemTarget.type === 'checkbox' || elemTarget.type === 'radio') {\n elemTarget.checked = apbctVal(elemSource);\n } else {\n elemTarget.value = apbctVal(elemSource);\n }\n }\n });\n });\n}\n// clear protected iframes list\napbctLocalStorage.set('apbct_iframes_protected', []);\nwindow.onload = function() {\n if ( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n setTimeout(function() {\n ctProtectExternal();\n catchDynamicRenderedForm();\n catchNextendSocialLoginForm();\n ctProtectOutsideIframe();\n }, 2000);\n};\n\n/**\n * Protect forms placed in iframe with outside src\n */\nfunction ctProtectOutsideIframe() {\n let iframes = document.querySelectorAll('iframe');\n if (iframes.length > 0) {\n iframes.forEach(function(iframe) {\n if (iframe.src.indexOf('form.typeform.com') !== -1 ||\n iframe.src.indexOf('forms.zohopublic.com') !== -1 ||\n iframe.src.indexOf('link.surepathconnect.com') !== -1 ||\n iframe.classList.contains('hs-form-iframe') ||\n ( iframe.src.indexOf('facebook.com') !== -1 && iframe.src.indexOf('plugins/comments.php') !== -1)\n ) {\n // pass if is already protected\n if (false !== apbctLocalStorage.get('apbct_iframes_protected') &&\n apbctLocalStorage.get('apbct_iframes_protected').length > 0 &&\n typeof iframe.id !== 'undefined' &&\n apbctLocalStorage.get('apbct_iframes_protected').indexOf[iframe.id] !== -1\n ) {\n return;\n }\n ctProtectOutsideIframeHandler(iframe);\n }\n });\n }\n}\n\nlet ctProtectOutsideIframeCheck;\n/**\n * Protect forms placed in iframe with outside src handler\n * @param {HTMLElement} iframe\n */\nfunction ctProtectOutsideIframeHandler(iframe) {\n let cover = document.createElement('div');\n cover.style.width = '100%';\n cover.style.height = '100%';\n cover.style.background = 'black';\n cover.style.opacity = 0;\n cover.style.position = 'absolute';\n cover.style.top = 0;\n cover.onclick = function(e) {\n if (ctProtectOutsideIframeCheck === undefined) {\n let currentDiv = e.currentTarget;\n currentDiv.style.opacity = 0.5;\n let preloader = document.createElement('div');\n preloader.className = 'apbct-iframe-preloader';\n currentDiv.appendChild(preloader);\n let botDetectorToken = '';\n if (document.querySelector('[name*=\"ct_bot_detector_event_token\"]')) {\n botDetectorToken = document.querySelector('[name*=\"ct_bot_detector_event_token\"]').value;\n }\n\n let data = {\n 'action': 'cleantalk_outside_iframe_ajax_check',\n 'ct_no_cookie_hidden_field': getNoCookieData(),\n 'ct_bot_detector_event_token': botDetectorToken,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n ctProtectOutsideIframeCheck = true;\n if (result.apbct.blocked === false) {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach(function(el) {\n el.parentNode.remove();\n });\n } else {\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.parentNode.style.color = 'white';\n el.parentNode.innerHTML += result.apbct.comment;\n });\n document.querySelectorAll('div.apbct-iframe-preloader').forEach((el) => {\n el.remove();\n });\n }\n },\n },\n );\n }\n };\n iframe.parentNode.style.position = 'relative';\n iframe.parentNode.appendChild(cover);\n let iframes = apbctLocalStorage.get('apbct_iframes_protected');\n if (false === iframes) {\n iframes = [];\n }\n if (typeof iframe.id !== 'undefined') {\n iframes.push(iframe.id);\n apbctLocalStorage.set('apbct_iframes_protected', iframes);\n }\n}\n\n/**\n * Catch NSL form integration\n */\nfunction catchNextendSocialLoginForm() {\n let blockNSL = document.getElementById('nsl-custom-login-form-main');\n if (blockNSL) {\n blockBtnNextendSocialLogin(blockNSL);\n }\n}\n\n/**\n * Blocking NSL plugin buttons\n * @param {HTMLElement} blockNSL\n */\nfunction blockBtnNextendSocialLogin(blockNSL) {\n let parentBtnsNSL = blockNSL.querySelectorAll('.nsl-container-buttons a');\n let childBtnsNSL = blockNSL.querySelectorAll('a[data-plugin=\"nsl\"] .nsl-button');\n parentBtnsNSL.forEach((el) => {\n el.setAttribute('data-oauth-login-blocked', 'true');\n el.addEventListener('click', (event) => {\n event.preventDefault();\n });\n });\n childBtnsNSL.forEach((el) => {\n el.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n ctCheckAjax(el);\n });\n });\n}\n\n/**\n * Unlocking the button and clicking on it after an ajax response\n * @param {HTMLElement} childBtn\n */\nfunction allowAjaxNextendSocialLogin(childBtn) {\n childBtn.parentElement.setAttribute('data-oauth-login-blocked', 'false');\n childBtn.parentElement.click();\n}\n\n/**\n * Locking the button and entering a message after an ajax response\n * @param {HTMLElement} childBtn\n * @param {string} msg\n */\nfunction forbiddenAjaxNextendSocialLogin(childBtn, msg) {\n let parentElement = childBtn.parentElement;\n if (parentElement.getAttribute('data-oauth-login-blocked') == 'false') {\n parentElement.setAttribute('data-oauth-login-blocked', 'true');\n }\n if (!document.querySelector('.ct-forbidden-msg')) {\n let elemForMsg = document.createElement('div');\n elemForMsg.className = 'ct-forbidden-msg';\n elemForMsg.style.background = 'red';\n elemForMsg.style.color = 'white';\n elemForMsg.style.padding = '5px';\n elemForMsg.innerHTML = msg;\n parentElement.insertAdjacentElement('beforebegin', elemForMsg);\n }\n}\n\n/**\n * User verification using user data and ajax\n * @param {HTMLElement} elem\n */\nfunction ctCheckAjax(elem) {\n let data = {\n 'action': 'cleantalk_nsl_ajax_check',\n 'ct_no_cookie_hidden_field': document.getElementsByName('ct_no_cookie_hidden_field')[0].value,\n };\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if (result.apbct.blocked === false) {\n allowAjaxNextendSocialLogin(elem);\n } else {\n forbiddenAjaxNextendSocialLogin(elem, result.apbct.comment);\n }\n },\n },\n );\n}\n\n/**\n * Checking the form integration\n * @param {HTMLElement} formObj\n * @return {boolean}\n */\nfunction isIntegratedForm(formObj) {\n const formAction = typeof(formObj.action) == 'string' ? formObj.action : '';\n const formId = formObj.getAttribute('id') !== null ? formObj.getAttribute('id') : '';\n\n if (\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined &&\n formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1 ||\n formId.indexOf('ihf-contact-request-form') !== -1 ||\n formAction.indexOf('crm.zoho.com') !== -1 ||\n formId.indexOf('delivra-external-form') !== -1 ||\n formObj.hasAttribute('data-hs-cf-bound') // Hubspot integration in Elementor form\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n * @param {HTMLElement} form\n * @param {HTMLElement} prev\n * @param {HTMLElement} formOriginal\n */\nfunction sendAjaxCheckingFormData(form) {\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visibleFields );\n\n const data = {};\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ) {\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n // MooSend integration\n if ( form.dataset.mailingListId !== undefined ) {\n let submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.remove();\n const parent = form.apbctParent;\n parent.appendChild(form.submitButtonOriginal);\n submitButton = form.querySelector('[type=\"submit\"]');\n submitButton.click();\n return;\n }\n\n const formNew = form;\n form.parentElement.removeChild(form);\n const prev = form.apbctPrev;\n const formOriginal = form.apbctFormOriginal;\n let mauticIntegration = false;\n\n apbctReplaceInputsValuesFromOtherForm(formNew, formOriginal);\n\n // mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mauticIntegration = true;\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n for (const el of formOriginal.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n\n for (const el of formOriginal.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n\n // Common click event\n let submButton = formOriginal.querySelectorAll('button[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n if (mauticIntegration) {\n setTimeout(function() {\n ctProtectExternal();\n }, 1500);\n }\n return;\n }\n\n submButton = formOriginal.querySelectorAll('input[type=submit]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // ConvertKit direct integration\n submButton = formOriginal.querySelectorAll('button[data-element=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n return;\n }\n\n // Paypal integration\n submButton = formOriginal.querySelectorAll('input[type=\"image\"][name=\"submit\"]');\n if ( submButton.length !== 0 ) {\n submButton[0].click();\n }\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Handle dynamic rendered form\n */\nfunction catchDynamicRenderedForm() {\n const forms = document.getElementsByTagName('form');\n\n catchDynamicRenderedFormHandler(forms);\n\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n\n if ( iframeForms.length === 0 ) {\n return;\n }\n\n catchDynamicRenderedFormHandler(iframeForms, frames[j].contentDocument);\n }\n }\n}\n\n/**\n * Process dynamic rendered form\n * @param {HTMLElements} forms\n * @param {HTMLElement} documentObject\n */\nfunction catchDynamicRenderedFormHandler(forms, documentObject = document) {\n const neededFormIds = [];\n for (const form of forms) {\n if (form.id.indexOf('hsForm') !== -1) {\n neededFormIds.push(form.id);\n }\n if (form.id.indexOf('createuser') !== -1 &&\n (form.classList !== undefined && form.classList.contains('ihc-form-create-edit'))\n ) {\n neededFormIds.push(form.id);\n }\n }\n\n for (const formId of neededFormIds) {\n const form = documentObject.getElementById(formId);\n form.apbct_external_onsubmit_prev = form.onsubmit;\n form.onsubmit = sendAjaxCheckingDynamicFormData;\n }\n}\n\n/**\n * Sending Ajax for checking form data on dynamic rendered form\n * @param {HTMLElement} form\n */\nfunction sendAjaxCheckingDynamicFormData(form) {\n form.preventDefault();\n form.stopImmediatePropagation();\n const formEvent = form;\n form = form.target;\n\n const forceAction = document.createElement('input');\n forceAction.name = 'action';\n forceAction.value = 'cleantalk_force_ajax_check';\n forceAction.type = 'hidden';\n form.appendChild(forceAction);\n\n // Get visible fields and set cookie\n const visibleFields = {};\n visibleFields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie(visibleFields);\n form.append(ctNoCookieConstructHiddenField('hidden'));\n\n const data = {};\n let elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if ( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function(result) {\n if ( result.apbct === undefined || ! +result.apbct.blocked ) {\n form.onsubmit = null;\n\n // Clear service fields\n for (const el of form.querySelectorAll('input[name=\"apbct_visible_fields\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[value=\"cleantalk_force_ajax_check\"]')) {\n el.remove();\n }\n for (const el of form.querySelectorAll('input[name=\"ct_no_cookie_hidden_field\"]')) {\n el.remove();\n }\n\n // Call previous submit action\n if (form.apbct_external_onsubmit_prev instanceof Function) {\n setTimeout(function() {\n form.apbct_external_onsubmit_prev.call(form, formEvent);\n }, 500);\n }\n\n const submButton = form.querySelector('input[type=\"submit\"]');\n if (submButton) {\n submButton.click();\n return;\n }\n }\n\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n },\n });\n}\n\n/**\n * Implement jQuery val() function\n * @param {HTMLElement} el\n * @return {HTMLElements}\n */\nfunction apbctVal(el) {\n if (el.options && el.multiple) {\n return el.options\n .filter((option) => option.selected)\n .map((option) => option.value);\n } else if (el.type === 'checkbox' || el.type === 'radio') {\n return el.checked ? el.checked : null;\n } else {\n return el.value;\n }\n}\n\n/**\n * Check form as internal.\n * @param {int} currForm Current form.\n */\nfunction ctCheckInternal(currForm) {\n // Gathering data\n const ctData = {};\n const elems = currForm.elements;\n let key;\n\n for (key in elems) {\n if (elems[key].type !== 'submit' &&\n elems[key].value !== undefined &&\n elems[key].value !== '') {\n ctData[elems[key].name] = currForm.elements[key].value;\n }\n }\n ctData.action = 'ct_check_internal';\n\n // AJAX Request\n apbct_public_sendAJAX(\n ctData,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function(data) {\n if (data.success === true) {\n currForm.origSubmit();\n } else {\n alert(data.data);\n return false;\n }\n },\n },\n );\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n let ctCurrAction = '';\n let ctCurrForm = '';\n\n if ( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n setTimeout(() => {\n for ( let i = 0; i < document.forms.length; i++ ) {\n if ( typeof(document.forms[i].action) == 'string' ) {\n ctCurrForm = document.forms[i];\n ctCurrAction = ctCurrForm.action;\n if (\n ctCurrAction.indexOf('https?://') !== null && // The protocol is obligatory\n ctCurrAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ctCheckInternalIsExcludedForm(ctCurrAction) // Exclude WordPress native scripts from processing\n ) {\n const formClone = ctCurrForm.cloneNode(true);\n ctCurrForm.parentNode.replaceChild(formClone, ctCurrForm);\n\n formClone.origSubmit = ctCurrForm.submit;\n formClone.submit = null;\n\n formClone.addEventListener('submit', function(event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n ctCheckInternal(event.target);\n return false;\n });\n }\n }\n }\n }, 500);\n});\n\n/**\n * Check by action to exclude the form checking\n * @param {string} action\n * @return {boolean}\n */\nfunction ctCheckInternalIsExcludedForm(action) {\n // An array contains forms action need to be excluded.\n const ctInternalScriptExclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ctInternalScriptExclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}\n"],"names":["ApbctCore","ajax_parameters","restParameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","styleName","Object","hasOwn","DomStyleName","replace","group","toUpperCase","let","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ajaxParameters","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","ctProcessError","msg","url","log","message","err","file","fileName","ln","lineNumber","lineNo","col","columnNumber","columnNo","stacktrace","stack","cause","JSON","stringify","errorObj","error","location","href","userAgent","navigator","errArray","localStorage","getItem","parse","setItem","ct_js_errors","apbct","params","Math","floor","random","onerror","exception","filterWords","ApbctXhr","xhr","XMLHttpRequest","method","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","console","prepare","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","response","httpCode","additionalMsg","errorString","errorOutput","errorMsg","headerName","setRequestHeader","convertDataToURL","convertDataToBody","paramsAppendix","URLSearchParams","toString","paramsPrefix","dataKey","FormData","object","objectKey","parsedValue","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","listOfCookieNamesToForceAlt","skipAlt","data__cookies_type","forcedAltCookiesSet","forEach","item","apbctLocalStorage","set","encodeURIComponent","ctSetAlternativeCookie","ctPublic","force_alt_cookies","forceAltCookies","ctNoCookieAttachHiddenFieldsToForms","_expires","ctSecure","protocol","cookie","cookiePrefix","ctDetectForcedAltCookiesForms","ninjaFormsSign","elementorUltimateAddonsRegister","smartFormsSign","jetpackCommentsForm","cwginstockForm","userRegistrationProForm","etPbDiviSubscriptionForm","fluentBookingApp","bookingPress","isArray","getJavascriptClientData","e","apbct_force_alt_cookies","data__ajax_type","apbct_pixel_url","decodeURIComponent","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","no_cache","apbctGenerateUniqueID","substr","get","property","storageValue","json","hasOwnProperty","isJson","objToSave","timestamp","getTime","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","apbctSessionStorage","sessionStorage","apbctOnAnimationStart","animationName","apbctAutocomplete","apbctCancelAutocomplete","apbctOnInput","inputType","element","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","CTTypoData","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","gatheringFields","field","assign","setListeners","currentDelta","abs","ctDate","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctMouseReadInterval","ctMouseWriteDataInterval","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctFunctionMouseMove","cronFormsHandler","data__key_is_ok","setInterval","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","cronStartTimeout","restartFieldsListening","restartBotDetectorEventTokenAttach","token","doAttach","getElementsByClassName","setEventTokenField","clearInterval","checkEmail","currentEmail","email","result","now","ctSetPixelImg","pixelUrl","insertedImg","pixel__enabled","getElementById","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","String","ctSetHasScrolled","ctStartFieldsListening","forms","ctGetPageForms","handled_fields","handledFormFields","type","ctFunctionHasInputFocused","ctFunctionHasKeyUp","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","ctPreloadLocalStorage","data__to_local_storage","entries","apbctPrepareBlockForAjaxForms","ctPrepareBlockMessage","responseText","ctParseBlockMessage","jQuery","ajaxComplete","settings","apbct_ready","sessionID","referrer","URL","host","apbctWriteReferrersToSessionStorage","cookiesType","initCookies","ctTypoData","getTimezoneOffset","apbctGetScreenInfo","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","ctAjaxSetupAddCleanTalkDataBeforeSendAjax","hiddenInput","visibleFieldsToInput","form","ctCheckHiddenFieldsExclusions","apbct_visible_fields","visibleFields","removeChild","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","apbct_visible_fields_set_cookie","isFormThatNeedCatchXhr","noCookieData","getNoCookieData","defaultSend","Function","ctOnsubmitPrevCallExclude","encodedEmailNodes","ctFillDecodedEmailHandler","_form","settings__forms__search_test","getAttribute","apbctSearchPrevOnsubmit","ctSearchFormOnSubmitHandler","ajaxSetup","beforeSend","sourceSign","contains","noCookieField","honeyPotField","botDetectorField","hpValue","hpEventId","parentNode","preventDefault","callBack","_noCookieField","HTMLFormElement","submit","parsedCookies","atob","apbct_search_form__honeypot_value","apbct_search_form__honeypot_id","warn","encodedEmailNodesIsMixed","popupText","encoderPopup","innerHTML","wl_brandname","waitingPopup","color","innerText","apbctAjaxEmailDecodeBulk","clickSource","event_javascript_data","post_url","encodedEmails","encodedEmailsCollection","apbctTooltip","dataset","originalString","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","res","resetEncodedNodes","ctShowDecodeComment","success","is_allowed","currentResultData","row","encoded_email","encodedEmail","baseElementContent","decoded_email","ctProcessDecodedDataResult","popup","click","comment","commonCookies","resultDataJson","apbct_headless","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_page_hits","apbct_prev_referer","apbct_site_referer","apbct_ct_js_errors","removeDoubleJsonEncoding","targetElement","ctFillDecodedEmail","inputs","inputsVisible","inputsVisibleCount","inputsInvisible","inputsInvisibleCount","inputsWithDuplicateNames","isNaN","visibility","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","visibleFieldsCollection","formId","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","blocked","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajaxPixelUrl","ctNoCookieConstructHiddenField","noCookieDataLocal","noCookieDataSession","noCookieDataTypo","typo","ctGetHiddenFieldExclusionsType","no_cookie","ncFieldExclusionsSign","data__visible_fields_required","id","hiddenFieldType","j","outerHTML","readyState","ct_checkjs_key","defaultFetch","fetch","checkFormsExistForCatching","isFormThatNeedCatch","includes","apply","formClasses","classExists","classForm","sessionCurrentPage","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","urlRegex","test","ctProtectExternal","cleantalk_hidden_action","cleantalk_hidden_method","ctMethod","currentForm","formIsExclusion","isIntegratedForm","apbctProcessExternalForm","mailingListId","apbctProcessExternalFormByFakeButton","tmp","hostname","ctAction","appendChild","apbctProcessIframes","exclusionId","exclusionClass","foundClass","formClass","apbctGetFormClass","exclusionRole","formRole","table","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalkPlaceholder","prev","insertBefore","previousSibling","formHtml","formOriginal","placeholder","forceAction","firstElementChild","reUseCurrentForm","apbctPrev","apbctFormOriginal","mailerliteDetectedClass","mailerliteClass","mailerliteSubmitButton","sendAjaxCheckingFormData","currentTarget","submitButtonOriginal","submitButtonHtml","apbctParent","apbctReplaceInputsValuesFromOtherForm","formSource","formTarget","inputsSource","inputsTarget","elemSource","elemTarget","checked","apbctVal","ctProtectOutsideIframe","iframes","iframe","src","ctProtectOutsideIframeHandler","settings__forms__check_external","catchDynamicRenderedForm","catchNextendSocialLoginForm","ctProtectOutsideIframeCheck","cover","onclick","currentDiv","preloader","botDetectorToken","ct_no_cookie_hidden_field","ct_bot_detector_event_token","el","blockNSL","blockBtnNextendSocialLogin","parentBtnsNSL","childBtnsNSL","ctCheckAjax","allowAjaxNextendSocialLogin","childBtn","forbiddenAjaxNextendSocialLogin","elemForMsg","insertAdjacentElement","getElementsByName","formObj","formAction","firstChild","elems","submitButton","formNew","mauticIntegration","submButton","catchDynamicRenderedFormHandler","neededFormIds","apbct_external_onsubmit_prev","sendAjaxCheckingDynamicFormData","stopImmediatePropagation","formEvent","options","multiple","option","selected","map","ctCheckInternal","currForm","ctData","alert","origSubmit","ctCheckInternalIsExcludedForm","some","blog_home","ctCurrAction","ctCurrForm","settings__forms__check_internal","formClone","cloneNode","replaceChild"],"mappings":"MAGMA,UACFC,gBAAkB,GAClBC,eAAiB,GAEjBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAMAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAiBH,OAhBIA,aAAoBQ,gBACpBF,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKZ,CAAQ,GACvB,UAApB,OAAOA,GACfM,KAAKN,SAAW,KAChBM,KAAKL,SAAW,GAChBK,KAAKL,SAAS,GAAKD,GACS,UAApB,OAAOA,GACfM,KAAKN,SAAWA,EAChBM,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBd,CAAQ,CAAC,GAG9EM,KAAKS,SAAS,EAGXT,IACX,CAKAU,WAAWC,GACmB,UAArB,OAAOA,EACRX,KAAKL,SAASiB,KAAKD,CAAS,EACC,UAArB,OAAOA,GACfX,KAAKN,SAAWiB,EAChBX,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBG,CAAS,CAAC,GAE/EX,KAAKS,SAAS,CAEtB,CAKAG,KAAKC,GACDb,KAAKL,SAASiB,KAAKC,CAAI,CAC3B,CAKAC,SACId,KAAKL,SAAWK,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