const a="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let nanoid=(e=21)=>{let n="",o=crypto.getRandomValues(new Uint8Array(e));for(let s=0;s{const e={session:session,anonymous:anonymous,url:window.location.href,agent:window.navigator.userAgent,type:"session.ping"};$.ajax({url:SAVE_EVENTS,type:"POST",data:e}).done(function(e){console.log(e)})},eventSearchClick=(e,n,o)=>{const s={type:"search.click",productId:n,position:Number(o),url:decodeURI(window.location.href),text:decodeURI(e),agent:window.navigator.userAgent,anonymous:anonymous,session:session};$.ajax({url:SAVE_EVENTS,type:"POST",data:JSON.stringify(s),headers:{"Content-Type":"application/json"}}).done(function(e){console.log("search.click")})},eventSearchQuery=e=>{const n={session:session,anonymous:anonymous,url:window.location.href,agent:window.navigator.userAgent,type:"search.query",text:e,misspelled:!0,match:1,operator:"and"};fetch(SAVE_EVENTS,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(e=>{if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return e}).then(e=>{}).catch(e=>{console.error("Error:",e)})},eventPageCart=e=>{const n={session:session,anonymous:anonymous,products:e,type:e.length>0?"page.cart":"page.empty_cart"};$.ajax({url:SAVE_EVENTS,type:"POST",data:n}).done(function(e){console.log("page.cart")})};(()=>{const e=window.location.href;if(e.includes("search/?query=")){const n=new URL(e),o=new URLSearchParams(n.search).get("query");eventSearchQuery(o)}})();