!function(){var e={7876:function(){document.addEventListener("DOMContentLoaded",(function(){const e=document.querySelectorAll("[data-show-if]");function t(e){let[t,n]=e.includes("!=")?e.split("!="):e.split("=");const o=e.includes("!="),l=document.querySelector(`[name="${t}"]:last-of-type`),r=document.querySelector(`input[type="radio"][name="${t}"]:checked`);if(!l&&!r)return!1;let a=l;r&&(a=r);let c=a.value;if("checkbox"===a.type){const e=document.querySelector(`input[type="hidden"][name="${t}"]`);c=a.checked?a.value:e?e.value:""}return o?c!==n:c===n}function n(){e.forEach((e=>{const n=e.dataset.showIf.split("|").map((e=>e.trim()));let o=!1;for(const e of n)if(e.split("&").map((e=>e.trim())).every(t)){o=!0;break}e.style.display=o?"":"none",e.querySelectorAll("input[required], select[required], textarea[required]").forEach((e=>{o?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}))}))}n();const o=new Set;e.forEach((e=>{e.dataset.showIf.split(/[&|]/).forEach((e=>{const t=e.trim(),n=t.includes("!=")?t.split("!=")[0]:t.split("=")[0];o.add(n)}))})),o.forEach((e=>{const t=document.querySelector(`[name="${e}"]:last-of-type`),o=document.querySelectorAll(`input[type="radio"][name="${e}"]`);t&&0===o.length?t.addEventListener("change",n):o.length>0&&o.forEach((e=>{e.addEventListener("change",n)}))}))}))}},t={};function n(o){var l=t[o];if(void 0!==l)return l.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";n(7876),function(e){if("undefined"==typeof wpmtkDebugMode||!wpmtkDebugMode.isPro)return;const t=wpmtkDebugMode;let n=null,o=0,l=!1;function r(){e.ajax({url:t.ajaxUrl,type:"POST",data:{action:"wpmastertoolkit_get_debug_log",nonce:t.nonce,last_size:o},success:function(t){if(t.success&&t.data.content){const n=e("#wpmtk-log-viewer"),l=n[0].scrollHeight-n.scrollTop()<=n.outerHeight()+50,r=function(t){const n=e("<div>").text(t).html().split("\n[");let o="",l=!1;return n.forEach((function(e){if(""===e.trim())return void(o+="\n");if((e=(e=0===n.indexOf(e)?e:"["+e).replace(/\n/g,"<br>")).match(/^#\d+\s+/)||l&&e.match(/^\s+/))return l=!0,void(o+='<span class="log-entry log-stack">'+e+"</span>\n");l=!1;let t="log-entry",r=e;e.match(/PHP Fatal error/i)?t+=" log-fatal":e.match(/PHP Warning/i)?t+=" log-warning":e.match(/PHP Notice/i)?t+=" log-notice":e.match(/PHP Deprecated/i)?t+=" log-deprecated":e.match(/error|exception|fatal/i)&&(t+=" log-error"),r=r.replace(/\[(\d{2}-\w{3}-\d{4}\s+\d{2}:\d{2}:\d{2}\s+\w+)\]/g,'<span class="log-date">[$1]</span>'),r=r.replace(/(\S+\.php)/g,'<span class="log-file">$1</span>'),r=r.replace(/on line (\d+)/g,'on line <span class="log-line">$1</span>'),o+='<span class="'+t+'">'+r+"</span>\n"})),o}(t.data.content);if(t.data.reset)return e("#wpmtk-log-content").html(r),void(o=0);0===o?e("#wpmtk-log-content").html(r):e("#wpmtk-log-content").append(r),o=t.data.size,(l||o===t.data.size)&&n.scrollTop(n[0].scrollHeight)}else t.data&&t.data.message&&0===o&&e("#wpmtk-log-content").html(t.data.message)},error:function(){l&&e("#wpmtk-log-content").append("\n"+t.i18n.fetchError)}})}e("#wpmtk-start-log-stream").on("click",(function(){l=!0,o=0,e(this).hide(),e("#wpmtk-stop-log-stream").show(),e("#wpmtk-log-content").html(t.i18n.loadingLogs),r(),n=setInterval(r,2e3)})),e("#wpmtk-stop-log-stream").on("click",(function(){l=!1,e(this).hide(),e("#wpmtk-start-log-stream").show(),n&&(clearInterval(n),n=null)})),e("#wpmtk-clear-log-display").on("click",(function(){e("#wpmtk-log-content").html(t.i18n.displayCleared),o=0})),e("#wpmtk-download-log").on("click",(function(){const t=e("#wpmtk-log-content").text(),n=new Blob([t],{type:"text/plain"}),o=window.URL.createObjectURL(n),l=document.createElement("a");l.href=o,l.download="debug-log-"+(new Date).getTime()+".txt",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(o)})),e("#wpmtk-delete-log").on("click",(function(){confirm(t.i18n.confirmDelete)&&e.ajax({url:t.ajaxUrl,type:"POST",data:{action:"wpmastertoolkit_delete_debug_log",nonce:t.nonce},success:function(n){n.success?(e("#wpmtk-log-content").html(t.i18n.logDeleted),o=0,l&&e("#wpmtk-stop-log-stream").click(),alert(t.i18n.logDeleted)):alert(t.i18n.error+(n.data.message||t.i18n.unknownError))},error:function(){alert(t.i18n.deleteFailed)}})})),e("#wpmtk-wrap-logs").on("change",(function(){e(this).is(":checked")?e("#wpmtk-log-viewer").addClass("wpmtk-log-wrap"):e("#wpmtk-log-viewer").removeClass("wpmtk-log-wrap")}))}(jQuery)}()}();