(()=>{"use strict";function e(){var e="automator_closure_redirect";!function(){var e,t=localStorage.getItem("automator_client_id");t&&/^[a-f0-9]{32}$/.test(t)||(e=new Uint8Array(16),crypto.getRandomValues(e),t=Array.from(e,function(e){return e.toString(16).padStart(2,"0")}).join(""),localStorage.setItem("automator_client_id",t));var n=new Date;n.setTime(n.getTime()+2592e6);var o="expires="+n.toUTCString();document.cookie="automator_client_id=".concat(t,"; ").concat(o,"; path=/; SameSite=Lax")}();var t,n=((t=document.createElement("a")).id="automator-closure-redirect",t.style.display="none",t.rel="noopener noreferrer",document.body.appendChild(t),t),o=setInterval(function(){if(!document.hidden){var t,r=function(e){for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),o=0;o<n.length;o++){var r=n[o].trim();if(0===r.indexOf(t))return r.substring(t.length)}return""}(e);r&&function(e){if("/"===e||e.startsWith("/"))return!0;try{return new URL(e),!0}catch(e){return!1}}(r)&&(clearInterval(o),t=e,document.cookie="".concat(t,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"),n.href=r,n.click())}},250),r=null;if("undefined"!=typeof jQuery&&jQuery(document).on("ajaxComplete",function(){a()}),"undefined"!=typeof PerformanceObserver&&"undefined"!=typeof automatorClosure)try{new PerformanceObserver(function(e){for(var t=e.getEntries(),n=0;n<t.length;n++){var o=t[n];if(!o.name||-1===o.name.indexOf("automator_check_closure_redirect")){if("fetch"===o.initiatorType||"xmlhttprequest"===o.initiatorType){a();break}if("other"===o.initiatorType&&o.name&&(-1!==o.name.indexOf("admin-ajax.php")||-1!==o.name.indexOf("/wp-json/")||-1!==o.name.indexOf("?action="))){a();break}}}}).observe({entryTypes:["resource","navigation"]})}catch(e){}function a(){clearTimeout(r),r=setTimeout(function(){!function(){if("undefined"!=typeof automatorClosure&&automatorClosure.nonce){var t=automatorClosure.ajaxUrl||window.ajaxurl||"/wp-admin/admin-ajax.php";fetch(t+"?action=automator_check_closure_redirect&nonce="+automatorClosure.nonce,{method:"GET",credentials:"same-origin"}).then(function(e){return e.json()}).then(function(t){t.success&&t.data.redirect_url&&(document.cookie="".concat(e,"=").concat(t.data.redirect_url,"; path=/"))}).catch(function(e){})}}()},100)}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()})();
//# sourceMappingURL=closure.js.map