!function(){function a(t){let n=0;for(let e=0;e<t.length;e++){var o=t.charCodeAt(e);n=(n<<5)-n+o,n|=0}return(n>>>0).toString(16)}bug_monitor.is4g=!(!navigator.connection||!navigator.connection.effectiveType||"4g"!=navigator.connection.effectiveType);const e=new MutationObserver(e=>{for(const o of e)if("childList"===o.type&&0<o.addedNodes.length)for(const r of o.addedNodes)if(r instanceof Element&&!["SCRIPT","META","NOSCRIPT"].includes(r.nodeName)){t=t=n=void 0;var t,n=r;if(!["HTML","HEAD","BODY"].includes(n.nodeName)&&!n.dataset.bmid){let e=a(Array.from(n.attributes).map(e=>e.name+"="+e.value).join("&")).toString();const i=n.parentElement,s=(i&&(t=i.getAttribute("data-bmid")||i.id||i.nodeName,e=t+"/"+e),n.previousElementSibling);!s||s.id&&"wpadminbar"===s.id||(t=s.getAttribute("data-bmid")||s.id||s.nodeName,e=e+"/"+t),e=a(e).toString(),n.setAttribute("data-bmid",e)}}});e.observe(document,{childList:!0,subtree:!0}),"on"==bug_monitor.config["network/csp"]&&document.addEventListener("securitypolicyviolation",function(e){bug_monitor.csp.push(e.blockedURI),bug_monitor.errors.push({type:"network/csp",level:"error",details:{url:e.blockedURI}})}),"on"!=bug_monitor.config["js/error"]&&"on"!=bug_monitor.config["network/mixed_content"]&&"on"!=bug_monitor.config["network/http"]||window.addEventListener("error",function(t){if(t.message){if(t.filename.match(/blob:/)){var e=document.querySelector('script[src="'+t.filename+'"]');if(e&&e.dataset.src){var n={},e=(["message","filename","lineno","error"].forEach(function(e){n[e]=t[e]}),e.dataset.src),o=new RegExp(t.filename,"g");n.filename=e;try{n.message=t.message.replace(t.filename,e),n.error.stack=t.error&&t.error.stack?t.error.stack.replace(o,e):""}catch(e){}t=n}}bug_monitor.errors.push({type:"js/error",level:"critical",details:{message:t.message,filename:t.filename,lineno:t.lineno,stack:t.error&&t.error.stack?t.error.stack:""}})}else if(t.target){o=t.target.src||t.target.href;if("string"==typeof o&&""!=o&&"https:"==document.location.protocol&&o.match(/^http:/))bug_monitor.errors.push({type:"network/mixed_content",level:"error",details:{url:o}});else{if(bug_monitor.csp.includes(o))return!0;bug_monitor.errors.push({type:"network/http",level:"error",details:{url:o}})}}return!0},!0);{let e=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{var t;["xmlhttprequest","fetch"].includes(e.initiatorType)&&(document.dispatchEvent(new CustomEvent("bm/ajax/finished")),"on"!=bug_monitor.config["ux/slow_response"]||[bug_monitor.mutation_endpoint,bug_monitor.screenshot_endpoint,bug_monitor.session_endpoint].includes(e.name)||(t=e.duration,n<t&&bug_monitor.errors.push({type:"ux/slow_response",level:"warning",details:{request_type:"AJAX",url:e.name,duration:t}})))})});e.observe({entryTypes:["resource"]});var n=navigator.connection&&navigator.connection.effectiveType&&"4g"==navigator.connection.effectiveType?800:2600}if("on"==bug_monitor.config["webvitals/lcp"]||"on"==bug_monitor.config["webvitals/fcp"]||"on"==bug_monitor.config["webvitals/cls"]){bug_monitor.cls=0;const r=new PerformanceObserver(e=>{for(const t of e.getEntries())"largest-contentful-paint"==t.entryType&&2500<t.startTime?bug_monitor.errors.push({type:"webvitals/lcp",level:"warning",details:{value:t.startTime}}):"first-contentful-paint"==t.name&&1e3<t.startTime?bug_monitor.errors.push({type:"webvitals/fcp",level:"warning",details:{value:t.startTime}}):"layout-shift"==t.entryType&&(bug_monitor.cls+=t.value)});["paint","largest-contentful-paint","layout-shift"].filter(e=>PerformanceObserver.supportedEntryTypes.includes(e)).forEach(function(e){r.observe({type:e,buffered:!0})})}var t=XMLHttpRequest.prototype.send,o=(XMLHttpRequest.prototype.send=function(){setTimeout(function(){document.dispatchEvent(new CustomEvent("bm/ajax/send"))},100),t.apply(this,arguments)},window.fetch);window.fetch=function(){return setTimeout(function(){document.dispatchEvent(new CustomEvent("bm/ajax/send"))},100),o.apply(this,arguments)}}();