function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var c,a={},t=Object.prototype,u=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function o(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{o({},"")}catch(c){o=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i,o,a,s,e=e&&e.prototype instanceof _?e:_,e=Object.create(e.prototype),n=new P(n||[]);return l(e,"_invoke",{value:(i=t,o=r,a=n,s=f,function(t,e){if(s===d)throw Error("Generator is already running");if(s===y){if("throw"===t)throw e;return{value:c,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,i=e.iterator[n];if(i===c)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=c,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=h(i,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;i=n.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=c),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===f)throw s=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=d;r=h(i,o,a);if("normal"===r.type){if(s=a.done?y:p,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(s=y,a.method="throw",a.arg=r.arg)}})}),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=s;var f="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function _(){}function g(){}function w(){}var e={},m=(o(e,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(E([]))),b=(m&&m!==t&&u.call(m,n)&&(e=m),w.prototype=_.prototype=Object.create(e));function k(t){["next","throw","return"].forEach(function(e){o(t,e,function(t){return this._invoke(e,t)})})}function S(a,s){var e;l(this,"_invoke",{value:function(r,n){function t(){return new s(function(t,e){!function e(t,r,n,i){var o,t=h(a[t],a,r);if("throw"!==t.type)return(r=(o=t.arg).value)&&"object"==_typeof(r)&&u.call(r,"__await")?s.resolve(r.__await).then(function(t){e("next",t,n,i)},function(t){e("throw",t,n,i)}):s.resolve(r).then(function(t){o.value=t,n(o)},function(t){return e("throw",t,n,i)});i(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function E(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r{var t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){var e,r,n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:try{e=this.getRequestUrl("hit"),r=new URLSearchParams(_objectSpread(_objectSpread({},WP_Statistics_Tracker_Object.hitParams),{},{referred:this.getReferred(),page_uri:this.getPathAndQueryString()})).toString(),(n=new XMLHttpRequest).open("POST",e,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("X-WPS-TS",this.base64Encode(Math.floor(Date.now()/1e3))),n.send(r),n.onreadystatechange=function(){var t;4===n.readyState&&(200===n.status?(t=JSON.parse(n.responseText),this.hitRequestSuccessful=!1!==t.status):(this.hitRequestSuccessful=!1,console.warn("WP Statistics: Hit request failed with status "+n.status)))}.bind(this)}catch(t){this.hitRequestSuccessful=!1,console.error("WP Statistics: Error sending hit request:",t)}case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}})(),sendOnlineUserRequest:(()=>{var t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){var e,r,n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.hitRequestSuccessful)try{e=this.getRequestUrl("online"),r=new URLSearchParams(_objectSpread(_objectSpread({},WP_Statistics_Tracker_Object.onlineParams),{},{referred:this.getReferred(),page_uri:this.getPathAndQueryString()})).toString(),(n=new XMLHttpRequest).open("POST",e,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("X-WPS-TS",this.base64Encode(Math.floor(Date.now()/1e3))),n.send(r)}catch(t){console.error("WP Statistics: Error sending online user request:",t)}case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}})(),keepUserOnline:function(){var e,r=this;WP_Statistics_Tracker_Object.option.userOnline&&(null!==this.userOnlineIntervalId&&(clearInterval(this.userOnlineIntervalId),this.userOnlineIntervalId=null),this.userOnlineIntervalId=setInterval(function(){WP_Statistics_Tracker_Object.option.dntEnabled&&(WP_Statistics_Tracker_Object.option.dntEnabled,1===this.isDndActive)||!this.hitRequestSuccessful||this.sendOnlineUserRequest()}.bind(this),this.checkTime),["click","keypress","scroll","DOMContentLoaded"].forEach(function(t){window.addEventListener(t,function(){clearTimeout(e),e=setTimeout(function(){null!==r.userOnlineIntervalId&&(clearInterval(r.userOnlineIntervalId),r.userOnlineIntervalId=null)},18e5)})}))},getRequestUrl:function(t){var e=WP_Statistics_Tracker_Object.requestUrl+"/";return WP_Statistics_Tracker_Object.option.bypassAdBlockers?e=WP_Statistics_Tracker_Object.ajaxUrl:"hit"===t?e+=WP_Statistics_Tracker_Object.hitParams.endpoint:"online"===t&&(e+=WP_Statistics_Tracker_Object.onlineParams.endpoint),e},updateTrackerObject:function(){var t=document.getElementById("wp-statistics-tracker-js-extra");if(t)try{var e=t.innerHTML.match(/var\s+WP_Statistics_Tracker_Object\s*=\s*(\{[\s\S]*?\});/);e&&e[1]&&(WP_Statistics_Tracker_Object=JSON.parse(e[1]))}catch(t){console.error("WP Statistics: Error parsing WP_Statistics_Tracker_Object",t)}},trackUrlChange:function(){var t=this;window.removeEventListener("popstate",t.handleUrlChange),history.pushState=function(){t.originalPushState.apply(history,arguments),t.handleUrlChange()},history.replaceState=function(){t.originalReplaceState.apply(history,arguments),t.handleUrlChange()},window.addEventListener("popstate",function(){t.handleUrlChange()})},handleUrlChange:function(){window.location.href!==this.lastUrl&&(this.lastUrl=window.location.href,this.updateTrackerObject(),this.hasTrackerInitializedOnce=!1,this.init())}}),window.WpStatisticsEventTracker||(window.WpStatisticsEventTracker={hasEventsInitializedOnce:!1,downloadTracker:!1,linkTracker:!1,init:(()=>{var t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:this.hasEventsInitializedOnce||WP_Statistics_Tracker_Object.isLegacyEventLoaded||(this.hasEventsInitializedOnce=!0,"undefined"!=typeof WP_Statistics_DataPlus_Event_Object&&(this.downloadTracker=WP_Statistics_DataPlus_Event_Object.options.downloadTracker,this.linkTracker=WP_Statistics_DataPlus_Event_Object.options.linkTracker,this.downloadTracker||this.linkTracker)&&this.captureEvent());case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}})(),captureEvent:function(){var r=this;document.querySelectorAll("a").forEach(function(t){t.addEventListener("click",(()=>{var e=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.handleEvent(e));case 1:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})()),t.addEventListener("mouseup",(()=>{var e=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.handleEvent(e));case 1:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})())})},handleEvent:(()=>{var e=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0="mouseup"==e.type&&1!=e.button,t.t0);else if(t.t1=e=this.prepareEventData(e),t.t1)return t.next=6,this.sendEventData(e);t.next=6;break;case 6:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}})(),prepareEventData:function(t){var e={en:t.type,et:Date.now(),eid:t.currentTarget.id,ec:t.currentTarget.className,ev:"",mb:t.button,fn:"",fx:"",m:"",tu:"",pid:""};return"A"===t.currentTarget.tagName&&(e=this.extractLinkData(t,e)),"undefined"!=typeof WP_Statistics_Tracker_Object&&(e.pid=WP_Statistics_Tracker_Object.hitParams.source_id),e},extractLinkData:function(t,e){var r=t.target.textContent,n=t.currentTarget.href,i=WP_Statistics_DataPlus_Event_Object.fileExtensions,i=new RegExp("\\.("+i.join("|")+")$","i"),r=(r&&(e.ev=r),n&&(e.tu=n),t.currentTarget.classList.contains("woocommerce-MyAccount-downloads-file")||n.includes("download_file="));if(e.wcdl=r,(i.test(n)||r)&&(t=new URL(n).pathname,e.df=r?n.substring(n.lastIndexOf("download_file=")+14).split("&").shift():"",e.dk=r?n.substring(n.lastIndexOf("key=")+4).split("&").shift():"",e.en="file_download",e.fn=r?e.df:t.substring(t.lastIndexOf("/")+1).split(".").shift(),e.fx=r?e.df:t.split(".").pop()),"click"===e.en){if(!this.linkTracker)return!1;if(n.toLowerCase().includes(window.location.host))return!1}return!("file_download"===e.en&&!this.downloadTracker)&&e},sendEventData:(()=>{var e=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var r,n,i;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(r in n=new URLSearchParams,e)n.append(r,e[r]);if(t.prev=2,i=WP_Statistics_DataPlus_Event_Object.eventAjaxUrl){t.next=6;break}throw new Error("DataPlus Event Ajax URL is not defined.");case 6:return t.next=8,fetch(i,{method:"POST",keepalive:!0,body:n});case 8:t.sent.ok,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(2),console.error("Error:",t.t0);case 14:case"end":return t.stop()}},t,null,[[2,11]])}));return function(t){return e.apply(this,arguments)}})()}),document.addEventListener("DOMContentLoaded",function(){var t=WP_Statistics_Tracker_Object.option.consentIntegration.name;t||(WpStatisticsUserTracker.init(),WpStatisticsEventTracker.init()),"wp_consent_api"===t&&handleWpConsentApiIntegration(),"real_cookie_banner"===t&&handleRealCookieBannerIntegration()});