/* 228F74BA4E180F68/shopify-files/1-pmid.js */ _pm_pid = '228F74BA4E180F68'; _pm_root = 'https://my.profitmetrics.io'; /* 228F74BA4E180F68/shopify-files/1000-shopify-bundle.js */ !function(){"use strict";var e=["AdsBot-Google","AdsBot-Google-Mobile","Googlebot","Storebot-Google","APIs-Google","Mediapartners-Google","FeedFetcher-Google","Google-Read-Aloud","DuplexWeb-Google","Google Favicon","googleweblight","Pinterestbot","AhrefsSiteAudit","AhrefsBot","Seekport Crawler","DuckDuckBot","PingdomPageSpeed","pingbot","YandexAccessibilityBot","adidxbot","bingbot","SMTBot","HubSpot Crawler","e.ventures Investment Crawler","Cincraw","Facebot","Twitterbot","Jooblebot","YisouSpider","YandexMetrika","Applebot","PagePeeker","Linespider","proximic","Algolia Crawler Renderscript","PetalBot","SEOFeedback_WebCrawler","oBot","Impact Radius Compliance Bot","Cocolyzebot","nlnbot","SemrushBot-SA","Bytespider","RyteBot","BrandVeritySpider","ethical-bugbot","Screaming Frog SEO Spider","BublupBot","bitlybot","Better Uptime Bot","KargoBot-Artemis-Mobile","YandexVideoParser","DotBot","BLEXBot","CheckMarkNetwork","MegaIndex.ru","Baiduspider","SurdotlyBot","Taboolabot","SiteScoreBot","StatusCake_Pagespeed_Indev","www.facebook.com/externalhit_uatext.php","+http://yandex.com/bots","YandexBot","LinkedInBot","+https://intelx.io","+https://www.seokicks.de/robot.html","SEOkicks;","ZoominfoBot","BingPreview","Morningscore","heritrix","http://tech.quickpay.net/api/callback","CookieInformationScanner","MJ12bot","KlarnaBot-PriceWatcher","HeadlessChrome","Barkrowler","Chrome-Lighthouse"];const t=e=>{const t=`${e}=`,o=document.cookie.split(";");for(let e=0;e{let n="";if(o){const e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3),n=`; expires=${e.toUTCString()}`}document.cookie=`${e}=${t||""}${n}; path=/`},n=e=>{const t=new RegExp(`[?&]${e}=([^&#]*)`).exec(window.location.search);return null===t?null:decodeURIComponent(t[1].replace(/\+/g," "))},r=async(e,t)=>{const o=new Headers;o.append("accept","application/json"),o.append("Content-Type","text/plain");const n={method:"POST",headers:o,body:t};await fetch(`https://api.my.profitmetrics.io/api/public/frontend/clientLog?level=${e}`,n)};var i;!function(e){e.Shopify="shopify"}(i||(i={}));const a=()=>!window.Shopify.customerPrivacy||window.Shopify.customerPrivacy.userCanBeTracked(),c=()=>!window.Shopify?.customerPrivacy||window.Shopify?.customerPrivacy.userCanBeTracked(),s=["gacid","gacid_source","fbp","ga4SessionId","ga4SessionNumber"],l=["gclid","fbc","gbraid","wbraid"],d=["fbclid","gclid","wbraid","gbraid"],p=()=>{let e=t("pmStorage")||null;if(e)try{e=JSON.parse(decodeURIComponent(e))}catch(e){o="pmStorage",document.cookie=o+"=; Max-Age=-99999999;",r("WARN",`pid: ${_pm_pid}. An error ocurred while parsing the pmStorage cookie in the Shopify tracking script version 2149a606c472fddd72e6b4b7e86a030e0be771ef. The cookie was deleted and functionality should continue as normal.`).then((e=>e))}var o;return e},u=()=>{const e=g(),t=a(),n=c();t||s.forEach((t=>e[t]=null)),n||l.forEach((t=>e[t]=null));const r=p(),i=((e,t)=>{const o=e,n=["url","referer","ts","cua","cc_statistics","cc_marketing","em_md5","em_sha256"];return Object.keys(e).forEach((r=>{n.includes(r)||(e[r]?o[r]=e[r]:t&&t[r]&&(o[r]=t[r]))})),o})(e,r);return o("pmStorage",encodeURIComponent(JSON.stringify(i))),i},g=()=>({visitSource:w(),gacid:_().id,gacid_source:_().source,gclid:S(),gbraid:f(),wbraid:b(),ga4SessionId:m(),ga4SessionNumber:h(),fbp:y(),fbc:k()}),m=()=>{const e=document.cookie.split(";").filter((e=>-1!==e.indexOf("_ga_"))).map((e=>e.trim().split("."))).filter((e=>null!=e&&void 0!==e&&"number"==typeof e.length&&e.length>=4)).map((e=>e[0].substring(4,e[0].indexOf("="))+":"+e[2])).join(",");return null!=e&&e.length>0?e:null},h=()=>{const e=document.cookie.split(";").filter((e=>-1!==e.indexOf("_ga_"))).map((e=>e.trim().split("."))).filter((e=>null!=e&&void 0!==e&&"number"==typeof e.length&&e.length>=4)).map((e=>e[0].substring(4,e[0].indexOf("="))+":"+e[3])).join(",");return null!=e&&e.length>0?e:null},f=()=>n("gbraid"),b=()=>n("wbraid"),w=()=>{const e=(e=>{const o=t("pmStorage");if(null===o)return null;const n=JSON.parse(decodeURIComponent(o));return n&&n[e]?n[e]:null})("visitSource");if(e)return e;const o=new RegExp("[?&]utm_source=([^&#]*)").exec(window.location.search),n=null===o?"":decodeURIComponent(o[1].replace(/\+/g," ")),r=new RegExp("[?&]utm_campaign=([^&#]*)").exec(window.location.search),i=null===r?"":decodeURIComponent(r[1].replace(/\+/g," ")),a=new RegExp("[?&]utm_medium=([^&#]*)").exec(window.location.search),s=null===a?"":decodeURIComponent(a[1].replace(/\+/g," "));let l=document.referrer.substring(0,2e3);const p=document.referrer.length,u=c(),g=new URLSearchParams(window.location.search);u||d.forEach((e=>g.delete(e)));let m=`${window.location.pathname}`;g.toString()&&(m+=`?${g.toString()}`),m=m.substring(0,2e3);const h=m.length;let f={utm_source:n.substring(0,100),utm_campaign:i.substring(0,100),utm_medium:s.substring(0,100),http_referrer:l,http_referrer_length:p,landingpage:m,landingpage_length:h,time:(new Date).valueOf()/1e3|0},b=encodeURIComponent(JSON.stringify(f));return b.length>4e3&&(f.http_referrer=f.http_referrer?.substring(0,1e3),null!=f.landingpage&&(f.landingpage=f.landingpage.substring(0,1e3)),b=encodeURIComponent(JSON.stringify(f))),b.length>4e3&&(f={error:"too long",time:new Date/1e3|0},b=encodeURIComponent(JSON.stringify(f))),JSON.parse(decodeURIComponent(b))},_=()=>{if(window.ga&&"function"==typeof window.ga.getAll){if(window.ga.getAll()&&window.ga.getAll().length)return{id:window.ga.getAll()[0].get("clientId"),source:"gatracker"}}else if(t("_ga"))return{id:t("_ga"),source:"gacookie"};return{id:null,source:null}},S=()=>n("gclid")||null,y=()=>t("_fbp")||null,k=()=>{const e=t("_fbc")||null,o=n("fbclid")||null;if(!e&&o){return`fb.${1}.${Math.floor(Date.now()/1e3)}.${o}`}return e||null};const C=async e=>{const n=t("pmPreviousRequest"),r=function(e){const t=`${_pm_root}/ss/shopify.php`,o=u(),n={v:1};return n.pid=_pm_pid,n.cv="2149a606c472fddd72e6b4b7e86a030e0be771ef",n.cart_token=e,window.shopifyCheckoutId&&(n.checkout_id=window.shopifyCheckoutId),n.gclid=o?.gclid,n.gacid=o?.gacid,n.gacid_source=o?.gacid_source,n.gbraid=o?.gbraid,n.wbraid=o?.wbraid,n.ga4_sessionid=o?.ga4SessionId,n.ga4_sessioncount=o?.ga4SessionNumber,n.fbp=o?.fbp,n.fbc=o?.fbc,n.t=JSON.stringify(o?.visitSource),`${t}?${Object.keys(n).filter((e=>!!n[e])).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(n[e]))).join("&")}`}(e);n!==r&&(o("pmPreviousRequest",r,999),await fetch(r))},x=async()=>{try{if(!a()&&!c())return;await fetch("/cart/update.js",{method:"post",body:"attributes[__profitmetrics_ignore]=ignore",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((async e=>await e.json())).then((async e=>{await C(e.token),e.attributes.__profitmetrics_ct&&e.token===e.attributes.__profitmetrics_ct||await fetch("/cart/update.js",{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`attributes[__profitmetrics_ct]=${e.token}`})}))}catch(e){const t=`pid: ${_pm_pid}. Error in carttoken set -> /ss/shopify.php chain. Error message: ${e}.`;await r("ERROR",t)}};(()=>{const t=navigator.userAgent.toLowerCase();return e.some((e=>t.indexOf(e.toLowerCase())>=0))})()||(window.Shopify?.loadFeatures?window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],(e=>{e||x().then((e=>e))})):x().then((e=>e)),document.addEventListener("trackingConsentAccepted",(async()=>{x().then((e=>e))})))}();