diff options
Diffstat (limited to 'plugins/jetpack/_inc/build/wordads/js/wordads-ccpa.min.js')
-rw-r--r-- | plugins/jetpack/_inc/build/wordads/js/wordads-ccpa.min.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/jetpack/_inc/build/wordads/js/wordads-ccpa.min.js b/plugins/jetpack/_inc/build/wordads/js/wordads-ccpa.min.js new file mode 100644 index 00000000..9ea5f575 --- /dev/null +++ b/plugins/jetpack/_inc/build/wordads/js/wordads-ccpa.min.js @@ -0,0 +1 @@ +!function(){var e=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},t=function(e,t,o,n,a,c){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var s="";if(o)switch(o.constructor){case Number:s=o===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+o;break;case String:s="; expires="+o;break;case Date:s="; expires="+o.toUTCString()}return"rootDomain"!==a&&".rootDomain"!==a||(a=(".rootDomain"===a?".":"")+document.location.hostname.split(".").slice(-2).join(".")),document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+s+(a?"; domain="+a:"")+(n?"; path="+n:"")+(c?"; secure":""),!0};window.__uspapi=function(t,o,n){if("function"==typeof n)if("getUSPData"===t&&1===o)if(navigator.globalPrivacyControl)n({version:1,uspString:"1YYN"},!0);else{var a=e("usprivacy");null!==a?n({version:1,uspString:a},!0):n(null,!1)}else n(null,!1)};var o=function(e){var o=".wordpress.com"===location.hostname.slice(-14)?".rootDomain":location.hostname;t("ccpa_applies",e,86400,"/",o)},n=function(){var e=document.querySelector("#ccpa-modal");e&&e.parentElement.removeChild(e)},a=function(){var t;n(),t=document.createElement("div"),document.body.insertBefore(t,document.body.firstElementChild),t.outerHTML='<div id="ccpa-loading" class="cleanslate ccpa__loading-wrapper"><div class="ccpa__loading-overlay"><span class="ccpa__loading-message">'+ccpaSettings.strings.pleaseWait+"...</span></div></div>";var o=new XMLHttpRequest;o.open("GET",ccpaSettings.ajaxUrl+"?action=privacy_optout_markup&security="+ccpaSettings.ajaxNonce,!0),o.onreadystatechange=function(){if(4===this.readyState&&200===this.status){document.getElementById("ccpa-loading").remove();var t=document.createElement("div");document.body.insertBefore(t,document.body.firstElementChild),t.outerHTML=this.response,document.getElementById("ccpa-opt-out").focus(),document.querySelector("#ccpa-modal .opt-out").addEventListener("click",(function(e){var t=new XMLHttpRequest;t.open("POST",ccpaSettings.ajaxUrl,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var t=JSON.parse(this.response);t&&t.success&&(t.data?(e.target.parentNode.classList.add("is-checked"),e.target.parentNode.parentNode.classList.add("is-checked")):(e.target.parentNode.classList.remove("is-checked"),e.target.parentNode.parentNode.classList.remove("is-checked")))}},t.send("action=privacy_optout&optout="+e.target.checked+"&security="+ccpaSettings.ajaxNonce)}));var o=e("usprivacy"),a=o&&"Y"===o[2],c=document.querySelector("#ccpa-modal .opt-out");c.checked=a,a&&(c.parentNode.classList.add("is-checked"),c.parentNode.parentNode.classList.add("is-checked"));var s=document.querySelectorAll("#ccpa-modal .components-button");Array.prototype.forEach.call(s,(function(e){e.addEventListener("click",(function(){n()}))}))}},o.send()},c=function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("wordads-ccpa-initialized",!0,!1,{ccpaApplies:e}),document.dispatchEvent(t)},s=function(e,o){var n,s,i=document.querySelectorAll(".ccpa-do-not-sell");null===o&&(e?0===i.length?(n=ccpaSettings.defaultOptOutCookieString,s=".wordpress.com"===location.hostname.slice(-14)?".rootDomain":location.hostname,t("usprivacy",n,86400,"/",s)):function(){var e=ccpaSettings.defaultOptInCookieString,o=".wordpress.com"===location.hostname.slice(-14)?".rootDomain":location.hostname;t("usprivacy",e,31536e3,"/",o)}():function(){var e=".wordpress.com"===location.hostname.slice(-14)?".rootDomain":location.hostname;t("usprivacy","1---",86400,"/",e)}()),e||"false"!==ccpaSettings.forceApplies?(Array.prototype.forEach.call(i,(function(e){e.addEventListener("click",(function(e){if(e.preventDefault(),!ccpaSettings.stylesLoaded){var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=ccpaSettings.ccpaCssUrl,document.getElementsByTagName("HEAD")[0].appendChild(t),ccpaSettings.stylesLoaded=!0}a()})),e.style.display=""})),c(!0)):c(!1)};document.addEventListener("DOMContentLoaded",(function(){var t=e("usprivacy");if(null===t){var n=e("ccpa_applies");if(null===n){var a=new XMLHttpRequest;a.open("GET","https://public-api.wordpress.com/geo/",!0),a.onreadystatechange=function(){if(4===this.readyState)if(200===this.status){var e=JSON.parse(this.response),t=e.region&&"california"===e.region.toLowerCase();o(t),s(t,null)}else o(!0),s(!0,null)},a.send()}else s("true"===n,null)}else s("1---"!==t,t)}))}();
\ No newline at end of file |