(()=>{"use strict";var e={1669:e=>{e.exports=jQuery}},t={};function d(e,t,d=!1){const n=d?!t:t;document.querySelectorAll(".edd-requires__"+e).forEach((function(e){e.classList.remove("edd-hidden--required"),e.classList.toggle("edd-hidden",!n),e.classList.contains("edd-hidden")&&e.classList.add("edd-hidden--required")}))}function n(e,t){document.querySelectorAll('[class*="edd-requires__'+e+'-"]').forEach((function(d){const n=d.className.match(new RegExp("edd-requires__"+e+"-([\\w-]+)"));if(n){const e=n[1],i=t===e;d.classList.remove("edd-hidden--required"),d.classList.toggle("edd-hidden",!i),d.classList.contains("edd-hidden")&&d.classList.add("edd-hidden--required")}})),document.querySelectorAll(".edd-requires__"+e+':not([class*="edd-requires__'+e+'-"])').forEach((function(e){const d=""!==t&&null!==t;e.classList.remove("edd-hidden--required"),e.classList.toggle("edd-hidden",!d),e.classList.contains("edd-hidden")&&e.classList.add("edd-hidden--required")}))}document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll("[data-edd-requirement]").forEach((function(e){const t=e.getAttribute("data-edd-requirement");if(t)if("SELECT"===e.tagName)n(t,e.value);else if("checkbox"===e.type){const n=e.hasAttribute("data-edd-requirement-inverse");d(t,e.checked,n)}})),document.addEventListener("change",(function(e){const t=e.target;if(!t.hasAttribute("data-edd-requirement"))return;const i=t.getAttribute("data-edd-requirement");if(i)if("SELECT"===t.tagName)n(i,t.value);else if("checkbox"===t.type){const e=t.hasAttribute("data-edd-requirement-inverse");d(i,t.checked,e)}})),document.addEventListener("eddSettingToggled",(function(e){e.detail?.setting&&d(e.detail.setting,e.detail.value)}))}));var i=function d(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,d),o.exports}(1669);if(void 0===i||"undefined"==typeof wp||!wp)throw new Error("Labs script requires jQuery and WordPress heartbeat");const o=i;document.addEventListener("DOMContentLoaded",(function(){document.addEventListener("eddSettingToggled",(function(e){const t=e?.detail?.cookie;if(t){const e=new Date(1e3*t.expiration),d=`${t.name}=${encodeURIComponent(t.value)}; expires=${e.toUTCString()}; path=/; SameSite=Lax`;document.cookie=d}})),o(document).on("heartbeat-send",(function(e,t){const d=function(){const e=[];return o(".edd-profiler-log").each((function(){const t=o(this);if(t.is(":visible")){const d=t.attr("data-requires");if(d){const t=d.replace(/_profiler$/,"");e.push(t)}}})),e}();d.length&&(t.eddLabsLogs={ids:d})})),o(document).on("heartbeat-tick",(function(e,t){if(!t?.eddLabsLogs)return;const d=t.eddLabsLogs;for(const e in d){const t=o("#edd-profiler-log-"+e+' textarea[name="edd-profiler-log-contents"]');t.length&&t.val(d[e].contents||"");const n=o("#edd-profiler-log-"+e).closest(".inside").find("code");n.length&&d[e].path&&n.text(d[e].path);const i=o('.edd-profiler-log__time[data-profiler="'+e+'"]');i.length&&d[e].updated&&(i.text(d[e].updated),i.closest(".edd-profiler-log__timestamp").removeClass("edd-hidden"))}}))}))})();