(function(g){g.fn.extend(window.WPD.ajaxsearchpro.plugin,{gaEvent:function(a,c){let h=this.gaGetTrackingID();if("undefined"==typeof ASP.analytics||"event"!=ASP.analytics.method)return!1;let d="function"==typeof gtag?gtag:!1;if(!1===d&&"undefined"==typeof window.dataLayer)return!1;if("undefined"!=typeof ASP.analytics.event[a]&&1==ASP.analytics.event[a].active){let l={search_id:this.o.id,search_name:this.n("search").data("name"),phrase:this.n("text").val(),option_name:"",option_value:"",result_title:"",
result_url:"",results_count:""},b={event_category:ASP.analytics.event[a].category,event_label:ASP.analytics.event[a].label,value:ASP.analytics.event[a].value};c=g.fn.extend(l,c);Object.keys(c).forEach(function(e){let f=c[e];f=String(f).replace(/[\s\n\r]+/g," ").trim();Object.keys(b).forEach(function(k){b[k]=b[k].replace(new RegExp("{"+e+"}","gmi"),f)})});!1!==d?!1!==h?h.forEach(function(e){b.send_to=e;d("event",ASP.analytics.event[a].action,b)}):d("event",ASP.analytics.event[a].action,b):"undefined"!=
typeof window.dataLayer.push&&window.dataLayer.push({event:"asp_event",event_name:ASP.analytics.event[a].action,event_category:b.event_category,event_label:b.event_label,event_value:b.value})}},gaGetTrackingID:function(){if("undefined"==typeof ASP.analytics)return!1;if("undefined"!=typeof ASP.analytics.tracking_id&&""!=ASP.analytics.tracking_id)return[ASP.analytics.tracking_id];if(!1===("function"==typeof window.gtag?window.gtag:!1)&&"undefined"!=typeof window.ga&&"undefined"!=typeof window.ga.getAll){let a=
[];window.ga.getAll().forEach(function(c){a.push(c.get("trackingId"))});return 0<a.length?a:!1}return!1}})})(WPD.dom);
