(()=>{var t={300:(t,e,i)=>{var s={"./admin-header/_style.scss":179,"./admin-notification/_style.scss":809,"./alert-actions/_style.scss":168,"./comparisons/_style.scss":234,"./metabox-classic-editor/_style.scss":271,"./modal/_style.scss":799,"./settings-page/_style.scss":793,"./test-run-alerts/_style.scss":800,"./test-run-info/_style.scss":177,"./test-run-page/_style.scss":364,"./test-run-pagination/_style.scss":821,"./test-run-receipt/_style.scss":305,"./test-run-success/_style.scss":140,"./test-runs-page/_style.scss":479,"./tests-page/_style.scss":423,"./upgrade-page/_style.scss":946};function n(t){var e=r(t);return i(e)}function r(t){if(!i.o(s,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return s[t]}n.keys=function(){return Object.keys(s)},n.resolve=r,t.exports=n,n.id=300},962:(t,e,i)=>{var s={"./admin-notification/script.js":415,"./alert-actions/script.js":303,"./comparisons/script.js":784,"./modal/script.js":417,"./settings-page/script.js":563,"./test-run-alerts/script.js":650,"./test-run-page/script.js":74,"./test-run-pagination/script.js":191,"./test-run-success/script.js":486,"./test-runs-page/script.js":937,"./tests-page/script.js":318,"./upgrade-page/script.js":92};function n(t){var e=r(t);return i(e)}function r(t){if(!i.o(s,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return s[t]}n.keys=function(){return Object.keys(s)},n.resolve=r,t.exports=n,n.id=962},328:t=>{function e(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}e.keys=()=>[],e.resolve=e,e.id=328,t.exports=e},407:()=>{class t extends window.HTMLElement{static get observedAttributes(){return["time"]}attributeChangedCallback(t,e,i){"time"===t&&(this.time=new Date(i),this.update())}update(){var t;this.innerText=`${function(t){const{__}=wp.i18n,i=new Date;i.setHours(0,0,0,0);const s=new Date(t);s.setHours(0,0,0,0);const n=(s-i)/864e5;return 0===n?__("Today","visual-regression-testing"):1===n?__("Tomorrow","visual-regression-testing"):-1===n?__("Yesterday","visual-regression-testing"):e(t,"D, Y/m/d")}(this.time)} at ${t=this.time,e(t,"g:i a")}`}}function e(t,e){const i=t=>t<10?`0${t}`:t,s=i(t.getDate()),n=i(t.getMonth()+1),r=t.getFullYear(),a=t.getFullYear(),o=t.getHours(),h=i(t.getMinutes()),l=t.getSeconds(),p=t.getHours()%12||12,d=t.getHours()>=12?"pm":"am",c=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][t.getDay()];return e.replace("d",s).replace("m",n).replace("y",r).replace("Y",a).replace("H",o).replace("i",h).replace("s",l).replace("g",p).replace("a",d).replace("D",c)}window.customElements.define("vrts-relative-time",t)},415:(t,e,i)=>{"use strict";i.r(e),i(407),jQuery(document).ready((function(t){t(document).on("click",".vrts-notice .notice-dismiss",(e=>{if(ajaxurl){const i=e.target.parentElement.querySelector("#_wpnonce").value,s=e.target.parentElement.dataset.view,n={action:"vrts_admin_notice_dismiss",url:ajaxurl,security:i,view:s};t.ajax({type:"POST",url:ajaxurl,data:n})}}))}))},303:()=>{"use strict";class t extends window.HTMLElement{constructor(){super(),this.dropdown=null,this.setAsReadTimeout=null,this.resolveElements(),this.bindFunctions(),this.bindEvents()}resolveElements(){this.$actionButtons=this.querySelectorAll("[data-vrts-alert-action]"),this.$hideElementsForm=this.querySelector("[data-vrts-hide-elements-form]"),this.$hideElementsModal=document.getElementById("vrts-modal-hide-elements"),this.$spinner=this.querySelector(".spinner"),this.$success=this.querySelector(".vrts-alert-actions__modal-action-success")}bindFunctions(){this.onActionClick=this.onActionClick.bind(this),this.onHideElementsFormSubmit=this.onHideElementsFormSubmit.bind(this),this.onHideElementsModalClose=this.onHideElementsModalClose.bind(this)}bindEvents(){this.$actionButtons.forEach((t=>{t.addEventListener("click",this.onActionClick)})),this.$hideElementsForm.addEventListener("submit",this.onHideElementsFormSubmit),this.$hideElementsModal.addEventListener("hide",this.onHideElementsModalClose)}connectedCallback(){this.dropdown=function(t){const e=t.querySelector("[data-vrts-dropdown-open]"),i=t=>{const e=t.currentTarget,i=e.getAttribute("aria-controls"),s=document.getElementById(i),n="true"===e.getAttribute("aria-expanded");e.setAttribute("aria-expanded",!n),s.setAttribute("aria-hidden",n)},s=i=>{t&&t!==i.target&&!t.contains(i.target)&&(e.setAttribute("aria-expanded",!1),document.getElementById(e.getAttribute("aria-controls")).setAttribute("aria-hidden",!0))};return e?.addEventListener("click",i),document.addEventListener("click",s),()=>{e?.removeEventListener("click",i),document.removeEventListener("click",s)}}(this),this.setAsReadOnView()}setAsReadOnView(){this.$actionButtons.forEach((t=>{const e="read-status"===t.getAttribute("data-vrts-alert-action"),i="primary"===t.getAttribute("data-vrts-action-state");e&&i&&(this.setAsReadTimeout=setTimeout((()=>{t.click()}),1e3))}))}onHideElementsFormSubmit(t){t.preventDefault();const e=t.currentTarget,i=new window.FormData(e),s=i.get("post_id");this.$spinner.classList.add("is-active"),this.$success.classList.remove("is-active"),fetch(`${window.vrts_admin_vars.rest_url}/tests/post/${s}`,{method:"PUT",headers:{"X-WP-Nonce":window.vrts_admin_vars.rest_nonce},body:new URLSearchParams(i)}).then((t=>t.json())).then((()=>{this.$spinner.classList.remove("is-active"),this.$success.classList.add("is-active")}))}onHideElementsModalClose(){this.$success.classList.remove("is-active")}onActionClick(t){const e=t.currentTarget,i="true"===e.getAttribute("data-vrts-loading"),s="primary"===e.getAttribute("data-vrts-action-state");if(i)return;const n=e.getAttribute("data-vrts-alert-action"),r=e.getAttribute("data-vrts-alert-id");this.handleAction(n,e,r,s)}handleAction(t,e,i,s){const n=`${window.vrts_admin_vars.rest_url}/alerts/${i}/${t}`,r=s?"POST":"DELETE";let a=0,o=null;const h=setTimeout((()=>{e.setAttribute("data-vrts-loading","true");const t=window.Date.now();o=setInterval((()=>{a=window.Date.now()-t}),50)}),200);fetch(n,{method:r,headers:{"X-WP-Nonce":window.vrts_admin_vars.rest_nonce}}).then((t=>t.json())).then((()=>{const n=a>0?Math.abs(a-400):0;setTimeout((()=>{e.setAttribute("data-vrts-loading","false"),e.setAttribute("data-vrts-action-state",s?"secondary":"primary");const n=document.getElementById(`vrts-alert-${i}`);n&&("false-positive"===t&&n.setAttribute("data-vrts-false-positive",s?"true":"false"),"read-status"===t&&n.setAttribute("data-vrts-state",s?"read":"unread"))}),n),clearTimeout(h),clearInterval(o)}))}disconnectedCallback(){this.dropdown?.(),clearTimeout(this.setAsReadTimeout),this.$actionButtons?.forEach((t=>{t.removeEventListener("click",this.onActionClick)})),this.$hideElementsForm?.removeEventListener("submit",this.onHideElementsFormSubmit),this.$hideElementsModal?.removeEventListener("hide",this.onHideElementsModalClose)}}window.customElements.define("vrts-alert-actions",t)},784:(t,e,i)=>{class s extends window.HTMLElement{constructor(){super(),this.resolveElements(),this.bindFunctions(),this.bindEvents(),this.init()}resolveElements(){this.$content=document.querySelector("[data-vrts-fullscreen]"),this.$fullscreen=this.querySelector("[data-vrts-fullscreen-open]"),this.$control=this.querySelector("[data-vrts-comparisons-slider-control]"),this.$diffIndicator=this.querySelector("[data-vrts-comparisons-diff-inidicator]"),this.$comparison=this.querySelector('[data-vrts-comparisons-slot="comparison"] img')}bindFunctions(){this.onFullscreenToggle=this.onFullscreenToggle.bind(this),this.onControlChange=this.onControlChange.bind(this),this.onFullScreenChange=this.onFullScreenChange.bind(this),this.onLoadComparison=this.onLoadComparison.bind(this)}bindEvents(){this.$fullscreen.addEventListener("click",this.onFullscreenToggle),this.$control.addEventListener("input",this.onControlChange),document.addEventListener("fullscreenchange",this.onFullScreenChange)}init(){this.worker=new window.Worker(new URL(i(392),i.b)),this.worker.onmessage=this.onWorkerMessage.bind(this),this.$comparison.complete?this.onLoadComparison():this.$comparison.onload=this.onLoadComparison}onLoadComparison(){const t=this.createOffscreenCanvarImageData(this.$comparison);this.worker.postMessage({action:"analyzeImage",imageData:t})}createOffscreenCanvarImageData(t){const e=new window.OffscreenCanvas(t.naturalWidth,t.naturalHeight),i=e.getContext("2d");return i.drawImage(t,0,0),i.getImageData(0,0,e.width,e.height)}requestFullscreen(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}getFullscreenElement(){return document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement}onFullscreenToggle(t){t.preventDefault(),this.getFullscreenElement()===this.$content?this.exitFullscreen():this.requestFullscreen(this.$content)}onFullScreenChange(){this.$content.setAttribute("data-vrts-fullscreen",this.getFullscreenElement()===this.$content)}onControlChange(t){this.style.setProperty("--vrts-comparisons-slider-position",`${t.target.value}%`)}onWorkerMessage(t){"analyzedImage"===t.data?.action&&this.highlightPixels(t.data.coloredPixels)}highlightPixels(t){const e=this.$diffIndicator.getContext("2d");this.$diffIndicator.width=this.$comparison.naturalWidth,this.$diffIndicator.height=this.$comparison.naturalHeight,e.clearRect(0,0,this.$comparison.naturalWidth,this.$comparison.naturalHeight),e.fillStyle="#cc1818",t.forEach((t=>{e.fillRect(0,t-2,e.canvas.width,3)}))}connectedCallback(){}disconnectedCallback(){this.$fullscreen?.removeEventListener("click",this.onFullscreenToggle),this.$control?.removeEventListener("input",this.onControlChange),document.removeEventListener("fullscreenchange",this.onFullScreenChange),this.worker?.terminate(),this.worker=null}}window.customElements.define("vrts-comparisons",s)},417:()=>{"use strict";const t=":not([inert]):not([inert] *)",e=':not([tabindex^="-"])',i=":not(:disabled)";var s=[`a[href]${t}${e}`,`area[href]${t}${e}`,`input:not([type="hidden"]):not([type="radio"])${t}${e}${i}`,`input[type="radio"]${t}${e}${i}`,`select${t}${e}${i}`,`textarea${t}${e}${i}`,`button${t}${e}${i}`,`details${t} > summary:first-of-type${e}`,`iframe${t}${e}`,`audio[controls]${t}${e}`,`video[controls]${t}${e}`,`[contenteditable]${t}${e}`,`[tabindex]${t}${e}`];function n(t){(t.querySelector("[autofocus]")||t).focus()}function r(t,e){if(e&&h(t))return t;if(function(t){return!(t.shadowRoot&&"-1"===t.getAttribute("tabindex")||t.matches(":disabled,[hidden],[inert]"))}(t))if(t.shadowRoot){let i=a(t.shadowRoot,e);for(;i;){const t=r(i,e);if(t)return t;i=o(i,e)}}else if("slot"===t.localName){const i=t.assignedElements({flatten:!0});e||i.reverse();for(const t of i){const i=r(t,e);if(i)return i}}else{let i=a(t,e);for(;i;){const t=r(i,e);if(t)return t;i=o(i,e)}}return!e&&h(t)?t:null}function a(t,e){return e?t.firstElementChild:t.lastElementChild}function o(t,e){return e?t.nextElementSibling:t.previousElementSibling}const h=t=>!t.shadowRoot?.delegatesFocus&&t.matches(s.join(","))&&!(t=>!(!t.matches("details:not([open]) *")||t.matches("details>summary:first-of-type"))||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))(t);function l(t=document){const e=t.activeElement;return e?e.shadowRoot?l(e.shadowRoot)||document.activeElement:e:null}function p(t,e){return function e(i){return i&&i!==document&&i!==window?(i.assignedSlot&&(i=i.assignedSlot),i.closest(t)||e(i.getRootNode().host)):null}(e)}const d="data-a11y-dialog";class c{$el;id;previouslyFocused;shown;constructor(t){this.$el=t,this.id=this.$el.getAttribute(d)||this.$el.id,this.previouslyFocused=null,this.shown=!1,this.maintainFocus=this.maintainFocus.bind(this),this.bindKeypress=this.bindKeypress.bind(this),this.handleTriggerClicks=this.handleTriggerClicks.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.$el.setAttribute("aria-hidden","true"),this.$el.setAttribute("aria-modal","true"),this.$el.setAttribute("tabindex","-1"),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),document.addEventListener("click",this.handleTriggerClicks,!0)}destroy(){return this.fire("destroy").defaultPrevented||(this.hide(),document.removeEventListener("click",this.handleTriggerClicks,!0),this.$el.replaceWith(this.$el.cloneNode(!0))),this}show(t){return this.shown||this.fire("show",t).defaultPrevented||(this.shown=!0,this.$el.removeAttribute("aria-hidden"),this.previouslyFocused=l(),"BODY"===this.previouslyFocused?.tagName&&t?.target&&(this.previouslyFocused=t.target),"focus"===t?.type?this.maintainFocus(t):n(this.$el),document.body.addEventListener("focus",this.maintainFocus,!0),this.$el.addEventListener("keydown",this.bindKeypress,!0)),this}hide(t){return this.shown?(this.fire("hide",t).defaultPrevented||(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this.previouslyFocused?.focus?.(),document.body.removeEventListener("focus",this.maintainFocus,!0),this.$el.removeEventListener("keydown",this.bindKeypress,!0)),this):this}on(t,e,i){return this.$el.addEventListener(t,e,i),this}off(t,e,i){return this.$el.removeEventListener(t,e,i),this}fire(t,e){const i=new CustomEvent(t,{detail:e,cancelable:!0});return this.$el.dispatchEvent(i),i}handleTriggerClicks(t){const e=t.composedPath()[0],i=p(`[${d}-show="${this.id}"]`,e),s=p(`[${d}-hide="${this.id}"]`,e),n=p(`[${d}-hide]`,e)&&p('[aria-modal="true"]',e)===this.$el;i&&this.show(t),(s||n)&&this.hide(t)}bindKeypress(t){if(p('[aria-modal="true"]',l())!==this.$el)return;let e=!1;try{e=!!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open')}catch{}"Escape"!==t.key||"alertdialog"===this.$el.getAttribute("role")||e||(t.preventDefault(),this.hide(t)),"Tab"===t.key&&function(t,e){const[i,s]=function(t){const e=r(t,!0);return[e,e?r(t,!1)||e:null]}(t);if(!i)return e.preventDefault();const n=l();e.shiftKey&&n===i?(s.focus(),e.preventDefault()):e.shiftKey||n!==s||(i.focus(),e.preventDefault())}(this.$el,t)}maintainFocus(t){t.target.closest(`[aria-modal="true"], [${d}-ignore-focus-trap]`)||n(this.$el)}}function u(){for(const t of document.querySelectorAll("[data-a11y-dialog]"))new c(t)}"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",u):u());class f extends window.HTMLElement{connectedCallback(){this.modal=new c(this)}disconnectedCallback(){this.modal.destroy()}}window.customElements.define("vrts-modal",f)},563:()=>{class t extends window.HTMLElement{constructor(){super(),this.resolveElements(),this.bindFunctions(),this.bindEvents()}resolveElements(){this.$proSettingsCheckboxes=this.querySelectorAll('[data-a11y-dialog-show] input[type="checkbox"]')}bindFunctions(){this.onCheckboxChange=this.onCheckboxChange.bind(this)}bindEvents(){this.$proSettingsCheckboxes?.forEach((t=>{t.addEventListener("change",this.onCheckboxChange)}))}onCheckboxChange(t){t.preventDefault(),t.currentTarget.checked=!t.currentTarget.checked}disconnectedCallback(){this.$proSettingsCheckboxes?.forEach((t=>{t.removeEventListener("change",this.onCheckboxChange)}))}}window.customElements.define("vrts-settings",t)},650:()=>{class t extends window.HTMLElement{constructor(){super(),this.resolveElements(),this.bindFunctions(),this.bindEvents(),this.unreadAlerts=new Set,this.initialUnreadAlerts=0,this.unreadRuns=parseInt(this.getAttribute("data-vrts-unread-runs"),10)}resolveElements(){this.$heading=this.querySelector(".vrts-test-run-alerts__heading"),this.$alerts=this.querySelectorAll("[data-vrts-alert]"),this.$actionButtons=this.querySelectorAll("[data-vrts-test-run-action]"),this.$runsMenuItems=[document.querySelector('.vrts-admin-header [href*="page=vrts-runs"]'),document.querySelector('#adminmenu .menu-top[href*="page=vrts"] .wp-menu-name'),document.querySelector('#adminmenu .wp-submenu a[href*="page=vrts-runs"]')]}bindFunctions(){this.handleAlertClick=this.handleAlertClick.bind(this),this.handleActionClick=this.handleActionClick.bind(this),this.updateRunsCount=this.updateRunsCount.bind(this)}bindEvents(){this.$alerts?.forEach((t=>{t.addEventListener("click",this.handleAlertClick)})),this.$actionButtons?.forEach((t=>{t.addEventListener("click",this.handleActionClick)}))}connectedCallback(){this.checkHeadingSticky(),this.checkReadStatusChange(),this.$alerts.forEach((t=>{"unread"===t.getAttribute("data-vrts-state")&&this.unreadAlerts.add(t.getAttribute("data-vrts-alert"))})),this.initialUnreadAlerts=this.unreadAlerts.size}checkHeadingSticky(){new window.IntersectionObserver((t=>{const e=!t[0].isIntersecting;this.$heading.setAttribute("data-is-sticky",e)}),{root:document,threshold:[1]}).observe(this.$heading)}checkReadStatusChange(){const t=new window.MutationObserver((t=>{t.forEach((t=>{if("attributes"===t.type&&"data-vrts-state"===t.attributeName){const e=t.target.getAttribute("data-vrts-alert"),i=t.target.getAttribute("data-vrts-state");if("receipt"===e)return;"unread"===i?this.unreadAlerts.add(e):this.unreadAlerts.delete(e),this.querySelector('[data-vrts-test-run-action="read-status"]').setAttribute("data-vrts-action-state",this.unreadAlerts.size>0?"primary":"secondary"),this.updateRunsCount(this.unreadAlerts.size)}}))}));this.$alerts.forEach((e=>{t.observe(e,{attributes:!0})}))}updateRunsCount(t){let e=this.unreadRuns;t>0&&0===this.initialUnreadAlerts?e+=1:0===t&&this.initialUnreadAlerts>0&&(e-=1),this.$runsMenuItems.forEach((t=>{if(t&&(t.querySelector(".update-plugins")?.remove(),t.textContent=t.textContent.replace(/\u00A0/g,""),e>0)){const i=document.createElement("span"),s=document.createTextNode(" ");i.classList.add("update-plugins"),i.textContent=e,t.appendChild(s),t.appendChild(i)}}))}handleAlertClick(t){t.preventDefault();const e=t.currentTarget;if("true"===e.getAttribute("data-vrts-current"))return;const i=e.getAttribute("href"),s=document.querySelector("vrts-comparisons")||document.querySelector("vrts-test-run-success"),n=document.querySelector("vrts-test-run-pagination");this.$alerts.forEach((t=>{t.setAttribute("data-vrts-current","false")})),e.setAttribute("data-vrts-current","true");const r=setTimeout((()=>{s.setAttribute("data-vrts-loading","true")}),200);fetch(i).then((t=>t.text())).then((t=>{const e=(new window.DOMParser).parseFromString(t,"text/html"),a=e.querySelector("vrts-comparisons")||e.querySelector("vrts-test-run-success"),o=e.querySelector("vrts-test-run-pagination");window.history.replaceState({},"",i),this.scrollTo(s.offsetTop-62),a&&s.replaceWith(a),o&&n.replaceWith(o),clearTimeout(r)}))}handleActionClick(t){const e=t.currentTarget,i="true"===e.getAttribute("data-vrts-loading"),s="primary"===e.getAttribute("data-vrts-action-state");if(i)return;const n=e.getAttribute("data-vrts-test-run-action"),r=e.getAttribute("data-vrts-test-run-id");this.handleAction(n,e,r,s)}handleAction(t,e,i,s){const n=`${window.vrts_admin_vars.rest_url}/test-runs/${i}/${t}`,r=s?"POST":"DELETE";let a=0,o=null;const h=setTimeout((()=>{e.setAttribute("data-vrts-loading","true");const t=window.Date.now();o=setInterval((()=>{a=window.Date.now()-t}),50)}),200);fetch(n,{method:r,headers:{"X-WP-Nonce":window.vrts_admin_vars.rest_nonce}}).then((t=>t.json())).then((()=>{const t=a>0?Math.abs(a-400):0;setTimeout((()=>{e.setAttribute("data-vrts-loading","false"),e.setAttribute("data-vrts-action-state",s?"secondary":"primary"),document.querySelectorAll("[data-vrts-alert]").forEach((t=>{t.setAttribute("data-vrts-state",s?"read":"unread")}))}),t),clearTimeout(h),clearInterval(o)}))}scrollTo(t){(document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||window).scrollTo({top:t,behavior:"smooth"})}disconnectedCallback(){this.$alerts?.forEach((t=>{t.removeEventListener("click",this.handleAlertClick)})),this.$actionButtons?.forEach((t=>{t.removeEventListener("click",this.handleActionClick)}))}}window.customElements.define("vrts-test-run-alerts",t)},74:()=>{class t extends window.HTMLElement{constructor(){super(),this.bindFunctions(),this.bindEvents(),this.isScrolling=!1}bindFunctions(){this.onScroll=this.onScroll.bind(this),this.setOffset=this.setOffset.bind(this)}bindEvents(){document.addEventListener("scroll",this.onScroll)}onScroll(){this.isScrolling||(this.isScrolling=!0,window.requestAnimationFrame(this.setOffset))}setOffset(){const t=Math.max(0,this.offset-window.scrollY);this.style.setProperty("--vrts-test-run-page-offset",`${t}px`),this.isScrolling=!1}connectedCallback(){const t=this.getBoundingClientRect(),e=document.getElementById("wpadminbar").offsetHeight;this.offset=t.top+window.scrollY-e,this.setOffset()}disconnectedCallback(){document.removeEventListener("scroll",this.onScroll)}}window.customElements.define("vrts-test-run-page",t)},191:()=>{class t extends window.HTMLElement{constructor(){super(),this.resolveElements(),this.bindFunctions(),this.bindEvents()}resolveElements(){this.$alerts=document.querySelectorAll("[data-vrts-alert]"),this.$buttons=this.querySelectorAll(".button")}bindFunctions(){this.handleClick=this.handleClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}bindEvents(){this.$buttons?.forEach((t=>{t.addEventListener("click",this.handleClick)})),document.addEventListener("keydown",this.handleKeyDown)}handleClick(t){t.preventDefault();const e=t.currentTarget,i=e.getAttribute("data-vrts-alert-id");let s=document.getElementById(`vrts-alert-${i}`);if(!s)return;const n=e.getAttribute("href"),r=document.querySelector("vrts-comparisons")||document.querySelector("vrts-test-run-success"),a=document.querySelector(".vrts-test-run-page__sidebar");this.$alerts.forEach((t=>{t.setAttribute("data-vrts-current","false")})),s.setAttribute("data-vrts-current","true");let o=0,h=null;const l=setTimeout((()=>{r.setAttribute("data-vrts-loading","true");const t=window.Date.now();h=setInterval((()=>{o=window.Date.now()-t}),50)}),200);let p=0;for(;s&&s!==a;)p+=s.offsetTop,s=s.offsetParent;a.scrollTo({top:p-82,behavior:"smooth"}),fetch(n).then((t=>t.text())).then((t=>{const e=(new window.DOMParser).parseFromString(t,"text/html"),i=e.querySelector("vrts-comparisons")||e.querySelector("vrts-test-run-success"),s=e.querySelector("vrts-test-run-pagination");window.history.replaceState({},"",n),this.scrollTo(r.offsetTop-62);const a=o>0?Math.abs(o-400):0;setTimeout((()=>{i&&r.replaceWith(i),s&&this.replaceWith(s)}),a),clearTimeout(l),clearInterval(h)}))}handleKeyDown(t){"ArrowUp"===t.key&&(t.preventDefault(),this.querySelector('[data-vrts-pagination="prev"]').click()),"ArrowDown"===t.key&&(t.preventDefault(),this.querySelector('[data-vrts-pagination="next"]').click())}scrollTo(t){(document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||window).scrollTo({top:t,behavior:"smooth"})}disconnectedCallback(){this.$buttons?.forEach((t=>{t.removeEventListener("click",this.handleClick)})),document.removeEventListener("keydown",this.handleKeyDown)}}window.customElements.define("vrts-test-run-pagination",t)},486:(t,e,i)=>{"use strict";i.r(e);var s=i(816),n=i.n(s);class r extends window.HTMLElement{constructor(){super(),this.resolveElements()}resolveElements(){this.$lottiePlayer=this.querySelector("[vrts-lottie-player]")}connectedCallback(){this.lottieAnimation=n().loadAnimation({path:`${window.vrts_admin_vars.pluginUrl}/assets/animations/success-check.json`,container:this.$lottiePlayer,renderer:"svg",loop:!1,autoplay:!0})}disconnectedCallback(){this.lottieAnimation.destroy()}loaAnimation(){this.$lottiePlayer.play()}}window.customElements.define("vrts-test-run-success",r)},937:()=>{class t extends window.HTMLElement{constructor(){super(),this.resolveElements()}resolveElements(){this.$runsListTable=this.querySelector("form .vrts-test-runs-list-table")}connectedCallback(){this.highlightNewTestRuns()}highlightNewTestRuns(){const t=new Set(JSON.parse(window.localStorage.getItem("vrtsNewTestRuns")||"[]")),e=this.$runsListTable.querySelectorAll("tr[data-test-run-id]");let i=0;e.forEach((e=>{const s=e.getAttribute("data-test-run-id");"true"===e.getAttribute("data-test-run-new")?t.has(s)||(t.add(s),setTimeout((()=>{e.classList.add("test-run-highlighted")}),i),i+=200):t.has(s)&&t.delete(s)})),window.localStorage.setItem("vrtsNewTestRuns",JSON.stringify([...t]))}}window.customElements.define("vrts-test-runs-page",t)},318:()=>{document.getElementById("show-modal-add-new")?.addEventListener("click",(()=>{window.wpLink.open("input_hidden_internal_url")})),window.wp=window.wp||{},function(t,e){window.inlineEditTest={init(){const e=this,i=t("#inline-edit");e.type="test",e.what="#test-",i.on("keyup",(function(t){if(27===t.which)return inlineEditTest.revert()})),t(".cancel",i).on("click",(function(){return inlineEditTest.revert()})),t(".save",i).on("click",(function(){return inlineEditTest.save(this)})),t("td",i).on("keydown",(function(e){if(13===e.which&&!e.shiftKey&&!t(e.target).hasClass("cancel"))return inlineEditTest.save(this)})),t("#the-list").on("click",".editinline",(function(){t(this).attr("aria-expanded","true"),inlineEditTest.edit(this)})),t("#doaction").on("click",(function(i){e.whichBulkButtonId=t(this).attr("id");const s=e.whichBulkButtonId.substr(2);"edit"===t('select[name="'+s+'"]').val()?i.preventDefault():t("form#posts-filter tr.inline-editor").length>0&&e.revert()}))},toggle(e){const i=this;"none"===t(i.what+i.getId(e)).css("display")?i.revert():i.edit(e)},edit(e){const i=this;i.revert(),"object"==typeof e&&(e=i.getId(e));const s=t("#inline-edit").clone(!0);t("td",s).attr("colspan",t("th:visible, td:visible",".widefat:first thead").length),t("td",s).find("#quick-edit-legend").removeAttr("id"),t("td",s).find('p[id^="quick-edit-"]').removeAttr("id"),t(i.what+e).removeClass("is-expanded").hide().after(s).after('');const n=t("#inline_"+e),r=t(".hide_css_selectors",n).text();return t(':input[name="hide_css_selectors"]',s).val(r),t(s).attr("id","edit-"+e).addClass("inline-editor").show(),t(':input[name="hide_css_selectors"]',s).trigger("focus"),!1},save(i){"object"==typeof i&&(i=this.getId(i)),t("table.widefat .spinner").addClass("is-active");const s={action:"vrts_test_quick_edit_save",test_id:i,hide_css_selectors:t("#edit-"+i+' [name="hide_css_selectors"]').val(),nonce:t("#_vrts_test_quick_edit_nonce").val()};return t.post(ajaxurl,s,(function(s){if(t("table.widefat .spinner").removeClass("is-active"),!(s=t.parseJSON(s)).success){const n=t("#edit-"+i+" .inline-edit-save .notice-error");return n.removeClass("hidden"),n.text(s.message),void e.a11y.speak(s.message)}t("#inline_"+i+" .hide_css_selectors").text(s.hide_css_selectors);const n=t(".widefat");(i=t(".inline-editor",n).attr("id"))&&(t(".spinner",n).removeClass("is-active"),t("#"+i).siblings("tr.hidden").addBack().remove(),i=i.substr(i.lastIndexOf("-")+1),t("#test-"+i).fadeIn(400).find(".editinline").attr("aria-expanded","false").trigger("focus")),e.a11y.speak(s.message);const r=s.snapshot_status,a=t("#test-"+i+" .base_screenshot_date");null!=r&&""!==r&&a.text(r)}),"html"),!1},revert(){const e=t(".widefat");let i=t(".inline-editor",e).attr("id");return i&&(t(".spinner",e).removeClass("is-active"),t("#"+i).siblings("tr.hidden").addBack().remove(),i=i.substr(i.lastIndexOf("-")+1),t(this.what+i).show().find(".editinline").attr("aria-expanded","false").trigger("focus")),!1},getId(e){const i=t(e).closest("tr").attr("id").split("-");return i[i.length-1]}},t((function(){t(".vrts-list-table-page").length&&inlineEditTest.init()}))}(jQuery,window.wp)},92:(t,e,i)=>{"use strict";i.r(e);var s=i(570),n=i.n(s);document.querySelector(".vrts_upgrade_page")&&n()({checkOrigin:!1,heightCalculationMethod:"taggedElement"},"#vrts_upgrade_iframe")},570:(t,e)=>{var i,s,n;!function(r){if("undefined"!=typeof window){var a,o,h=0,l=!1,p=!1,d="[iFrameSizer]",c=null,u=window.requestAnimationFrame,f=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),m={},g=null,v=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){C("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),y={};window.jQuery!==r&&((o=window.jQuery).fn?o.fn.iFrameResize||(o.fn.iFrameResize=function(t){return this.filter("iframe").each((function(e,i){z(i,t)})).end()}):A("","Unable to bind to jQuery, it is not fully loaded.")),s=[],(n="function"==typeof(i=j)?i.apply(e,s):i)===r||(t.exports=n),window.iFrameResize=window.iFrameResize||j()}function b(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(t,e,i){t.addEventListener(e,i,!1)}function _(t,e,i){t.removeEventListener(e,i,!1)}function k(t){return m[t]?m[t].log:l}function x(t,e){S("log",t,e,k(t))}function A(t,e){S("info",t,e,k(t))}function C(t,e){S("warn",t,e,!0)}function S(t,e,i,s){!0===s&&"object"==typeof window.console&&console[t](function(t){return d+"["+function(t){var e="Host page: "+t;return window.top!==window.self&&(e=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),e}(t)+"]"}(e),i)}function E(t){function e(){i("Height"),i("Width"),$((function(){R(S),F(E),l("onResized",S)}),S,"init")}function i(t){var e=Number(m[E]["max"+t]),i=Number(m[E]["min"+t]),s=t.toLowerCase(),n=Number(S[s]);x(E,"Checking "+s+" is in range "+i+"-"+e),ne&&(n=e,x(E,"Set "+s+" to max value")),S[s]=""+n}function s(t){return k.slice(k.indexOf(":")+7+t)}function n(t,e){var i,s;i=function(){var i,s;O("Send Page Info","pageInfo:"+(i=document.body.getBoundingClientRect(),s=S.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:s.height,iframeWidth:s.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(s.top-i.top,10),offsetLeft:parseInt(s.left-i.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),t,e)},y[s=e]||(y[s]=setTimeout((function(){y[s]=null,i()}),32))}function r(t){var e=t.getBoundingClientRect();return D(E),{x:Math.floor(Number(e.left)+Number(c.x)),y:Math.floor(Number(e.top)+Number(c.y))}}function a(t){var e=t?r(S.iframe):{x:0,y:0},i={x:Number(S.width)+e.x,y:Number(S.height)+e.y};x(E,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(c=i,o(),x(E,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):C(E,"Unable to scroll to requested position, window.parentIFrame not found")}function o(){!1===l("onScroll",c)?I():F(E)}function h(t){var e={};if(0===Number(S.width)&&0===Number(S.height)){var i=s(9).split(":");e={x:i[1],y:i[0]}}else e={x:S.width,y:S.height};l(t,{iframe:S.iframe,screenX:Number(e.x),screenY:Number(e.y),type:S.type})}function l(t,e){return P(E,t,e)}var p,u,f,g,v,b,k=t.data,S={},E=null;"[iFrameResizerChild]Ready"===k?function(){for(var t in m)O("iFrame requested init",N(t),m[t].iframe,t)}():d===(""+k).slice(0,13)&&k.slice(13).split(":")[0]in m?(g=(f=k.slice(13).split(":"))[1]?parseInt(f[1],10):0,v=m[f[0]]&&m[f[0]].iframe,b=getComputedStyle(v),S={iframe:v,id:f[0],height:g+function(t){return"border-box"!==t.boxSizing?0:(t.paddingTop?parseInt(t.paddingTop,10):0)+(t.paddingBottom?parseInt(t.paddingBottom,10):0)}(b)+function(t){return"border-box"!==t.boxSizing?0:(t.borderTopWidth?parseInt(t.borderTopWidth,10):0)+(t.borderBottomWidth?parseInt(t.borderBottomWidth,10):0)}(b),width:f[2],type:f[3]},E=S.id,m[E]&&(m[E].loaded=!0),(u=S.type in{true:1,false:1,undefined:1})&&x(E,"Ignoring init message from meta parent page"),!u&&function(t){var e=!0;return m[t]||(e=!1,C(S.type+" No settings for "+t+". Message was: "+k)),e}(E)&&(x(E,"Received: "+k),p=!0,null===S.iframe&&(C(E,"IFrame ("+S.id+") not found"),p=!1),p&&function(){var e,i=t.origin,s=m[E]&&m[E].checkOrigin;if(s&&""+i!="null"&&!(s.constructor===Array?function(){var t=0,e=!1;for(x(E,"Checking connection is from allowed list of origins: "+s);tm[o]["max"+t])throw new Error("Value for min"+t+" can not be greater than max"+t)}i("Height"),i("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(m[o]&&m[o].bodyMargin)&&"0"!==(m[o]&&m[o].bodyMargin)||(m[o].bodyMarginV1=m[o].bodyMargin,m[o].bodyMargin=m[o].bodyMargin+"px"),s=N(o),(n=b())&&(a=function(e){if(!t.parentNode)return null;var i=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&M(t)}))}))}));return i.observe(t.parentNode,{childList:!0}),i}(n)),w(t,"load",(function(){var e,i;O("iFrame.onload",s,t,r,!0),e=m[o]&&m[o].firstRun,i=m[o]&&m[o].heightCalculationMethod in f,!e&&i&&L({iframe:t,height:0,width:0,type:"init"})})),O("init",s,t,r,!0),m[o]&&(m[o].iframe.iFrameResizer={close:M.bind(null,m[o].iframe),removeListeners:T.bind(null,m[o].iframe),resize:O.bind(null,"Window resize","resize",m[o].iframe),moveToAnchor:function(t){O("Move to anchor","moveToAnchor:"+t,m[o].iframe,o)},sendMessage:function(t){O("Send Message","message:"+(t=JSON.stringify(t)),m[o].iframe,o)}}))}function B(t,e){null===g&&(g=setTimeout((function(){g=null,t()}),e))}function V(){"hidden"!==document.visibilityState&&(x("document","Trigger event: Visibility change"),B((function(){q("Tab Visible","resize")}),16))}function q(t,e){Object.keys(m).forEach((function(i){(function(t){return m[t]&&"parent"===m[t].resizeFrom&&m[t].autoResize&&!m[t].firstRun})(i)&&O(t,e,m[i].iframe,i)}))}function j(){function t(t,i){i&&(function(){if(!i.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==i.tagName.toUpperCase())throw new TypeError("Expected